@friedbotstudio/create-baseline 0.1.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/LICENSE +202 -0
- package/README.md +222 -0
- package/bin/cli.js +247 -0
- package/obj/template/.claude/agents/swarm-worker.md +52 -0
- package/obj/template/.claude/bin/LICENSE +201 -0
- package/obj/template/.claude/bin/NOTICE +48 -0
- package/obj/template/.claude/commands/approve-spec.md +29 -0
- package/obj/template/.claude/commands/approve-swarm.md +27 -0
- package/obj/template/.claude/commands/grant-commit.md +19 -0
- package/obj/template/.claude/commands/init-project.md +191 -0
- package/obj/template/.claude/hooks/artifact_template_guard.sh +141 -0
- package/obj/template/.claude/hooks/consent_gate_grant.sh +89 -0
- package/obj/template/.claude/hooks/destructive_cmd_guard.sh +42 -0
- package/obj/template/.claude/hooks/env_guard.sh +36 -0
- package/obj/template/.claude/hooks/git_commit_guard.sh +93 -0
- package/obj/template/.claude/hooks/harness_continuation.sh +121 -0
- package/obj/template/.claude/hooks/lib/__pycache__/resume_writer.cpython-314.pyc +0 -0
- package/obj/template/.claude/hooks/lib/common.sh +328 -0
- package/obj/template/.claude/hooks/lib/resume_writer.py +341 -0
- package/obj/template/.claude/hooks/lint_runner.sh +55 -0
- package/obj/template/.claude/hooks/memory_pre_compact.sh +36 -0
- package/obj/template/.claude/hooks/memory_session_start.sh +244 -0
- package/obj/template/.claude/hooks/memory_stop.sh +173 -0
- package/obj/template/.claude/hooks/plantuml_syntax_guard.sh +161 -0
- package/obj/template/.claude/hooks/process_lifecycle_guard.sh +89 -0
- package/obj/template/.claude/hooks/setup_guard.sh +50 -0
- package/obj/template/.claude/hooks/spec_approval_guard.sh +81 -0
- package/obj/template/.claude/hooks/spec_design_calls_guard.sh +183 -0
- package/obj/template/.claude/hooks/spec_diagram_presence_guard.sh +141 -0
- package/obj/template/.claude/hooks/swarm_approval_guard.sh +39 -0
- package/obj/template/.claude/hooks/swarm_boundary_guard.sh +136 -0
- package/obj/template/.claude/hooks/tdd_order_guard.sh +176 -0
- package/obj/template/.claude/hooks/test_runner.sh +75 -0
- package/obj/template/.claude/hooks/tests/fixtures/ac008_byte_equal_reference.txt +12 -0
- package/obj/template/.claude/hooks/tests/memory_session_start_test.sh +285 -0
- package/obj/template/.claude/hooks/track_guard.sh +127 -0
- package/obj/template/.claude/hooks/verify_pass_guard.sh +88 -0
- package/obj/template/.claude/memory/README.md +108 -0
- package/obj/template/.claude/memory/_pending.md +15 -0
- package/obj/template/.claude/memory/_resume.md +12 -0
- package/obj/template/.claude/memory/conventions.md +26 -0
- package/obj/template/.claude/memory/decisions.md +29 -0
- package/obj/template/.claude/memory/landmarks.md +26 -0
- package/obj/template/.claude/memory/landmines.md +27 -0
- package/obj/template/.claude/memory/libraries.md +27 -0
- package/obj/template/.claude/memory/pending-questions.md +28 -0
- package/obj/template/.claude/project.json +221 -0
- package/obj/template/.claude/settings.json +110 -0
- package/obj/template/.claude/skills/archive/SKILL.md +48 -0
- package/obj/template/.claude/skills/archive/archive.sh +145 -0
- package/obj/template/.claude/skills/audit-baseline/SKILL.md +80 -0
- package/obj/template/.claude/skills/audit-baseline/audit.sh +919 -0
- package/obj/template/.claude/skills/brd/SKILL.md +44 -0
- package/obj/template/.claude/skills/brd/template.md +83 -0
- package/obj/template/.claude/skills/chore/SKILL.md +99 -0
- package/obj/template/.claude/skills/claude-automation-recommender/LICENSE +202 -0
- package/obj/template/.claude/skills/claude-automation-recommender/NOTICE +69 -0
- package/obj/template/.claude/skills/claude-automation-recommender/SKILL.md +358 -0
- package/obj/template/.claude/skills/claude-automation-recommender/references/hooks-patterns.md +226 -0
- package/obj/template/.claude/skills/claude-automation-recommender/references/mcp-servers.md +263 -0
- package/obj/template/.claude/skills/claude-automation-recommender/references/plugins-reference.md +98 -0
- package/obj/template/.claude/skills/claude-automation-recommender/references/skills-reference.md +408 -0
- package/obj/template/.claude/skills/claude-automation-recommender/references/subagent-templates.md +181 -0
- package/obj/template/.claude/skills/code-structure/SKILL.md +204 -0
- package/obj/template/.claude/skills/commit/SKILL.md +21 -0
- package/obj/template/.claude/skills/copywriting/SKILL.md +252 -0
- package/obj/template/.claude/skills/copywriting/evals/evals.json +111 -0
- package/obj/template/.claude/skills/copywriting/references/ai-writing-detection.md +200 -0
- package/obj/template/.claude/skills/copywriting/references/copy-frameworks.md +344 -0
- package/obj/template/.claude/skills/copywriting/references/natural-transitions.md +272 -0
- package/obj/template/.claude/skills/design-ui/SKILL.md +175 -0
- package/obj/template/.claude/skills/design-ui/references/design-vs-development.md +89 -0
- package/obj/template/.claude/skills/design-ui/references/intent-table.md +64 -0
- package/obj/template/.claude/skills/design-ui/references/orchestration.md +121 -0
- package/obj/template/.claude/skills/design-ui/references/state-machine.md +125 -0
- package/obj/template/.claude/skills/document/SKILL.md +66 -0
- package/obj/template/.claude/skills/documentation/SKILL.md +50 -0
- package/obj/template/.claude/skills/harness/SKILL.md +169 -0
- package/obj/template/.claude/skills/humanizer/SKILL.md +489 -0
- package/obj/template/.claude/skills/humanizer/references/ai-writing-detection.md +208 -0
- package/obj/template/.claude/skills/impeccable/PROJECT_NOTES.md +22 -0
- package/obj/template/.claude/skills/impeccable/SKILL.md +153 -0
- package/obj/template/.claude/skills/impeccable/agents/openai.yaml +4 -0
- package/obj/template/.claude/skills/impeccable/reference/adapt.md +190 -0
- package/obj/template/.claude/skills/impeccable/reference/animate.md +173 -0
- package/obj/template/.claude/skills/impeccable/reference/audit.md +134 -0
- package/obj/template/.claude/skills/impeccable/reference/bolder.md +113 -0
- package/obj/template/.claude/skills/impeccable/reference/brand.md +104 -0
- package/obj/template/.claude/skills/impeccable/reference/clarify.md +174 -0
- package/obj/template/.claude/skills/impeccable/reference/cognitive-load.md +106 -0
- package/obj/template/.claude/skills/impeccable/reference/color-and-contrast.md +105 -0
- package/obj/template/.claude/skills/impeccable/reference/colorize.md +154 -0
- package/obj/template/.claude/skills/impeccable/reference/craft.md +138 -0
- package/obj/template/.claude/skills/impeccable/reference/critique.md +213 -0
- package/obj/template/.claude/skills/impeccable/reference/delight.md +302 -0
- package/obj/template/.claude/skills/impeccable/reference/distill.md +111 -0
- package/obj/template/.claude/skills/impeccable/reference/document.md +427 -0
- package/obj/template/.claude/skills/impeccable/reference/extract.md +70 -0
- package/obj/template/.claude/skills/impeccable/reference/harden.md +347 -0
- package/obj/template/.claude/skills/impeccable/reference/heuristics-scoring.md +234 -0
- package/obj/template/.claude/skills/impeccable/reference/interaction-design.md +195 -0
- package/obj/template/.claude/skills/impeccable/reference/layout.md +141 -0
- package/obj/template/.claude/skills/impeccable/reference/live.md +513 -0
- package/obj/template/.claude/skills/impeccable/reference/motion-design.md +99 -0
- package/obj/template/.claude/skills/impeccable/reference/onboard.md +234 -0
- package/obj/template/.claude/skills/impeccable/reference/optimize.md +258 -0
- package/obj/template/.claude/skills/impeccable/reference/overdrive.md +130 -0
- package/obj/template/.claude/skills/impeccable/reference/personas.md +178 -0
- package/obj/template/.claude/skills/impeccable/reference/polish.md +232 -0
- package/obj/template/.claude/skills/impeccable/reference/product.md +62 -0
- package/obj/template/.claude/skills/impeccable/reference/quieter.md +99 -0
- package/obj/template/.claude/skills/impeccable/reference/responsive-design.md +114 -0
- package/obj/template/.claude/skills/impeccable/reference/shape.md +136 -0
- package/obj/template/.claude/skills/impeccable/reference/spatial-design.md +100 -0
- package/obj/template/.claude/skills/impeccable/reference/teach.md +137 -0
- package/obj/template/.claude/skills/impeccable/reference/typeset.md +124 -0
- package/obj/template/.claude/skills/impeccable/reference/typography.md +159 -0
- package/obj/template/.claude/skills/impeccable/reference/ux-writing.md +107 -0
- package/obj/template/.claude/skills/impeccable/scripts/cleanup-deprecated.mjs +284 -0
- package/obj/template/.claude/skills/impeccable/scripts/command-metadata.json +94 -0
- package/obj/template/.claude/skills/impeccable/scripts/design-parser.mjs +820 -0
- package/obj/template/.claude/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/obj/template/.claude/skills/impeccable/scripts/is-generated.mjs +69 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-accept.mjs +465 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-browser.js +4684 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-inject.mjs +436 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-poll.mjs +187 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-server.mjs +679 -0
- package/obj/template/.claude/skills/impeccable/scripts/live-wrap.mjs +395 -0
- package/obj/template/.claude/skills/impeccable/scripts/live.mjs +247 -0
- package/obj/template/.claude/skills/impeccable/scripts/load-context.mjs +93 -0
- package/obj/template/.claude/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/obj/template/.claude/skills/impeccable/scripts/pin.mjs +214 -0
- package/obj/template/.claude/skills/implement/SKILL.md +83 -0
- package/obj/template/.claude/skills/intake/SKILL.md +46 -0
- package/obj/template/.claude/skills/intake/template.md +61 -0
- package/obj/template/.claude/skills/integrate/SKILL.md +62 -0
- package/obj/template/.claude/skills/memory-flush/SKILL.md +172 -0
- package/obj/template/.claude/skills/memory-flush/sweep.py +286 -0
- package/obj/template/.claude/skills/memory-flush/tests/run.sh +327 -0
- package/obj/template/.claude/skills/prose/SKILL.md +119 -0
- package/obj/template/.claude/skills/rca/SKILL.md +42 -0
- package/obj/template/.claude/skills/rca/template.md +83 -0
- package/obj/template/.claude/skills/research/SKILL.md +75 -0
- package/obj/template/.claude/skills/scenario/SKILL.md +64 -0
- package/obj/template/.claude/skills/scout/SKILL.md +72 -0
- package/obj/template/.claude/skills/security/SKILL.md +75 -0
- package/obj/template/.claude/skills/simplify/SKILL.md +67 -0
- package/obj/template/.claude/skills/spec/SKILL.md +69 -0
- package/obj/template/.claude/skills/spec/template.md +274 -0
- package/obj/template/.claude/skills/spec-diagram-review/SKILL.md +81 -0
- package/obj/template/.claude/skills/spec-lint/SKILL.md +55 -0
- package/obj/template/.claude/skills/spec-lint/lint.sh +218 -0
- package/obj/template/.claude/skills/spec-render/SKILL.md +45 -0
- package/obj/template/.claude/skills/spec-render/render.sh +109 -0
- package/obj/template/.claude/skills/spec-traceability-review/SKILL.md +72 -0
- package/obj/template/.claude/skills/swarm-dispatch/SKILL.md +212 -0
- package/obj/template/.claude/skills/swarm-dispatch/swarm_merge.sh +154 -0
- package/obj/template/.claude/skills/swarm-plan/SKILL.md +90 -0
- package/obj/template/.claude/skills/swarm-plan/validate.sh +181 -0
- package/obj/template/.claude/skills/tdd/SKILL.md +100 -0
- package/obj/template/.claude/skills/technical-tutorials/SKILL.md +569 -0
- package/obj/template/.claude/skills/technical-tutorials/references/audience-context-README.md +53 -0
- package/obj/template/.claude/skills/technical-tutorials/references/audience-context.md +246 -0
- package/obj/template/.claude/skills/technical-tutorials/references/audience-example.md +175 -0
- package/obj/template/.claude/skills/technical-tutorials/references/audience-template.md +152 -0
- package/obj/template/.claude/skills/triage/SKILL.md +55 -0
- package/obj/template/.claude/skills/verify/SKILL.md +74 -0
- package/obj/template/.mcp.json +24 -0
- package/obj/template/CLAUDE.md +327 -0
- package/obj/template/docs/init/seed.md +585 -0
- package/obj/template/manifest.json +214 -0
- package/package.json +48 -0
- package/src/.mcp.template.json +24 -0
- package/src/.npmrc.template +2 -0
- package/src/CLAUDE.template.md +327 -0
- package/src/agents/swarm-worker.template.md +51 -0
- package/src/cli/conflict.js +31 -0
- package/src/cli/doctor.js +152 -0
- package/src/cli/install.js +93 -0
- package/src/cli/io.js +27 -0
- package/src/cli/manifest.js +38 -0
- package/src/cli/mcp.js +54 -0
- package/src/cli/merge.js +107 -0
- package/src/cli/plantuml.js +121 -0
- package/src/cli/util.js +10 -0
- package/src/memory/_pending.template.md +15 -0
- package/src/memory/_resume.template.md +12 -0
- package/src/memory/conventions.template.md +26 -0
- package/src/memory/decisions.template.md +29 -0
- package/src/memory/landmarks.template.md +26 -0
- package/src/memory/landmines.template.md +27 -0
- package/src/memory/libraries.template.md +27 -0
- package/src/memory/pending-questions.template.md +28 -0
- package/src/project.template.json +221 -0
- package/src/seed.template.md +585 -0
- package/src/settings.template.json +110 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swarm-worker
|
|
3
|
+
description: Execute a single swarm task in an isolated git worktree. Receive a fully-specified recipe from the main context — a scenario recipe plus an implementation contract — then run `Skill(scenario)` followed by `Skill(implement)` and report JSON status. Make no design decisions and do not expand scope. Invoked exclusively by `/swarm-dispatch`; never elsewhere.
|
|
4
|
+
tools: Read, Write, Edit, MultiEdit, Bash, Skill, Grep, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
skills:
|
|
7
|
+
- scenario
|
|
8
|
+
- implement
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are a swarm worker. The main context has already decided what tests to write, what code to write, in which files. Your job is to execute that recipe — not to expand it, second-guess it, or design around it.
|
|
12
|
+
|
|
13
|
+
This subagent operates under the **In-Session Constitution** (`CLAUDE.md`) and the **Genesis Prompt** (`docs/init/seed.md`). Article II of the constitution scopes your authority: *Decisions live in main context; subagents only execute pre-decided recipes.* You SHALL NOT exceed that scope.
|
|
14
|
+
|
|
15
|
+
# Operating envelope
|
|
16
|
+
|
|
17
|
+
Your worktree is **physically isolated** from the rest of the repo (Art. IV phase 6c, swarm worktree mode). Files you write are merged back to main only if they fall inside your declared `write_set`. Anything outside SHALL fail the merge audit and your task SHALL be marked failed. The orchestrator preserves the worktree on audit failure for inspection.
|
|
18
|
+
|
|
19
|
+
# Inputs (provided by the caller)
|
|
20
|
+
|
|
21
|
+
The caller's prompt SHALL contain two recipes and the swarm metadata. You SHALL execute against them verbatim — you SHALL NOT improvise, expand, or substitute.
|
|
22
|
+
|
|
23
|
+
1. **Scenario recipe** — the list of failing tests to write. Each entry has `name`, `covers`, `assertion`, `fixtures`. The recipe also names an `out-of-scope` list and a `test target paths` field.
|
|
24
|
+
2. **Implementation contract** — the failing test paths (after step 1 produces them), the `write_set` (exact source paths you may touch), the behavior contract (spec excerpts), and project conventions.
|
|
25
|
+
3. **Swarm metadata** — `task_id`, `slug`, the AC list this task covers, the relevant spec excerpt.
|
|
26
|
+
|
|
27
|
+
# Method (mandatory sequence)
|
|
28
|
+
|
|
29
|
+
1. **Invoke `Skill(scenario)`** with the scenario recipe + test target paths + style anchors from the caller's prompt. Capture the test files written and the per-test verdict (`RED`, `PASS_UNEXPECTEDLY`, `ERROR`).
|
|
30
|
+
2. **Halt condition.** If any test in step 1 returned `PASS_UNEXPECTEDLY` or `ERROR`, you SHALL stop. Set status to `failed` and put the test name + reason in `note`. SHALL NOT proceed to implementation.
|
|
31
|
+
3. **Invoke `Skill(implement)`** with the failing test paths from step 1, the `write_set`, the behavior contract, and the project conventions — verbatim from the caller's prompt. The skill runs the RALPH loop (capped at 5) and returns `GREEN`, `RED`, or `BLOCKED`.
|
|
32
|
+
4. **Report JSON** as your final output line — exactly this shape, nothing else after it:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{"task_id": "<T-XXX>", "status": "done" | "failed", "files_touched": ["..."], "note": "<one short line>"}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- `status: "done"` SHALL be reported only if `Skill(implement)` returned `GREEN`.
|
|
39
|
+
- `status: "failed"` SHALL be reported for `RED`, `BLOCKED`, scenario halts, or any other stop.
|
|
40
|
+
- `files_touched` SHALL be the union of test files (from `scenario`) and source files (from `implement`) actually modified.
|
|
41
|
+
- `note` SHALL be one short human-readable line explaining the outcome.
|
|
42
|
+
|
|
43
|
+
# Constitutional constraints (binding — Art. II)
|
|
44
|
+
|
|
45
|
+
- **You SHALL NOT pick scenarios.** The recipe is given. If it is incomplete or ambiguous, set `failed` with the gap named in `note`. SHALL NOT improvise scenarios.
|
|
46
|
+
- **You SHALL NOT pick architecture.** The contract is given. If it conflicts with itself, set `failed` with the conflict named in `note`. SHALL NOT redesign.
|
|
47
|
+
- **You SHALL NEVER write outside the `write_set`.** Even if you believe a fix requires it. If a write outside the set is genuinely necessary, set `failed` with the path in `note` — the orchestrator decides whether to re-plan.
|
|
48
|
+
- **You SHALL NEVER invoke another subagent.** You are a leaf worker. The skills you use (`scenario`, `implement`, plus any project-specific skills the template was rendered with) run inside your own context.
|
|
49
|
+
- **You SHALL NEVER run `git commit` or `git push`** (Art. VII). Merge is the orchestrator's responsibility via `swarm_merge.sh`.
|
|
50
|
+
- **The final JSON line is the swarm protocol** and overrides any reporting habit. SHALL NOT wrap it in prose. SHALL NOT add commentary after it.
|
|
51
|
+
|
|
52
|
+
If the caller's prompt does not provide both recipes, or the recipes contradict each other, you SHALL stop at step 1 and report `failed` with the gap named — do not attempt to fill in missing inputs from training data or context recall.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend,
|
|
172
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
173
|
+
or claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
200
|
+
implied. See the License for the specific language governing permissions
|
|
201
|
+
and limitations under the License.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
create-baseline — Claude Code baseline scaffolder
|
|
2
|
+
Copyright 2026 Konark Bhardwaj
|
|
3
|
+
|
|
4
|
+
This product includes software developed by The PlantUML Project
|
|
5
|
+
(https://plantuml.com/).
|
|
6
|
+
|
|
7
|
+
================================================================================
|
|
8
|
+
PlantUML — deferred-fetch model
|
|
9
|
+
================================================================================
|
|
10
|
+
|
|
11
|
+
This baseline depends on PlantUML for diagram syntax validation
|
|
12
|
+
(`plantuml_syntax_guard` hook) and rendering (`/spec-render` skill). The
|
|
13
|
+
PlantUML jar itself is NOT bundled in this package; it is fetched at install
|
|
14
|
+
time from the upstream GitHub release, with the bytes verified against a
|
|
15
|
+
pinned sha256 before being written to disk.
|
|
16
|
+
|
|
17
|
+
Upstream artifact: plantuml-asl-1.2026.2.jar
|
|
18
|
+
Upstream URL: https://github.com/plantuml/plantuml/releases/download/v1.2026.2/plantuml-asl-1.2026.2.jar
|
|
19
|
+
Pinned sha256: c348f6a26d999f81fd05b5d49834bb70df9cf35fab0939c4edecb0909e64022b
|
|
20
|
+
Pinned size: 19,395,808 bytes
|
|
21
|
+
Local install path: <target>/.claude/bin/plantuml.jar
|
|
22
|
+
Upstream license: Apache License, Version 2.0 (the `plantuml-asl-*.jar`
|
|
23
|
+
build is the explicit Apache-only redistribution variant
|
|
24
|
+
maintained by the PlantUML project for compatibility with
|
|
25
|
+
Apache 2.0 redistribution requirements; see the LICENSE
|
|
26
|
+
file in this directory for the full Apache 2.0 text).
|
|
27
|
+
|
|
28
|
+
The fetcher (src/cli/plantuml.js) auto-detects an existing system `plantuml`
|
|
29
|
+
binary on PATH and skips the download in that case. The flags `--no-plantuml`
|
|
30
|
+
and `--require-plantuml` modify behavior: the former disables the fetch
|
|
31
|
+
entirely, the latter promotes any fetch failure (network error or sha256
|
|
32
|
+
mismatch) to exit code 4.
|
|
33
|
+
|
|
34
|
+
================================================================================
|
|
35
|
+
Why this NOTICE preserves the deferred-fetch framing
|
|
36
|
+
================================================================================
|
|
37
|
+
|
|
38
|
+
Apache 2.0 §4(d) requires that any pre-existing NOTICE file in the upstream
|
|
39
|
+
distribution be preserved in derivative works. The `plantuml-asl-1.2026.2.jar`
|
|
40
|
+
artifact carries Apache 2.0 licensing throughout; its META-INF may contain
|
|
41
|
+
upstream attribution that should propagate forward when this baseline ships.
|
|
42
|
+
This NOTICE file is the in-package record of that attribution, even though
|
|
43
|
+
the jar itself is fetched rather than redistributed by this package.
|
|
44
|
+
|
|
45
|
+
If you are auditing this package for compliance: the jar is the upstream
|
|
46
|
+
artifact identified above, fetched verbatim from the upstream URL, byte-equal
|
|
47
|
+
to the pinned sha256. This package redistributes the LICENSE and this NOTICE
|
|
48
|
+
(both small text files) but not the jar.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Record human approval of a spec. The Spec Approval Guard hook blocks Claude from ever writing approval tokens; this command is the only sanctioned path. Must be user-invoked.
|
|
3
|
+
argument-hint: "<slug | path-to-spec>"
|
|
4
|
+
allowed-tools: Read, Bash(mkdir:*), Bash(date:*), Bash(basename:*), Bash(git:*), Write
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The user has reviewed and approved the spec referenced by `$ARGUMENTS`. Record approval.
|
|
9
|
+
|
|
10
|
+
How this works structurally: when the user typed `/approve-spec <arg>`, the `consent_gate_grant` UserPromptSubmit hook ran *before* this body was passed to Claude and wrote a short-lived consent marker at `.claude/state/.spec_approval_grant` whose slug is the bare slug derived from `<arg>`. The `spec_approval_guard` PreToolUse hook reads that marker on the approval-token Write and allows it when the marker is fresh and the approval filename's bare slug matches. Claude cannot forge the marker — that's what makes the gate structural.
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
|
|
14
|
+
1. **Derive the bare slug** from `$ARGUMENTS`:
|
|
15
|
+
- `slug="${ARGUMENTS##*/}"` (strip any directory prefix)
|
|
16
|
+
- `slug="${slug%.md}"` (strip a trailing `.md`)
|
|
17
|
+
The same canonicalization runs inside `consent_gate_grant`, so the marker slug and the expected slug always agree.
|
|
18
|
+
2. **Resolve the spec path**:
|
|
19
|
+
- If `$ARGUMENTS` contains a `/`, treat it as a path (absolute or relative to repo root).
|
|
20
|
+
- Otherwise the path is `docs/specs/<slug>.md`.
|
|
21
|
+
Verify the spec file exists at the resolved path. If not, stop and ask for the correct slug or path.
|
|
22
|
+
3. **Write the approval token** to `.claude/state/spec_approvals/<slug>.approval` with:
|
|
23
|
+
- Line 1: `APPROVED`
|
|
24
|
+
- Line 2: epoch timestamp (`date +%s`)
|
|
25
|
+
- Line 3: absolute path to the spec file
|
|
26
|
+
- Line 4: git short SHA of the spec file at this moment (if in a git repo; use `git log -1 --format=%h -- "<resolved-path>"`, otherwise `N/A`)
|
|
27
|
+
4. Confirm to the user: "Approved spec `<slug>`. Approval token written to `.claude/state/spec_approvals/<slug>.approval`. Downstream phases that depend on this spec may now proceed."
|
|
28
|
+
|
|
29
|
+
Do NOT mark the spec itself as "Approved" inside the markdown — the Spec Approval Guard hook blocks that. The approval token is the authoritative record.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Record human approval of a swarm plan. swarm-dispatch will not run until this approval token exists. Must be user-invoked — Claude cannot approve.
|
|
3
|
+
argument-hint: "<slug — matches .claude/state/swarm/<slug>.json; .md is stripped if present>"
|
|
4
|
+
allowed-tools: Read, Bash(mkdir:*), Bash(date:*), Bash(basename:*), Write
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The user has reviewed the swarm plan referenced by `$ARGUMENTS` and approved it for dispatch.
|
|
9
|
+
|
|
10
|
+
How this works structurally: when the user typed `/approve-swarm <slug>`, the `consent_gate_grant` UserPromptSubmit hook ran *before* this body was passed to Claude and wrote a short-lived consent marker at `.claude/state/.swarm_approval_grant` whose slug is the bare slug derived from `<arg>`. The `swarm_approval_guard` PreToolUse hook reads that marker on the approval-token Write and allows it when the marker is fresh and the approval filename's bare slug matches. Claude cannot forge the marker — that's what makes the gate structural.
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
|
|
14
|
+
1. **Derive the bare slug** from `$ARGUMENTS` defensively (in case the user passed a path or a `.md`-suffixed name):
|
|
15
|
+
- `slug="${ARGUMENTS##*/}"` (strip any directory prefix)
|
|
16
|
+
- `slug="${slug%.md}"` (strip a trailing `.md`)
|
|
17
|
+
The same canonicalization runs inside `consent_gate_grant`.
|
|
18
|
+
2. Verify the plan exists at `.claude/state/swarm/<slug>.json`. If not, stop and ask for the correct slug.
|
|
19
|
+
3. Read the plan and confirm it has `status: "planned"` and a non-null `waves` array (i.e., the validator ran). If not, tell the user to re-run `/swarm-plan` first.
|
|
20
|
+
4. Write `.claude/state/swarm_approvals/<slug>.approval` with:
|
|
21
|
+
- Line 1: `APPROVED`
|
|
22
|
+
- Line 2: epoch timestamp (`date +%s`)
|
|
23
|
+
- Line 3: plan path (`.claude/state/swarm/<slug>.json`)
|
|
24
|
+
- Line 4: task count + wave count from the plan (e.g., `tasks=7 waves=3`)
|
|
25
|
+
5. Confirm to the user: "Swarm plan approved for `<slug>`. Run `/swarm-dispatch <slug>` to begin parallel execution. Tasks declared at plan time are the ONLY files each wave may write to — the boundary guard enforces this."
|
|
26
|
+
|
|
27
|
+
Do NOT mark the plan file itself as approved in any status field — the approval token is the authoritative record (mirrors /approve-spec).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Grant consent for Claude to run `git commit`. Valid for 5 minutes. Required by the Git Commit Guard hook.
|
|
3
|
+
argument-hint: "[optional note]"
|
|
4
|
+
allowed-tools: Bash(mkdir:*), Bash(date:*), Bash(tee:*), Bash(git:*), Write
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Write a consent token to `.claude/state/commit_consent` so the Git Commit Guard hook allows the next `git commit`. The token is the current UNIX epoch timestamp on line 1; any optional note goes on line 2.
|
|
9
|
+
|
|
10
|
+
How this works structurally: when the user typed `/grant-commit`, the `consent_gate_grant` UserPromptSubmit hook ran *before* this body was passed to Claude and wrote a short-lived consent marker at `.claude/state/.commit_consent_grant`. The `git_commit_guard` PreToolUse hook (Write matcher) reads that marker and allows Claude to write the consent file because the marker is fresh. Claude cannot forge the marker — that's what makes the gate structural. The Bash-matcher leg of the same guard then enforces the consent token on the actual `git commit` invocation.
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
|
|
14
|
+
1. **Git-repo precheck.** Run `git rev-parse --is-inside-work-tree 2>/dev/null`. If the exit status is non-zero, this project is not a git repository: refuse to write the consent token and tell the user "Not a git repository — `/grant-commit` is inapplicable. Per CLAUDE.md Article IV, gate C and `commit` are auto-excepted on non-git projects; the workflow ends after `/archive`. Persistence outside git is your responsibility." Stop here.
|
|
15
|
+
2. Run `date +%s` to get the current epoch.
|
|
16
|
+
3. Write the epoch (and the optional note `$ARGUMENTS` on line 2 if non-empty) to `.claude/state/commit_consent`, overwriting any prior token.
|
|
17
|
+
4. Confirm to the user: "Commit consent granted at <epoch>, valid for 300s (until <HH:MM:SS local>). The next `git commit` will be allowed; forbidden flags (push, --amend, --no-verify, reset --hard, etc.) remain blocked regardless."
|
|
18
|
+
|
|
19
|
+
Do not run `git commit` yourself in this command. The user asks explicitly when they want a commit; this command only opens the window.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Configure the baseline for this specific project. Invokes the `scout` skill, then `claude-automation-recommender`, populates `.claude/project.json`, pre-creates lazy directories, re-renders `swarm-worker.md` from its template with any stack-specific skills appended, appends a §16 addendum to `docs/init/seed.md`, runs `/audit-baseline`, and asks the user to restart Claude Code so changes take effect. Until this runs, the test/lint runner hooks emit guidance only.
|
|
3
|
+
argument-hint: "[optional: stack hint, e.g. 'next.js + vitest' — usually unnecessary, auto-detected]"
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Task, Skill, AskUserQuestion, Glob, Grep
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# `/init-project` — bootstrap the baseline for THIS project
|
|
9
|
+
|
|
10
|
+
User-only command. The 9-step protocol below mirrors `seed.md` §13. Each step is shown to the user; nothing happens silently.
|
|
11
|
+
|
|
12
|
+
Skip steps already completed (e.g., re-runs after `configured: true`). Re-runs **replace** the §16 addendum wholesale; manual notes belong in a sibling section.
|
|
13
|
+
|
|
14
|
+
Log every step transition to `.claude/state/init/<UTC-timestamp>.log` so partial failures and re-runs are debuggable.
|
|
15
|
+
|
|
16
|
+
## Step 1 — Welcome
|
|
17
|
+
|
|
18
|
+
- Print one line confirming you're at the repo root: `pwd`, then list `.mcp.json`, `CLAUDE.md`, `.claude/`.
|
|
19
|
+
- Read `.claude/project.json → configured`. Tell the user one of:
|
|
20
|
+
- `configured: false` → "First run. The baseline is in project-agnostic mode. I'll scout your codebase, ask the recommender what to tailor, and propose a config."
|
|
21
|
+
- `configured: true` → "Re-running init. Will re-scout and replace §16 in seed.md. Continue? (otherwise abort.)"
|
|
22
|
+
- If `$ARGUMENTS` was provided, note it ("user hint: `<...>`") and feed it into Step 3 as a stack-detection prior.
|
|
23
|
+
|
|
24
|
+
## Step 2 — Pre-flight deps
|
|
25
|
+
|
|
26
|
+
Verify the baseline's hard requirements + advisory ones:
|
|
27
|
+
|
|
28
|
+
| Required | Check command | If missing |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `bash` ≥ 4 | `bash --version` | Hard fail. The baseline cannot run. |
|
|
31
|
+
| `python3` | `which python3` | Hard fail. Hooks won't parse JSON. |
|
|
32
|
+
| `node` + `npx` | `which npx` | Hard fail. Both MCP servers need npx. |
|
|
33
|
+
| `git` repo | `git rev-parse --is-inside-work-tree` | Soft warn. Swarm worktree mode falls back to shared. |
|
|
34
|
+
| `plantuml` CLI | `which plantuml` | Soft warn. `plantuml_syntax_guard` runs in guide mode and `/spec-render` refuses without it. |
|
|
35
|
+
|
|
36
|
+
For each soft warn, note it and proceed. For hard fails, stop here with the install command.
|
|
37
|
+
|
|
38
|
+
## Step 3 — Codebase survey (whole-project, in main context)
|
|
39
|
+
|
|
40
|
+
Survey the WHOLE project — not a task slice. Do this directly with Read/Grep/Glob/Bash; do not delegate to a subagent (the only baseline subagent, `swarm-worker`, exists strictly for `/swarm-dispatch` parallelism). Capture structured findings:
|
|
41
|
+
|
|
42
|
+
- **Stack**: language(s), framework(s), package manager, runtime version targets.
|
|
43
|
+
- **Test setup**: test framework, test glob conventions, current test scripts.
|
|
44
|
+
- **Lint setup**: linter(s), formatter, type checker.
|
|
45
|
+
- **Architecture signals**: monorepo? multiple deployable units? front-end + back-end split?
|
|
46
|
+
- **External services referenced** (in code or config): databases, queues, third-party APIs, observability, project management tools.
|
|
47
|
+
- **CI**: present? what runner?
|
|
48
|
+
- **Conventions**: commit format, branch naming, code style notes from CLAUDE.md / CONTRIBUTING.md / README.
|
|
49
|
+
|
|
50
|
+
Keep the survey under 400 lines. Include exact file paths for the strongest evidence of each finding.
|
|
51
|
+
|
|
52
|
+
Save the survey to `.claude/state/init/<timestamp>.scout.md`.
|
|
53
|
+
|
|
54
|
+
## Step 4 — Run the recommender (baseline-aware)
|
|
55
|
+
|
|
56
|
+
Invoke the `claude-automation-recommender` skill via the Skill tool. **Always pass the survey from Step 3 as context** so recommendations are grounded in actual evidence.
|
|
57
|
+
|
|
58
|
+
The recommender's SKILL.md instructs it to:
|
|
59
|
+
- Treat baseline components as already-installed (16 hooks, 1 subagent, 35 skills, 4 commands, 3 MCPs).
|
|
60
|
+
- Recommend additions only — never duplicate.
|
|
61
|
+
- Never recommend new subagent types — decisions live in skills running in main context. The only subagent recommendation form is `additions.swarm_worker_skills` (stack-specific skills the `swarm-worker` should preload).
|
|
62
|
+
- Output a JSON block alongside the narrative; the JSON shape is `{stack, project_json, additions, gaps}` where `additions` has `mcp_servers`, `skills`, `hooks`, `swarm_worker_skills` (no `subagents` field).
|
|
63
|
+
|
|
64
|
+
Capture both the narrative and the JSON. Save the JSON to `.claude/state/init/<timestamp>.recommender.json`.
|
|
65
|
+
|
|
66
|
+
## Step 5 — Aggregate + present
|
|
67
|
+
|
|
68
|
+
Show the user one review surface before writing anything:
|
|
69
|
+
|
|
70
|
+
1. **Detected stack** (from Step 3 + Step 4 JSON `stack` field). Confirm or correct.
|
|
71
|
+
2. **`project.json` proposed values** (from JSON `project_json`, merged with baseline defaults):
|
|
72
|
+
- `test.cmd`, `lint.cmd`
|
|
73
|
+
- `tdd.source_globs`, `test_globs`, `exempt_globs`
|
|
74
|
+
- `destructive.hard_block_patterns` (baseline + extensions), `ask_patterns` (baseline + extensions)
|
|
75
|
+
- `swarm.isolation` (`worktree` if git, else `shared`)
|
|
76
|
+
- All other keys keep their baseline defaults.
|
|
77
|
+
3. **Recommender additions** (from JSON `additions`): MCP servers, skills, hooks, and any `swarm_worker_skills` to preload — name + reason for each.
|
|
78
|
+
4. **Gaps flagged** (from JSON `gaps`): things the baseline doesn't cover but might warrant a future spec.
|
|
79
|
+
|
|
80
|
+
Use `AskUserQuestion` to confirm: "Apply these changes?" Options: `apply`, `apply with edits`, `cancel`.
|
|
81
|
+
|
|
82
|
+
If `apply with edits`: take the user's adjustments inline, re-show the surface, ask again.
|
|
83
|
+
|
|
84
|
+
## Step 6 — Apply
|
|
85
|
+
|
|
86
|
+
Write to disk now. Do each sub-step in order; if any fails, stop and surface the error before continuing:
|
|
87
|
+
|
|
88
|
+
1. **Pre-create lazy directories**:
|
|
89
|
+
```bash
|
|
90
|
+
mkdir -p docs/{intake,brd,scout,research,specs,rca,security,archive}
|
|
91
|
+
mkdir -p .claude/state/{spec_approvals,swarm_approvals,swarm,harness,init}
|
|
92
|
+
```
|
|
93
|
+
2. **Add new MCP servers** (if any) → merge into `.mcp.json → mcpServers`.
|
|
94
|
+
3. **Add new skills** (if any) → write `.claude/skills/<name>/SKILL.md`. Skills are landed *before* the swarm-worker re-render so any skill referenced by `additions.swarm_worker_skills` exists on disk when the worker file is written.
|
|
95
|
+
4. **Re-render `swarm-worker`** with stack-specific skills:
|
|
96
|
+
- Read the template at `src/agents/swarm-worker.template.md`.
|
|
97
|
+
- Build the `SKILLS` value as a YAML list block. Always include ` - scenario` and ` - implement` (the worker's two mandatory skills). Append each skill in `additions.swarm_worker_skills` in dependency order (framework first, then testing/linting, then cross-cutting). Two-space indent, one skill per line.
|
|
98
|
+
- Substitute the four tokens — `{{NAME}}` → `swarm-worker`, `{{DESCRIPTION}}` → the canonical description (verbatim string below), `{{SKILLS}}` → the YAML list block, `{{ROLE_LINE}}` → the canonical first-paragraph role line. Substitution is literal string replacement.
|
|
99
|
+
|
|
100
|
+
**Canonical description (use verbatim for `{{DESCRIPTION}}`):**
|
|
101
|
+
|
|
102
|
+
> Execute a single swarm task in an isolated git worktree. Receive a fully-specified recipe from the main context — a scenario recipe plus an implementation contract — then run \`Skill(scenario)\` followed by \`Skill(implement)\` and report JSON status. Make no design decisions and do not expand scope. Invoked exclusively by \`/swarm-dispatch\`; never elsewhere.
|
|
103
|
+
|
|
104
|
+
**Canonical role line (use verbatim for `{{ROLE_LINE}}`):**
|
|
105
|
+
|
|
106
|
+
> You are a swarm worker. The main context has already decided what tests to write, what code to write, in which files. Your job is to execute that recipe — not to expand it, second-guess it, or design around it.
|
|
107
|
+
- Validate every skill named in `SKILLS` exists at `.claude/skills/<skill>/SKILL.md`. If any is missing, refuse the render and surface the gap.
|
|
108
|
+
- Write the rendered output to `.claude/agents/swarm-worker.md` (overwriting the baseline version with the stack-augmented one).
|
|
109
|
+
|
|
110
|
+
Recommender output **must not** propose new subagent types — only stack-skill additions for the existing `swarm-worker`. If you see a `subagents` field in the recommender JSON, ignore it and surface a warning that the schema is stale.
|
|
111
|
+
5. **Add new hooks** (if any) → write `.claude/hooks/<name>.sh`, `chmod +x`, wire into `.claude/settings.json`. Must use bash + python3, no jq, follow §4.1 conventions.
|
|
112
|
+
6. **Write `project.json`** with the agreed values, `configured: true`, **and a populated `additions` block**:
|
|
113
|
+
```jsonc
|
|
114
|
+
"additions": {
|
|
115
|
+
"agents": [],
|
|
116
|
+
"skills": [<names of every entry in additions.skills[]>],
|
|
117
|
+
"hooks": [<names of every entry in additions.hooks[]>],
|
|
118
|
+
"mcp_servers": [<names of every entry in additions.mcp_servers[]>],
|
|
119
|
+
"swarm_worker_skills": [<names of every entry in additions.swarm_worker_skills[]>]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
`additions.agents` stays empty in this baseline — the recommender does not propose new subagents. The audit script reads this block and unions each set with the baseline `EXPECTED_*` set when checking names + counts. Names only — drop the `command`, `why`, etc. fields the recommender used; only the identifiers are needed for drift detection.
|
|
123
|
+
|
|
124
|
+
## Step 7 — Update `seed.md` §16 addendum
|
|
125
|
+
|
|
126
|
+
Append — or replace — the `## §16 — Project-specific configuration` section in `docs/init/seed.md`. Use the shape in seed.md §16:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
## §16 — Project-specific configuration
|
|
130
|
+
|
|
131
|
+
Generated: <UTC timestamp>
|
|
132
|
+
By: /init-project (run #<n>)
|
|
133
|
+
|
|
134
|
+
### Detected stack
|
|
135
|
+
- Language: ...
|
|
136
|
+
- Framework: ...
|
|
137
|
+
- Test runner / cmd: ...
|
|
138
|
+
- Linter / cmd: ...
|
|
139
|
+
- Package manager: ...
|
|
140
|
+
|
|
141
|
+
### Recommender additions adopted
|
|
142
|
+
| Kind | Name | Why |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
...
|
|
145
|
+
|
|
146
|
+
### Workflow tweaks
|
|
147
|
+
- ...
|
|
148
|
+
|
|
149
|
+
### Deviations from canonical seed
|
|
150
|
+
- ...
|
|
151
|
+
|
|
152
|
+
### Recommender output (verbatim JSON)
|
|
153
|
+
```json
|
|
154
|
+
<paste from Step 4>
|
|
155
|
+
```
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If §16 already exists, find its bounds (heading to next `## §` or EOF) and replace wholesale. Don't merge — re-runs are full replacements (seed §16 idempotency rules).
|
|
159
|
+
|
|
160
|
+
## Step 8 — Drift self-check
|
|
161
|
+
|
|
162
|
+
Invoke the `audit-baseline` skill via the Skill tool. It runs `audit.sh` and prints a pass/fail table of 60+ checks.
|
|
163
|
+
|
|
164
|
+
- **PASS** → log it and proceed.
|
|
165
|
+
- **FAIL** → STOP. Surface the failures. The most likely cause: Step 6 added a component that doesn't match seed §4 conventions (missing wiring in `settings.json`, or a new skill absent from the canonical name set). Tell the user what failed and offer to roll back Step 6.
|
|
166
|
+
|
|
167
|
+
## Step 9 — Ready + restart
|
|
168
|
+
|
|
169
|
+
Print a final summary:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
✓ Baseline configured for <stack>
|
|
173
|
+
test.cmd: <cmd>
|
|
174
|
+
lint.cmd: <cmd>
|
|
175
|
+
swarm: <isolation>
|
|
176
|
+
added: <N MCPs, M subagents, K skills, J hooks>
|
|
177
|
+
audit: PASS
|
|
178
|
+
|
|
179
|
+
→ EXIT and restart Claude Code so new hooks, agents, skills, and MCP servers
|
|
180
|
+
load. After restart, run /triage "<your request>" to begin, or /harness
|
|
181
|
+
for the full pipeline.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Tell the user to restart.** New MCP servers and hooks wired in `settings.json` only take effect on a fresh session. `/reload-plugins` covers some cases; restart is the safe default.
|
|
185
|
+
|
|
186
|
+
## Constraints
|
|
187
|
+
|
|
188
|
+
- **Steps 6 + 7 + 8 are atomic for the user.** If Step 8 fails, do not declare success at Step 9.
|
|
189
|
+
- **Never write `configured: true` before Step 8 passes.** A FAIL at Step 8 means the project is in a broken state; leaving `configured: true` would lie to `setup_guard` and the welcome hook in CLAUDE.md.
|
|
190
|
+
- **No silent decisions.** Every project-specific change appears in seed.md §16 so the next reader can see what diverged from baseline.
|
|
191
|
+
- **Idempotent.** Re-running on the same project produces the same §16 (modulo timestamp + run number) and passes `/audit-baseline` cleanly.
|