generate-package-skill
Skill308 starsChanged 7 months agoMITView on GitHub
Generate or update an Agent Skill that teaches consumers one npm or local package the user maintains, including framework modules and wrappers. Tests each example against the installed version. Use when a maintainer asks for a package Skill, a SKILL.md for their library, or a Skill update after a release.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bombshell-dev-clackSkill
- microsoft-typescriptSkill
- sindresorhus-log-updateSkill
- sqlite-vec-skilldSkill
- unjs-cittySkill
- generate-project-skillSkill
- review-skillSkill
- skilldSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 17 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Write a short Skill that stops an Agent from misusing one package version.
- Very specific: line 15
Write one Skill per installed package, unless a second package has distinct users.
- Distinctive: line 21
Read the manifest, every exported entry point, and the public types.
- Distinctive: line 23
If the package wraps, re-exports, or peers on another package, read the types or tagged source of the version the consumer gets, never a …
- Distinctive: line 24
Read the current official docs and examples, and release notes only for breaking changes and removed APIs.
- Distinctive: line 26
Test an existing Skill's claims.
- Very specific: line 32
Create a minimal consumer fixture outside the package source.
- Very specific: line 33
Before packing, build the package and its native code (NAPI, WASM).
- Very specific: line 36
Use consumer defaults. The package repository's config and fixtures can turn them off.
- Distinctive: line 39
Run each example you include.
- Very specific: line 40
Test each mode: framework modes, export conditions (node, workerd, edge-light, browser, CDN or IIFE build), and each CLI binary with a …
- Distinctive: line 43
Read dev warnings in the dev log, prerender results in build output, and runtime results from the production server.
- Very specific: line 44
If a trap says nothing happens, run it and confirm the silence.
- Very specific: line 48
Never kill by port or with pkill -f: another Agent can own that process.
- Distinctive: line 50
If documentation and behaviour disagree, write the behaviour and report the mismatch.
- Distinctive: line 51
Keep an unrunnable example only when the types prove it.
- Distinctive: line 53
Do not fix the package or its docs in the Skill change.
- Distinctive: line 80
Write each code block as a complete module with imports.
- Very specific: line 83
Keep one file. Move a topic to references/<topic>.md only past about 40 lines and when under a third of tasks need it.
- Very specific: line 85
Write at most eight reference files.
- Distinctive: line 86
Never include credentials, caches, build output, or dependency directories.
- Distinctive: line 98
Keep one source Skill for compatible Agents.
- Very specific: line 99
Use capability descriptions instead of provider-specific tool names.
- Very specific: line 100
Ask for inputs explicitly.
- Distinctive: line 103
If a required capability is unavailable, report it and stop that dependent step.
- Distinctive: line 104
Never invent evidence or silently skip a required check.
- Distinctive: line 106
Check a matching task, an unrelated task, and a missing-input task.
- Distinctive: line 107
When available, use a fresh session in each Agent the user asks to support.
- Very specific: line 123
If the package ships the Skill, add its directory to files in package.json.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Generate a package Skill
Write a short Skill that stops an Agent from misusing one package version. The reader knows the language, the framework, and the domain. Write only what it would get wrong.
Inputs
Take a package name, directory, or prepared source. Ask for the destination only when it is missing.
In a monorepo, put the Skill in the published package directory.
Write one Skill per installed package, unless a second package has distinct users.
assets/ holds the Harness request. A direct run ignores it.
1. Research
- Record the exact package version.
- Read the manifest, every exported entry point, and the public types.
- For a framework module, read what setup registers: auto-imports, components, the config key and defaults, hooks, server routes.
- If the package wraps, re-exports, or peers on another package, read the types or tagged source of the version the consumer gets, never a default branch.
- Read the current official docs and examples, and release notes only for breaking changes and removed APIs.
Test an existing Skill's claims; do not copy its layout.
2. Test the examples
Observed behaviour beats documentation.
- Create a minimal consumer fixture outside the package source. Install the recorded version, or link the local build.
Before packing, build the package and its native code (NAPI, WASM);
prepackcan need them. Pack with the repository's package manager:npm packleaves pnpmcatalog:versions. Install only the package and documented peers. A resolution error is a finding. - Use consumer defaults. The package repository's config and fixtures can turn them off.
In Nuxt, keep test modules out of
modules/; Nuxt registers every module there. One fixture page can exercise many examples. - Run each example you include. Compare output with the claim: HTML, return values, type errors, build logs, exit codes, report files.
Test each mode: framework modes, export conditions (
node,workerd,edge-light,browser, CDN or IIFE build), and each CLI binary with a config file and with flags. Wrap every run intimeout 120. Grep the package for agent and CI detection, such asCLAUDECODEorCI; unset each variable it reads withenv -u VAR. Read dev warnings in the dev log, prerender results in build output, and runtime results from the production server. If a trap says nothing happens, run it and confirm the silence. To fetch from a server, run scripts/serve-fixture.mjs in the fixture:node SKILL_DIR/scripts/serve-fixture.mjs --fetch / -- node .output/server/index.mjs. For a binary, use--fetch-raw PATH --out DIR.DIR/responses.jsonlists each status and content type. Without--fetch, it holds the server until SIGTERM. Background it with your tool's option;&andnohupdie with the shell call. Never kill by port or withpkill -f: another Agent can own that process. In a browser, set a desktop user agent; a package can treatHeadlessChromeas a bot. - If documentation and behaviour disagree, write the behaviour and report the mismatch.
- Keep an unrunnable example only when the types prove it; report it untested.
Do not fix the package or its docs in the Skill change.
3. Write
Include:
- Setup that differs from the framework default, such as a required config key.
- What the package does automatically, and how to turn it off.
- Traps: silent failures, plausible wrong calls, documentation mismatches, version limits.
- One small example per common task the types do not make obvious.
- Breaking changes an Agent trained on an older version would repeat: old call, new call.
- A deploy section, such as CI cache or Cloudflare, when most traps live there.
Cut:
- Self-explanatory config options; link the config reference. Keep a table when values are the API, such as priorities.
- Internals the consumer cannot act on, such as tree shaking.
- Changelog paraphrase, fixed bugs, release history.
- Generic debug advice, such as "view source" or public validators.
path:linecitations. Put evidence in the report.- Any second copy of content, such as a list repeating inline reference links.
Shape:
- Name the package and tested version in the first paragraph, not the frontmatter.
- Order, dropping empty sections: setup, automatic behaviour, common tasks, integrations, traps, version limits, config, debug.
- A config example that is a common task goes there; the config section only lists options.
- Write each code block as a complete module with imports. ESLint can lint fenced code.
- A trap detailed in a reference gets one linking line in traps.
- Aim for 150 lines and about 2,000 tokens in
SKILL.md. Never exceed 500 lines. - Keep one file. Move a topic to
references/<topic>.mdonly past about 40 lines and when under a third of tasks need it. - Link each reference from
SKILL.md, one level deep. A reference over 100 lines starts with contents. - Write at most eight reference files. Add
scripts/only when running code beats reading it. - Never include credentials, caches, build output, or dependency directories.
The frontmatter contains only name and description.
The name uses lowercase letters, numbers, and single hyphens, at most 64 characters, and matches the directory.
For a scoped package, drop the @ and replace / with a hyphen: @nuxtjs/seo becomes nuxtjs-seo.
The description, at most 1024 characters in third person, says what the Skill does, then when to use it, in the words a user types: package name, main exports, config key, error symptoms.
Good: Add and debug Schema.org JSON-LD in Nuxt with nuxt-schema-org. Use when a task mentions structured data, rich results, useSchemaOrg, defineArticle, or the schemaOrg config key.
4. Check and report
Cross-Agent portability
Keep one source Skill for compatible Agents. Keep their discovery paths outside the generated Skill.
Use capability descriptions instead of provider-specific tool names.
Ask for inputs explicitly; do not depend on $ARGUMENTS, hooks, or dynamic context injection.
Resolve bundled files from the Skill directory and consumer commands from the consumer project root.
Name script runtimes, binaries, network access, and credential requirements beside their use.
If a required capability is unavailable, report it and stop that dependent step.
Never invent evidence or silently skip a required check.
Check a matching task, an unrelated task, and a missing-input task. When available, use a fresh session in each Agent the user asks to support. Record its version, model, task, output, and required permissions. Distinguish format validation, discovery, activation, and task completion. Report unavailable Agent paths untested. Package example checks do not prove cross-Agent execution.
Before finishing, confirm:
- Each example ran against the recorded version, or is reported untested.
- Each reference is linked. Delete stale files from an earlier Skill.
- The frontmatter follows the rules above.
Report to the user:
- The files and the tested version.
- Each untested example, and each mismatch: example, documented result, observed result. These are package bugs.
- The source path or documentation URL behind each version-specific rule.
- If the package ships the Skill, add its directory to
filesinpackage.json. After one build, list packed files withnpm pack --dry-run --ignore-scripts;pnpm packrejects that flag. - Replace any README or docs
skilld add <package>tip in place with the tip below. Add the badge after the others. ReplaceOWNER,REPOSITORY, andPACKAGE. If the Repository has several Skills, add/SKILLto the page and badge paths. The skilld.dev indexer skipsSKILL.mdunder test and fixture folders. The README omits the run command; the page shows it.
<a href="https://skilld.dev/gh/OWNER/REPOSITORY">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://skilld.dev/b/OWNER/REPOSITORY?theme=dark">
<source media="(prefers-color-scheme: light)" srcset="https://skilld.dev/b/OWNER/REPOSITORY?theme=light">
<img alt="Skill repository on skilld.dev" src="https://skilld.dev/b/OWNER/REPOSITORY?theme=light">
</picture>
</a>> [!TIP]
> Using an AI agent? Get the PACKAGE Skill on [skilld.dev/gh/OWNER/REPOSITORY](https://skilld.dev/gh/OWNER/REPOSITORY).For a direct run, show the files for review, or open a pull request if asked. Replace an existing Skill only with user approval. A direct run has no Harness checks; never claim it passed them.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

