contextdevkit 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +592 -0
- package/LICENSE +21 -0
- package/README.md +401 -0
- package/docs/AGENT-PACKAGE-FORMAT.md +140 -0
- package/docs/ARCHITECTURE.md +258 -0
- package/docs/CHANGELOG.md +559 -0
- package/docs/CUSTOMIZING.md +211 -0
- package/docs/LEVELS.md +151 -0
- package/docs/ROADMAP.md +385 -0
- package/docs/SQUAD-PIPELINE-FORMAT.md +258 -0
- package/docs/SQUADS/agent-forge.md +65 -0
- package/docs/SQUADS/design-team.md +161 -0
- package/docs/token-economy-plan.md +135 -0
- package/install.mjs +273 -0
- package/instrucoes.md +274 -0
- package/package.json +46 -0
- package/templates/CLAUDE.md.tpl +133 -0
- package/templates/claude/agents/_TEMPLATE.md +52 -0
- package/templates/claude/agents/accessibility.md +36 -0
- package/templates/claude/agents/agent-architect.md +37 -0
- package/templates/claude/agents/architect.md +39 -0
- package/templates/claude/agents/code-reviewer.md +43 -0
- package/templates/claude/agents/code-security.md +59 -0
- package/templates/claude/agents/context-keeper.md +40 -0
- package/templates/claude/agents/devops.md +40 -0
- package/templates/claude/agents/eval-designer.md +40 -0
- package/templates/claude/agents/forge-orchestrator.md +42 -0
- package/templates/claude/agents/governance-officer.md +45 -0
- package/templates/claude/agents/growth.md +92 -0
- package/templates/claude/agents/infra-security.md +53 -0
- package/templates/claude/agents/landing-architect.md +154 -0
- package/templates/claude/agents/model-router.md +34 -0
- package/templates/claude/agents/packager.md +38 -0
- package/templates/claude/agents/privacy-lgpd.md +64 -0
- package/templates/claude/agents/product-owner.md +51 -0
- package/templates/claude/agents/prompt-engineer.md +33 -0
- package/templates/claude/agents/qa-e2e.md +52 -0
- package/templates/claude/agents/qa-fuzzer.md +24 -0
- package/templates/claude/agents/qa-integration.md +21 -0
- package/templates/claude/agents/qa-orchestrator.md +40 -0
- package/templates/claude/agents/qa-perf.md +40 -0
- package/templates/claude/agents/qa-unit.md +39 -0
- package/templates/claude/agents/rag-designer.md +54 -0
- package/templates/claude/agents/retention.md +85 -0
- package/templates/claude/agents/security.md +48 -0
- package/templates/claude/agents/seo-specialist.md +106 -0
- package/templates/claude/agents/test-engineer.md +48 -0
- package/templates/claude/agents/tool-designer.md +32 -0
- package/templates/claude/agents/ui-designer.md +37 -0
- package/templates/claude/agents/ux-designer.md +38 -0
- package/templates/claude/commands/README.md +95 -0
- package/templates/claude/commands/advise.md +80 -0
- package/templates/claude/commands/audit/analyze-code-ia-practices.md +75 -0
- package/templates/claude/commands/audit/audit.md +35 -0
- package/templates/claude/commands/audit/contract-check.md +21 -0
- package/templates/claude/commands/audit/deep-analysis.md +48 -0
- package/templates/claude/commands/audit/deps-audit.md +49 -0
- package/templates/claude/commands/audit/security-setup.md +35 -0
- package/templates/claude/commands/audit/seo-audit.md +63 -0
- package/templates/claude/commands/audit/tech-debt-sweep.md +35 -0
- package/templates/claude/commands/bug-hunt.md +42 -0
- package/templates/claude/commands/claude-md.md +36 -0
- package/templates/claude/commands/close-version.md +25 -0
- package/templates/claude/commands/context-refresh.md +19 -0
- package/templates/claude/commands/context-stats.md +15 -0
- package/templates/claude/commands/dashboard.md +66 -0
- package/templates/claude/commands/distill-apply.md +19 -0
- package/templates/claude/commands/distill-sessions.md +26 -0
- package/templates/claude/commands/fleet.md +47 -0
- package/templates/claude/commands/forge/forge-audit.md +16 -0
- package/templates/claude/commands/forge/forge-budget.md +16 -0
- package/templates/claude/commands/forge/forge-deprecate.md +16 -0
- package/templates/claude/commands/forge/forge-doctor.md +17 -0
- package/templates/claude/commands/forge/forge-eval.md +16 -0
- package/templates/claude/commands/forge/forge-fallback-test.md +17 -0
- package/templates/claude/commands/forge/forge-killswitch.md +17 -0
- package/templates/claude/commands/forge/forge-list.md +17 -0
- package/templates/claude/commands/forge/forge-new.md +41 -0
- package/templates/claude/commands/forge/forge-policy.md +16 -0
- package/templates/claude/commands/forge/forge-redteam.md +17 -0
- package/templates/claude/commands/forge/forge-refresh-matrix.md +20 -0
- package/templates/claude/commands/forge/forge-route.md +17 -0
- package/templates/claude/commands/forge/forge-show.md +16 -0
- package/templates/claude/commands/landing-page.md +71 -0
- package/templates/claude/commands/log-session.md +59 -0
- package/templates/claude/commands/media-gen.md +93 -0
- package/templates/claude/commands/new-adr.md +30 -0
- package/templates/claude/commands/pipeline/dev-start.md +64 -0
- package/templates/claude/commands/pipeline/pipeline.md +36 -0
- package/templates/claude/commands/pipeline/resume.md +70 -0
- package/templates/claude/commands/pipeline/retro.md +34 -0
- package/templates/claude/commands/pipeline/runs.md +63 -0
- package/templates/claude/commands/pipeline/ship.md +54 -0
- package/templates/claude/commands/pipeline/workflow.md +85 -0
- package/templates/claude/commands/playbook.md +27 -0
- package/templates/claude/commands/predictions-review.md +28 -0
- package/templates/claude/commands/qa/qa-signoff.md +24 -0
- package/templates/claude/commands/qa/scaffold-tests.md +27 -0
- package/templates/claude/commands/qa/test-plan.md +26 -0
- package/templates/claude/commands/qa/visual-test.md +42 -0
- package/templates/claude/commands/roadmap.md +48 -0
- package/templates/claude/commands/setup/aidevtool-from0.md +104 -0
- package/templates/claude/commands/setup/context-config.md +25 -0
- package/templates/claude/commands/setup/context-doctor.md +21 -0
- package/templates/claude/commands/setup/context-level.md +17 -0
- package/templates/claude/commands/setup/setupcontextdevkit.md +121 -0
- package/templates/claude/commands/simulate-impact.md +32 -0
- package/templates/claude/commands/squad.md +44 -0
- package/templates/claude/commands/state.md +21 -0
- package/templates/claude/commands/token-report.md +29 -0
- package/templates/claude/commands/tune-agents.md +35 -0
- package/templates/claude/commands/vcs/claim.md +18 -0
- package/templates/claude/commands/vcs/git.md +83 -0
- package/templates/claude/commands/vcs/release.md +15 -0
- package/templates/claude/commands/vcs/worktree-new.md +18 -0
- package/templates/claude/commands/watch.md +47 -0
- package/templates/contextkit/.env.example +36 -0
- package/templates/contextkit/CLAUDE.child.md.tpl +38 -0
- package/templates/contextkit/README.md +74 -0
- package/templates/contextkit/behaviors-examples.md +183 -0
- package/templates/contextkit/behaviors.md +116 -0
- package/templates/contextkit/best-practices.md +323 -0
- package/templates/contextkit/config.json +66 -0
- package/templates/contextkit/detectors/README.md +45 -0
- package/templates/contextkit/detectors/example-detector.mjs.example +25 -0
- package/templates/contextkit/instrucoes.md +114 -0
- package/templates/contextkit/memory/GLOSSARY.md +13 -0
- package/templates/contextkit/memory/SESSIONS.md +9 -0
- package/templates/contextkit/memory/WORKSPACE.md +7 -0
- package/templates/contextkit/memory/business-rules/_TEMPLATE.md +33 -0
- package/templates/contextkit/memory/decisions/0000-record-architecture-decisions.md +34 -0
- package/templates/contextkit/memory/decisions/_TEMPLATE.md +25 -0
- package/templates/contextkit/memory/predictions/.gitkeep +0 -0
- package/templates/contextkit/memory/roadmap.md +28 -0
- package/templates/contextkit/memory/sessions/.gitkeep +0 -0
- package/templates/contextkit/memory/workflows/.gitkeep +0 -0
- package/templates/contextkit/pipeline/backlog/.gitkeep +0 -0
- package/templates/contextkit/pipeline/conclusion/.gitkeep +0 -0
- package/templates/contextkit/pipeline/devpipeline.md +9 -0
- package/templates/contextkit/pipeline/testing/.gitkeep +0 -0
- package/templates/contextkit/pipeline/working/.gitkeep +0 -0
- package/templates/contextkit/review-protocol.md +214 -0
- package/templates/contextkit/runtime/config/defaults.mjs +215 -0
- package/templates/contextkit/runtime/config/levels.mjs +42 -0
- package/templates/contextkit/runtime/config/load.mjs +105 -0
- package/templates/contextkit/runtime/config/paths.mjs +92 -0
- package/templates/contextkit/runtime/config/presets.mjs +47 -0
- package/templates/contextkit/runtime/config/schema.mjs +88 -0
- package/templates/contextkit/runtime/config/settings-compose.mjs +55 -0
- package/templates/contextkit/runtime/git-hooks/commit-msg.mjs +55 -0
- package/templates/contextkit/runtime/git-hooks/pre-commit.mjs +47 -0
- package/templates/contextkit/runtime/git-hooks/pre-push.mjs +102 -0
- package/templates/contextkit/runtime/hooks/boot-context-readers.mjs +111 -0
- package/templates/contextkit/runtime/hooks/boot-signals.mjs +135 -0
- package/templates/contextkit/runtime/hooks/check-registration.mjs +228 -0
- package/templates/contextkit/runtime/hooks/concurrency-guard.mjs +110 -0
- package/templates/contextkit/runtime/hooks/ledger.mjs +231 -0
- package/templates/contextkit/runtime/hooks/md-extract.mjs +65 -0
- package/templates/contextkit/runtime/hooks/path-classification.mjs +62 -0
- package/templates/contextkit/runtime/hooks/safe-io.mjs +84 -0
- package/templates/contextkit/runtime/hooks/session-digest-core.mjs +85 -0
- package/templates/contextkit/runtime/hooks/session-start.mjs +248 -0
- package/templates/contextkit/runtime/hooks/simulate-gate.mjs +108 -0
- package/templates/contextkit/runtime/hooks/track-edits.mjs +154 -0
- package/templates/contextkit/runtime/providers/media/_adapter.mjs +120 -0
- package/templates/contextkit/runtime/providers/media/nano-banana.mjs +110 -0
- package/templates/contextkit/runtime/providers/media/veo.mjs +162 -0
- package/templates/contextkit/runtime/providers/review/_adapter.mjs +71 -0
- package/templates/contextkit/runtime/providers/review/detect.mjs +115 -0
- package/templates/contextkit/runtime/providers/review/gh.mjs +103 -0
- package/templates/contextkit/runtime/state/state-io.mjs +172 -0
- package/templates/contextkit/runtime/statusline.mjs +51 -0
- package/templates/contextkit/squads/README.md +115 -0
- package/templates/contextkit/squads/_BRIEFING.md.tpl +27 -0
- package/templates/contextkit/squads/agent-forge/README.md +69 -0
- package/templates/contextkit/squads/agent-forge/ROADMAP.md +108 -0
- package/templates/contextkit/squads/agent-forge/best-practices.md +89 -0
- package/templates/contextkit/squads/agent-forge/cli/forge-admin.mjs +132 -0
- package/templates/contextkit/squads/agent-forge/cli/forge-eval-cli.mjs +163 -0
- package/templates/contextkit/squads/agent-forge/cli/forge-new.mjs +97 -0
- package/templates/contextkit/squads/agent-forge/cli/forge-ops.mjs +177 -0
- package/templates/contextkit/squads/agent-forge/lib/architect.mjs +112 -0
- package/templates/contextkit/squads/agent-forge/lib/eval-designer.mjs +133 -0
- package/templates/contextkit/squads/agent-forge/lib/eval-runner.mjs +167 -0
- package/templates/contextkit/squads/agent-forge/lib/governance-officer.mjs +178 -0
- package/templates/contextkit/squads/agent-forge/lib/package-ops.mjs +101 -0
- package/templates/contextkit/squads/agent-forge/lib/packager.mjs +219 -0
- package/templates/contextkit/squads/agent-forge/lib/prompt-gen.mjs +122 -0
- package/templates/contextkit/squads/agent-forge/lib/rag-designer.mjs +102 -0
- package/templates/contextkit/squads/agent-forge/lib/router.mjs +165 -0
- package/templates/contextkit/squads/agent-forge/lib/tool-gen.mjs +113 -0
- package/templates/contextkit/squads/agent-forge/lib/yaml.mjs +47 -0
- package/templates/contextkit/squads/agent-forge/pipeline.yaml +65 -0
- package/templates/contextkit/squads/agent-forge/router/capability-matrix.json +112 -0
- package/templates/contextkit/squads/agent-forge/router/decision-rules.json +120 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/.agentforgerc +12 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/CHANGELOG.md +13 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/LICENSE +5 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/README.md +39 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/README.md +10 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/agent.go +14 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/go/go.mod +3 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/README.md +11 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/index.js +53 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/node/package.json +9 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/README.md +10 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/agent.py +16 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/adapters/python/pyproject.toml +10 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/golden.jsonl +1 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/red-team.jsonl +3 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/rubric.yaml +14 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/run-eval.md +17 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/evals/thresholds.yaml +18 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/basic.node.md +17 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/with-fallback.node.md +24 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/examples/with-rag.python.md +20 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/audit.schema.json +23 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/compliance.policy.yaml +43 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/cost.policy.yaml +36 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/fallback-chain.yaml +16 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/governance/quality.policy.yaml +43 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/manifest.yaml +91 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.anthropic.md +19 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.canonical.md +25 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.deepseek.md +21 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.google.md +19 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.ollama.md +21 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/prompts/system.openai.md +20 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/config.yaml +17 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/index/.gitkeep +3 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/ingestion/chunker.config.yaml +6 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/ingestion/sources.yaml +8 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/retrieval/query-template.md +16 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/rag/retrieval/rerank.config.yaml +6 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/anthropic.tools.json +11 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/deepseek.tools.json +14 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/google.tools.json +11 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/ollama.tools.json +14 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/adapters/openai.tools.json +14 -0
- package/templates/contextkit/squads/agent-forge/templates/agent-package/tools/schemas.canonical.json +25 -0
- package/templates/contextkit/starters/tanstack/README.md +86 -0
- package/templates/contextkit/starters/tanstack/index.html +12 -0
- package/templates/contextkit/starters/tanstack/package.json +25 -0
- package/templates/contextkit/starters/tanstack/src/main.tsx +40 -0
- package/templates/contextkit/starters/tanstack/src/router.tsx +12 -0
- package/templates/contextkit/starters/tanstack/src/routes/__root.tsx +10 -0
- package/templates/contextkit/starters/tanstack/src/routes/index.tsx +17 -0
- package/templates/contextkit/starters/tanstack/tsconfig.json +19 -0
- package/templates/contextkit/starters/tanstack/vite.config.ts +10 -0
- package/templates/contextkit/tools/scripts/adr-digest-core.mjs +42 -0
- package/templates/contextkit/tools/scripts/adr-digest.mjs +78 -0
- package/templates/contextkit/tools/scripts/agent-tuning.mjs +74 -0
- package/templates/contextkit/tools/scripts/aiso-audit.mjs +174 -0
- package/templates/contextkit/tools/scripts/audit-shared.mjs +129 -0
- package/templates/contextkit/tools/scripts/claim.mjs +133 -0
- package/templates/contextkit/tools/scripts/claude-md.mjs +123 -0
- package/templates/contextkit/tools/scripts/clean-drive.mjs +78 -0
- package/templates/contextkit/tools/scripts/context-config.mjs +111 -0
- package/templates/contextkit/tools/scripts/context-level.mjs +98 -0
- package/templates/contextkit/tools/scripts/context-pack.mjs +120 -0
- package/templates/contextkit/tools/scripts/contract-scan.mjs +186 -0
- package/templates/contextkit/tools/scripts/dashboard-data.mjs +198 -0
- package/templates/contextkit/tools/scripts/dashboard-html.mjs +215 -0
- package/templates/contextkit/tools/scripts/dashboard-server.mjs +129 -0
- package/templates/contextkit/tools/scripts/dashboard.mjs +107 -0
- package/templates/contextkit/tools/scripts/deep-analysis.mjs +62 -0
- package/templates/contextkit/tools/scripts/deps-audit.mjs +201 -0
- package/templates/contextkit/tools/scripts/detect-stack.mjs +164 -0
- package/templates/contextkit/tools/scripts/distill-detect.mjs +90 -0
- package/templates/contextkit/tools/scripts/doctor.mjs +165 -0
- package/templates/contextkit/tools/scripts/fleet.mjs +170 -0
- package/templates/contextkit/tools/scripts/generate-context.mjs +142 -0
- package/templates/contextkit/tools/scripts/gh-alerts.mjs +117 -0
- package/templates/contextkit/tools/scripts/git.mjs +97 -0
- package/templates/contextkit/tools/scripts/home.mjs +106 -0
- package/templates/contextkit/tools/scripts/mark-simulation.mjs +78 -0
- package/templates/contextkit/tools/scripts/media-gen.mjs +154 -0
- package/templates/contextkit/tools/scripts/pipeline-board.mjs +74 -0
- package/templates/contextkit/tools/scripts/pipeline-prioritize.mjs +68 -0
- package/templates/contextkit/tools/scripts/pipeline-session.mjs +99 -0
- package/templates/contextkit/tools/scripts/pipeline-validate.mjs +136 -0
- package/templates/contextkit/tools/scripts/pipeline.mjs +302 -0
- package/templates/contextkit/tools/scripts/playbook.mjs +123 -0
- package/templates/contextkit/tools/scripts/predictions-review.mjs +113 -0
- package/templates/contextkit/tools/scripts/release.mjs +60 -0
- package/templates/contextkit/tools/scripts/resume.mjs +114 -0
- package/templates/contextkit/tools/scripts/roadmap.mjs +86 -0
- package/templates/contextkit/tools/scripts/runs.mjs +116 -0
- package/templates/contextkit/tools/scripts/seo-audit.mjs +150 -0
- package/templates/contextkit/tools/scripts/session-digest.mjs +89 -0
- package/templates/contextkit/tools/scripts/session-reindex.mjs +91 -0
- package/templates/contextkit/tools/scripts/setup-complete.mjs +69 -0
- package/templates/contextkit/tools/scripts/squad-meta.mjs +23 -0
- package/templates/contextkit/tools/scripts/squad-pipeline-condition.mjs +192 -0
- package/templates/contextkit/tools/scripts/squad-pipeline.mjs +301 -0
- package/templates/contextkit/tools/scripts/squad.mjs +80 -0
- package/templates/contextkit/tools/scripts/stats.mjs +138 -0
- package/templates/contextkit/tools/scripts/sync-check.mjs +235 -0
- package/templates/contextkit/tools/scripts/tech-debt-detectors.mjs +76 -0
- package/templates/contextkit/tools/scripts/tech-debt-scan.mjs +164 -0
- package/templates/contextkit/tools/scripts/token-report.mjs +153 -0
- package/templates/contextkit/tools/scripts/visual-test.mjs +132 -0
- package/templates/contextkit/tools/scripts/watch.mjs +106 -0
- package/templates/contextkit/tools/scripts/workflow.mjs +136 -0
- package/templates/contextkit/tools/scripts/workspace-sync.mjs +220 -0
- package/templates/contextkit/tools/scripts/worktree-new.mjs +50 -0
- package/templates/contextkit/workflows/L1-static-loading.md +59 -0
- package/templates/contextkit/workflows/L2-session-ledger.md +86 -0
- package/templates/contextkit/workflows/L3-multi-session.md +80 -0
- package/templates/contextkit/workflows/L4-squads.md +68 -0
- package/templates/contextkit/workflows/L5-proactive.md +88 -0
- package/templates/contextkit/workflows/README.md +47 -0
- package/templates/contextkit/workflows/playbooks/distillation-cycle.md +74 -0
- package/templates/contextkit/workflows/playbooks/landing-page.md +197 -0
- package/templates/contextkit/workflows/playbooks/security-batch.md +68 -0
- package/templates/contextkit/workflows/playbooks/seo-aiso.md +288 -0
- package/templates/contextkit/workflows/playbooks/simulate-impact.md +83 -0
- package/templates/contextkit/workflows/playbooks/tanstack.md +164 -0
- package/templates/contextkit/workflows/playbooks/tech-debt-sweep.md +77 -0
- package/templates/docs/CHANGELOG.md.tpl +11 -0
- package/templates/gitattributes +3 -0
- package/templates/github/ISSUE_TEMPLATE/bug_report.md +30 -0
- package/templates/github/ISSUE_TEMPLATE/feature_request.md +22 -0
- package/templates/github/PULL_REQUEST_TEMPLATE.md +27 -0
- package/templates/github/dependabot.yml +27 -0
- package/templates/github/workflows/quality.yml +36 -0
- package/templates/github/workflows/security.yml +54 -0
- package/tools/install/cli.mjs +62 -0
- package/tools/install/fs.mjs +56 -0
- package/tools/install/git.mjs +114 -0
- package/tools/install/project.mjs +51 -0
- package/tools/install/uninstall.mjs +54 -0
- package/tools/integration-test-compozy.mjs +88 -0
- package/tools/integration-test-guards.mjs +269 -0
- package/tools/integration-test-tooling-agent-forge.mjs +189 -0
- package/tools/integration-test-tooling-pipeline.mjs +164 -0
- package/tools/integration-test-tooling.mjs +172 -0
- package/tools/integration-test.mjs +228 -0
- package/tools/it-helpers.mjs +60 -0
- package/tools/selfcheck-agent-forge-ops.mjs +107 -0
- package/tools/selfcheck-agent-forge.mjs +304 -0
- package/tools/selfcheck-config.mjs +80 -0
- package/tools/selfcheck-runtime.mjs +135 -0
- package/tools/selfcheck-source.mjs +326 -0
- package/tools/selfcheck.mjs +268 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: One-shot intelligent onboarding — inspects the project and self-configures ContextDevKit to it.
|
|
3
|
+
argument-hint: [target level 1-7]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 🚀 Setup ContextDevKit
|
|
7
|
+
|
|
8
|
+
You are running the **self-configuring onboarding**. Goal: make this project's
|
|
9
|
+
ContextDevKit setup *at least as rich as a hand-tuned one* — adapted to THIS
|
|
10
|
+
project's stack, structure, and domain. Be thorough, infer aggressively, ask
|
|
11
|
+
only the few questions that genuinely need a human, and **never break the
|
|
12
|
+
project**. Confirm before any command that installs packages or changes the
|
|
13
|
+
environment.
|
|
14
|
+
|
|
15
|
+
Work through these phases in order. Use TodoWrite to track them.
|
|
16
|
+
|
|
17
|
+
## Phase 1 — Inspect
|
|
18
|
+
1. Run `node contextkit/tools/scripts/detect-stack.mjs` and parse the JSON report
|
|
19
|
+
(languages, package manager, frameworks, monorepo, source dirs, suggested
|
|
20
|
+
`ledger` + `highRiskPaths`, README summary, greenfield flag).
|
|
21
|
+
2. Read `README*`, the existing `CLAUDE.md`, and skim the top-level structure to
|
|
22
|
+
understand what the project *is* and its domain language.
|
|
23
|
+
3. If it's **greenfield** (no source yet), say so — onboarding will set up
|
|
24
|
+
conventions and defer stack specifics to the first `/new-adr`.
|
|
25
|
+
|
|
26
|
+
## Phase 2 — Ask only what you can't infer
|
|
27
|
+
Ask the user (batch into one short round, offer inferred defaults):
|
|
28
|
+
- A one-sentence description of the project + its audience.
|
|
29
|
+
- The **language for user-facing UI text** (code stays English; this is for
|
|
30
|
+
visible strings) — infer from README if obvious.
|
|
31
|
+
- 1–3 **immutable rules** to enforce (propose candidates from the detected
|
|
32
|
+
stack, e.g. "never introduce <competing tech>", "all DB access via <layer>").
|
|
33
|
+
- The **target level** (use `$ARGUMENTS` if provided; else recommend based on
|
|
34
|
+
the report — L2 for most, L1 for greenfield, L4/L5 if the codebase is large or
|
|
35
|
+
has clear high-risk areas).
|
|
36
|
+
|
|
37
|
+
## Phase 3 — Apply configuration
|
|
38
|
+
1. Tune the ledger + high-risk paths to this stack in one step (this also flips
|
|
39
|
+
the first-run flag off at the end):
|
|
40
|
+
```
|
|
41
|
+
node contextkit/tools/scripts/setup-complete.mjs --detect
|
|
42
|
+
```
|
|
43
|
+
Then review `contextkit/config.json` and refine `ledger.important` /
|
|
44
|
+
`l5.highRiskPaths` by hand if the heuristics missed something.
|
|
45
|
+
2. Set the chosen level: `node contextkit/tools/scripts/context-level.mjs <N>`
|
|
46
|
+
(this rewires `.claude/settings.json` and installs git hooks at L≥3).
|
|
47
|
+
|
|
48
|
+
## Phase 4 — Fill in CLAUDE.md
|
|
49
|
+
Edit `CLAUDE.md` (or merge `CLAUDE.contextdevkit.md` if the installer left one):
|
|
50
|
+
- "What this is" — the description from Phase 2.
|
|
51
|
+
- "Stack" — the concrete detected stack (languages, frameworks, package manager).
|
|
52
|
+
- "Immutable rules" — the rules from Phase 2; link an ADR for each big one.
|
|
53
|
+
- "Language policy" — set the UI language row.
|
|
54
|
+
- Keep it under ~200 lines. Push detail into ADRs.
|
|
55
|
+
|
|
56
|
+
**Curated-stack rules.** When the detect report contains any `@tanstack/*`
|
|
57
|
+
framework, inherit the conventions block from
|
|
58
|
+
`contextkit/workflows/playbooks/tanstack.md` (the "Core conventions" section)
|
|
59
|
+
into the project's `CLAUDE.md` under "Stack" or "Immutable rules". Cite the
|
|
60
|
+
playbook + ADR-0017. Do **not** copy the opt-in starter — `/setupcontextdevkit`
|
|
61
|
+
detects and writes rules; the starter is `/aidevtool-from0`-only.
|
|
62
|
+
|
|
63
|
+
## Phase 4b — Scoped CLAUDE.md per app/module
|
|
64
|
+
Run `node contextkit/tools/scripts/claude-md.mjs find`. For a multi-app/monorepo
|
|
65
|
+
project, ensure **each app/module has its own CLAUDE.md** (backend, frontend,
|
|
66
|
+
each package/service): `claude-md.mjs scaffold`, then **fill each** with real
|
|
67
|
+
local rules (role, local stack, local conventions, boundaries) via `/claude-md`.
|
|
68
|
+
Single-package project → the root CLAUDE.md is enough; skip.
|
|
69
|
+
|
|
70
|
+
## Phase 5 — Glossary, business rules & squads (sub-agents)
|
|
71
|
+
- Add any clear domain terms (from README/code) to `contextkit/memory/GLOSSARY.md`.
|
|
72
|
+
- Capture any explicit **domain rules** you can infer as versioned files in
|
|
73
|
+
`contextkit/memory/business-rules/` (copy `_TEMPLATE.md`) — e.g. pricing, eligibility,
|
|
74
|
+
scheduling, gamification. One cohesive rule per file.
|
|
75
|
+
- At **level ≥ 4** the squads install (`.claude/agents/`): **devteam**, **qa-team**,
|
|
76
|
+
**compliance-team** (LGPD), **design-team** (UI/UX), plus starter product/ops
|
|
77
|
+
agents. Review `contextkit/squads/README.md`. Enable the squads relevant to this
|
|
78
|
+
project (e.g. compliance-team if it handles Brazilian residents' personal data;
|
|
79
|
+
design-team if it has a UI) and **grow the devteam** with domain agents via
|
|
80
|
+
`/squad` (e.g. `frontend`, `backend`, `db`) from `_TEMPLATE.md`.
|
|
81
|
+
|
|
82
|
+
## Phase 5b — Product roadmap (important — don't skip)
|
|
83
|
+
Run `node contextkit/tools/scripts/roadmap.mjs find --json`:
|
|
84
|
+
- If it lists an existing roadmap/PRD/spec file → offer to **import/normalize** it
|
|
85
|
+
into `contextkit/memory/roadmap.md` via `/roadmap from-existing`.
|
|
86
|
+
- If none and the roadmap is undefined → **analyze** the codebase and **propose** a
|
|
87
|
+
roadmap, then **ask the user for their objectives** to add (P-IDs). Drive this
|
|
88
|
+
with `/roadmap from-existing`. A project without a roadmap is flying blind —
|
|
89
|
+
create it now (with the user), even a small first version.
|
|
90
|
+
|
|
91
|
+
## Phase 6 — Install what's needed (confirm first)
|
|
92
|
+
- If `package.json` exists but dependencies aren't installed, offer to run the
|
|
93
|
+
detected package manager's install (`pnpm install` / `npm install` / …).
|
|
94
|
+
- If the user chose **Level 5** and wants strict `/context-config` validation,
|
|
95
|
+
offer to add `zod` as a dev dependency (optional — the kit runs without it).
|
|
96
|
+
- Never install anything without explicit confirmation.
|
|
97
|
+
|
|
98
|
+
## Phase 6b — Version control (verify the remote, decide with the user)
|
|
99
|
+
Run `node contextkit/tools/scripts/git.mjs status` and act on the result:
|
|
100
|
+
- **`isRepo: false`** → offer `git init`.
|
|
101
|
+
- **`remoteUrl` present** → already connected; confirm it's the right one, move on.
|
|
102
|
+
- **`remoteUrl: null`** → **ask**: "No remote — do you already have a repo
|
|
103
|
+
(GitHub/GitLab/other) to connect, or should we create one?" Then run
|
|
104
|
+
`/git setup-remote` (B1 connect existing / B2 create new, private by default).
|
|
105
|
+
Confirm before any push/repo-creation (outward-facing).
|
|
106
|
+
|
|
107
|
+
## Phase 7 — Record the baseline
|
|
108
|
+
1. Create `contextkit/memory/decisions/0001-<stack-slug>.md` (use `/new-adr` style)
|
|
109
|
+
capturing the chosen stack + immutable rules as the baseline decision.
|
|
110
|
+
2. Run `/log-session` to register this onboarding session.
|
|
111
|
+
3. The `setup-complete.mjs` call already flipped `config.setup.completed = true`,
|
|
112
|
+
so the first-run trigger will no longer fire. Confirm it is `true`.
|
|
113
|
+
|
|
114
|
+
## Phase 8 — Report
|
|
115
|
+
Summarize to the user: detected stack, level set, config tuned (counts of
|
|
116
|
+
important/high-risk paths), CLAUDE.md sections filled, agents created, deps
|
|
117
|
+
installed, ADR + session logged. End with the natural next step.
|
|
118
|
+
|
|
119
|
+
If anything is ambiguous, prefer asking one crisp question over guessing wrong.
|
|
120
|
+
The point of this command is that the user goes from "kit installed" to "kit
|
|
121
|
+
fully fitted to my project" in a single pass.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: L5 pre-flight — map the blast radius of a change BEFORE editing high-risk paths.
|
|
3
|
+
argument-hint: <one-sentence objective>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 🔮 Simulate Impact
|
|
7
|
+
|
|
8
|
+
Objective: **$ARGUMENTS**
|
|
9
|
+
|
|
10
|
+
Produce a **Blast Radius Report** before any Edit/Write on high-risk paths.
|
|
11
|
+
|
|
12
|
+
1. **Identify what the change touches.** List the concrete files/dirs you expect to modify. Cross-
|
|
13
|
+
reference `contextkit/config.json` → `l5.highRiskPaths` to see which are gated.
|
|
14
|
+
|
|
15
|
+
2. **Map the blast radius.** For each touched area, reason about downstream effects: public
|
|
16
|
+
contracts/exports, API/route signatures, data schema, auth surface, shared types, anything that
|
|
17
|
+
other modules or external consumers depend on. If agents are installed (Level 4), delegate
|
|
18
|
+
focused sub-analyses to the relevant specialists in parallel and consolidate.
|
|
19
|
+
|
|
20
|
+
3. **Write the report** to `contextkit/memory/predictions/<YYYY-MM-DD>-<slug>.md` with: objective,
|
|
21
|
+
files in scope, downstream risks, suggested order of changes, and a rollback note.
|
|
22
|
+
|
|
23
|
+
4. **Authorize the edits** by recording the simulation on the ledger (this unblocks the L5 gate):
|
|
24
|
+
```
|
|
25
|
+
node contextkit/tools/scripts/mark-simulation.mjs "$ARGUMENTS" <covered-path-or-dir/> [more ...]
|
|
26
|
+
```
|
|
27
|
+
Use trailing slashes for directory coverage (e.g. `src/services/`).
|
|
28
|
+
|
|
29
|
+
5. Summarize the report to the user and proceed with the change in the suggested order.
|
|
30
|
+
|
|
31
|
+
For a genuinely trivial edit (typo/comment) on a gated path, record an explicit bypass instead:
|
|
32
|
+
`node contextkit/tools/scripts/mark-simulation.mjs "BYPASS: <reason>" <path>`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show/route/grow the agent squads (devteam + qa-team) — the roster, when to use each, and how to add agents/squads.
|
|
3
|
+
argument-hint: [show | route <task> | brief <agent> | new-squad <name>]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 👥 Squads
|
|
7
|
+
|
|
8
|
+
The sub-agents are organized into **squads** (see `contextkit/squads/README.md`):
|
|
9
|
+
**devteam** (constructive — build + review) and **qa-team** (adversarial — verify
|
|
10
|
+
behaviour). Agents live in `.claude/agents/` and install at **Level 4**.
|
|
11
|
+
|
|
12
|
+
Act on **$ARGUMENTS**:
|
|
13
|
+
|
|
14
|
+
## show (default)
|
|
15
|
+
Run `node contextkit/tools/scripts/squad.mjs list` (agents + which already have a
|
|
16
|
+
tier-2 briefing) and read `contextkit/squads/README.md`; summarize the squads, their
|
|
17
|
+
members, and when to use each. If `.claude/agents/` isn't present, note the project
|
|
18
|
+
is below Level 4 — suggest `/context-level 4` to enable the squads.
|
|
19
|
+
|
|
20
|
+
## route <task>
|
|
21
|
+
Pick the right squad/agent for the task and delegate (use the Agent tool to
|
|
22
|
+
invoke the sub-agent). Building/designing/reviewing → **devteam** (`architect` →
|
|
23
|
+
`code-reviewer`); testing/verifying → **qa-team** (via `qa-orchestrator`). For a
|
|
24
|
+
full feature, prefer `/ship` (orchestrates the whole squad with checkpoints).
|
|
25
|
+
|
|
26
|
+
## brief <agent>
|
|
27
|
+
Scaffold the **tier-2 rich briefing**, then fill it:
|
|
28
|
+
```
|
|
29
|
+
node contextkit/tools/scripts/squad.mjs brief <agent>
|
|
30
|
+
```
|
|
31
|
+
It auto-detects the agent's squad and creates `contextkit/squads/<squad>/<agent>.md`
|
|
32
|
+
from `_BRIEFING.md.tpl` (idempotent). Then **fill it** with real, specific content
|
|
33
|
+
for this project — anti-patterns, end-to-end recipes, edge cases — the deep
|
|
34
|
+
reference behind the lean `.claude/agents/<agent>.md`.
|
|
35
|
+
|
|
36
|
+
## new-squad <name>
|
|
37
|
+
Add a new squad (e.g. `design-team`, `product-team`, `ops-team`): create a
|
|
38
|
+
section in `contextkit/squads/README.md` with its mandate + roster, and scaffold its
|
|
39
|
+
agents from `.claude/agents/_TEMPLATE.md` (sharp `description`s). Keep the
|
|
40
|
+
sovereignty rule clear (who decides on conflict).
|
|
41
|
+
|
|
42
|
+
Remember the conflict rule: `code-reviewer` owns style/constitution;
|
|
43
|
+
`qa-orchestrator` owns behaviour/sign-off; devteam decides until you harden the
|
|
44
|
+
gates (`/context-level`).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quick summary of current project state (latest session + Unreleased + key rules)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> ⚠️ **Deprecated (1.0):** prefer **/audit** for a fuller, prioritized health
|
|
6
|
+
> view. This quick state read still works for now.
|
|
7
|
+
|
|
8
|
+
Summarize the current state of this project in at most 12 lines. To do so:
|
|
9
|
+
|
|
10
|
+
1. Run `node contextkit/tools/scripts/context-pack.mjs` [ADR-0027] — **one** bounded
|
|
11
|
+
bundle with the latest-session digest, `[Unreleased]`, the immutable rules, the
|
|
12
|
+
open backlog, and recent ADRs. Reason over the pack instead of opening those
|
|
13
|
+
files separately; open a full file only if the pack flags something to inspect.
|
|
14
|
+
|
|
15
|
+
Structure the answer in 3 blocks:
|
|
16
|
+
|
|
17
|
+
- **State**: what is done, what is in progress.
|
|
18
|
+
- **Natural next step**: based on `[Unreleased]` and the current phase.
|
|
19
|
+
- **Do NOT touch**: the 1–2 most critical immutable rules to remember.
|
|
20
|
+
|
|
21
|
+
Do not invent — only cite what is in the files. If something is empty, say "empty".
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Token economy & usage insight — report Claude Code token usage per session/week with budget warnings.
|
|
3
|
+
argument-hint: [--all | --json]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 🪙 Token Report
|
|
7
|
+
|
|
8
|
+
Make token cost a **measured** dimension of the project (L6 Insight).
|
|
9
|
+
|
|
10
|
+
Run:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
node contextkit/tools/scripts/token-report.mjs
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
It reads Claude Code's local session transcripts (`~/.claude/projects/…`) and aggregates
|
|
17
|
+
**input / output / cache** tokens per session and per ISO week — read-only, local,
|
|
18
|
+
**aggregated counts only** (never content). Then:
|
|
19
|
+
|
|
20
|
+
1. Call out the **heaviest sessions** and what likely drove them (long context, big files
|
|
21
|
+
re-read, repeated tool loops). A high cache-read share is normal — that's prompt caching.
|
|
22
|
+
2. Check usage against the budget (`tokens.budgetPerSession`). If sessions trend hot,
|
|
23
|
+
suggest concrete optimizations: tighter scope per session (`/dev-start`), fewer
|
|
24
|
+
full-file re-reads, a leaner boot context, cheaper models for low-stakes steps.
|
|
25
|
+
3. Set or adjust the budget: `/context-config set tokens.budgetPerSession <n>` (and
|
|
26
|
+
`tokens.warnAtPct`).
|
|
27
|
+
|
|
28
|
+
Flags: `--all` (every project, not just this cwd) · `--json` (machine-readable) ·
|
|
29
|
+
`--from <dir>` (read transcripts from a specific directory).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: L6 — propose outcome-driven refinements to agent briefings (writes a proposal, applies nothing). Mirrors /distill-sessions.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 🎯 Tune agents (propose)
|
|
6
|
+
|
|
7
|
+
Refine the squad's **agent briefings** from how they actually performed — but
|
|
8
|
+
**apply nothing**. This is the review step (like `/distill-sessions` for `CLAUDE.md`);
|
|
9
|
+
you apply the edits with your own OK.
|
|
10
|
+
|
|
11
|
+
1. **Signals** (deterministic):
|
|
12
|
+
```
|
|
13
|
+
node contextkit/tools/scripts/agent-tuning.mjs --json
|
|
14
|
+
```
|
|
15
|
+
Gives the roster, tier-2 briefing coverage, and per-agent mention counts across
|
|
16
|
+
the session history (a usage proxy).
|
|
17
|
+
|
|
18
|
+
2. **Outcomes** (judgment): read the recent session files + the DevPipeline
|
|
19
|
+
(`/pipeline`, the known-bugs map, ingested findings) and look, per agent, for:
|
|
20
|
+
- **false positives** it keeps raising → add a "don't flag X" note to dampen them,
|
|
21
|
+
- **blind spots** — real issues it missed that sit squarely in its lane → add an
|
|
22
|
+
anti-pattern row,
|
|
23
|
+
- **routing friction** — work that landed on the wrong agent → sharpen the
|
|
24
|
+
`description` (that's what routing keys on).
|
|
25
|
+
|
|
26
|
+
3. **Draft** concrete briefing edits to `contextkit/squads/<team>/<agent>.md` (scaffold
|
|
27
|
+
a missing briefing first: `node contextkit/tools/scripts/squad.mjs brief <agent>`).
|
|
28
|
+
Prefer small, high-signal additions — briefings stay sharp, not bloated.
|
|
29
|
+
|
|
30
|
+
4. **Write the proposal** to `.agent-tuning-proposal.md` (gitignored): the evidence
|
|
31
|
+
(which sessions/findings, what pattern), per-agent **before/after** edits, and any
|
|
32
|
+
agent that needs a new briefing. **Apply nothing in this command.**
|
|
33
|
+
|
|
34
|
+
5. Summarize to the user and tell them to review it, then apply the edits with their
|
|
35
|
+
OK (or re-run after a batch of work). Do not edit agent briefings here.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reserve path(s) for this session so parallel sessions get a cross-claim warning.
|
|
3
|
+
argument-hint: <path1> [path2 ...]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Reserve the following path(s) for this session: **$ARGUMENTS**
|
|
7
|
+
|
|
8
|
+
Run:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
node contextkit/tools/scripts/claim.mjs $ARGUMENTS
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This records the claim in `.claude/.workspace/<sid>.json` and regenerates
|
|
15
|
+
`contextkit/memory/WORKSPACE.md`. Any OTHER active Claude session that edits inside a claimed path
|
|
16
|
+
will see a cross-claim warning from the PostToolUse hook.
|
|
17
|
+
|
|
18
|
+
Confirm to the user which paths are now claimed. Release them at the end with `/release`.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Version-control command — git workflow + connect a remote (GitHub/GitLab/other) with the CLI, fully integrated.
|
|
3
|
+
argument-hint: [status | setup-remote | new-branch <name> | commit | pr | sync | release]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 🔧 Git / Version Control
|
|
7
|
+
|
|
8
|
+
The disciplined git workflow for this project, integrated with the kit's hooks
|
|
9
|
+
(`commit-msg` enforces Conventional Commits, `pre-push` blocks real conflicts)
|
|
10
|
+
and commands (`/worktree-new`, `/close-version`). Always start by reading the
|
|
11
|
+
facts: `node contextkit/tools/scripts/git.mjs status`.
|
|
12
|
+
|
|
13
|
+
Act on **$ARGUMENTS**:
|
|
14
|
+
|
|
15
|
+
## status (default)
|
|
16
|
+
Run `git.mjs status` and summarize: repo/commits, branch, remote + provider,
|
|
17
|
+
ahead/behind, and whether `gh`/`glab` are installed + authed. Flag what's missing
|
|
18
|
+
and recommend the single next action.
|
|
19
|
+
|
|
20
|
+
## setup-remote — the decision tree (detect → connect or create)
|
|
21
|
+
**Always start by detecting** — read `git.mjs status` (`remoteUrl`, `isRepo`,
|
|
22
|
+
`hasCommits`, `cli`). Then follow the branch that matches:
|
|
23
|
+
|
|
24
|
+
**0. Not a git repo yet?** → `git init` first (and make an initial commit once
|
|
25
|
+
there are files).
|
|
26
|
+
|
|
27
|
+
**A. A remote ALREADY exists** (`remoteUrl` not null) → say so, show the URL +
|
|
28
|
+
provider, confirm it's the intended one, and stop. Nothing to set up. (Only fix
|
|
29
|
+
it if the user says it's wrong.)
|
|
30
|
+
|
|
31
|
+
**B. No remote → ASK: "Do you already have a repository for this
|
|
32
|
+
(GitHub/GitLab/other) to connect, or should we create a new one?"**
|
|
33
|
+
|
|
34
|
+
- **B1 — they HAVE one to connect** → ask for the URL (or `owner/repo`) and wire
|
|
35
|
+
it: `git remote add origin <url>`, then `git fetch origin` and either
|
|
36
|
+
`git push -u origin <branch>` (local has the history) or
|
|
37
|
+
`git pull --rebase origin <default>` (remote has history) — reconcile if both
|
|
38
|
+
do, keeping BOTH sides.
|
|
39
|
+
|
|
40
|
+
- **B2 — they DON'T have one → suggest creating it.** Ask provider
|
|
41
|
+
(GitHub/GitLab/other) + visibility (**private by default**; public is hard to
|
|
42
|
+
undo — confirm explicitly). Ensure the CLI is installed + authed first (offer
|
|
43
|
+
the OS-aware install; confirm before installing):
|
|
44
|
+
- **GitHub** → `gh`: macOS `brew install gh` · Windows `winget install
|
|
45
|
+
GitHub.cli` · Linux cli.github.com. Auth: `gh auth login`.
|
|
46
|
+
- **GitLab** → `glab`: macOS `brew install glab` · Windows `winget install
|
|
47
|
+
glab` · Linux gitlab.com/gitlab-org/cli. Auth: `glab auth login`.
|
|
48
|
+
Then create + wire + push (confirm — outward-facing):
|
|
49
|
+
- GitHub: `gh repo create <name> --private --source . --remote origin --push`
|
|
50
|
+
- GitLab: `glab repo create <name> --private` then `git push -u origin <branch>`
|
|
51
|
+
- other: create in the UI, then `git remote add origin <url>` + push.
|
|
52
|
+
|
|
53
|
+
Finally, recommend branch protection on the default branch (PRs + green CI before
|
|
54
|
+
merge). Never push/create without the user's explicit OK.
|
|
55
|
+
|
|
56
|
+
## new-branch <name>
|
|
57
|
+
`git checkout -b <type>/<name>` using a Conventional type
|
|
58
|
+
(feat/fix/chore/docs/refactor/test/ci/build/perf/style/revert). Never work on the
|
|
59
|
+
default branch directly.
|
|
60
|
+
|
|
61
|
+
## commit
|
|
62
|
+
Stage intentionally and commit with Conventional Commits
|
|
63
|
+
(`<type>(<scope>)?: <subject>`, ≤100 chars, no trailing period) — the `commit-msg`
|
|
64
|
+
hook enforces this; `[skip-cc]` bypasses. Keep commits small and coherent.
|
|
65
|
+
|
|
66
|
+
## pr
|
|
67
|
+
**First, re-check sync** [ADR-0026]: `node contextkit/tools/scripts/sync-check.mjs
|
|
68
|
+
prepr`. It re-confirms you are not behind the default branch (rebase first if you
|
|
69
|
+
are) and detects whether an **open PR already exists for this branch** — if so,
|
|
70
|
+
just push to update it instead of creating a duplicate. Then push the branch
|
|
71
|
+
(`git push -u origin <branch>` — the `pre-push` hook checks for conflicts first)
|
|
72
|
+
and open a PR: `gh pr create` / `glab mr create`. Summarize the change; wait for
|
|
73
|
+
CI green before merge. Don't push to the default branch directly.
|
|
74
|
+
|
|
75
|
+
## sync
|
|
76
|
+
`git fetch` then `git pull --rebase origin <default>` to replay your work on top
|
|
77
|
+
and resolve conflicts cleanly (keeping BOTH sides' changes — never clobber).
|
|
78
|
+
|
|
79
|
+
## release
|
|
80
|
+
Defer to `/close-version <x.y.z>` (CHANGELOG + tag); a `v*` tag triggers the
|
|
81
|
+
release workflow if configured.
|
|
82
|
+
|
|
83
|
+
Confirm before any push, repo creation, or install — those are outward-facing.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Release this session's claim(s) — a specific path, or all of them.
|
|
3
|
+
argument-hint: [path]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> ℹ️ **Paired with `/claim`** (claim → work → release). Manage both as one flow;
|
|
7
|
+
> this command does the release half.
|
|
8
|
+
|
|
9
|
+
Release path claims for this session.
|
|
10
|
+
|
|
11
|
+
- To release a specific path: `node contextkit/tools/scripts/release.mjs $ARGUMENTS`
|
|
12
|
+
- To release everything (no argument): `node contextkit/tools/scripts/release.mjs`
|
|
13
|
+
|
|
14
|
+
Run the appropriate command based on whether `$ARGUMENTS` is empty, then confirm to the user what
|
|
15
|
+
was released. This also regenerates `contextkit/memory/WORKSPACE.md`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a git worktree + branch for a parallel session on the same machine.
|
|
3
|
+
argument-hint: <feature> [base-branch]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Create an isolated worktree so another Claude session can work in parallel without colliding on the
|
|
7
|
+
ledger or on live file edits.
|
|
8
|
+
|
|
9
|
+
Run:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
node contextkit/tools/scripts/worktree-new.mjs $ARGUMENTS
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This creates branch `feat/<feature>` and a sibling worktree directory `../<repo>-<feature>`. Show
|
|
16
|
+
the user the output, including the `code "<path>"` command to open the new worktree in a separate
|
|
17
|
+
window. Remind them: each worktree has its own `.claude/.sessions/`, so the two sessions stay fully
|
|
18
|
+
isolated. When the feature is done: `git push -u origin feat/<feature>` then open a PR.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Watch the active session ledger — what got edited, in order. Optional --follow streams new entries.
|
|
3
|
+
argument-hint: [-f | --follow]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 👀 Watch the active ledger
|
|
7
|
+
|
|
8
|
+
Stream what the **current session** has touched, in the order it touched them.
|
|
9
|
+
Zero-dep, file-based — reads `.claude/.sessions/<active-id>.json` via the
|
|
10
|
+
runtime's `readMostRecentLedger`.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
node contextkit/tools/scripts/watch.mjs # print all entries and exit
|
|
16
|
+
node contextkit/tools/scripts/watch.mjs --follow # stream (re-poll every 500 ms; Ctrl-C to stop)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Output format:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
# session 04b759ee — 17 entries
|
|
23
|
+
[14:02:11] EDIT templates/claude/commands/dev-start.md
|
|
24
|
+
[14:02:14] WRITE templates/contextkit/runtime/providers/review/_adapter.mjs
|
|
25
|
+
[14:02:16] WRITE templates/contextkit/runtime/providers/review/gh.mjs
|
|
26
|
+
...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## When to use it
|
|
30
|
+
|
|
31
|
+
- **Mid-session sanity check.** "What has this session actually edited so
|
|
32
|
+
far?" without opening the ledger JSON in the editor.
|
|
33
|
+
- **Long agent run.** Pair with `--follow` in a second pane to watch a
|
|
34
|
+
sub-agent's progress in real time.
|
|
35
|
+
- **Drift triage.** When the Stop hook nags about unregistered work, run
|
|
36
|
+
`/watch` once to see the footprint before you decide to `/log-session`
|
|
37
|
+
or `/resume`.
|
|
38
|
+
|
|
39
|
+
## What it does *not* do
|
|
40
|
+
|
|
41
|
+
- It does **not** filter by ticket. Ticket-scoped view comes when ticket
|
|
42
|
+
042's per-task scratch convention lands and the `/pipeline` board gains
|
|
43
|
+
a "what touched this ticket?" surface.
|
|
44
|
+
- It does **not** modify state. Pure read.
|
|
45
|
+
- It does **not** invent entries. If the ledger is missing or the active
|
|
46
|
+
session cannot be resolved, the script exits non-zero with a clear
|
|
47
|
+
reason — never prints "0 entries" as a soft success.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ContextDevKit — environment template (ADR-0024)
|
|
2
|
+
#
|
|
3
|
+
# This file is COPIED INTO YOUR PROJECT at contextkit/.env.example. To use
|
|
4
|
+
# it: copy to contextkit/.env (or your project's root .env), fill in values.
|
|
5
|
+
# Then run the kit scripts that need creds with Node's built-in env-file
|
|
6
|
+
# loader (Node 20.6+):
|
|
7
|
+
#
|
|
8
|
+
# node --env-file=contextkit/.env contextkit/tools/scripts/media-gen.mjs image \
|
|
9
|
+
# --prompt "editorial product hero, asymmetric grid" --out hero.png
|
|
10
|
+
#
|
|
11
|
+
# Or copy the variables into your project's existing dotenv setup
|
|
12
|
+
# (Astro / Next / Nuxt / Vite all already read .env).
|
|
13
|
+
#
|
|
14
|
+
# Nothing here is required by default. The kit refuses cleanly with a
|
|
15
|
+
# NO_CREDENTIALS error if you call a media-generation script without
|
|
16
|
+
# the key set, and points you back at this file.
|
|
17
|
+
|
|
18
|
+
# ─── Media generation (ADR-0024) ────────────────────────────────────────
|
|
19
|
+
# Google AI Studio API key — used by both:
|
|
20
|
+
# nano-banana.mjs (image — Imagen)
|
|
21
|
+
# veo.mjs (video — Veo)
|
|
22
|
+
# Get one at: https://aistudio.google.com/apikey
|
|
23
|
+
# GOOGLE_AI_API_KEY=
|
|
24
|
+
|
|
25
|
+
# Per-process cost cap in USD. The adapters keep a running tally and
|
|
26
|
+
# refuse the next call that would push the total over this floor. Leave
|
|
27
|
+
# unset = no cap (you pay for whatever you call).
|
|
28
|
+
# CONTEXTDEVKIT_MEDIA_MAX_USD=5.00
|
|
29
|
+
|
|
30
|
+
# ─── Future home-scoped overrides (optional) ───────────────────────────
|
|
31
|
+
# These are listed for discoverability — the kit reads them from
|
|
32
|
+
# process.env directly, so they can live here or in your shell.
|
|
33
|
+
# CONTEXTDEVKIT_HOME= # override ~/.contextdevkit/ (ADR-0020)
|
|
34
|
+
# CONTEXTDEVKIT_DASHBOARD_PORT= # override /dashboard --watch port (default 4242)
|
|
35
|
+
# CONTEXT_FLEET_FILE= # override the fleet registry path
|
|
36
|
+
# CONTEXT_GIT_TIMEOUT_MS= # override the kit's git command timeout
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# {{MODULE_NAME}} — local context for Claude
|
|
2
|
+
|
|
3
|
+
> Scoped CLAUDE.md for `{{MODULE_PATH}}`. Claude Code loads the file **closest**
|
|
4
|
+
> to the code being edited, so this carries the rules specific to this
|
|
5
|
+
> module/app. It **inherits** the root [`CLAUDE.md`](../../CLAUDE.md) constitution
|
|
6
|
+
> — don't repeat it here; only add what's local.
|
|
7
|
+
> Scaffolded by ContextDevKit ({{DATE}}). Fill in the TODOs.
|
|
8
|
+
|
|
9
|
+
## What this is
|
|
10
|
+
|
|
11
|
+
<!-- One line: this module's role (backend API / web frontend / mobile app /
|
|
12
|
+
shared library / service X) and its single responsibility. -->
|
|
13
|
+
_TODO: describe `{{MODULE_PATH}}` and its role in the system._
|
|
14
|
+
|
|
15
|
+
## Local stack & tooling
|
|
16
|
+
|
|
17
|
+
{{MODULE_STACK}}
|
|
18
|
+
|
|
19
|
+
## Local conventions (what's different here)
|
|
20
|
+
|
|
21
|
+
<!-- Rules that apply ONLY to this module — folder layout, where things go, the
|
|
22
|
+
patterns to follow, the traps to avoid. Examples:
|
|
23
|
+
- Routes are thin controllers; business logic lives in `services/`.
|
|
24
|
+
- Components stay presentational; state/effects go into `hooks/`.
|
|
25
|
+
- Public API of this package is the barrel `src/index.ts` — keep it stable. -->
|
|
26
|
+
- _TODO: add this module's local rules._
|
|
27
|
+
|
|
28
|
+
## Boundaries
|
|
29
|
+
|
|
30
|
+
- **Depends on:** _TODO (which modules/packages this one consumes)._
|
|
31
|
+
- **Consumed by:** _TODO (who depends on this module's public surface)._
|
|
32
|
+
- Changes to the public surface are contract changes — see `/contract-check`.
|
|
33
|
+
|
|
34
|
+
## Pointers
|
|
35
|
+
|
|
36
|
+
- Root constitution & immutable rules: [`CLAUDE.md`](../../CLAUDE.md)
|
|
37
|
+
- Architecture decisions: `contextkit/memory/decisions/`
|
|
38
|
+
- Glossary (naming): `contextkit/memory/GLOSSARY.md`
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# contextkit/ — ContextDevKit platform
|
|
2
|
+
|
|
3
|
+
This folder is the AI-assisted development platform installed by
|
|
4
|
+
[ContextDevKit](https://github.com/reiTavares/ContextDevKit). It is a **bounded
|
|
5
|
+
context** separate from your product code — everything here exists to make
|
|
6
|
+
Claude Code sessions reliable, self-documenting, and consistent across time.
|
|
7
|
+
|
|
8
|
+
## Layout
|
|
9
|
+
|
|
10
|
+
| Path | What |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| `runtime/hooks/` | Claude Code hooks (boot context, edit ledger, drift nudge, L5 gate) |
|
|
13
|
+
| `runtime/config/` | Zero-dep config loader, defaults, paths, settings composer, optional zod schema |
|
|
14
|
+
| `runtime/git-hooks/` | `pre-commit` (reindex), `commit-msg` (Conventional Commits), `pre-push` (block real conflicts) |
|
|
15
|
+
| `runtime/providers/review/` | PR/review CLI adapters (`gh` ships) — see ADR-0021 |
|
|
16
|
+
| `runtime/providers/media/` | Media generation adapters — `nano-banana` (Imagen 3) + `veo` (Veo 3); see ADR-0024 |
|
|
17
|
+
| `runtime/state/` | Canonical `state.json` substrate for tasks + pipeline runs (ADR-0015) |
|
|
18
|
+
| `tools/scripts/` | 50+ helpers (reindex, dashboard, sync-check, audits, media-gen, …) |
|
|
19
|
+
| `memory/decisions/` | ADRs — the immutable *why* |
|
|
20
|
+
| `memory/sessions/` | One markdown file per work session — the *what* |
|
|
21
|
+
| `memory/SESSIONS.md` | Auto-generated index (do not hand-edit) |
|
|
22
|
+
| `memory/WORKSPACE.md` | Auto-generated active-claims index (do not hand-edit) |
|
|
23
|
+
| `memory/GLOSSARY.md` | Domain term ↔ code identifier |
|
|
24
|
+
| `pipeline/` | DevPipeline lanes: `backlog/ → working/ → testing/ → conclusion/` |
|
|
25
|
+
| `workflows/playbooks/` | Reusable procedures (tanstack, landing-page, seo-aiso, tech-debt-sweep, …) |
|
|
26
|
+
| `squads/agent-forge/` | The L6+ "agent that builds agents" (Agent Package pipeline) |
|
|
27
|
+
| `config.json` | Level + ledger path lists + L5 params (edit via `/context-config`) |
|
|
28
|
+
| `.env.example` | Optional credentials template (`/media-gen` Google AI Studio keys) |
|
|
29
|
+
|
|
30
|
+
## The 7 levels
|
|
31
|
+
|
|
32
|
+
The active level is `config.json` → `level`. See `/context-level` to inspect or
|
|
33
|
+
change it. Higher levels add capability — earlier ones stay active.
|
|
34
|
+
|
|
35
|
+
1. **Memory** — boot context, session log, ADRs, changelog.
|
|
36
|
+
2. **Ledger** — drift detection (tracks edits, nudges you to `/log-session`).
|
|
37
|
+
3. **Multi-session** — claims, worktrees, derived indices, git hooks.
|
|
38
|
+
4. **Squads** — 28 specialized sub-agents organised into 7 squads (devteam,
|
|
39
|
+
qa-team, design-team with `seo-specialist` + `landing-architect`,
|
|
40
|
+
security-team, compliance-team, ops-team, agent-forge).
|
|
41
|
+
5. **Proactive** — `/simulate-impact` gate on high-risk paths, tech-debt sweep,
|
|
42
|
+
distill-detect nudge, contract drift.
|
|
43
|
+
6. **Autonomy & Insight** — `/ship`, `/retro`, `/context-stats`, agent-forge squad.
|
|
44
|
+
7. **Ecosystem** — `/fleet` multi-repo control plane, `/tune-agents`,
|
|
45
|
+
visual tests, playbook runner.
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- **Node.js ≥ 18** (the hooks/scripts — Levels 1–3 need zero npm packages).
|
|
50
|
+
**Node 20.6+** unlocks `--env-file` for the media-gen credentials flow.
|
|
51
|
+
- **git** (for divergence detection and Level 3 git hooks).
|
|
52
|
+
- `zod` is optional, only for strict `/context-config` validation at Level 5.
|
|
53
|
+
- *Optional:* `gh` (GitHub CLI) for sync-check PR awareness;
|
|
54
|
+
`GOOGLE_AI_API_KEY` for `/media-gen`.
|
|
55
|
+
|
|
56
|
+
## Updating the engine
|
|
57
|
+
|
|
58
|
+
Re-run the kit installer over the project to pull engine updates without losing
|
|
59
|
+
your memory or config:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx contextdevkit@latest --target . --update
|
|
63
|
+
# or, offline / from GitHub:
|
|
64
|
+
npx github:reiTavares/ContextDevKit --target . --update
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Quick references
|
|
68
|
+
|
|
69
|
+
- **Slash commands** — see `.claude/commands/README.md` for the taxonomy.
|
|
70
|
+
- **Provider adapters** — `runtime/providers/{review,media}/_adapter.mjs`
|
|
71
|
+
document the contract.
|
|
72
|
+
- **Playbooks** — `workflows/playbooks/` for reusable procedures.
|
|
73
|
+
- **Setup credentials for `/media-gen`** — copy `.env.example` to `.env`, fill
|
|
74
|
+
in `GOOGLE_AI_API_KEY`, run with `node --env-file=contextkit/.env ...`.
|