Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cab20d7
[Spec 653] Initial specification draft
waleedkadous Apr 2, 2026
cb3bf22
[Spec 653] Specification with multi-agent review feedback
waleedkadous Apr 2, 2026
47c23e9
[Spec 653] Complete rewrite: mid-protocol checkpoint PRs as first-cla…
waleedkadous Apr 5, 2026
086a98a
[Spec 653] Iter 2: add Verify phase, broaden framing, apply consult f…
waleedkadous Apr 11, 2026
4dc33e5
[Spec 653] Iter 3 fixes: once-phase, checks interception, worktree li…
waleedkadous Apr 11, 2026
331e2f7
[Spec 653] Rewrite: decouple worktree/branch/PR and minimal verify phase
waleedkadous Apr 12, 2026
9d74c0a
[Spec 653] Address consultation feedback: fix terminal state, scope c…
waleedkadous Apr 12, 2026
ce04f58
[Spec 653] Architect feedback: builder-through-verify, single state m…
waleedkadous Apr 12, 2026
08c89bf
[Spec 653] Final revision: remove cold-start, TICK in scope, state al…
waleedkadous Apr 12, 2026
aa41bff
[Spec 653] Initial implementation plan
waleedkadous Apr 12, 2026
c173202
[Spec 653] Plan: address consultation feedback
waleedkadous Apr 12, 2026
77c9130
[Spec 653][Phase: pr_exists_fix] Tighten pr-exists to exclude CLOSED-…
waleedkadous Apr 13, 2026
6af9f53
[Spec 653][Phase: pr_exists_fix] Fix GitLab/Gitea: fetch all states b…
waleedkadous Apr 13, 2026
2a48ad7
[Spec 653][Phase: status_commit_infra] Add writeStateAndCommit: git c…
waleedkadous Apr 13, 2026
02cfbe8
[Spec 653][Phase: status_commit_infra] Remove redundant commitStatusT…
waleedkadous Apr 13, 2026
c0c025a
[Spec 653][Phase: pr_tracking_and_worktree] PR history tracking + wor…
waleedkadous Apr 16, 2026
a0762b7
[Spec 653][Phase: pr_tracking_and_worktree] Fix flag validation, add …
waleedkadous Apr 16, 2026
f8d2774
[Spec 653][Phase: verify_phase] Add verify phase, terminal state rena…
waleedkadous Apr 16, 2026
65de283
[Spec 653][Phase: verify_phase] Fix verify gate flow, add tests
waleedkadous Apr 16, 2026
137e37b
[Spec 653][Phase: tick_removal] Remove TICK protocol from codebase
waleedkadous Apr 16, 2026
183411b
[Spec 653][Phase: tick_removal] Deep TICK removal: spawn logic, CLI, …
waleedkadous Apr 16, 2026
a2d01f2
[Spec 653][Phase: tick_removal] Rebuttal for iter1 reviews
waleedkadous Apr 16, 2026
f5a7846
[Spec 653][Phase: docs_and_prompts] Multi-PR workflow and verify phas…
waleedkadous Apr 16, 2026
4d420d1
[Spec 653][Phase: docs_and_prompts] Complete doc updates: verify phas…
waleedkadous Apr 16, 2026
13f66c6
[Spec 653] Review and lessons learned
waleedkadous Apr 16, 2026
da6676d
[Spec 653] PR review fixes: verify flow, gate creation, TICK cleanup
waleedkadous Apr 16, 2026
d23b9bb
[Spec 653] Address architect PR review: 3 critical + 4 minor fixes
waleedkadous Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You are working in the Codev project itself, with multiple development protocols
- **SPIR**: Multi-phase development with consultation - `codev/protocols/spir/protocol.md`
- **ASPIR**: Autonomous SPIR (no human gates on spec/plan) - `codev/protocols/aspir/protocol.md`
- **AIR**: Autonomous Implement & Review for small features - `codev/protocols/air/protocol.md`
- **TICK**: Amendment workflow for existing specs - `codev/protocols/tick/protocol.md`
- **BUGFIX**: Bug fixes from GitHub issues - `codev/protocols/bugfix/protocol.md`
- **EXPERIMENT**: Disciplined experimentation - `codev/protocols/experiment/protocol.md`
- **MAINTAIN**: Codebase maintenance (code hygiene + documentation sync) - `codev/protocols/maintain/protocol.md`

Expand Down Expand Up @@ -144,13 +144,6 @@ validated: [gemini, codex, claude]

**AIR uses GitHub Issues as source of truth.** Two phases: Implement → Review. See `codev/protocols/air/protocol.md`.

### Use TICK for (amendments to existing specs):
- **Amendments** to an existing SPIR spec that is already `integrated`
- Small scope (< 300 lines of new/changed code)
- Clear requirements that extend existing functionality

**TICK modifies spec/plan in-place** and creates a new review file. Cannot be used for greenfield work.

### Use SPIR for (new features):
- Creating a **new feature from scratch** (no existing spec to amend)
- New protocols or protocol variants
Expand All @@ -161,10 +154,10 @@ validated: [gemini, codex, claude]
### Use ASPIR for (autonomous SPIR):
- Same as SPIR but **without human approval gates** on spec and plan
- Trusted, low-risk work where spec/plan review can be deferred to PR
- Builder runs autonomously through Specify → Plan → Implement → Review
- Builder runs autonomously through Specify → Plan → Implement → Review (→ Verify)
- Human approval still required at the PR gate before merge

**ASPIR is identical to SPIR** except `spec-approval` and `plan-approval` gates are removed. See `codev/protocols/aspir/protocol.md`.
**ASPIR is identical to SPIR** except `spec-approval` and `plan-approval` gates are removed. Both include an optional verify phase after review. See `codev/protocols/aspir/protocol.md`.

### Use EXPERIMENT for:
- Testing new approaches or techniques
Expand All @@ -187,7 +180,7 @@ validated: [gemini, codex, claude]

1. **When asked to build NEW FEATURES FOR CODEV**: Start with the Specification phase
2. **Create exactly THREE documents per feature**: spec, plan, and review (all with same filename)
3. **Follow the SPIR phases**: Specify → Plan → Implement → Review
3. **Follow the SPIR phases**: Specify → Plan → Implement → Review (→ Verify)
4. **Use multi-agent consultation by default** unless user says "without consultation"

## Directory Structure
Expand All @@ -196,7 +189,6 @@ project-root/
├── codev/
│ ├── protocols/ # Development protocols
│ │ ├── spir/ # Multi-phase development with consultation
│ │ ├── tick/ # Fast autonomous implementation
│ │ ├── experiment/ # Disciplined experimentation
│ │ └── maintain/ # Codebase maintenance (code + docs)
│ ├── maintain/ # MAINTAIN protocol runtime artifacts
Expand Down Expand Up @@ -322,9 +314,8 @@ afx workspace start # Start the workspace
afx spawn 42 --protocol spir # Spawn builder for SPIR project
afx spawn 42 --protocol spir --soft # Spawn builder (soft mode)
afx spawn 42 --protocol bugfix # Spawn builder for a bugfix
afx spawn 42 --protocol tick --amends 30 # TICK amendment to spec 30
afx status # Check all builders
afx cleanup --project 0042 # Clean up after merge
afx cleanup --project 0042 # Clean up (architect-driven, not automatic)
afx open file.ts # Open file in annotation viewer (NOT system open)
```

Expand All @@ -336,7 +327,7 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d

## Porch - Protocol Orchestrator

Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.
Porch drives SPIR, ASPIR, AIR, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.

### Key Commands

Expand Down
21 changes: 6 additions & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You are working in the Codev project itself, with multiple development protocols
- **SPIR**: Multi-phase development with consultation - `codev/protocols/spir/protocol.md`
- **ASPIR**: Autonomous SPIR (no human gates on spec/plan) - `codev/protocols/aspir/protocol.md`
- **AIR**: Autonomous Implement & Review for small features - `codev/protocols/air/protocol.md`
- **TICK**: Amendment workflow for existing specs - `codev/protocols/tick/protocol.md`
- **BUGFIX**: Bug fixes from GitHub issues - `codev/protocols/bugfix/protocol.md`
- **EXPERIMENT**: Disciplined experimentation - `codev/protocols/experiment/protocol.md`
- **MAINTAIN**: Codebase maintenance (code hygiene + documentation sync) - `codev/protocols/maintain/protocol.md`

Expand Down Expand Up @@ -144,13 +144,6 @@ validated: [gemini, codex, claude]

**AIR uses GitHub Issues as source of truth.** Two phases: Implement → Review. See `codev/protocols/air/protocol.md`.

### Use TICK for (amendments to existing specs):
- **Amendments** to an existing SPIR spec that is already `integrated`
- Small scope (< 300 lines of new/changed code)
- Clear requirements that extend existing functionality

**TICK modifies spec/plan in-place** and creates a new review file. Cannot be used for greenfield work.

### Use SPIR for (new features):
- Creating a **new feature from scratch** (no existing spec to amend)
- New protocols or protocol variants
Expand All @@ -161,10 +154,10 @@ validated: [gemini, codex, claude]
### Use ASPIR for (autonomous SPIR):
- Same as SPIR but **without human approval gates** on spec and plan
- Trusted, low-risk work where spec/plan review can be deferred to PR
- Builder runs autonomously through Specify → Plan → Implement → Review
- Builder runs autonomously through Specify → Plan → Implement → Review (→ Verify)
- Human approval still required at the PR gate before merge

**ASPIR is identical to SPIR** except `spec-approval` and `plan-approval` gates are removed. See `codev/protocols/aspir/protocol.md`.
**ASPIR is identical to SPIR** except `spec-approval` and `plan-approval` gates are removed. Both include an optional verify phase after review. See `codev/protocols/aspir/protocol.md`.

### Use EXPERIMENT for:
- Testing new approaches or techniques
Expand All @@ -187,7 +180,7 @@ validated: [gemini, codex, claude]

1. **When asked to build NEW FEATURES FOR CODEV**: Start with the Specification phase
2. **Create exactly THREE documents per feature**: spec, plan, and review (all with same filename)
3. **Follow the SPIR phases**: Specify → Plan → Implement → Review
3. **Follow the SPIR phases**: Specify → Plan → Implement → Review (→ Verify)
4. **Use multi-agent consultation by default** unless user says "without consultation"

## Directory Structure
Expand All @@ -196,7 +189,6 @@ project-root/
├── codev/
│ ├── protocols/ # Development protocols
│ │ ├── spir/ # Multi-phase development with consultation
│ │ ├── tick/ # Fast autonomous implementation
│ │ ├── experiment/ # Disciplined experimentation
│ │ └── maintain/ # Codebase maintenance (code + docs)
│ ├── maintain/ # MAINTAIN protocol runtime artifacts
Expand Down Expand Up @@ -322,9 +314,8 @@ afx workspace start # Start the workspace
afx spawn 42 --protocol spir # Spawn builder for SPIR project
afx spawn 42 --protocol spir --soft # Spawn builder (soft mode)
afx spawn 42 --protocol bugfix # Spawn builder for a bugfix
afx spawn 42 --protocol tick --amends 30 # TICK amendment to spec 30
afx status # Check all builders
afx cleanup --project 0042 # Clean up after merge
afx cleanup --project 0042 # Clean up (architect-driven, not automatic)
afx open file.ts # Open file in annotation viewer (NOT system open)
```

Expand All @@ -336,7 +327,7 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d

## Porch - Protocol Orchestrator

Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.
Porch drives SPIR, ASPIR, AIR, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.

### Key Commands

Expand Down
4 changes: 1 addition & 3 deletions codev-skeleton/.claude/skills/afx/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ afx spawn [number] [options]

| Flag | Description |
|------|-------------|
| `--protocol <name>` | Protocol: spir, aspir, air, bugfix, tick, maintain, experiment. **Required for numbered spawns.** |
| `--protocol <name>` | Protocol: spir, aspir, air, bugfix, maintain, experiment. **Required for numbered spawns.** |
| `--task <text>` | Ad-hoc task (no issue number needed) |
| `--shell` | Bare Claude session |
| `--worktree` | Bare worktree session |
| `--amends <number>` | Original spec number (TICK only) |
| `--files <files>` | Context files, comma-separated. **Requires `--task`.** |
| `--no-comment` | Skip commenting on the GitHub issue |
| `--force` | Skip dirty-worktree and collision checks |
Expand All @@ -38,7 +37,6 @@ afx spawn 42 --protocol spir # SPIR builder for issue #42
afx spawn 42 --protocol aspir # ASPIR (autonomous, no human gates)
afx spawn 42 --protocol air # AIR (small features)
afx spawn 42 --protocol bugfix # Bugfix
afx spawn 42 --protocol tick --amends 30 # TICK amendment to spec 30
afx spawn 42 --protocol spir --soft # Soft mode
afx spawn 42 --resume # Resume existing builder
afx spawn --task "fix the flaky test" # Ad-hoc task (no issue)
Expand Down
2 changes: 1 addition & 1 deletion codev-skeleton/.claude/skills/consult/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.
-m, --model <model> Model to use (required except stats)
--prompt <text> Inline prompt (general mode)
--prompt-file <path> Prompt file path (general mode)
--protocol <name> Protocol: spir, aspir, air, bugfix, tick, maintain
--protocol <name> Protocol: spir, aspir, air, bugfix, maintain
-t, --type <type> Review type (see below)
--issue <number> Issue number (required in architect context)
--output <path> Save result to file
Expand Down
4 changes: 2 additions & 2 deletions codev-skeleton/.claude/skills/porch/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: porch
description: Protocol orchestrator CLI — drives SPIR, ASPIR, AIR, TICK, and BUGFIX protocols via a state machine. ALWAYS check this skill before running any `porch` command. Use when you need to check project status, approve gates, signal phase completion, or manage protocol state. Also use when a builder asks about gate approvals or phase transitions.
description: Protocol orchestrator CLI — drives SPIR, ASPIR, AIR, and BUGFIX protocols via a state machine. ALWAYS check this skill before running any `porch` command. Use when you need to check project status, approve gates, signal phase completion, or manage protocol state. Also use when a builder asks about gate approvals or phase transitions.
---

# porch - Protocol Orchestrator
Expand Down Expand Up @@ -31,7 +31,7 @@ Gates are human-only approval checkpoints. The `--a-human-explicitly-approved-th
|------|----------|------|
| `spec-approval` | SPIR | After spec is written |
| `plan-approval` | SPIR | After plan is written |
| `pr` | SPIR, TICK, AIR | After PR is created |
| `pr` | SPIR, AIR | After PR is created |

```bash
porch approve 42 spec-approval --a-human-explicitly-approved-this
Expand Down
61 changes: 0 additions & 61 deletions codev-skeleton/porch/prompts/understand.md

This file was deleted.

58 changes: 0 additions & 58 deletions codev-skeleton/porch/prompts/verify.md

This file was deleted.

4 changes: 2 additions & 2 deletions codev-skeleton/protocol-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://codev.dev/protocol-schema.json",
"title": "Codev Protocol Definition",
"description": "Schema for porch protocol definitions (SPIR, TICK, BUGFIX, etc.)",
"description": "Schema for porch protocol definitions (SPIR, BUGFIX, AIR, etc.)",
"type": "object",
"required": ["name", "phases"],
"properties": {
Expand All @@ -12,7 +12,7 @@
},
"name": {
"type": "string",
"description": "Protocol name (e.g., 'spir', 'tick', 'bugfix')",
"description": "Protocol name (e.g., 'spir', 'bugfix', 'air')",
"pattern": "^[a-z][a-z0-9-]*$"
},
"alias": {
Expand Down
1 change: 0 additions & 1 deletion codev-skeleton/protocols/air/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ AIR is a minimal protocol for implementing small features (< 300 LOC) where the

- Bug fixes → use **BUGFIX**
- Features needing spec discussion → use **SPIR** or **ASPIR**
- Amendments to existing specs → use **TICK**
- Architectural changes → use **SPIR**
- Complex features with multiple phases → use **SPIR** or **ASPIR**

Expand Down
24 changes: 23 additions & 1 deletion codev-skeleton/protocols/aspir/builder-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,33 @@ Follow the implementation plan at: `{{plan.path}}`
{{task_text}}
{{/if}}

## Multi-PR Workflow

Your worktree is persistent — it survives across PR merges. You can produce multiple PRs sequentially:

1. Cut a branch, open a PR, wait for merge
2. After merge: `git fetch origin main && git checkout -b <next-branch> origin/main`
3. Continue to the next phase, open another PR

**Important**: Do NOT run `git checkout main` — git worktrees cannot check out a branch that's checked out elsewhere. Always branch off `origin/main` via fetch.

Record PRs: `porch done {{project_id}} --pr <N> --branch <name>`
Record merges: `porch done {{project_id}} --merged <N>`

## Verify Phase

After the final PR merges, the project enters the **verify** phase. You stay alive through verify:
1. Pull main into your worktree
2. Run `porch done {{project_id}}` to signal verification is ready
3. The architect approves `verify-approval` when satisfied

If verification is not needed: `porch verify {{project_id}} --skip "reason"`

## Notifications
Always use `afx send architect "..."` to notify the architect at key moments:
- **Gate reached**: `afx send architect "Project {{project_id}}: <gate-name> ready for approval"`
- **PR ready**: `afx send architect "PR #N ready for review (project {{project_id}})"`
- **PR merged**: `afx send architect "Project {{project_id}} complete. PR merged. Ready for cleanup."`
- **PR merged**: `afx send architect "Project {{project_id}} PR merged. Entering verify phase."`
- **Blocked**: `afx send architect "Blocked on project {{project_id}}: [reason]"`

## Handling Flaky Tests
Expand Down
8 changes: 8 additions & 0 deletions codev-skeleton/protocols/aspir/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@
}
},
"gate": "pr",
"next": "verify"
},
{
"id": "verify",
"name": "Verify",
"description": "Post-merge environmental verification (optional — skip with porch verify --skip)",
"type": "once",
"gate": "verify-approval",
"next": null
}
],
Expand Down
Loading
Loading