

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Copilot Instructions23## What This Project Does45`aspens` is a CLI tool that generates and maintains AI-ready documentation (skills and guidelines) for any codebase. It scans a repo's tech stack, then uses Claude to produce structured markdown "skill files" that Claude Code loads automatically when working in that codebase.67```bash8aspens scan # detect tech stack (current dir)9aspens doc init --dry-run # preview generated skills10aspens doc init --mode chunked # generate one domain at a time11aspens doc sync --commits 3 # update skills from last 3 commits12aspens doc sync --install-hook # auto-sync on every commit13```1415## Project Setup1617```bash18npm install # installs commander, @clack/prompts, picocolors19npm link # makes `aspens` available globally for testing20```2122No build step. No test runner configured yet — `tests/` is empty.2324## Architecture2526```27bin/cli.js # entrypoint — welcome screen + subcommands via commander28src/29 index.js # barrel exports30 commands/31 scan.js # pretty/JSON output of scanner results32 doc-init.js # full pipeline: scan → mode select → Claude → write33 doc-sync.js # diff-based skill updates + git hook installer34 add.js # placeholder (Phase 4)35 lib/36 scanner.js # deterministic tech stack detection (no LLM)37 context-builder.js # assembles repo context (used by doc-sync, available for API mode)38 runner.js # wraps `claude -p` CLI; prompt loading; output parsing; path sanitization39 skill-writer.js # writes parsed {path, content} files to disk40 prompts/41 doc-init.md # all-at-once init prompt (tool-first: "read before writing")42 doc-init-domain.md # single domain skill prompt (for chunked mode)43 doc-init-claudemd.md # CLAUDE.md generation prompt44 doc-sync.md # sync prompt (diff → skill updates)45 partials/ # skill-format.md, guideline-format.md, examples.md46```4748### `doc init` Pipeline49501. `scanRepo()` — detect languages, frameworks, structure, domains, entry points512. User picks mode: all-at-once / chunked / pick domains / base-only523. User picks strategy for existing docs: improve / rewrite / skip534. `loadPrompt()` — resolve `{{partial-name}}` and `{{varName}}` in the template545. `runClaude()` — spawn `claude -p` with `--allowedTools Read,Glob,Grep` — Claude explores the repo itself556. `parseFileOutput()` — extract `<file path="...">content</file>` blocks from Claude's response567. `writeSkillFiles()` — mkdir + write, respecting `--force` / `--dry-run`5758### `doc sync` Pipeline59601. Check prerequisites (git repo, .claude/skills/ exists)612. Get git diff for last N commits623. Map changed files → affected skills (via activation pattern matching, generic segments filtered)634. Send diff + existing skills to Claude with Read/Glob/Grep tools645. Claude updates only affected skills, outputs nothing if no changes needed656. Write updated files (force mode — sync is meant to be automated)6667## Key Conventions6869### ES Modules70The project uses `"type": "module"` — all files use `import`/`export`, no `require()`.7172### Path Handling73Always resolve to absolute paths with `path.resolve()` / `path.join()`. Use `path.relative()` for display and stored paths. Never pass raw user-provided paths without resolving first.7475### Output Parsing76Claude emits files as `<file path="...">content</file>`. `parseFileOutput()` handles this (primary) and an HTML comment fallback. Paths are validated by `sanitizePath()`: no `..`, no leading `/`, must be exactly `CLAUDE.md` or start with `.claude/`.7778### Prompt Templates79Templates live in `src/prompts/`. `{{skill-format}}` in a template resolves to the full content of `src/prompts/partials/skill-format.md`. Other `{{varName}}` tokens are substituted from the `vars` object passed to `loadPrompt()`. Partials are resolved before variables.8081### Claude CLI Invocation82`runner.js` spawns `claude -p` with `--allowedTools Read,Glob,Grep` — read-only tools so Claude can explore the codebase. For `--verbose` mode, uses `--output-format stream-json` to show real-time activity. Handles timeout (manual timer + SIGTERM), rate-limit detection, and non-zero exits.8384### Interactive UI85Use `@clack/prompts` for all user-facing interaction (spinners, confirms, selects, multiselects). Use `picocolors` for inline color. `--mode` and `--strategy` flags allow non-interactive/CI usage.8687### Error Handling88Throw descriptive errors with remediation hints. Commands call `process.exit(1)` on unrecoverable failures. File reads use try/catch and return `null` on failure. Doc init falls back to chunked mode on timeout.8990## Skill File Format9192Generated skills use YAML frontmatter followed by structured markdown:9394```markdown95---96name: domain-name97description: One-line description98---99100## Activation101Triggers when editing these files:102- `**/pattern*.js`103104---105106You are working on **description**.107108## Key Files109## Key Concepts110## Critical Rules111```112113Skills are written to `.claude/skills/<name>/skill.md` in the target repo. The full spec is in `src/prompts/partials/skill-format.md`.114115## Phase Status116117| Phase | Status |118|-------|--------|119| 1: Scanner + Skill Format | Done |120| 2: Doc Init (3 modes, improve/rewrite/skip, verbose, chunked) | Done |121| 3: Doc Sync (git diff, skill mapping, hook installer) | Done |122| 4: À La Carte Components | Planned |123| 5: API Mode (Anthropic SDK) | Planned |124| 6: Docs Site (Astro Starlight) | Planned |125| 7: Launch (npm publish) | Planned |126
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aspenkit/aspensAGENTS.md · 95 | AGENTS.md | teststyledeployment | 71/100 | 14 days ago | |
| aspenkit/aspensCLAUDE.md · 95 | CLAUDE.md | teststyledeployment | 71/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | today | |
| rtk-ai/rtk.github/copilot-instructions.md · 76k | Copilot instructions | buildtestlint-formatstyle+2 | 97/100 | 14 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/aspenkit-aspens-github-copilot-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.