Install
$ agentstack add skill-aspenkit-aspens-template-library ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
You are working on the template library — bundled agents, slash commands, hooks, and settings that users browse and install into their repos.
Domain purpose
aspens add [name] copies curated templates into a consumer repo's .claude/ directories so users get working agents, slash commands, hooks, and settings without authoring them. The same template tree is reused by aspens doc init (hook installation, recommended agents) and aspens save-tokens (handoff tooling). Custom skills can also be scaffolded blank or LLM-generated from a reference doc.
Key Concepts
- Four resource types for
add:agent→.claude/agents,command→.claude/commands,hook→.claude/hooks. A fourth typeskillis handled separately (not template-based). - Save-tokens templates:
save-tokens.mjsis the runtime entry point for all three hook entry points (statusline, prompt-guard, precompact). Shell wrappers (save-tokens-*.sh) resolve project dir and delegate to the.mjsfile. Slash commands (save-handoff.md,resume-handoff.md,resume-handoff-latest.md) provide user-invokable handoff management. These are installed byaspens save-tokensoraspens doc init --recommended, not byaspens add. - Codex-only restriction:
add agent,add command, andadd hookthrowCliErrorfor Codex-only repos. Skills work with both targets. - Target-aware skill commands:
addSkillCommandandgenerateSkillFromDocresolve the active target viaresolveSkillTarget(config). Skill paths usetarget.skillsDirandtarget.skillFilename. - Backend-aware generation:
generateSkillFromDocusesrunLLM()to dispatch to Claude or Codex based on config. - Hook templates (monorepo-aware): Shell hooks compute
PROJECT_DIRfrom the script's own location (cd "$SCRIPT_DIR/../.." && pwd) and pass it asASPENS_PROJECT_DIRto.mjscounterparts. Save-tokens shell hooks follow the same pattern. - Settings template quoting: Hook commands in
settings.jsonare wrapped in double quotes for shell safety. doc inithook installation (step 13): Generatesskill-rules.json, copies hook files, generatespost-tool-use-tracker.shwith domain patterns, mergessettings.jsonwith backup.doc init --recommendedextras (step 15): Copies all bundled agent templates to.claude/agents/(skips existing), addsdev/to.gitignore.- Template discovery:
listAvailable()reads template dir, filters.md/.shfiles, regex-parsesname:anddescription:. - No-overwrite policy:
addResource()skips files that already exist. Same foraddSkillCommand. - Plan/execute gitignore: Adding
planorexecuteagents auto-addsdev/to.gitignorefor plan storage.doc init --recommendedalso ensuresdev/in.gitignore. - Base-skill warning for agents:
addResource()prints a non-fatal yellow warning when installing an agent if.claude/skills/base/skill.mdis missing, prompting the user to runaspens doc init. The agent still installs.
Critical files (purpose, not inventory)
src/commands/add.js— Entry point foraspens add; dispatches to resource copy, blank skill scaffold, or LLM skill generation.src/templates/agents/*.md— Agent persona templates copied as-is into.claude/agents/.src/templates/commands/*.md— Slash command templates (includes handoff commands installed bysave-tokens).src/templates/hooks/— Hook scripts (skill-activation-prompt.{sh,mjs},graph-context-prompt.{sh,mjs},post-tool-use-tracker.sh,save-tokens.mjs,save-tokens-{statusline,prompt-guard,precompact}.sh).src/templates/settings/settings.json— Default Claude Code settings with hook wiring; merged into the consumer repo's settings.src/prompts/add-skill.md— System prompt foradd skill --fromLLM generation.
Critical Rules
- Template files must contain
name:anddescription:lines parseable by regex. - Only
.mdand.shextensions are discovered bylistAvailable()..mjsfiles are copied bydoc initandsave-tokensdirectly, not byadd. - The templates dir resolves from
src/commands/viajoin(__dirname, '..', 'templates')— movingadd.jsbreaks template resolution. - Skill names are sanitized to lowercase alphanumeric + hyphens. Invalid names throw
CliError. - Commands throw
CliErrorfor expected failures instead of callingprocess.exit(). - Reference docs passed to
add skill --fromare truncated to 50,000 chars before being handed to the LLM.
References
- Customize flow:
.claude/skills/agent-customization/skill.md - Save-tokens install:
.claude/skills/save-tokens/skill.md
Last Updated: 2026-05-11
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: aspenkit
- Source: aspenkit/aspens
- License: MIT
- Homepage: https://www.npmjs.com/package/aspens
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.