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,142 @@
1
+ description: "ftm-mind routing accuracy"
2
+
3
+ prompts:
4
+ - "You are ftm-mind. Given this user request, which ftm skill should handle it? Reply with just the skill name.\n\nUser: {{input}}"
5
+
6
+ providers:
7
+ - id: "exec:claude --print"
8
+ label: "claude-code"
9
+
10
+ tests:
11
+ - description: "debug request routes to ftm-debug"
12
+ vars:
13
+ input: "debug this flaky test"
14
+ assert:
15
+ - type: contains
16
+ value: "ftm-debug"
17
+
18
+ - description: "design thinking routes to ftm-brainstorm"
19
+ vars:
20
+ input: "help me think through auth design"
21
+ assert:
22
+ - type: contains
23
+ value: "ftm-brainstorm"
24
+
25
+ - description: "plan execution routes to ftm-executor"
26
+ vars:
27
+ input: "execute ~/.claude/plans/foo.md"
28
+ assert:
29
+ - type: contains
30
+ value: "ftm-executor"
31
+
32
+ - description: "trivial rename routes to micro or direct handling"
33
+ vars:
34
+ input: "rename this variable"
35
+ assert:
36
+ - type: regex
37
+ value: "micro|direct"
38
+
39
+ - description: "multi-model deliberation routes to ftm-council"
40
+ vars:
41
+ input: "what would other AIs think about this approach"
42
+ assert:
43
+ - type: contains
44
+ value: "ftm-council"
45
+
46
+ - description: "wiring audit routes to ftm-audit"
47
+ vars:
48
+ input: "audit the wiring"
49
+ assert:
50
+ - type: contains
51
+ value: "ftm-audit"
52
+
53
+ - description: "pause request routes to ftm-pause"
54
+ vars:
55
+ input: "pause"
56
+ assert:
57
+ - type: contains
58
+ value: "ftm-pause"
59
+
60
+ - description: "save state request routes to ftm-pause"
61
+ vars:
62
+ input: "save state"
63
+ assert:
64
+ - type: contains
65
+ value: "ftm-pause"
66
+
67
+ - description: "resume request routes to ftm-resume"
68
+ vars:
69
+ input: "resume"
70
+ assert:
71
+ - type: contains
72
+ value: "ftm-resume"
73
+
74
+ - description: "continue request routes to ftm-resume"
75
+ vars:
76
+ input: "continue where we left off"
77
+ assert:
78
+ - type: contains
79
+ value: "ftm-resume"
80
+
81
+ - description: "upgrade request routes to ftm-upgrade"
82
+ vars:
83
+ input: "upgrade ftm"
84
+ assert:
85
+ - type: contains
86
+ value: "ftm-upgrade"
87
+
88
+ - description: "config check routes to ftm-config"
89
+ vars:
90
+ input: "check my config"
91
+ assert:
92
+ - type: contains
93
+ value: "ftm-config"
94
+
95
+ - description: "ftm settings routes to ftm-config"
96
+ vars:
97
+ input: "ftm settings"
98
+ assert:
99
+ - type: contains
100
+ value: "ftm-config"
101
+
102
+ - description: "intent doc update routes to ftm-intent"
103
+ vars:
104
+ input: "update the intent docs"
105
+ assert:
106
+ - type: contains
107
+ value: "ftm-intent"
108
+
109
+ - description: "architecture diagram update routes to ftm-diagram"
110
+ vars:
111
+ input: "update architecture diagram"
112
+ assert:
113
+ - type: contains
114
+ value: "ftm-diagram"
115
+
116
+ - description: "browser task routes to ftm-browse"
117
+ vars:
118
+ input: "open browser and check the page"
119
+ assert:
120
+ - type: contains
121
+ value: "ftm-browse"
122
+
123
+ - description: "codex validation routes to ftm-codex-gate"
124
+ vars:
125
+ input: "run codex validation"
126
+ assert:
127
+ - type: contains
128
+ value: "ftm-codex-gate"
129
+
130
+ - description: "retrospective routes to ftm-retro"
131
+ vars:
132
+ input: "how did that go"
133
+ assert:
134
+ - type: contains
135
+ value: "ftm-retro"
136
+
137
+ - description: "retro keyword routes to ftm-retro"
138
+ vars:
139
+ input: "retro"
140
+ assert:
141
+ - type: contains
142
+ value: "ftm-retro"
@@ -0,0 +1,328 @@
1
+ # FTM-Mind Blackboard Schema Reference
2
+
3
+ **Location**: `~/.claude/ftm-state/blackboard/`
4
+ **Purpose**: Shared persistent memory for the ftm-mind unified intelligence system. Skills read from and write to these files using the Read and Write tools directly — no code libraries, no APIs.
5
+
6
+ ---
7
+
8
+ ## Source of Truth Matrix
9
+
10
+ Each file has a single, non-overlapping responsibility. Never duplicate information across files.
11
+
12
+ | File / Location | Owns | Never Contains |
13
+ |---|---|---|
14
+ | `blackboard/context.json` | Active session state — current task, decisions made this session, live constraints, user prefs | Cross-session learnings, historical patterns |
15
+ | `blackboard/experiences/` | Cross-session learnings recorded after task completion | Current session state, live constraints |
16
+ | `blackboard/patterns.json` | Promoted meta-insights distilled from multiple experiences | Raw individual experiences, session state |
17
+ | `blackboard/experiences/index.json` | Index of all experience files (titles, tags, types, paths) | Full experience content |
18
+ | `STATE.md` | Pause/resume snapshots (ftm-pause / ftm-resume) | Anything not related to pausing a session mid-stream |
19
+ | `PROGRESS.md` | Executor wave progress during multi-agent runs | Session state, historical learnings |
20
+ | `DEBUG.md` | Debug session traces from ftm-debug | Non-debug information |
21
+ | `INTENT.md` | Codebase contract documents (API shapes, invariants) | Session state, learnings |
22
+
23
+ ---
24
+
25
+ ## 1. context.json
26
+
27
+ **Path**: `~/.claude/ftm-state/blackboard/context.json`
28
+ **Role**: Single source of truth for what is happening RIGHT NOW in the active session. Overwritten frequently — treat every write as a full replacement of the file.
29
+
30
+ ### Full Schema
31
+
32
+ ```json
33
+ {
34
+ "current_task": {
35
+ "id": "string | null",
36
+ "description": "string | null",
37
+ "type": "string | null",
38
+ "started_at": "ISO8601 timestamp | null",
39
+ "status": "pending | in_progress | blocked | complete | null"
40
+ },
41
+ "recent_decisions": [
42
+ {
43
+ "decision": "string — what was decided",
44
+ "reasoning": "string — why this choice was made",
45
+ "timestamp": "ISO8601 timestamp",
46
+ "task_id": "string | null — links back to current_task.id if applicable"
47
+ }
48
+ ],
49
+ "active_constraints": [
50
+ {
51
+ "constraint": "string — description of the constraint",
52
+ "source": "string — where it came from (e.g. user, skill-name, inferred)",
53
+ "expires_at": "ISO8601 timestamp | null — null means indefinite"
54
+ }
55
+ ],
56
+ "user_preferences": {
57
+ "communication_style": "string | null — e.g. terse, detailed, bullet-first",
58
+ "approval_gates": "string | null — e.g. ask_before_write, ask_before_commit, never",
59
+ "default_model_profile": "string | null — e.g. fast, balanced, thorough"
60
+ },
61
+ "session_metadata": {
62
+ "started_at": "ISO8601 timestamp | null",
63
+ "last_updated": "ISO8601 timestamp | null",
64
+ "conversation_id": "string | null",
65
+ "messages_count": "integer",
66
+ "skills_invoked": ["array of skill name strings invoked this session"]
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### Field Notes
72
+
73
+ - **`current_task.id`**: Use a short slug, e.g. `"refactor-auth-flow"` or `"debug-poller-crash"`. Does not need to be globally unique — it scopes within the session.
74
+ - **`current_task.type`**: Free-form but aim for consistency: `feature`, `bug`, `refactor`, `investigation`, `configuration`, `documentation`, `test`, `deploy`.
75
+ - **`recent_decisions`**: Cap at 10 entries. When adding an 11th, drop the oldest. This is a rolling window, not a history log.
76
+ - **`active_constraints`**: Anything that limits what the system can do — e.g. "do not modify production DB", "user wants no auto-commits". Remove expired entries on each write.
77
+ - **`user_preferences`**: Populated from observation or explicit instruction. Skills should read this before deciding how verbose to be or whether to ask for approval.
78
+ - **`session_metadata.skills_invoked`**: Append skill names as they are activated. Used for retrospectives and debugging.
79
+
80
+ ### Write Convention
81
+
82
+ Always read the file first, apply your changes to the parsed object in memory, then write the entire file back. Never write partial JSON.
83
+
84
+ ---
85
+
86
+ ## 2. patterns.json
87
+
88
+ **Path**: `~/.claude/ftm-state/blackboard/patterns.json`
89
+ **Role**: Promoted meta-insights. An entry here means the same thing has been observed across multiple sessions and is considered reliable enough to act on without re-deriving it each time.
90
+
91
+ ### Full Schema
92
+
93
+ ```json
94
+ {
95
+ "codebase_insights": [
96
+ {
97
+ "insight": "string — the observation about the codebase",
98
+ "file_pattern": "string — glob or path description, e.g. 'src/**/*.ts' or 'bin/poller*.py'",
99
+ "confidence": "low | medium | high",
100
+ "last_seen": "ISO8601 timestamp",
101
+ "occurrences": "integer — how many times this was independently observed"
102
+ }
103
+ ],
104
+ "execution_patterns": [
105
+ {
106
+ "pattern": "string — description of the recurring execution approach",
107
+ "context": "string — what situation triggers this pattern",
108
+ "outcome": "string — what typically results",
109
+ "confidence": "low | medium | high",
110
+ "occurrences": "integer",
111
+ "last_reinforced": "ISO8601 timestamp"
112
+ }
113
+ ],
114
+ "user_behavior": [
115
+ {
116
+ "behavior": "string — description of the observed user behavior or preference",
117
+ "frequency": "rarely | sometimes | usually | always",
118
+ "context": "string — when or under what conditions this behavior appears",
119
+ "confidence": "low | medium | high"
120
+ }
121
+ ],
122
+ "recurring_issues": [
123
+ {
124
+ "issue": "string — short title for the issue",
125
+ "symptoms": "string — what it looks like when it occurs",
126
+ "root_cause": "string | null — the underlying reason, if known",
127
+ "resolution": "string | null — how to fix or work around it",
128
+ "occurrences": "integer",
129
+ "last_seen": "ISO8601 timestamp"
130
+ }
131
+ ]
132
+ }
133
+ ```
134
+
135
+ ### Promotion Threshold
136
+
137
+ A pattern should be promoted into patterns.json only after it has appeared in at least 2 separate experience files (different dates, different task slugs). A single observation belongs in an experience file, not here. Use `confidence: "low"` for newly promoted patterns with only 2 occurrences; raise to `"medium"` at 4+, `"high"` at 8+.
138
+
139
+ ### Write Convention
140
+
141
+ patterns.json is written infrequently — typically at the end of a session or after multiple experiences are reviewed. Read it, merge new insights, and write the full file back.
142
+
143
+ ---
144
+
145
+ ## 3. Experience Files
146
+
147
+ **Directory**: `~/.claude/ftm-state/blackboard/experiences/`
148
+ **Role**: Durable cross-session learnings, one file per completed task or significant interaction.
149
+
150
+ ### File Naming Convention
151
+
152
+ ```
153
+ YYYY-MM-DD_task-slug.json
154
+ ```
155
+
156
+ Examples:
157
+ - `2026-03-17_refactor-auth-flow.json`
158
+ - `2026-03-17_debug-slack-poller-crash.json`
159
+ - `2026-03-18_add-freshservice-enrichment.json`
160
+
161
+ The task slug should be lowercase kebab-case, derived from `current_task.id` or the task description. If two tasks share a date and slug (rare), append a short suffix: `2026-03-17_refactor-auth-flow-2.json`.
162
+
163
+ ### Experience Entry Schema
164
+
165
+ ```json
166
+ {
167
+ "task_type": "string — matches current_task.type vocabulary: feature | bug | refactor | investigation | configuration | documentation | test | deploy",
168
+ "description": "string — 1-2 sentence summary of what was attempted",
169
+ "approach": "string — how the task was approached: tools used, strategies employed, sequence of steps",
170
+ "outcome": "success | partial | failure",
171
+ "lessons": [
172
+ "string — each lesson is a concrete, actionable takeaway",
173
+ "string — avoid vague statements like 'be more careful'; prefer 'check X before doing Y'"
174
+ ],
175
+ "time_taken": "string | null — approximate duration, e.g. '12 minutes', '2 hours'",
176
+ "complexity_estimated": "trivial | low | medium | high | very_high",
177
+ "complexity_actual": "trivial | low | medium | high | very_high",
178
+ "capabilities_used": [
179
+ "string — skill names, MCP tools, or agent types that were activated"
180
+ ],
181
+ "tags": [
182
+ "string — searchable labels, e.g. 'python', 'slack', 'database', 'auth', 'poller'"
183
+ ],
184
+ "confidence": "low | medium | high",
185
+ "recorded_at": "ISO8601 timestamp"
186
+ }
187
+ ```
188
+
189
+ ### Field Notes
190
+
191
+ - **`outcome`**: Use `partial` when the core task completed but side effects failed or follow-up is needed. Use `failure` only when the primary objective was not achieved.
192
+ - **`lessons`**: The most important field. Write at least one lesson per experience. Make it specific enough that a future skill loading this file can act on it without further context.
193
+ - **`complexity_estimated` vs `complexity_actual`**: Track both so the system can learn when its estimates are systematically off. If they diverge by more than one level, note why in `approach` or `lessons`.
194
+ - **`capabilities_used`**: Include skill names (e.g. `ftm-executor`, `ftm-debug`), MCP server names (e.g. `mcp__mcp-atlassian-personal__jira_get_issue`), and agent types (e.g. `backend-architect`).
195
+ - **`confidence`**: Reflects how certain you are that the lessons are generalizable. A one-off issue warrants `low`; a pattern confirmed multiple times within the session warrants `high`.
196
+
197
+ ---
198
+
199
+ ## 4. experiences/index.json
200
+
201
+ **Path**: `~/.claude/ftm-state/blackboard/experiences/index.json`
202
+ **Role**: Lightweight index for fast retrieval. Never contains full experience content — only enough metadata to decide which files to load.
203
+
204
+ ### Full Schema
205
+
206
+ ```json
207
+ {
208
+ "entries": [
209
+ {
210
+ "filename": "YYYY-MM-DD_task-slug.json",
211
+ "task_type": "string",
212
+ "tags": ["array", "of", "tags"],
213
+ "outcome": "success | partial | failure",
214
+ "confidence": "low | medium | high",
215
+ "recorded_at": "ISO8601 timestamp"
216
+ }
217
+ ],
218
+ "metadata": {
219
+ "total_count": "integer",
220
+ "last_updated": "ISO8601 timestamp | null",
221
+ "max_entries": 200,
222
+ "pruning_strategy": "remove_oldest_low_confidence"
223
+ }
224
+ }
225
+ ```
226
+
227
+ ### Pruning Rules
228
+
229
+ When `total_count` exceeds `max_entries` (200):
230
+ 1. Collect all entries where `confidence == "low"`.
231
+ 2. Sort by `recorded_at` ascending (oldest first).
232
+ 3. Delete index entries and their corresponding files until `total_count` is back under 200.
233
+ 4. If all low-confidence entries are removed and the count is still over 200, repeat the process with `confidence == "medium"`, oldest first.
234
+ 5. Never delete `confidence == "high"` entries through automatic pruning.
235
+
236
+ ---
237
+
238
+ ## 5. Retrieval Protocol
239
+
240
+ When a skill needs to consult past experience before acting:
241
+
242
+ 1. **Read** `experiences/index.json`.
243
+ 2. **Filter** entries where `task_type` matches the current task type OR there is at least one tag overlap with the current task's tags.
244
+ 3. **Sort** filtered results by `recorded_at` descending (most recent first).
245
+ 4. **Load** the top 3–5 matching experience files by reading each `filename` from the `experiences/` directory.
246
+ 5. **Synthesize** lessons from loaded files to inform the current approach. Prefer lessons from `confidence: "high"` or `outcome: "success"` entries.
247
+ 6. If no matches are found, proceed without historical context (see Cold Start section).
248
+
249
+ ---
250
+
251
+ ## 6. Cold Start Protocol
252
+
253
+ The blackboard starts empty. Empty is not broken — it is the normal starting state.
254
+
255
+ When `experiences/index.json` has `total_count == 0` or `entries == []`:
256
+
257
+ - **Do not enter a degraded mode.** The system has full capability.
258
+ - **Do not warn the user** that there is no historical context unless directly asked.
259
+ - **Proceed with full confidence**, relying on the current session context and skill instructions.
260
+ - **Record experiences aggressively** during the first ~10 interactions. Every completed task, even trivial ones, should produce an experience file. This is how the system bootstraps its memory.
261
+ - **Set `confidence: "low"` on early experiences** — they have not been cross-validated yet. Promote to `"medium"` or `"high"` as patterns recur.
262
+
263
+ The goal of the cold start window is to populate the blackboard fast enough that by the 10th interaction, retrieval is already returning useful context.
264
+
265
+ ---
266
+
267
+ ## 7. Concurrency Rules
268
+
269
+ Multiple executor agents may run in parallel during a ftm-executor wave. To prevent index corruption:
270
+
271
+ - **Single-writer model for index.json**: Only the orchestrator (the coordinating skill, not individual executor agents) writes to `index.json`.
272
+ - **Executor agents write individual experience files only.** Each executor writes its own `YYYY-MM-DD_task-slug.json` file using a unique slug derived from its task ID. Because filenames are unique, parallel writes to different files are safe.
273
+ - **After wave completion**, the orchestrator reads all newly created experience files, merges their metadata entries into `index.json`, updates `total_count` and `last_updated`, and writes `index.json` once.
274
+ - **context.json** is session-scoped and is written only by the primary coordinating agent for that session. Executors do not write context.json.
275
+ - **patterns.json** is written only during post-session review or by an explicit pattern-promotion step, never during active execution.
276
+
277
+ ---
278
+
279
+ ## 8. Read/Write Conventions for Skills
280
+
281
+ ### Reading
282
+
283
+ Always use the Read tool with the absolute path:
284
+
285
+ ```
286
+ Read: ~/.claude/ftm-state/blackboard/context.json
287
+ ```
288
+
289
+ Parse the JSON content mentally before acting on it. If the file is empty or malformed, treat it as if all fields are null/empty and proceed without crashing.
290
+
291
+ ### Writing
292
+
293
+ Always:
294
+ 1. Read the current file first.
295
+ 2. Apply your changes to the parsed content.
296
+ 3. Write the complete, valid JSON back using the Write tool.
297
+
298
+ Never write partial files or append to JSON files. Every write is a full replacement.
299
+
300
+ Use absolute paths:
301
+
302
+ ```
303
+ Write: ~/.claude/ftm-state/blackboard/context.json
304
+ Write: ~/.claude/ftm-state/blackboard/patterns.json
305
+ Write: ~/.claude/ftm-state/blackboard/experiences/index.json
306
+ Write: ~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_task-slug.json
307
+ ```
308
+
309
+ ### Validation Before Writing
310
+
311
+ Before writing, verify:
312
+ - All required fields are present (nulls are acceptable, missing keys are not).
313
+ - Arrays are arrays, objects are objects — no type mismatches.
314
+ - Timestamps are ISO8601 strings or null, never integers.
315
+ - `recent_decisions` in context.json has at most 10 entries.
316
+ - `entries` in index.json matches `metadata.total_count`.
317
+
318
+ ---
319
+
320
+ ## 9. Quick Reference: Key Paths
321
+
322
+ | What | Absolute Path |
323
+ |---|---|
324
+ | Session state | `~/.claude/ftm-state/blackboard/context.json` |
325
+ | Meta-patterns | `~/.claude/ftm-state/blackboard/patterns.json` |
326
+ | Experience index | `~/.claude/ftm-state/blackboard/experiences/index.json` |
327
+ | Experience files | `~/.claude/ftm-state/blackboard/experiences/YYYY-MM-DD_slug.json` |
328
+ | This document | `~/.claude/skills/ftm-mind/references/blackboard-schema.md` |
@@ -0,0 +1,110 @@
1
+ # Complexity Sizing Guide
2
+
3
+ Orient must size tasks from observed evidence, not vibes. Use these tiers.
4
+
5
+ ---
6
+
7
+ ## Micro — `just do it`
8
+
9
+ **Signals:**
10
+ - one coherent local action
11
+ - trivial blast radius
12
+ - rollback is obvious
13
+ - no meaningful uncertainty
14
+ - no dedicated verification step needed
15
+
16
+ **Typical examples:**
17
+ - rename a variable
18
+ - fix a typo
19
+ - answer a factual question after one read
20
+ - add an import
21
+ - tweak a comment
22
+
23
+ ---
24
+
25
+ ## Small — `do + test`
26
+
27
+ **Signals:**
28
+ - 1-3 files
29
+ - one concern
30
+ - clear done state
31
+ - at least one verification step is warranted
32
+ - still reversible without planning overhead
33
+
34
+ **Typical examples:**
35
+ - implement a simple helper
36
+ - patch a bug in one area
37
+ - add or update a focused test
38
+ - update docs plus one code path
39
+
40
+ ---
41
+
42
+ ## Medium — `lightweight plan`
43
+
44
+ **Signals:**
45
+ - multiple changes with ordering
46
+ - moderate uncertainty
47
+ - multi-file or multi-step
48
+ - a bug or feature spans layers but not a full program of work
49
+ - benefits from an explicit short plan before execution
50
+
51
+ **Typical examples:**
52
+ - fix a flaky test with several hypotheses
53
+ - add UI + API + tests for one feature
54
+ - refactor a module with dependent updates
55
+
56
+ ---
57
+
58
+ ## Large — `brainstorm + plan + executor`
59
+
60
+ **Signals:**
61
+ - cross-domain work
62
+ - major uncertainty or architectural choice
63
+ - a plan document already exists
64
+ - many files or multiple independent workstreams
65
+ - would benefit from orchestration, parallel execution, or audit passes
66
+
67
+ **Typical examples:**
68
+ - build a feature from scratch
69
+ - implement a long plan doc
70
+ - re-architect a subsystem
71
+
72
+ ---
73
+
74
+ ## Boundary: where micro ends and small begins
75
+
76
+ Micro ends the moment any of these become true:
77
+
78
+ - more than one meaningful edit is required
79
+ - a test or build check is needed to trust the change
80
+ - the correct change is not self-evident
81
+ - the blast radius is larger than the immediate line or local block
82
+
83
+ If it needs verification or carries plausible regression risk, it is at least small.
84
+
85
+ ---
86
+
87
+ ## ADaPT Rule
88
+
89
+ Try the simpler tier first.
90
+
91
+ - If it looks small, start small.
92
+ - If it looks medium, see whether a small direct pass resolves it.
93
+ - If it looks large, ask whether a medium plan-plus-execute path is enough before invoking full orchestration.
94
+
95
+ Escalate only when:
96
+ - the simple approach fails
97
+ - the user explicitly asks for the larger workflow
98
+ - the complexity is obvious from the start
99
+
100
+ ---
101
+
102
+ ## Research Tasks
103
+
104
+ Research tasks don't follow the micro/small/medium/large sizing — they route directly
105
+ to ftm-researcher regardless of complexity. The researcher's mode system (quick/standard/deep)
106
+ handles the depth calibration internally.
107
+
108
+ If a research request also implies implementation ("research X and then build it"),
109
+ orient as a multi-phase workflow: research first (ftm-researcher), then plan (ftm-brainstorm
110
+ or direct), then execute (ftm-executor).