@cluesmith/codev 2.0.18 → 2.1.0-rc.2

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 (107) hide show
  1. package/dashboard/dist/assets/index-CALp-XEo.js +197 -0
  2. package/dashboard/dist/assets/index-CALp-XEo.js.map +1 -0
  3. package/dashboard/dist/assets/index-MVvud9Tr.css +32 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +53 -5
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/cleanup.js +16 -0
  10. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  11. package/dist/agent-farm/commands/index.d.ts +1 -0
  12. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/index.js +1 -0
  14. package/dist/agent-farm/commands/index.js.map +1 -1
  15. package/dist/agent-farm/commands/open.d.ts.map +1 -1
  16. package/dist/agent-farm/commands/open.js +8 -6
  17. package/dist/agent-farm/commands/open.js.map +1 -1
  18. package/dist/agent-farm/commands/rename.d.ts +12 -0
  19. package/dist/agent-farm/commands/rename.d.ts.map +1 -0
  20. package/dist/agent-farm/commands/rename.js +42 -0
  21. package/dist/agent-farm/commands/rename.js.map +1 -0
  22. package/dist/agent-farm/commands/shell.js +1 -1
  23. package/dist/agent-farm/commands/start.js +1 -1
  24. package/dist/agent-farm/commands/start.js.map +1 -1
  25. package/dist/agent-farm/db/index.d.ts.map +1 -1
  26. package/dist/agent-farm/db/index.js +25 -1
  27. package/dist/agent-farm/db/index.js.map +1 -1
  28. package/dist/agent-farm/db/schema.d.ts +1 -1
  29. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  30. package/dist/agent-farm/db/schema.js +2 -0
  31. package/dist/agent-farm/db/schema.js.map +1 -1
  32. package/dist/agent-farm/lib/tower-client.d.ts +12 -0
  33. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  34. package/dist/agent-farm/lib/tower-client.js +9 -0
  35. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  36. package/dist/agent-farm/servers/analytics.d.ts +64 -0
  37. package/dist/agent-farm/servers/analytics.d.ts.map +1 -0
  38. package/dist/agent-farm/servers/analytics.js +246 -0
  39. package/dist/agent-farm/servers/analytics.js.map +1 -0
  40. package/dist/agent-farm/servers/overview.d.ts +6 -0
  41. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  42. package/dist/agent-farm/servers/overview.js +46 -5
  43. package/dist/agent-farm/servers/overview.js.map +1 -1
  44. package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
  45. package/dist/agent-farm/servers/send-buffer.js +4 -3
  46. package/dist/agent-farm/servers/send-buffer.js.map +1 -1
  47. package/dist/agent-farm/servers/tower-cron.js +2 -2
  48. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  49. package/dist/agent-farm/servers/tower-instances.d.ts +3 -1
  50. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  51. package/dist/agent-farm/servers/tower-instances.js +21 -13
  52. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  53. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  54. package/dist/agent-farm/servers/tower-routes.js +144 -67
  55. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  56. package/dist/agent-farm/servers/tower-server.js +2 -1
  57. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  58. package/dist/agent-farm/servers/tower-terminals.d.ts +24 -1
  59. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  60. package/dist/agent-farm/servers/tower-terminals.js +121 -15
  61. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  62. package/dist/agent-farm/servers/tower-types.d.ts +2 -0
  63. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  64. package/dist/agent-farm/utils/config.d.ts +1 -1
  65. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  66. package/dist/agent-farm/utils/config.js +2 -2
  67. package/dist/agent-farm/utils/config.js.map +1 -1
  68. package/dist/agent-farm/utils/file-tabs.d.ts +11 -0
  69. package/dist/agent-farm/utils/file-tabs.d.ts.map +1 -1
  70. package/dist/agent-farm/utils/file-tabs.js +18 -0
  71. package/dist/agent-farm/utils/file-tabs.js.map +1 -1
  72. package/dist/cli.js +1 -1
  73. package/dist/cli.js.map +1 -1
  74. package/dist/commands/consult/metrics.d.ts +4 -0
  75. package/dist/commands/consult/metrics.d.ts.map +1 -1
  76. package/dist/commands/consult/metrics.js +16 -0
  77. package/dist/commands/consult/metrics.js.map +1 -1
  78. package/dist/lib/github.d.ts +46 -0
  79. package/dist/lib/github.d.ts.map +1 -1
  80. package/dist/lib/github.js +104 -1
  81. package/dist/lib/github.js.map +1 -1
  82. package/dist/terminal/pty-session.d.ts +4 -1
  83. package/dist/terminal/pty-session.d.ts.map +1 -1
  84. package/dist/terminal/pty-session.js +7 -0
  85. package/dist/terminal/pty-session.js.map +1 -1
  86. package/package.json +1 -1
  87. package/skeleton/.claude/skills/af/SKILL.md +7 -6
  88. package/skeleton/protocols/air/builder-prompt.md +69 -0
  89. package/skeleton/protocols/air/consult-types/impl-review.md +58 -0
  90. package/skeleton/protocols/air/consult-types/pr-review.md +58 -0
  91. package/skeleton/protocols/air/prompts/implement.md +89 -0
  92. package/skeleton/protocols/air/prompts/pr.md +98 -0
  93. package/skeleton/protocols/air/protocol.json +109 -0
  94. package/skeleton/protocols/air/protocol.md +88 -0
  95. package/skeleton/protocols/spike/builder-prompt.md +62 -0
  96. package/skeleton/protocols/spike/protocol.json +36 -0
  97. package/skeleton/protocols/spike/protocol.md +122 -0
  98. package/skeleton/protocols/spike/templates/findings.md +67 -0
  99. package/skeleton/resources/commands/agent-farm.md +26 -24
  100. package/skeleton/resources/commands/overview.md +4 -4
  101. package/skeleton/resources/risk-triage.md +111 -0
  102. package/skeleton/resources/workflow-reference.md +17 -9
  103. package/skeleton/roles/architect.md +65 -13
  104. package/skeleton/templates/cheatsheet.md +3 -3
  105. package/dashboard/dist/assets/index-B-WzJvht.css +0 -32
  106. package/dashboard/dist/assets/index-DszQyc2c.js +0 -134
  107. package/dashboard/dist/assets/index-DszQyc2c.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ # IMPLEMENT Phase Prompt
2
+
3
+ You are executing the **IMPLEMENT** phase of the AIR protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Read the GitHub issue, implement the feature, and add tests. Keep it focused and under 300 LOC.
8
+
9
+ ## Context
10
+
11
+ - **Issue**: #{{issue.number}} — {{issue.title}}
12
+ - **Current State**: {{current_state}}
13
+
14
+ ## Process
15
+
16
+ ### 1. Read the Issue
17
+
18
+ Read the full issue description. Identify:
19
+ - What is the desired behavior?
20
+ - What are the acceptance criteria?
21
+ - Are there examples or mockups?
22
+ - What files/modules are likely affected?
23
+
24
+ ### 2. Implement the Feature
25
+
26
+ Apply a focused implementation:
27
+ - Implement what the issue describes — no more, no less
28
+ - Do NOT refactor surrounding code
29
+ - Do NOT add features beyond what's described in the issue
30
+ - Do NOT fix unrelated bugs you happen to notice (file separate issues)
31
+
32
+ **Code Quality**:
33
+ - Self-documenting code (clear names, obvious structure)
34
+ - No commented-out code or debug prints
35
+ - Follow existing project conventions
36
+
37
+ ### 3. Add Tests
38
+
39
+ Write tests that:
40
+ - Cover the main happy path
41
+ - Cover key edge cases
42
+ - Are deterministic (not flaky)
43
+
44
+ Place tests following project conventions (`__tests__/`, `*.test.ts`, etc.).
45
+
46
+ ### 4. Verify the Build
47
+
48
+ Run build and tests:
49
+
50
+ ```bash
51
+ npm run build # Must pass
52
+ npm test # Must pass
53
+ ```
54
+
55
+ Fix any failures before proceeding. If build/test commands don't exist, check `package.json`.
56
+
57
+ ### 5. Commit
58
+
59
+ Stage and commit your changes:
60
+ - Use explicit file paths (never `git add -A` or `git add .`)
61
+ - Commit message: `[Air #{{issue.number}}] feat: <brief description>`
62
+
63
+ ## Signals
64
+
65
+ When implementation and tests are complete and passing:
66
+
67
+ ```
68
+ <signal>PHASE_COMPLETE</signal>
69
+ ```
70
+
71
+ If the feature is too complex for AIR (> 300 LOC or architectural):
72
+
73
+ ```
74
+ <signal>TOO_COMPLEX</signal>
75
+ ```
76
+
77
+ If you're blocked (missing context, unclear requirements, etc.):
78
+
79
+ ```
80
+ <signal>BLOCKED:reason goes here</signal>
81
+ ```
82
+
83
+ ## Important Notes
84
+
85
+ 1. **Stay focused** — Implement what the issue describes, nothing else
86
+ 2. **Tests are expected** — Add tests unless the change is purely declarative (e.g., config only)
87
+ 3. **Build AND tests must pass** — Don't signal complete until both pass
88
+ 4. **Stay under 300 LOC** — If the feature grows beyond this, signal `TOO_COMPLEX`
89
+ 5. **No spec/plan artifacts** — AIR does not create files in `codev/specs/` or `codev/plans/`
@@ -0,0 +1,98 @@
1
+ # PR Phase Prompt
2
+
3
+ You are executing the **PR** phase of the AIR protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Create a pull request with the review embedded in the PR body, optionally run CMAP, and notify the architect.
8
+
9
+ ## Context
10
+
11
+ - **Issue**: #{{issue.number}} — {{issue.title}}
12
+ - **Current State**: {{current_state}}
13
+
14
+ ## Process
15
+
16
+ ### 1. Create the Pull Request
17
+
18
+ Create a PR that links to the issue. The PR body IS the review — include a summary, key decisions, and test plan:
19
+
20
+ ```bash
21
+ gh pr create --title "[Air #{{issue.number}}] feat: <brief description>" --body "$(cat <<'EOF'
22
+ ## Summary
23
+
24
+ <1-2 sentence description of the feature>
25
+
26
+ Implements #{{issue.number}}
27
+
28
+ ## What Changed
29
+
30
+ <Brief explanation of the implementation approach>
31
+
32
+ ## Key Decisions
33
+
34
+ <Any notable decisions made during implementation, or "None — straightforward implementation">
35
+
36
+ ## Test Plan
37
+
38
+ - [ ] Unit tests added
39
+ - [ ] Build passes
40
+ - [ ] All tests pass
41
+
42
+ ## Review Notes
43
+
44
+ <Anything the reviewer should pay special attention to, or "Standard implementation — no special concerns">
45
+ EOF
46
+ )"
47
+ ```
48
+
49
+ **IMPORTANT**: Do NOT create a review file in `codev/reviews/`. The PR body IS the review for AIR.
50
+
51
+ ### 2. Optional CMAP Review
52
+
53
+ If the implementation is non-trivial, run 3-way consultation:
54
+
55
+ ```bash
56
+ consult -m gemini --protocol air --type pr &
57
+ consult -m codex --protocol air --type pr &
58
+ consult -m claude --protocol air --type pr &
59
+ ```
60
+
61
+ All three should run in the background (`run_in_background: true`).
62
+
63
+ **This is optional** — use your judgement. For simple features (config changes, small UI additions), you may skip consultation. For features touching core logic or multiple modules, run it.
64
+
65
+ ### 3. Address Feedback (if CMAP was run)
66
+
67
+ If you ran CMAP:
68
+ - Wait for all consultations to complete
69
+ - Record each model's verdict
70
+ - Fix any issues identified
71
+ - Push updates to the PR branch
72
+
73
+ ### 4. Notify Architect
74
+
75
+ Send notification with PR link:
76
+
77
+ ```bash
78
+ af send architect "PR #<number> ready for review (implements issue #{{issue.number}})"
79
+ ```
80
+
81
+ If CMAP was run, include verdicts:
82
+ ```bash
83
+ af send architect "PR #<number> ready for review (implements issue #{{issue.number}}). CMAP: gemini=<verdict>, codex=<verdict>, claude=<verdict>"
84
+ ```
85
+
86
+ ## Signals
87
+
88
+ When PR is created and ready for review:
89
+
90
+ ```
91
+ <signal>PHASE_COMPLETE</signal>
92
+ ```
93
+
94
+ If you're blocked:
95
+
96
+ ```
97
+ <signal>BLOCKED:reason goes here</signal>
98
+ ```
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "air",
4
+ "version": "1.0.0",
5
+ "description": "AIR: Autonomous Implement & Review — lightweight protocol for small features from GitHub Issues",
6
+ "input": {
7
+ "type": "github-issue",
8
+ "required": false,
9
+ "default_for": ["--issue", "-i"]
10
+ },
11
+ "hooks": {
12
+ "pre-spawn": {
13
+ "collision-check": true,
14
+ "comment-on-issue": "On it! Implementing this feature now."
15
+ }
16
+ },
17
+ "phases": [
18
+ {
19
+ "id": "implement",
20
+ "name": "Implement",
21
+ "description": "Implement the feature and add tests",
22
+ "type": "once",
23
+ "steps": [
24
+ "read_issue",
25
+ "implement_feature",
26
+ "add_tests",
27
+ "verify_build",
28
+ "commit"
29
+ ],
30
+ "checks": {
31
+ "build": {
32
+ "command": "npm run build",
33
+ "on_fail": "retry",
34
+ "max_retries": 2
35
+ },
36
+ "tests": {
37
+ "command": "npm test -- --exclude='**/e2e/**'",
38
+ "description": "Unit tests only - e2e tests run in PR phase",
39
+ "on_fail": "retry",
40
+ "max_retries": 2
41
+ }
42
+ },
43
+ "transition": {
44
+ "on_complete": "pr",
45
+ "on_too_complex": "escalate"
46
+ }
47
+ },
48
+ {
49
+ "id": "pr",
50
+ "name": "Create PR",
51
+ "description": "Create pull request with review in PR body",
52
+ "type": "once",
53
+ "steps": [
54
+ "create_pr",
55
+ "link_issue",
56
+ "optional_consultation",
57
+ "notify_architect"
58
+ ],
59
+ "consultation": {
60
+ "on": "review",
61
+ "models": ["gemini", "codex"],
62
+ "type": "impl",
63
+ "parallel": true,
64
+ "max_rounds": 1
65
+ },
66
+ "checks": {
67
+ "pr_exists": {
68
+ "command": "gh pr list --head \"$(git branch --show-current)\" --json number --jq 'length' | grep -q '^[1-9]'",
69
+ "description": "PR must be created before signaling completion"
70
+ },
71
+ "e2e_tests": {
72
+ "command": "npm run test:e2e 2>&1 || echo 'e2e tests skipped (not configured)'",
73
+ "description": "Full e2e test suite",
74
+ "optional": true
75
+ }
76
+ },
77
+ "gate": "pr",
78
+ "transition": {
79
+ "on_complete": null
80
+ }
81
+ }
82
+ ],
83
+ "signals": {
84
+ "PHASE_COMPLETE": {
85
+ "description": "Signal current phase is complete",
86
+ "transitions_to": "next_phase"
87
+ },
88
+ "TOO_COMPLEX": {
89
+ "description": "Feature is too complex for AIR, escalate to ASPIR",
90
+ "transitions_to": "escalate"
91
+ },
92
+ "BLOCKED": {
93
+ "description": "Signal implementation is blocked",
94
+ "requires": "reason"
95
+ }
96
+ },
97
+ "defaults": {
98
+ "mode": "strict",
99
+ "consultation": {
100
+ "enabled": true,
101
+ "models": ["gemini", "codex"],
102
+ "parallel": true
103
+ },
104
+ "checks": {
105
+ "build": "npm run build",
106
+ "test": "npm test"
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,88 @@
1
+ # AIR Protocol
2
+
3
+ > **AIR** = **A**utonomous **I**mplement & **R**eview
4
+ >
5
+ > A lightweight protocol for small features that are fully specified by their GitHub issue.
6
+ > Two phases: Implement → Review. No spec/plan artifacts.
7
+
8
+ ## What is AIR?
9
+
10
+ AIR is a minimal protocol for implementing small features (< 300 LOC) where the GitHub issue provides all the requirements. It skips the Specify and Plan phases entirely — the builder implements directly from the issue and creates a PR with the review embedded in the PR body.
11
+
12
+ ### How AIR Compares
13
+
14
+ | Aspect | BUGFIX | AIR | ASPIR/SPIR |
15
+ |--------|--------|-----|------------|
16
+ | **Use case** | Bug fixes | Small features | New features |
17
+ | **Input** | GitHub Issue | GitHub Issue | GitHub Issue → Spec |
18
+ | **Phases** | Investigate → Fix → PR | Implement → PR | Specify → Plan → Implement → Review |
19
+ | **Artifacts** | None | None | Spec, plan, review files |
20
+ | **Review location** | PR body | PR body | `codev/reviews/` file |
21
+ | **Consultation** | PR phase only | Optional (builder decides) | Every phase (3-way) |
22
+ | **Human gates** | None (PR gate) | None (PR gate) | Spec + Plan + PR gates (SPIR) |
23
+ | **LOC limit** | < 300 | < 300 | No limit |
24
+
25
+ ### When to Use AIR
26
+
27
+ - Small features (< 300 LOC)
28
+ - Requirements are clear from the GitHub issue
29
+ - No architectural decisions needed
30
+ - No new abstractions or significant refactoring required
31
+ - Would be overkill for full SPIR/ASPIR ceremony
32
+
33
+ ### When NOT to Use AIR
34
+
35
+ - Bug fixes → use **BUGFIX**
36
+ - Features needing spec discussion → use **SPIR** or **ASPIR**
37
+ - Amendments to existing specs → use **TICK**
38
+ - Architectural changes → use **SPIR**
39
+ - Complex features with multiple phases → use **SPIR** or **ASPIR**
40
+
41
+ ## Protocol Phases
42
+
43
+ ### I - Implement
44
+
45
+ The builder reads the GitHub issue and implements the feature:
46
+
47
+ 1. Read and understand the issue requirements
48
+ 2. Implement the feature (< 300 LOC)
49
+ 3. Write tests
50
+ 4. Verify build and tests pass
51
+ 5. Commit with descriptive message
52
+
53
+ If the feature grows beyond 300 LOC or requires architectural decisions, the builder signals `TOO_COMPLEX` to escalate to ASPIR.
54
+
55
+ ### R - Review (PR)
56
+
57
+ The builder creates a PR with the review embedded in the PR body:
58
+
59
+ 1. Create PR linking to the issue
60
+ 2. Include a review section in the PR body (summary, key decisions, test plan)
61
+ 3. Optionally run CMAP consultation if the builder judges the complexity warrants it
62
+ 4. Notify the architect
63
+
64
+ The **PR gate** is preserved — a human reviews all code before merge.
65
+
66
+ ## Usage
67
+
68
+ ```bash
69
+ # Spawn a builder using AIR
70
+ af spawn 42 --protocol air
71
+
72
+ # The builder implements autonomously and stops at the PR gate
73
+ ```
74
+
75
+ ## File Structure
76
+
77
+ ```
78
+ codev-skeleton/protocols/air/
79
+ ├── protocol.json # Protocol definition
80
+ ├── protocol.md # This file
81
+ ├── builder-prompt.md # Builder instructions (Handlebars template)
82
+ ├── prompts/
83
+ │ ├── implement.md # Implement phase prompt
84
+ │ └── pr.md # PR phase prompt
85
+ └── consult-types/
86
+ ├── impl-review.md # Implementation consultation guide
87
+ └── pr-review.md # PR consultation guide
88
+ ```
@@ -0,0 +1,62 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are executing a time-boxed technical feasibility spike.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the SPIKE protocol yourself (no porch orchestration)
9
+ - Stay focused on the question — don't gold-plate
10
+ - The findings document is your deliverable, not the code
11
+ {{/if}}
12
+
13
+ ## Protocol
14
+ Follow the SPIKE protocol: `codev/protocols/spike/protocol.md`
15
+
16
+ {{#if task}}
17
+ ## Spike Question
18
+ {{task_text}}
19
+ {{/if}}
20
+
21
+ ## Recommended Workflow
22
+
23
+ Follow this 3-step workflow. You can skip or reorder steps as the investigation demands.
24
+
25
+ ### 1. Research
26
+ - Read documentation, examine existing code, search for prior art
27
+ - Identify constraints, dependencies, and potential blockers
28
+ - Understand the problem space before writing any code
29
+
30
+ ### 2. Iterate
31
+ - Build minimal proof-of-concept code to test approaches
32
+ - Focus on answering the feasibility question, not building production code
33
+ - POC code doesn't need tests or polish
34
+ - **Skip this step** if the answer is clear from research alone
35
+
36
+ ### 3. Findings
37
+ - Write findings to `codev/spikes/<id>-<name>.md` using the template
38
+ - Provide a clear feasibility verdict: Feasible / Not Feasible / Feasible with Caveats
39
+ - Commit the findings document
40
+ - Notify the architect: `af send architect "Spike <id> complete. Verdict: [verdict]"`
41
+
42
+ ## Key Principles
43
+
44
+ - **Time-boxing**: Stay focused on the question. Don't explore tangents.
45
+ - **Exploration over perfection**: POC code doesn't need tests or polish.
46
+ - **Clear output**: The findings document is the deliverable, not the code.
47
+ - **Know when to stop**: Once you can answer the feasibility question, write findings and stop. Don't keep iterating.
48
+ - **Document failures**: "Not feasible" is a valid and valuable finding.
49
+
50
+ ## Handling Flaky Tests
51
+
52
+ If you encounter **pre-existing flaky tests** (intermittent failures unrelated to your changes):
53
+ 1. **DO NOT** edit `status.yaml` to bypass checks
54
+ 2. **DO NOT** skip porch checks or use any workaround to avoid the failure
55
+ 3. **DO** mark the test as skipped with a clear annotation (e.g., `it.skip('...') // FLAKY: skipped pending investigation`)
56
+ 4. **DO** document each skipped flaky test in your findings under a `## Flaky Tests` section
57
+ 5. Commit the skip and continue with your work
58
+
59
+ ## Getting Started
60
+ 1. Read the SPIKE protocol document
61
+ 2. Understand the question you're investigating
62
+ 3. Start with research — don't jump straight to code
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "spike",
4
+ "version": "1.0.0",
5
+ "description": "Time-boxed technical feasibility exploration",
6
+ "input": {
7
+ "type": "task",
8
+ "required": false,
9
+ "default_for": []
10
+ },
11
+ "phases": [
12
+ {
13
+ "id": "spike",
14
+ "name": "Spike",
15
+ "description": "Execute the spike — research, iterate, write findings",
16
+ "type": "once"
17
+ }
18
+ ],
19
+ "signals": {
20
+ "PHASE_COMPLETE": {
21
+ "description": "Signal spike is complete"
22
+ },
23
+ "BLOCKED": {
24
+ "description": "Signal spike is blocked",
25
+ "requires": "reason"
26
+ }
27
+ },
28
+ "defaults": {
29
+ "mode": "soft",
30
+ "consultation": {
31
+ "enabled": false,
32
+ "models": [],
33
+ "parallel": false
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,122 @@
1
+ # SPIKE Protocol
2
+
3
+ ## Overview
4
+
5
+ Time-boxed technical feasibility exploration. Answer "Can we do X?" and "What would it take?" before committing to a full SPIR project.
6
+
7
+ **Core Principle**: Stay focused on the question. Once you can answer it, write findings and stop.
8
+
9
+ ## When to Use
10
+
11
+ **Use for**: Quick technical feasibility investigations, proof-of-concept explorations, "can we do X?" questions, evaluating approaches before committing to SPIR
12
+
13
+ **Skip for**: Production code (use SPIR), formal hypothesis testing (use EXPERIMENT), bug fixes (use BUGFIX), well-understood implementations (use TICK)
14
+
15
+ ### Spike vs Experiment
16
+
17
+ | | Spike | Experiment |
18
+ |---|---|---|
19
+ | **Goal** | Answer a feasibility question | Test a formal hypothesis |
20
+ | **Structure** | Lightweight guidance | Formal phases (hypothesis/design/execute/analyze) |
21
+ | **Output** | Findings document | Experiment notes with metrics |
22
+ | **Rigor** | Exploration-first | Measurement-first |
23
+ | **Time** | Short (hours) | Longer (days) |
24
+
25
+ ## Spawning a Spike
26
+
27
+ ```bash
28
+ af spawn --task "Can we use WebSockets for real-time updates?" --protocol spike
29
+ af spawn --task "What would it take to support SQLite FTS?" --protocol spike
30
+ ```
31
+
32
+ Spikes are always soft mode — no porch orchestration, no gates, no consultation.
33
+
34
+ ## Recommended Workflow
35
+
36
+ The following 3-step workflow is **guidance only** — not enforced by porch. Follow it, skip steps, or reorder as the investigation demands.
37
+
38
+ ### Step 1: Research
39
+
40
+ - Read documentation, examine existing code, search for prior art
41
+ - Identify constraints, dependencies, and potential blockers
42
+ - Understand the problem space before writing any code
43
+ - Check if someone has already investigated this (look in `codev/spikes/`)
44
+
45
+ ### Step 2: Iterate
46
+
47
+ - Build minimal proof-of-concept code
48
+ - Try different approaches, hit walls, pivot
49
+ - Focus on answering the feasibility question, not building production code
50
+ - **Skip this step** if the answer is clear from research alone
51
+
52
+ ### Step 3: Findings
53
+
54
+ - Write the findings document at `codev/spikes/<id>-<name>.md`
55
+ - Use the template: `codev/protocols/spike/templates/findings.md`
56
+ - Provide a clear feasibility verdict
57
+ - Commit and notify the architect
58
+
59
+ ## Output
60
+
61
+ Findings are stored in `codev/spikes/` using the pattern: `<id>-<descriptive-name>.md`
62
+
63
+ Examples:
64
+ - `codev/spikes/462-websocket-feasibility.md`
65
+ - `codev/spikes/475-sqlite-fts-performance.md`
66
+
67
+ The `<id>` is the GitHub issue number or project ID.
68
+
69
+ ## Proof-of-Concept Code
70
+
71
+ POC code from the iterate step is committed to the spike branch alongside the findings document. It serves as evidence supporting the findings. However:
72
+
73
+ - POC code does NOT need tests, polish, or production quality
74
+ - POC code does NOT get merged to main — it stays on the spike branch
75
+ - The findings document is the primary deliverable; the code is supporting evidence
76
+ - If the spike leads to a SPIR project, the builder starts fresh
77
+
78
+ ## Outcome Handling
79
+
80
+ - **Feasible**: Write findings with recommended approach and effort estimate. Architect decides whether to create a SPIR project.
81
+ - **Not Feasible**: Write findings documenting why, what was tried, and what alternatives exist. This prevents future teams from repeating the investigation.
82
+ - **Feasible with Caveats**: Write findings with conditions, risks, and trade-offs.
83
+
84
+ In all cases, notify the architect:
85
+ ```bash
86
+ af send architect "Spike <id> complete. Verdict: [feasible/not feasible/caveats]"
87
+ ```
88
+
89
+ ## Git Workflow
90
+
91
+ ### Commits
92
+ ```
93
+ [Spike 462] Research: WebSocket library comparison
94
+ [Spike 462] Iterate: POC with ws library
95
+ [Spike 462] Findings: WebSockets feasible for real-time updates
96
+ ```
97
+
98
+ ### When to Commit
99
+ - After significant research findings
100
+ - After each iteration attempt
101
+ - When writing the findings document (final commit)
102
+
103
+ ## Integration with Other Protocols
104
+
105
+ ### Spike -> SPIR
106
+ When a spike validates feasibility:
107
+ 1. Create a SPIR spec referencing the spike findings
108
+ 2. Use findings to inform the solution approach
109
+ 3. Reference effort estimate for planning
110
+
111
+ Example spec reference:
112
+ ```markdown
113
+ ## Background
114
+ Spike 462 confirmed WebSocket feasibility with the `ws` library.
115
+ See: codev/spikes/462-websocket-feasibility.md
116
+ ```
117
+
118
+ ### Spike -> "Do Not Pursue"
119
+ When a spike finds something is not feasible:
120
+ 1. Document clearly in findings
121
+ 2. Close the related GitHub issue with a link to findings
122
+ 3. The findings become institutional knowledge
@@ -0,0 +1,67 @@
1
+ # Spike: [Title]
2
+
3
+ **Date**: YYYY-MM-DD
4
+
5
+ **Verdict**: Feasible | Not Feasible | Feasible with Caveats
6
+
7
+ ## Question
8
+
9
+ What technical question was being investigated? Be specific:
10
+ - What are you trying to determine?
11
+ - What prompted this investigation?
12
+ - What decision depends on the answer?
13
+
14
+ ## Research Summary
15
+
16
+ What was explored during the research phase:
17
+ - Documentation read
18
+ - Existing code examined
19
+ - Prior art found
20
+ - Key constraints identified
21
+
22
+ ## Approaches Tried
23
+
24
+ What was built or tested during the iterate phase:
25
+
26
+ ### Approach 1: [Name]
27
+ - **What**: Brief description of what was tried
28
+ - **Result**: What happened
29
+ - **Verdict**: Worked / Didn't work / Partially worked
30
+
31
+ ### Approach 2: [Name]
32
+ *(Add more approaches as needed, or remove if research alone answered the question)*
33
+
34
+ ## Constraints Discovered
35
+
36
+ Technical limitations, dependencies, and gotchas found during the investigation:
37
+ - [Constraint 1]
38
+ - [Constraint 2]
39
+
40
+ ## Recommended Approach
41
+
42
+ *(If feasible)* How should full implementation proceed?
43
+ - Recommended library/technique/pattern
44
+ - Key architectural decisions
45
+ - Things to watch out for
46
+
47
+ *(If not feasible)* Why not, and what alternatives exist?
48
+
49
+ ## Effort Estimate
50
+
51
+ Rough sizing for a full SPIR project: **Small** | **Medium** | **Large**
52
+
53
+ - Small: < 300 LOC, 1-2 files, straightforward
54
+ - Medium: 300-1000 LOC, multiple files, some complexity
55
+ - Large: 1000+ LOC, architectural changes, significant complexity
56
+
57
+ ## Next Steps
58
+
59
+ - [ ] [Recommended action — e.g., "Create SPIR spec for WebSocket integration"]
60
+ - [ ] [Or: "Do not pursue — blocked by X"]
61
+ - [ ] [Or: "Investigate Y further before deciding"]
62
+
63
+ ## References
64
+
65
+ - [Link to relevant documentation]
66
+ - [Link to relevant code/commits]
67
+ - [Link to external resources consulted]