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
@@ -10,70 +10,24 @@ description:
10
10
  ## Policy Capsule
11
11
 
12
12
  - Drive the three-phase loop in order: **Understand & Expand → Evaluate & Converge (grill) → Sharpen & Ship**. Never jump straight to Phase 3 output.
13
- - Phase 1 MUST restate the idea as a "How Might We" statement, ask 3–5 sharpening questions via `AskUserQuestion`, and generate 5–8 variations (not 20+ shallow ones); do not proceed until target user and success criteria are explicit.
13
+ - Phase 1 MUST restate the idea as a "How Might We" statement, ask 3–5 sharpening questions via `AskUserQuestion`, and generate 5–8 variations (never 20+ shallow ones) each carrying a reason it exists, told as a short story, not a bare bullet. Do not proceed until target user and success criteria are explicit.
14
14
  - Phase 2 grill loop poses **one** question at a time, each with a recommended answer + one-line rationale grounded in user input / codebase / first principles; never batch questions and never omit the recommendation.
15
- - Re-enumerate open branches after every grill answer; stop only when no unresolved decisions remain. Take the off-ramp directly to Phase 3 when the idea is already crisply scoped.
15
+ - Re-enumerate open branches after every grill answer; stop only when no unresolved decisions remain. Take the off-ramp directly to Phase 3 when the idea is already crisply scoped. A branch consciously deferred rather than resolved records its deferral reason.
16
16
  - Phase 3 emits a markdown one-pager with the canonical five planning headings exactly: `## Context`, `## Goal`, `## Non-Goals`, `## Scope`, `## Acceptance Criteria` (plus optional `## Open Questions`). No alternate heading text — the `/plan` clarity gate depends on this verbatim.
17
17
  - Surface every key assumption inside `## Context` (or `## Scope`); assumptions do not get their own heading. Unresolved decisions MUST NOT carry into the one-pager.
18
18
  - The `## Non-Goals` list is mandatory and each entry includes a reason — focus is created by explicit exclusion.
19
19
  - Be honest, not supportive: push back on weak ideas with kindness; never function as a yes-machine.
20
- - Save the one-pager to `docs/ideas/[idea-name].md` **only after** the user explicitly confirms; never write to disk silently.
20
+ - Save the one-pager to `docs/ideas/[idea-name].md` **only after** the user explicitly confirms the direction; never write to disk silently.
21
21
  - When invoked inside a codebase, ground variations in real files/patterns via `Glob` / `Grep` / `Read`; do not invent architecture that ignores existing constraints.
22
22
 
23
- Refines raw ideas into sharp, actionable concepts worth building through
24
- structured divergent and convergent thinking.
25
-
26
- ## How It Works
27
-
28
- 1. **Understand & Expand (Divergent):** Restate the idea, ask sharpening
29
- questions, and generate variations.
30
- 2. **Evaluate & Converge (Grill):** Cluster the resonant directions, then
31
- walk each unresolved decision branch — one question at a time, with a
32
- recommended answer — until no branches remain.
33
- 3. **Sharpen & Ship:** Produce a concrete markdown one-pager moving work
34
- forward.
35
-
36
23
  ## Activation
37
24
 
38
25
  Called from [`/plan`](../../../workflows/plan.md) during ideation when the
39
- operator supplies `--seed "<text>"` (or runs ideation with no seed and
40
- the host collects one interactively). The skill sharpens freeform intent
41
- into canonical planning sections that `/plan` then folds into a Story.
42
- There is no separate Epic Clarity Gate path in v2 — N=1 Story authoring
43
- with a folded `## Spec` is the lean default.
44
-
45
- ## Usage
46
-
47
- This skill is primarily an interactive dialogue. Invoke it with an idea, and the
48
- agent will guide you through the process.
49
-
50
- ```bash
51
- # Optional: Initialize the ideas directory
52
- bash /mnt/skills/user/idea-refine/scripts/idea-refine.sh
53
- ```
54
-
55
- **Trigger Phrases:**
56
-
57
- - "Help me refine this idea"
58
- - "Ideate on [concept]"
59
- - "Stress-test my plan"
60
- - "Grill me on this"
61
- - "Walk me through the decision tree"
62
-
63
- ## Output
64
-
65
- The final output is a markdown one-pager saved to `docs/ideas/[idea-name].md`
66
- (after user confirmation), containing the five canonical planning sections:
67
-
68
- - Context (problem framing + current state)
69
- - Goal (desired outcome)
70
- - Non-Goals (explicit exclusions)
71
- - Scope (the in-scope MVP and how it tests the core assumption)
72
- - Acceptance Criteria (how we'll know it worked)
73
-
74
- Assumptions and open questions are recorded in the body of the relevant
75
- section (typically under Context or Scope) rather than carved into their
76
- own headings — the canonical five drive the `/plan` clarity gate.
26
+ operator supplies `--seed "<text>"` (or runs ideation with no seed and the host
27
+ collects one interactively). The skill sharpens freeform intent into the
28
+ canonical planning sections that `/plan` then folds into a Story. There is no
29
+ separate Epic Clarity Gate path in v2 — N=1 Story authoring with a folded
30
+ `## Spec` is the lean default.
77
31
 
78
32
  ## Detailed Instructions
79
33
 
@@ -88,7 +42,6 @@ actionable concepts worth building.
88
42
  - Say no to 1,000 things. Focus beats breadth.
89
43
  - Challenge every assumption. "How it's usually done" is not a reason.
90
44
  - Show people the future — don't just give them better horses.
91
- - The parts you can't see should be as beautiful as the parts you can.
92
45
 
93
46
  ### Process
94
47
 
@@ -103,103 +56,75 @@ conversation, not a template.
103
56
  1. **Restate the idea** as a crisp "How Might We" problem statement. This forces
104
57
  clarity on what's actually being solved.
105
58
 
106
- 2. **Ask 3-5 sharpening questions** — no more. Focus on:
107
- - Who is this for, specifically?
108
- - What does success look like?
109
- - What are the real constraints (time, tech, resources)?
110
- - What's been tried before?
111
- - Why now?
112
-
113
- Use the `AskUserQuestion` tool to gather this input. Do NOT proceed until you
114
- understand who this is for and what success looks like.
115
-
116
- 3. **Generate 5-8 idea variations** using these lenses:
117
- - **Inversion:** "What if we did the opposite?"
118
- - **Constraint removal:** "What if budget/time/tech weren't factors?"
119
- - **Audience shift:** "What if this were for [different user]?"
120
- - **Combination:** "What if we merged this with [adjacent idea]?"
121
- - **Simplification:** "What's the version that's 10x simpler?"
122
- - **10x version:** "What would this look like at massive scale?"
123
- - **Expert lens:** "What would [domain] experts find obvious that outsiders
124
- wouldn't?"
125
-
126
- Push beyond what the user initially asked for. Create products people don't
127
- know they need yet. Pick the lens that fits the idea — don't run every one
128
- mechanically.
59
+ 2. **Ask 3-5 sharpening questions** — no more via the `AskUserQuestion` tool.
60
+ Focus on: who this is for specifically, what success looks like, the real
61
+ constraints (time, tech, resources), what's been tried, and why now. Do NOT
62
+ proceed until you understand who this is for and what success looks like.
63
+
64
+ 3. **Generate 5-8 idea variations** using lenses that fit the idea — inversion,
65
+ constraint removal, audience shift, combination, simplification, 10x
66
+ version, expert lens. Push beyond what the user initially asked for; each
67
+ variation should have a reason it exists, not just be a bullet point. Don't
68
+ run every lens mechanically.
129
69
 
130
70
  **If running inside a codebase:** Use `Glob`, `Grep`, and `Read` to scan for
131
71
  relevant context — existing architecture, patterns, constraints, prior art.
132
- Ground your variations in what actually exists. Reference specific files and
133
- patterns when relevant.
72
+ Ground your variations in what actually exists, and reference specific files
73
+ when relevant.
134
74
 
135
75
  #### Phase 2: Evaluate & Converge (Grill)
136
76
 
137
- After the user reacts to Phase 1 (indicates which ideas resonate, pushes back,
138
- adds context), shift to convergent mode. The job here is not just to *list*
139
- open questions it is to **resolve** them, one at a time, before anything
140
- lands in the Phase 3 one-pager.
77
+ After the user reacts to Phase 1, shift to convergent mode. The job here is not
78
+ just to *list* open questions it is to **resolve** them, one at a time,
79
+ before anything lands in the Phase 3 one-pager.
141
80
 
142
- > **Off-ramp.** Before starting the grill loop, restate the chosen direction
143
- > in one sentence and check whether any decision branches remain unresolved.
144
- > If the idea is already crisply scoped — target user clear, MVP boundary
145
- > obvious, no architectural forks, no hidden assumptions — skip directly to
146
- > Phase 3. Don't grill trivial ideas for the sake of process.
81
+ > **Off-ramp.** Before starting the grill loop, restate the chosen direction in
82
+ > one sentence and check whether any decision branches remain unresolved. If the
83
+ > idea is already crisply scoped — target user clear, MVP boundary obvious, no
84
+ > architectural forks, no hidden assumptions — skip directly to Phase 3. Don't
85
+ > grill trivial ideas for the sake of process.
147
86
 
148
- 1. **Cluster** the ideas that resonated into 2-3 distinct directions. Each
149
- direction should feel meaningfully different, not just variations on a
150
- theme. Get the user's pick (or a tentative lean) before enumerating
151
- branches — the grill loop runs against the *chosen* direction, not the
152
- full set.
87
+ 1. **Cluster** the ideas that resonated into 2-3 distinct directions. Get the
88
+ user's pick (or a tentative lean) before enumerating branches — the grill
89
+ loop runs against the *chosen* direction, not the full set.
153
90
 
154
91
  2. **Enumerate open branches.** List every unresolved decision the chosen
155
- direction depends on. Use the stress-test rubric and the assumption
156
- surfaces below as your source material:
157
-
158
- - **User value branches.** Who benefits and how much? Painkiller or
159
- vitamin? Which segment first?
160
- - **Feasibility branches.** Technical/resource cost. Hardest part. Build
161
- vs. buy. Sequencing.
162
- - **Differentiation branches.** What makes this genuinely different?
163
- Why would someone switch?
164
- - **Hidden assumptions.** What you're betting is true (but haven't
165
- validated). What could kill this. What you're choosing to ignore (and
166
- why that's okay for now).
167
-
168
- Read `refinement-criteria.md` in this skill directory for the full
169
- evaluation rubric. Treat each unresolved item as a branch to grill on.
170
- If the list is empty after enumeration, take the off-ramp.
92
+ direction depends on: user-value branches (who benefits, painkiller vs.
93
+ vitamin), feasibility branches (cost, hardest part, build vs. buy,
94
+ sequencing), differentiation branches (why switch), and hidden assumptions
95
+ (what you're betting is true, what could kill this, what you're ignoring and
96
+ why that's okay for now). Read `refinement-criteria.md` in this skill
97
+ directory for the full evaluation rubric. If the list is empty after
98
+ enumeration, take the off-ramp.
171
99
 
172
100
  3. **Interrogate sequentially.** For each branch, in priority order
173
101
  (highest-leverage / most blocking first):
174
102
 
175
103
  - Pose **one** question at a time. Never batch.
176
- - State your **recommended answer** with a one-line rationale grounded
177
- in what the user has already told you, the codebase if you're inside
178
- one, or first-principles reasoning. The recommendation is a forcing
179
- function — accepting it should be the easy path; the user pushes back
180
- only when they actually disagree.
181
- - Use the `AskUserQuestion` tool so the recommendation surfaces as the
182
- first option.
104
+ - State your **recommended answer** with a one-line rationale grounded in
105
+ what the user has told you, the codebase if you're inside one, or
106
+ first-principles reasoning. The recommendation is a forcing function —
107
+ accepting it should be the easy path; the user pushes back only when they
108
+ actually disagree.
109
+ - Use `AskUserQuestion` so the recommendation surfaces as the first option.
183
110
  - **Wait for the response** (accept, modify, or reject) before moving on.
184
111
  Record the resolution inline so it's available when you author Phase 3.
185
112
 
186
113
  4. **Re-enumerate after each answer.** A resolved branch may collapse other
187
- branches (a "build" decision moots the "buy" follow-ups) or expand the
188
- tree (a new constraint surfaces fresh forks). Don't pre-compute the full
189
- question list — re-derive it after each answer and pick the next
190
- highest-leverage branch.
114
+ branches (a "build" decision moots the "buy" follow-ups) or expand the tree
115
+ (a new constraint surfaces fresh forks). Re-derive the list after each
116
+ answer and pick the next highest-leverage branch.
191
117
 
192
118
  5. **Stop condition.** Phase 2 ends when no branches remain unresolved.
193
- Resolutions feed directly into the Phase 3 one-pager: confirmed bets
194
- land in the **Context** section with their validation strategy
195
- inline; rejected branches become **Non-Goals** entries with the
196
- reason; chosen scope becomes the **Scope** section; verifiable
197
- outcomes from the resolved decisions become **Acceptance Criteria**.
119
+ Resolutions feed the Phase 3 one-pager: confirmed bets land in **Context**
120
+ with their validation strategy inline; rejected branches become **Non-Goals**
121
+ entries with the reason; chosen scope becomes the **Scope** section;
122
+ verifiable outcomes become **Acceptance Criteria**. A branch consciously
123
+ deferred rather than resolved records the deferral reason.
198
124
 
199
- **Be honest, not supportive.** If an idea is weak, say so with kindness. A
200
- good ideation partner is not a yes-machine. Push back on complexity,
201
- question real value, and point out when the emperor has no clothes — and do
202
- it inside the grill loop, not after the one-pager is already written.
125
+ **Be honest, not supportive.** If an idea is weak, say so with kindness. Push
126
+ back on complexity, question real value, and point out when the emperor has no
127
+ clothes inside the grill loop, not after the one-pager is written.
203
128
 
204
129
  > The Phase 2 interrogation discipline is inspired by Matt Pocock's
205
130
  > [`grill-me`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md)
@@ -208,43 +133,39 @@ it inside the grill loop, not after the one-pager is already written.
208
133
 
209
134
  #### Phase 3: Sharpen & Ship
210
135
 
211
- Produce a concrete artifact — a markdown one-pager that moves work forward.
212
- The five canonical headings below match `.agents/templates/epic-from-idea.md`
213
- and the `/plan` clarity gate; emit them verbatim so the renderer can
214
- substitute the body into a `/plan` Story seed without translation.
136
+ Produce a markdown one-pager that moves work forward. The five canonical
137
+ headings below match `.agents/templates/epic-from-idea.md` and the `/plan`
138
+ clarity gate; emit them verbatim so the renderer can substitute the body into a
139
+ `/plan` Story seed without translation.
215
140
 
216
141
  ```markdown
217
142
  # [Idea Name]
218
143
 
219
144
  ## Context
220
145
 
221
- [One-sentence "How Might We" framing followed by the current-state pain
222
- or motivation in 1-2 short paragraphs. Surface the key assumptions you
223
- are betting on inline — assumptions live here, not in a separate
224
- heading.]
146
+ [One-sentence "How Might We" framing followed by the current-state pain or
147
+ motivation in 1-2 short paragraphs. Surface the key assumptions you are betting
148
+ on inline — assumptions live here, not in a separate heading.]
225
149
 
226
150
  ## Goal
227
151
 
228
- [The chosen direction and the outcome it produces — 2-3 paragraphs max.
229
- Frame in terms of the end-state the user reaches, not the implementation
230
- path.]
152
+ [The chosen direction and the outcome it produces — 2-3 paragraphs max. Frame in
153
+ terms of the end-state the user reaches, not the implementation path.]
231
154
 
232
155
  ## Non-Goals
233
156
 
234
157
  - [Thing 1] — [reason]
235
158
  - [Thing 2] — [reason]
236
- - [Thing 3] — [reason]
237
159
 
238
160
  ## Scope
239
161
 
240
- [The minimum version that tests the core assumption. What's in, what's
241
- out, and how it sequences into stories.]
162
+ [The minimum version that tests the core assumption. What's in, what's out, and
163
+ how it sequences into stories.]
242
164
 
243
165
  ## Acceptance Criteria
244
166
 
245
167
  - [ ] [Verifiable outcome 1 — phrased so a reviewer can check it]
246
168
  - [ ] [Verifiable outcome 2]
247
- - [ ] [Verifiable outcome 3]
248
169
 
249
170
  ## Open Questions
250
171
 
@@ -257,55 +178,8 @@ saying no to good ideas. Make the trade-offs explicit.
257
178
  Ask the user if they'd like to save this to `docs/ideas/[idea-name].md` (or a
258
179
  location of their choosing). Only save if they confirm.
259
180
 
260
- ### Anti-patterns to Avoid
261
-
262
- - **Don't generate 20+ ideas.** Quality over quantity. 5-8 well-considered
263
- variations beat 20 shallow ones.
264
- - **Don't be a yes-machine.** Push back on weak ideas with specificity and
265
- kindness.
266
- - **Don't skip "who is this for."** Every good idea starts with a person and
267
- their problem.
268
- - **Don't produce a plan without surfacing assumptions.** Untested assumptions
269
- are the #1 killer of good ideas.
270
- - **Don't over-engineer the process.** Three phases, each doing one thing well.
271
- Resist adding steps.
272
- - **Don't just list ideas — tell a story.** Each variation should have a reason
273
- it exists, not just be a bullet point.
274
- - **Don't ignore the codebase.** If you're in a project, the existing
275
- architecture is a constraint and an opportunity. Use it.
276
-
277
181
  ### Tone
278
182
 
279
183
  Direct, thoughtful, slightly provocative. You're a sharp thinking partner, not a
280
184
  facilitator reading from a script. Channel the energy of "that's interesting,
281
- but what if..." -- always pushing one step further without being exhausting.
282
-
283
- ## Red Flags
284
-
285
- - Generating 20+ shallow variations instead of 5-8 considered ones
286
- - Skipping the "who is this for" question
287
- - No assumptions surfaced before committing to a direction
288
- - Yes-machining weak ideas instead of pushing back with specificity
289
- - Producing a plan without a "Non-Goals" list
290
- - Ignoring existing codebase constraints when ideating inside a project
291
- - Jumping straight to Phase 3 output without running Phases 1 and 2
292
- - Batching grill-loop questions (asking 3+ at once) instead of one at a time
293
- - Posing grill questions without a recommended answer — the recommendation
294
- is the forcing function, not optional
295
- - Carrying unresolved branches into the Phase 3 one-pager (assumptions are
296
- fine; *unresolved decisions* are not)
297
-
298
- ## Verification
299
-
300
- After completing an ideation session:
301
-
302
- - [ ] A clear "How Might We" problem statement exists
303
- - [ ] The target user and success criteria are defined
304
- - [ ] Multiple directions were explored, not just the first idea
305
- - [ ] Hidden assumptions are explicitly listed with validation strategies
306
- - [ ] Every open decision branch was either resolved in the grill loop or
307
- consciously deferred (with the deferral reason recorded)
308
- - [ ] A "Non-Goals" list makes trade-offs explicit
309
- - [ ] The output is a concrete artifact (markdown one-pager), not just
310
- conversation
311
- - [ ] The user confirmed the final direction before any implementation work
185
+ but what if" always pushing one step further without being exhausting.
@@ -4,52 +4,36 @@ description:
4
4
  Hardens code against vulnerabilities. Use when handling user input,
5
5
  authentication, data storage, or external integrations. The non-negotiable
6
6
  security MUSTs live in `.agents/rules/security-baseline.md`; this skill shows
7
- how to apply them with code patterns, decision trees, and review checklists.
7
+ how to apply them with process guidance, an audit-triage tree, and a review
8
+ checklist.
8
9
  ---
9
10
 
10
11
  # Security and Hardening
11
12
 
12
13
  ## Policy Capsule
13
14
 
14
- - The non-negotiable MUSTs live in `.agents/rules/security-baseline.md`; that rule wins on conflict. Open a PR against the rule rather than working around it in this skill.
15
- - Validate ALL client input (body, query, headers, path params) at the edge with a strict schema (e.g., Zod). Never trust client-side validation as a security boundary.
16
- - Parameterize every database query. Never concatenate user input into SQL/NoSQL filters or shell commands.
17
- - Hash passwords with bcrypt (≥12 rounds), scrypt, or argon2; plaintext storage is forbidden. Session cookies MUST be `httpOnly`, `secure`, and carry an explicit `sameSite`. Never put auth tokens in `localStorage`/`sessionStorage`.
18
- - Every protected endpoint checks **authorization**, not just authentication; verify resource ownership server-side before any state change and never trust client-asserted roles.
19
- - Encode HTML output via the framework's auto-escaping; sanitize any unavoidable raw HTML with a vetted library (e.g., DOMPurify). Never feed user data to `eval()`, `Function()`, or `innerHTML`/`dangerouslySetInnerHTML` unsanitized.
20
- - Exclude sensitive fields (password hashes, reset tokens, internal IDs) from API responses and never expose stack traces or internal error details to clients.
21
- - Never log PII (emails, full credit cards, session tokens, phone numbers). Destructure safe properties; don't log whole objects.
22
- - Configure security headers (`Content-Security-Policy`, `Strict-Transport-Security`, `X-Frame-Options`, `X-Content-Type-Options`) and restrict CORS to an explicit allowlist — wildcard `*` is forbidden on credentialed endpoints.
23
- - Pull all secrets from environment variables; never commit `.env`, default API keys, or fallback secrets. `.env.example` (placeholders only) is the committed shape.
24
- - Surface security-expanding changes (new auth flows, new PII categories, new integrations, CORS / rate-limit changes, file uploads, elevated permissions) under a "Security surface" section in the PR body and on the ticket, label `risk::high`, and link the relevant baseline MUST. This documents the surface — it does not pause execution. `agent::blocked` is only for unrecoverable runtime blockers.
15
+ - The non-negotiable security MUSTs — input validation, authentication, authorization, output/rendering, data-leakage & logging, transport & headers, secrets, dependency hygiene, and forbidden practices — live in [`.agents/rules/security-baseline.md`](../../../rules/security-baseline.md); that rule is the SSOT and wins on conflict. Read it for the **what**; this skill is the **how** and the process.
16
+ - Do **not** restate a baseline MUST here or work around one in code — open a PR against the rule instead. The baseline is inviolable ([`instructions.md` § 1.K](../../../instructions.md)); no skill relaxes it.
17
+ - Surface security-expanding changes new auth flows, new PII categories, new external integrations, CORS / rate-limit changes, file uploads, elevated permissions — under a "Security surface" section in the PR body and on the ticket, label the change `risk::high`, and link the relevant baseline MUST.
18
+ - Surfacing **documents** the surface; it does **not** pause execution. `agent::blocked` is the only runtime pause label, reserved for unrecoverable blockers never for "this change is sensitive."
19
+ - For validation-error responses (status code and envelope), cite [`.agents/rules/api-conventions.md`](../../../rules/api-conventions.md) validation failures return **400** `VALIDATION_ERROR` in the canonical envelope. Do not carry a divergent inline status here.
20
+ - Open a `reference.md` section only when the task actually engages it (index below).
25
21
 
26
- The non-negotiable MUSTs input validation, authentication, authorization,
27
- output encoding, transport, headers, secrets, forbidden practices — live in
28
- [`.agents/rules/security-baseline.md`](../../../rules/security-baseline.md),
29
- which is the SSOT. This skill shows **how** to apply those MUSTs with code
30
- patterns and process guidance; read the rule for the **what**. When the rule
31
- and this skill diverge, the rule wins — open a PR against the rule rather
32
- than working around it here.
22
+ The MUSTs themselves are the SSOT in
23
+ [`security-baseline.md`](../../../rules/security-baseline.md). When the rule and
24
+ this skill diverge, the rule wins.
33
25
 
34
26
  ## Long-form reference — read on demand
35
27
 
36
28
  The capsule above is the contract and the whole always-read surface of this
37
- skill. The long-form material behind it patterns, worked examples,
38
- checklists, and rationalizations lives in the on-demand sibling
39
- [`reference.md`](reference.md), matching the split the always-on rules already
29
+ skill. The project-specific process material behind it lives in the on-demand
30
+ sibling [`reference.md`](reference.md), matching the split the always-on rules
40
31
  use ([`rules/git-conventions.md`](../../../rules/git-conventions.md) ⇄
41
32
  [`git-conventions-reference.md`](../../../rules/git-conventions-reference.md)).
42
33
  Activating this skill costs the capsule; open a section below only when the
43
- task actually engages it.
34
+ task engages it.
44
35
 
45
- - [When to Use](reference.md#when-to-use)
46
36
  - [Security Surfacing, Not Runtime Pause](reference.md#security-surfacing-not-runtime-pause)
47
- - [OWASP Top 10 Prevention Patterns](reference.md#owasp-top-10-prevention-patterns)
48
- - [Input Validation Patterns](reference.md#input-validation-patterns)
37
+ - [Validation-Error Responses](reference.md#validation-error-responses)
49
38
  - [Triaging npm audit Results](reference.md#triaging-npm-audit-results)
50
- - [Rate Limiting](reference.md#rate-limiting)
51
- - [Secrets Management Layout](reference.md#secrets-management-layout)
52
39
  - [Security Review Checklist](reference.md#security-review-checklist)
53
- - [Common Rationalizations](reference.md#common-rationalizations)
54
- - [Red Flags](reference.md#red-flags)
55
- - [Verification](reference.md#verification)