welcome-ai-badger
Skill3 starsChanged 34 days agoMITView on GitHub
Use when a repository should be set up with ai-badger — "welcome-ai-badger", "scaffold this project", "add agent instructions here", "onboard this repo" — whether it is new or already has agent files. Detects stacks, writes .ai-badger/, and generates each configured agent's discovery file.
- Installs packages
In this repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .ai-badger/AGENTS.mdAGENTS.md
- .ai-badger/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .ai-badger/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- ai-raccoon-memorySkill
- archifySkill
- artifact-verificationSkill
- auto-wmSkill
- browser-usageSkill
- call-behavioristSkill
- code-review-checklistSkill
- code-review-evidenceSkill
- commit-reminderSkill
- complete-project-scope-code-reviewSkill
- create-task-specSkill
- debug-issueSkill
- den-refreshSkill
- design-gate-auditSkill
- design-testsSkill
- differential-feature-refactorSkill
- documentation-drift-auditSkill
- documentationSkill
- evidence-first-researchSkill
- explore-codebaseSkill
- feed-badgerSkill
- git-workSkill
- humanizerSkill
- maintain-agent-instructionsSkill
- mcp-indexSkill
- multi-agent-communicationSkill
- multi-lane-report-assemblySkill
- owner-gate-reviewSkill
- pre-push-gate-debuggingSkill
- prompt-markersSkill
- qaSkill
- quick-taskSkill
- refactor-safelySkill
- research-record-auditSkill
- review-changesSkill
- review-gate-diff-verificationSkill
- review-testsSkill
- scripts-tooling-refactorSkill
- semantica-knowledge-graphSkill
- send-messageSkill
- spec-driven-refactoringSkill
- status-reportSkill
- task-decompositionSkill
- taskSkill
- test-economySkill
- worktree-agent-isolationSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
If index.json is missing or stale, run python3 "$AI_BADGER/tooling/index_build.py" first.
- Very specific: line 53
Author
config.json: Read the proposal. Fill in project.summary and project.domain (the domain is the *business* purpose, never a stack). - Distinctive: line 61
Ask plugin scope: Ask the user: default (honor each plugin entry's declared scope) or
- Very specific: line 65
If the user declines a skill, persona, invariant or instruction, name it in exclude ({"skills": ["mcp-index"]}) — deleting the scaffolded …
- Very specific: line 97
When the output ends with a list of trees that "claim to be ai-badger", relay it: a drift notice fires once per tree (Why — see Gotchas.), …
- Very specific: line 163
When any script in the welcome flow (detect.py, validate.py, scaffold.py) exits non-zero or emits an error, attempt recovery before …
- Distinctive: line 181
After applying a fix, re-run the failed step and continue the flow.
- Very specific: line 184
Recovery failed — offer to create a GitHub issue: Follow .ai-badger/skills/welcome-ai-badger/references/reporting-a-framework-bug.md when a …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
welcome-ai-badger
Scaffolds a target repository with a project-tailored selection of ai-badger framework
features. The scripts do all mechanical work; you (the agent) only author config.json — the
one creative artifact — and answer/ask a few questions.
Responsibility split (do not blur it)
- Scripts (mechanical, deterministic):
detect.pyproposes a config;validate.pychecks it;scaffold.pybuilds.ai-badger/, assemblesCLAUDE.md, copies agent files, records provenance inmanifest.json. - You (creative only): turn the proposed config into a good
config.json— writeproject.summary/domain, choose/confirm stacks, definepersonaRouting, resolve any detection ambiguity by asking the user. Then hand it back tovalidate.py.
Prerequisites
Framework scripts need jsonschema:
python3 -m pip install -r "$AI_BADGER/engine/requirements.txt"$AI_BADGER = this framework's root (the dir containing index.json, schemas/, common/).
If index.json is missing or stale, run python3 "$AI_BADGER/tooling/index_build.py" first.
Flow
- Detect. From the target repo root:
This proposes stacks (withpython3 "$AI_BADGER/features/common/skills/welcome-ai-badger/scripts/detect.py" --target . --root "$AI_BADGER" > /tmp/proposed-config.jsonrequiresexpanded), detected coding agents (claude/copilot/hermes/pi/codex, detected from repo or user-scope traces), source control, and build/test/lint/run commands. - Author
config.json. Read the proposal. Fill inproject.summaryandproject.domain(the domain is the business purpose, never a stack). Confirm the stack list againstindex.json(stacksmust be known stacks). AddpersonaRoutingmapping kinds of work to the personas that will be scaffolded (base roles:architect,test-engineer,code-reviewer, plus each selected stack's engineer persona). Ask the user only when a choice is genuinely ambiguous (e.g. detection found both a frontend and a backend and you can't tell the project's focus). Ask plugin scope. Ask the user: default (honor each plugin entry's declared scope) or local-only (force every plugin install to project scope). Set
skillScopeaccordingly. (There is deliberately no "user-only" option.)If the user declines a skill, persona, invariant or instruction, name it in
exclude({"skills": ["mcp-index"]}) — deleting the scaffolded file is undone by the next refresh (Why — see Gotchas.). The declined item is not delivered and its discovery symlinks are removed; the copy already under.ai-badger/skills/stays on disk for the user to delete.- Validate.
Fix any reported error in the config and re-run until it passes.python3 "$AI_BADGER/tooling/validate.py" --kind config /tmp/proposed-config.json - Scaffold.
Producespython3 "$AI_BADGER/features/common/skills/welcome-ai-badger/scripts/scaffold.py" \ --config /tmp/proposed-config.json --target . --root "$AI_BADGER" \ --generated-at "$(date -u +%Y-%m-%dT%H:%M:%SZ)".ai-badger/(config.json, manifest.json, CLAUDE.md, agents/, instructions/, invariants/, skills/, agent-instructions/, state.json) and agent-discovery copies for each detected agent (CLAUDE.md,.github/copilot-instructions.md,HERMES.md,AGENTS.override.md,AGENTS.md). Codex receives.agents/skills/symlinks and.codex/agents/*.toml, project MCP configuration and the supported native hook subset. Review project and hook trust in Codex before expecting hooks to run; scaffolding does not grant trust. A root piAGENTS.override.mdwins overAGENTS.md, so check its guidance when both agents share a repository. Note the printed plugin-setup commands and run them per the chosen scope (or hand them to the user). Existing hand-authored discovery files are preserved by default — see the preserve note below; on a mature repo the scaffold will report which files it left untouched. - Verify & report. Confirm the scaffold matches the stacks (no leakage from unselected
stacks). Summarize what was written, the plugin commands, and any notes the script emitted.
When the output ends with a list of trees that "claim to be ai-badger", relay it: a drift
notice fires once per tree (Why — see Gotchas.), so competing copies explain contradictory
notices. Scaffolding
deletes nothing in the home directory —
den-refresh --prune-cacheis the one command that removes~/.ai-badger/framework, and~/.claude/plugins/cache/is Claude Code's to manage.
Notes
- Idempotent: re-running
scaffold.pyrefreshes managed files and the manifest. Safe to re-run after editingconfig.json. - Copy-vs-reference: essential agent files (CLAUDE.md, HERMES.md, copilot-instructions)
are copied to their conventional locations with a header pointing at
.ai-badger/as the source of truth, because agent CLIs discover them by convention. A thin-proxy (symlink) alternative was considered and dropped: symlinks break on Windows, and Copilot does not follow references. - Preserve-by-default (mature repos): a discovery file that already exists and does not carry
the ai-badger managed header is treated as hand-authored and left untouched — its
.ai-badger/source copy is still written, and the scaffold emits apreserved …note. Framework-written copies (which carry the header) and brand-new files are written/refreshed normally, so idempotent re-scaffolding still works. Pass--overwrite-agent-filesto force the old copy-over behavior on every discovery file. - Preserved regions (per-block): content between
<!-- ai-badger:keep-start -->and<!-- ai-badger:keep-end -->is carried verbatim into the regenerated file, in order, at the end. This applies to every managed agent file and its.ai-badger/source-of-truth copy, so a project block added to.ai-badger/CLAUDE.mdsurvives a re-scaffold. Unbalanced or nested markers leave the file untouched and emit a note — a marker typo never loses content (Why — see Gotchas.). Tell the user about this whenever they ask where to put project-authored content in a managed file. - Extensions: config-gated skill extensions (e.g. the GitHub PR/issue extension of
task) are embedded automatically iffconfig.jsonsupplies their required data.
Gotchas
- Deleting a scaffolded file does not decline the item. The next refresh brings it back —
decline a skill, persona, invariant or instruction by naming it in
excludeinconfig.json, not by deleting the delivered copy. - A keep-marker typo never loses content. Unbalanced or nested
<!-- ai-badger:keep-start -->/<!-- ai-badger:keep-end -->markers leave the file untouched and emit a note rather than mangling it. - A drift notice fires once per tree. Competing ai-badger copies each claim the repo, so a relayed tree list explains contradictory notices — it is not a bug to fix.
- Never remediate a scaffold-freshness-guard failure with
--skills ''. The empty value recovers the skill list from the manifest being audited (#129), so on a narrowed manifest it regenerates the same narrowed set and the guard goes green over the very defect it reported. The guard's printed remediation carries the full config-derived skill list — run that verbatim. And every regenerated mirror (.ai-badger/skills/**, agent files,.ai-badger/manifest.json) rides in the same commit as the source edit that made it stale — a mirror committed alone is the guard catching up to something that already shipped.
Updating an already-scaffolded project
The initial scaffold is a one-time setup. For ongoing updates when the framework
releases new features or fixes, use den-refresh instead of re-running welcome:
python3 "$AI_BADGER/features/common/skills/den-refresh/scripts/refresh.py" --target . --root "$AI_BADGER"den-refresh checks what changed upstream, re-scaffolds with your existing
config.json (no re-detection, no questions), and reports the result. Seed-once
files (state.json, markers-context.json, model.json) are preserved. Review the
diff before committing.
Error Recovery
When any script in the welcome flow (detect.py, validate.py, scaffold.py)
exits non-zero or emits an error, attempt recovery before surfacing the failure.
- Parse the error. Scripts emit structured JSON with an
errorfield and sometimesvalidationErrors. Read both to classify the failure. Attempt automatic recovery. Try the applicable fix, then re-run the failed step.
Error Fix jsonschemaimport errorpython3 -m pip install -r "$AI_BADGER/engine/requirements.txt"index.jsonmissing or stalepython3 "$AI_BADGER/tooling/index_build.py"validate.pyreports config errorsRead errors, patch config JSON, re-validate scaffold.pyfile-permission / encoding errorFix the file/permission, retry once detect.pyfound no stacksCheck that $AI_BADGERpoints at a valid framework checkout (hasindex.json)Agent file write failed (read-only discovery file) Pass --overwrite-agent-filesor remove the conflicting fileAfter applying a fix, re-run the failed step and continue the flow. If it succeeds, report what was fixed.
- Recovery failed — offer to create a GitHub issue. Follow
.ai-badger/skills/welcome-ai-badger/references/reporting-a-framework-bug.mdwhen a fix does not recover the failure: ask permission first, gate onghbeing installed and authenticated, sanitize the config before including it. Never create the issue without explicit user approval — that rule holds even if the reference file is not present.
Verification Checklist
validate.py --kind configpassed on the authored config- Scaffold output covers exactly the selected stacks — no leakage from unselected stacks
.ai-badger/holds config.json, manifest.json, CLAUDE.md, agents/, instructions/, invariants/, skills/, agent-instructions/, state.json- Plugin-setup commands relayed per the chosen scope (default or local-only)
- Preserved hand-authored discovery files reported, not overwritten
- Any "competing copies" tree list relayed, and nothing outside the target deleted
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.

