|
| 1 | +--- |
| 2 | +description: Implement a Phase 0 / roadmap task end to end, from its spec to a PR-ready description. |
| 3 | +argument-hint: <task-id> (e.g. P0-TK-3) [path-or-URL to the task list, if not the default] |
| 4 | +--- |
| 5 | + |
| 6 | +You are driving a single roadmap task to completion in `living-doc-toolkit`. |
| 7 | +Follow these steps **in this exact order**. Do not skip or reorder them. |
| 8 | + |
| 9 | +Task ID: `$1` |
| 10 | +Task-list source (optional override): `$2` |
| 11 | + |
| 12 | +## 1. Read the task |
| 13 | + |
| 14 | +- Locate task `$1` in the Phase 0 task list (`living-doc/docs/specs/phase-0-tasklist.md`) |
| 15 | + or the roadmap (`living-doc/docs/specs/roadmap.md`). If `$2` is given, read it there. |
| 16 | +- Read the task's **prompt** and its **acceptance criteria** in full. Also read the |
| 17 | + linked GitHub issue if the task names one. |
| 18 | +- Write the acceptance criteria out as a numbered checklist you will verify against code |
| 19 | + in step 5. Do not start work until this list is explicit. |
| 20 | + |
| 21 | +## 2. Read every file the task references — before writing any code |
| 22 | + |
| 23 | +- Open every spec, doc, config, and source file named in the task prompt, its "Spec refs" |
| 24 | + line, and its acceptance criteria. Follow one hop of cross-references (a spec section that |
| 25 | + points at another spec section). |
| 26 | +- Read the existing code the change touches and the tests that already cover it, so the |
| 27 | + implementation matches repo patterns (`.github/copilot-instructions.md`, |
| 28 | + `.github/copilot-review-rules.md`). |
| 29 | +- For a monorepo change, identify which of the six packages the task touches — `core`, |
| 30 | + `datasets_pdf`, `adapters/collector_gh`, `services/normalize_issues`, |
| 31 | + `services/coverage_matrix`, `apps/cli` — and respect the dependency rules. |
| 32 | +- If the task is ambiguous after reading, stop and ask — do not guess. |
| 33 | + |
| 34 | +## 3. Implement to the spec exactly |
| 35 | + |
| 36 | +- Make the smallest change that satisfies the spec. Match existing structure, naming, |
| 37 | + logging style (lazy `%` formatting, no `print`), and import conventions. |
| 38 | +- Prefer a change that touches one package. Split a cross-package change unless the parts |
| 39 | + must change together. |
| 40 | +- Add or update tests for every new or changed code path (success + failure). Use the |
| 41 | + `test-author` agent for the test surface. |
| 42 | +- Do not change externally-visible contracts (CLI argument names/defaults, exit codes, |
| 43 | + error-message prefixes, `schema_version` values, `pdf_ready.json` / `coverage-matrix.json` |
| 44 | + structure, `AdapterResult` signature) unless the task explicitly calls for it. |
| 45 | +- If a spec section is being implemented, apply `.claude/rules/docs-lifecycle.md` in this |
| 46 | + same change: move that section's content out of `SPEC.md` into the live docs. |
| 47 | + |
| 48 | +## 4. Run the `make qa` loop until green |
| 49 | + |
| 50 | +- Run `make qa` for a full-repo change, or `make qa-<alias>` for the package you touched |
| 51 | + (`<alias>` ∈ `core`, `datasets-pdf`, `collector-gh`, `normalize`, `coverage`, `cli`) — |
| 52 | + the same targets CI runs. |
| 53 | +- Fix every failure and re-run. Repeat until QA exits clean per package: |
| 54 | + Pylint ≥ 9.5, Black clean, mypy clean, `pytest --cov-fail-under=80` passing. |
| 55 | +- Do not lower a threshold, add an inline lint disable, or `# type: ignore` to get past a |
| 56 | + gate unless the repo documents that exception. |
| 57 | + |
| 58 | +## 5. Verify each acceptance criterion against the actual code |
| 59 | + |
| 60 | +For every criterion on your step 1 checklist, confirm the **literal claim** by reading the |
| 61 | +code / config that now exists — **not** by checking that a same-named test is green. |
| 62 | + |
| 63 | +- "returns a typed `X`" → read the function's real return annotation. |
| 64 | +- "sorted descending" → read the actual sort call and its `reverse=`/key. |
| 65 | +- "deprecated ACs excluded from `coverage_pct`" → confirm the filter precedes the division |
| 66 | + in `summary.py`. |
| 67 | +- "`requires-python` is `>=3.10`" → open each `pyproject.toml` and read the literal value. |
| 68 | +- "file X exists / contains Y" → open X and confirm Y is literally present. |
| 69 | + |
| 70 | +Record each criterion as met (with the `file:line` that proves it) or not met. If any |
| 71 | +criterion is not met, return to step 3. |
| 72 | + |
| 73 | +## 6. Write the PR description |
| 74 | + |
| 75 | +Write a PR description (to `pr.md` in the repo root unless told otherwise) with exactly |
| 76 | +these sections, per `CONTRIBUTING.md`: |
| 77 | + |
| 78 | +- `## Overview` — what changed and why. |
| 79 | +- `## Release Notes` — at least one real user-facing bullet (no `TBD`). |
| 80 | +- `## Related` — `Closes #<issue>` for the task's issue. |
| 81 | + |
| 82 | +Include a short "Acceptance criteria" checklist mapping each criterion to the `file:line` |
| 83 | +that satisfies it (from step 5). |
| 84 | + |
| 85 | +## 7. Stop |
| 86 | + |
| 87 | +Do not open the PR, push, or commit. Report: what changed, the `make qa` result, and the |
| 88 | +acceptance-criteria verification table. Then stop. |
0 commit comments