mandrel 2.6.0 → 2.8.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 (78) 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 +133 -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/scripts/lib/feedback-loop/audit-results-graduator.js +7 -2
  21. package/.agents/scripts/lib/feedback-loop/graduator-core.js +144 -12
  22. package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +11 -1
  23. package/.agents/scripts/lib/observability/runtime-friction.js +97 -36
  24. package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +29 -5
  25. package/.agents/skills/core/api-and-interface-design/SKILL.md +23 -297
  26. package/.agents/skills/core/api-and-interface-design/reference.md +76 -0
  27. package/.agents/skills/core/browser-testing-with-devtools/SKILL.md +20 -327
  28. package/.agents/skills/core/browser-testing-with-devtools/reference.md +74 -0
  29. package/.agents/skills/core/code-review-and-quality/reference.md +16 -398
  30. package/.agents/skills/core/debugging-and-error-recovery/reference.md +14 -281
  31. package/.agents/skills/core/documentation-and-adrs/reference.md +42 -338
  32. package/.agents/skills/core/git-workflow-and-versioning/SKILL.md +28 -326
  33. package/.agents/skills/core/idea-refinement/SKILL.md +67 -193
  34. package/.agents/skills/core/security-and-hardening/SKILL.md +15 -31
  35. package/.agents/skills/core/security-and-hardening/reference.md +15 -273
  36. package/.agents/skills/skills.index.json +5 -5
  37. package/.agents/skills/stack/qa/gherkin-authoring/SKILL.md +16 -222
  38. package/.agents/skills/stack/qa/gherkin-authoring/reference.md +157 -0
  39. package/.agents/skills/stack/qa/playwright/SKILL.md +0 -29
  40. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +19 -23
  41. package/.agents/skills/stack/qa/qa-harness/SKILL.md +35 -53
  42. package/.agents/skills/stack/qa/vitest/SKILL.md +0 -29
  43. package/.agents/workflows/audit-accessibility.md +34 -108
  44. package/.agents/workflows/audit-architecture.md +35 -123
  45. package/.agents/workflows/audit-clean-code.md +19 -78
  46. package/.agents/workflows/audit-data-model.md +32 -100
  47. package/.agents/workflows/audit-dependencies.md +47 -111
  48. package/.agents/workflows/audit-devops.md +16 -83
  49. package/.agents/workflows/audit-documentation.md +46 -93
  50. package/.agents/workflows/audit-navigability.md +26 -80
  51. package/.agents/workflows/audit-performance.md +40 -106
  52. package/.agents/workflows/audit-privacy.md +17 -80
  53. package/.agents/workflows/audit-quality.md +35 -99
  54. package/.agents/workflows/audit-security.md +20 -78
  55. package/.agents/workflows/audit-seo.md +20 -98
  56. package/.agents/workflows/audit-sre.md +20 -88
  57. package/.agents/workflows/audit-to-stories.md +1 -8
  58. package/.agents/workflows/audit-ux-ui.md +17 -80
  59. package/.agents/workflows/deliver.md +54 -9
  60. package/.agents/workflows/git-cleanup.md +50 -275
  61. package/.agents/workflows/helpers/audit-lens-core.md +230 -0
  62. package/.agents/workflows/helpers/code-review.md +11 -23
  63. package/.agents/workflows/helpers/deliver-story-reference.md +114 -17
  64. package/.agents/workflows/helpers/deliver-story.md +26 -186
  65. package/.agents/workflows/helpers/qa-core.md +174 -0
  66. package/.agents/workflows/helpers/qa-run-scenario-reference.md +35 -0
  67. package/.agents/workflows/helpers/qa-run-scenario.md +11 -25
  68. package/.agents/workflows/helpers/worktree-lifecycle.md +6 -67
  69. package/.agents/workflows/mandrel-update.md +7 -13
  70. package/.agents/workflows/plan.md +17 -15
  71. package/.agents/workflows/qa-assist.md +140 -269
  72. package/.agents/workflows/qa-explore.md +125 -316
  73. package/.agents/workflows/qa-run.md +180 -380
  74. package/docs/CHANGELOG.md +18 -0
  75. package/package.json +1 -1
  76. package/.agents/workflows/helpers/audit-dual-path.md +0 -59
  77. package/.agents/workflows/helpers/audit-self-check.md +0 -70
  78. package/.agents/workflows/helpers/audit-severity-scale.md +0 -19
@@ -10,343 +10,45 @@ description:
10
10
 
11
11
  ## Policy Capsule
12
12
 
13
- - Default to trunk-based development: branch from `main`, keep feature branches short-lived (1–3 days), and delete them after merge. Prefer feature flags over long-lived branches.
14
- - Commit early and often each successful increment is its own save point. Never accumulate large uncommitted changes.
15
- - Keep commits atomic: each commit does exactly one logical thing. Never mix formatting changes with behavior changes, or refactors with features.
16
- - Write commit messages that explain the **why**, not the what. Follow the `<type>: <description>` convention with types drawn from `feat | fix | refactor | test | docs | chore` (imperative mood).
17
- - Target ~100 lines per commit/PR; split anything over ~1000 lines into smaller logical changes before submitting.
18
- - Before every commit: review the staged diff, scan for secrets/PII, run tests + lint + typecheck; automate via husky/lint-staged when available.
19
- - Provide a structured Change Summary on completion that includes `CHANGES MADE`, `THINGS I DIDN'T TOUCH (intentionally)`, and `POTENTIAL CONCERNS` — the "didn't touch" section is mandatory to demonstrate scope discipline.
20
- - Never commit `.env`, build output (`dist/`, `.next/`), `node_modules/`, IDE-private config, or any hardcoded secret. Keep a `.gitignore` that covers these from day one.
21
- - Never force-push to shared branches; on rejected pushes, fix the underlying issue and create a follow-up commit rather than amending.
22
- - Use worktrees (not branch-switching) for parallel agent work so concurrent streams are isolated until explicitly merged.
23
-
24
- ## Overview
25
-
26
- Git is your safety net. Treat commits as save points, branches as sandboxes, and
27
- history as documentation. With AI agents generating code at high speed,
28
- disciplined version control is the mechanism that keeps changes manageable,
29
- reviewable, and reversible.
30
-
31
- ## When to Use
32
-
33
- Always. Every code change flows through git.
34
-
35
- ## Core Principles
36
-
37
- ### Trunk-Based Development (Recommended)
38
-
39
- Keep `main` always deployable. Work in short-lived feature branches that merge
40
- back within 1-3 days. Long-lived development branches are hidden costs — they
41
- diverge, create merge conflicts, and delay integration. DORA research
42
- consistently shows trunk-based development correlates with high-performing
43
- engineering teams.
44
-
45
- ```text
46
- main ──●──●──●──●──●──●──●──●──●── (always deployable)
47
- ╲ ╱ ╲ ╱
48
- ●──●─╱ ●──╱ ← short-lived feature branches (1-3 days)
49
- ```
50
-
51
- This is the recommended default. Teams using gitflow or long-lived branches can
52
- adapt the principles (atomic commits, small changes, descriptive messages) to
53
- their branching model — the commit discipline matters more than the specific
54
- branching strategy.
55
-
56
- - **Dev branches are costs.** Every day a branch lives, it accumulates merge
57
- risk.
58
- - **Release branches are acceptable.** When you need to stabilize a release
59
- while main moves forward.
60
- - **Feature flags > long branches.** Prefer deploying incomplete work behind
61
- flags rather than keeping it on a branch for weeks.
62
-
63
- ### 1. Commit Early, Commit Often
64
-
65
- Each successful increment gets its own commit. Don't accumulate large
66
- uncommitted changes.
67
-
68
- ```text
69
- Work pattern:
70
- Implement slice → Test → Verify → Commit → Next slice
71
-
72
- Not this:
73
- Implement everything → Hope it works → Giant commit
74
- ```
75
-
76
- Commits are save points. If the next change breaks something, you can revert to
77
- the last known-good state instantly.
78
-
79
- ### 2. Atomic Commits
80
-
81
- Each commit does one logical thing:
82
-
83
- ```text
84
- # Good: Each commit is self-contained
85
- git log --oneline
86
- a1b2c3d Add task creation endpoint with validation
87
- d4e5f6g Add task creation form component
88
- h7i8j9k Connect form to API and add loading state
89
- m1n2o3p Add task creation tests (unit + integration)
90
-
91
- # Bad: Everything mixed together
92
- git log --oneline
93
- x1y2z3a Add task feature, fix sidebar, update deps, refactor utils
94
- ```
95
-
96
- ### 3. Descriptive Messages
97
-
98
- Commit messages explain the _why_, not just the _what_:
99
-
100
- ```text
101
- # Good: Explains intent
102
- feat: add email validation to registration endpoint
103
-
104
- Prevents invalid email formats from reaching the database.
105
- Uses Zod schema validation at the route handler level,
106
- consistent with existing validation patterns in auth.ts.
107
-
108
- # Bad: Describes what's obvious from the diff
109
- update auth.ts
110
- ```
111
-
112
- **Format:**
113
-
114
- ```text
115
- <type>: <short description>
116
-
117
- <optional body explaining why, not what>
118
- ```
119
-
120
- **Types:**
121
-
122
- - `feat` — New feature
123
- - `fix` — Bug fix
124
- - `refactor` — Code change that neither fixes a bug nor adds a feature
125
- - `test` — Adding or updating tests
126
- - `docs` — Documentation only
127
- - `chore` — Tooling, dependencies, config
128
-
129
- ### 4. Keep Concerns Separate
130
-
131
- Don't combine formatting changes with behavior changes. Don't combine refactors
132
- with features. Each type of change should be a separate commit — and ideally a
133
- separate PR:
134
-
135
- ```text
136
- # Good: Separate concerns
137
- git commit -m "refactor: extract validation logic to shared utility"
138
- git commit -m "feat: add phone number validation to registration"
139
-
140
- # Bad: Mixed concerns
141
- git commit -m "refactor validation and add phone number field"
142
- ```
143
-
144
- **Separate refactoring from feature work.** A refactoring change and a feature
145
- change are two different changes — submit them separately. This makes each
146
- change easier to review, revert, and understand in history. Small cleanups
147
- (renaming a variable) can be included in a feature commit at reviewer
148
- discretion.
149
-
150
- ### 5. Size Your Changes
151
-
152
- Target ~100 lines per commit/PR. Changes over ~1000 lines should be split. See
153
- the splitting strategies in `code-review-and-quality` for how to break down
154
- large changes.
155
-
156
- ```text
157
- ~100 lines → Easy to review, easy to revert
158
- ~300 lines → Acceptable for a single logical change
159
- ~1000 lines → Split into smaller changes
160
- ```
161
-
162
- ## Branching Strategy
163
-
164
- ### Feature Branches
165
-
166
- ```text
167
- main (always deployable)
168
-
169
- ├── feature/task-creation ← One feature per branch
170
- ├── feature/user-settings ← Parallel work
171
- └── fix/duplicate-tasks ← Bug fixes
172
- ```
173
-
174
- - Branch from `main` (or the team's default branch)
175
- - Keep branches short-lived (merge within 1-3 days) — long-lived branches are
176
- hidden costs
177
- - Delete branches after merge
178
- - Prefer feature flags over long-lived branches for incomplete features
179
-
180
- ### Branch Naming
181
-
182
- ```text
183
- feature/<short-description> → feature/task-creation
184
- fix/<short-description> → fix/duplicate-tasks
185
- chore/<short-description> → chore/update-deps
186
- refactor/<short-description> → refactor/auth-module
187
- ```
188
-
189
- ## Working with Worktrees
190
-
191
- For parallel AI agent work, use git worktrees to run multiple branches
192
- simultaneously:
193
-
194
- ```bash
195
- # Create a worktree for a feature branch
196
- git worktree add ../project-feature-a feature/task-creation
197
- git worktree add ../project-feature-b feature/user-settings
198
-
199
- # Each worktree is a separate directory with its own branch
200
- # Agents can work in parallel without interfering
201
- ls ../
202
- project/ ← main branch
203
- project-feature-a/ ← task-creation branch
204
- project-feature-b/ ← user-settings branch
205
-
206
- # When done, merge and clean up
207
- git worktree remove ../project-feature-a
208
- ```
209
-
210
- Benefits:
211
-
212
- - Multiple agents can work on different features simultaneously
213
- - No branch switching needed (each directory has its own branch)
214
- - If one experiment fails, delete the worktree — nothing is lost
215
- - Changes are isolated until explicitly merged
216
-
217
- ## The Save Point Pattern
218
-
219
- ```text
220
- Agent starts work
221
-
222
- ├── Makes a change
223
- │ ├── Test passes? → Commit → Continue
224
- │ └── Test fails? → Revert to last commit → Investigate
225
-
226
- ├── Makes another change
227
- │ ├── Test passes? → Commit → Continue
228
- │ └── Test fails? → Revert to last commit → Investigate
229
-
230
- └── Feature complete → All commits form a clean history
231
- ```
232
-
233
- This pattern means you never lose more than one increment of work. If an agent
234
- goes off the rails, `git reset --hard HEAD` takes you back to the last
235
- successful state.
13
+ - The always-on git core — canonical branch shape (`story-<storyId>` seeded from `main`), the Conventional-Commit subject contract and its allowed type set, the `refs #<id>` reference, and the push / hygiene MUSTs lives in [`.agents/rules/git-conventions.md`](../../../rules/git-conventions.md); that rule is the SSOT and wins on conflict. This skill adds **only** what the rule does not own.
14
+ - Commit early and often: each successful increment is its own save point. Never accumulate large uncommitted changes.
15
+ - Keep commits atomic one logical thing per commit. Never mix formatting changes with behavior changes, or refactors with features.
16
+ - Treat commits as revertable save points: when a change breaks something, `git reset --hard HEAD` returns you to the last known-good increment, so you never lose more than one step of work.
17
+ - Provide a structured Change Summary on completion with `CHANGES MADE`, `THINGS I DIDN'T TOUCH (intentionally)`, and `POTENTIAL CONCERNS` — the "didn't touch" section is mandatory to demonstrate scope discipline.
18
+ - Use git worktrees (not branch-switching) for parallel agent work so concurrent streams stay isolated until explicitly merged. The runtime already materializes one worktree per Story under `.worktrees/story-<id>/`.
19
+
20
+ ## What the rule owns (do not restate)
21
+
22
+ Branch naming, the allowed commit types, `refs #`, squash-merge delivery, push
23
+ validation, and local-checkout hygiene are the always-on rule's job. Read
24
+ [`git-conventions.md`](../../../rules/git-conventions.md) for those; do not
25
+ carry a divergent copy here. In particular, the framework's only sanctioned
26
+ delivery shape is `story-<id>` PR squash-merge to `main`: there is no
27
+ short-lived personal branch flow to prescribe, and delivery is squash-merge, so
28
+ this skill offers no contrary branching or history-preservation guidance.
29
+
30
+ ## The Save-Point Pattern
31
+
32
+ Work in the loop `implement slice → test → verify → commit → next slice`. Each
33
+ green increment is a commit; if the next change fails, revert to the last
34
+ commit and investigate rather than debugging forward from a broken state. This
35
+ means you never lose more than one increment of work.
236
36
 
237
37
  ## Change Summaries
238
38
 
239
- After any modification, provide a structured summary. This makes review easier,
39
+ After any modification, provide a structured summary it makes review easier,
240
40
  documents scope discipline, and surfaces unintended changes:
241
41
 
242
42
  ```text
243
43
  CHANGES MADE:
244
44
  - src/routes/tasks.ts: Added validation middleware to POST endpoint
245
- - src/lib/validation.ts: Added TaskCreateSchema using Zod
246
45
 
247
46
  THINGS I DIDN'T TOUCH (intentionally):
248
- - src/routes/auth.ts: Has similar validation gap but out of scope
249
- - src/middleware/error.ts: Error format could be improved (separate task)
47
+ - src/routes/auth.ts: Has a similar validation gap but out of scope
250
48
 
251
49
  POTENTIAL CONCERNS:
252
- - The Zod schema is strict — rejects extra fields. Confirm this is desired.
253
- - Added zod as a dependency (72KB gzipped) — already in package.json
254
- ```
255
-
256
- This pattern catches wrong assumptions early and gives reviewers a clear map of
257
- the change. The "DIDN'T TOUCH" section is especially important — it shows you
258
- exercised scope discipline and didn't go on an unsolicited renovation.
259
-
260
- ## Pre-Commit Hygiene
261
-
262
- Before every commit:
263
-
264
- ```bash
265
- # 1. Check what you're about to commit
266
- git diff --staged
267
-
268
- # 2. Ensure no secrets
269
- git diff --staged | grep -i "password\|secret\|api_key\|token"
270
-
271
- # 3. Run tests
272
- npm test
273
-
274
- # 4. Run linting
275
- npm run lint
276
-
277
- # 5. Run type checking
278
- npx tsc --noEmit
279
- ```
280
-
281
- Automate this with git hooks:
282
-
283
- ```json
284
- // package.json (using lint-staged + husky)
285
- {
286
- "lint-staged": {
287
- "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
288
- "*.{json,md}": ["prettier --write"]
289
- }
290
- }
50
+ - The new schema rejects extra fields confirm that is desired.
291
51
  ```
292
52
 
293
- ## Handling Generated Files
294
-
295
- - **Commit generated files** only if the project expects them (e.g.,
296
- `package-lock.json`, Prisma migrations)
297
- - **Don't commit** build output (`dist/`, `.next/`), environment files (`.env`),
298
- or IDE config (`.vscode/settings.json` unless shared)
299
- - **Have a `.gitignore`** that covers: `node_modules/`, `dist/`, `.env`,
300
- `.env.local`, `*.pem`
301
-
302
- ## Using Git for Debugging
303
-
304
- ```bash
305
- # Find which commit introduced a bug
306
- git bisect start
307
- git bisect bad HEAD
308
- git bisect good <known-good-commit>
309
- # Git checkouts midpoints; run your test at each to narrow down
310
-
311
- # View what changed recently
312
- git log --oneline -20
313
- git diff HEAD~5..HEAD -- src/
314
-
315
- # Find who last changed a specific line
316
- git blame src/services/task.ts
317
-
318
- # Search commit messages for a keyword
319
- git log --grep="validation" --oneline
320
- ```
321
-
322
- ## Common Rationalizations
323
-
324
- | Rationalization | Reality |
325
- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
326
- | "I'll commit when the feature is done" | One giant commit is impossible to review, debug, or revert. Commit each slice. |
327
- | "The message doesn't matter" | Messages are documentation. Future you (and future agents) will need to understand what changed and why. |
328
- | "I'll squash it all later" | Squashing destroys the development narrative. Prefer clean incremental commits from the start. |
329
- | "Branches add overhead" | Short-lived branches are free and prevent conflicting work from colliding. Long-lived branches are the problem — merge within 1-3 days. |
330
- | "I'll split this change later" | Large changes are harder to review, riskier to deploy, and harder to revert. Split before submitting, not after. |
331
- | "I don't need a .gitignore" | Until `.env` with production secrets gets committed. Set it up immediately. |
332
-
333
- ## Red Flags
334
-
335
- - Large uncommitted changes accumulating
336
- - Commit messages like "fix", "update", "misc"
337
- - Formatting changes mixed with behavior changes
338
- - No `.gitignore` in the project
339
- - Committing `node_modules/`, `.env`, or build artifacts
340
- - Long-lived branches that diverge significantly from main
341
- - Force-pushing to shared branches
342
-
343
- ## Verification
344
-
345
- For every commit:
346
-
347
- - [ ] Commit does one logical thing
348
- - [ ] Message explains the why, follows type conventions
349
- - [ ] Tests pass before committing
350
- - [ ] No secrets in the diff
351
- - [ ] No formatting-only changes mixed with behavior changes
352
- - [ ] `.gitignore` covers standard exclusions
53
+ The "DIDN'T TOUCH" section is the important one: it shows you exercised scope
54
+ discipline and did not go on an unsolicited renovation.