agent-customization
Skill100 starsChanged 6 months agoMITView on GitHub
LLM-powered injection of project context into installed agent templates via `aspens customize agents`
2 other projects use a version of this.
Adopted by
Most recently taken up by
- informaticolorenzo/skill-maestra-publictheir own version, first seen Nov 8, 2026
- microsoft/vscodetheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- microsoft/vscode★ 195ksame name
- informaticolorenzo/skill-maestra-public★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- architectureSkill
- baseSkill
- claude-runnerSkill
- cli-shellSkill
- codex-supportSkill
- doc-impactSkill
- doc-syncSkill
- import-graphSkill
- repo-scanningSkill
- save-tokensSkill
- skill-generationSkill
- template-librarySkill
- agent-customizationSkill
- baseSkill
- claude-runnerSkill
- cli-shellSkill
- codex-supportSkill
- doc-impactSkill
- doc-syncSkill
- import-graphSkill
- repo-scanningSkill
- save-tokensSkill
- skill-generationSkill
- template-librarySkill
The file
Files
You are working on agent customization — the feature that reads a project's skills and AGENTS.md, then uses Claude CLI to inject project-specific context into generic agent files in .claude/agents/.
Domain purpose
aspens customize agents makes generic, bundled agent templates project-aware. It pulls the repo's skills + AGENTS.md as ground truth and asks Claude to add a tech-stack line, 3-5 project conventions, and real commands into each agent — without touching the agent's core logic.
Business rules / invariants
- Claude-only feature. Throws
CliErrorfor Codex-only repos (config.targets === ['codex']). Codex CLI has no agent concept. - Base skill is required. Pre-flight throws
CliError("Run 'aspens doc init' first — base skill is required for agent context.")if.agents/skills/base/SKILL.mdis missing. - Skills (
.claude/skills/**) are the single source of truth for project context. The prompt must not invent other context directories. - Read-only tools only. Claude is invoked with
allowedTools: ['Read', 'Glob', 'Grep']— no edits/writes from the LLM itself. - Output paths restricted to
.claude/.parseFileOutput()rejects anything else;writeSkillFiles(..., { force: true })does the actual write.
Non-obvious behaviors
- Frontmatter preservation is split across LLM + code. The prompt instructs Claude to preserve YAML frontmatter verbatim (including NOT adding a
skills:line). ThenmaybeInjectBaseSkill()post-processes each returned file to addskills: [base]into the frontmatter — this keeps agents valid even when installed viaaspens add agentwithout a priordoc init. --resetsemantics: without--reset, agents that already declareskills:are left alone; with--reset, any existingskills:line is overwritten toskills: [base]. Used to roll out v0.8 upgrades to previously-customized agents.## Project contextblock is verbatim-preserved by the prompt — it carries conditional read instructions for code-map / domain skills.- AGENTS.md is truncated at 3000 chars in
gatherProjectContext(); skills are passed in full. - Agent discovery:
findAgents()recursively walks.claude/agents/, extractsname:via regex, falls back to filename if missing. - Default timeout 300s via
resolveTimeout(options.timeout, 300);ASPENS_TIMEOUTenv var honored with warning on invalid value.
Critical files (purpose, not inventory)
src/commands/customize.js— orchestrator: preflight, agent discovery, context gathering, per-agent Claude calls, post-LLMskills: [base]injection, write.src/prompts/customize-agents.md— system prompt; enforces frontmatter +## Project contextpreservation and bans file-inventory / hub-ranking output.
Critical Rules
- Never let the LLM emit a
skills:line — the prompt forbids it and the code adds it. If you change one, change both. - Never weaken path sanitization — only
.claude/paths may be written. - Never duplicate file-inventory or hub-ranking output in customized agents — the graph hook supplies that dynamically.
- Do not bypass the base-skill preflight — agents without base context regress to generic behavior.
Last Updated: 2026-05-11
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.

