Agent skill

Skill Generation

by aspenkit in aspenkit/aspens

LLM-powered generation pipeline for Claude Code skills and AGENTS.md — doc-init command, prompt system, context building, and output parsing

MITAuto-check passedAgent Workflows

Install Skill Generation

skills CLI
$ npx skills add aspenkit/aspens --skill skill-generation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aspenkit/aspens skill-generation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aspenkit/aspens.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/skill-generation .claude/skills/skill-generation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
skill-generation
GitHub stars
102
Token cost
~2.3k tokens
SKILL.md length
963 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

LLM-powered generation pipeline for Claude Code skills and AGENTS.md — doc-init command, prompt system, context building, and output parsing

  • Tasks that involve Agent instruction files
  • SKILL.md covers Domain purpose, Critical files (purpose, not…, Key Concepts and Critical Rules, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Skill Generation is an agent skill from aspenkit/aspens. LLM-powered generation pipeline for Claude Code skills and AGENTS.md — doc-init command, prompt system, context building, and output parsing

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent instruction files. The repository describes itself as: Your CLAUDE.md stopped working at 200 lines. Generate scoped skill files from your import graph, auto-sync on every commit. Claude Code, Codex and OpenCode. The licence is MIT.

When your agent uses it

  • Tasks that involve Agent instruction files

Example prompts

  • “/skill-generation”

What it can do on your machine

Read from SKILL.md and the folder at commit 8dde826. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Skill Generation loads about 2.3k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 963 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aspenkit/aspens at commit 8dde826, republished under its MIT licence (© aspenkit). 963 words, ~2,255 tokens.

Download SKILL.mdSave it as .claude/skills/skill-generation/SKILL.md (or your agent's skills folder).
name
skill-generation
description
LLM-powered generation pipeline for Claude Code skills and AGENTS.md — doc-init command, prompt system, context building, and output parsing
triggers.files
src/commands/doc-init.js, src/lib/context-builder.js, src/prompts/**/*
triggers.keywords
doc-init, generate skills, discovery agents, chunked generation, recommended

You are working on aspens' skill generation pipeline — the system that scans repos and uses Claude/Codex CLI to generate skills, hooks, and instructions files.

Domain purpose

aspens doc init orchestrates a multi-step LLM pipeline that turns a scanned repo + import graph into a base skill, per-domain skills, and an instructions file (AGENTS.md or AGENTS.md). Generation is always done in Claude-canonical format and transformed for other targets afterwards. The end product is what other coding agents (and aspens' own hooks) consume to stay grounded in the repo.

Critical files (purpose, not inventory)

  • src/commands/doc-init.js — the pipeline orchestrator (backend → target → scan → graph → discovery → strategy → mode → generate → validate → transform → write → hooks → recommended extras → config)
  • src/lib/runner.js — runLLM(), loadPrompt(), parseFileOutput(), validateSkillFiles() shared across all LLM-driven commands
  • src/lib/skill-writer.js — writes parsed files, generates skill-rules.json, injects domain bash patterns, merges settings.json
  • src/lib/skill-reader.js — parses skill frontmatter, activation patterns, keywords (consumed by skill-writer)
  • src/lib/git-hook.js — installGitHook() / removeGitHook() for post-commit auto-sync (monorepo-aware)
  • src/lib/timeout.js — resolveTimeout() for auto-scaled + user-override timeouts
  • src/lib/target.js / src/lib/backend.js / src/lib/target-transform.js — target/backend resolution and Claude→other-target transform
  • src/prompts/ — doc-init.md, doc-init-domain.md, doc-init-claudemd.md, discover-domains.md, discover-architecture.md, plus partials/ (skill-format, preservation-contract, examples)

Key Concepts

  • Pipeline steps: (1) detect backends (2) backend selection (3) target selection (4) scan + graph (5) existing docs discovery check (6) parallel discovery agents (7) strategy (8) mode (9) generate (10) validate (11) transform for non-Claude targets (12) show files + dry-run (13) write (14) install hooks (Claude-only) (15) recommended extras (save-tokens, agents, git hook) (16) persist config to .aspens.json
  • Early config persistence: Target/backend config is written to .aspens.json before generation starts (after step 4), so a failed generation run still records the user's explicit target/backend choice. saveTokens from existing config is preserved. Final writeConfig at step 16 adds saveTokens from recommended install.
  • --recommended flag: Skips interactive prompts with smart defaults. Reuses existing target config from .aspens.json. Auto-selects backend from target. Defaults strategy to improve when existing docs found. Auto-picks discovery skip when docs exist. Auto-selects generation mode based on repo size. Also installs save-tokens, bundled Claude agents, dev/ gitignore entry, and doc-sync git hook (step 15).
  • Recommended extras (step 15): When --recommended and not --dry-run: calls installSaveTokensRecommended() from save-tokens.js (if Claude target), copies all bundled agent templates to .claude/agents/ (skips existing) via installRecommendedClaudeAgents(), adds dev/ to .gitignore, installs doc-sync git hook if not present. Summary lines printed after.
  • Backend before target: Backend selection (step 2) happens before target selection (step 3). If both CLIs available, user picks backend first, then targets. Pre-selects matching target in the multiselect. With --recommended, backend is inferred from existing target config.
  • Canonical generation: All prompts receive CANONICAL_VARS (hardcoded Claude paths: .claude/skills, skill.md, AGENTS.md, .claude). Generation always produces Claude-canonical format regardless of target. Non-Claude targets are produced by post-generation transform via transformForTarget().
  • Incremental writing (chunked mode): When mode === 'chunked' and not dry-run, generated files are written to disk as each chunk completes instead of waiting until the end. User is prompted to confirm incremental writes before generation starts. Helper functions: validateGeneratedChunk() validates and strips truncated files per chunk; buildOutputFilesForTargets() handles multi-target transform; writeIncrementalOutputs() deduplicates and writes changed files. Tracks written content via incrementalWriteState (contentsByPath + resultsByPath Maps). When incremental mode is active, post-generation validation/transform/confirm/write steps are skipped (already done per-chunk).
  • parseLLMOutput with strict single-file fallback: Codex often returns plain markdown without <file> tags. parseLLMOutput(text, allowedPaths, expectedPath) only wraps tagless text as the expected file for true single-file prompts (exactly one exactFile in allowedPaths, no dirPrefixes). Multi-file prompts require proper <file> tags.
  • Existing docs reuse: When existing Claude docs are found and strategy is improve, loadExistingDocsContext() inlines them as ## Existing Docs (improve these — preserve hand-written rules...) into the prompt. chooseReuseSourceTarget() decides whether Claude or Codex docs are the source. Supports cross-target reuse (e.g. Claude docs → Codex output).
  • Domain reuse helpers: loadReusableDomains() tries loadReusableDomainsFromRules() first (reads skill-rules.json), falls back to findSkillFiles() with extractKeyFilePatterns() parsing ## Key Files blocks.
  • Config persistence with target merging: Uses mergeConfiguredTargets() to avoid dropping previously configured targets. writeConfig now also persists saveTokens config from the recommended install.
  • Hook installation: Only for targets with supportsHooks: true (Claude). installHooks() generates skill-rules.json, copies hook scripts, injects generated domain patterns into post-tool-use-tracker.sh via # BEGIN/END detect_skill_domain markers, merges settings.json (backs up existing to .bak).
  • Git hook offer: With --recommended, git hook is auto-installed (no prompt). Without --recommended, interactive prompt offered. Detection looks for the marker string aspens doc-sync hook (<rel>) in .git/hooks/post-commit.
  • Discovery agents: Two LLM calls run in parallel — discover-domains (hub files + domain clusters) and discover-architecture (hub files + ranked + hotspots). Findings are merged into discoveryFindings and parsed; domain-specific slices are injected into each domain prompt as ## Discovery Findings for {domain}.
Show full SKILL.md (218 more words)Show less

Critical Rules

  • Base skill + instructions file are essential — pipeline retries up to 2× with format-correction prompts when <file> tags are missing. Domain skill failures are acceptable (user retries with --domains).
  • improve strategy preserves hand-written content — LLM must read existing skills first and not discard human-authored rules. The preservation-contract partial enforces this in every prompt.
  • Discovery runs before user prompt — domain picker shows discovered domains, not scanner directory names. Falls back to scanner domains if discovery fails.
  • PARALLEL_LIMIT = 3 — domain skills generate in batches of 3 concurrent calls. Base skill always sequential first. Instructions file always sequential last.
  • CliError, not process.exit() — all error exits throw CliError; cancellations return early.
  • --hooks-only is Claude-only — hardcoded to TARGETS.claude regardless of config.
  • Incremental write deduplication — writeIncrementalOutputs() skips files whose content hasn't changed since last write, using contentsByPath Map for tracking. Directory-scoped AGENTS.md files (path ends with /AGENTS.md but not the root AGENTS.md) go through writeTransformedFiles(), all others through writeSkillFiles().
  • Read-only LLM tools — generation calls always pass allowedTools: ['Read', 'Glob', 'Grep']. The LLM explores the repo itself; aspens never lets it write.
  • AGENTS.md post-processing — generated instructions files are run through ensureRootKeyFilesSection(), syncSkillsSection(), and syncBehaviorSection() so aspens owns the Skills list and Behavior block deterministically; prompts explicitly forbid the LLM from emitting these sections.

References

  • Prompts: src/prompts/doc-init*.md, src/prompts/discover-*.md
  • Partials: src/prompts/partials/skill-format.md, src/prompts/partials/preservation-contract.md, src/prompts/partials/examples.md

Last Updated: 2026-05-11

© aspenkit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/skill-generation of aspenkit/aspens.

Open the folder on GitHubat commit 8dde826

Compare with similar skills

Skill Generation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Skill Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Skill Generation this skillaspenkit/aspens102—~2.3kAutomated safety check: PassMIT
Using Agent Skillsaddyosmani/agent-skills102k4 repos~2.4kAutomated safety check: PassMIT
Claude ReflectBayramAnnakov/claude-reflect1.7k2 repos~627Automated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~12kAutomated safety check: PassCC-BY-4.0
Writing For Agentsbestofjs/bestofjs3.1k17 repos~2.7kAutomated safety check: PassMIT

Similar skills

  • Using Agent Skills

    addyosmani/agent-skills

    Meta-skill for choosing which workflow skill fits the task at hand, plus always-on habits: surface assumptions, stop on confusion, push back, keep it simple and stay in scope.

    102k GitHub starsUsed in 4 repos~2.4k tokens
    Agent WorkflowsAuto-check passed
  • Claude Reflect

    BayramAnnakov/claude-reflect

    Self-learning system that captures corrections during sessions and reminds users to run /reflect to update CLAUDE.md.

    1.7k GitHub starsUsed in 2 repos~627 tokens
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~12k tokens
    Agent WorkflowsAuto-check passed
  • Writing For Agents

    bestofjs/bestofjs

    Writing documents for agents. An agent skill from bestofjs/bestofjs.

    3.1k GitHub starsUsed in 17 repos~2.7k tokens
    Agent WorkflowsAuto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from aspenkit/aspens

All 12 skills in this repo
  • Injects a project's own skills and AGENTS.md content into generic bundled agent template files, adding a tech-stack line and real conventions without touching an agent's core logic.

    102 GitHub stars~898 tokensUpdated 25 days ago
    Auto-check passed
  • Orientation to the aspens codebase for agents working on the CLI itself: its Node.js stack, commands, module layout and debug settings.

    102 GitHub stars~1.6k tokensUpdated 25 days ago
    Auto-check passed
  • Aspens CLI Shell

    aspenkit/aspens

    Project context for the aspens CLI entry point: Commander wiring, the welcome screen, missing-hook warnings, CliError exit handling and the public programmatic exports.

    102 GitHub stars~1.1k tokensUpdated 25 days ago
    Auto-check passed
  • Explains how the aspens generator routes output to Claude Code or Codex CLI targets and transforms generated skills and instruction files between their formats.

    102 GitHub stars~1.9k tokensUpdated 25 days ago
    Auto-check passed
  • Doc Impact

    aspenkit/aspens

    Context health analysis — freshness, domain coverage, hub surfacing, drift detection, LLM-powered interpretation, and auto-repair for generated agent context

    102 GitHub stars~1.3k tokensUpdated 25 days ago
    Auto-check passed
  • Doc Sync

    aspenkit/aspens

    Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook

    102 GitHub stars~1.8k tokensUpdated 25 days ago
    Auto-check passed

Categories

Questions about Skill Generation

What does Skill Generation do?

LLM-powered generation pipeline for Claude Code skills and AGENTS.md — doc-init command, prompt system, context building, and output parsing. Skill Generation is an agent skill from aspenkit/aspens.

When should I use Skill Generation?

Skill Generation fits situations like: tasks that involve Agent instruction files.

How do I install Skill Generation in Claude Code?

Run `npx skills add aspenkit/aspens --skill skill-generation -a claude-code`. Or copy the skill folder (.agents/skills/skill-generation in aspenkit/aspens) into .claude/skills/skill-generation in your project. Claude Code loads it when a task matches its description.

How do I install Skill Generation in Codex?

Run `npx skills add aspenkit/aspens --skill skill-generation -a codex`. Or copy the skill folder (.agents/skills/skill-generation in aspenkit/aspens) into .agents/skills/skill-generation in your project. Codex loads it when a task matches its description.

Can I use Skill Generation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aspenkit/aspens --skill skill-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skill-generation, .gemini/skills/skill-generation, .github/skills/skill-generation and .opencode/skills/skill-generation in your project.

What does Skill Generation need to run?

SKILL.md names no scripts, command-line tools or credentials: Skill Generation is instructions for the agent only.

Does Skill Generation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Skill Generation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Skill Generation use?

Skill Generation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Skill Generation use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Skill Generation?

Skills that share tags, products or a category with Skill Generation: Using Agent Skills (addyosmani/agent-skills, 102k stars), Claude Reflect (BayramAnnakov/claude-reflect, 1.7k stars), Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars) and Task Observer (rebelytics/one-skill-to-rule-them-all, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Skill Generation?

aspenkit (a GitHub organization) maintains it in aspenkit/aspens, which has 102 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on September 12, 2026.

Source: aspenkit/aspens on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.