jorgex-stack 1.0.28 → 1.0.30
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/README.md +17 -9
- package/dist/cli.js +28 -3
- package/package.json +1 -1
- package/stack/agents/orchestrator.md +33 -8
- package/stack/agents/test-analyzer.md +26 -62
- package/stack/agents/tester.md +52 -27
- package/stack/commands/claude-code/xreview.md +5 -0
- package/stack/commands/opencode/xreview.md +5 -0
- package/stack/hooks/hooks.json +1 -1
- package/stack/scripts/post-pr-review.cjs +103 -120
- package/stack/skills/agent-delegation/SKILL.md +2 -2
- package/stack/skills/tdd/SKILL.md +54 -72
- package/stack/skills/tdd/mocking.md +22 -47
- package/stack/skills/tdd/tests.md +42 -44
- package/stack/skills/to-prd/SKILL.md +10 -4
- package/stack/skills/work-lifecycle/SKILL.md +12 -0
- package/stack/skills/work-lifecycle/references/plan-template.md +12 -0
- package/stack/{commands/xreview.md → skills/xreview/SKILL.md} +9 -8
- package/stack/system-prompt/AGENTS.md +11 -4
- package/upstreams.json +2 -1
|
@@ -9,7 +9,9 @@ This skill takes the current conversation context and codebase understanding and
|
|
|
9
9
|
|
|
10
10
|
1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the PRD, and respect any ADRs in the area you're touching.
|
|
11
11
|
|
|
12
|
-
2. Sketch out the seams at which you're going to test the feature.
|
|
12
|
+
2. Sketch out the seams at which you're going to test the feature. Prefer an existing seam when it is strong enough, and choose the closest seam that can fail for the concrete regression risk. Introduce a new seam only when existing ones cannot provide reliable evidence.
|
|
13
|
+
|
|
14
|
+
Do not choose from a fixed test pyramid or a requirement to add tests. Prefer one authoritative test at the strongest seam closest to the risk; another layer is justified only for a distinct contract. Record existing coverage and valid no-new-test decisions for trivial, mechanical, generated, styling, or wiring changes.
|
|
13
15
|
|
|
14
16
|
Check with the user that these seams match their expectations.
|
|
15
17
|
|
|
@@ -67,9 +69,13 @@ Keep this static: describe the planned delivery slices, not the current state.
|
|
|
67
69
|
|
|
68
70
|
A list of testing decisions that were made. Include:
|
|
69
71
|
|
|
70
|
-
-
|
|
71
|
-
- Which
|
|
72
|
-
-
|
|
72
|
+
- The meaningful regression risk introduced by each behavior change
|
|
73
|
+
- Which existing tests already protect it
|
|
74
|
+
- Which new behavior requires protection
|
|
75
|
+
- The chosen seam and why it is closest to the risk
|
|
76
|
+
- Why another layer would protect a distinct contract rather than duplicate the same behavior
|
|
77
|
+
- Why no new test is needed for trivial, mechanical, generated, styling, wiring, or already-covered changes
|
|
78
|
+
- Prior art for the selected tests (i.e. similar valuable tests in the codebase)
|
|
73
79
|
|
|
74
80
|
## Out of Scope
|
|
75
81
|
|
|
@@ -41,6 +41,18 @@ Every piece of work gets a **canonical kebab-case name** when it starts (e.g. `c
|
|
|
41
41
|
- Task status lives ONLY in the task table: flip it (⬜ → ✅) with a surgical edit when the task closes. PR status/evidence lives ONLY in the PR roadmap table. Do not mirror task progress into memory, and do not re-read the whole plan after every task — it is already in context; re-read it on resume.
|
|
42
42
|
- For multi-PR work, resume from the first PR/task not done in the roadmap/table. For single-PR work, the canonical name worktree/branch is enough and the roadmap collapses to one checkpoint.
|
|
43
43
|
|
|
44
|
+
## Pull request lifecycle
|
|
45
|
+
|
|
46
|
+
1. Start from the updated production branch in the canonical worktree/branch. Keep one concrete objective per PR.
|
|
47
|
+
2. Implement one coherent first slice, commit it, push the work branch, and open the PR immediately as draft with `gh pr create --draft`.
|
|
48
|
+
3. Continue implementation, commits and pushes only while the PR is draft. Draft means the code can still change; ready means the current SHA is the candidate to merge.
|
|
49
|
+
4. Before ready, complete every applicable preflight item: code, version bump, local tests, project quality command (`pnpm qa:quality` when defined), Vercel preview review when the project uses Vercel, final diff inspection, and full PR review.
|
|
50
|
+
5. Mark ready once with `gh pr ready <number>`. If the project has PR checks configured, wait for Quality Gates, run `gh pr checks <number>`, and verify the checks belong to the latest commit. If no PR checks are configured, confirm that from project configuration such as workflows, rulesets or integrations, and record it; their absence does not block the merge. An empty `gh pr checks` result immediately after ready is not evidence that no checks are configured. Immediately before reporting or merging, compare `gh pr view --json headRefOid` with the recorded candidate SHA.
|
|
51
|
+
6. Never push to a ready PR. If it needs changes, first run `gh pr ready --undo <number>`, then modify and push while draft, repeat preflight and review, mark ready again, and wait for a fresh complete gate when checks are configured.
|
|
52
|
+
7. Merge only after explicit user approval. When PR checks are configured, their passing result must match the current candidate SHA.
|
|
53
|
+
|
|
54
|
+
Dependent PRs are sequential: merge one checkpoint, update the production branch, then create the next worktree/branch from that updated base. Do not stack a dependent PR from an unmerged work branch unless the human explicitly chooses a stacked-PR strategy.
|
|
55
|
+
|
|
44
56
|
## HTML review view (on demand)
|
|
45
57
|
|
|
46
58
|
When presenting the PRD or the plan for human review on non-trivial work, OFFER a disposable HTML view (e.g. side-by-side approach comparison for the PRD, task table + dependency graph for the plan). Rules:
|
|
@@ -41,6 +41,8 @@ The full spec of each task is NOT a file: it lives in Engram, one observation pe
|
|
|
41
41
|
> This is the live PR-level board: scope, PR status, and merge evidence live here.
|
|
42
42
|
> Task-level status stays in the task table below.
|
|
43
43
|
> Full checkpoint history lives in Engram under `work/[name]/pr/[NN]`.
|
|
44
|
+
> PR status advances: ⬜ Pending → 📝 Draft → 🔍 Reviewed → ⏳ Ready / gates when configured → ✅ Merged.
|
|
45
|
+
> If a ready PR changes, return it to Draft with `gh pr ready --undo`, clear stale gate evidence, and repeat review plus configured gates for the new SHA. If no PR checks are configured, confirm that from project configuration and record their absence instead of blocking the merge. An empty `gh pr checks` result immediately after ready is not evidence that no checks are configured. Immediately before reporting or merging, compare `gh pr view --json headRefOid` with the recorded candidate SHA.
|
|
44
46
|
|
|
45
47
|
| PR | Scope | Branch | Worktree | Base | Status | Merge evidence |
|
|
46
48
|
|----|-------|--------|----------|------|--------|----------------|
|
|
@@ -144,6 +146,16 @@ Status, wave and dependencies live in the plan.md table (single home) — do NOT
|
|
|
144
146
|
|
|
145
147
|
- [Rule]
|
|
146
148
|
|
|
149
|
+
## Testing decision
|
|
150
|
+
|
|
151
|
+
- **Risk**: [meaningful regression this task can introduce]
|
|
152
|
+
- **Existing protection**: [specific existing test/evidence, or none]
|
|
153
|
+
- **New behavior**: [behavior needing new protection, or none]
|
|
154
|
+
- **Chosen seam**: [unit/component/database/integration/contract/e2e and why it is closest to the risk]
|
|
155
|
+
- **Action**: [add | update | reuse | no new test] — [concrete reason]
|
|
156
|
+
|
|
157
|
+
Prefer one authoritative test per behavior. Another layer is justified only when it protects a distinct contract. Styling, wiring, generated code, mechanical refactors, and trivial changes may use `no new test`; business rules, bugs/regressions, public contracts, and invariants should normally use TDD.
|
|
158
|
+
|
|
147
159
|
## Acceptance criteria
|
|
148
160
|
|
|
149
161
|
[VERIFIABLE and SPECIFIC criteria — not generic. Each must be checkable manually or automatically.]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: xreview
|
|
2
3
|
description: Conditional multi-agent code review — determines what to review (asking if unclear), resolves the exact diff, and launches only the relevant subagents in parallel
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -6,7 +7,7 @@ Run a comprehensive multi-agent review. Your job as the main agent: determine WH
|
|
|
6
7
|
|
|
7
8
|
## 0. Determine the review target
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Review target (may be empty): use the invocation context or the explicit target supplied by the caller.
|
|
10
11
|
|
|
11
12
|
- If the input names a branch → review `git diff <that-branch>...HEAD`.
|
|
12
13
|
- If the input references a PR (number or URL) → use that PR's base branch as BASE.
|
|
@@ -51,19 +52,19 @@ If the diff adds or changes comments/docstrings, run `comment-fixer` ALONE befor
|
|
|
51
52
|
|
|
52
53
|
## 4. Launch the remaining subagents in PARALLEL
|
|
53
54
|
|
|
54
|
-
All subagents are CONDITIONAL: launch one only when the changed files indicate it applies. Run them in PARALLEL via the
|
|
55
|
+
All subagents are CONDITIONAL: launch one only when the changed files indicate it applies. Run them in PARALLEL via the delegation mechanism available in the current runtime. Each subagent fetches its OWN diff; all are read-only. Pass every one EXACTLY:
|
|
55
56
|
|
|
56
57
|
- the review scope: BASE and HEAD branches (verbatim), or "working diff" for uncommitted work
|
|
57
58
|
- the instruction: review only that scope — never assume `main`, use the scope given
|
|
58
59
|
|
|
59
60
|
Subagents and their triggers:
|
|
60
61
|
|
|
61
|
-
1.
|
|
62
|
-
2.
|
|
63
|
-
3.
|
|
64
|
-
4.
|
|
65
|
-
5.
|
|
66
|
-
6.
|
|
62
|
+
1. `test-analyzer` — only if the diff touches tests or code that should be tested
|
|
63
|
+
2. `silent-failure-hunter` — only if the diff includes error handling, try/catch, fallbacks, or async flows
|
|
64
|
+
3. `type-design-analyzer` — only if the diff changes types, interfaces, schemas, or public contracts
|
|
65
|
+
4. `code-reviewer` — for general code quality whenever non-trivial source code changed
|
|
66
|
+
5. `code-simplifier` — only if the diff introduces complexity worth simplifying; this is the lean/anti-bloat pass for diffs and PRs
|
|
67
|
+
6. `security-auditor` — only if the diff touches auth, authorization, permissions, secrets/credentials, sensitive data, input validation, webhooks, or other security-critical flows
|
|
67
68
|
|
|
68
69
|
If none of a subagent's triggers are present, skip it and note that it was skipped. Always state which subagents ran and which were skipped and why.
|
|
69
70
|
|
|
@@ -110,9 +110,11 @@ Every piece of information about a piece of work has exactly ONE home — never
|
|
|
110
110
|
|
|
111
111
|
## Testing and Verification
|
|
112
112
|
|
|
113
|
-
- When the project has tests or the change affects behavior,
|
|
114
|
-
-
|
|
115
|
-
- Use
|
|
113
|
+
- When the project has tests or the change affects behavior, verification is mandatory. A new test is not.
|
|
114
|
+
- Make one explicit testing decision per change: what risk it introduces, what existing test already covers it, what new behavior needs protection, and why no new test is needed when the change is trivial, mechanical, or already covered.
|
|
115
|
+
- Use TDD for business rules, bugs/regressions, public contracts, and invariants. Do not impose it on styling, wiring, generated code, mechanical refactors, or trivial code unless they change meaningful behavior.
|
|
116
|
+
- Prefer one authoritative test at the strongest seam closest to the risk. Add coverage at another layer only when it protects a distinct contract, not to repeat the same behavior.
|
|
117
|
+
- Use the `tdd` skill for red-green-refactor, test-first work, or risk-based behavior testing.
|
|
116
118
|
- Prefer targeted verification before broad suites.
|
|
117
119
|
- Default order: specific test > partial suite > full suite.
|
|
118
120
|
- Use the real test commands and test stack of the project.
|
|
@@ -125,7 +127,12 @@ Every piece of information about a piece of work has exactly ONE home — never
|
|
|
125
127
|
- Commit per task or per bounded group of tasks — small, separate commits whose history maps to the work; never everything in one giant commit.
|
|
126
128
|
- Never push code or behavior changes directly to production branches (main/master or the repo's protected/release branches): those always go through a work branch + PR. Pushing a work branch or a worktree branch is fine without asking.
|
|
127
129
|
- Exception: TRIVIAL changes — docs, typos, content removal, config text with no behavior or code-logic impact — may be committed and pushed directly to the production branch. When in doubt about whether a change is trivial, it is not: use a PR.
|
|
128
|
-
-
|
|
130
|
+
- Start each non-trivial PR from an updated production branch in its canonical worktree/branch, and keep one concrete objective per PR. Dependent PRs are sequential: merge the first, update the production branch, then create the next branch from it.
|
|
131
|
+
- After the first coherent commit, push the work branch and always open the PR as draft with `gh pr create --draft`. Creating and pushing the work branch and draft PR is fine without asking.
|
|
132
|
+
- Keep the PR in draft while its code can still change. All subsequent commits and pushes happen while draft; never push to a ready PR.
|
|
133
|
+
- Before ready, complete all applicable preflight work: code, version bump, local tests, the project's quality command (`pnpm qa:quality` when defined), Vercel preview review when the project uses Vercel, final diff inspection, and the full PR review. React Doctor is manual/local, not a GitHub Actions gate.
|
|
134
|
+
- Mark the PR ready only once the current SHA is the candidate to merge: `gh pr ready <number>`. If the project has PR checks configured, wait for Quality Gates, run `gh pr checks <number>`, and verify the checks belong to the latest commit before reporting it mergeable. If no PR checks are configured, confirm that from project configuration such as workflows, rulesets or integrations, and record it; their absence does not block the merge. An empty `gh pr checks` result immediately after ready is not evidence that no checks are configured. Immediately before reporting or merging, compare `gh pr view --json headRefOid` with the recorded candidate SHA.
|
|
135
|
+
- If a ready PR needs any code or behavior change, first run `gh pr ready --undo <number>`, then modify and push while draft, repeat the full local verification and review, mark ready again, and wait for a fresh complete gate when PR checks are configured. Never push to a ready PR and merge without repeating the applicable cycle.
|
|
129
136
|
- Merging a PR ALWAYS requires an explicit user request — no exceptions, in any flow.
|
|
130
137
|
- Before commit or push, review `git status`, `git diff`, and `git log --oneline -10`.
|
|
131
138
|
- Never add AI signatures, `Co-Authored-By`, or agent mentions.
|
package/upstreams.json
CHANGED
|
@@ -74,7 +74,8 @@
|
|
|
74
74
|
"tdd": {
|
|
75
75
|
"source": "github:mattpocock/skills",
|
|
76
76
|
"path": "skills/engineering/tdd",
|
|
77
|
-
"commit": "694fa30311e02c2639942308513555e61ee84a6f"
|
|
77
|
+
"commit": "694fa30311e02c2639942308513555e61ee84a6f",
|
|
78
|
+
"modified": true
|
|
78
79
|
},
|
|
79
80
|
"to-issues": {
|
|
80
81
|
"source": "github:mattpocock/skills",
|