continuous-improvement 3.0.0 → 3.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.
Files changed (126) hide show
  1. package/.claude-plugin/marketplace.json +78 -0
  2. package/CHANGELOG.md +210 -0
  3. package/LICENSE +21 -21
  4. package/QUICKSTART.md +101 -81
  5. package/README.md +224 -198
  6. package/SKILL.md +87 -9
  7. package/action.yml +33 -0
  8. package/bin/analyze.sh +161 -153
  9. package/bin/backfill.mjs +172 -0
  10. package/bin/check-docs-substrings.mjs +333 -0
  11. package/bin/check-everything-mirror.mjs +145 -0
  12. package/bin/check-routing-targets.mjs +151 -0
  13. package/bin/check-skill-law-tag.mjs +128 -0
  14. package/bin/check-skill-mirror.mjs +119 -0
  15. package/bin/check-skill-tiers.mjs +116 -0
  16. package/bin/check-third-party-shape.mjs +202 -0
  17. package/bin/generate-plugin-manifests.mjs +169 -0
  18. package/bin/harvest-friction.mjs +279 -0
  19. package/bin/hook-stats.mjs +258 -0
  20. package/bin/install.mjs +418 -456
  21. package/bin/lint-transcript.mjs +239 -0
  22. package/bin/mcp-server.mjs +842 -499
  23. package/bin/observe.mjs +148 -0
  24. package/bin/pre-commit-block-strays.sh +49 -0
  25. package/bin/refresh-third-party.mjs +416 -0
  26. package/bin/unified-cli.mjs +533 -0
  27. package/commands/continuous-improvement.md +115 -74
  28. package/commands/dashboard.md +56 -0
  29. package/commands/discipline.md +51 -0
  30. package/commands/harvest.md +76 -0
  31. package/commands/learn-eval.md +117 -0
  32. package/commands/planning-with-files.md +66 -0
  33. package/commands/proceed-with-the-recommendation.md +62 -0
  34. package/commands/ralph.md +103 -0
  35. package/commands/release-train.md +81 -0
  36. package/commands/seven-laws.md +16 -0
  37. package/commands/superpowers.md +153 -0
  38. package/commands/swarm.md +101 -0
  39. package/commands/workspace-surface-audit.md +77 -0
  40. package/hooks/observe.sh +172 -134
  41. package/hooks/session.sh +106 -106
  42. package/hooks/three-section-close.mjs +181 -0
  43. package/instinct-packs/go.json +58 -0
  44. package/instinct-packs/meta.json +16 -0
  45. package/instinct-packs/python.json +58 -0
  46. package/instinct-packs/react.json +58 -0
  47. package/lib/cli-anything.mjs +401 -0
  48. package/lib/compound-engineering.mjs +831 -0
  49. package/lib/observe-event.mjs +128 -0
  50. package/lib/plugin-metadata.mjs +432 -0
  51. package/lib/pm-marketplace.mjs +61 -0
  52. package/lib/pm-skills.mjs +1274 -0
  53. package/lib/resolve-home-dir.mjs +43 -0
  54. package/lib/skill-tiers.mjs +137 -0
  55. package/lib/unified-plugin.mjs +924 -0
  56. package/llms.txt +68 -0
  57. package/package.json +38 -15
  58. package/plugins/beginner.json +17 -6
  59. package/plugins/continuous-improvement/.claude-plugin/marketplace.json +20 -0
  60. package/plugins/continuous-improvement/.claude-plugin/plugin.json +26 -0
  61. package/plugins/continuous-improvement/LICENSE +21 -0
  62. package/plugins/continuous-improvement/README.md +56 -0
  63. package/plugins/continuous-improvement/bin/backfill.mjs +172 -0
  64. package/plugins/continuous-improvement/bin/mcp-server.mjs +886 -0
  65. package/plugins/continuous-improvement/bin/observe.mjs +148 -0
  66. package/plugins/continuous-improvement/commands/continuous-improvement.md +115 -0
  67. package/plugins/continuous-improvement/commands/dashboard.md +56 -0
  68. package/plugins/continuous-improvement/commands/discipline.md +51 -0
  69. package/plugins/continuous-improvement/commands/harvest.md +76 -0
  70. package/plugins/continuous-improvement/commands/learn-eval.md +117 -0
  71. package/plugins/continuous-improvement/commands/planning-with-files.md +66 -0
  72. package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +62 -0
  73. package/plugins/continuous-improvement/commands/ralph.md +103 -0
  74. package/plugins/continuous-improvement/commands/release-train.md +81 -0
  75. package/plugins/continuous-improvement/commands/seven-laws.md +16 -0
  76. package/plugins/continuous-improvement/commands/superpowers.md +153 -0
  77. package/plugins/continuous-improvement/commands/swarm.md +101 -0
  78. package/plugins/continuous-improvement/commands/workspace-surface-audit.md +77 -0
  79. package/plugins/continuous-improvement/hooks/hooks.json +60 -0
  80. package/plugins/continuous-improvement/hooks/observe.sh +172 -0
  81. package/plugins/continuous-improvement/hooks/session.sh +106 -0
  82. package/plugins/continuous-improvement/hooks/three-section-close.mjs +181 -0
  83. package/plugins/continuous-improvement/instinct-packs/go.json +58 -0
  84. package/plugins/continuous-improvement/instinct-packs/meta.json +16 -0
  85. package/plugins/continuous-improvement/instinct-packs/python.json +58 -0
  86. package/plugins/continuous-improvement/instinct-packs/react.json +58 -0
  87. package/plugins/continuous-improvement/lib/observe-event.mjs +128 -0
  88. package/plugins/continuous-improvement/lib/plugin-metadata.mjs +432 -0
  89. package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +43 -0
  90. package/plugins/continuous-improvement/skills/README.md +34 -0
  91. package/plugins/continuous-improvement/skills/continuous-improvement/SKILL.md +249 -0
  92. package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +131 -0
  93. package/plugins/continuous-improvement/skills/gateguard/SKILL.md +155 -0
  94. package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +108 -0
  95. package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +454 -0
  96. package/plugins/continuous-improvement/skills/ralph/SKILL.md +221 -0
  97. package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +76 -0
  98. package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +104 -0
  99. package/plugins/continuous-improvement/skills/superpowers/SKILL.md +212 -0
  100. package/plugins/continuous-improvement/skills/tdd-workflow/SKILL.md +411 -0
  101. package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +136 -0
  102. package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +192 -0
  103. package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +191 -0
  104. package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +147 -0
  105. package/plugins/continuous-improvement/templates/planning-with-files/findings.md +8 -0
  106. package/plugins/continuous-improvement/templates/planning-with-files/progress.md +7 -0
  107. package/plugins/continuous-improvement/templates/planning-with-files/task_plan.md +23 -0
  108. package/plugins/expert.json +34 -5
  109. package/skills/README.md +79 -0
  110. package/skills/deploy-receipt.md +131 -0
  111. package/skills/gateguard.md +155 -0
  112. package/skills/para-memory-files.md +108 -0
  113. package/skills/proceed-with-the-recommendation.md +454 -0
  114. package/skills/ralph.md +221 -0
  115. package/skills/safety-guard.md +76 -0
  116. package/skills/strategic-compact.md +104 -0
  117. package/skills/superpowers.md +212 -0
  118. package/skills/tdd-workflow.md +411 -0
  119. package/skills/token-budget-advisor.md +136 -0
  120. package/skills/verification-loop.md +192 -0
  121. package/skills/wild-risa-balance.md +191 -0
  122. package/skills/workspace-surface-audit.md +147 -0
  123. package/templates/planning-with-files/findings.md +8 -0
  124. package/templates/planning-with-files/progress.md +7 -0
  125. package/templates/planning-with-files/task_plan.md +23 -0
  126. package/templates/verify-ladder.example.json +47 -0
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: proceed-with-the-recommendation
3
+ description: "Execute the agent's prior recommendation list under the 7 Laws — walk in order, route per item, verify, reflect. Standalone companion skill with inline fallbacks when other skills are not installed."
4
+ ---
5
+
6
+ # /proceed-with-the-recommendation
7
+
8
+ Walk an agent-generated recommendation list top-to-bottom under the continuous-improvement 7 Laws. Each item is routed to the best specialist skill when available, falls back to concrete inline behavior when it is not.
9
+
10
+ Invoke immediately after the agent has offered a numbered list of recommendations, next steps, or suggested actions.
11
+
12
+ ## Trigger phrases
13
+
14
+ - `/proceed-with-the-recommendation`
15
+ - "proceed with your recommendation"
16
+ - "do all of it"
17
+ - "go ahead with the plan"
18
+ - "execute the recommendations"
19
+ - "yes do it" / "all of them"
20
+
21
+ ## What happens
22
+
23
+ 1. **Pre-flight (Law 1)** — restate the recommendation list in original order, tag each `safe` / `caution` / `needs-approval`
24
+ 2. **Plan (Law 2)** — inline restatement if ≤3 items, call `superpowers:writing-plans` if larger
25
+ 3. **Execute (Law 3)** — route each item to the preferred skill; apply inline fallback if the skill is not installed
26
+ 4. **Verify (Law 4)** — smallest check per item, non-transitive (no later item retroactively verifies an earlier one)
27
+ 5. **Iterate (Law 6)** — one change → verify → next; never carry a failure forward
28
+ 6. **Reflect (Laws 5 + 7)** — end-of-run Reflection block appended to `observations.jsonl`
29
+ 7. **Close** — three-section user-facing block: **What has been done → What is next → Recommendation** (tiered tables + one decisive "My recommendation" paragraph + a binary "Want me to: A or B?" closer)
30
+
31
+ ## Hard halts (never silently proceed)
32
+
33
+ - Any `needs-approval` item: deploy, force-push, DB drop, secret change, shared-state mutation
34
+ - Verification failure with non-obvious fix
35
+ - Drive-by temptation outside the original list
36
+ - Context budget above 80%
37
+
38
+ ## Pairs best with
39
+
40
+ | Preferred skill | Used for |
41
+ |---|---|
42
+ | `workspace-surface-audit` | Law 1 pre-flight when the list touches unknown surface area |
43
+ | `superpowers:writing-plans` | Plan breakdown when the list >3 items or >150 LOC |
44
+ | `superpowers:*` | Per-item specialist routing (TDD, debugging, review, verification, parallel) |
45
+ | `ralph` | Long-running PRD-style autonomous execution |
46
+ | `simplify`, `security-review`, `documentation-lookup`, `schedule`, `loop`, `update-config`, `commit-commands:*` | continuous-improvement helpers |
47
+
48
+ If none of those are installed, the skill still works — every routing row has an inline fallback and every item still gets a verification step.
49
+
50
+ ## Skill file
51
+
52
+ Full behavior is defined in [`skills/proceed-with-the-recommendation.md`](../skills/proceed-with-the-recommendation.md).
53
+
54
+ ## Install standalone
55
+
56
+ ```bash
57
+ mkdir -p ~/.claude/skills/proceed-with-the-recommendation
58
+ curl -L https://raw.githubusercontent.com/naimkatiman/continuous-improvement/main/skills/proceed-with-the-recommendation.md \
59
+ -o ~/.claude/skills/proceed-with-the-recommendation/SKILL.md
60
+ ```
61
+
62
+ Restart the Claude Code session so the registry picks it up.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: ralph
3
+ description: "Convert PRD to executable JSON and run autonomous agent loop until all stories complete"
4
+ ---
5
+
6
+ # /ralph
7
+
8
+ Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete.
9
+
10
+ ## Subcommands
11
+
12
+ ### `/ralph init`
13
+
14
+ Initialize Ralph in your project:
15
+
16
+ 1. Create `scripts/ralph/` directory
17
+ 2. Add `ralph.sh` loop script
18
+ 3. Add prompt templates for Amp and Claude Code
19
+ 4. Create example `prd.json`
20
+
21
+ ### `/ralph convert <prd-file>`
22
+
23
+ Convert a markdown PRD to Ralph's executable JSON format:
24
+
25
+ ```
26
+ /ralph convert tasks/prd-auth-feature.md
27
+ ```
28
+
29
+ Output: `prd.json` with structured user stories
30
+
31
+ ### `/ralph run [iterations]`
32
+
33
+ Run the autonomous loop:
34
+
35
+ ```
36
+ /ralph run 10
37
+ ```
38
+
39
+ Default: 10 iterations. Stops early if all stories complete.
40
+
41
+ ## Ralph Loop Behavior
42
+
43
+ 1. **Create branch** from PRD `branchName`
44
+ 2. **Pick highest priority** story where `passes: false`
45
+ 3. **Implement story** — fresh context, no pollution
46
+ 4. **Run quality checks** — typecheck, tests, lint
47
+ 5. **Commit if passing** — atomic commits per story
48
+ 6. **Update prd.json** — mark `passes: true`
49
+ 7. **Log learnings** — append to `progress.txt`
50
+ 8. **Repeat** until done or max iterations
51
+
52
+ ## Key Files
53
+
54
+ | File | Purpose |
55
+ |------|---------|
56
+ | `prd.json` | Executable PRD with user stories |
57
+ | `progress.txt` | Accumulated learnings |
58
+ | `ralph.sh` | The loop script |
59
+ | `AGENTS.md` | Iteration memory (auto-updated) |
60
+
61
+ ## Workflow Integration
62
+
63
+ Ralph works best with:
64
+ - **Superpowers** — for structured development stages
65
+ - **continuous-improvement** — for reflection and learning between iterations
66
+ - **workspace-surface-audit** — to verify capabilities before starting
67
+
68
+ ## Critical Concepts
69
+
70
+ ### Fresh Context Per Iteration
71
+ Each story runs in isolation. Previous work is visible only via git history and `prd.json`.
72
+
73
+ ### AGENTS.md Updates
74
+ Ralph updates `AGENTS.md` after each story so subsequent iterations know what's already done.
75
+
76
+ ### Browser Verification
77
+ For UI stories, Ralph starts a dev server and uses Playwright to verify rendering.
78
+
79
+ ### Stop Conditions
80
+ - All stories pass
81
+ - Max iterations reached
82
+ - Critical failure (requires human intervention)
83
+
84
+ ## Troubleshooting
85
+
86
+ | Issue | Solution |
87
+ |-------|----------|
88
+ | Ralph stuck | Check `prd.json` for malformed stories |
89
+ | Tests failing | Run `npm test` independently to isolate |
90
+ | Uncommitted changes | Check git status, commit or stash |
91
+ | Wrong tool | Use `--tool amp` or `--tool claude` flag |
92
+
93
+ ## Example Session
94
+
95
+ ```
96
+ User: /ralph convert tasks/prd-checkout.md
97
+ [Creates prd.json with 8 stories]
98
+
99
+ User: /ralph run 15
100
+ [Ralph creates branch, implements stories 1-8 over 12 iterations]
101
+
102
+ [All tests pass, branch ready for PR]
103
+ ```
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: release-train
3
+ description: "Autonomous multi-PR release train — plan stacked single-concern PRs, open each on its own branch, monitor CI, rebase on conflicts, and ship in dependency order while you sleep. Driven by report.html horizon item 'Autonomous Multi-PR Release Trains'."
4
+ ---
5
+
6
+ # /release-train
7
+
8
+ Long-running autonomous orchestrator for stacked-PR rollouts. Driven by the user's session report (1,218 messages, 178 sessions): the audit-then-execute pattern landed at `fully_achieved` when sessions opened with a stacked-PR plan; sessions that started as big-bang multi-file edits landed at `partially_achieved`.
9
+
10
+ This command formalizes the pattern. It does NOT bypass branch protection, force-push, or merge unreviewed PRs.
11
+
12
+ ## Preconditions
13
+
14
+ Before invoking this command:
15
+
16
+ 1. A `RELEASE_PLAN.md` (or `docs/plans/YYYY-MM-DD-<slug>.md`) exists in the repo with a per-PR table, dependency graph, worktree-per-PR, and out-of-scope list. Per the Stacked-PR Plan Precondition in the unified `/superpowers` dispatcher.
17
+ 2. The plan was reviewed and explicitly approved by the operator.
18
+ 3. The base branch (`main`) is clean and up to date with `origin/main`.
19
+ 4. CI is green on `origin/main`.
20
+
21
+ If any precondition fails, this command halts and reports what is missing rather than improvising.
22
+
23
+ ## Behavior
24
+
25
+ For each PR in the plan, in dependency order:
26
+
27
+ 1. **Worktree** — `git worktree add -b <branch> ../<branch> origin/main` (or off the previous PR's branch when the dependency requires it).
28
+ 2. **Implement** — TDD-first per `superpowers:test-driven-development`: failing test, watch it fail, write minimal code, watch it pass, commit.
29
+ 3. **Verify** — `superpowers:verification-before-completion` before claiming done. Smallest check that proves correctness.
30
+ 4. **Review** — dispatch a fresh subagent for spec-compliance + code-quality two-stage review per `superpowers:subagent-driven-development`. Critical findings block progress.
31
+ 5. **Open PR** — `gh pr create --base <base-of-this-PR> --head <branch>` with single-concern description that cites the plan doc.
32
+ 6. **Wait for CI** — poll until green. Auto-rebase on conflicts (max 2 attempts; halt on third).
33
+ 7. **Address review** — `superpowers:receiving-code-review` to walk reviewer comments. Critical findings produce a fix commit; non-critical are logged on the PR.
34
+ 8. **Merge when green and approved** — never bypass branch protection. If branch protection blocks, post a status comment and continue with the next independent PR.
35
+ 9. **Deploy receipt** — when the merged branch is on an auto-deploy target, run `deploy-receipt` to verify deployed SHA matches merge SHA + healthcheck 200 before reporting the PR as done.
36
+
37
+ Logs every state transition to `release-train.log` in the repo root.
38
+
39
+ ## Stop conditions
40
+
41
+ Halt and surface to the operator if any of these occur:
42
+
43
+ - A `CRITICAL` reviewer finding cannot be auto-resolved.
44
+ - Two consecutive auto-rebase attempts fail on the same PR.
45
+ - A PR has been waiting on CI for more than 30 minutes.
46
+ - A required check (branch protection, status check, required reviewer) blocks merge.
47
+ - A deploy-receipt times out or returns non-200.
48
+ - The plan's dependency graph becomes unsatisfiable (e.g. a dependency PR was closed unmerged).
49
+
50
+ When halted, write a state file to `release-train.halt.md` describing exactly which PR halted, why, and what the operator needs to decide before resuming.
51
+
52
+ ## Resuming
53
+
54
+ Re-invoke `/release-train` after the halt is resolved. The orchestrator reads `release-train.log` and `release-train.halt.md` to skip already-merged PRs and resume from the halt point.
55
+
56
+ ## Composition
57
+
58
+ This command activates the unified `/superpowers` dispatcher and routes through:
59
+
60
+ - `superpowers:writing-plans` (or its inline fallback) to validate the plan
61
+ - `superpowers:using-git-worktrees` for isolation per PR
62
+ - `superpowers:test-driven-development` for implementation
63
+ - `superpowers:subagent-driven-development` for two-stage review
64
+ - `superpowers:finishing-a-development-branch` for merge decisions
65
+ - `deploy-receipt` (CI-bundled) for production verification
66
+ - `proceed-with-the-recommendation` orchestrator to walk the plan's PR list
67
+
68
+ ## Anti-patterns this command refuses
69
+
70
+ - **Big-bang merge.** Will not merge a PR that touches more than 15 non-generated files.
71
+ - **Bypass.** Will not use `--admin`, `--force`, or `--no-verify`.
72
+ - **Speculative fix during CI wait.** Will not push speculative fixes during the first-time-contributor workflow-approval gate.
73
+ - **Drive-by scope.** Will not add a fix outside the plan's scope; logs as deferred follow-up instead.
74
+
75
+ ## Example
76
+
77
+ ```
78
+ /release-train docs/plans/2026-05-07-unified-five-plugin-dispatcher.md
79
+ ```
80
+
81
+ Reads the plan, opens worktrees in dependency order, ships each PR through the full discipline, halts only at policy gates.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: seven-laws
3
+ description: "Brand-aligned alias for /continuous-improvement. Reflect on the current session, analyze observations for patterns, and show instinct status under the 7 Laws of AI Agent Discipline."
4
+ ---
5
+
6
+ # /seven-laws
7
+
8
+ Brand-aligned alias for [`/continuous-improvement`](continuous-improvement.md). Both commands run the exact same three-step workflow under the 7 Laws of AI Agent Discipline:
9
+
10
+ 1. **Reflect** (Law 5) — generate a reflection block for this session.
11
+ 2. **Analyze** (Law 7) — process pending observations into instincts.
12
+ 3. **Status** — show all instincts for the project + global with confidence and current level.
13
+
14
+ Run the workflow defined in [`continuous-improvement.md`](continuous-improvement.md). Subcommands `weekly` and `always-on` work identically.
15
+
16
+ `/continuous-improvement` remains supported indefinitely for backward compatibility. Prefer `/seven-laws` going forward — it matches the brand and the SKILL.md spec.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: superpowers
3
+ description: "Activate mandatory agent workflows: brainstorming, TDD, code review, git worktrees, and structured development"
4
+ ---
5
+
6
+ # /superpowers
7
+
8
+ Activate the Superpowers mandatory workflow framework. Skills trigger automatically based on context — this is not optional guidance.
9
+
10
+ ## Subcommands
11
+
12
+ ### `/superpowers status`
13
+
14
+ Show which workflow stages are active:
15
+
16
+ ```
17
+ === Superpowers Status ===
18
+
19
+ Active Skills:
20
+ [x] brainstorming (trigger: new feature request)
21
+ [ ] using-git-worktrees (waiting: design approval)
22
+ [ ] writing-plans (waiting: worktree ready)
23
+ [ ] test-driven-development (waiting: plan approved)
24
+ [ ] requesting-code-review (waiting: implementation)
25
+ [ ] finishing-a-development-branch (waiting: completion)
26
+ ```
27
+
28
+ ### `/superpowers enable <skill>`
29
+
30
+ Explicitly enable a skill for the current session:
31
+
32
+ ```
33
+ /superpowers enable test-driven-development
34
+ ```
35
+
36
+ ### `/superpowers workflow <type>`
37
+
38
+ Activate a complete workflow preset:
39
+
40
+ | Preset | Skills Activated |
41
+ |--------|------------------|
42
+ | `new-feature` | brainstorming → worktrees → plans → TDD → review → finish |
43
+ | `bug-fix` | systematic-debugging → verification → TDD → review |
44
+ | `refactor` | worktrees → plans → TDD → review → finish |
45
+ | `review` | requesting-code-review → receiving-code-review |
46
+
47
+ Example:
48
+ ```
49
+ /superpowers workflow new-feature
50
+ ```
51
+
52
+ ## Mandatory Skills
53
+
54
+ ### brainstorming
55
+ **Triggers:** New feature requests, vague requirements
56
+
57
+ 1. Ask clarifying questions
58
+ 2. Explore 2-3 alternatives
59
+ 3. Present design in sections
60
+ 4. Wait for explicit approval
61
+
62
+ ### using-git-worktrees
63
+ **Triggers:** Design approved, feature branch needed
64
+
65
+ Creates isolated workspace:
66
+ ```bash
67
+ git worktree add -b feature-name ../feature-name
68
+ ```
69
+
70
+ ### writing-plans
71
+ **Triggers:** Worktree ready, implementation starting
72
+
73
+ Breaks work into bite-sized tasks (2-5 minutes each). Every task includes:
74
+ - Exact file paths
75
+ - Complete code
76
+ - Verification steps
77
+
78
+ ### test-driven-development
79
+ **Triggers:** Plan approved, coding begins
80
+
81
+ ```
82
+ RED: Write failing test → Watch it fail
83
+ GREEN: Write minimal code → Watch it pass
84
+ REFACTOR: Improve while green → Commit
85
+ ```
86
+
87
+ **Rule:** Code written before tests is deleted.
88
+
89
+ ### requesting-code-review
90
+ **Triggers:** Task complete, before continuing
91
+
92
+ Two-stage review:
93
+ 1. Spec compliance — Does it match the plan?
94
+ 2. Code quality — Clean, tested, maintainable?
95
+
96
+ Severity levels: Critical (blocks), Warning (note), Info (log)
97
+
98
+ ### finishing-a-development-branch
99
+ **Triggers:** All tasks complete
100
+
101
+ Options presented:
102
+ - Merge to main
103
+ - Create PR
104
+ - Keep branch
105
+ - Discard (with confirmation)
106
+
107
+ ## Skill Activation Rules
108
+
109
+ | User Request | Activates |
110
+ |--------------|-----------|
111
+ | "Create a feature" | brainstorming → writing-plans → executing-plans |
112
+ | "Fix this bug" | systematic-debugging → verification → TDD |
113
+ | "Review this code" | requesting-code-review |
114
+ | "Refactor this" | using-git-worktrees → writing-plans → TDD |
115
+
116
+ ## Verification Protocol
117
+
118
+ Every skill requires verification before reporting completion:
119
+
120
+ 1. **Code runs** without errors
121
+ 2. **Output matches** expected result
122
+ 3. **Actual result checked** — not assumed
123
+ 4. **Build passes**
124
+ 5. **Explained** in one sentence
125
+
126
+ ## Integration
127
+
128
+ Superpowers integrates with:
129
+ - **continuous-improvement** — reflection and learning after each stage
130
+ - **ralph** — autonomous execution of planned stories
131
+ - **workspace-surface-audit** — verify environment before starting
132
+
133
+ ## Example Session
134
+
135
+ ```
136
+ User: "Build a checkout flow"
137
+
138
+ [brainstorming activates]
139
+ AI: "Clarifying questions: 1) Payment provider? 2) Guest checkout?"
140
+
141
+ User: "Stripe, yes guest checkout"
142
+
143
+ [writing-plans activates]
144
+ AI: "Plan created with 6 tasks. Approve?"
145
+
146
+ User: "Approved"
147
+
148
+ [using-git-worktrees activates]
149
+ AI: "Created worktree at ../checkout-feature"
150
+
151
+ [test-driven-development activates]
152
+ AI: "Task 1: Write failing test for cart validation..."
153
+ ```
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: swarm
3
+ description: "Fan out N parallel sub-agents on isolated worktrees with a shared contract test, produce a comparison report. Driven by report.html horizon item 'Parallel Provider-Migration Agents' — pick winners from real evidence instead of discovering tier limits in production."
4
+ ---
5
+
6
+ # /swarm
7
+
8
+ Parallel-agent fan-out for evidence-based decision-making. Driven by the user's session report: provider-swap epics (Trading Economics → Forex Factory, ETF → CFD, Finnhub → R StocksTrader, Stooq removal) each took multiple sessions and hit fallback bugs in production because alternatives were not vetted upfront.
9
+
10
+ This command does not replace the `superpowers:dispatching-parallel-agents` skill — it builds on top of it with a contract-pinned, worktree-isolated, comparison-report shape.
11
+
12
+ ## When to use
13
+
14
+ The right trigger is "I need to pick between N options and I have a contract test that defines what 'works' means." Examples:
15
+
16
+ - Evaluating N candidate providers behind a shared interface (the report's recurring need)
17
+ - Trying N candidate refactors against the same test suite
18
+ - Prototyping N candidate library upgrades and measuring which breaks the fewest tests
19
+ - Generating N candidate UI designs that all pass the same accessibility + performance budget
20
+
21
+ Do NOT use this command for:
22
+
23
+ - Open-ended exploration without a contract — use `superpowers:brainstorming` instead
24
+ - Single-implementation tasks — use the `superpowers:dispatching-parallel-agents` skill directly
25
+ - Tasks where the candidates have different contracts — that is N separate jobs, not a swarm
26
+
27
+ ## Preconditions
28
+
29
+ 1. A shared contract test exists at a path the agents can reference (e.g. `tests/contracts/<name>.test.ts`).
30
+ 2. Candidates are listed up front (3-6 typical; 8 max). Letting agents propose candidates is allowed but the list freezes before fan-out.
31
+ 3. The base branch is clean.
32
+ 4. Each candidate has a clear evaluation rubric: PASS/FAIL per contract test, plus per-candidate measurements (latency, coverage, cost, free-tier limits, etc. — domain-specific).
33
+
34
+ ## Behavior
35
+
36
+ 1. **Plan** — restate the objective, list candidates, confirm contract test path. If unclear, halt and ask.
37
+ 2. **Bootstrap** — for each candidate, create an isolated worktree off `origin/main`: `git worktree add -b swarm/<objective>-<candidate> ../<candidate>`. Pin the base SHA in the swarm log.
38
+ 3. **Fan out** — dispatch one fresh sub-agent per candidate via the `Agent` tool, in a single message (parallel, not serial). Each agent receives the contract test path, the candidate name, the rubric, and the worktree path.
39
+ 4. **Run** — each agent implements the candidate behind the shared interface, runs the contract test against it, captures measurements per the rubric, and writes findings to `reports/<objective>/<candidate>.md`.
40
+ 5. **Synthesize** — when all agents complete, this command produces a decision matrix (candidates × rubric metrics) and recommends a winner with citations to the per-candidate reports.
41
+ 6. **Stop** — does NOT merge any candidate's worktree. Does NOT modify production. Output is evidence; the operator decides which candidate to advance.
42
+
43
+ ## Topology
44
+
45
+ The default topology is **flat fan-out** — all agents run in parallel, no inter-agent communication. This matches the report's actual gap (provider migrations were each independent prototypes).
46
+
47
+ When `ruflo-swarm` is installed (`/plugin install ruflo-swarm@continuous-improvement`), an alternate topology becomes available: `hierarchical-mesh` with a coordinator role brokering stage hand-off. Activate via `/swarm --topology hierarchical-mesh`.
48
+
49
+ Available topologies (when ruflo-swarm installed):
50
+
51
+ | Topology | When to use |
52
+ |---|---|
53
+ | `flat` (default) | Independent prototypes, no shared state |
54
+ | `hierarchical` | One coordinator + N workers; workers report to coordinator only |
55
+ | `mesh` | Workers can share intermediate findings |
56
+ | `hierarchical-mesh` | Coordinator plus worker-to-worker chat |
57
+ | `ring` | Each worker hands off to the next; sequential within a parallel start |
58
+ | `star` | All workers report to a central evaluator that filters before synthesis |
59
+ | `adaptive` | Topology selected per-step based on intermediate findings |
60
+
61
+ ## Stop conditions
62
+
63
+ Halt and surface to the operator if:
64
+
65
+ - Any agent reports the contract test is itself broken (test suite is the source of truth; if it is wrong, no candidate can win).
66
+ - A candidate's evaluation reveals the rubric is incomplete (a metric the rubric doesn't measure changes the answer).
67
+ - More than 50% of agents fail to produce a report (likely environment or harness issue, not candidate quality).
68
+ - The winner-by-rubric and the reports' qualitative findings disagree (surface the conflict; do not paper over it).
69
+
70
+ ## Stream observation
71
+
72
+ Long swarm runs feel opaque. When `ruflo-swarm:monitor-stream` is installed, this command emits live progress events to a stream the operator can tail. Without it, this command writes per-step lines to `reports/<objective>/swarm.log` that can be tailed with `tail -f`.
73
+
74
+ ## Composition
75
+
76
+ This command activates the unified `/superpowers` dispatcher and routes through:
77
+
78
+ - `superpowers:dispatching-parallel-agents` for the fan-out shape
79
+ - `ruflo-swarm:swarm-init` (when installed) for contract-pinned bootstrap
80
+ - `ruflo-swarm:monitor-stream` (when installed) for stream observation
81
+ - `superpowers:writing-plans` (or inline fallback) for the candidate list + rubric
82
+ - `proceed-with-the-recommendation` for walking the synthesis output as a recommendation list
83
+
84
+ ## Anti-patterns this command refuses
85
+
86
+ - **Letting one candidate run before others start.** All worktrees and agents bootstrap together; no early-bird advantage.
87
+ - **Modifying the contract test mid-run.** Test is source of truth; halt instead.
88
+ - **Picking a winner without measurements.** The synthesis must cite the rubric, not just the agents' summaries.
89
+ - **Merging any worktree.** Output is evidence; operator decides advancement.
90
+
91
+ ## Example
92
+
93
+ ```
94
+ /swarm "Pick the next market data provider"
95
+
96
+ Candidates: Swissquote, R StocksTrader, Twelve Data, Finnhub
97
+ Contract: tests/contracts/provider-contract.test.ts
98
+ Rubric: PASS/FAIL per contract test, p50/p99 latency, symbol coverage for 50 tracked instruments, free-tier limits, monthly cost at expected volume
99
+ ```
100
+
101
+ The orchestrator opens four worktrees, runs four agents in parallel, produces `reports/market-data-provider/{swissquote,rstockstrader,twelve-data,finnhub}.md`, and a `decision-matrix.md` with the recommended winner cited from the rubric.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: workspace-surface-audit
3
+ description: "Audit workspace capabilities and recommend continuous-improvement-native skills, hooks, and workflows"
4
+ ---
5
+
6
+ # /workspace-surface-audit
7
+
8
+ Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup. Returns a 5-section report with specific next moves.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /workspace-surface-audit
14
+ ```
15
+
16
+ ## What It Checks
17
+
18
+ 1. **Repo surface** — `package.json`, lockfiles, framework config, `.mcp.json`, `.claude/settings*.json`, `AGENTS.md`
19
+ 2. **Environment surface** — `.env*` files (key names only, no secrets)
20
+ 3. **Connected tools** — installed plugins, MCP servers, LSPs, app integrations
21
+ 4. **continuous-improvement surface** — existing skills, commands, hooks, agents
22
+
23
+ ## Output Format
24
+
25
+ ```
26
+ === Workspace Surface Audit ===
27
+
28
+ ## Current Surface
29
+ - [What is usable right now]
30
+
31
+ ## Parity
32
+ - [Where continuous-improvement matches or exceeds benchmarks]
33
+
34
+ ## Primitive-Only Gaps
35
+ - [Tools exist, but continuous-improvement lacks clean operator skills]
36
+
37
+ ## Missing Integrations
38
+ - [Capabilities not available yet]
39
+
40
+ ## Top 3-5 Next Moves
41
+ 1. [Concrete continuous-improvement-native addition]
42
+ 2. [Ordered by impact]
43
+ ```
44
+
45
+ ## Rules
46
+
47
+ - **Never print secrets** — only provider names, capability names, file paths
48
+ - **Prefer continuous-improvement** over generic "install another plugin" advice
49
+ - **Organize by workflows**, not API brands
50
+ - **Specific recommendations** — concrete enough to implement without another discovery pass
51
+
52
+ ## Example Output
53
+
54
+ ```
55
+ ## Current Surface
56
+ - MCP: filesystem, github, playwright
57
+ - Plugins: beginner, expert (continuous-improvement)
58
+ - Env: STRIPE_API_KEY, FAL_KEY configured
59
+ - Framework: Next.js 15, React 19, TypeScript
60
+
61
+ ## Parity
62
+ - Continuous improvement: covered (native)
63
+ - Testing discipline: covered (TDD workflows)
64
+
65
+ ## Primitive-Only Gaps
66
+ - Stripe connected but no billing-operator skill
67
+ - GitHub MCP available but no issue-triage workflow
68
+
69
+ ## Missing Integrations
70
+ - No Linear connector detected
71
+ - No Slack webhook configured
72
+
73
+ ## Top 3-5 Next Moves
74
+ 1. Create billing-operator skill (Stripe integration)
75
+ 2. Create github-ops workflow for issue triage
76
+ 3. Add Linear connector skill for project management
77
+ ```
@@ -0,0 +1,60 @@
1
+ {
2
+ "description": "Observation, session lifecycle, and 3-section-close discipline hooks for continuous-improvement.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh\"",
10
+ "timeout": 5
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "PostToolUse": [
16
+ {
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/observe.sh\"",
21
+ "timeout": 5
22
+ }
23
+ ]
24
+ }
25
+ ],
26
+ "SessionStart": [
27
+ {
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session.sh\"",
32
+ "timeout": 5
33
+ }
34
+ ]
35
+ }
36
+ ],
37
+ "SessionEnd": [
38
+ {
39
+ "hooks": [
40
+ {
41
+ "type": "command",
42
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session.sh\"",
43
+ "timeout": 5
44
+ }
45
+ ]
46
+ }
47
+ ],
48
+ "Stop": [
49
+ {
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/three-section-close.mjs\"",
54
+ "timeout": 5
55
+ }
56
+ ]
57
+ }
58
+ ]
59
+ }
60
+ }