workflow-toolkit 1.0.1
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.
- package/.agents/skills/ponytail/SKILL.md +111 -0
- package/.agents/skills/ponytail-audit/SKILL.md +37 -0
- package/.agents/skills/ponytail-debt/SKILL.md +41 -0
- package/.agents/skills/ponytail-gain/SKILL.md +47 -0
- package/.agents/skills/ponytail-help/SKILL.md +70 -0
- package/.agents/skills/ponytail-review/SKILL.md +52 -0
- package/.agents/skills/prompt-review/SKILL.md +60 -0
- package/.agents/skills/wtk/SKILL.md +64 -0
- package/.agents/skills/wtk/references/artifacts.md +82 -0
- package/.agents/skills/wtk/references/evidence.md +68 -0
- package/.agents/skills/wtk/references/git.md +75 -0
- package/.agents/skills/wtk/references/test-contract.md +76 -0
- package/.agents/skills/wtk/references/validation.md +127 -0
- package/.agents/skills/wtk-config/SKILL.md +102 -0
- package/.agents/skills/wtk-config/assets/agents/claude/deep-reviewer.md +40 -0
- package/.agents/skills/wtk-config/assets/agents/claude/designer.md +57 -0
- package/.agents/skills/wtk-config/assets/agents/claude/explorer.md +41 -0
- package/.agents/skills/wtk-config/assets/agents/claude/implementer.md +57 -0
- package/.agents/skills/wtk-config/assets/agents/claude/planner.md +68 -0
- package/.agents/skills/wtk-config/assets/agents/claude/verifier.md +80 -0
- package/.agents/skills/wtk-config/assets/agents/codex/deep-reviewer.toml +41 -0
- package/.agents/skills/wtk-config/assets/agents/codex/designer.toml +55 -0
- package/.agents/skills/wtk-config/assets/agents/codex/explorer.toml +35 -0
- package/.agents/skills/wtk-config/assets/agents/codex/implementer.toml +52 -0
- package/.agents/skills/wtk-config/assets/agents/codex/planner.toml +66 -0
- package/.agents/skills/wtk-config/assets/agents/codex/verifier.toml +78 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/deep-reviewer.md +38 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/designer.md +55 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/explorer.md +39 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/implementer.md +55 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/planner.md +66 -0
- package/.agents/skills/wtk-config/assets/agents/cursor/verifier.md +79 -0
- package/.agents/skills/wtk-config/scripts/ad-index.py +123 -0
- package/.agents/skills/wtk-config/scripts/repository_intelligence.py +671 -0
- package/.agents/skills/wtk-config/scripts/workflow_config.py +972 -0
- package/.agents/skills/wtk-deep-review/SKILL.md +164 -0
- package/.agents/skills/wtk-deep-review/assets/PROMPT.md +56 -0
- package/.agents/skills/wtk-deep-review/assets/REVIEW_UI.html +1340 -0
- package/.agents/skills/wtk-deep-review/assets/findings.schema.json +113 -0
- package/.agents/skills/wtk-deep-review/references/context-pack.md +88 -0
- package/.agents/skills/wtk-deep-review/references/orchestration.md +164 -0
- package/.agents/skills/wtk-deep-review/references/output-contracts.md +149 -0
- package/.agents/skills/wtk-deep-review/references/publish-github.md +83 -0
- package/.agents/skills/wtk-deep-review/references/state-and-learnings.md +64 -0
- package/.agents/skills/wtk-deep-review/references/subagent-runtimes.md +33 -0
- package/.agents/skills/wtk-deep-review/references/taxonomy.md +70 -0
- package/.agents/skills/wtk-deep-review/scripts/_common.py +371 -0
- package/.agents/skills/wtk-deep-review/scripts/build_jobs.py +561 -0
- package/.agents/skills/wtk-deep-review/scripts/build_knowledge.py +349 -0
- package/.agents/skills/wtk-deep-review/scripts/build_manifest.py +479 -0
- package/.agents/skills/wtk-deep-review/scripts/graft_context.py +160 -0
- package/.agents/skills/wtk-deep-review/scripts/graphify_context.py +75 -0
- package/.agents/skills/wtk-deep-review/scripts/merge_findings.py +313 -0
- package/.agents/skills/wtk-deep-review/scripts/render_html.py +240 -0
- package/.agents/skills/wtk-deep-review/scripts/render_review.py +282 -0
- package/.agents/skills/wtk-deep-review/scripts/run_jobs.py +436 -0
- package/.agents/skills/wtk-deep-review/scripts/token_metrics.py +369 -0
- package/.agents/skills/wtk-discover/SKILL.md +270 -0
- package/.agents/skills/wtk-discover/references/document-format.md +149 -0
- package/.agents/skills/wtk-implement/SKILL.md +95 -0
- package/.agents/skills/wtk-implement/references/checklist-format.md +116 -0
- package/.agents/skills/wtk-implement/references/screens.md +129 -0
- package/.agents/skills/wtk-implement/references/test-policy.md +152 -0
- package/.agents/skills/wtk-implement/references/verify.md +297 -0
- package/.agents/skills/wtk-knowledge-check/SKILL.md +16 -0
- package/.agents/skills/wtk-knowledge-check/scripts/check.ts +502 -0
- package/.agents/skills/wtk-knowledge-check/scripts/cli.ts +32 -0
- package/.agents/skills/wtk-knowledge-check/scripts/frontmatter.ts +44 -0
- package/.agents/skills/wtk-lean/.skill-meta.json +6 -0
- package/.agents/skills/wtk-lean/NOTICE.md +18 -0
- package/.agents/skills/wtk-lean/SKILL.md +137 -0
- package/.agents/skills/wtk-lean/references/build.md +168 -0
- package/.agents/skills/wtk-lean/references/checks.md +253 -0
- package/.agents/skills/wtk-lean/references/memory.md +156 -0
- package/.agents/skills/wtk-lean/references/plan.md +514 -0
- package/.agents/skills/wtk-lean/references/verify.md +336 -0
- package/.agents/skills/wtk-lean/scripts/check_commit.py +121 -0
- package/.agents/skills/wtk-lean/scripts/fixtures/checks.md +98 -0
- package/.agents/skills/wtk-lean/scripts/fixtures/plan.md +119 -0
- package/.agents/skills/wtk-lean/scripts/fixtures/verification.md +41 -0
- package/.agents/skills/wtk-lean/scripts/lessons.py +412 -0
- package/.agents/skills/wtk-lean/scripts/selftest.py +401 -0
- package/.agents/skills/wtk-lean/scripts/validate_checks.py +417 -0
- package/.agents/skills/wtk-lean/scripts/validate_plan.py +580 -0
- package/.agents/skills/wtk-lean/scripts/validate_verification.py +357 -0
- package/.agents/skills/wtk-plan/SKILL.md +102 -0
- package/.agents/skills/wtk-plan/references/document-format.md +222 -0
- package/.agents/skills/wtk-qa/SKILL.md +14 -0
- package/.agents/skills/wtk-qa-execute/SKILL.md +115 -0
- package/.agents/skills/wtk-qa-execute/references/fix-loop.md +23 -0
- package/.agents/skills/wtk-qa-execute/references/session-protocol.md +25 -0
- package/.agents/skills/wtk-qa-plan/SKILL.md +111 -0
- package/.agents/skills/wtk-qa-plan/references/profile.md +35 -0
- package/.agents/skills/wtk-ship/SKILL.md +49 -0
- package/.agents/skills/wtk-ship/remediation.py +170 -0
- package/.agents/skills/wtk-ship/scripts/close_feature.py +83 -0
- package/.agents/skills/wtk-ship/scripts/review_convergence.py +373 -0
- package/.wtk.toml.example +93 -0
- package/AGENTS.md +129 -0
- package/NOTICE.md +12 -0
- package/README.md +440 -0
- package/bin/wtk.js +25 -0
- package/docs/toolkit/README.md +56 -0
- package/docs/toolkit/decisions.md +61 -0
- package/docs/toolkit/guidelines/CONTEXT-BUDGET.md +64 -0
- package/docs/toolkit/guidelines/DX.md +67 -0
- package/docs/toolkit/guidelines/FRONTEND.md +73 -0
- package/docs/toolkit/guidelines/KNOWLEDGE-WIKI.md +128 -0
- package/docs/toolkit/guidelines/MODELING.md +134 -0
- package/docs/toolkit/guidelines/QA-EXECUTION.md +46 -0
- package/docs/toolkit/guidelines/QA-SCENARIOS.md +165 -0
- package/docs/toolkit/guidelines/REVIEW-ROUNDS.md +160 -0
- package/docs/toolkit/guidelines/SECURITY.md +160 -0
- package/docs/toolkit/guidelines/UI-UX.md +117 -0
- package/docs/toolkit/guidelines/WORKFLOW-MEMORY.md +73 -0
- package/docs/toolkit/guidelines.md +50 -0
- package/docs/toolkit/loop.md +77 -0
- package/docs/toolkit/purpose.md +51 -0
- package/docs/toolkit/repository-intelligence.md +53 -0
- package/docs/toolkit/reviews.md +77 -0
- package/knowledge/AGENTS.md +316 -0
- package/knowledge/raw/README.md +17 -0
- package/package.json +74 -0
- package/scripts/install_security_skills.py +816 -0
- package/scripts/installer/engine.js +254 -0
- package/scripts/installer/knowledge.js +28 -0
- package/scripts/installer/packets.js +77 -0
- package/scripts/installer/terminal.js +98 -0
- package/scripts/installer/transaction.js +75 -0
- package/skills-lock.json +92 -0
- package/templates/adoption/agents/core.md +23 -0
- package/templates/adoption/agents/quality.md +3 -0
- package/templates/adoption/knowledge/wiki/architecture/index.md +3 -0
- package/templates/adoption/knowledge/wiki/decisions/index.md +3 -0
- package/templates/adoption/knowledge/wiki/design/index.md +3 -0
- package/templates/adoption/knowledge/wiki/domain/index.md +3 -0
- package/templates/adoption/knowledge/wiki/index.md +3 -0
- package/templates/adoption/knowledge/wiki/log.md +3 -0
- package/templates/adoption/knowledge/wiki/open-questions/index.md +3 -0
- package/templates/adoption/knowledge/wiki/product/index.md +3 -0
- package/templates/adoption/knowledge/wiki/research/index.md +3 -0
- package/templates/adoption/product/AGENT-CONTEXT.md +25 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtk-deep-review
|
|
3
|
+
description: "Review diffs, worktrees, or PRs in depth, including spec conformance and requested finding publication. Use for deep review; not fixes, spec edits, or quick feedback."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: "[--pr N | --base <ref> | --staged | --worktree] [--files p1,p2] [--spec <path>] [--subagent native|claude-opus|grok|codex] [--max-cohort-files N] [--publish] [--full] [--out <dir>] [--no-workflow]"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Deep Review
|
|
9
|
+
|
|
10
|
+
Review at CodeRabbit grade with no file cap and one assertive posture: funnel the diff, discover root/nested project instructions and relevant local skills, shard the diff into defect cohorts, fan out reviewers, then merge with complete hunk/rule accounting. Defects require causal evidence and control the verdict; advisories require a concrete improvement and always remain visible.
|
|
11
|
+
|
|
12
|
+
Steps 1–4 drive an idempotent artifact pipeline under `<out>`: every stage gate is a bundled-script exit 0, valid agent outputs are never re-run, and an interrupted round resumes by re-running the same commands.
|
|
13
|
+
|
|
14
|
+
`<skill-dir>` below means the directory containing this SKILL.md; run every bundled command from the repo root.
|
|
15
|
+
|
|
16
|
+
## Inputs (all optional)
|
|
17
|
+
|
|
18
|
+
| Flag | Meaning | Default |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `--pr <n>` | Review a GitHub PR (requires authenticated `gh`; head fetched locally) | — |
|
|
21
|
+
| `--base <ref>` / `--staged` | Local diff scope | merge-base with the origin default branch |
|
|
22
|
+
| `--worktree` | Review uncommitted + untracked work against the base ref (always a full round) | — |
|
|
23
|
+
| `--files <p1,p2>` | Restrict review to these paths | full diff |
|
|
24
|
+
| `--concurrency <n>` | Override repository reviewer concurrency (`1`–`6`) while building the manifest | `.wtk-deep-review.yaml` or `3` |
|
|
25
|
+
| `--spec <path>` | Spec file or directory; its contract-bearing artifacts are available as reviewer context | — |
|
|
26
|
+
| `--subagent <runtime>` | Step 3 reviewer runtime: `native` \| `claude-opus` \| `grok` \| `codex` — non-native runs cross-LLM via `compozy exec` | `native` |
|
|
27
|
+
| `--max-cohort-files <n>` | Maximum files assigned to one cohort; the ~6,000 changed-line cap still applies | `100` |
|
|
28
|
+
| `--publish` | Post walkthrough + review to the PR | off — local report only |
|
|
29
|
+
| `--full` | Ignore prior state; review the whole diff again | incremental when state exists |
|
|
30
|
+
| `--out <dir>` | Artifact directory | `.wtk-deep-review/<target>/` |
|
|
31
|
+
| `--no-workflow` | Skip the Workflow tool; use Agent execution | Named native `deep-reviewer` when the host supports it; role-free Workflow fallback |
|
|
32
|
+
| `--metrics` | Observe compatible provider usage when an adapter is configured | unavailable without a compatible adapter |
|
|
33
|
+
| `--metrics-db <path>` | Provider telemetry source supplied by an adapter | none |
|
|
34
|
+
| `--metrics-ledger <path>` | Content-safe observational metrics path | `<out>/runs/review-metrics.json` |
|
|
35
|
+
| `--metrics-reviewer-prefix <path>` | Explicit provider reviewer path for the adapter | none |
|
|
36
|
+
|
|
37
|
+
## Repo config — `.wtk-deep-review.yaml`
|
|
38
|
+
|
|
39
|
+
Optional repo-root file, the skill-native config standard. Any key absent there falls back to its `.coderabbit.yaml` counterpart (`reviews.*`), so repos migrating from CodeRabbit work unconfigured. Top-level keys, all optional:
|
|
40
|
+
|
|
41
|
+
| Key | Meaning |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `concurrency` | Maximum simultaneous reviewer jobs, an integer from `1` through `6`; defaults to `3` and is pinned in `manifest.json` |
|
|
44
|
+
| `path_filters` | Globs over repo-relative paths: `!pat` excludes; bare patterns, when present, restrict review to their matches and beat any exclude; built-in excludes (locks, vendor, generated, testdata, snapshots) always append |
|
|
45
|
+
| `path_instructions` | `path` glob + verbatim `instructions` entries — the highest-precedence rubric source (Step 2) |
|
|
46
|
+
| `request_changes_workflow` | publish-mode review-event gate |
|
|
47
|
+
|
|
48
|
+
The manifest builder resolves `path_filters` into manifest.json; the knowledge stage ingests `path_instructions` together with project instructions and skills.
|
|
49
|
+
|
|
50
|
+
## Hard rules
|
|
51
|
+
|
|
52
|
+
- Source is read-only and **frozen**: the manifest pins `worktree_snapshot`, and run_jobs.py / render_review.py refuse a drifted checkout. Writes go only to `<out>`, `.wtk-deep-review/` state, and — with `--publish` — the target PR.
|
|
53
|
+
- No file-count cap: a large selection means more cohorts, never a skipped or silently truncated review. Every selected file lands in exactly one cohort.
|
|
54
|
+
- Every defect starts with `Premise → Path → Verdict`; every advisory starts with `Premise → Improvement → Fix`. Investigated rejections remain visible in the suppression ledger.
|
|
55
|
+
- Every selected hunk line receives defect-lane coverage. Every bound rule receives an explicit compliant/violated/not-applicable assessment.
|
|
56
|
+
- Run the repo's linters first and record every overlapping candidate as `linter-overlap` rather than reporting it again.
|
|
57
|
+
- Cite rubric rules verbatim with their source path; severity comes from the taxonomy, never inflated.
|
|
58
|
+
- Publishing needs `--publish` or the user's explicit go-ahead in this session; otherwise the review stays local.
|
|
59
|
+
- Every review ends with a **SHIP / FIX_BEFORE_SHIP / REWORK** verdict derived by render_review.py and stated only after that script exits 0.
|
|
60
|
+
- `FIX_BEFORE_SHIP` is actionable, not a prompt for approval: in an approved loop, follow `docs/toolkit/guidelines/REVIEW-ROUNDS.md`: fix every defect from its Repair plan, run the scoped gate, then the remediation check below, until no Critical/Major is open or `stall_attempts` halts.
|
|
61
|
+
- Optional metrics snapshot provider totals and cumulative checkpoints without changing dispatch,
|
|
62
|
+
retries, outputs, or exits. The main thread records serialized cumulative checkpoints without
|
|
63
|
+
per-job token attribution; totals finalize only after the full scope completes. Hosts without a
|
|
64
|
+
compatible adapter record `unavailable` and continue the review normally. The pinned Graft adapter
|
|
65
|
+
runs before prompts are materialized; a failed or absent Graft falls back to ordinary repository
|
|
66
|
+
inspection.
|
|
67
|
+
- Native execution uses the configured named `deep-reviewer` when the host supports it; otherwise use the role-free Workflow fallback or prompt-only Agent fallback described in orchestration.md.
|
|
68
|
+
- Reviewer concurrency is resolved before dispatch: `--concurrency N` overrides `.wtk-deep-review.yaml`, which overrides the default `3`; valid values are `1` through `6`. The resolved value is frozen in `manifest.json`. The legacy no-op `--workers` option is rejected.
|
|
69
|
+
- External `--subagent` runtimes spend `compozy exec` credit.
|
|
70
|
+
|
|
71
|
+
## Procedure
|
|
72
|
+
|
|
73
|
+
**Step 1: Funnel — build the manifest**
|
|
74
|
+
|
|
75
|
+
1. Run the bundled manifest builder (bootstrap helper; reads the repo and `gh`, writes only under `--out`):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python3 <skill-dir>/scripts/build_manifest.py --out <out> \
|
|
79
|
+
[--pr N | --base REF | --staged | --worktree] [--files p1,p2] [--full] [--concurrency N]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
It resolves repo path filters, detects generated / trivial / renamed files, scopes to the incremental delta when prior state exists, and pins the source-freeze snapshot.
|
|
83
|
+
2. Read the printed summary. For `--pr`, the manifest base is the merge-base of the fetched PR base/head, so base-only changes stay outside the review. If the head is missing, run the printed fetch command and retry; if the base/history is missing, fetch it before retrying.
|
|
84
|
+
|
|
85
|
+
*Done when:* `<out>/manifest.json` exists, every changed file is accounted for as selected, ignored(reason), or skipped(reason), and every selected file carries its hunk list (the units of judgment and the publish anchors).
|
|
86
|
+
|
|
87
|
+
**Step 2: Knowledge + plan — project rules, cohorts, walkthrough**
|
|
88
|
+
|
|
89
|
+
1. STOP. Read `<skill-dir>/references/context-pack.md` and `<skill-dir>/references/taxonomy.md` in full before extracting rules or defining reviewer lanes. Run the bootstrap helper (reads the repo, writes only under `<out>`):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python3 <skill-dir>/scripts/build_knowledge.py --out <out>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Read every source left pending in `<out>/rules.template.json` in full, including direct references of selected project skills. Write `<out>/rules.json` with every source marked applied or not-applicable (reason required), then extract verdict-bearing rules verbatim with scope globs. Assemble `<out>/context-pack.md` and run/fold the detected linter lanes.
|
|
96
|
+
2. Read `<skill-dir>/references/orchestration.md` (cohort rules, sweep triggers) and `<skill-dir>/references/output-contracts.md` (walkthrough anatomy, effort scale) in full. Write `<out>/plan.json` — cohorts of up to `<max-cohort-files>` files (default 100) / ~6,000 changed lines plus any sweep whose trigger fires — and `<out>/walkthrough.md`.
|
|
97
|
+
3. Run the bootstrap plan gate (reads repo artifacts, writes only under `<out>`):
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
python3 <skill-dir>/scripts/build_jobs.py --out <out> \
|
|
101
|
+
[--max-cohort-files N]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
It rejects incomplete source accounting and over-split plans, proves defect ownership, injects bound rules into every cohort and sweep, and materializes `<out>/jobs.json`. Test-adequacy and spec-parity proof remain Technical Verifier responsibilities.
|
|
105
|
+
|
|
106
|
+
*Done when:* build_jobs.py exits 0, every discovered source has an audited decision in rules.json, context-pack.md lists applied source/rule and linter outcomes without copying the full registry, and walkthrough.md satisfies its contract.
|
|
107
|
+
|
|
108
|
+
**Step 3: Fan-out — parallel review**
|
|
109
|
+
|
|
110
|
+
Execute `<out>/jobs.json` with the mutating runner and engine contract loaded in Step 2. When `--subagent` is not `native`, read `<skill-dir>/references/subagent-runtimes.md` in full before execution. Completion is engine-independent — re-dispatch whatever is listed as pending/invalid until exit 0:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
python3 <skill-dir>/scripts/run_jobs.py --out <out> --validate-only
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
*Done when:* run_jobs.py `--validate-only` exits 0 — every cohort and sweep output matches the schema and completely accounts for assigned hunks and rules. Execute materialized jobs with the bounded concurrency pinned in the manifest, keeping retries inside their worker slot; refill slots after completion, stop refilling after a provider block, and preserve manifest-order status.
|
|
117
|
+
|
|
118
|
+
**Step 4: Merge + report**
|
|
119
|
+
|
|
120
|
+
Run the bootstrap merger, mutating state/report renderer, and bootstrap HTML hydrator:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
python3 <skill-dir>/scripts/merge_findings.py --out <out>
|
|
124
|
+
python3 <skill-dir>/scripts/render_review.py --out <out> [--rework "<structural rationale>"]
|
|
125
|
+
python3 <skill-dir>/scripts/render_html.py --out <out>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
merge_findings.py emits `<out>/findings.json` plus `<out>/review-stats.json`, deduplicates both result classes, reconciles rounds, and fails unless every selected hunk line has defect coverage. render_review.py derives the verdict from defects only. render_html.py shows defects, advisories, suppressions, and coverage separately in `<out>/review.html`.
|
|
129
|
+
|
|
130
|
+
When ReportFindings is available, report defects first and every advisory afterward. The user-facing summary states the verdict, defect/advisory counts, every Critical/Major defect, coverage status, and artifact paths.
|
|
131
|
+
|
|
132
|
+
*Done when:* render_review.py and render_html.py exit 0 and the final message states the verdict, every Critical and Major defect, and the review.html path.
|
|
133
|
+
|
|
134
|
+
**Step 5: Publish (only with `--publish`)**
|
|
135
|
+
|
|
136
|
+
1. Read `<skill-dir>/references/publish-github.md` in full and execute its recipes: upsert the walkthrough, publish every anchorable in-diff defect and advisory inline, keep only unanchorable/outside-diff results in the body, and edit resolved prior-round comments.
|
|
137
|
+
|
|
138
|
+
*Done when:* the PR shows the updated walkthrough and the new review, and both URLs are cited in the final message.
|
|
139
|
+
|
|
140
|
+
**Step 6: Learnings**
|
|
141
|
+
|
|
142
|
+
1. state.json was already written at Step 4. When the user — or a PR reply — rebuts or dismisses a result, read `<skill-dir>/references/state-and-learnings.md` in full, distill the correction into `.wtk-deep-review/learnings.md`, and mark that fingerprint `dismissed` in the state ledger.
|
|
143
|
+
|
|
144
|
+
*Done when:* every user correction from the session is captured as a learning or explicitly declined.
|
|
145
|
+
|
|
146
|
+
## Incremental rounds
|
|
147
|
+
|
|
148
|
+
With prior state (or fingerprints recovered from the PR thread), Step 1 scopes to commits since the last reviewed head and archives the prior round's artifacts under `<out>/rounds/`. Step 2 emits one defect-lane remediation job whose prompt requires one evidence-bearing `prior_findings` disposition per open prior fingerprint; absence never resolves it. Unresolved prior results re-surface once under Duplicates; dismissed fingerprints stay suppressed; resolved ones receive the ✅ edit in publish mode. `--full` reviews the whole diff again. Each round's Step 4 regenerates `<out>/review.html`, so a browser tab left open on it tracks the rounds by itself.
|
|
149
|
+
|
|
150
|
+
## Error handling
|
|
151
|
+
|
|
152
|
+
- `--pr` or `--publish` without a passing `gh auth status` → stop and name the gap; publishing by any other transport is out of scope.
|
|
153
|
+
- Workflow tool unavailable → automatic Agent fallback; record the mode in walkthrough.md's Review details.
|
|
154
|
+
- External `--subagent` failure (model not available, missing/invalid output file, non-zero exit) → apply the failure handling loaded in Step 3.
|
|
155
|
+
- Empty selection after the funnel → report "nothing reviewable" with the manifest counts; write no findings.
|
|
156
|
+
- A linter lane unavailable → proceed and state in review.md that overlap suppression did not run for that lane.
|
|
157
|
+
- A bootstrap gate failing (build_manifest.py, build_knowledge.py, build_jobs.py, merge_findings.py) → stop and surface stderr. Missing knowledge accounting or incomplete defect coverage is a review failure, not a warning.
|
|
158
|
+
- run_jobs.py exit 2 (blocked) → a provider limit interrupted the fan-out; valid outputs are preserved and `<out>/run-blocker.json` lists the pending jobs — resume by re-running the same command once the limit clears. Providers that signal limits differently need extra `--block-on` patterns.
|
|
159
|
+
- run_jobs.py exit 3 or a render_review freeze failure → the checkout drifted mid-round; findings would anchor to stale lines. Restart from Step 1 — the round increments and prior artifacts are archived.
|
|
160
|
+
- More than 75 publishable results → use the Step 5 batching contract.
|
|
161
|
+
|
|
162
|
+
## Bundled implementation
|
|
163
|
+
|
|
164
|
+
`assets/PROMPT.md`, `assets/findings.schema.json`, and `assets/REVIEW_UI.html` are author-tooling sources consumed by the bundled scripts; agents use their rendered prompt/schema/report artifacts rather than loading these assets directly. `<skill-dir>/scripts/_common.py` is a read-only library imported by the CLIs and is never invoked directly.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Deep-review prompt templates
|
|
2
|
+
|
|
3
|
+
The single source of truth for every prompt the fan-out dispatches. `build_jobs.py` renders these blocks — edit wording here, nowhere else. Consistency is enforced twice at render time: the build fails if a template lost a mandatory `{{placeholder}}`, and fails again if any placeholder survives unfilled in a rendered prompt.
|
|
4
|
+
|
|
5
|
+
Placeholders are `{{snake_case}}` tokens. Mandatory sets live in `build_jobs.py` (`REVIEWER_PLACEHOLDERS`, `SWEEP_PLACEHOLDERS`).
|
|
6
|
+
|
|
7
|
+
<!-- template:reviewer -->
|
|
8
|
+
Review cohort "{{cohort_name}}" (risk: {{risk}}) of {{target}}. Read-only: never modify product, test, docs, or generated source — your only write is the output file named in the OUTPUT CONTRACT.
|
|
9
|
+
|
|
10
|
+
{{lane_instruction}}
|
|
11
|
+
|
|
12
|
+
The unit of judgment is the HUNK; whole files are context.
|
|
13
|
+
|
|
14
|
+
FILES — you own every listed hunk:
|
|
15
|
+
{{file_list}}
|
|
16
|
+
{{scope_instruction}}
|
|
17
|
+
|
|
18
|
+
CONTEXT: read `{{context}}` (change intent, knowledge sources, linters, spec contract when present) and `{{taxonomy}}` (defect/advisory grammar and objective suppression rules) in full before judging.
|
|
19
|
+
|
|
20
|
+
GRAFT CONTEXT: read `{{graft_context}}` for the prepared repository map, relevant symbols, and blast-radius orientation. Verify it against the checkout; use plain repository inspection for any fallback paths.
|
|
21
|
+
|
|
22
|
+
REPO RULES bound to these files — when a result violates one, include its id in `rule_ids` and quote the rule verbatim in `guideline`:
|
|
23
|
+
{{rules_block}}
|
|
24
|
+
|
|
25
|
+
REVIEW:
|
|
26
|
+
1. Read every cohort file in full — hunks lie without their surroundings. See each change with `{{diff_command}}`. For status A files the whole file is the new-side hunk. For status D read `git show {{base}}:<file>` and judge the old-side hunk plus surviving callers.
|
|
27
|
+
2. INSPECT every owned hunk through the assigned lane. Check every bound repo rule explicitly. When one pattern repeats, search the cohort and enumerate occurrences under one result's `also_applies`.
|
|
28
|
+
3. REFUTE candidates against the checkout. Defects require a named input/state and causal path; their first evidence entry is `Premise: <fact at file:line> → Path: <caller/input/control flow> → Verdict: <failure>`. Advisories require a concrete local benefit and fix; their first entry is `Premise: <fact at file:line> → Improvement: <specific benefit> → Fix: <bounded change>`. Later entries record `command or file:line → what it showed`.
|
|
29
|
+
4. REPORT every survivor in the lane's result array. This review is always assertive: a small advisory survives when it is specific, actionable, and not owned by a formatter or a linter. Assign impact only after refutation. Set `hunk` on every in-diff result; outside-diff results set `in_diff` false and `hunk` null. Fill `suggestion` only with an exact, self-contained replacement.
|
|
30
|
+
5. REPORT every investigated candidate dropped by an objective taxonomy rule in `suppressions`; never silently discard it. Then complete the exact hunk and rule accounting below. A clear hunk still needs a coverage row.
|
|
31
|
+
|
|
32
|
+
{{prior_findings}}
|
|
33
|
+
|
|
34
|
+
{{coverage_contract}}
|
|
35
|
+
|
|
36
|
+
OUTPUT CONTRACT: write ONLY valid JSON matching this schema to `{{output}}` — no other file, nothing to stdout: `{{schema}}`
|
|
37
|
+
Empty defect/advisory arrays are valid only with complete coverage. Validate the JSON before returning; the final response states only that the artifact was written.
|
|
38
|
+
<!-- /template -->
|
|
39
|
+
|
|
40
|
+
<!-- template:sweep -->
|
|
41
|
+
Global sweep "{{sweep_key}}" over {{target}}: {{lens}}. Read-only: never modify product, test, docs, or generated source — your only write is the output file named in the OUTPUT CONTRACT.
|
|
42
|
+
|
|
43
|
+
Read `{{context}}`, `{{manifest}}`, and `{{taxonomy}}` in full. Work from the manifest's selected files and hunks; read any repository file you need and see changes with `{{diff_command}}`.
|
|
44
|
+
|
|
45
|
+
GRAFT CONTEXT: read `{{graft_context}}` for the prepared repository map, relevant symbols, and blast-radius orientation. Verify it against the checkout; use plain repository inspection for any fallback paths.
|
|
46
|
+
|
|
47
|
+
REPO RULES applicable across the selected surface — account for every id:
|
|
48
|
+
{{rules_block}}
|
|
49
|
+
|
|
50
|
+
Find concrete cross-cohort hypotheses through this lens, enumerate every occurrence, then refute each with repository evidence. Put causal failures in `defects` with `Premise → Path → Verdict`; put measurable structural or convention improvements in `advisories` with `Premise → Improvement → Fix`. Record investigated candidates rejected by an objective taxonomy rule in `suppressions`. Cross-cohort results are the point of this sweep — cohort lanes own single-cohort results; a result inside cohort-owned hunks is rejected unless its `also_applies` names anchors in at least two other files.
|
|
51
|
+
|
|
52
|
+
{{coverage_contract}}
|
|
53
|
+
|
|
54
|
+
OUTPUT CONTRACT: write ONLY valid JSON matching this schema to `{{output}}` — no other file, nothing to stdout: `{{schema}}`
|
|
55
|
+
Empty result arrays are valid only after the full lens and rule accounting. Validate the JSON before returning; the final response states only that the artifact was written.
|
|
56
|
+
<!-- /template -->
|