Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Humans steer. Agents execute. When agents struggle, fix the harness.

Run the session-start script to gather context before doing anything else:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand Down
12 changes: 7 additions & 5 deletions agents/closer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ Create a pull request with a thorough description based on the task file, progre

You receive from the orchestrator:

- **Task file path** — absolute path to the `.md` task file in `/Users/nicknisi/Developer/case/tasks/active/`
- **Case repo path** (`CASE_REPO`) — absolute path to the case harness repo
- **Task file path** — absolute path to the `.md` task file in `${CASE_REPO}/tasks/active/`
- **Task JSON path** — the `.task.json` companion
- **Target repo path** — absolute path to the repo
- **Verifier AGENT_RESULT** — structured output from the verifier (screenshot URLs, evidence markers, pass/fail)
- **Reviewer AGENT_RESULT** — structured output from the reviewer (findings, severity counts)

## Workflow

### 0. Session Context

Run the session-start script to orient yourself:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand All @@ -38,7 +40,7 @@ Read the output to understand: current branch, last commits, task status, which
- `.case-manual-tested` — should have `evidence` field (if src/ files changed)
- `.case-reviewed` — should have `critical: 0` (review findings summary)
4. Extract video and screenshot tags from the verifier's progress log entry or AGENT_RESULT (look for `<video` tags and `![` image tags)
5. Read `/Users/nicknisi/Developer/case/docs/conventions/pull-requests.md` for PR format rules
5. Read `${CASE_REPO}/docs/conventions/pull-requests.md` for PR format rules

### 2. Draft PR

Expand Down Expand Up @@ -151,8 +153,8 @@ Only post if there are actual findings to share. Skip this step if the reviewer

1. **Update task JSON** — agent phase only. The `status → pr-opened` transition is owned by the post-PR hook (fires automatically after `gh pr create` succeeds). Do NOT set status here — it creates duplicate ownership.
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent closer status completed
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent closer completed now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent closer status completed
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent closer completed now
```
The hook will handle: `status → pr-opened` and `prUrl`.

Expand Down
25 changes: 13 additions & 12 deletions agents/implementer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ Implement a fix or feature in the target repo. Write code, run automated tests,

You receive from the orchestrator:

- **Task file path** — absolute path to the `.md` task file in `/Users/nicknisi/Developer/case/tasks/active/`
- **Case repo path** (`CASE_REPO`) — absolute path to the case harness repo
- **Task file path** — absolute path to the `.md` task file in `${CASE_REPO}/tasks/active/`
- **Task JSON path** — the `.task.json` companion (same stem as the .md)
- **Target repo path** — absolute path to the repo where you'll work
- **Issue summary** — title, body, and key details from the GitHub/Linear issue
- **Playbook path** — reference to the relevant playbook in `/Users/nicknisi/Developer/case/docs/playbooks/`
- **Playbook path** — reference to the relevant playbook in `${CASE_REPO}/docs/playbooks/`

## Workflow

### 0. Session Context

Run the session-start script to orient yourself:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand All @@ -34,15 +35,15 @@ Read the output to understand: current branch, last commits, task status, which

1. Update task JSON: set status to `implementing` and agent phase to running
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> status implementing
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent implementer status running
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent implementer started now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> status implementing
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent implementer status running
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent implementer started now
```
2. Read the task file (`.md`) — understand the objective, acceptance criteria, and checklist
3. Read the target repo's `CLAUDE.md` for project-specific instructions
4. Read the playbook referenced in the task file
5. Read `/Users/nicknisi/Developer/case/projects.json` to find the repo's available commands (test, typecheck, lint, build, format)
6. Read `/Users/nicknisi/Developer/case/docs/learnings/{repo}.md` for tactical knowledge from previous tasks in this repo
5. Read `${CASE_REPO}/projects.json` to find the repo's available commands (test, typecheck, lint, build, format)
6. Read `${CASE_REPO}/docs/learnings/{repo}.md` for tactical knowledge from previous tasks in this repo

### 2. Implement

Expand Down Expand Up @@ -91,9 +92,9 @@ Then create the final commit as usual.
Prefer the JSON reporter for structured evidence (pass/fail counts, duration, per-file breakdown):
```bash
# Preferred — structured evidence via vitest JSON reporter
pnpm test --reporter=json 2>&1 | bash /Users/nicknisi/Developer/case/scripts/mark-tested.sh
pnpm test --reporter=json 2>&1 | bash ${CASE_REPO}/scripts/mark-tested.sh
# Fallback — if JSON reporter is unavailable or the repo doesn't use vitest
pnpm test 2>&1 | bash /Users/nicknisi/Developer/case/scripts/mark-tested.sh
pnpm test 2>&1 | bash ${CASE_REPO}/scripts/mark-tested.sh
```
This creates `.case-tested` with a hash of test output AND updates the task JSON `tested` field. You do NOT set `tested` directly.

Expand All @@ -115,8 +116,8 @@ Then create the final commit as usual.

4. **Update task JSON**:
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent implementer status completed
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent implementer completed now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent implementer status completed
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent implementer completed now
```

### 5. Output
Expand Down
5 changes: 3 additions & 2 deletions agents/retrospective.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ You run after every `/case` pipeline completion (success or failure). Your job:

You receive from the orchestrator:

- **Case repo path** (`CASE_REPO`) — absolute path to the case harness repo
- **Task file path** — absolute path to the `.md` task file (with progress log from all agents)
- **Task JSON path** — the `.task.json` companion (with status, agent phases, evidence flags)
- **Pipeline outcome** — "completed" (PR created) or "failed" (stopped at some agent)
Expand All @@ -23,7 +24,7 @@ You receive from the orchestrator:

Run the session-start script to orient yourself:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand Down Expand Up @@ -91,7 +92,7 @@ For each finding, apply the fix directly:
4. For script changes, verify syntax with `bash -n <file>` after editing
5. Log each applied change with file path and one-line summary

**What you can edit** (all within `/Users/nicknisi/Developer/case/`):
**What you can edit** (all within `${CASE_REPO}/`):
- `docs/architecture/` — architecture docs
- `docs/conventions/` — convention docs
- `docs/playbooks/` — playbooks
Expand Down
17 changes: 9 additions & 8 deletions agents/reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ You start with a **completely fresh context**. You did not write the code — yo

You receive from the orchestrator:

- **Task file path** — absolute path to the `.md` task file in `/Users/nicknisi/Developer/case/tasks/active/`
- **Case repo path** (`CASE_REPO`) — absolute path to the case harness repo
- **Task file path** — absolute path to the `.md` task file in `${CASE_REPO}/tasks/active/`
- **Task JSON path** — the `.task.json` companion
- **Target repo path** — absolute path to the repo where the fix was implemented

Expand All @@ -22,7 +23,7 @@ You receive from the orchestrator:

Run the session-start script to orient yourself:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand All @@ -32,9 +33,9 @@ Read the output to understand: current branch, last commits, task status, which

1. Update task JSON:
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> status reviewing
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent reviewer status running
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent reviewer started now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> status reviewing
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent reviewer status running
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent reviewer started now
```
2. Read the task file — understand the issue, objective, and acceptance criteria
3. Read the git diff to understand what the implementer changed:
Expand Down Expand Up @@ -120,7 +121,7 @@ Format each finding as:

1. If **no critical findings**: create the evidence marker:
```bash
bash /Users/nicknisi/Developer/case/scripts/mark-reviewed.sh \
bash ${CASE_REPO}/scripts/mark-reviewed.sh \
--critical 0 --warnings <N> --info <N>
```

Expand All @@ -138,8 +139,8 @@ Format each finding as:

4. **Update task JSON**:
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent reviewer status completed
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent reviewer completed now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent reviewer status completed
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent reviewer completed now
```

### 5. Output
Expand Down
23 changes: 12 additions & 11 deletions agents/verifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ You start with a **completely fresh context**. You did not write the code — yo

You receive from the orchestrator:

- **Task file path** — absolute path to the `.md` task file in `/Users/nicknisi/Developer/case/tasks/active/`
- **Case repo path** (`CASE_REPO`) — absolute path to the case harness repo
- **Task file path** — absolute path to the `.md` task file in `${CASE_REPO}/tasks/active/`
- **Task JSON path** — the `.task.json` companion
- **Target repo path** — absolute path to the repo where the fix was implemented

Expand All @@ -22,7 +23,7 @@ You receive from the orchestrator:

Run the session-start script to orient yourself:
```bash
SESSION=$(bash /Users/nicknisi/Developer/case/scripts/session-start.sh <target-repo-path> --task <task.json>)
SESSION=$(bash ${CASE_REPO}/scripts/session-start.sh <target-repo-path> --task <task.json>)
echo "$SESSION"
```

Expand All @@ -32,9 +33,9 @@ Read the output to understand: current branch, last commits, task status, which

1. Update task JSON:
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> status verifying
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent verifier status running
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent verifier started now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> status verifying
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent verifier status running
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent verifier started now
```
2. Read the task file — understand the issue, objective, and acceptance criteria
3. Read the git diff to understand what the implementer changed:
Expand All @@ -61,7 +62,7 @@ git diff --name-only HEAD~1 | grep "^src/" || git diff --name-only main | grep "

1. Read the issue description from the task file's `## Issue Reference` or `## Objective` section
2. Identify the specific bug/feature scenario to reproduce
3. Read `/Users/nicknisi/Developer/case/projects.json` to find if the target repo has an example app
3. Read `${CASE_REPO}/projects.json` to find if the target repo has an example app

**3a. Port hygiene — MANDATORY before starting any app:**
```bash
Expand Down Expand Up @@ -120,12 +121,12 @@ If the implementer added a new export, alias, or API:
3. **Upload video and screenshots** for PR inclusion:
```bash
# Upload video — the script auto-converts to GIF (inline) + mp4 (download)
VIDEO_MARKDOWN=$(/Users/nicknisi/Developer/case/scripts/upload-screenshot.sh /tmp/verification.webm)
VIDEO_MARKDOWN=$(${CASE_REPO}/scripts/upload-screenshot.sh /tmp/verification.webm)
echo "$VIDEO_MARKDOWN"

# Upload screenshot
cp .playwright-cli/page-*.png /tmp/after.png
SCREENSHOT=$(/Users/nicknisi/Developer/case/scripts/upload-screenshot.sh /tmp/after.png)
SCREENSHOT=$(${CASE_REPO}/scripts/upload-screenshot.sh /tmp/after.png)
echo "$SCREENSHOT"
```

Expand All @@ -137,7 +138,7 @@ If the implementer added a new export, alias, or API:

4. Create the manual testing evidence marker:
```bash
bash /Users/nicknisi/Developer/case/scripts/mark-manual-tested.sh
bash ${CASE_REPO}/scripts/mark-manual-tested.sh
```
This checks for recent playwright screenshots and creates `.case-manual-tested` with evidence. It also updates the task JSON `manualTested` field. You do NOT set `manualTested` directly.

Expand All @@ -156,8 +157,8 @@ If the implementer added a new export, alias, or API:

2. **Update task JSON**:
```bash
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent verifier status completed
bash /Users/nicknisi/Developer/case/scripts/task-status.sh <task.json> agent verifier completed now
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent verifier status completed
bash ${CASE_REPO}/scripts/task-status.sh <task.json> agent verifier completed now
```

### 6. Output
Expand Down
12 changes: 6 additions & 6 deletions docs/ideation/case-multi-agent/spec-phase-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ closing → verifying (hook failure, re-verify)
1. Read current `scripts/mark-tested.sh`
2. After creating the `.case-tested` file (existing behavior), add:
- Read `.case-active` for task ID
- If task ID found and `.task.json` exists: `bash /Users/nicknisi/Developer/case/scripts/task-status.sh <file> tested true --from-marker`
- If task ID found and `.task.json` exists: `bash ${CASE_REPO}/scripts/task-status.sh <file> tested true --from-marker`
3. Test: pipe test output through script, verify both `.case-tested` file and `.task.json` `tested` field are updated

**Implementation steps — mark-manual-tested.sh**:

1. Read current `scripts/mark-manual-tested.sh`
2. After creating the `.case-manual-tested` file (existing behavior), add:
- Read `.case-active` for task ID
- If task ID found and `.task.json` exists: `bash /Users/nicknisi/Developer/case/scripts/task-status.sh <file> manualTested true --from-marker`
- If task ID found and `.task.json` exists: `bash ${CASE_REPO}/scripts/task-status.sh <file> manualTested true --from-marker`
3. Test: run after playwright screenshots exist, verify both `.case-manual-tested` file and `.task.json` `manualTested` field are updated

### Updated Post-PR Cleanup Hook
Expand All @@ -242,11 +242,11 @@ closing → verifying (hook failure, re-verify)
1. Read current `hooks/post-pr-cleanup.sh`
2. **Deterministic task targeting**: instead of iterating all files in `tasks/active/`, identify the active task by:
- Read `.case-active` marker file — update it to contain the task ID (e.g., `authkit-nextjs-1-issue-53`). The orchestrator writes the task ID into `.case-active` instead of bare `touch`.
- Use the task ID to find the specific `.task.json`: `/Users/nicknisi/Developer/case/tasks/active/{task-id}.task.json`
- If `.case-active` has no content (old-format bare touch), fall back to iterating all files in `/Users/nicknisi/Developer/case/tasks/active/` (backward compat)
- Use the task ID to find the specific `.task.json`: `${CASE_REPO}/tasks/active/{task-id}.task.json`
- If `.case-active` has no content (old-format bare touch), fall back to iterating all files in `${CASE_REPO}/tasks/active/` (backward compat)
3. Update the targeted task JSON:
- Run `bash /Users/nicknisi/Developer/case/scripts/task-status.sh <file> status pr-opened`
- If a PR URL is available from the tool output, run `bash /Users/nicknisi/Developer/case/scripts/task-status.sh <file> prUrl <url>`
- Run `bash ${CASE_REPO}/scripts/task-status.sh <file> status pr-opened`
- If a PR URL is available from the tool output, run `bash ${CASE_REPO}/scripts/task-status.sh <file> prUrl <url>`
4. Keep marker file cleanup (`rm -f .case-active .case-tested .case-manual-tested`)
5. Add fallback: if no `.task.json` found, move `.md` files as before (backward compat)

Expand Down
4 changes: 2 additions & 2 deletions docs/ideation/case-multi-agent/spec-phase-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Additionally, every agent must end its response with a structured `AGENT_RESULT`

### Implementer Agent

**Pattern to follow**: Ideation plugin's `agents/reviewer.md` and `agents/scout.md` (at `/Users/nicknisi/.claude/plugins/cache/nicknisi/ideation/0.9.0/agents/`)
**Pattern to follow**: Ideation plugin's `agents/reviewer.md` and `agents/scout.md` (in the ideation plugin's `agents/` directory)

**Overview**: The implementer receives a task file path, target repo path, and issue details. It implements the fix, runs unit tests, commits with a conventional message, and updates the task progress log. It does NOT do manual testing, create evidence markers, or create PRs.

Expand Down Expand Up @@ -197,7 +197,7 @@ tools: ["Read", "Bash", "Glob", "Grep"]
- [ ] Verify implementer prompt does NOT mention Playwright, screenshots, or PR creation
- [ ] Verify verifier prompt does NOT mention editing code or committing
- [ ] Verify closer prompt does NOT mention editing code, running tests, or using Playwright
- [ ] Verify all three reference correct absolute script paths (`/Users/nicknisi/Developer/case/scripts/mark-tested.sh`, etc.)
- [ ] Verify all three reference correct absolute script paths (`${CASE_REPO}/scripts/mark-tested.sh`, etc.)
- [ ] Verify all three include the AGENT_RESULT output format section

## Validation Commands
Expand Down
Loading