writer-function

A group of Nix functions for generating scripts, text files, configuration files, and in some cases compiled programs. A derivation is Nix's description of how to produce such an output.

In plain words
What is it for?
Use it when creating Nix packages or configurations that need generated text files, shell scripts, executable commands, combined files, or small compiled outputs.
Why use it?
It helps choose the correct writer function and avoid mistakes about output paths, executability, shell checks, and how generated programs enter the system's command path.

Skill for Claude CodeCodex

Part of the nix-tasuke plugin — 6 skills, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ncaq/konoka/writer-function
Any agent
npx skills add ncaq/konoka --skill writer-function
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code, Codex.

Or install nix-tasuke, the plugin that ships this one along with the rest of its 6 skills, 1 MCP server.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,385 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.01385
Opus 5 $0.00019 $0.00692
Sonnet 5 $0.00008 $0.00277
Haiku 4.5 $0.00004 $0.00138

Measured 3d ago against content hash e3ec5b7254d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

writer-function scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

runtimeInputs = with pkgs; [ curl jq ];
plugins/nix-tasuke/skills/writer-function/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Nixのwriter系関数

ファイルやスクリプトを生成するderivationを作るための関数群です。

無印とBinサフィックスの違い

多くのwriter関数には無印版とBinサフィックス版があります。

無印(writeShellScript等)

$outがファイルそのもの。 ${myScript}でバイナリパスを直接参照できる。

Bin(writeShellScriptBin等):

$out/bin/<name>にファイルを出力しmeta.mainProgramを設定する。

lib.getExe myPkg${myPkg}/bin/<name>でパスを得る。 lib.getExeの使用を推奨します。

ファイルそのものではないので、 environment.systemPackagesruntimeInputsに入れて$PATHに載せられます。

writeShellApplicationは名前にBinが付いていませんが$out/bin/<name>に出力するためBin系と同じ構造です。

trivial-builders (pkgs.*)

nixpkgs/pkgs/build-support/trivial-builders/default.nix に定義されています。

テキスト系

  • writeTextFile: 全テキスト系writerの基盤関数
  • writeText name text: テキストファイルを生成
  • writeTextDir path text: ディレクトリ構造付きでテキストファイルを生成

汎用スクリプト系

  • writeScript name text / writeScriptBin name text: 実行可能スクリプト、シバンは手動で記述する

シェルスクリプト系

  • writeShellScript name text / writeShellScriptBin name text: シバン自動付与、構文チェックあり
  • writeShellApplication: シェルスクリプト用の最高機能writer

その他

  • writeCBin pname code: Cソースをコンパイルしてバイナリを生成
  • concatTextFile: 複数ファイルを連結
  • concatText name files: concatTextFileのラッパー
  • concatScript name files: 実行可能な連結ファイルを生成
  • writeClosure paths: ランタイム依存クロージャのパス一覧を書き出す
  • writeDirectReferencesToFile path: 直接参照のパス一覧を書き出す
  • writeStringReferencesToFile string: 文字列コンテキストの依存パスを書き出す

writers (pkgs.writers.*)

nixpkgs/pkgs/build-support/writers/scripts.nix 配下に定義されています。 各関数にBinサフィックス版があり、 $out/bin/に配置します。

基盤関数

  • makeScriptWriter: インタープリタ言語用スクリプトの基盤
  • makeBinWriter: コンパイル言語用バイナリの基盤

シェル系

  • writeBash / writeBashBin
  • writeDash / writeDashBin
  • writeFish / writeFishBin
  • writeNu / writeNuBin

スクリプト言語系

  • writeBabashka / writeBabashkaBin
  • writeGuile / writeGuileBin
  • writeJS / writeJSBin
  • writeLua / writeLuaBin
  • writePerl / writePerlBin
  • writePyPy2 / writePyPy2Bin
  • writePyPy3 / writePyPy3Bin
  • writePython3 / writePython3Bin
  • writeRuby / writeRubyBin

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 132 lines · 39 tokens per session scan A e3ec5b7254d0

Subscribe to this mod's changes

writer-function is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed 4d ago), licensed Apache-2.0. It adds 39 tokens to every session and 1,385 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

segment-docs

Reference mapping between Oh My Posh Go segment source code and MDX documentation. Use when creating, updating, or auditing segment documentation, or when reading segment Go code and needing to understand how code constructs map to user-facing options, template properties, and type representations in docs.

JanDeDobbeleer/oh-my-posh · 59 tokens

seo-backlinks

Backlink profile analysis: referring domains, anchor text distribution, toxic link detection, competitor gap analysis. Works with free APIs (Moz, Bing Webmaster, Common Crawl) and DataForSEO extension. Use when user says backlinks, link profile, referring domains, anchor text, toxic links, link gap, link building…

AgriciDaniel/claude-seo · 75 tokens

seo-image-gen

AI image generation for SEO assets: OG/social preview images, blog hero images, schema images, product photography, infographics. Powered by Gemini via nanobanana-mcp. Requires banana extension installed. Use when user says "generate image", "OG image", "social preview", "hero image", "blog image", "product photo"…

AgriciDaniel/claude-seo · 111 tokens

seo-audit

Full website SEO audit with parallel subagent delegation. Crawls up to 500 pages, detects business type, delegates to up to 15 specialists (8 always + 7 conditional), generates health score. Use when user says audit, full SEO check, analyze my site, or website health check.

AgriciDaniel/claude-seo · 64 tokens

wiki-lint

Run a deterministic, read-only health check on an Obsidian wiki. Use for lint, vault health check, audit wiki health, find orphans, find dead links, frontmatter audit, provenance audit, or wiki audit. Reports graph, link, frontmatter, provenance-ledger, empty-section, and stale-index findings; it does not reason…

AgriciDaniel/claude-obsidian · 79 tokens