@nst173/superpowers-ccg 1.3.0 → 1.3.1
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/README.md +14 -78
- package/agents/code-reviewer.md +1 -1
- package/bin/cli.js +179 -0
- package/bin/codeagent-wrapper-darwin-amd64 +0 -0
- package/bin/codeagent-wrapper-darwin-arm64 +0 -0
- package/bin/codeagent-wrapper-linux-amd64 +0 -0
- package/bin/codeagent-wrapper-linux-arm64 +0 -0
- package/bin/codeagent-wrapper-windows-amd64.exe +0 -0
- package/bin/codeagent-wrapper-windows-arm64.exe +0 -0
- package/hooks/pre-tool-use-task.sh +4 -4
- package/hooks/session-start.sh +8 -9
- package/hooks/user-prompt-submit.sh +53 -19
- package/lib/installer.js +50 -0
- package/lib/mcp-config.js +85 -0
- package/lib/prompts.js +92 -0
- package/lib/skills-core.js +208 -0
- package/package.json +10 -15
- package/skills/EVALUATION.md +2 -82
- package/skills/brainstorming/SKILL.md +7 -8
- package/skills/coordinating-multi-model-work/GATE.md +5 -4
- package/skills/coordinating-multi-model-work/INTEGRATION.md +79 -15
- package/skills/coordinating-multi-model-work/SKILL.md +33 -8
- package/skills/coordinating-multi-model-work/checkpoints.md +113 -14
- package/skills/coordinating-multi-model-work/context-sharing.md +71 -0
- package/skills/coordinating-multi-model-work/prompts/codex-base.md +47 -10
- package/skills/coordinating-multi-model-work/prompts/gemini-base.md +47 -10
- package/skills/coordinating-multi-model-work/review-chain.md +11 -13
- package/skills/coordinating-multi-model-work/routing-decision.md +81 -24
- package/skills/debugging-systematically/SKILL.md +13 -15
- package/skills/developing-with-subagents/SKILL.md +18 -15
- package/skills/developing-with-subagents/implementer-prompt.md +44 -14
- package/skills/executing-plans/SKILL.md +13 -9
- package/skills/shared/multi-model-integration-section.md +10 -7
- package/skills/shared/protocol-threshold.md +158 -21
- package/skills/shared/supplementary-tools.md +22 -18
- package/skills/verifying-before-completion/SKILL.md +3 -1
- package/templates/antigravity/config/antigravity/superpowers-ccg.yaml +4 -0
- package/templates/claude-code/.claude/commands/brainstorm.md +6 -0
- package/templates/claude-code/.claude/commands/execute-plan.md +6 -0
- package/templates/claude-code/.claude/commands/write-plan.md +6 -0
- package/templates/claude-code/.claude/hooks/hooks.json +37 -0
- package/templates/claude-code/.claude/hooks/pre-tool-use-task.sh +4 -0
- package/templates/claude-code/.claude/hooks/run-hook.cmd +19 -0
- package/templates/claude-code/.claude/hooks/session-start.sh +71 -0
- package/templates/claude-code/.claude/hooks/user-prompt-submit.sh +65 -0
- package/templates/claude-code/CLAUDE.md +5 -0
- package/templates/cursor/.cursor/rules/superpowers-ccg.mdc +9 -0
- package/.agent/skills/brainstorming/SKILL.md +0 -26
- package/.agent/skills/coordinating-multi-model-work/SKILL.md +0 -29
- package/.agent/skills/executing-plans/SKILL.md +0 -27
- package/.agent/skills/using-superpowers/SKILL.md +0 -29
- package/.agent/skills/verifying-before-completion/SKILL.md +0 -20
- package/.agent/skills/writing-plans/SKILL.md +0 -29
- package/.cursor/agents/code-reviewer.md +0 -22
- package/.cursor/commands/brainstorm.md +0 -11
- package/.cursor/commands/execute-plan.md +0 -12
- package/.cursor/commands/write-plan.md +0 -11
- package/.cursor/hook-scripts/after-file-edit.mjs +0 -3
- package/.cursor/hook-scripts/before-shell-execution.mjs +0 -3
- package/.cursor/hook-scripts/session-end.mjs +0 -3
- package/.cursor/hooks.json +0 -21
- package/.cursor/mcp.json +0 -20
- package/.cursor/rules/checkpoint-protocol.mdc +0 -11
- package/.cursor/rules/orchestrator-routing.mdc +0 -12
- package/.cursor/rules/token-discipline.mdc +0 -12
- package/.cursor/skills/brainstorming/SKILL.md +0 -26
- package/.cursor/skills/coordinating-multi-model-work/SKILL.md +0 -29
- package/.cursor/skills/executing-plans/SKILL.md +0 -27
- package/.cursor/skills/using-superpowers/SKILL.md +0 -29
- package/.cursor/skills/verifying-before-completion/SKILL.md +0 -20
- package/.cursor/skills/writing-plans/SKILL.md +0 -29
- package/AGENTS.md +0 -23
- package/CLAUDE.md +0 -78
- package/GEMINI.md +0 -27
- package/cli/superpowers-ccg.mjs +0 -8
- package/config/antigravity/mcp_config.example.json +0 -26
- package/skills/developing-with-subagents/code-quality-reviewer-prompt.md +0 -30
- package/skills/developing-with-subagents/spec-reviewer-prompt.md +0 -25
- package/skills/dispatching-parallel-agents/SKILL.md +0 -195
- package/skills/finishing-development-branches/SKILL.md +0 -208
- package/skills/practicing-test-driven-development/SKILL.md +0 -346
- package/skills/practicing-test-driven-development/testing-anti-patterns.md +0 -299
- package/skills/receiving-code-review/SKILL.md +0 -221
- package/skills/requesting-code-review/SKILL.md +0 -127
- package/skills/requesting-code-review/code-reviewer.md +0 -146
- package/skills/using-git-worktrees/SKILL.md +0 -225
- package/skills/using-superpowers/SKILL.md +0 -101
- package/skills/writing-skills/CHECKLIST.md +0 -92
- package/skills/writing-skills/SKILL.md +0 -111
- package/skills/writing-skills/STRUCTURE.md +0 -208
- package/skills/writing-skills/TESTING.md +0 -155
- package/skills/writing-skills/anthropic-best-practices.md +0 -1150
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
- package/skills/writing-skills/graphviz-conventions.dot +0 -172
- package/skills/writing-skills/persuasion-principles.md +0 -187
- package/skills/writing-skills/render-graphs.js +0 -168
- package/skills/writing-skills/testing-skills-with-subagents.md +0 -384
- package/src/cli.mjs +0 -165
- package/src/constants.mjs +0 -7
- package/src/install.mjs +0 -186
- package/src/io.mjs +0 -81
package/README.md
CHANGED
|
@@ -1,54 +1,17 @@
|
|
|
1
1
|
# Superpowers-CCG
|
|
2
2
|
|
|
3
|
-
Superpowers-CCG is a fork/enhanced variant of [obra/superpowers](https://github.com/obra/superpowers). It keeps the same skills-driven workflow and adds **CCG multi-model orchestration**: Claude is the **pure orchestrator** (never writes code), routing implementation to **Codex MCP** (backend and systems) and **Gemini MCP** (frontend), with **
|
|
3
|
+
Superpowers-CCG is a fork/enhanced variant of [obra/superpowers](https://github.com/obra/superpowers). It keeps the same skills-driven workflow and adds **CCG multi-model orchestration**: Claude is the **pure orchestrator** (never writes code), routing implementation to **Codex MCP** (backend and systems) and **Gemini MCP** (frontend), with **Claude CP4 final spec review** and **Haiku for trivial tasks and fast exploration**.
|
|
4
4
|
|
|
5
5
|
> **CCG** = **C**laude + **C**odex + **G**emini
|
|
6
6
|
|
|
7
|
-
## npm CLI
|
|
8
|
-
|
|
9
|
-
This repo now also ships a project-level installer CLI for supported agents:
|
|
10
|
-
|
|
11
|
-
- Claude Code
|
|
12
|
-
- Cursor
|
|
13
|
-
- Antigravity
|
|
14
|
-
|
|
15
|
-
Run it with:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npx @nst173/superpowers-ccg setup
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Install only specific agents:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx @nst173/superpowers-ccg setup --agent claude-code --agent cursor
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Install into another project directory:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx @nst173/superpowers-ccg setup ../my-project --all
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Preview changes without writing files:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npx @nst173/superpowers-ccg setup --dry-run
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
List supported agents:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npx @nst173/superpowers-ccg list
|
|
43
|
-
```
|
|
44
|
-
|
|
45
7
|
## What You Get
|
|
46
8
|
|
|
47
9
|
- **Claude as pure orchestrator**: Claude routes, coordinates, and integrates. It never writes implementation code.
|
|
48
10
|
- **Multi-model routing (CCG)**: route tasks to Codex (backend and systems) or Gemini (frontend). Use **CROSS_VALIDATION** for full-stack or critical tasks.
|
|
49
|
-
- **
|
|
11
|
+
- **Final spec review**: CP4 performs a pure spec check against the original request and CP1 success criteria.
|
|
50
12
|
- **MCP tool integration**: external calls go through `mcp__codex__codex` and `mcp__gemini__gemini`.
|
|
51
|
-
- **Collaboration checkpoints**: CP1/CP2/CP3 checkpoints are embedded in the main skills.
|
|
13
|
+
- **Collaboration checkpoints**: CP0/CP1/CP2/CP3/CP4 checkpoints are embedded in the main skills.
|
|
14
|
+
- **Smart context sharing**: CP0 produces reusable context artifacts, CP1 builds task-scoped bundles, and same-task follow-ups send deltas only.
|
|
52
15
|
- **Fail-closed gate**: if a required external model call cannot complete, the workflow stops with `BLOCKED`.
|
|
53
16
|
|
|
54
17
|
## Quick Start (Claude Code)
|
|
@@ -81,10 +44,10 @@ claude mcp add gemini -s user --transport stdio -- uvx --from git+https://github
|
|
|
81
44
|
|
|
82
45
|
You normally do **not** call MCP tools manually. Tell Claude what you want, and the workflow decides when to invoke external models.
|
|
83
46
|
|
|
84
|
-
- Backend or systems: "Use Codex MCP for the API/database/CI parts
|
|
85
|
-
- Frontend: "Use Gemini MCP for UI/components/styles
|
|
47
|
+
- Backend or systems: "Use Codex MCP for the API/database/CI parts and return the final files directly."
|
|
48
|
+
- Frontend: "Use Gemini MCP for UI/components/styles and return the final files directly."
|
|
86
49
|
- Cross-validation: "Do CROSS_VALIDATION for this design and reconcile conflicts."
|
|
87
|
-
-
|
|
50
|
+
- CP4 final spec review runs automatically at the end of the workflow.
|
|
88
51
|
|
|
89
52
|
## Model Selection
|
|
90
53
|
|
|
@@ -97,50 +60,22 @@ You normally do **not** call MCP tools manually. Tell Claude what you want, and
|
|
|
97
60
|
|
|
98
61
|
The routing and checkpoint rules live in `skills/coordinating-multi-model-work/`.
|
|
99
62
|
|
|
100
|
-
## Cursor Plugin
|
|
101
|
-
|
|
102
|
-
This repo now also ships a Cursor Marketplace plugin scaffold based on `cursor/plugin-template`.
|
|
103
|
-
|
|
104
|
-
- Marketplace manifest: [`.cursor-plugin/marketplace.json`](.cursor-plugin/marketplace.json)
|
|
105
|
-
- Plugin package: [`plugins/superpowers-ccg`](plugins/superpowers-ccg)
|
|
106
|
-
- Setup notes: [`docs/cursor-plugin.md`](docs/cursor-plugin.md)
|
|
107
|
-
|
|
108
|
-
Validate the Cursor packaging with:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
node scripts/validate-cursor-plugin.mjs
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Antigravity Port
|
|
115
|
-
|
|
116
|
-
This repo now also includes an Antigravity-oriented port built around:
|
|
117
|
-
|
|
118
|
-
- [`AGENTS.md`](AGENTS.md)
|
|
119
|
-
- [`GEMINI.md`](GEMINI.md)
|
|
120
|
-
- [`.agent/skills`](.agent/skills)
|
|
121
|
-
- [`config/antigravity/mcp_config.example.json`](config/antigravity/mcp_config.example.json)
|
|
122
|
-
- [`docs/antigravity.md`](docs/antigravity.md)
|
|
123
|
-
|
|
124
|
-
Sync the project skills with:
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
node scripts/sync-antigravity-workspace.mjs
|
|
128
|
-
```
|
|
129
|
-
|
|
130
63
|
## Checkpoint Protocol
|
|
131
64
|
|
|
132
65
|
| Checkpoint | When | Purpose |
|
|
133
66
|
|---|---|---|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
67
|
+
| CP0 | Before CP1 | Context acquisition with Auggie for local code context and Grok Search for external research |
|
|
68
|
+
| CP1 | Immediately after CP0, before first Task call | Task assessment and routing using the CP1 routing matrix |
|
|
69
|
+
| CP2 | After CP1 when routed externally | External execution via Gemini/Codex/Cross-Validation with final file output |
|
|
70
|
+
| CP3 | After CP2 when reconciliation is needed | Resolve external-model conflicts, gaps, and clarifications before CP4 |
|
|
71
|
+
| CP4 | Final step of every workflow | Pure spec review against the original request and CP1 success criteria |
|
|
137
72
|
|
|
138
73
|
## Differences vs Superpowers (obra/superpowers)
|
|
139
74
|
|
|
140
75
|
- **Claude as orchestrator-only**: Claude never writes implementation code.
|
|
141
76
|
- **Built-in multi-model routing** via MCP tools (Codex, Gemini).
|
|
142
77
|
- **Codex covers systems work**: scripts, CI/CD, Dockerfiles, and infrastructure route to Codex.
|
|
143
|
-
- **
|
|
78
|
+
- **CP4 final spec review is spec-only**: no automatic style, redundancy, or best-practice review is part of the checkpoint flow.
|
|
144
79
|
- **CP checkpoints** enforce evidence-driven collaboration.
|
|
145
80
|
- **Skill set changes** align the plugin with the CCG workflow.
|
|
146
81
|
|
|
@@ -167,5 +102,6 @@ See `tests/claude-code/README.md` for the Claude Code skills test suite.
|
|
|
167
102
|
- [obra/superpowers](https://github.com/obra/superpowers) - Original Superpowers project
|
|
168
103
|
- [BryanHoo/superpowers-ccg](https://github.com/BryanHoo/superpowers-ccg) - CCG collaboration fork
|
|
169
104
|
- [fengshao1227/ccg-workflow](https://github.com/fengshao1227/ccg-workflow) - CCG workflow
|
|
105
|
+
- [Danau5tin/multi-agent-coding-system](https://github.com/Danau5tin/multi-agent-coding-system) - Smart context-sharing inspiration
|
|
170
106
|
- [GuDaStudio/geminimcp](https://github.com/GuDaStudio/geminimcp) - Gemini MCP
|
|
171
107
|
- [GuDaStudio/codexmcp](https://github.com/GuDaStudio/codexmcp) - Codex MCP
|
package/agents/code-reviewer.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: code-reviewer
|
|
3
3
|
description: |
|
|
4
4
|
Use this agent when a major project step has been completed and needs to be reviewed against the original plan and coding standards. Examples: <example>Context: The user is creating a code-review agent that should be called after a logical chunk of code is written. user: "I've finished implementing the user authentication system as outlined in step 3 of our plan" assistant: "Great work! Now let me use the code-reviewer agent to review the implementation against our plan and coding standards" <commentary>Since a major project step has been completed, use the code-reviewer agent to validate the work against the plan and identify any issues.</commentary></example> <example>Context: User has completed a significant feature implementation. user: "The API endpoints for the task management system are now complete - that covers step 2 from our architecture document" assistant: "Excellent! Let me have the code-reviewer agent examine this implementation to ensure it aligns with our plan and follows best practices" <commentary>A numbered step from the planning document has been completed, so the code-reviewer agent should review the work.</commentary></example>
|
|
5
|
-
model:
|
|
5
|
+
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
You are the final code review arbiter with expertise in software architecture, design patterns, and best practices. Your role is to review completed project steps against original plans, evaluate any assistant-review feedback, and make the final judgment on whether the implementation is ready.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { install } from '../lib/installer.js';
|
|
4
|
+
import { collectInteractiveConfig } from '../lib/prompts.js';
|
|
5
|
+
import { writeMcpConfig } from '../lib/mcp-config.js';
|
|
6
|
+
|
|
7
|
+
const AGENTS = new Set(['claude-code', 'cursor', 'antigravity']);
|
|
8
|
+
const FLAG_TO_ENV = {
|
|
9
|
+
'--grok-api-url': 'GROK_API_URL',
|
|
10
|
+
'--grok-api-key': 'GROK_API_KEY',
|
|
11
|
+
'--tavily-api-url': 'TAVILY_API_URL',
|
|
12
|
+
'--tavily-api-key': 'TAVILY_API_KEY',
|
|
13
|
+
'--firecrawl-api-key': 'FIRECRAWL_API_KEY',
|
|
14
|
+
'--firecrawl-api-url': 'FIRECRAWL_API_URL'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
async function main() {
|
|
18
|
+
const { command, flags } = parseArgs(process.argv.slice(2));
|
|
19
|
+
|
|
20
|
+
if (flags.help || command === 'help') {
|
|
21
|
+
printHelp();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (command === 'init') {
|
|
26
|
+
const { agents, mcpEnv } = await collectInteractiveConfig();
|
|
27
|
+
await runInstall(agents, mcpEnv);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (command === 'install') {
|
|
32
|
+
const agents = parseAgents(flags.agents);
|
|
33
|
+
const mcpEnv = collectFlagMcpEnv(flags);
|
|
34
|
+
|
|
35
|
+
ensureRequiredGrokConfig(mcpEnv);
|
|
36
|
+
|
|
37
|
+
await runInstall(agents, mcpEnv);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
throw new Error(`Unknown command: ${command}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function runInstall(agents, mcpEnv) {
|
|
45
|
+
await install(agents);
|
|
46
|
+
await writeMcpConfig(mcpEnv);
|
|
47
|
+
|
|
48
|
+
console.log(`Installed superpowers-ccg for: ${agents.join(', ')}`);
|
|
49
|
+
console.log('Updated project MCP settings in .claude/settings.json');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function parseArgs(argv) {
|
|
53
|
+
if (argv.length === 0) {
|
|
54
|
+
return {
|
|
55
|
+
command: 'init',
|
|
56
|
+
flags: {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let command = 'init';
|
|
61
|
+
let index = 0;
|
|
62
|
+
|
|
63
|
+
if (!argv[0].startsWith('-')) {
|
|
64
|
+
command = argv[0];
|
|
65
|
+
index = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const flags = {};
|
|
69
|
+
|
|
70
|
+
for (; index < argv.length; index += 1) {
|
|
71
|
+
const arg = argv[index];
|
|
72
|
+
|
|
73
|
+
if (!arg.startsWith('-')) {
|
|
74
|
+
throw new Error(`Unexpected argument: ${arg}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (arg === '--help' || arg === '-h') {
|
|
78
|
+
flags.help = true;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const [name, inlineValue] = arg.split(/=(.*)/s, 2);
|
|
83
|
+
|
|
84
|
+
if (!(name in FLAG_TO_ENV) && name !== '--agents') {
|
|
85
|
+
throw new Error(`Unknown flag: ${name}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let value = inlineValue;
|
|
89
|
+
|
|
90
|
+
if (value === undefined) {
|
|
91
|
+
index += 1;
|
|
92
|
+
|
|
93
|
+
if (index >= argv.length) {
|
|
94
|
+
throw new Error(`Missing value for ${name}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
value = argv[index];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
flags[name.slice(2).replace(/-([a-z])/g, (_, char) => char.toUpperCase())] = value;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return { command, flags };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function parseAgents(value) {
|
|
107
|
+
if (!value) {
|
|
108
|
+
throw new Error('Missing required flag: --agents');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const agents = value
|
|
112
|
+
.split(',')
|
|
113
|
+
.map((agent) => agent.trim())
|
|
114
|
+
.filter(Boolean);
|
|
115
|
+
|
|
116
|
+
if (agents.length === 0) {
|
|
117
|
+
throw new Error('At least one agent must be provided.');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
for (const agent of agents) {
|
|
121
|
+
if (!AGENTS.has(agent)) {
|
|
122
|
+
throw new Error(`Unsupported agent: ${agent}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return [...new Set(agents)];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function collectFlagMcpEnv(flags) {
|
|
130
|
+
const mcpEnv = {};
|
|
131
|
+
|
|
132
|
+
for (const [flag, envKey] of Object.entries(FLAG_TO_ENV)) {
|
|
133
|
+
const flagKey = flag.slice(2).replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
134
|
+
const value = typeof flags[flagKey] === 'string' ? flags[flagKey].trim() : '';
|
|
135
|
+
|
|
136
|
+
if (value) {
|
|
137
|
+
mcpEnv[envKey] = value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return mcpEnv;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function ensureRequiredGrokConfig(mcpEnv) {
|
|
145
|
+
const requiredKeys = ['GROK_API_URL', 'GROK_API_KEY'];
|
|
146
|
+
const missingKeys = requiredKeys.filter((key) => !mcpEnv[key]);
|
|
147
|
+
|
|
148
|
+
if (missingKeys.length > 0) {
|
|
149
|
+
throw new Error(`Missing required flags: ${missingKeys.map((key) => envKeyToFlag(key)).join(', ')}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function envKeyToFlag(envKey) {
|
|
154
|
+
return `--${envKey.toLowerCase().replace(/_/g, '-')}`;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function printHelp() {
|
|
158
|
+
console.log(`Usage:
|
|
159
|
+
superpowers-ccg [init]
|
|
160
|
+
superpowers-ccg install --agents <comma-list> --grok-api-url <url> --grok-api-key <key> [options]
|
|
161
|
+
|
|
162
|
+
Agents:
|
|
163
|
+
claude-code,cursor,antigravity
|
|
164
|
+
|
|
165
|
+
Options:
|
|
166
|
+
--agents <comma-list>
|
|
167
|
+
--grok-api-url <url>
|
|
168
|
+
--grok-api-key <key>
|
|
169
|
+
--tavily-api-url <url>
|
|
170
|
+
--tavily-api-key <key>
|
|
171
|
+
--firecrawl-api-key <key>
|
|
172
|
+
--firecrawl-api-url <url>
|
|
173
|
+
-h, --help`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
main().catch((error) => {
|
|
177
|
+
console.error(error.message);
|
|
178
|
+
process.exitCode = 1;
|
|
179
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# PreToolUse hook for Task tool -
|
|
3
|
-
|
|
4
|
-
echo "⚠️
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PreToolUse hook for Task tool - keep Task usage aligned with the CP workflow
|
|
3
|
+
|
|
4
|
+
echo "⚠️ CP routing check: use Task for coordination, review, or exploration only; route implementation through CP1 to Codex or Gemini, and keep CP4 Final Spec Review in the Claude main thread." >&2
|
package/hooks/session-start.sh
CHANGED
|
@@ -14,11 +14,12 @@ fi
|
|
|
14
14
|
COMPACT_CONTEXT="$(cat <<'ENDOFCOMPACT'
|
|
15
15
|
You have superpowers.
|
|
16
16
|
|
|
17
|
-
**Core Rules:**
|
|
18
|
-
1. **1% Rule:** If there is even a 1% chance a skill applies, use the Skill tool to load it before responding.
|
|
19
|
-
2. **
|
|
20
|
-
3. **
|
|
21
|
-
4. **
|
|
17
|
+
**Core Rules:**
|
|
18
|
+
1. **1% Rule:** If there is even a 1% chance a skill applies, use the Skill tool to load it before responding.
|
|
19
|
+
2. **CP0 first:** Do minimal context acquisition before routing. Use Auggie for full local codebase context retrieval, and use Grok Search only for external/current knowledge or research.
|
|
20
|
+
3. **Claude is orchestrator-only:** All implementation code goes through external models (Codex/Gemini MCP).
|
|
21
|
+
4. **Checkpoint Protocol:** CP1 Task Assessment & Routing before the first Task call, CP2 External Execution when routing to external models, CP3 Reconciliation only after cross-validation or conflicting/non-trivial external feedback, and CP4 Final Spec Review as the last step.
|
|
22
|
+
5. **Fail-Closed:** If Routing != CLAUDE and MCP call fails, output BLOCKED (see GATE.md for tiered policy).
|
|
22
23
|
|
|
23
24
|
**Multi-Model Routing:**
|
|
24
25
|
- Backend (API, DB, auth) → CODEX (`mcp__codex__codex`)
|
|
@@ -27,13 +28,11 @@ You have superpowers.
|
|
|
27
28
|
- Full-stack/uncertain → CROSS_VALIDATION (multiple)
|
|
28
29
|
- Docs/coordination only → CLAUDE
|
|
29
30
|
|
|
30
|
-
**
|
|
31
|
-
|
|
32
|
-
**Supplementary Tools (optional):** Grok Search/Tavily (research), Sequential-Thinking (complex reasoning), Serena (shared context bus), Magic (UI components), Morphllm (bulk edits).
|
|
31
|
+
**Supplementary Tools (optional):** Grok Search/Tavily (research), Sequential-Thinking (complex reasoning), Magic (UI components), Morphllm (bulk edits).
|
|
33
32
|
|
|
34
33
|
**Skill Namespace:** `superpowers-ccg:` — use Skill tool to load any skill by name.
|
|
35
34
|
|
|
36
|
-
**To learn more:** Load `superpowers-ccg:
|
|
35
|
+
**To learn more:** Load `superpowers-ccg:coordinating-multi-model-work` for the full orchestration workflow.
|
|
37
36
|
ENDOFCOMPACT
|
|
38
37
|
)"
|
|
39
38
|
|
|
@@ -3,29 +3,63 @@
|
|
|
3
3
|
|
|
4
4
|
set -euo pipefail
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Print the reminder as literal text so markdown backticks never trigger shell execution.
|
|
7
|
+
cat <<'EOF'
|
|
8
|
+
[CP Protocol Threshold]
|
|
7
9
|
|
|
8
|
-
Before the first Task call,
|
|
9
|
-
|
|
10
|
+
Before the first Task call, do minimal CP0 context acquisition using Auggie for full local context retrieval and Grok Search only for external/current knowledge or research.
|
|
11
|
+
Immediately after CP0 completes, run CP1 Task Assessment & Routing using the original user request and the CP0 context artifacts, then build one task-scoped context bundle for the next bounded task.
|
|
12
|
+
CP1 routing guide:
|
|
13
|
+
| Task Category | Model | Cross-Validation | Notes / Triggers |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| Pure Frontend / UI / Styling | Gemini | No | Fastest path |
|
|
16
|
+
| Pure Backend / Logic / API | Codex | No | Use cross-validation only if the task becomes high-impact or architecture-heavy |
|
|
17
|
+
| Full-Stack / Architecture | Cross-Validation (Codex + Gemini) | Yes | Both models run in parallel |
|
|
18
|
+
| Docs / Comments / Simple Fix | Claude | No | Usually no external models |
|
|
19
|
+
| Debugging / Performance | Codex | No | Escalate to cross-validation only if the failure mode stays ambiguous |
|
|
20
|
+
| Infrastructure / DevOps | Codex | No | Use cross-validation only for high-risk changes |
|
|
21
|
+
| Data / ML / Analytics | Codex | No | Use cross-validation only if the task becomes unusually complex |
|
|
22
|
+
| Testing / Test Coverage | Cross-Validation (Codex + Gemini) | Yes | Useful when tests span frontend and backend behavior |
|
|
23
|
+
| Cross-Cutting / Security | Codex | Yes | Extra safety layer |
|
|
24
|
+
| Uncategorized / Ambiguous | Claude | No | Fail-closed: ask clarifying questions immediately |
|
|
25
|
+
If the request is unclear or incomplete, route to Claude, output the CP1 block below, and then immediately ask clarifying questions.
|
|
26
|
+
If CP1 routes to Gemini, Codex, or Cross-Validation, run CP2 External Execution using a task-scoped context bundle: compressed original request, context refs, hydrated context snippets, and the CP1 task summary plus success criteria. Reuse the same worker SESSION_ID only for follow-up fixes on that bounded task, and send deltas only on follow-up turns. Require final file contents directly (preferred) or a unified diff patch using External Response Protocol v1.1.
|
|
27
|
+
If CP1 chose Cross-Validation or CP2 returned conflicts, overlap, PARTIAL/NO spec compliance, clarifications, CONTINUE_SESSION, or other non-trivial feedback, run CP3 Reconciliation. In CP3, parse every External Response Protocol block, resolve conflicts against the original requirement, decide whether to proceed, retry, continue, or ask the user, and do not apply file edits yourself.
|
|
28
|
+
Always run CP4 Final Spec Review as the final step, after CP3 when reconciliation is needed or directly after Claude-only / non-reconciled work. In CP4, use the original user request, the CP1 task summary, and the files changed by the workflow to judge spec satisfaction only. Do not perform code quality, style, redundancy, or best-practice review in CP4.
|
|
10
29
|
|
|
11
|
-
Use the
|
|
30
|
+
Use the exact CP1, CP3, and CP4 formats below. Do not add extra narration inside those blocks. Use the literal headings and field labels exactly as written. Do not rename them. The CP1 route bullets must begin exactly with `- Model:`, `- Cross-Validation:`, and `- Reason:`. Legacy `[CP1 Assessment]`, `[CP1] Routing`, `[CP3 Assessment]`, and `[CP3] Verified` formats are invalid.
|
|
12
31
|
|
|
13
|
-
|
|
14
|
-
- Task type: [Frontend/Backend/Full-stack/Other]
|
|
15
|
-
- Complexity: [Trivial/Standard/Critical]
|
|
16
|
-
- Routing decision: [CLAUDE/CODEX/GEMINI/CROSS_VALIDATION]
|
|
17
|
-
- Rationale: [one sentence]
|
|
32
|
+
# CP1 ROUTING DECISION
|
|
18
33
|
|
|
19
|
-
|
|
20
|
-
[
|
|
34
|
+
## Task Summary
|
|
35
|
+
[One-sentence English summary of the request]
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
37
|
+
## Route
|
|
38
|
+
- Model: Gemini / Codex / Cross-Validation (Codex + Gemini) / Claude
|
|
39
|
+
- Cross-Validation: Yes / No
|
|
40
|
+
- Reason: [short 1-line justification]
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
[
|
|
29
|
-
"
|
|
42
|
+
## Next Action
|
|
43
|
+
[Proceed to CP2 with the chosen model(s) OR handle directly OR ask user]
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
# CP3 RECONCILIATION COMPLETE
|
|
46
|
+
|
|
47
|
+
## Summary
|
|
48
|
+
[One-sentence summary of what was merged/applied]
|
|
49
|
+
|
|
50
|
+
## Changes Applied
|
|
51
|
+
- [List of files created/edited/deleted]
|
|
52
|
+
|
|
53
|
+
## Status
|
|
54
|
+
Ready for CP4
|
|
55
|
+
|
|
56
|
+
# CP4 SPEC REVIEW COMPLETE
|
|
57
|
+
|
|
58
|
+
## Result
|
|
59
|
+
- **Status**: PASS / PARTIAL / FAIL
|
|
60
|
+
- **Explanation**: [Clear, concise explanation]
|
|
61
|
+
|
|
62
|
+
## Recommendation
|
|
63
|
+
- If PASS: Task is complete
|
|
64
|
+
- If PARTIAL/FAIL: [Specific gaps + suggested next action (e.g. re-run external model or ask user)]
|
|
65
|
+
EOF
|
package/lib/installer.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
const AGENTS = new Set(['claude-code', 'cursor', 'antigravity']);
|
|
5
|
+
|
|
6
|
+
export async function install(agents) {
|
|
7
|
+
if (!Array.isArray(agents) || agents.length === 0) {
|
|
8
|
+
throw new Error('At least one agent must be selected for installation.');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
for (const agent of agents) {
|
|
12
|
+
if (!AGENTS.has(agent)) {
|
|
13
|
+
throw new Error(`Unsupported agent: ${agent}`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const sourceDir = new URL(`../templates/${agent}/`, import.meta.url);
|
|
17
|
+
await copyTree(sourceDir, process.cwd());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await copyTree(new URL('../skills/', import.meta.url), path.join(process.cwd(), 'skills'));
|
|
21
|
+
await copyTree(new URL('../agents/', import.meta.url), path.join(process.cwd(), 'agents'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function copyTree(sourceDir, destinationDir) {
|
|
25
|
+
const entries = await fs.readdir(sourceDir, { withFileTypes: true });
|
|
26
|
+
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
const sourcePath = new URL(entry.isDirectory() ? `${entry.name}/` : entry.name, sourceDir);
|
|
29
|
+
const destinationPath = path.join(destinationDir, entry.name);
|
|
30
|
+
|
|
31
|
+
if (entry.isDirectory()) {
|
|
32
|
+
await fs.mkdir(destinationPath, { recursive: true });
|
|
33
|
+
await copyTree(sourcePath, destinationPath);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
await fs.access(destinationPath);
|
|
39
|
+
console.warn(`Skipping existing file: ${path.relative(process.cwd(), destinationPath)}`);
|
|
40
|
+
continue;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (error.code !== 'ENOENT') {
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
await fs.mkdir(path.dirname(destinationPath), { recursive: true });
|
|
48
|
+
await fs.copyFile(sourcePath, destinationPath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
const GROK_SEARCH_URL = 'git+https://github.com/GuDaStudio/GrokSearch@grok-with-tavily';
|
|
5
|
+
const GEMINI_URL = 'git+https://github.com/GuDaStudio/codexmcp.git';
|
|
6
|
+
const CODEX_URL = 'git+https://github.com/GuDaStudio/geminimcp.git';
|
|
7
|
+
|
|
8
|
+
export async function writeMcpConfig(mcpEnv) {
|
|
9
|
+
const settingsDir = path.join(process.cwd(), '.claude');
|
|
10
|
+
const settingsPath = path.join(settingsDir, 'settings.json');
|
|
11
|
+
|
|
12
|
+
await fs.mkdir(settingsDir, { recursive: true });
|
|
13
|
+
|
|
14
|
+
const existingSettings = await readJson(settingsPath);
|
|
15
|
+
const nextSettings = {
|
|
16
|
+
...existingSettings,
|
|
17
|
+
mcpServers: {
|
|
18
|
+
...(existingSettings.mcpServers ?? {}),
|
|
19
|
+
...buildMcpServers(mcpEnv)
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
await fs.writeFile(settingsPath, `${JSON.stringify(nextSettings, null, 2)}\n`, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function buildMcpServers(mcpEnv) {
|
|
27
|
+
return {
|
|
28
|
+
auggie: {
|
|
29
|
+
type: 'stdio',
|
|
30
|
+
command: 'auggie',
|
|
31
|
+
args: ['--mcp', '--mcp-auto-workspace']
|
|
32
|
+
},
|
|
33
|
+
'grok-search': {
|
|
34
|
+
type: 'stdio',
|
|
35
|
+
...buildUvxCommand(GROK_SEARCH_URL, 'grok-search'),
|
|
36
|
+
env: omitEmptyEnv(mcpEnv)
|
|
37
|
+
},
|
|
38
|
+
gemini: {
|
|
39
|
+
type: 'stdio',
|
|
40
|
+
...buildUvxCommand(GEMINI_URL, 'geminimcp')
|
|
41
|
+
},
|
|
42
|
+
codex: {
|
|
43
|
+
type: 'stdio',
|
|
44
|
+
...buildUvxCommand(CODEX_URL, 'codexmcp')
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function buildUvxCommand(url, entry) {
|
|
50
|
+
if (process.platform === 'win32') {
|
|
51
|
+
return {
|
|
52
|
+
command: 'cmd',
|
|
53
|
+
args: ['/c', 'uvx', '--from', url, entry]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
command: 'uvx',
|
|
59
|
+
args: ['--from', url, entry]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function omitEmptyEnv(mcpEnv = {}) {
|
|
64
|
+
return Object.fromEntries(
|
|
65
|
+
Object.entries(mcpEnv).filter(([, value]) => typeof value === 'string' && value.trim() !== '')
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function readJson(filePath) {
|
|
70
|
+
try {
|
|
71
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
72
|
+
|
|
73
|
+
if (!content.trim()) {
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return JSON.parse(content);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if (error.code === 'ENOENT') {
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
}
|