mandrel 2.7.0 → 2.9.0

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.
Files changed (95) hide show
  1. package/.agents/README.md +104 -330
  2. package/.agents/agents/auditor.md +135 -0
  3. package/.agents/agents/plan-critic.md +80 -0
  4. package/.agents/audit-checklists/dependencies.md +7 -0
  5. package/.agents/audit-checklists/documentation.md +1 -0
  6. package/.agents/docs/SDLC.md +69 -162
  7. package/.agents/docs/configuration.md +159 -499
  8. package/.agents/docs/quality-gates.md +59 -180
  9. package/.agents/instructions.md +170 -295
  10. package/.agents/rules/changelog-style.md +8 -66
  11. package/.agents/rules/ci-remediation.md +65 -124
  12. package/.agents/rules/gherkin-standards.md +10 -31
  13. package/.agents/rules/git-conventions-reference.md +28 -61
  14. package/.agents/rules/git-conventions.md +1 -1
  15. package/.agents/rules/orchestration-error-handling.md +5 -15
  16. package/.agents/rules/security-baseline.md +7 -13
  17. package/.agents/rules/shell-conventions.md +4 -13
  18. package/.agents/rules/test-seams.md +2 -2
  19. package/.agents/rules/testing-standards.md +7 -17
  20. package/.agents/schemas/agentrc.schema.json +21 -0
  21. package/.agents/scripts/audit-to-stories.js +51 -0
  22. package/.agents/scripts/lib/audit-to-stories/dedupe-against-github.js +120 -55
  23. package/.agents/scripts/lib/config-settings-schema.js +32 -0
  24. package/.agents/scripts/lib/findings/semantic-issue-search.js +43 -5
  25. package/.agents/scripts/lib/observability/terse-result.js +114 -0
  26. package/.agents/scripts/lib/orchestration/complexity-gate.js +207 -0
  27. package/.agents/scripts/lib/orchestration/plan-context.js +3 -0
  28. package/.agents/scripts/lib/orchestration/single-story-close/phases/auto-merge.js +221 -8
  29. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +55 -14
  30. package/.agents/scripts/lib/orchestration/story-close/emit-blocked.js +9 -3
  31. package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +4 -1
  32. package/.agents/scripts/lib/orchestration/task-body-validator.js +13 -40
  33. package/.agents/scripts/lib/story-body/body-format-lints.js +215 -0
  34. package/.agents/scripts/lib/story-body/story-body.js +18 -2
  35. package/.agents/scripts/lib/templates/decomposer-prompts.js +16 -0
  36. package/.agents/scripts/providers/github/issues.js +54 -7
  37. package/.agents/scripts/providers/github/search-budget.js +124 -0
  38. package/.agents/scripts/providers/github/search-query.js +71 -0
  39. package/.agents/scripts/single-story-confirm-merge.js +14 -5
  40. package/.agents/scripts/single-story-init.js +19 -3
  41. package/.agents/scripts/sync-branch-from-base.js +9 -3
  42. package/.agents/skills/core/api-and-interface-design/SKILL.md +23 -297
  43. package/.agents/skills/core/api-and-interface-design/reference.md +76 -0
  44. package/.agents/skills/core/browser-testing-with-devtools/SKILL.md +20 -327
  45. package/.agents/skills/core/browser-testing-with-devtools/reference.md +74 -0
  46. package/.agents/skills/core/code-review-and-quality/reference.md +16 -398
  47. package/.agents/skills/core/debugging-and-error-recovery/reference.md +14 -281
  48. package/.agents/skills/core/documentation-and-adrs/reference.md +42 -338
  49. package/.agents/skills/core/git-workflow-and-versioning/SKILL.md +28 -326
  50. package/.agents/skills/core/idea-refinement/SKILL.md +67 -193
  51. package/.agents/skills/core/security-and-hardening/SKILL.md +15 -31
  52. package/.agents/skills/core/security-and-hardening/reference.md +15 -273
  53. package/.agents/skills/skills.index.json +5 -5
  54. package/.agents/skills/stack/qa/gherkin-authoring/SKILL.md +16 -222
  55. package/.agents/skills/stack/qa/gherkin-authoring/reference.md +157 -0
  56. package/.agents/skills/stack/qa/playwright/SKILL.md +0 -29
  57. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +19 -23
  58. package/.agents/skills/stack/qa/qa-harness/SKILL.md +35 -53
  59. package/.agents/skills/stack/qa/vitest/SKILL.md +0 -29
  60. package/.agents/workflows/audit-accessibility.md +34 -108
  61. package/.agents/workflows/audit-architecture.md +35 -123
  62. package/.agents/workflows/audit-clean-code.md +19 -78
  63. package/.agents/workflows/audit-data-model.md +32 -100
  64. package/.agents/workflows/audit-dependencies.md +47 -111
  65. package/.agents/workflows/audit-devops.md +16 -83
  66. package/.agents/workflows/audit-documentation.md +46 -93
  67. package/.agents/workflows/audit-navigability.md +26 -80
  68. package/.agents/workflows/audit-performance.md +40 -106
  69. package/.agents/workflows/audit-privacy.md +17 -80
  70. package/.agents/workflows/audit-quality.md +35 -99
  71. package/.agents/workflows/audit-security.md +20 -78
  72. package/.agents/workflows/audit-seo.md +20 -98
  73. package/.agents/workflows/audit-sre.md +20 -88
  74. package/.agents/workflows/audit-to-stories.md +1 -8
  75. package/.agents/workflows/audit-ux-ui.md +17 -80
  76. package/.agents/workflows/deliver.md +54 -9
  77. package/.agents/workflows/git-cleanup.md +50 -275
  78. package/.agents/workflows/helpers/audit-lens-core.md +230 -0
  79. package/.agents/workflows/helpers/code-review.md +11 -23
  80. package/.agents/workflows/helpers/deliver-story-reference.md +114 -17
  81. package/.agents/workflows/helpers/deliver-story.md +36 -186
  82. package/.agents/workflows/helpers/qa-core.md +174 -0
  83. package/.agents/workflows/helpers/qa-run-scenario-reference.md +35 -0
  84. package/.agents/workflows/helpers/qa-run-scenario.md +11 -25
  85. package/.agents/workflows/helpers/worktree-lifecycle.md +6 -67
  86. package/.agents/workflows/mandrel-update.md +7 -13
  87. package/.agents/workflows/plan.md +44 -17
  88. package/.agents/workflows/qa-assist.md +140 -269
  89. package/.agents/workflows/qa-explore.md +125 -316
  90. package/.agents/workflows/qa-run.md +180 -380
  91. package/docs/CHANGELOG.md +30 -0
  92. package/package.json +1 -1
  93. package/.agents/workflows/helpers/audit-dual-path.md +0 -59
  94. package/.agents/workflows/helpers/audit-self-check.md +0 -70
  95. package/.agents/workflows/helpers/audit-severity-scale.md +0 -19
package/docs/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.9.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.8.0...mandrel-v2.9.0) (2026-07-21)
6
+
7
+
8
+ ### Added
9
+
10
+ * ceremony-lite path: complexity-gate the full plan/deliver pipeline for trivial scopes ([#4683](https://github.com/dsj1984/mandrel/issues/4683)) ([#4688](https://github.com/dsj1984/mandrel/issues/4688)) ([1002776](https://github.com/dsj1984/mandrel/commit/10027761c7bf375aa32b4ffe8b526015433311ca))
11
+ * harden /audit-to-stories dedup search: budget the fan-out, bound the query, soft-fail instead of aborting ([#4678](https://github.com/dsj1984/mandrel/issues/4678)) ([#4679](https://github.com/dsj1984/mandrel/issues/4679)) ([c043b70](https://github.com/dsj1984/mandrel/commit/c043b708dca9daf10525fe0e810da9b13998454b))
12
+ * **plan:** pre-empt deterministic body-format lints in the story-author prompt and auto-fix mechanical ones (refs [#4684](https://github.com/dsj1984/mandrel/issues/4684)) ([#4689](https://github.com/dsj1984/mandrel/issues/4689)) ([8dea7ad](https://github.com/dsj1984/mandrel/commit/8dea7adc71e9adcb746022747f3d436ccb520758))
13
+
14
+
15
+ ### Fixed
16
+
17
+ * land tail: tolerate/pre-empt a worktree-held story branch so a merged PR is never stranded at agent::blocked ([#4681](https://github.com/dsj1984/mandrel/issues/4681)) ([#4686](https://github.com/dsj1984/mandrel/issues/4686)) ([0436af0](https://github.com/dsj1984/mandrel/commit/0436af0ab183c6e423cf2b56e749d63fa0c6b150))
18
+ * root-cause and fix: second-touch change-request deliveries complete but their PR never lands ([#4682](https://github.com/dsj1984/mandrel/issues/4682)) ([#4687](https://github.com/dsj1984/mandrel/issues/4687)) ([2010739](https://github.com/dsj1984/mandrel/commit/20107399a9a1645c0d8b259245b275a965ffdcbc))
19
+
20
+
21
+ ### Performance
22
+
23
+ * **orchestration:** quiet hot-path script stdout to terse summaries (refs [#4685](https://github.com/dsj1984/mandrel/issues/4685)) ([#4690](https://github.com/dsj1984/mandrel/issues/4690)) ([310ee4a](https://github.com/dsj1984/mandrel/commit/310ee4a70726dee0ace6da8bb866cb01e57f7c2b))
24
+
25
+ ## [2.8.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.7.0...mandrel-v2.8.0) (2026-07-21)
26
+
27
+
28
+ ### Changed
29
+
30
+ * **audit:** extract a shared audit-lens-core and dispatch lenses through a role-scoped auditor ([#4665](https://github.com/dsj1984/mandrel/issues/4665)) ([#4674](https://github.com/dsj1984/mandrel/issues/4674)) ([c7b0e13](https://github.com/dsj1984/mandrel/commit/c7b0e138465bd14eef08470cc756c7ea3c35e78d))
31
+ * **qa:** extract shared qa-core helper and cut the stale draft-bundle path (refs [#4666](https://github.com/dsj1984/mandrel/issues/4666)) ([#4669](https://github.com/dsj1984/mandrel/issues/4669)) ([dca7412](https://github.com/dsj1984/mandrel/commit/dca74128b419cd96deaaa4b214223d82f5a16415))
32
+ * **skills:** enforce capsule-first discipline and fix git-skill rule conflicts (refs [#4667](https://github.com/dsj1984/mandrel/issues/4667)) ([#4673](https://github.com/dsj1984/mandrel/issues/4673)) ([4a3a142](https://github.com/dsj1984/mandrel/commit/4a3a1428873f0d3f0fc084dc77b7d591576f0eee))
33
+ * **workflows:** wire role-scoped story-worker dispatch and slim the delivery workflow cluster (refs [#4663](https://github.com/dsj1984/mandrel/issues/4663)) ([#4670](https://github.com/dsj1984/mandrel/issues/4670)) ([42e65f0](https://github.com/dsj1984/mandrel/commit/42e65f0a2483a924aa0a1268b4ec26ea6f5b53bb))
34
+
5
35
  ## [2.7.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.6.0...mandrel-v2.7.0) (2026-07-21)
6
36
 
7
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandrel",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Claude Code-first opinionated workflow framework: instructions, skills, rules, and SDLC workflows that govern AI coding assistants.",
5
5
  "files": [
6
6
  ".agents/",
@@ -1,59 +0,0 @@
1
- # Audit lens execution strategy (dual-path)
2
-
3
- > **Single source for the dual-path preamble (Story #4625).** Every lens whose
4
- > `## Execution strategy (dual-path)` section points here shares this exact
5
- > contract. Read `audit-<lens>` and
6
- > `.claude/workflows/audit-<lens>.workflow.js` below as this lens's own name.
7
-
8
- A lens that references this helper runs along one of two execution paths. Both
9
- emit the **identical** report contract (the lens's Output Requirements step);
10
- downstream consumers (`audit-to-stories`) are agnostic to which path produced
11
- it.
12
-
13
- - **Orchestrated (dynamic-workflow) path.** When Claude Code's
14
- [dynamic workflows](https://code.claude.com/docs/en/workflows) are
15
- available, the saved project workflow
16
- `.claude/workflows/audit-<lens>.workflow.js` fans the lens's dimensions out
17
- as parallel read-only subagents, runs an **adversarial cross-check** stage
18
- (an independent agent reviews each dimension's findings and drops false
19
- positives before they enter the report), then synthesises the report. The
20
- orchestrator derives its per-dimension prompts from the *lens* markdown at
21
- run time — the lens stays the single source of truth; the script does not
22
- fork a second copy of the spec.
23
- - **Sequential (single-pass) path.** When dynamic workflows are unavailable,
24
- follow the lens's Steps turn-by-turn exactly as before. This is the default
25
- fallback and changes nothing about the existing behaviour.
26
-
27
- **Strategy selection** is computed by
28
- [`lib/dynamic-workflow/capability.js`](../../scripts/lib/dynamic-workflow/capability.js)
29
- (`selectAuditStrategy`). The orchestrated path is chosen only when the runtime
30
- is Claude Code, `disableWorkflows` is not set (settings.json **or**
31
- `CLAUDE_CODE_DISABLE_WORKFLOWS`), and the Claude Code version meets the
32
- research-preview floor (`>= 2.1.154`). Any other runtime, a disabled setting,
33
- or an older version degrades gracefully to the sequential path.
34
-
35
- > **Capability degradation, not a contract shim.** This dual path is **not**
36
- > covered by the No-Shim / hard-cutover rule in
37
- > [`git-conventions.md`](../../rules/git-conventions.md). That rule forbids
38
- > running two shapes of the *same contract* side by side. Here there is **one**
39
- > report contract; only the *execution strategy* is selected from a runtime
40
- > capability — the same pattern the protocol already endorses for live-docs
41
- > fallback in [`instructions.md` §1.C/§1.D](../../instructions.md). The full
42
- > capability-degradation rationale lives in the
43
- > [`capability.js`](../../scripts/lib/dynamic-workflow/capability.js) module
44
- > docstring; the orchestrated-run evidence and per-lens cost/precision gate
45
- > verdicts live in [`docs/roadmap.md`](../../../docs/roadmap.md) (Part 3 —
46
- > Dynamic-Workflow Orchestration).
47
-
48
- **Forcing a path (for testing).** Set `MANDREL_AUDIT_STRATEGY=sequential` to
49
- verify the fallback path with the feature notionally disabled, or
50
- `MANDREL_AUDIT_STRATEGY=orchestrated` to pin the dynamic path. To exercise the
51
- real disable signals instead, set `CLAUDE_CODE_DISABLE_WORKFLOWS=1` (env) or
52
- `disableWorkflows: true` in `.claude/settings.json` and re-run the lens — both
53
- degrade to the sequential path.
54
-
55
- > **Read-only on both paths.** The lens is read-only (see its Constraint). The
56
- > orchestrated subagents run in `acceptEdits` and inherit the session tool
57
- > allowlist, but the workflow script grants the analysis agents only
58
- > read/search tools (`Read`, `Grep`, `Glob`) — no write/edit/shell-mutation
59
- > tools. The single write in an orchestrated run is the final report artifact.
@@ -1,70 +0,0 @@
1
- # Audit finding self-cross-check (shared)
2
-
3
- > **Single source of truth for the sequential-path false-positive guard
4
- > (Story #4627).** Every non-retired audit lens references this file and runs
5
- > this pass over its Detailed Findings before finalizing its report. The
6
- > orchestrated dynamic-workflow path already fans out an independent
7
- > adversarial reviewer; this pass gives the **sequential single-pass** path —
8
- > the one consumer runs take, where the npm payload ships no per-lens
9
- > `*.workflow.js` — the same false-positive filter, so a lens cannot report an
10
- > unverified finding just because it ran single-pass.
11
-
12
- You are your own adversarial reviewer. After you have drafted the Detailed
13
- Findings but **before** you write the report artifact, re-open every finding
14
- and hold it to the bar below. This pass is **read-only** — it filters and
15
- tightens the findings you already have; it never invents new ones.
16
-
17
- ## Per-finding evidence bar (keep or drop)
18
-
19
- Keep a finding only when **all** of the following hold. Drop it otherwise.
20
-
21
- - **Grounded location** — it names a concrete `path:line` (or a concrete
22
- symbol / config key) that you have actually read, not a hypothetical or a
23
- "somewhere in the codebase" claim.
24
- - **Reproducible evidence** — the problem is backed by an observable: a tool
25
- reading (a baseline row, a complexity/MI/duplication number, a failing
26
- command), a quoted code snippet, or a specific standard it violates. A
27
- finding whose entire basis is "this looks wrong" does not clear the bar.
28
- - **In-scope** — when a change-set scope filter was supplied (the `Scope`
29
- block resolved to a file list), the finding lives in that scope or a direct
30
- dependency the lens explicitly reasons across. A finding outside the scope
31
- filter is dropped, not reported.
32
- - **Actionable** — the recommendation is specific enough to execute. Drop
33
- vague exhortations ("improve error handling generally") that carry no
34
- concrete change.
35
-
36
- ## Exclusion list (never a finding)
37
-
38
- Treat the following as **out of scope by construction** and drop any finding
39
- that rests on one of them:
40
-
41
- - **Sanctioned test seams** — exports consumed only by tests, and other
42
- patterns the `test-seams` rule blesses. Never a production defect.
43
- - **Entry points & public API surface** — CLI mains, `bin/` scripts, declared
44
- `exports` / `bin` / `main`, and barrel contracts consumed out-of-tree. A
45
- zero in-repo consumer count is not death.
46
- - **Dynamic / framework reachability** — symbols reached via `import()`,
47
- string-keyed dispatch, decorators, lifecycle listeners, or convention-loaded
48
- plugin directories. Invisible to static analysis, not dead.
49
- - **Intentional, documented deviations** — a pattern an in-tree comment, ADR,
50
- or config explicitly sanctions. Cite it and drop the finding.
51
- - **Style-only nits already enforced by a formatter/linter** — do not
52
- re-litigate what the committed tooling already governs.
53
-
54
- ## Final re-open-and-drop pass (mandatory)
55
-
56
- 1. Walk your Detailed Findings once more, applying the bar and the exclusion
57
- list above. Remove every finding that fails.
58
- 2. Count what you kept (`k`) and what you dropped (`d`).
59
- 3. Record the outcome in the report's **Executive Summary** as a single line:
60
-
61
- ```text
62
- Self-cross-check: kept <k> / dropped <d>.
63
- ```
64
-
65
- When `d > 0`, name the dropped findings (title + the bar/exclusion reason)
66
- in one short list under that line, so the filtering is auditable and never
67
- silent.
68
-
69
- A lens that keeps every finding still records `dropped 0` — the line's absence
70
- is itself a defect (it means the pass did not run).
@@ -1,19 +0,0 @@
1
- # Audit finding severity scale (shared)
2
-
3
- > **Single source of truth for the `Severity` axis (Story #4625).** Every audit
4
- > lens report references this file so the four levels — and the parser that
5
- > ranks them — never drift per lens.
6
-
7
- Every finding grades its severity (labelled `Severity` or `Impact` on a given
8
- lens) on this ordered scale. `parse-audit-md.js` recognizes every level, and a
9
- surviving **Critical** finding halts the delivery gate
10
- (`lib/audit-suite/findings.js#hasSurvivingCritical`).
11
-
12
- - **Critical** — an active, exploitable, or data-losing defect that must be
13
- fixed before the change can ship (e.g. a leaked secret, an auth bypass, a
14
- guaranteed production outage or data-loss path).
15
- - **High** — a serious correctness, security, or maintainability risk that
16
- should be fixed promptly, but does not by itself block the release.
17
- - **Medium** — a real problem worth scheduling; contained blast radius, or a
18
- reasonable workaround exists.
19
- - **Low** — minor or cosmetic; fix opportunistically.