writer-function

writer-function is a skill for Claude Code from ncaq/konoka. It costs 39 tokens per session (1,186 once invoked), scanned A, original, Apache-2.0.

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 Code

Written for Claude Code: user-invocable in frontmatter.

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

Good fit Use it when creating Nix packages or configurations that need generated text files, shell scripts, executable commands, combined files, or small compiled outputs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/writer-function
View source ↗ ncaq/konoka
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.

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.

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

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writer-function

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/writer-function/github.svg)](https://agentmods.dev/skills/ncaq/konoka/writer-function)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/writer-function"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/writer-function/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writer-function

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/writer-function"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/writer-function.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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,186 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00039 $0.01186
Opus 5.5 $0.00016 $0.00474
Sonnet 5.5 $0.00008 $0.00237
Haiku 4.5 $0.00004 $0.00119

Measured yesterday against content hash c8b3b90420cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

writer-function scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/nix-tasuke/skills/writer-function/SKILL.md · 81 lines

How it starts

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

Nixのwriter系関数

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

シェルスクリプトにはwriteShellApplicationを優先する

シェルスクリプトを書く場合は、 writeShellScriptやwriteShellScriptBinよりもwriteShellApplicationを優先して使います。 以下の利点があるためです。

  • set -o errexit、set -o nounset、set -o pipefailが自動で適用されます。 bashOptionsで変えられます。
  • ビルド時にshellcheckが自動で実行されます。
  • runtimeInputsでPATHを管理できて、実行時の依存が明示されます。
  • runtimeEnvで環境変数を設定できます。

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

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

  • 無印(writeShellScriptなど): $outがファイルそのものです。 ${myScript}でファイルのパスを直接参照できます。
  • Bin(writeShellScriptBinなど): $out/bin/<name>にファイルを出力し、meta.mainProgramを設定します。 パスはlib.getExe myPkgか${myPkg}/bin/<name>で得られます。 lib.getExeのほうを推奨します。 $outがファイルそのものではないので、 environment.systemPackagesやruntimeInputsに入れて$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.*)

言語ごとのwriterは、 nixpkgs/pkgs/build-support/writers/scripts.nix に定義されています。 以下の各関数には、writeBashBinのようにBinサフィックスを付けた版があり、$out/bin/に配置します。

Read the full file on GitHub · 81 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. yesterday Changed · -51 lines c8b3b90420cb
  2. 3mo 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 yesterday), licensed Apache-2.0. It adds 39 tokens to every session and 1,186 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

writer-function compared with skills from other repositories

writer-function next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
writer-functionncaq/konokaSkill3yesterdayApache-2.0A39Claude Code
github-project-automationsecondsky/claude-skillsSkill257todayMITA45Claude Code
hono-routingsecondsky/claude-skillsSkill257todayMITA41Claude Code
api-testingsecondsky/claude-skillsSkill257todayMITA39Claude Code
bun-http-serversecondsky/claude-skillsSkill257todayMITA31Claude Code
bun-jest-migrationsecondsky/claude-skillsSkill257todayMITA25Claude Code
cloudflare-workers-migrationsecondsky/claude-skillsSkill257todayMITA49Claude Code