feed-the-machine 1.0.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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -0
  3. package/bin/generate-manifest.mjs +210 -0
  4. package/bin/install.mjs +114 -0
  5. package/ftm/SKILL.md +88 -0
  6. package/ftm-audit/SKILL.md +146 -0
  7. package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -0
  8. package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -0
  9. package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -0
  10. package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -0
  11. package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -0
  12. package/ftm-audit/scripts/run-knip.sh +23 -0
  13. package/ftm-audit.yml +2 -0
  14. package/ftm-brainstorm/SKILL.md +379 -0
  15. package/ftm-brainstorm/evals/evals.json +100 -0
  16. package/ftm-brainstorm/evals/promptfoo.yaml +109 -0
  17. package/ftm-brainstorm/references/agent-prompts.md +224 -0
  18. package/ftm-brainstorm/references/plan-template.md +121 -0
  19. package/ftm-brainstorm.yml +2 -0
  20. package/ftm-browse/SKILL.md +415 -0
  21. package/ftm-browse/daemon/browser-manager.ts +206 -0
  22. package/ftm-browse/daemon/bun.lock +30 -0
  23. package/ftm-browse/daemon/cli.ts +347 -0
  24. package/ftm-browse/daemon/commands.ts +410 -0
  25. package/ftm-browse/daemon/main.ts +357 -0
  26. package/ftm-browse/daemon/package.json +17 -0
  27. package/ftm-browse/daemon/server.ts +189 -0
  28. package/ftm-browse/daemon/snapshot.ts +519 -0
  29. package/ftm-browse/daemon/tsconfig.json +22 -0
  30. package/ftm-browse.yml +4 -0
  31. package/ftm-codex-gate/SKILL.md +302 -0
  32. package/ftm-codex-gate.yml +2 -0
  33. package/ftm-config/SKILL.md +310 -0
  34. package/ftm-config.default.yml +80 -0
  35. package/ftm-config.yml +2 -0
  36. package/ftm-council/SKILL.md +132 -0
  37. package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -0
  38. package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -0
  39. package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -0
  40. package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -0
  41. package/ftm-council/references/protocols/PREREQUISITES.md +47 -0
  42. package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -0
  43. package/ftm-council.yml +2 -0
  44. package/ftm-dashboard.yml +4 -0
  45. package/ftm-debug/SKILL.md +146 -0
  46. package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -0
  47. package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -0
  48. package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -0
  49. package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -0
  50. package/ftm-debug/references/protocols/BLACKBOARD.md +86 -0
  51. package/ftm-debug/references/protocols/EDGE-CASES.md +103 -0
  52. package/ftm-debug.yml +2 -0
  53. package/ftm-diagram/SKILL.md +233 -0
  54. package/ftm-diagram.yml +2 -0
  55. package/ftm-executor/SKILL.md +657 -0
  56. package/ftm-executor/references/STYLE-TEMPLATE.md +73 -0
  57. package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -0
  58. package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -0
  59. package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -0
  60. package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -0
  61. package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -0
  62. package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -0
  63. package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -0
  64. package/ftm-executor/references/protocols/MODEL-PROFILE.md +44 -0
  65. package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -0
  66. package/ftm-executor/runtime/ftm-runtime.mjs +252 -0
  67. package/ftm-executor/runtime/package.json +8 -0
  68. package/ftm-executor.yml +2 -0
  69. package/ftm-git/SKILL.md +195 -0
  70. package/ftm-git/evals/evals.json +26 -0
  71. package/ftm-git/evals/promptfoo.yaml +75 -0
  72. package/ftm-git/hooks/post-commit-experience.sh +92 -0
  73. package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -0
  74. package/ftm-git/references/protocols/REMEDIATION.md +139 -0
  75. package/ftm-git/scripts/pre-commit-secrets.sh +110 -0
  76. package/ftm-git.yml +2 -0
  77. package/ftm-intent/SKILL.md +198 -0
  78. package/ftm-intent.yml +2 -0
  79. package/ftm-map.yml +2 -0
  80. package/ftm-mind/SKILL.md +986 -0
  81. package/ftm-mind/evals/promptfoo.yaml +142 -0
  82. package/ftm-mind/references/blackboard-schema.md +328 -0
  83. package/ftm-mind/references/complexity-guide.md +110 -0
  84. package/ftm-mind/references/event-registry.md +299 -0
  85. package/ftm-mind/references/mcp-inventory.md +296 -0
  86. package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -0
  87. package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -0
  88. package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -0
  89. package/ftm-mind/references/reflexion-protocol.md +249 -0
  90. package/ftm-mind/references/routing/SCENARIOS.md +22 -0
  91. package/ftm-mind/references/routing-scenarios.md +35 -0
  92. package/ftm-mind.yml +2 -0
  93. package/ftm-pause/SKILL.md +133 -0
  94. package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -0
  95. package/ftm-pause/references/protocols/VALIDATION.md +80 -0
  96. package/ftm-pause.yml +2 -0
  97. package/ftm-researcher.yml +2 -0
  98. package/ftm-resume/SKILL.md +166 -0
  99. package/ftm-resume/references/protocols/VALIDATION.md +172 -0
  100. package/ftm-resume.yml +2 -0
  101. package/ftm-retro/SKILL.md +189 -0
  102. package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -0
  103. package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -0
  104. package/ftm-retro.yml +2 -0
  105. package/ftm-routine.yml +4 -0
  106. package/ftm-state/blackboard/context.json +23 -0
  107. package/ftm-state/blackboard/experiences/index.json +9 -0
  108. package/ftm-state/blackboard/patterns.json +6 -0
  109. package/ftm-state/schemas/context.schema.json +130 -0
  110. package/ftm-state/schemas/experience-index.schema.json +77 -0
  111. package/ftm-state/schemas/experience.schema.json +78 -0
  112. package/ftm-state/schemas/patterns.schema.json +44 -0
  113. package/ftm-upgrade/SKILL.md +153 -0
  114. package/ftm-upgrade/scripts/check-version.sh +76 -0
  115. package/ftm-upgrade/scripts/upgrade.sh +143 -0
  116. package/ftm-upgrade.yml +2 -0
  117. package/ftm.yml +2 -0
  118. package/install.sh +102 -0
  119. package/package.json +74 -0
  120. package/uninstall.sh +25 -0
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: ftm-council
3
+ description: Multi-AI deliberation council that sends problems to Claude, Codex, and Gemini as equal peers, then loops through rounds of debate until 2-of-3 agree on a decision. Use when the user wants a second (and third) opinion, says "council this", "get other opinions", "what would other AIs think", "debate this", "multi-model", "ftm-council", or wants to cross-check a decision, architecture choice, debugging approach, or any problem where diverse AI perspectives would reduce blind spots. Especially valuable for debugging hard problems, architecture decisions, code review, and any situation where confirmation bias from a single model is a risk. Even if the user just says "I'm not sure about this approach" or "sanity check this", consider invoking the council.
4
+ ---
5
+
6
+ ## Events
7
+
8
+ ### Emits
9
+ - `review_complete` — when the council reaches a majority verdict (2-of-3 agreement) or synthesizes a final recommendation after 5 rounds
10
+ - `task_completed` — when the deliberation session concludes and a verdict is returned to the caller
11
+
12
+ ### Listens To
13
+ (none — council is invoked explicitly by the user or by ftm-executor when an INTENT.md conflict requires arbitration)
14
+
15
+ ## Blackboard Read
16
+
17
+ Before starting, load context from the blackboard:
18
+
19
+ 1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
20
+ 2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter entries by tags matching the current decision domain
21
+ 3. Load top 3-5 matching experience files for past council verdicts and how well they held up
22
+ 4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check execution_patterns for what types of decisions benefited most from multi-model review
23
+
24
+ If index.json is empty or no matches found, proceed normally without experience-informed shortcuts.
25
+
26
+ # FTM Council
27
+
28
+ Three peers — a subagent investigator, Codex, and Gemini — independently research the codebase and deliberate on a problem through structured rounds of debate. No single model is the authority. Each model explores the code on its own, forms its own conclusions from what it finds, and only then enters deliberation. The council converges through majority vote: when 2 of 3 agree, that's the decision. If 5 rounds pass without majority agreement, the orchestrator synthesizes the best elements from all three positions and presents the user with a clear summary of where the models agreed, where they diverged, and a recommended path forward.
29
+
30
+ ## Why Independent Research Matters
31
+
32
+ Each model explores the codebase independently — different attention patterns, different navigation instincts, different focus areas. This produces genuinely diverse perspectives grounded in what each model actually found, not three reactions to one curated framing.
33
+
34
+ ## Prerequisites
35
+
36
+ Check tool availability before starting. Read `references/protocols/PREREQUISITES.md` for the full availability check, fallback logic, timeout configuration, and working directory setup.
37
+
38
+ Quick check:
39
+ ```bash
40
+ which codex && which gemini
41
+ ```
42
+ If either is missing, tell the user what to install and stop — don't try to run a degraded council without informing them.
43
+
44
+ ## The Protocol
45
+
46
+ ### Auto-Invocation Mode
47
+
48
+ Two invocation modes:
49
+ 1. **User-invoked** (default): Frame the problem in Step 0, proceed through protocol.
50
+ 2. **Auto-invoked**: Another skill provides a pre-framed conflict payload (containing `CONFLICT TYPE`, `ORIGINAL INTENT`, `CODEX'S CHANGE`, etc.). Skip Step 0, use the payload directly, include DEBUG.md history, run Steps 1-5, and return a structured `COUNCIL VERDICT` to the caller without user interaction.
51
+
52
+ ---
53
+
54
+ ### Step 0: Frame the Problem
55
+
56
+ > **Note:** Skipped in auto-invocation mode. If a structured conflict payload was provided, proceed directly to Step 1.
57
+
58
+ Distill the user's request into a self-contained **council prompt** — a clear problem statement with investigation entry points but no pre-read code. Models read the code themselves.
59
+
60
+ Read `references/protocols/STEP-0-FRAMING.md` for the full framing guide, including what to include, what to exclude, and the structured payload format.
61
+
62
+ Show the user the framed prompt before proceeding: "Here's what I'll send to the council — does this capture the problem?" Wait for confirmation or edits.
63
+
64
+ ---
65
+
66
+ ### Step 1: Independent Research (Round 1)
67
+
68
+ **You (the orchestrator) are NOT a peer in this step.** Do not form your own position yet. Spawn three independent investigations in parallel and collect the results.
69
+
70
+ Read `references/prompts/CLAUDE-INVESTIGATION.md`, `references/prompts/CODEX-INVESTIGATION.md`, and `references/prompts/GEMINI-INVESTIGATION.md` for the full prompt templates for each model.
71
+
72
+ Present results with a structured comparison showing each model's research, position, key evidence, and an alignment check (agreement areas, divergence points, majority forming?).
73
+
74
+ ---
75
+
76
+ ### Step 2: Check for Early Consensus
77
+
78
+ After each round, check if 2 of 3 positions substantially agree. "Substantially agree" means they recommend the same approach, even if they phrase it differently or differ on minor details. Don't require identical wording — look for the same core recommendation.
79
+
80
+ If majority exists → jump to **Step 5: Verdict**.
81
+ If not → continue to the next rebuttal round.
82
+
83
+ ---
84
+
85
+ ### Step 3: Rebuttal Rounds (Rounds 2-5)
86
+
87
+ Each model sees the other two models' previous positions and must respond directly to their evidence. Read `references/prompts/REBUTTAL-TEMPLATE.md` for the full rebuttal prompt template. Use same CLI flags for follow-up research. Present results highlighting what changed and whether consensus is forming.
88
+
89
+ ---
90
+
91
+ ### Step 4: Repeat or Escalate
92
+
93
+ After each rebuttal round, check for majority agreement (Step 2).
94
+
95
+ If after 5 rounds there's still no majority:
96
+ - This is a genuinely hard problem with legitimate disagreement
97
+ - Synthesize the three final positions into a summary
98
+ - Highlight the core tension — what's the fundamental tradeoff they can't agree on?
99
+ - Note which models examined which parts of the codebase — incomplete research might explain persistent disagreement
100
+ - Present the user with 2-3 concrete options (mapped to the council positions) and let them decide
101
+
102
+ ---
103
+
104
+ ### Step 5: Verdict
105
+
106
+ When 2 of 3 agree, present: decision, which models agreed, dissent, evidence basis, why the majority won, what the dissent raised that's still valid, and recommended action. Ask if the user wants to proceed or dig into the dissent.
107
+
108
+ **Auto-invocation:** Return structured `COUNCIL VERDICT` with `decision` (update_intent/revert_fix), `round`, `agreed_by`, `dissent`, `reasoning`, `debug_log_entry`. Do not ask the user — return directly to the calling skill.
109
+
110
+ ---
111
+
112
+ ## Practical Considerations
113
+
114
+ ### Conversation State
115
+ Orchestrator holds state between rounds. Codex and Gemini are stateless — every prompt must include full history.
116
+
117
+ ### When NOT to Council
118
+ Trivial questions, pure execution requests, pure opinion with no code to investigate, or when the user says "just do it". Exception: always proceed when auto-invoked by ftm-executor.
119
+
120
+ ---
121
+
122
+ ## Blackboard Write
123
+
124
+ After completing, update the blackboard:
125
+
126
+ 1. Update `~/.claude/ftm-state/blackboard/context.json`:
127
+ - Set current_task status to "complete"
128
+ - Append decision summary to recent_decisions including the verdict and which models agreed (cap at 10)
129
+ - Update session_metadata.skills_invoked and last_updated
130
+ 2. Write an experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json` capturing decision domain, verdict, round reached, dissent summary, and whether the verdict held up
131
+ 3. Update `~/.claude/ftm-state/blackboard/experiences/index.json` with the new entry
132
+ 4. Emit `task_completed` event
@@ -0,0 +1,60 @@
1
+ # Claude Investigation Prompt Template
2
+
3
+ Use this for spawning the Claude subagent in Step 1 (and rebuttal rounds). Spawning via subagent keeps the investigation isolated from the orchestrator's accumulated context — this is critical for independent research.
4
+
5
+ ## Round 1: Independent Research
6
+
7
+ ```
8
+ You are one of three AI peers in a deliberation council. The other two peers are Codex (OpenAI) and Gemini (Google). Your job is to independently investigate the following problem by reading the codebase, then give your honest, well-reasoned position.
9
+
10
+ IMPORTANT: Do your own research. Read files, search code, trace through logic. Your position must be grounded in what you actually find in the code, not assumptions. Cite specific files and line numbers.
11
+
12
+ PROBLEM:
13
+ {council_prompt}
14
+
15
+ WORKING DIRECTORY: {cwd}
16
+
17
+ Instructions:
18
+ 1. Start by exploring the relevant parts of the codebase — read files, search for patterns, trace dependencies
19
+ 2. Take notes on what you find as you go
20
+ 3. After you've done sufficient research, formulate your position
21
+
22
+ Give your response in this format:
23
+ 1. RESEARCH SUMMARY: What files you examined, what you found (with file:line references)
24
+ 2. POSITION: Your clear stance (1-2 sentences)
25
+ 3. REASONING: Why you believe this, grounded in specific code you read
26
+ 4. CONCERNS: What could go wrong with your approach
27
+ 5. CONFIDENCE: High/Medium/Low and why
28
+ ```
29
+
30
+ ## Rebuttal Rounds (Rounds 2-5)
31
+
32
+ The rebuttal subagent also runs isolated so it doesn't anchor on the orchestrator's context.
33
+
34
+ ```
35
+ Round {N} of the deliberation council.
36
+
37
+ Here's what happened in the previous round. Each model independently researched the codebase and formed a position:
38
+
39
+ PEER 1's research and position:
40
+ {peer1_previous_full}
41
+
42
+ PEER 2's research and position:
43
+ {peer2_previous_full}
44
+
45
+ YOUR previous research and position:
46
+ {claude_previous_full}
47
+
48
+ Now respond. You may do additional codebase research if you want to verify claims the other models made or investigate angles they raised. Then:
49
+
50
+ 1. Directly address the strongest point from each other model
51
+ 2. If another model cited code you haven't looked at, go read it and see if you agree with their interpretation
52
+ 3. State whether you've changed your position (and why, or why not)
53
+ 4. If you agree with another model, say so explicitly
54
+
55
+ UPDATED POSITION: [same/changed] ...
56
+ NEW EVIDENCE (if any): [anything new you found by following up on other models' research]
57
+ KEY RESPONSE TO PEER 1: ...
58
+ KEY RESPONSE TO PEER 2: ...
59
+ REMAINING DISAGREEMENTS: ...
60
+ ```
@@ -0,0 +1,58 @@
1
+ # Codex Investigation Prompt Template
2
+
3
+ Use this for spawning Codex via CLI. The `--full-auto` flag gives Codex sandboxed read access to the workspace so it can explore files on its own.
4
+
5
+ ## Round 1: Independent Research
6
+
7
+ ```bash
8
+ cd {cwd} && codex exec --full-auto "You are one of three AI peers in a deliberation council. The other two peers are a subagent investigator and Gemini (Google). Your job is to independently investigate the following problem by reading the codebase, then give your honest, well-reasoned position.
9
+
10
+ IMPORTANT: Do your own research. Read files, search code, trace through logic. Your position must be grounded in what you actually find in the code, not assumptions. Cite specific files and line numbers.
11
+
12
+ PROBLEM:
13
+ {council_prompt}
14
+
15
+ Instructions:
16
+ 1. Start by exploring the relevant parts of the codebase — read files, search for patterns, trace dependencies
17
+ 2. Take notes on what you find as you go
18
+ 3. After you have done sufficient research, formulate your position
19
+
20
+ Give your response in this format:
21
+ 1. RESEARCH SUMMARY: What files you examined, what you found (with file:line references)
22
+ 2. POSITION: Your clear stance (1-2 sentences)
23
+ 3. REASONING: Why you believe this, grounded in specific code you read
24
+ 4. CONCERNS: What could go wrong with your approach
25
+ 5. CONFIDENCE: High/Medium/Low and why"
26
+ ```
27
+
28
+ ## Rebuttal Rounds (Rounds 2-5)
29
+
30
+ Use `--full-auto` in rebuttal rounds as well — Codex may want to verify another model's claims by reading files it hadn't looked at before.
31
+
32
+ ```bash
33
+ cd {cwd} && codex exec --full-auto "Round {N} of the deliberation council.
34
+
35
+ Here's what happened in the previous round. Each model independently researched the codebase and formed a position:
36
+
37
+ PEER 1's research and position:
38
+ {peer1_previous_full}
39
+
40
+ PEER 2's research and position:
41
+ {peer2_previous_full}
42
+
43
+ YOUR previous research and position:
44
+ {codex_previous_full}
45
+
46
+ Now respond. You may do additional codebase research if you want to verify claims the other models made or investigate angles they raised. Then:
47
+
48
+ 1. Directly address the strongest point from each other model
49
+ 2. If another model cited code you haven't looked at, go read it and see if you agree with their interpretation
50
+ 3. State whether you've changed your position (and why, or why not)
51
+ 4. If you agree with another model, say so explicitly
52
+
53
+ UPDATED POSITION: [same/changed] ...
54
+ NEW EVIDENCE (if any): [anything new you found by following up on other models' research]
55
+ KEY RESPONSE TO PEER 1: ...
56
+ KEY RESPONSE TO PEER 2: ...
57
+ REMAINING DISAGREEMENTS: ..."
58
+ ```
@@ -0,0 +1,58 @@
1
+ # Gemini Investigation Prompt Template
2
+
3
+ Use this for spawning Gemini via CLI. The `--yolo` flag lets Gemini auto-approve file reads so it can explore without getting stuck on permission prompts.
4
+
5
+ ## Round 1: Independent Research
6
+
7
+ ```bash
8
+ cd {cwd} && gemini -p "You are one of three AI peers in a deliberation council. The other two peers are a subagent investigator and Codex (OpenAI). Your job is to independently investigate the following problem by reading the codebase, then give your honest, well-reasoned position.
9
+
10
+ IMPORTANT: Do your own research. Read files, search code, trace through logic. Your position must be grounded in what you actually find in the code, not assumptions. Cite specific files and line numbers.
11
+
12
+ PROBLEM:
13
+ {council_prompt}
14
+
15
+ Instructions:
16
+ 1. Start by exploring the relevant parts of the codebase — read files, search for patterns, trace dependencies
17
+ 2. Take notes on what you find as you go
18
+ 3. After you have done sufficient research, formulate your position
19
+
20
+ Give your response in this format:
21
+ 1. RESEARCH SUMMARY: What files you examined, what you found (with file:line references)
22
+ 2. POSITION: Your clear stance (1-2 sentences)
23
+ 3. REASONING: Why you believe this, grounded in specific code you read
24
+ 4. CONCERNS: What could go wrong with your approach
25
+ 5. CONFIDENCE: High/Medium/Low and why" --yolo
26
+ ```
27
+
28
+ ## Rebuttal Rounds (Rounds 2-5)
29
+
30
+ Use `--yolo` in rebuttal rounds as well — Gemini may want to verify another model's claims by reading files it hadn't looked at before.
31
+
32
+ ```bash
33
+ cd {cwd} && gemini -p "Round {N} of the deliberation council.
34
+
35
+ Here's what happened in the previous round. Each model independently researched the codebase and formed a position:
36
+
37
+ PEER 1's research and position:
38
+ {peer1_previous_full}
39
+
40
+ PEER 2's research and position:
41
+ {peer2_previous_full}
42
+
43
+ YOUR previous research and position:
44
+ {gemini_previous_full}
45
+
46
+ Now respond. You may do additional codebase research if you want to verify claims the other models made or investigate angles they raised. Then:
47
+
48
+ 1. Directly address the strongest point from each other model
49
+ 2. If another model cited code you haven't looked at, go read it and see if you agree with their interpretation
50
+ 3. State whether you've changed your position (and why, or why not)
51
+ 4. If you agree with another model, say so explicitly
52
+
53
+ UPDATED POSITION: [same/changed] ...
54
+ NEW EVIDENCE (if any): [anything new you found by following up on other models' research]
55
+ KEY RESPONSE TO PEER 1: ...
56
+ KEY RESPONSE TO PEER 2: ...
57
+ REMAINING DISAGREEMENTS: ..." --yolo
58
+ ```
@@ -0,0 +1,57 @@
1
+ # Rebuttal Round Prompt Template
2
+
3
+ Use this to construct the prompt sent to each model in rebuttal rounds (Steps 3-4). The prompt must be fully self-contained — Codex and Gemini are stateless between rounds, so every round's prompt must include the full history.
4
+
5
+ ## Template
6
+
7
+ ```
8
+ Round {N} of the deliberation council.
9
+
10
+ Here's what happened in the previous round. Each model independently researched the codebase and formed a position:
11
+
12
+ MODEL A's research and position:
13
+ {model_a_previous_full}
14
+
15
+ MODEL B's research and position:
16
+ {model_b_previous_full}
17
+
18
+ MODEL C's research and position:
19
+ {model_c_previous_full}
20
+
21
+ Now respond. You may do additional codebase research if you want to verify claims the other models made or investigate angles they raised. Then:
22
+
23
+ 1. Directly address the strongest point from each other model
24
+ 2. If another model cited code you haven't looked at, go read it and see if you agree with their interpretation
25
+ 3. State whether you've changed your position (and why, or why not)
26
+ 4. If you agree with another model, say so explicitly
27
+
28
+ UPDATED POSITION: [same/changed] ...
29
+ NEW EVIDENCE (if any): [anything new you found by following up on other models' research]
30
+ KEY RESPONSE TO MODEL A: ...
31
+ KEY RESPONSE TO MODEL B: ...
32
+ REMAINING DISAGREEMENTS: ...
33
+ ```
34
+
35
+ ## Construction Rules
36
+
37
+ - Replace `{model_a/b/c_previous_full}` with each model's complete response from the prior round — research summary, position, reasoning, concerns, and confidence
38
+ - Do NOT summarize or truncate prior responses — the full research context is what allows models to verify each other's findings
39
+ - Include ALL prior rounds' positions if building a multi-round history, not just the most recent
40
+ - Use the same CLI flags as Round 1 (`--full-auto` for Codex, `--yolo` for Gemini) so models can do follow-up research
41
+
42
+ ## Orchestrator State
43
+
44
+ Between rounds, the orchestrator holds all state. Keep a running record of:
45
+ - Each model's research findings per round (files examined, what was found)
46
+ - Each model's position per round
47
+ - Whether any model changed position and why
48
+
49
+ This record feeds the next round's rebuttal prompt. Without it, models cannot engage meaningfully with each other's evidence.
50
+
51
+ ## What to Watch For
52
+
53
+ When presenting round results to the user, highlight:
54
+ - **Position changes**: which model moved and what evidence caused the shift
55
+ - **New research**: if a model read files others hadn't looked at
56
+ - **Convergence signal**: models independently finding the same evidence
57
+ - **Persistent divergence**: models who've both read the same code and still disagree — this is a genuine hard problem
@@ -0,0 +1,47 @@
1
+ # Prerequisites: Tool Availability Checks
2
+
3
+ ## Required CLI Tools
4
+
5
+ The council requires both external CLI tools to be installed and authenticated:
6
+
7
+ - **Codex**: `npm install -g @openai/codex` (authenticated via `codex login`)
8
+ - **Gemini**: `npm install -g @google/gemini-cli` (authenticated via Google)
9
+
10
+ ## Availability Check
11
+
12
+ Before the first round, verify both tools are available:
13
+
14
+ ```bash
15
+ which codex && which gemini
16
+ ```
17
+
18
+ ## Fallback Logic
19
+
20
+ | Scenario | Action |
21
+ |---|---|
22
+ | Both tools missing | Tell the user what to install and stop — don't attempt a degraded council |
23
+ | One tool missing | Report which tool is missing. A 2-model debate loses the tiebreaker benefit — ask the user if they want to proceed or install the missing tool first |
24
+ | Auth failure at runtime | Report the error to the user. Continue with the remaining models. A 2-model debate is better than nothing |
25
+ | Rate limit or sandbox error at runtime | Report the error. Continue with the remaining models |
26
+
27
+ **Do not silently proceed with a degraded council.** Always tell the user which tool is unavailable and why. The tiebreaker value of a 3-model council is significant for close decisions.
28
+
29
+ ## Runtime Timeout Configuration
30
+
31
+ Set timeouts per round type:
32
+
33
+ - **Round 1 (Independent Research)**: 300s (5 minutes) — models are reading files and searching code
34
+ - **Rebuttal rounds (2-5)**: 180s — less exploration, more focused follow-up
35
+
36
+ If one model times out in any round, report it and continue with the other two.
37
+
38
+ ## Working Directory
39
+
40
+ Make sure both CLI tools run from the same working directory as the current session. This ensures all models look at the same codebase.
41
+
42
+ Pass `cd {cwd} &&` before CLI commands if needed:
43
+
44
+ ```bash
45
+ cd /path/to/project && codex exec --full-auto "..."
46
+ cd /path/to/project && gemini -p "..." --yolo
47
+ ```
@@ -0,0 +1,46 @@
1
+ # Step 0: Frame the Problem
2
+
3
+ > **Note:** This step is skipped in auto-invocation mode. If a structured conflict payload was provided, proceed directly to Step 1 using the payload as the council prompt.
4
+
5
+ Take the user's request and distill it into a clear **council prompt** — a self-contained problem statement that makes sense without conversation history. The prompt should describe the problem and what a good answer looks like, but it should NOT include pre-read code. The models will read the code themselves.
6
+
7
+ ## What to Include
8
+
9
+ - The specific question or decision to be made
10
+ - File paths or areas of the codebase to start investigating (as pointers, not content)
11
+ - Error messages or symptoms if it's a debugging problem
12
+ - Decision criteria — what a good answer looks like
13
+ - Any constraints the user has mentioned
14
+
15
+ ## What to Exclude
16
+
17
+ - Pre-read file contents (each model reads files itself)
18
+ - Your own analysis or opinion about the problem
19
+ - Summaries of what the code does (let each model discover that)
20
+
21
+ ## Confirmation Gate
22
+
23
+ Show the user the framed prompt before proceeding: "Here's what I'll send to the council — does this capture the problem?" Wait for confirmation or edits.
24
+
25
+ ## Structured Payload Format
26
+
27
+ When creating the council prompt, use this structure:
28
+
29
+ ```
30
+ PROBLEM:
31
+ [Clear statement of the question or decision]
32
+
33
+ CODEBASE ENTRY POINTS:
34
+ [File paths or directories to investigate — no content, just paths]
35
+
36
+ SYMPTOMS / ERROR MESSAGES:
37
+ [If debugging: exact error text, stack traces, reproduction steps]
38
+
39
+ DECISION CRITERIA:
40
+ [What a good answer looks like — what tradeoffs matter here]
41
+
42
+ CONSTRAINTS:
43
+ [Any hard requirements, technology restrictions, or non-negotiables]
44
+ ```
45
+
46
+ The prompt must be fully self-contained. A model dropped into a fresh session with only this prompt should know exactly what to investigate and what success looks like.
@@ -0,0 +1,2 @@
1
+ name: ftm-council
2
+ description: Multi-AI deliberation council that sends problems to Claude, Codex, and Gemini as equal peers, then loops through rounds of debate until 2-of-3 agree on a decision. Use when the user wants a second (and third) opinion, says "council this", "get other opinions", "what would other AIs think", "debate this", "multi-model", "ftm-council", or wants to cross-check a decision, architecture choice, debugging approach, or any problem where diverse AI perspectives would reduce blind spots. Especially valuable for debugging hard problems, architecture decisions, code review, and any situation where confirmation bias from a single model is a risk. Even if the user just says "I'm not sure about this approach" or "sanity check this", consider invoking the council.
@@ -0,0 +1,4 @@
1
+ ---
2
+ name: ftm-dashboard
3
+ description: Session and weekly analytics dashboard for the FTM skill ecosystem. Reads events.log and blackboard state to show skills invoked, plans presented, approval rates, experiences recorded, and patterns promoted. Use when user says "dashboard", "analytics", "stats", "ftm-dashboard", "show session stats", or "how's the system doing".
4
+ ---
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: ftm-debug
3
+ description: Deep multi-vector debugging war room that launches parallel agent teams to instrument, research, reproduce, hypothesize, solve, and verify tricky bugs. Use when a bug is stubborn, multi-turn debugging hasn't worked, the user says "debug this deeply", "war room this", "I can't figure out why", "this is driving me crazy", "launch the debug team", or any situation where standard debugging is insufficient. Also triggers on "/ftm-debug". Covers any codebase — frontend, backend, CLI tools, native apps, build systems, anything. Do NOT use for simple one-step fixes — this is the heavy artillery for problems that resist normal debugging.
4
+ ---
5
+
6
+ ## Events
7
+
8
+ ### Emits
9
+ - `bug_fixed` — when the Reviewer agent approves a fix and the bug is confirmed resolved
10
+ - `issue_found` — when investigation surfaces a specific problem (hypothesis confirmed, instrumentation reveals root cause)
11
+ - `test_passed` — when the reproduction test passes after a fix, or when the full suite passes post-fix
12
+ - `test_failed` — when the reproduction test fails, or when a fix attempt causes regressions
13
+ - `error_encountered` — when an unexpected error halts the war room workflow (agent failure, unrecoverable blocker)
14
+ - `task_completed` — when the debug session concludes with an approved and merged fix
15
+
16
+ ### Listens To
17
+ - `test_failed` — auto-investigate: launch Phase 0 intake and deploy the war room agent team
18
+ - `error_encountered` — diagnose the error: run codebase reconnaissance and begin targeted investigation
19
+
20
+ ## Blackboard Read
21
+
22
+ Before starting, load context from the blackboard. Read `references/protocols/BLACKBOARD.md` for full protocol. Summary:
23
+
24
+ 1. Read `~/.claude/ftm-state/blackboard/context.json` — check current_task, recent_decisions, active_constraints
25
+ 2. Read `~/.claude/ftm-state/blackboard/experiences/index.json` — filter entries by task_type="bug" and tags matching the current error domain
26
+ 3. Load top 3-5 matching experience files for known fixes and failed approaches
27
+ 4. Read `~/.claude/ftm-state/blackboard/patterns.json` — check recurring_issues for matching symptoms and codebase_insights for relevant file patterns
28
+
29
+ If index.json is empty or no matches found, proceed normally without experience-informed shortcuts.
30
+
31
+ ---
32
+
33
+ # Debug War Room
34
+
35
+ Multi-vector deep debugging with parallel agent teams. When a bug resists normal debugging — you've tried the obvious, poked at it for multiple turns, and it's still not yielding — this skill escalates to a coordinated investigation across every angle simultaneously: instrumentation, research, reproduction, hypothesis, fix, and verification.
36
+
37
+ ## Why This Exists
38
+
39
+ Hard bugs are hard because they hide across multiple dimensions. The symptom is in one place, the cause is in another, and the fix requires understanding both plus the invisible interactions between them. Single-threaded debugging (try a thing, see if it works, try another thing) is too slow and too narrow. The war room attacks from every direction at once.
40
+
41
+ ## Core Principle: Automate Everything Before Involving the User
42
+
43
+ The entire point of the war room is that **agents do the work**. Every verification step, every test run, every log check, every "does it actually work?" confirmation must be performed by an agent before presenting results to the user. The user should receive a **verified, working result** — not a list of manual steps to try.
44
+
45
+ - If you can run a command to check if the fix works, **run it**. Don't tell the user to run it.
46
+ - "All tests pass" is necessary but NOT sufficient. The Reviewer must verify the actual runtime/visual result, not just test results.
47
+ - If an agent produces a "How to Verify" section with manual steps, that's a failure of the process.
48
+
49
+ Read `references/protocols/EDGE-CASES.md` for anti-patterns and fallback handling.
50
+
51
+ ---
52
+
53
+ ## The Process
54
+
55
+ ### Phase 0: Problem Intake
56
+
57
+ Before launching agents, understand what you're debugging. This happens in the main conversation thread — no agents yet.
58
+
59
+ **Flow:**
60
+ 1. Gather problem statement (ask targeted questions if needed — skip what's already known)
61
+ 2. Spawn an **Explore agent** for codebase reconnaissance
62
+ 3. Formulate investigation plan → present to user → proceed unless user objects
63
+
64
+ Read `references/phases/PHASE-0-INTAKE.md` for full intake steps, Explore agent prompt, and investigation plan format.
65
+
66
+ ---
67
+
68
+ ### Phase 1: Parallel Investigation (the war room)
69
+
70
+ Launch all investigation agents **simultaneously**. This is the core value — attacking from every angle at once.
71
+
72
+ **Agents to launch in parallel:**
73
+ - **Instrumenter** — adds debug logging and observability in its own worktree
74
+ - **Researcher** — searches GitHub issues, Stack Overflow, docs, changelogs
75
+ - **Reproducer** — creates a minimal failing test or trigger script
76
+ - **Hypothesizer** — traces execution paths and forms ranked root cause theories
77
+
78
+ **Decision:** Not every bug needs all agents. See agent selection guide in `references/phases/PHASE-1-TRIAGE.md` to determine which agents to skip for each bug type.
79
+
80
+ Read `references/phases/PHASE-1-TRIAGE.md` for the agent selection guide and worktree strategy.
81
+
82
+ Read `references/phases/PHASE-2-WAR-ROOM-AGENTS.md` for all four agent prompts (Instrumenter, Researcher, Reproducer, Hypothesizer).
83
+
84
+ ---
85
+
86
+ ### Phase 2: Synthesis & Solve
87
+
88
+ After all Phase 1 agents complete:
89
+
90
+ 1. **Cross-reference findings** — do hypotheses match research? does reproduction confirm a hypothesis? are there contradictions?
91
+ 2. Present synthesis briefly to the user (Researcher finding / Reproducer status / top hypothesis / Instrumenter summary)
92
+ 3. **Launch the Solver agent** in a fresh worktree with full synthesis context
93
+
94
+ **Decision:** If the Solver's fix is NEEDS REWORK, send feedback back for another iteration. Max 3 iterations before escalating.
95
+
96
+ Read `references/phases/PHASE-3-TO-6-EXECUTION.md` for the full synthesis format, Solver agent prompt, and iteration rules.
97
+
98
+ ---
99
+
100
+ ### Phase 3: Review & Verify
101
+
102
+ **HARD GATE — Cannot present to user without this phase.**
103
+
104
+ 1. Determine verification method BEFORE launching Reviewer (visual vs behavioral vs error-absence)
105
+ 2. If fix requires a restart, the Reviewer handles it — not the user
106
+ 3. Launch **Reviewer agent** independently of the Solver
107
+
108
+ **Reviewer runs:** reproduction test → full test suite → build/lint → live runtime verification → visual verification (if applicable)
109
+
110
+ **Decision:** APPROVED → proceed to Phase 4. NEEDS REWORK → back to Solver (max 3 total iterations). Still failing after 3 → escalate to user.
111
+
112
+ Read `references/phases/PHASE-3-TO-6-EXECUTION.md` for Reviewer agent prompt, verification gate checklist, and escalation protocol.
113
+
114
+ ---
115
+
116
+ ### Phase 4: Present Results
117
+
118
+ **Checkpoint before presenting:**
119
+ - [ ] Reviewer agent was spawned (not Solver declaring victory)
120
+ - [ ] Reviewer verdict includes actual evidence (output, screenshots, log snippets)
121
+ - [ ] Visual evidence captured if bug was visual
122
+ - [ ] Post-restart behavior verified if fix required restart
123
+ - [ ] No "How to Verify" manual instructions in the presentation
124
+
125
+ Once the Reviewer approves, present: root cause → what changed → verification already performed (with evidence) → commits.
126
+
127
+ Wait for user confirmation, then: merge → clean up worktrees → remove debug instrumentation.
128
+
129
+ Read `references/phases/PHASE-3-TO-6-EXECUTION.md` for the full result presentation format.
130
+
131
+ ---
132
+
133
+ ## Blackboard Write
134
+
135
+ After completing, update the blackboard. Read `references/protocols/BLACKBOARD.md` for full write protocol. Summary:
136
+
137
+ 1. Update `~/.claude/ftm-state/blackboard/context.json` — set task complete, append decision summary
138
+ 2. Write experience file to `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json` — root cause, hypotheses tested, fix approach, check_first_next_time
139
+ 3. Update `experiences/index.json` with the new entry
140
+ 4. Emit `task_completed` event
141
+
142
+ ## Config Read
143
+
144
+ Before dispatching agents, read `~/.claude/ftm-config.yml`:
145
+ - Use the `planning` model from the active profile for all investigation agents
146
+ - If config missing, use session default