@brunosps00/dev-workflow 0.13.0 → 0.15.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.
- package/README.md +9 -3
- package/package.json +1 -1
- package/scaffold/en/commands/dw-bugfix.md +2 -1
- package/scaffold/en/commands/dw-code-review.md +1 -0
- package/scaffold/en/commands/dw-create-tasks.md +6 -0
- package/scaffold/en/commands/dw-deps-audit.md +1 -1
- package/scaffold/en/commands/dw-fix-qa.md +1 -1
- package/scaffold/en/commands/dw-functional-doc.md +1 -1
- package/scaffold/en/commands/dw-help.md +1 -1
- package/scaffold/en/commands/dw-redesign-ui.md +1 -1
- package/scaffold/en/commands/dw-run-qa.md +2 -1
- package/scaffold/en/commands/dw-run-task.md +1 -1
- package/scaffold/pt-br/commands/dw-bugfix.md +2 -1
- package/scaffold/pt-br/commands/dw-code-review.md +1 -0
- package/scaffold/pt-br/commands/dw-create-tasks.md +6 -0
- package/scaffold/pt-br/commands/dw-deps-audit.md +1 -1
- package/scaffold/pt-br/commands/dw-fix-qa.md +1 -1
- package/scaffold/pt-br/commands/dw-functional-doc.md +1 -1
- package/scaffold/pt-br/commands/dw-help.md +1 -1
- package/scaffold/pt-br/commands/dw-redesign-ui.md +1 -1
- package/scaffold/pt-br/commands/dw-run-qa.md +2 -1
- package/scaffold/pt-br/commands/dw-run-task.md +1 -1
- package/scaffold/skills/dw-incident-response/SKILL.md +164 -0
- package/scaffold/skills/dw-incident-response/references/blameless-discipline.md +126 -0
- package/scaffold/skills/dw-incident-response/references/communication-templates.md +107 -0
- package/scaffold/skills/dw-incident-response/references/postmortem-template.md +133 -0
- package/scaffold/skills/dw-incident-response/references/runbook-templates.md +169 -0
- package/scaffold/skills/dw-incident-response/references/severity-and-triage.md +186 -0
- package/scaffold/skills/dw-llm-eval/SKILL.md +148 -0
- package/scaffold/skills/dw-llm-eval/references/agent-eval.md +252 -0
- package/scaffold/skills/dw-llm-eval/references/judge-calibration.md +169 -0
- package/scaffold/skills/dw-llm-eval/references/oracle-ladder.md +171 -0
- package/scaffold/skills/dw-llm-eval/references/rag-metrics.md +186 -0
- package/scaffold/skills/dw-llm-eval/references/reference-dataset.md +190 -0
- package/scaffold/skills/dw-testing-discipline/SKILL.md +99 -76
- package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +170 -0
- package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +6 -6
- package/scaffold/skills/dw-testing-discipline/references/core-rules.md +128 -0
- package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +2 -2
- package/scaffold/skills/dw-ui-discipline/SKILL.md +101 -79
- package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +93 -73
- package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +152 -0
- package/scaffold/skills/dw-testing-discipline/references/ai-agent-gates.md +0 -170
- package/scaffold/skills/dw-testing-discipline/references/iron-laws.md +0 -128
- package/scaffold/skills/dw-ui-discipline/references/anti-slop.md +0 -162
- /package/scaffold/skills/dw-testing-discipline/references/{positive-patterns.md → patterns.md} +0 -0
package/README.md
CHANGED
|
@@ -269,8 +269,10 @@ These are not slash commands — they are primitives other commands call to enfo
|
|
|
269
269
|
|
|
270
270
|
| Skill | Description | Source | License |
|
|
271
271
|
|-------|-------------|--------|---------|
|
|
272
|
-
| **dw-ui-discipline** | UI doctrine: 4
|
|
273
|
-
| **dw-testing-discipline** | Testing doctrine:
|
|
272
|
+
| **dw-ui-discipline** | UI doctrine: 4 grounding questions (design source, surface job, state matrix, who/where/light/mood), 14 visual-slop patterns + 17 anti-defaults, WCAG 2.2 AA floor with verification recipes, 10 curated palette/font defaults for bootstrap | dev-workflow (original work) | MIT |
|
|
273
|
+
| **dw-testing-discipline** | Testing doctrine: six core rules, 12 positive patterns, 25 anti-patterns across 4 families (fragile/non-deterministic/mock-driven/suite-hygiene), 6 mandatory agent guardrails, flaky discipline + SLOs, Playwright recipes, browser security-boundary patterns | dev-workflow (original work) + browser-DevTools patterns from [`addyosmani/agent-skills`](https://github.com/addyosmani/agent-skills) | MIT |
|
|
274
|
+
| **dw-incident-response** | Five-phase incident workflow (triage → investigation → resolution → communication → postmortem) with checkpoints and structured outputs to `.dw/incidents/`. Severity classification (SEV-1..4), runbook templates, on-call handoff, blameless postmortem template, action-item quality bar. | [wilsto/claude-code-starter-kit](https://github.com/wilsto/claude-code-starter-kit) (MIT, credits `wshobson/agents` v1.3.0) | MIT |
|
|
275
|
+
| **dw-llm-eval** | LLM/AI evaluation doctrine: five-rung oracle ladder (exact → schema → outcome → LLM-as-judge → human), judge calibration (Spearman ≥0.80 against humans), reference-dataset principle (20 from real failures > 200 synthetic), RAG metrics (precision@k + faithfulness + utilization), agent eval (outcome-vs-trajectory + 4 trajectory match modes) | Trajectory match modes from [`langchain-ai/agentevals`](https://github.com/langchain-ai/agentevals) (MIT); other patterns distilled from open evaluations literature | MIT |
|
|
274
276
|
| **vercel-react-best-practices** | 67 React/Next.js performance optimization rules across 8 priority categories. Wraps the rules with `references/perf-discipline.md` (measure → identify → fix → verify → guard) so perf work is data-driven, not vibes-based | [Vercel Labs](https://github.com/vercel-labs/agent-skills) + [`addyosmani/agent-skills`](https://github.com/addyosmani/agent-skills) | MIT |
|
|
275
277
|
| **security-review** | Systematic vulnerability review based on OWASP with confidence-based reporting | [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/) | CC BY-SA 4.0 |
|
|
276
278
|
| **humanizer** | Detects and removes 24 AI writing patterns based on Wikipedia's "Signs of AI Writing" guide | [Wikipedia AI Writing Guide](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) | -- |
|
|
@@ -318,7 +320,11 @@ Source-driven development, code simplification, debugging discipline, and git wo
|
|
|
318
320
|
|
|
319
321
|
Spec-Driven Development patterns — declarative constitution (`.dw/constitution.md`), cross-artifact consistency check (PRD ↔ TechSpec ↔ Tasks), and template override layer (`.dw/templates/overrides/`) — adapted from [`github/spec-kit`](https://github.com/github/spec-kit) by GitHub (MIT). dev-workflow specifics: embedded into existing commands instead of new slash commands, severity-graded enforcement (`info`/`high`/`critical`) with ADR-justified deviation as the escape hatch, ausência-of-constitution never blocks (auto-installs defaults and continues), and integration with the analytical `.dw/rules/` already produced by `/dw-analyze-project`.
|
|
320
322
|
|
|
321
|
-
UI discipline (
|
|
323
|
+
UI discipline (`dw-ui-discipline`) and testing doctrine (`dw-testing-discipline`) are original works in this repository. Earlier dev-workflow versions (≤0.13.x) drew on `pedronauck/skills` `ui-craft` and `testing-boss` as inspiration, but in v0.14.0 those skills were rewritten clean-room after a license audit confirmed that the upstream repo has no explicit LICENSE file at root — the README's MIT claim is unverified. The underlying ideas (grounding before design; behavior over mocks; mutation over coverage) are widely-documented general software engineering principles available in many sources (Beck, Fowler, Meszaros, Feathers, Google SRE Book, WCAG specifications). Browser-DevTools patterns from [`addyosmani/agent-skills`](https://github.com/addyosmani/agent-skills) (MIT) live inside `dw-testing-discipline/references/` (`security-boundary.md`, `three-workflow-patterns.md`).
|
|
324
|
+
|
|
325
|
+
Incident response (`dw-incident-response`) adapted from [`wilsto/claude-code-starter-kit/incident-response`](https://github.com/wilsto/claude-code-starter-kit) (MIT). The 5-phase workflow structure and runbook templates come from there. wilsto credits the upstream `wshobson/agents` plugin `incident-response` (v1.3.0); attribution chain preserved. Additional reading cited in the skill: Google SRE Book, Etsy Debriefing Facilitation Guide, PagerDuty Incident Response Documentation.
|
|
326
|
+
|
|
327
|
+
LLM evaluation (`dw-llm-eval`) trajectory-match modes (strict / unordered / subset / superset) and tool-argument matching strategies adapted from [`langchain-ai/agentevals`](https://github.com/langchain-ai/agentevals) (MIT). The broader oracle-ladder framing, judge-calibration discipline, and reference-dataset principle are distilled from the open evaluations literature (OpenAI evals cookbook, Anthropic evals guidance, the academic eval-of-LLM body of work) and rewritten in our voice.
|
|
322
328
|
|
|
323
329
|
## Migration from v0.12.x
|
|
324
330
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brunosps00/dev-workflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "AI-driven development workflow commands for any project. Scaffolds a complete PRD-to-PR pipeline with multi-platform AI assistant support.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dev-workflow": "./bin/dev-workflow.js"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
- `dw-debug-protocol`: **ALWAYS** — runs the bug through the six-step triage (Reproduce → Localize → Reduce → Fix Root Cause → Guard → Verify End-to-End). Stop-the-line discipline; root-cause over symptom; regression test committed in the same atomic commit. Non-reproducible bugs follow the instrument-first sub-protocol — no guess fixes without explicit acknowledgement.
|
|
19
19
|
- `dw-verify`: **ALWAYS** — in Direct mode, invoked before committing the fix. The VERIFICATION REPORT must show the original bug symptom no longer reproduces (not just that tests pass).
|
|
20
20
|
- `vercel-react-best-practices`: use when the bug affects React/Next.js and there is suspicion of render, hydration, fetching, waterfall, bundle, or re-render issues
|
|
21
|
-
- `dw-testing-discipline`: use when the fix requires a reproducible E2E/retest flow in a web app — `references/playwright-recipes.md` for recipes,
|
|
21
|
+
- `dw-testing-discipline`: use when the fix requires a reproducible E2E/retest flow in a web app — `references/playwright-recipes.md` for recipes, core rules + 6 agent guardrails for any test the fix adds, flaky-discipline if the bug surfaces intermittently.
|
|
22
|
+
- `dw-incident-response`: use when the bug has severity `critical` AND affects production AND was detected by alert/user-report (i.e., the bug IS an incident, not a backlog item). Triggers the 5-phase workflow (triage → investigation → resolution → communication → postmortem) with structured output in `.dw/incidents/`. Fixes ride on `/dw-bugfix` per the incident's resolution phase.
|
|
22
23
|
- `security-review`: use when the root cause touches auth, authorization, external input, upload, secrets, SQL, XSS, SSRF, or other sensitive surfaces
|
|
23
24
|
|
|
24
25
|
## Input Variables
|
|
@@ -27,6 +27,7 @@ When available in the project under `./.agents/skills/`, use these skills as ana
|
|
|
27
27
|
- `dw-simplification`: use when the diff touches dense or twisty code — applies Chesterton's Fence (understand WHY before flagging removal), behavior-preserving refactor protocol (test gate before/after), and complexity metrics (cyclomatic, cognitive, depth, fan-out) so that "simplify this" findings are concrete, not vibes-based.
|
|
28
28
|
- `security-review`: use when auth, authorization, external input, upload, SQL, external integration, secrets, SSRF, XSS, or sensitive surfaces are present
|
|
29
29
|
- `vercel-react-best-practices`: use when the diff touches React/Next.js to review rendering, fetching, bundle, hydration, and performance patterns
|
|
30
|
+
- `dw-llm-eval`: **REQUIRED when the diff touches AI/LLM feature code paths** (chat handlers, RAG, classifiers, agents, prompt templates). The PR must include: (1) reference dataset path under `.dw/eval/datasets/<feature>/`, (2) at least 2 oracle rungs covering the feature, lower rungs FIRST (rung 1-3 before rung 4), (3) judge-calibration evidence if rung 4 is used (Spearman ≥0.80 against humans), (4) eval run results on the touched code path. Missing any of these → **REJECTED**.
|
|
30
31
|
|
|
31
32
|
## Codebase Intelligence
|
|
32
33
|
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
## Pipeline Position
|
|
9
9
|
**Predecessor:** `/dw-create-techspec` | **Successor:** `/dw-run-task` or `/dw-run-plan`
|
|
10
10
|
|
|
11
|
+
## Complementary Skills
|
|
12
|
+
|
|
13
|
+
When available in the project under `./.agents/skills/`, use these skills as planning support:
|
|
14
|
+
|
|
15
|
+
- `dw-llm-eval`: **REQUIRED when the PRD describes an AI / LLM feature** (chat, RAG, summarization, classifier, agent, tool-use, structured extraction). Add a mandatory "Eval Plan" subtask to one of the generated tasks — the subtask defines (a) the reference dataset path, (b) which oracle rungs (1-5) apply, (c) judge-calibration evidence if rung 4 is used, (d) target metrics per rung. Failing to add an eval-plan subtask for an AI feature is caught by the final consistency check.
|
|
16
|
+
|
|
11
17
|
## Prerequisites
|
|
12
18
|
|
|
13
19
|
The feature you will work on is identified by this slug:
|
|
@@ -31,7 +31,7 @@ This command is **distinct** from `/dw-security-check`:
|
|
|
31
31
|
| `security-review` (`references/supply-chain.md`) | **ALWAYS** when classifying findings — gives OWASP A06 (Vulnerable & Outdated Components) framing for the brainstorm trade-offs |
|
|
32
32
|
| `dw-source-grounding` | **ALWAYS** in the brainstorm phase — each per-package update option (Conservative/Balanced/Bold) cites the official changelog/release notes for the target version: `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`. Catches "agent recommends v5 because it sounds modern, but v5 dropped Node 18 support" errors. |
|
|
33
33
|
| `dw-council` | Auto opt-in when ≥3 packages land in tier COMPROMISED — multi-advisor stress-test on remediation order and scope |
|
|
34
|
-
| `dw-testing-discipline` | Optional — when the scoped test phase needs Playwright recipes for frontend projects.
|
|
34
|
+
| `dw-testing-discipline` | Optional — when the scoped test phase needs Playwright recipes for frontend projects. core rules + anti-patterns apply to any test added during the audit. |
|
|
35
35
|
|
|
36
36
|
## Input Variables
|
|
37
37
|
|
|
@@ -20,7 +20,7 @@ When available in the project under `./.agents/skills/`, use these skills as ope
|
|
|
20
20
|
|
|
21
21
|
- `dw-debug-protocol`: **ALWAYS** — every bug-shaped finding (failing scenario, not missing feature) flows through the six-step triage. The retest evidence is the step-6 verification artifact; the regression test added in step 5 is what allows `Fixed` status to stick.
|
|
22
22
|
- `dw-verify`: **ALWAYS** — invoked before marking any bug as `Fixed` or `Closed` in `QA/bugs.md`. Without a VERIFICATION REPORT PASS (test + lint + build) **and** retest evidence (screenshot in UI mode OR JSONL log line in API mode), status stays `Reopened` or `Under review`.
|
|
23
|
-
- `dw-testing-discipline`: (UI mode) consult `references/playwright-recipes.md` for retest structures, captures, scripts. Apply
|
|
23
|
+
- `dw-testing-discipline`: (UI mode) consult `references/playwright-recipes.md` for retest structures, captures, scripts. Apply core rules + flaky discipline when retesting bug fixes — quarantine and SLOs from the doctrine apply.
|
|
24
24
|
- `vercel-react-best-practices`: (UI mode) use only if the fix affects React/Next.js frontend and there is risk of rendering, hydration, fetching, or performance regression
|
|
25
25
|
- `api-testing-recipes`: **(API mode — ALWAYS)** source of the recipe used at QA time. Re-execute the original `.http`/pytest/supertest/etc. file for the bug's RF; append the retest result to a fresh JSONL log under `QA/logs/api/BUG-NN-retest.log`
|
|
26
26
|
|
|
@@ -55,7 +55,7 @@ Works best with project analyzed by `/dw-analyze-project`
|
|
|
55
55
|
|
|
56
56
|
When available in the project under `./.agents/skills/`, use these skills as operational support without replacing this command as source of truth:
|
|
57
57
|
|
|
58
|
-
- `dw-testing-discipline`: support for structuring E2E flows (`references/playwright-recipes.md`), evidence collection patterns, and applying
|
|
58
|
+
- `dw-testing-discipline`: support for structuring E2E flows (`references/playwright-recipes.md`), evidence collection patterns, and applying core rules + selector hierarchy to any test the doc references
|
|
59
59
|
- `remotion-best-practices`: mandatory support when there is a final human video, captions, composition, transitions, FFmpeg, or Remotion
|
|
60
60
|
- `humanizer`: mandatory support for reviewing and naturalizing all captions, `.srt` files, descriptive texts, and any human-facing writing before final delivery
|
|
61
61
|
- `dw-ui-discipline`: use when documenting visual patterns — the state matrix and scene sentence become part of each screen's overview section
|
|
@@ -185,7 +185,7 @@ Skills in `.agents/skills/` that commands above invoke transparently. You don't
|
|
|
185
185
|
|
|
186
186
|
| Skill | Invoked by | Role |
|
|
187
187
|
|-------|------------|------|
|
|
188
|
-
| `dw-verify` | run-task, run-plan, fix-qa, bugfix, code-review, generate-pr, quick |
|
|
188
|
+
| `dw-verify` | run-task, run-plan, fix-qa, bugfix, code-review, generate-pr, quick | core rule: no success claim without a PASS VERIFICATION REPORT |
|
|
189
189
|
| `dw-memory` | run-task, run-plan, autopilot, resume, revert-task | Two-tier workflow memory (shared + task-local) with promotion test |
|
|
190
190
|
| `dw-review-rigor` | code-review, review-implementation, refactoring-analysis | De-duplication, severity ordering, verify-intent-before-flag, signal-over-volume |
|
|
191
191
|
| `dw-council` | brainstorm `--council`, create-techspec `--council` | Multi-advisor debate (3-5 archetypes) with steel-manning, concession tracking, and dissent-preserving synthesis. Opt-in. |
|
|
@@ -42,7 +42,7 @@ When available in the project under `./.agents/skills/`, use these to guide the
|
|
|
42
42
|
|
|
43
43
|
- `dw-ui-discipline`: **REQUIRED** — runs the 4-checkpoint hard-gate (brand authorities OR curated defaults; surface job sentence; complete state matrix; scene sentence) BEFORE any design proposal. The 14 anti-slop patterns are checked against each proposed direction. The WCAG 2.2 AA floor is non-negotiable at the validate step.
|
|
44
44
|
- `vercel-react-best-practices`: use when the project is React/Next.js for performance and implementation patterns
|
|
45
|
-
- `dw-testing-discipline`: consult `references/playwright-recipes.md` for before/after screenshot capture and visual validation.
|
|
45
|
+
- `dw-testing-discipline`: consult `references/playwright-recipes.md` for before/after screenshot capture and visual validation. core rules + selector hierarchy apply to any tests generated alongside the redesign.
|
|
46
46
|
- `security-review`: use if the redesign touches authentication flows or sensitive forms
|
|
47
47
|
|
|
48
48
|
## Analysis Tools
|
|
@@ -20,10 +20,11 @@ You are an AI assistant specialized in Quality Assurance. Your task is to valida
|
|
|
20
20
|
|
|
21
21
|
When available in the project under `./.agents/skills/`, use these skills as operational support without replacing this command:
|
|
22
22
|
|
|
23
|
-
- `dw-testing-discipline`: (UI mode) **ALWAYS** —
|
|
23
|
+
- `dw-testing-discipline`: (UI mode) **ALWAYS** — core rules and 25 anti-patterns apply to every QA test authored. `references/playwright-recipes.md` for tactical patterns. `references/three-workflow-patterns.md` to pick the right verification mode (UI / network / perf). `references/security-boundary.md` for any flow that crosses an auth boundary.
|
|
24
24
|
- `vercel-react-best-practices`: (UI mode) use only if the frontend under test is React/Next.js and there is indication of regression related to rendering, fetching, hydration, or perceived performance
|
|
25
25
|
- `dw-ui-discipline`: (UI mode) use when validating design consistency — the anti-slop catalog and WCAG accessibility floor are checked as part of QA evidence
|
|
26
26
|
- `api-testing-recipes`: **(API mode — ALWAYS)** validated snippets for `.http`, pytest+httpx, supertest, WebApplicationFactory, reqwest. Composes per-RF test files in `QA/scripts/api/` and JSONL logs in `QA/logs/api/` per its references
|
|
27
|
+
- `dw-llm-eval`: **(AI mode — when invoked with `--ai`)** runs the reference dataset at `.dw/eval/datasets/<feature>/` against the current implementation. Computes precision@k / faithfulness / outcome accuracy per the feature type. Logs results as JSONL to `QA/logs/ai/<feature>-<date>.jsonl`. Compares against the prior run to detect regression; alerts when any metric drops >10% from baseline.
|
|
27
28
|
|
|
28
29
|
## Analysis Tools
|
|
29
30
|
|
|
@@ -21,7 +21,7 @@ When available in the project at `./.agents/skills/`, use these skills as specia
|
|
|
21
21
|
| `dw-verify` | **ALWAYS** — invoked before the commit to produce a Verification Report with fresh evidence |
|
|
22
22
|
| `dw-memory` | **ALWAYS** — reads workflow memory at task start and updates it at task end (promotion test) |
|
|
23
23
|
| `vercel-react-best-practices` | Task touches React rendering, hydration, data fetching, bundle, cache, or performance |
|
|
24
|
-
| `dw-testing-discipline` | Task needs tests (any layer) — applies
|
|
24
|
+
| `dw-testing-discipline` | Task needs tests (any layer) — applies core rules, 6 agent guardrails, anti-patterns catalog. Use `references/playwright-recipes.md` when the task has interactive frontend needing E2E validation. |
|
|
25
25
|
|
|
26
26
|
## Codebase Intelligence
|
|
27
27
|
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
- `dw-debug-protocol`: **SEMPRE** — conduz o bug pelo six-step triage (Reproduzir → Localizar → Reduzir → Fix Root Cause → Guardar → Verificar End-to-End). Stop-the-line discipline; root-cause sobre symptom; regression test commitado no mesmo commit atômico. Bugs não-reprodutíveis seguem o sub-protocolo instrument-first — sem fix por palpite a não ser com acknowledgement explícito.
|
|
19
19
|
- `dw-verify`: **SEMPRE** — em modo Direto, invocada antes do commit da correção. O VERIFICATION REPORT deve mostrar que o sintoma original do bug não se reproduz mais (não apenas que os testes passam).
|
|
20
20
|
- `vercel-react-best-practices`: use quando o bug afeta React/Next.js e há suspeita de problemas de render, hidratação, fetching, waterfall, bundle ou re-render
|
|
21
|
-
- `dw-testing-discipline`: use quando a correção requer fluxo E2E/reteste reproduzível em web app — `references/playwright-recipes.md` pra recipes,
|
|
21
|
+
- `dw-testing-discipline`: use quando a correção requer fluxo E2E/reteste reproduzível em web app — `references/playwright-recipes.md` pra recipes, core rules + 6 agent guardrails pra qualquer teste que o fix adicione, flaky-discipline se o bug aparece de forma intermitente.
|
|
22
|
+
- `dw-incident-response`: use quando o bug tem severidade `critical` E afeta produção E foi detectado por alerta/user-report (ou seja, o bug É um incident, não item de backlog). Dispara o workflow de 5 fases (triage → investigation → resolution → communication → postmortem) com saída estruturada em `.dw/incidents/`. As correções rodam via `/dw-bugfix` durante a fase de resolution.
|
|
22
23
|
- `security-review`: use quando a causa raiz toca auth, autorização, input externo, upload, secrets, SQL, XSS, SSRF ou outras superfícies sensíveis
|
|
23
24
|
|
|
24
25
|
## Variáveis de Entrada
|
|
@@ -27,6 +27,7 @@ Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como apo
|
|
|
27
27
|
- `dw-simplification`: use quando o diff toca código denso ou tortuoso — aplica Chesterton's Fence (entender POR QUÊ antes de propor remoção), protocolo de refactor preservando comportamento (test gate antes/depois) e métricas de complexidade (ciclomática, cognitiva, depth, fan-out) para que findings de "simplifique isso" sejam concretos, não opinativos.
|
|
28
28
|
- `security-review`: use quando auth, autorização, input externo, upload, SQL, integração externa, secrets, SSRF, XSS ou superfícies sensíveis estiverem presentes
|
|
29
29
|
- `vercel-react-best-practices`: use quando o diff tocar React/Next.js para revisar padrões de renderização, fetching, bundle, hidratação e performance
|
|
30
|
+
- `dw-llm-eval`: **OBRIGATÓRIO quando o diff toca código de feature AI/LLM** (handlers de chat, RAG, classifiers, agentes, templates de prompt). O PR deve incluir: (1) caminho do reference dataset em `.dw/eval/datasets/<feature>/`, (2) no mínimo 2 oracle rungs cobrindo a feature, rungs mais baixos PRIMEIRO (rung 1-3 antes de rung 4), (3) evidência de calibração do juiz se rung 4 for usado (Spearman ≥0.80 vs humanos), (4) resultados de eval run no path tocado. Faltando algum → **REPROVADO**.
|
|
30
31
|
|
|
31
32
|
## Inteligência do Codebase
|
|
32
33
|
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
## Posição no Pipeline
|
|
9
9
|
**Antecessor:** `/dw-create-techspec` | **Sucessor:** `/dw-run-task` ou `/dw-run-plan`
|
|
10
10
|
|
|
11
|
+
## Skills Complementares
|
|
12
|
+
|
|
13
|
+
Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como apoio de planejamento:
|
|
14
|
+
|
|
15
|
+
- `dw-llm-eval`: **OBRIGATÓRIO quando o PRD descreve uma feature AI / LLM** (chat, RAG, summarização, classifier, agente, tool-use, extração estruturada). Adicione uma subtask "Plano de Avaliação" obrigatória em uma das tasks geradas — a subtask define (a) caminho do reference dataset, (b) quais oracle rungs (1-5) se aplicam, (c) evidência de calibração do juiz se rung 4 for usado, (d) métricas-alvo por rung. Não adicionar subtask de eval-plan pra feature AI é pego pelo final consistency check.
|
|
16
|
+
|
|
11
17
|
## Pré-requisitos
|
|
12
18
|
|
|
13
19
|
A funcionalidade em que você trabalhará é identificada por este slug:
|
|
@@ -31,7 +31,7 @@ Este comando e **distinto** do `/dw-security-check`:
|
|
|
31
31
|
| `security-review` (`references/supply-chain.md`) | **SEMPRE** ao classificar findings — da o framing OWASP A06 (Vulnerable & Outdated Components) para os trade-offs do brainstorm |
|
|
32
32
|
| `dw-source-grounding` | **SEMPRE** na fase de brainstorm — cada opcao de update por pacote (Conservadora/Balanceada/Ousada) cita o changelog/release notes oficial da versao alvo: `[source: <url>, version: X.Y, retrieved: YYYY-MM-DD]`. Previne "agent recomenda v5 porque parece moderno, mas v5 dropou Node 18". |
|
|
33
33
|
| `dw-council` | Opt-in automatico quando >=3 pacotes caem em tier COMPROMISED — stress-test multi-conselheiro sobre ordem e escopo de remediacao |
|
|
34
|
-
| `dw-testing-discipline` | Opcional — quando a fase de testes escopados precisa de recipes Playwright pra projetos frontend.
|
|
34
|
+
| `dw-testing-discipline` | Opcional — quando a fase de testes escopados precisa de recipes Playwright pra projetos frontend. core rules + anti-patterns valem pra qualquer teste adicionado durante o audit. |
|
|
35
35
|
|
|
36
36
|
## Variaveis de Entrada
|
|
37
37
|
|
|
@@ -20,7 +20,7 @@ Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como sup
|
|
|
20
20
|
|
|
21
21
|
- `dw-debug-protocol`: **SEMPRE** — todo finding bug-shaped (cenário falhando, não feature ausente) passa pelo six-step triage. A evidência de reteste é o artefato da etapa 6 (verify); o regression test da etapa 5 é o que sustenta o status `Corrigido`.
|
|
22
22
|
- `dw-verify`: **SEMPRE** — invocada antes de marcar qualquer bug como `Corrigido` ou `Fechado` no `QA/bugs.md`. Sem VERIFICATION REPORT PASS (test + lint + build) + evidência de reteste (screenshot em modo UI OU linha JSONL em modo API), o status permanece `Reaberto` ou `Em análise`.
|
|
23
|
-
- `dw-testing-discipline`: (modo UI) consulte `references/playwright-recipes.md` para estruturas de reteste, capturas, scripts. Aplique
|
|
23
|
+
- `dw-testing-discipline`: (modo UI) consulte `references/playwright-recipes.md` para estruturas de reteste, capturas, scripts. Aplique core rules + flaky discipline ao retestar fixes — quarantine e SLOs da doutrina valem aqui.
|
|
24
24
|
- `vercel-react-best-practices`: (modo UI) use apenas se a correção afetar frontend React/Next.js e houver risco de regressão de renderização, hidratação, fetching ou performance
|
|
25
25
|
- `api-testing-recipes`: **(modo API — SEMPRE)** fonte da recipe usada no QA. Re-execute o arquivo `.http`/pytest/supertest/etc. original do RF do bug; anexe o resultado do reteste a um log JSONL fresco em `QA/logs/api/BUG-NN-retest.log`
|
|
26
26
|
|
|
@@ -55,7 +55,7 @@ Funciona melhor com projeto analisado por `/dw-analyze-project`
|
|
|
55
55
|
|
|
56
56
|
Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como apoio operacional, sem substituir este comando como fonte de verdade:
|
|
57
57
|
|
|
58
|
-
- `dw-testing-discipline`: apoio para estruturar fluxos E2E (`references/playwright-recipes.md`), padrões de coleta de evidência, e aplicar
|
|
58
|
+
- `dw-testing-discipline`: apoio para estruturar fluxos E2E (`references/playwright-recipes.md`), padrões de coleta de evidência, e aplicar core rules + hierarquia de seletores em qualquer teste referenciado pelo doc
|
|
59
59
|
- `remotion-best-practices`: apoio obrigatório quando houver vídeo humano final, legendas, composição, transições, FFmpeg ou Remotion
|
|
60
60
|
- `humanizer`: apoio obrigatório para revisar e naturalizar todas as legendas, captions `.srt`, textos descritivos e qualquer redação voltada a leitura humana antes da entrega final
|
|
61
61
|
- `dw-ui-discipline`: use ao documentar padrões visuais — state matrix e scene sentence viram parte da seção de overview de cada tela
|
|
@@ -168,7 +168,7 @@ Skills em `.agents/skills/` que os commands acima invocam transparentemente. Voc
|
|
|
168
168
|
|
|
169
169
|
| Skill | Invocada por | Papel |
|
|
170
170
|
|-------|--------------|-------|
|
|
171
|
-
| `dw-verify` | run-task, run-plan, fix-qa, bugfix, code-review, generate-pr, quick |
|
|
171
|
+
| `dw-verify` | run-task, run-plan, fix-qa, bugfix, code-review, generate-pr, quick | core rule: nenhuma claim de sucesso sem VERIFICATION REPORT PASS |
|
|
172
172
|
| `dw-memory` | run-task, run-plan, autopilot, resume, revert-task | Memory de workflow em dois níveis (shared + task-local) com promotion test |
|
|
173
173
|
| `dw-review-rigor` | code-review, review-implementation, refactoring-analysis | De-duplication, severity ordering, verify-intent-before-flag, signal-over-volume |
|
|
174
174
|
| `dw-council` | brainstorm `--council`, create-techspec `--council` | Debate multi-advisor (3-5 archetypes) com steel-manning, concession tracking e synthesis que preserva dissent. Opt-in. |
|
|
@@ -42,7 +42,7 @@ Quando disponíveis no projeto em `./.agents/skills/`, use para guiar o redesign
|
|
|
42
42
|
|
|
43
43
|
- `dw-ui-discipline`: **OBRIGATÓRIO** — roda o hard-gate de 4 checkpoints (brand authorities OU curated defaults; surface job sentence; state matrix completa; scene sentence) ANTES de qualquer proposta. Os 14 anti-slop patterns são checados contra cada direção. O WCAG 2.2 AA floor é não-negociável no step de validate.
|
|
44
44
|
- `vercel-react-best-practices`: use quando o projeto for React/Next.js para padrões de performance e implementação
|
|
45
|
-
- `dw-testing-discipline`: consulte `references/playwright-recipes.md` para captura de screenshots antes/depois e validação visual.
|
|
45
|
+
- `dw-testing-discipline`: consulte `references/playwright-recipes.md` para captura de screenshots antes/depois e validação visual. core rules + hierarquia de seletores valem pra qualquer teste gerado junto com o redesign.
|
|
46
46
|
- `security-review`: use se o redesign tocar flows de autenticação ou formulários sensíveis
|
|
47
47
|
|
|
48
48
|
## Ferramentas de Análise
|
|
@@ -20,10 +20,11 @@ Você é um assistente IA especializado em Quality Assurance. Sua tarefa é vali
|
|
|
20
20
|
|
|
21
21
|
Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como apoio operacional sem substituir este comando:
|
|
22
22
|
|
|
23
|
-
- `dw-testing-discipline`: (modo UI) **SEMPRE** —
|
|
23
|
+
- `dw-testing-discipline`: (modo UI) **SEMPRE** — core rules e 25 anti-patterns valem pra todo teste de QA autorado. `references/playwright-recipes.md` pra patterns táticos. `references/three-workflow-patterns.md` pra escolher o modo certo (UI / network / perf). `references/security-boundary.md` pra qualquer fluxo que cruza boundary de auth.
|
|
24
24
|
- `vercel-react-best-practices`: (modo UI) use apenas se o frontend sob teste for React/Next.js e houver indicação de regressão relacionada a renderização, fetching, hidratação ou performance percebida
|
|
25
25
|
- `dw-ui-discipline`: (modo UI) use ao validar consistência de design — o catálogo anti-slop e o floor de acessibilidade WCAG são checados como parte da evidência de QA
|
|
26
26
|
- `api-testing-recipes`: **(modo API — SEMPRE)** snippets validados para `.http`, pytest+httpx, supertest, WebApplicationFactory, reqwest. Compõe um arquivo de teste por RF em `QA/scripts/api/` e logs JSONL em `QA/logs/api/` segundo seus references
|
|
27
|
+
- `dw-llm-eval`: **(modo AI — quando invocado com `--ai`)** roda o reference dataset em `.dw/eval/datasets/<feature>/` contra a implementação atual. Computa precision@k / faithfulness / outcome accuracy conforme tipo da feature. Loga resultados como JSONL em `QA/logs/ai/<feature>-<date>.jsonl`. Compara contra a run anterior pra detectar regressão; alerta quando qualquer métrica cai >10% do baseline.
|
|
27
28
|
|
|
28
29
|
## Ferramentas de Análise
|
|
29
30
|
|
|
@@ -21,7 +21,7 @@ Quando disponíveis no projeto em `./.agents/skills/`, use estas skills como sup
|
|
|
21
21
|
| `dw-verify` | **SEMPRE** — invocada antes do commit para produzir Verification Report com evidence fresca |
|
|
22
22
|
| `dw-memory` | **SEMPRE** — lê memory da workflow no início e atualiza ao final da task (promotion test) |
|
|
23
23
|
| `vercel-react-best-practices` | Task envolve renderização React, hidratação, data fetching, bundle, cache ou performance |
|
|
24
|
-
| `dw-testing-discipline` | Task precisa de testes (qualquer layer) — aplica
|
|
24
|
+
| `dw-testing-discipline` | Task precisa de testes (qualquer layer) — aplica core rules, 6 agent guardrails, catálogo de anti-patterns. Use `references/playwright-recipes.md` quando a task tem frontend interativo precisando de validação E2E. |
|
|
25
25
|
|
|
26
26
|
## Inteligência do Codebase
|
|
27
27
|
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dw-incident-response
|
|
3
|
+
description: Use when a production incident is reported, when writing a postmortem, or when an on-call handoff is needed. Five-phase guided workflow (triage → investigation → resolution → communication → postmortem) with checkpoints between phases and structured output files persisted to .dw/incidents/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Incident Response
|
|
7
|
+
|
|
8
|
+
> **Inspired by** [`wilsto/claude-code-starter-kit/incident-response`](https://github.com/wilsto/claude-code-starter-kit) (MIT). Five-phase workflow structure and runbook templates adapted from that skill; specifics rewritten for dev-workflow's `.dw/` namespace and command surface.
|
|
9
|
+
|
|
10
|
+
> wilsto credits the original `wshobson/agents` plugin `incident-response` (v1.3.0). Attribution chain: wshobson → wilsto → dev-workflow.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- A production incident is declared (SEV-1 through SEV-3).
|
|
15
|
+
- You need to write a postmortem after an incident.
|
|
16
|
+
- You're generating or updating a runbook for a service.
|
|
17
|
+
- You need an on-call handoff template.
|
|
18
|
+
- `/dw-bugfix` detects severity `critical` + production marker — auto-escalates here.
|
|
19
|
+
|
|
20
|
+
## Key concepts
|
|
21
|
+
|
|
22
|
+
### Severity classification
|
|
23
|
+
|
|
24
|
+
| Severity | Criteria | Response time | Example |
|
|
25
|
+
|----------|----------|---------------|---------|
|
|
26
|
+
| **SEV-1 (Critical)** | Service down, data loss, security breach | Immediate (page) | Payment system offline |
|
|
27
|
+
| **SEV-2 (Major)** | Significant degradation, partial outage | < 30 min | API latency 10× normal |
|
|
28
|
+
| **SEV-3 (Minor)** | Limited impact, workaround exists | < 4 hours | One endpoint returning 500s |
|
|
29
|
+
| **SEV-4 (Low)** | Cosmetic, non-urgent | Next business day | Dashboard chart broken |
|
|
30
|
+
|
|
31
|
+
See `references/severity-and-triage.md` for full criteria and triage commands per stack.
|
|
32
|
+
|
|
33
|
+
### Behavioral rules
|
|
34
|
+
|
|
35
|
+
1. **Execute phases in order** — never skip a phase.
|
|
36
|
+
2. **Write output files after each phase** — they are the record of truth for the next phase.
|
|
37
|
+
3. **STOP at checkpoints** — wait for user confirmation before proceeding.
|
|
38
|
+
4. **Halt on failure** — if a step fails, do not continue to the next phase.
|
|
39
|
+
5. **File-based context** — read previous phase outputs rather than relying on conversation memory.
|
|
40
|
+
|
|
41
|
+
## Entry questions
|
|
42
|
+
|
|
43
|
+
Before starting any phase:
|
|
44
|
+
|
|
45
|
+
1. **What's happening?** Describe the incident in 1–2 sentences. What's broken and what's the user impact?
|
|
46
|
+
2. **Severity?** SEV-1 / SEV-2 / SEV-3 / SEV-4 per the table above.
|
|
47
|
+
3. **Mode?**
|
|
48
|
+
- **Full workflow** — all 5 phases (triage → postmortem).
|
|
49
|
+
- **Postmortem only** — incident already resolved; skip to Phase 5.
|
|
50
|
+
- **Runbook generation** — produce a runbook template for a service (no live incident).
|
|
51
|
+
|
|
52
|
+
## The five phases
|
|
53
|
+
|
|
54
|
+
Each phase writes to `.dw/incidents/<YYYY-MM-DD>-<slug>/`. Slug is auto-generated from incident title (kebab-case, ≤30 chars).
|
|
55
|
+
|
|
56
|
+
### Phase 1 — Detection & Triage
|
|
57
|
+
|
|
58
|
+
**Output:** `.dw/incidents/<date>-<slug>/01-triage.md`
|
|
59
|
+
|
|
60
|
+
Steps:
|
|
61
|
+
1. Classify severity using the table above.
|
|
62
|
+
2. Assess blast radius: which services, how many users affected, revenue impact if known.
|
|
63
|
+
3. Identify immediate mitigation: rollback, feature flag toggle, traffic redirect.
|
|
64
|
+
|
|
65
|
+
See `references/severity-and-triage.md` for diagnostic commands per stack (Kubernetes, Docker, generic HTTP).
|
|
66
|
+
|
|
67
|
+
**Checkpoint:** present triage summary. Wait for user confirmation before moving to investigation.
|
|
68
|
+
|
|
69
|
+
### Phase 2 — Investigation & Root Cause
|
|
70
|
+
|
|
71
|
+
**Output:** `.dw/incidents/<date>-<slug>/02-investigation.md`
|
|
72
|
+
|
|
73
|
+
Steps:
|
|
74
|
+
1. Build timeline: when did it start? What changed?
|
|
75
|
+
2. Correlate signals: metrics spike + deploy + error logs.
|
|
76
|
+
3. Hypothesis testing: one theory at a time; verify each before moving on.
|
|
77
|
+
4. Identify root cause: not the first symptom, but the underlying assumption that broke.
|
|
78
|
+
|
|
79
|
+
Common forensic tools:
|
|
80
|
+
- `git bisect` for regressions.
|
|
81
|
+
- Recent deploy log: `git log --oneline --since="24 hours ago"`.
|
|
82
|
+
- For live monitoring during investigation, `/dw-debug-protocol` flaky-investigation patterns apply.
|
|
83
|
+
|
|
84
|
+
**Checkpoint:** present root-cause hypothesis. Wait for user confirmation before applying fix.
|
|
85
|
+
|
|
86
|
+
### Phase 3 — Resolution & Recovery
|
|
87
|
+
|
|
88
|
+
**Output:** `.dw/incidents/<date>-<slug>/03-resolution.md`
|
|
89
|
+
|
|
90
|
+
Steps:
|
|
91
|
+
1. Apply fix: hotfix branch → fast PR (via `/dw-generate-pr`) → deploy.
|
|
92
|
+
2. Verify: health checks green, error rate back to baseline.
|
|
93
|
+
3. Monitor 30 minutes post-fix for SEV-1/2 to confirm stability.
|
|
94
|
+
|
|
95
|
+
**Checkpoint:** confirm full recovery before drafting communications.
|
|
96
|
+
|
|
97
|
+
### Phase 4 — Communication
|
|
98
|
+
|
|
99
|
+
**Output:** `.dw/incidents/<date>-<slug>/04-communication.md`
|
|
100
|
+
|
|
101
|
+
Two communications generated using the templates in `references/communication-templates.md`:
|
|
102
|
+
- **Initial notification** (sent during the incident; updated every 30 min for SEV-1/2).
|
|
103
|
+
- **Resolution notification** (sent when phase 3 confirms recovery).
|
|
104
|
+
|
|
105
|
+
### Phase 5 — Postmortem
|
|
106
|
+
|
|
107
|
+
**Output:** `.dw/incidents/<date>-<slug>/05-postmortem.md`
|
|
108
|
+
|
|
109
|
+
Generate a **blameless** postmortem using `references/postmortem-template.md`. Sections:
|
|
110
|
+
- Summary (2–3 sentences).
|
|
111
|
+
- Timeline (per-minute events from alert to all-clear).
|
|
112
|
+
- Root cause (technical, no blame).
|
|
113
|
+
- Impact (users affected, revenue, error-budget consumed).
|
|
114
|
+
- What went well / What went wrong.
|
|
115
|
+
- Action items (owner + due date + priority — see `references/blameless-discipline.md` for the quality bar).
|
|
116
|
+
|
|
117
|
+
**Quality bar for action items:** see `references/blameless-discipline.md`. "Improve monitoring" does NOT count. "Add Datadog SLO alert at p99 > 800ms with on-call routing by 2026-06-01, owner: @bruno" counts.
|
|
118
|
+
|
|
119
|
+
## Required reading by context
|
|
120
|
+
|
|
121
|
+
| Doing what | Read |
|
|
122
|
+
|------------|------|
|
|
123
|
+
| Live incident — triage | `references/severity-and-triage.md` |
|
|
124
|
+
| Writing the postmortem | `references/postmortem-template.md` + `references/blameless-discipline.md` |
|
|
125
|
+
| Drafting incident communications | `references/communication-templates.md` |
|
|
126
|
+
| Generating a runbook (no live incident) | `references/runbook-templates.md` |
|
|
127
|
+
| On-call handoff document | `references/runbook-templates.md` (handoff section) |
|
|
128
|
+
|
|
129
|
+
## Common pitfalls
|
|
130
|
+
|
|
131
|
+
Detailed in `references/blameless-discipline.md`:
|
|
132
|
+
|
|
133
|
+
1. **Skipping triage** — jumping to debug without assessing severity/blast-radius wastes the wrong hours.
|
|
134
|
+
2. **Blame culture** — postmortems focused on "who did it" hide mistakes and incidents recur.
|
|
135
|
+
3. **No action items** — postmortem filed, forgotten, same incident in 3 months.
|
|
136
|
+
4. **Communicating too late** — users discover the outage before the team acknowledges; trust erodes.
|
|
137
|
+
|
|
138
|
+
## Integration with dev-workflow commands
|
|
139
|
+
|
|
140
|
+
- `/dw-bugfix` with severity `critical` + production marker → offers to escalate here.
|
|
141
|
+
- `/dw-autopilot --incident "X"` → runs this workflow end-to-end for declared incidents.
|
|
142
|
+
- `/dw-analyze-project` reads `.dw/incidents/` on next execution to surface recurring failure patterns. 3+ incidents touching the same area → flag as "structural problem; needs design review" and propose constitution principles based on observed patterns.
|
|
143
|
+
- `/dw-generate-pr` is the fix-deployment path during Phase 3.
|
|
144
|
+
- `/dw-adr` is the right tool when the postmortem leads to a deliberate architectural change.
|
|
145
|
+
|
|
146
|
+
## Output directory layout
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
.dw/incidents/
|
|
150
|
+
├── 2026-05-12-checkout-payment-outage/
|
|
151
|
+
│ ├── 01-triage.md
|
|
152
|
+
│ ├── 02-investigation.md
|
|
153
|
+
│ ├── 03-resolution.md
|
|
154
|
+
│ ├── 04-communication.md
|
|
155
|
+
│ └── 05-postmortem.md
|
|
156
|
+
└── 2026-05-08-search-index-stale/
|
|
157
|
+
└── 05-postmortem.md # postmortem-only mode
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Files are committed to the repo alongside code — incidents are part of the project history, not ephemeral chat.
|
|
161
|
+
|
|
162
|
+
## Why this skill exists
|
|
163
|
+
|
|
164
|
+
dev-workflow's existing surface is "build feature → ship." Nothing covered "production broke, what now?" Teams improvised postmortems, action items got lost, and the same bug recurred. This skill closes that loop: structured response in the moment, blameless reflection after, and cross-incident learning that feeds back into the project's constitution.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Blameless discipline — the principles behind postmortems
|
|
2
|
+
|
|
3
|
+
The postmortem template imposes structure. This reference imposes the discipline that makes the structure useful.
|
|
4
|
+
|
|
5
|
+
## Why blameless
|
|
6
|
+
|
|
7
|
+
Postmortems with blame produce three failure modes:
|
|
8
|
+
1. **Hidden mistakes** — people learn to omit information that might reflect badly on them.
|
|
9
|
+
2. **Compliance theater** — "lessons learned" becomes a ritual, not a tool.
|
|
10
|
+
3. **Recurring incidents** — the same kind of failure happens 6 months later because the underlying system never changed.
|
|
11
|
+
|
|
12
|
+
Blameless framing forces the conversation toward what's actually fixable: systems, processes, assumptions, tooling. Individual mistakes are the entry point; the question is always "why did the system make this mistake easy/likely?"
|
|
13
|
+
|
|
14
|
+
## The 5-whys protocol
|
|
15
|
+
|
|
16
|
+
Stack five "why" questions until you reach an assumption or design choice that's actually changeable:
|
|
17
|
+
|
|
18
|
+
> **Symptom:** payment endpoint returned 500 for 47 minutes.
|
|
19
|
+
> **Why?** The new deploy introduced a regression in the order serializer.
|
|
20
|
+
> **Why?** The serializer started reading a field that the upstream API stopped sending.
|
|
21
|
+
> **Why?** The upstream API changed its response format two weeks ago and we didn't know.
|
|
22
|
+
> **Why?** We don't have contract tests against the upstream API.
|
|
23
|
+
> **Why?** Contract tests were considered too expensive to set up; the trade-off was never revisited.
|
|
24
|
+
|
|
25
|
+
**Root cause:** absence of contract tests for upstream APIs (a deliberate-but-stale design decision), not "the developer didn't check the response format."
|
|
26
|
+
|
|
27
|
+
If you reach "operator error" at any why, you stopped too early. Operator error happens because a system permits it.
|
|
28
|
+
|
|
29
|
+
## Quality bar for action items
|
|
30
|
+
|
|
31
|
+
The single most common postmortem failure mode: action items written vaguely so they can be "done" without changing anything.
|
|
32
|
+
|
|
33
|
+
### Bad action items
|
|
34
|
+
|
|
35
|
+
- "Improve monitoring."
|
|
36
|
+
- "Add more tests."
|
|
37
|
+
- "Document the runbook."
|
|
38
|
+
- "Make the system more resilient."
|
|
39
|
+
- "Better communication during incidents."
|
|
40
|
+
|
|
41
|
+
These are wishes, not actions. They can't be tracked. They will not happen.
|
|
42
|
+
|
|
43
|
+
### Good action items
|
|
44
|
+
|
|
45
|
+
Every action item has THREE components: owner, due date, measurable outcome.
|
|
46
|
+
|
|
47
|
+
| Action | Owner | Due | Measurable outcome |
|
|
48
|
+
|--------|-------|-----|-------------------|
|
|
49
|
+
| Add Datadog SLO alert at p99 > 800ms with PagerDuty routing to the payments on-call schedule | @bruno | 2026-06-01 | Alert exists in Datadog UI and fires successfully in test |
|
|
50
|
+
| Add idempotency-key header to `POST /api/orders` with 24h deduplication window | @maria | 2026-05-25 | Two identical requests with same key return the same order ID; verified by integration test |
|
|
51
|
+
| Open ADR documenting decision to add circuit breaker on Stripe API calls | @bruno | 2026-05-19 | ADR exists in `.dw/spec/<prd>/adrs/`, status: Accepted |
|
|
52
|
+
|
|
53
|
+
**Test:** can a third party verify the action item is done without asking the owner? If yes, it's good. If no, rewrite.
|
|
54
|
+
|
|
55
|
+
## Cognitive analysis — beyond the trigger
|
|
56
|
+
|
|
57
|
+
Two questions to push past "the code was wrong":
|
|
58
|
+
|
|
59
|
+
### 1. Why didn't we catch this earlier?
|
|
60
|
+
|
|
61
|
+
This is about the blind spot. The bug existed; we didn't see it. What's the gap in our:
|
|
62
|
+
- Tests (unit, integration, contract, E2E)?
|
|
63
|
+
- Monitoring (metric, alert, dashboard)?
|
|
64
|
+
- Process (code review, deploy checks, canary)?
|
|
65
|
+
- Documentation (knew but forgot, never knew)?
|
|
66
|
+
|
|
67
|
+
Fix the blind spot, not just the bug.
|
|
68
|
+
|
|
69
|
+
### 2. What ELSE could be hiding behind this gap?
|
|
70
|
+
|
|
71
|
+
If contract tests against the upstream API are missing → the payment incident is one instance. What ELSE depends on that API in ways the missing tests would catch?
|
|
72
|
+
|
|
73
|
+
The action item is to add the contract tests, not "fix the payment serializer."
|
|
74
|
+
|
|
75
|
+
## Cross-incident learning
|
|
76
|
+
|
|
77
|
+
`/dw-analyze-project` reads `.dw/incidents/` on subsequent runs. Patterns to watch:
|
|
78
|
+
|
|
79
|
+
- **3+ incidents in the same module** (e.g., billing): structural problem. Open a design-review issue, not another action item.
|
|
80
|
+
- **3+ incidents with the same root-cause class** (e.g., contract drift, missing idempotency): a constitution principle is needed (`/dw-adr` + add to `.dw/constitution.md`).
|
|
81
|
+
- **Time clustering** (multiple incidents during the same week): possible stress on the team's review/deploy capacity — process issue, not technical.
|
|
82
|
+
|
|
83
|
+
These patterns are MORE valuable than individual postmortems. Single incidents tell you what broke; patterns tell you what's fragile.
|
|
84
|
+
|
|
85
|
+
## Common pitfalls (the four big ones)
|
|
86
|
+
|
|
87
|
+
### Pitfall 1: Skipping triage
|
|
88
|
+
|
|
89
|
+
**Symptom:** jumping straight to debugging without assessing severity and blast radius.
|
|
90
|
+
**Consequence:** wrong priority — might fix a low-impact bug while a high-impact issue festers.
|
|
91
|
+
**Fix:** always classify severity first. Two minutes of triage saves hours of misguided investigation.
|
|
92
|
+
|
|
93
|
+
### Pitfall 2: Blame culture
|
|
94
|
+
|
|
95
|
+
**Symptom:** postmortem focuses on "who did it" instead of "why did the system allow it?"
|
|
96
|
+
**Consequence:** people hide mistakes; incidents recur.
|
|
97
|
+
**Fix:** blameless framing. Focus on systemic fixes — better monitoring, safer deploys, guardrails, removed footguns.
|
|
98
|
+
|
|
99
|
+
### Pitfall 3: No action items
|
|
100
|
+
|
|
101
|
+
**Symptom:** postmortem written, filed, forgotten.
|
|
102
|
+
**Consequence:** same incident in 3 months.
|
|
103
|
+
**Fix:** every postmortem has concrete action items with owners, due dates, measurable outcomes (see "Quality bar" above). Track them in the same system as feature work.
|
|
104
|
+
|
|
105
|
+
### Pitfall 4: Communicating too late
|
|
106
|
+
|
|
107
|
+
**Symptom:** users discover the outage before the team acknowledges it.
|
|
108
|
+
**Consequence:** trust erosion + support ticket flood.
|
|
109
|
+
**Fix:** first communication within 15 min for SEV-1/2, even if it's "We're investigating." Status page updates every 30 min until resolved.
|
|
110
|
+
|
|
111
|
+
## When the discipline bends
|
|
112
|
+
|
|
113
|
+
- **Internal-only tools:** the communication discipline can be lighter (no public status page).
|
|
114
|
+
- **Compliance-driven postmortems** (SOC 2, HIPAA): may require additional fields or sign-off chains beyond the template. Add them as a project-specific extension.
|
|
115
|
+
- **Trivial near-misses** (caught in staging before production): consider a "lite" postmortem — 1 page with timeline + lesson + action items. Not full structure.
|
|
116
|
+
|
|
117
|
+
In all bend cases, document the deviation in the postmortem itself. "Skipped public communication because internal-only tool" is fine; just say it.
|
|
118
|
+
|
|
119
|
+
## Reference reading
|
|
120
|
+
|
|
121
|
+
The discipline above is distilled from:
|
|
122
|
+
- Google SRE Book — [Incident Response](https://sre.google/sre-book/managing-incidents/) and [Postmortem Culture](https://sre.google/sre-book/postmortem-culture/).
|
|
123
|
+
- Etsy — [Debriefing Facilitation Guide](https://github.com/etsy/DebriefingFacilitationGuide) (the original blameless postmortem playbook).
|
|
124
|
+
- PagerDuty — [Incident Response Documentation](https://response.pagerduty.com/).
|
|
125
|
+
|
|
126
|
+
The dev-workflow version adapts these to a single-team or small-org scale; large enterprises may need more layers.
|