@brunosps00/dev-workflow 0.11.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.
Files changed (127) hide show
  1. package/README.md +54 -5
  2. package/lib/constants.js +20 -20
  3. package/lib/init.js +24 -1
  4. package/lib/migrate-skills.js +129 -0
  5. package/lib/removed-bundled-skills.js +16 -0
  6. package/lib/uninstall.js +6 -2
  7. package/lib/utils.js +43 -1
  8. package/package.json +1 -1
  9. package/scaffold/en/agent-instructions.md +68 -0
  10. package/scaffold/en/commands/dw-autopilot.md +1 -1
  11. package/scaffold/en/commands/dw-brainstorm.md +1 -1
  12. package/scaffold/en/commands/dw-bugfix.md +4 -3
  13. package/scaffold/en/commands/dw-code-review.md +1 -0
  14. package/scaffold/en/commands/dw-create-tasks.md +6 -0
  15. package/scaffold/en/commands/dw-create-techspec.md +1 -1
  16. package/scaffold/en/commands/dw-deps-audit.md +1 -1
  17. package/scaffold/en/commands/dw-fix-qa.md +1 -1
  18. package/scaffold/en/commands/dw-functional-doc.md +2 -2
  19. package/scaffold/en/commands/dw-help.md +2 -2
  20. package/scaffold/en/commands/dw-redesign-ui.md +7 -7
  21. package/scaffold/en/commands/dw-run-qa.md +5 -4
  22. package/scaffold/en/commands/dw-run-task.md +2 -2
  23. package/scaffold/en/templates/constitution-template.md +1 -1
  24. package/scaffold/pt-br/agent-instructions.md +68 -0
  25. package/scaffold/pt-br/commands/dw-autopilot.md +1 -1
  26. package/scaffold/pt-br/commands/dw-brainstorm.md +1 -1
  27. package/scaffold/pt-br/commands/dw-bugfix.md +4 -3
  28. package/scaffold/pt-br/commands/dw-code-review.md +1 -0
  29. package/scaffold/pt-br/commands/dw-create-tasks.md +6 -0
  30. package/scaffold/pt-br/commands/dw-create-techspec.md +1 -1
  31. package/scaffold/pt-br/commands/dw-deps-audit.md +1 -1
  32. package/scaffold/pt-br/commands/dw-fix-qa.md +1 -1
  33. package/scaffold/pt-br/commands/dw-functional-doc.md +2 -2
  34. package/scaffold/pt-br/commands/dw-help.md +2 -2
  35. package/scaffold/pt-br/commands/dw-redesign-ui.md +7 -7
  36. package/scaffold/pt-br/commands/dw-run-qa.md +5 -4
  37. package/scaffold/pt-br/commands/dw-run-task.md +2 -2
  38. package/scaffold/pt-br/templates/constitution-template.md +1 -1
  39. package/scaffold/skills/dw-council/SKILL.md +1 -1
  40. package/scaffold/skills/dw-incident-response/SKILL.md +164 -0
  41. package/scaffold/skills/dw-incident-response/references/blameless-discipline.md +126 -0
  42. package/scaffold/skills/dw-incident-response/references/communication-templates.md +107 -0
  43. package/scaffold/skills/dw-incident-response/references/postmortem-template.md +133 -0
  44. package/scaffold/skills/dw-incident-response/references/runbook-templates.md +169 -0
  45. package/scaffold/skills/dw-incident-response/references/severity-and-triage.md +186 -0
  46. package/scaffold/skills/dw-llm-eval/SKILL.md +148 -0
  47. package/scaffold/skills/dw-llm-eval/references/agent-eval.md +252 -0
  48. package/scaffold/skills/dw-llm-eval/references/judge-calibration.md +169 -0
  49. package/scaffold/skills/dw-llm-eval/references/oracle-ladder.md +171 -0
  50. package/scaffold/skills/dw-llm-eval/references/rag-metrics.md +186 -0
  51. package/scaffold/skills/dw-llm-eval/references/reference-dataset.md +190 -0
  52. package/scaffold/skills/dw-testing-discipline/SKILL.md +171 -0
  53. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +170 -0
  54. package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +336 -0
  55. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +128 -0
  56. package/scaffold/skills/dw-testing-discipline/references/flaky-discipline.md +163 -0
  57. package/scaffold/skills/dw-testing-discipline/references/patterns.md +241 -0
  58. package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +282 -0
  59. package/scaffold/skills/{webapp-testing → dw-testing-discipline}/references/security-boundary.md +1 -1
  60. package/scaffold/skills/dw-ui-discipline/SKILL.md +150 -0
  61. package/scaffold/skills/dw-ui-discipline/references/accessibility-floor.md +225 -0
  62. package/scaffold/skills/dw-ui-discipline/references/curated-defaults.md +195 -0
  63. package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +162 -0
  64. package/scaffold/skills/dw-ui-discipline/references/state-matrix.md +101 -0
  65. package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +152 -0
  66. package/scaffold/skills/ui-ux-pro-max/LICENSE +0 -21
  67. package/scaffold/skills/ui-ux-pro-max/SKILL.md +0 -659
  68. package/scaffold/skills/ui-ux-pro-max/data/_sync_all.py +0 -414
  69. package/scaffold/skills/ui-ux-pro-max/data/app-interface.csv +0 -31
  70. package/scaffold/skills/ui-ux-pro-max/data/charts.csv +0 -26
  71. package/scaffold/skills/ui-ux-pro-max/data/colors.csv +0 -162
  72. package/scaffold/skills/ui-ux-pro-max/data/design.csv +0 -1776
  73. package/scaffold/skills/ui-ux-pro-max/data/draft.csv +0 -1779
  74. package/scaffold/skills/ui-ux-pro-max/data/google-fonts.csv +0 -1924
  75. package/scaffold/skills/ui-ux-pro-max/data/icons.csv +0 -106
  76. package/scaffold/skills/ui-ux-pro-max/data/landing.csv +0 -35
  77. package/scaffold/skills/ui-ux-pro-max/data/products.csv +0 -162
  78. package/scaffold/skills/ui-ux-pro-max/data/react-performance.csv +0 -45
  79. package/scaffold/skills/ui-ux-pro-max/data/stacks/angular.csv +0 -51
  80. package/scaffold/skills/ui-ux-pro-max/data/stacks/astro.csv +0 -54
  81. package/scaffold/skills/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
  82. package/scaffold/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
  83. package/scaffold/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
  84. package/scaffold/skills/ui-ux-pro-max/data/stacks/laravel.csv +0 -51
  85. package/scaffold/skills/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
  86. package/scaffold/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -51
  87. package/scaffold/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
  88. package/scaffold/skills/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
  89. package/scaffold/skills/ui-ux-pro-max/data/stacks/react.csv +0 -54
  90. package/scaffold/skills/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
  91. package/scaffold/skills/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
  92. package/scaffold/skills/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
  93. package/scaffold/skills/ui-ux-pro-max/data/stacks/threejs.csv +0 -54
  94. package/scaffold/skills/ui-ux-pro-max/data/stacks/vue.csv +0 -50
  95. package/scaffold/skills/ui-ux-pro-max/data/styles.csv +0 -85
  96. package/scaffold/skills/ui-ux-pro-max/data/typography.csv +0 -74
  97. package/scaffold/skills/ui-ux-pro-max/data/ui-reasoning.csv +0 -162
  98. package/scaffold/skills/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  99. package/scaffold/skills/ui-ux-pro-max/scripts/core.py +0 -262
  100. package/scaffold/skills/ui-ux-pro-max/scripts/design_system.py +0 -1148
  101. package/scaffold/skills/ui-ux-pro-max/scripts/search.py +0 -114
  102. package/scaffold/skills/ui-ux-pro-max/skills/brand/SKILL.md +0 -97
  103. package/scaffold/skills/ui-ux-pro-max/skills/design/SKILL.md +0 -302
  104. package/scaffold/skills/ui-ux-pro-max/skills/design-system/SKILL.md +0 -244
  105. package/scaffold/skills/ui-ux-pro-max/templates/base/quick-reference.md +0 -297
  106. package/scaffold/skills/ui-ux-pro-max/templates/base/skill-content.md +0 -358
  107. package/scaffold/skills/ui-ux-pro-max/templates/platforms/agent.json +0 -21
  108. package/scaffold/skills/ui-ux-pro-max/templates/platforms/augment.json +0 -18
  109. package/scaffold/skills/ui-ux-pro-max/templates/platforms/claude.json +0 -21
  110. package/scaffold/skills/ui-ux-pro-max/templates/platforms/codebuddy.json +0 -21
  111. package/scaffold/skills/ui-ux-pro-max/templates/platforms/codex.json +0 -21
  112. package/scaffold/skills/ui-ux-pro-max/templates/platforms/continue.json +0 -21
  113. package/scaffold/skills/ui-ux-pro-max/templates/platforms/copilot.json +0 -21
  114. package/scaffold/skills/ui-ux-pro-max/templates/platforms/cursor.json +0 -21
  115. package/scaffold/skills/ui-ux-pro-max/templates/platforms/droid.json +0 -21
  116. package/scaffold/skills/ui-ux-pro-max/templates/platforms/gemini.json +0 -21
  117. package/scaffold/skills/ui-ux-pro-max/templates/platforms/kilocode.json +0 -21
  118. package/scaffold/skills/ui-ux-pro-max/templates/platforms/kiro.json +0 -21
  119. package/scaffold/skills/ui-ux-pro-max/templates/platforms/opencode.json +0 -21
  120. package/scaffold/skills/ui-ux-pro-max/templates/platforms/qoder.json +0 -21
  121. package/scaffold/skills/ui-ux-pro-max/templates/platforms/roocode.json +0 -21
  122. package/scaffold/skills/ui-ux-pro-max/templates/platforms/trae.json +0 -21
  123. package/scaffold/skills/ui-ux-pro-max/templates/platforms/warp.json +0 -18
  124. package/scaffold/skills/ui-ux-pro-max/templates/platforms/windsurf.json +0 -21
  125. package/scaffold/skills/webapp-testing/SKILL.md +0 -138
  126. package/scaffold/skills/webapp-testing/assets/test-helper.js +0 -56
  127. /package/scaffold/skills/{webapp-testing → dw-testing-discipline}/references/three-workflow-patterns.md +0 -0
@@ -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.
@@ -0,0 +1,107 @@
1
+ # Communication templates
2
+
3
+ Two messages get drafted during Phase 4: an initial notification (sent during the incident) and a resolution notification (sent at all-clear). Both go through the same channels — status page, support team, internal Slack/Teams, customer email if applicable.
4
+
5
+ ## Initial notification
6
+
7
+ Sent as soon as the incident is acknowledged. Update every 30 min for SEV-1/2 until resolved.
8
+
9
+ ```markdown
10
+ ## Incident: <Title>
11
+
12
+ **Severity:** SEV-<X>
13
+ **Status:** Investigating | Mitigated | Resolved
14
+ **Impact:** <What users experience — be specific>
15
+ **Started:** YYYY-MM-DD HH:MM UTC
16
+ **Next update:** HH:MM UTC
17
+
18
+ We are aware of <symptom> affecting <surface>. The team is actively investigating.
19
+ <Optional: known workaround if any.>
20
+
21
+ We will post the next update by HH:MM UTC.
22
+ ```
23
+
24
+ ### Update cadence
25
+
26
+ - **SEV-1:** every 15 min until mitigated, then every 30 min until resolved.
27
+ - **SEV-2:** every 30 min throughout.
28
+ - **SEV-3:** every 2 hours.
29
+ - **SEV-4:** initial + resolution; no interim updates.
30
+
31
+ ### Status progression
32
+
33
+ The `Status` field moves through three values:
34
+ 1. **Investigating** — we know it's happening; cause unknown.
35
+ 2. **Mitigated** — symptoms are reduced or contained; root cause may still be unresolved.
36
+ 3. **Resolved** — symptoms gone, monitoring shows baseline, no follow-up expected.
37
+
38
+ ### Tone
39
+
40
+ - Direct. No "we're experiencing a slight disruption."
41
+ - Specific. Say which feature; don't generalize.
42
+ - Honest. If you don't know the cause, say so.
43
+ - No blame. Don't mention which team owns the area in public-facing comms.
44
+
45
+ ## Resolution notification
46
+
47
+ Sent when Phase 3 confirms recovery.
48
+
49
+ ```markdown
50
+ ## Resolved: <Title>
51
+
52
+ **Duration:** Xh Ym (from HH:MM to HH:MM UTC)
53
+ **Root cause:** <1-2 sentences, technical but accessible>
54
+ **Fix applied:** <what was done — link to deploy / PR if public-facing isn't a concern>
55
+ **Postmortem:** Will be published within 48 hours at <link>
56
+
57
+ We apologize for the disruption. Customers affected by <specific issue> can <specific recovery action if applicable>.
58
+
59
+ Questions: <support@example.com> or <#incident-channel>.
60
+ ```
61
+
62
+ ### What to include
63
+
64
+ - Specific duration in minutes/hours.
65
+ - Root cause that's accurate but readable by non-engineers.
66
+ - Concrete remedy (refund window, retry-now action, etc.) if customers need to do something.
67
+ - Postmortem link or commitment to publish.
68
+
69
+ ### What NOT to include
70
+
71
+ - Names of individuals.
72
+ - Detailed stack traces or internal tool names.
73
+ - Speculation on prevention before the postmortem is done.
74
+ - Apologies that promise "this will never happen again" — incidents do recur; promise to learn.
75
+
76
+ ## Internal-only versions
77
+
78
+ For internal tools without external users, drop the apology section and add:
79
+
80
+ ```markdown
81
+ ## Internal incident — <Title>
82
+
83
+ **Severity:** SEV-X
84
+ **Affected team(s):** <list>
85
+ **Duration:** Xh Ym
86
+ **Cause:** <technical>
87
+ **Fix:** <commit/deploy>
88
+ **Action items:** see postmortem at <link>
89
+ ```
90
+
91
+ Shorter, more technical, no need to be customer-friendly.
92
+
93
+ ## Status page updates
94
+
95
+ If using a status page (Statuspage, Cachet, Better Uptime, etc.):
96
+
97
+ - Component-level granularity: mark which specific service is degraded, not "platform down."
98
+ - Match the severity to the visual indicator (degraded vs partial outage vs major outage).
99
+ - Close the incident on the status page only after the resolution notification confirms recovery.
100
+
101
+ ## When the communication discipline bends
102
+
103
+ - **Internal-only tools:** initial + resolution only; no 30-min updates needed.
104
+ - **Security incidents:** legal/compliance may need to approve every external message. Build that handoff into Phase 4.
105
+ - **Customer-specific incidents** (affects 1-2 enterprise customers, not the whole user base): direct contact to those customers replaces public status page.
106
+
107
+ Document the deviation in `04-communication.md`.
@@ -0,0 +1,133 @@
1
+ # Postmortem template — blameless, action-oriented
2
+
3
+ Use this template for the Phase 5 output (`05-postmortem.md`). Every field is mandatory unless explicitly marked optional.
4
+
5
+ The discipline behind the template lives in `blameless-discipline.md` — read both.
6
+
7
+ ## Template
8
+
9
+ ```markdown
10
+ # Postmortem: <Incident title>
11
+
12
+ **Date:** YYYY-MM-DD
13
+ **Duration:** Xh Ym (from detection to all-clear)
14
+ **Severity:** SEV-X
15
+ **Authors:** @name1, @name2
16
+ **Status:** Draft | Reviewed | Published
17
+
18
+ ## Summary
19
+
20
+ [2-3 sentences. What happened? What was the user-visible impact? How was it resolved?
21
+ No blame, no causes yet — just the observable narrative.]
22
+
23
+ ## Timeline
24
+
25
+ All times UTC. Aim for ±5 min granularity; tighter for SEV-1/2.
26
+
27
+ | Time (UTC) | Event |
28
+ |------------|-------|
29
+ | HH:MM | First alert fired (or first user report) |
30
+ | HH:MM | On-call acknowledged |
31
+ | HH:MM | War room opened / incident channel created |
32
+ | HH:MM | Initial triage complete; severity confirmed |
33
+ | HH:MM | Hypothesis: <X> |
34
+ | HH:MM | Hypothesis rejected — observed <Y> |
35
+ | HH:MM | Root cause identified |
36
+ | HH:MM | Fix applied: <commit SHA / deploy>
37
+ | HH:MM | Verified recovery (health checks green, error rate baseline)
38
+ | HH:MM | All-clear confirmed; communications sent |
39
+
40
+ ## Root cause
41
+
42
+ [Technical explanation. Walk through the chain:
43
+ 1. What was the proximate cause? (the immediate trigger)
44
+ 2. What was the underlying assumption that broke?
45
+ 3. Why didn't existing safeguards catch it?
46
+
47
+ No blame. No "X did Y wrong." Frame as: "the system allowed Z because A was assumed."]
48
+
49
+ ## Impact
50
+
51
+ - **Users affected:** N (counting method: <how we estimated>)
52
+ - **Geography:** [if applicable]
53
+ - **Revenue impact:** $X estimated (calculation: <method>)
54
+ - **Error budget consumed:** X% of monthly SLO
55
+ - **Data impact:** [data lost / corrupted? recoverable?]
56
+
57
+ ## Detection
58
+
59
+ - **How was it detected?** [alert / user report / scheduled check]
60
+ - **Time to detection (TTD):** X minutes
61
+ - **Was the detection signal adequate?** [yes/no — and what would improve it]
62
+
63
+ ## What went well
64
+
65
+ Concrete things to keep:
66
+ - [item — specific, not "we worked as a team"]
67
+ - [item]
68
+ - [item]
69
+
70
+ ## What went wrong
71
+
72
+ Process / tooling / assumptions that failed:
73
+ - [item — specific failure mode, no blame]
74
+ - [item]
75
+ - [item]
76
+
77
+ ## Where we got lucky
78
+
79
+ [Optional. What worked by accident that we shouldn't rely on next time?
80
+ e.g., "The bug only fired during business hours because of <X>; could have been overnight and worse."]
81
+
82
+ ## Action items
83
+
84
+ Quality bar: each item has **owner**, **due date**, and **measurable outcome**. "Improve monitoring" does NOT count. Read `blameless-discipline.md` for the bar.
85
+
86
+ | Action | Owner | Due date | Priority | Tracking |
87
+ |--------|-------|----------|----------|----------|
88
+ | Add Datadog SLO alert at p99 > 800ms with PagerDuty routing | @bruno | 2026-06-01 | P1 | Linear ENG-1234 |
89
+ | Add idempotency key to /api/orders POST | @maria | 2026-05-25 | P1 | GitHub #5678 |
90
+ | Update runbook with new mitigation steps | @bruno | 2026-05-19 | P2 | Linear ENG-1235 |
91
+ | Constitution principle: every state-changing endpoint requires audit log | @team | 2026-06-15 | P3 | ADR-042 |
92
+
93
+ ## Constitution implications
94
+
95
+ [Did this incident reveal a principle the team should commit to? If yes, an ADR
96
+ should be opened via `/dw-adr`. Examples:
97
+ - "Every write to billing tables requires audit log entry"
98
+ - "Database migrations must run in a separate maintenance window"
99
+ - "External API calls must have circuit breakers"
100
+
101
+ Link the ADR slug here.]
102
+
103
+ ## Cross-incident pattern
104
+
105
+ [Have we seen this category of incident before? If yes, list the prior incidents.
106
+ 3+ similar incidents = structural problem; needs design review, not just an action item.]
107
+
108
+ ## References
109
+
110
+ - Incident channel: [Slack link]
111
+ - Diagnostic dashboards: [Grafana / Datadog links]
112
+ - Affected commits: [SHA range]
113
+ - Related ADRs: [list]
114
+ - Related runbook: `<path>` (updated in this incident if applicable)
115
+ ```
116
+
117
+ ## Quality checklist before publishing
118
+
119
+ - [ ] Summary is 2-3 sentences — not a wall of text.
120
+ - [ ] Timeline events have specific times (not "around lunch time").
121
+ - [ ] Root cause section explains the ASSUMPTION, not just the trigger.
122
+ - [ ] Every action item has owner + due date + measurable outcome.
123
+ - [ ] Action items are filed in the actual tracker (Linear/Jira/GitHub) with links.
124
+ - [ ] No names appear in "what went wrong" — only systems, processes, and assumptions.
125
+ - [ ] Cross-incident pattern section reviewed against `.dw/incidents/` for prior occurrences.
126
+ - [ ] If a constitution principle emerged, ADR opened via `/dw-adr` and linked.
127
+
128
+ ## Publishing
129
+
130
+ - Postmortems for SEV-1/2 are shared with stakeholders within 48 hours.
131
+ - Postmortems for SEV-3 are reviewed in the next team retro.
132
+ - Action items track in the project's normal tooling — not in the postmortem file.
133
+ - The postmortem file in `.dw/incidents/` is the canonical write-up; everything else (Slack threads, status pages) eventually points back here.