Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .claude/skills/build/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,32 @@ Keep commits atomic — one logical change per commit.

### 7. Final quality check

> **CRITICAL — this step is mandatory and non-negotiable:**
>
> You MUST run all checks and they MUST all be green before this step is complete.
> Do NOT proceed to step 8 until every check passes. Do NOT report success while
> any check is failing. There are no exceptions.

Once all steps are implemented:

```bash
make check # fmt + lint + test + vuln — ALL must pass
make build # binary must compile cleanly
```

If anything fails, fix it before proceeding. Do not declare the build complete with
failing checks.
**If anything fails:**
1. Read the failure output carefully.
2. Fix the root cause — do not suppress warnings, skip linters, or use `//nolint` to paper over issues.
3. Re-run `make check` from scratch.
4. Repeat until every check is green.

**Red flags — if you are thinking any of these, stop:**
- "The lint warning is minor, I'll proceed anyway"
- "Tests pass locally, the lint failure is just style"
- "I'll note the failure and move on"
- "This check is flaky, I'll skip it"

The only valid exit from step 7 is `make check` and `make build` both exiting with status 0, no failures, no skipped checks.

### 8. Update roadmap and issue

Expand Down
163 changes: 163 additions & 0 deletions .claude/skills/fix/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
name: fix
description: Use when open QA findings need to be resolved after /qa has run on the current IN_REVIEW slice
---

# Fix — Resolve QA Findings

## Overview

Work through all OPEN findings in the current review document, highest severity first.
Each finding is fixed, verified with `make check`, then committed alongside the updated
review document. The revision is closed when all findings are FIXED.

**Announce at start:** "Using the fix skill to resolve open findings."

## Workflow

```dot
digraph fix {
"Load context" -> "Find review document";
"Find review document" -> "Parse OPEN findings";
"Parse OPEN findings" -> "None?" [label="check"];
"None?" -> "Report: nothing to fix" [label="yes"];
"None?" -> "Sort by severity" [label="no"];
"Sort by severity" -> "Create todo per finding";
"Create todo per finding" -> "Take next finding";
"Take next finding" -> "Implement fix";
"Implement fix" -> "run make check";
"run make check" -> "Green?" [label="result"];
"Green?" -> "Mark FIXED in review doc" [label="yes"];
"Green?" -> "Stop and report failure" [label="no"];
"Mark FIXED in review doc" -> "Last finding?" [label="check"];
"Last finding?" -> "Mark revision fixed" [label="yes"];
"Last finding?" -> "Commit and continue" [label="no"];
"Mark revision fixed" -> "Commit and continue";
"Commit and continue" -> "Take next finding";
}
```

## Steps

### 1. Load context

Read `docs/roadmap.md` to find the slice with `STATUS: IN_REVIEW`. Note the slice number
and name.

Find the active revision file:
- List all files matching `docs/reviews/NNN-kebab-case-name/revision-*.md`
- Read the frontmatter of each (they are small — this is cheap)
- Find the file with `status: in_progress` — that is the revision to fix

**Stop conditions:**
- No slice is IN_REVIEW → tell the user to run `/build` first
- Review directory does not exist → tell the user to run `/qa` first
- No revision file has `status: in_progress` → report "No active revision to fix. Run /qa
to create a new revision."

Read the `in_progress` revision file in full.

### 2. Parse OPEN findings

Scan every table in the document for rows where the `Status` column is `OPEN`.
Ignore rows with `FIXED` or `DISCARDED`.

For each OPEN finding collect:
- **ID** (e.g. `F1`, `I2`)
- **Severity** (`BLOCKER`, `HIGH`, `MED`, `LOW`)
- **Summary** (the table row's one-line description)
- **Detail** (the `**ID** path:line` paragraph below the table)

If no OPEN findings exist, report "Nothing to fix — all findings are already FIXED or
DISCARDED." and stop.

### 3. Sort and plan

Order by severity: `BLOCKER` → `HIGH` → `MED` → `LOW`.
Within the same severity, preserve document order.

Create a TodoWrite todo for each finding in sorted order.

### 4. Fix each finding

Repeat for each finding in order:

#### a. Understand the change

Read the detail paragraph and every file it references. Understand the exact change
required before touching any code.

#### b. Implement the fix

Make the minimal change that resolves the finding. Do **not**:
- Refactor surrounding code
- Fix other unrelated issues (even obvious ones — log them separately)
- Add features or cleanups beyond the finding's scope

#### c. Run `make check`

```bash
make check
```

**If `make check` fails:** Stop immediately. Do not mark the finding FIXED. Report:

```
Fix for [ID] failed make check. Stopping.

<paste the relevant error output>

Fix the issue manually, then run /fix again to continue.
```

Do not attempt the remaining findings.

#### d. Mark the finding FIXED in the review document

Update the finding's table row — change `OPEN` to `FIXED`:

```
| I2 | MED | OPEN | Duplicate testCtx vars in test package |
```
```
| I2 | MED | FIXED | Duplicate testCtx vars in test package |
```

Do not change any other part of the document.

#### e. If this is the last OPEN finding, update the revision status

Update `status` in the revision file's frontmatter:
```yaml
status: done
```

#### f. Commit

Stage only the modified source files and the revision file. Use this commit message
format:

```
fix(slice-NNN): resolve [ID] — <one-line summary from finding>

Closes finding [ID] in docs/reviews/NNN-kebab-case-name/revision-R.md
```

Mark the todo for this finding complete.

### 5. Report to user

```
Fix complete for slice NNN (revision R).

Fixed N findings:
• [F1] HIGH — <summary>
• [I2] MED — <summary>

make check passes. Review status: fixed.
Next step: run /qa again — a clean pass will close the slice.
```

If any finding was skipped because `make check` failed, say so clearly and do not claim
the review is fixed.
98 changes: 43 additions & 55 deletions .claude/skills/qa/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ structured review document and report findings to the user.
```dot
digraph qa {
"Load context" -> "Find IN_REVIEW slice";
"Find IN_REVIEW slice" -> "Create review document";
"Create review document" -> "Phase 1: Smoke test + completeness audit";
"Find IN_REVIEW slice" -> "Phase 1: Smoke test + completeness audit";
"Phase 1: Smoke test + completeness audit" -> "Phase 2: Implementation review";
"Phase 2: Implementation review" -> "Findings?" [label="assess"];
"Findings?" -> "Write findings + update status" [label="yes"];
"Findings?" -> "Write PASS + update status" [label="no"];
"Write findings + update status" -> "Report to user";
"Write PASS + update status" -> "Report to user";
"Findings?" -> "Create revision file + write findings" [label="yes"];
"Findings?" -> "Update roadmap to DONE" [label="no"];
"Create revision file + write findings" -> "Report to user";
"Update roadmap to DONE" -> "Report to user";
}
```

Expand All @@ -46,43 +45,7 @@ If no slice is `IN_REVIEW`, stop and tell the user to run `/build` first.
Note the slice number, name, branch name. Open `docs/issues/NNN-kebab-case-name.md` and
read the entire file — scope, file plan, implementation order, and verification commands.

### 3. Create or update the review document

Path: `docs/reviews/NNN-kebab-case-name.md`

**If the file does not exist**, create it with this structure:

```markdown
---
branch: feat/NNN-kebab-case-name
status: in_progress
revision: 1
---

# Slice NNN — Name

## Smoke test + completeness audit

## Implementation review
```

**If the file already exists**, it is a re-review after fixes. Do not overwrite it:
1. Increment `revision: N` → `revision: N+1` in the frontmatter
2. Set `status: in_progress`
3. Append a new revision section at the end of the file:

```markdown
---

## Revision N+1
```

All findings from this run go under that heading, using the same table + detail
format. Previous revision sections are left untouched — they are the audit trail.

---

### 4. Phase 1 — Smoke test + completeness audit
### 3. Phase 1 — Smoke test + completeness audit

**Goal:** Verify the slice scope is fully implemented and that tests actually cover the
specified behaviour. Look for gaps only — do not report style or code quality here.
Expand Down Expand Up @@ -129,7 +92,7 @@ commands satisfied.

---

### 5. Phase 2 — Implementation review
### 4. Phase 2 — Implementation review

**Goal:** Find bugs, anti-patterns, architecture deviations, and bad practices in the diff.

Expand Down Expand Up @@ -171,10 +134,35 @@ No findings. Implementation follows architecture conventions and issue plan.

---

### 6. Write findings
### 5. Write findings (only if findings exist)

**If there are no findings from either phase:** skip this step entirely. Do not create
any file. Proceed to step 6.

**If there are findings:** create the revision file now.

**Determine the next revision number:**
- If `docs/reviews/NNN-kebab-case-name/` does not exist, create it. Next revision is 1.
- If it exists, count the `revision-*.md` files inside. Next revision is count + 1.

Create `docs/reviews/NNN-kebab-case-name/revision-N.md`:

```markdown
---
branch: feat/NNN-kebab-case-name
revision: N
status: in_progress
---

# Slice NNN — Name (Revision N)

## Smoke test + completeness audit

## Implementation review
```

Use the **table index + detail paragraph** format. Keep detail paragraphs minimal — enough
for the implementation agent to act without ambiguity.
Then write findings using the **table index + detail paragraph** format. Keep detail
paragraphs minimal — enough for the implementation agent to act without ambiguity.

**Severities:** `BLOCKER` · `HIGH` · `MED` · `LOW`
**Statuses:** `OPEN` · `FIXED` · `DISCARDED`
Expand Down Expand Up @@ -206,18 +194,18 @@ overwritten and `nil` is returned. Callers cannot detect cancellation.
formatting helpers belong in `internal/format`.
```

### 7. Update the review document
### 6. Update roadmap and report

Set `status: open` if there are any `OPEN` findings, otherwise `status: passed`.
**If findings exist:** do not touch the roadmap. The revision file already has
`status: in_progress`. Hand off to the user to run `/fix`.

Update the roadmap **only** if there are no open findings:
**If no findings:** update the roadmap:
- Change `STATUS: IN_REVIEW` → `STATUS: DONE`
- Change the issue frontmatter `status: in_review` → `status: done`

If findings exist, **do not touch the roadmap**. The build agent will re-run `/qa` after
fixes are applied and the review document will be updated.
No revision file was created — the last `done` revision stands as the final audit record.

### 8. Report to user
### 7. Report to user

```
QA review complete for slice NNN (revision N).
Expand All @@ -230,8 +218,8 @@ Open findings (N total):
• [F1] HIGH — <one-line summary>
• [I1] HIGH — <one-line summary>

See docs/reviews/NNN-kebab-case-name.md for detail.
Next step: fix open findings, then run /qa again.
See docs/reviews/NNN-kebab-case-name/revision-N.md for detail.
Next step: run /fix to resolve findings, then run /qa again.

<If no findings:>
All checks passed. Roadmap updated to DONE. Ready to open a PR.
Expand Down
Loading
Loading