/agent-starter:adopt-projectfrom agent-starter
Audits an existing codebase and proposes agent-starter components (hooks, skills, CLAUDE.md, lint configs, patterns) by invasiveness tier, applying only what the developer approves.
Ships in agent-starter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use on an existing codebase. Never on a green field - that's /new-project.
An existing project has state to audit, every change is potentially destructive, and adoption must be incremental. So the flow is audit-first, merge-don't-overwrite, opt-in per component.
git checkout -b adopt/agent-starter.
Everything below is reversible by dropping the branch.Ask one at a time:
~/code/agent-starter
(only needed if files will be copied).Build a gap report before proposing anything.
Detect the stack:
package.json + tsconfig.json → TypeScript/JavaScriptpyproject.toml / setup.py / requirements.txt → PythonInventory (present as a table: component | what exists | starter offering | conflicts):
biome.json, Prettier;
ruff (ruff.toml or [tool.ruff] in pyproject), mypy/pyright configstailwindcss 4.x in package.json dependencies,
or a shadcn components.json. Either one makes the project a candidate for
the @shadcn/lint fragment (Tier 3). Record the ESLint major.minor while
here: the plugin needs 9.30+.CLAUDE.md, CLAUDE.local.md, .claude/rules/, AGENTS.md.claude/settings.json hook entries; agent-starter hooks already
installed system-wide (~/.claude/hooks/.agent-starter-version - record the
stamped version to compare against the repo VERSION)~/.claude/skills/{commit,commit-push-pr,simplify,remember,dream,new-project,adopt-project,reflect,test-audit}.
Hooks and skills are user-global, so anything already installed already
covers this project - don't re-propose it.package.json scripts.test, pytest/tox config, Makefile targets
python3 -I <repo-path>/skills/test-audit/scripts/find-test-only-exports.py .
This is informational: adoption never prunes tests.bash <repo-path>/hooks/check-codebase-health.sh
from the project root, or
find src -name '*.ts' -o -name '*.py' | xargs wc -l | sort -rn | head -20process.env / os.environ, raw
throw new Error / raise Exception)Present the menu grouped by invasiveness, with per-item conflict notes from the audit. Wait for explicit approval per item (or "all of tier N"). Nothing is applied unapproved.
VERSION) - they're user-global and already cover
this project. If stale, offer to update by re-running bash <repo-path>/install.sh
(idempotent). Otherwise run it now: it installs to ~/.claude/hooks/ and
merges the settings.json wiring with jq. Note for the developer: hooks are
user-global - they will also fire in their other projects.<repo-path>/skills/ to ~/.claude/skills/; leave already-present skills
as-is (for s in ...; do [ -d ~/.claude/skills/$s ] || cp -r <repo-path>/skills/$s ~/.claude/skills/; done).mkdir -p .harness/reflections && echo '.harness/ledger.jsonl' >> .gitignore
/reflect reads it.<repo-path>/templates/CLAUDE.md, fill in project
name and description..claude/rules/starter-patterns.md → the apply-on-touch file (Tier 4).TypeScript:
templates/biome.jsonc + templates/eslint.config.mjs
from the repo, install deps (see AGENT.md step 4 there), run on the
codebase, and report the damage. Where existing code fails a rule en masse,
downgrade that rule to warn with a ratchet note instead of fixing
hundreds of violations in the adoption branch.guides/lint-rules-for-ai.md into their config, or
(b) migrate to the starter flat config, carrying their custom rules over.templates/eslint.shadcn.mjs + npm i -D @shadcn/lint, spread into their
flat config as ...shadcnRules. Adapt settings.shadcn.ui and the
**/components/ui/** override to where their components live. Existing
ESLint below 9.30 has to be upgraded first. Run it on the codebase and
downgrade rules that fail en masse to warn with a ratchet note, same as
the base config.Python:
templates/ruff.toml +
templates/pyrightconfig.json, run ruff check, report counts per rule
family, and downgrade noisy families per-project rather than mass-fixing.[tool.ruff] in pyproject.toml → merge the starter's select/ignore
lists into pyproject. Do not drop a standalone ruff.toml next to it -
ruff.toml silently takes precedence and their existing config stops
applying.Foundation templates (both stacks): copy only where the pattern is absent
env.ts / env.py), error registry (errorIds.ts /
error_ids.py), truncator (truncate-for-context.ts /
truncate_for_context.py). Adapt import paths to the project's layout. Skip
any the project already has an equivalent for.
If Tier 4 is adopted too, list each copied template's path at the end of
.claude/rules/starter-patterns.md. Until new code imports them they look
unused, and /test-audit treats files named there as scaffold to ask about,
not dead code to delete.Write .claude/rules/starter-patterns.md with apply-on-touch guidance:
# Starter patterns - apply on touch
Apply these when already editing the relevant code. Never as a bulk refactor.
- Editing a file over 300 lines → split per the file-size hook's suggestions
(types / constants / validation / utils).
- Touching a `throw` / `raise` site → route it through the error registry
(`guides/error-id-registry.md`).
- Changing a fallible function's signature → consider returning a Result
(`guides/discriminated-union-results.md`).
- Touching an env read → move it behind the env boundary
(`guides/zod-at-the-boundary.md`).
- Adding a long-running operation → thread cancellation through it
(`guides/abort-signal-threading.md`).
- Adding a new tool → use the directory-per-tool layout
(`guides/tool-authoring-pattern.md`).
- Adding or changing a test → pass the test-audit authoring gate: the
behavior it protects, the regression that fails it, why existing proof
misses it, and no test-only production seam.
Explicitly out of scope: restructuring directories, rewriting existing error handling, or converting APIs wholesale. The starter's layout is a target for new code, not a migration mandate.
If the project has tests, offer /test-audit as its own task: a fresh branch
from the merged default branch, starting with the skill's read-only ledger.
Never run it on the adoption branch. Every Tier 3 step is checked against
the project's test suite, so pruning that suite mid-adoption weakens the
check the adoption relies on. If the project has no tests, do not offer it.
Execute the approved items tier by tier, in tier order. After each Tier 3 item, run the project's lint and tests; stop on red. One commit per component, so the developer can drop any single adoption from the branch.
Confirm each item before reporting done:
.harness/ledger.jsonl gitignored, if the loop was adoptedWhat SKILL.md sets; muted values are Claude Code's defaults
10 skills in this plugin
/commitCreate a single well-crafted git commit from current changes. Analyzes diff, follows repo's commit style, and writes a concise "why not what" message./commit-push-prFull git workflow - creates branch, commits, pushes, and creates or updates a PR with summary and test plan./dep-vuln-updateUse when dependencies in a repo have known vulnerabilities and need updating, including when the dep-vuln hook reports advisories at commit or merge request time, when the user asks to fix vulns, patch CVEs or GHSAs, run an audit fix, or bump vulnerable packages. Covers scanning tracked lockfiles with osv-scanner, choosing the smallest version that clears each advisory, overrides for transitive deps, verifying with the repo's own tests, and committing per repo.npx claudepluginhub sneg55/agent-starter --plugin agent-starterOther plugins' skills for the same job