@geraldmaron/construct 1.0.6 → 1.0.8

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 (218) hide show
  1. package/README.md +39 -34
  2. package/bin/construct +1403 -96
  3. package/commands/build/feature.md +1 -1
  4. package/commands/build/fix.md +1 -1
  5. package/commands/design/access.md +1 -1
  6. package/commands/design/flow.md +1 -1
  7. package/commands/design/ui.md +1 -1
  8. package/commands/measure/experiment.md +1 -1
  9. package/commands/measure/metrics.md +1 -1
  10. package/commands/measure/results.md +1 -1
  11. package/commands/plan/api.md +1 -1
  12. package/commands/plan/challenge.md +1 -1
  13. package/commands/plan/decide.md +1 -1
  14. package/commands/plan/feature.md +1 -1
  15. package/commands/plan/requirements.md +1 -1
  16. package/commands/remember/context.md +1 -1
  17. package/commands/remember/handoff.md +1 -1
  18. package/commands/remember/runbook.md +1 -1
  19. package/commands/review/code.md +1 -1
  20. package/commands/review/quality.md +1 -1
  21. package/commands/review/security.md +1 -1
  22. package/commands/ship/ready.md +1 -1
  23. package/commands/ship/release.md +1 -1
  24. package/commands/ship/status.md +1 -1
  25. package/commands/understand/docs.md +1 -1
  26. package/commands/understand/this.md +1 -1
  27. package/commands/understand/why.md +1 -1
  28. package/commands/work/clean.md +1 -1
  29. package/commands/work/drive.md +1 -1
  30. package/commands/work/optimize-prompts.md +2 -2
  31. package/commands/work/parallel-review.md +1 -1
  32. package/db/schema/007_tags.sql +30 -0
  33. package/db/schema/008_skill_usage.sql +24 -0
  34. package/db/schema/009_scheduler.sql +14 -0
  35. package/examples/internal/roles/architect/bad/clever-plan-without-contracts.md +1 -1
  36. package/examples/internal/roles/architect/golden/explicit-tradeoff-before-plan.md +1 -1
  37. package/examples/internal/roles/engineer/bad/speculative-abstraction.md +1 -1
  38. package/examples/internal/roles/engineer/golden/read-before-write.md +1 -1
  39. package/examples/internal/roles/qa/bad/coverage-theater.md +1 -1
  40. package/examples/internal/roles/qa/golden/regression-gate.md +1 -1
  41. package/examples/seed-observations/decisions.md +1 -1
  42. package/lib/audit-skills.mjs +3 -3
  43. package/lib/auto-docs.mjs +8 -8
  44. package/lib/boundary.mjs +126 -0
  45. package/lib/cache-strategy-google.js +26 -31
  46. package/lib/cli-commands.mjs +276 -122
  47. package/lib/comment-lint.mjs +139 -1
  48. package/lib/completions.mjs +1 -1
  49. package/lib/config/schema.mjs +15 -1
  50. package/lib/contracts/validate.mjs +371 -0
  51. package/lib/daemons/contract.mjs +210 -0
  52. package/lib/distill.mjs +22 -4
  53. package/lib/doc-stamp.mjs +48 -0
  54. package/lib/docs-verify.mjs +59 -6
  55. package/lib/doctor/cli.mjs +16 -1
  56. package/lib/doctor/index.mjs +3 -1
  57. package/lib/doctor/watchers/consistency.mjs +360 -0
  58. package/lib/doctor/watchers/mcp-protocol.mjs +232 -0
  59. package/lib/document-extract.mjs +420 -17
  60. package/lib/document-ingest.mjs +2 -0
  61. package/lib/embed/cli.mjs +124 -3
  62. package/lib/embed/daemon.mjs +43 -4
  63. package/lib/embed/docs-lifecycle.mjs +1 -1
  64. package/lib/embed/inbox.mjs +50 -3
  65. package/lib/embed/role-framing.mjs +3 -3
  66. package/lib/embed/scheduler.mjs +33 -5
  67. package/lib/env-config.mjs +9 -3
  68. package/lib/evaluator-optimizer.mjs +2 -3
  69. package/lib/extractors/calendar.mjs +173 -0
  70. package/lib/extractors/shared/drop-info.mjs +22 -0
  71. package/lib/extractors/transcript.mjs +0 -0
  72. package/lib/gates-audit.mjs +8 -2
  73. package/lib/git-hooks/prepare-commit-msg +1 -1
  74. package/lib/headhunt.mjs +2 -2
  75. package/lib/hooks/agent-tracker.mjs +6 -11
  76. package/lib/hooks/comment-lint.mjs +16 -0
  77. package/lib/hooks/guard-bash.mjs +35 -14
  78. package/lib/hooks/mcp-audit.mjs +14 -1
  79. package/lib/hooks/pre-compact.mjs +92 -5
  80. package/lib/hooks/pre-push-gate.mjs +41 -8
  81. package/lib/hooks/proactive-activation.mjs +0 -14
  82. package/lib/hooks/registry-sync.mjs +2 -2
  83. package/lib/hooks/rule-verifier.mjs +217 -0
  84. package/lib/hooks/session-optimize.mjs +2 -1
  85. package/lib/hooks/stop-notify.mjs +7 -6
  86. package/lib/host-capabilities.mjs +10 -1
  87. package/lib/hygiene/scan.mjs +141 -0
  88. package/lib/init-unified.mjs +73 -65
  89. package/lib/install/stage-project.mjs +4 -4
  90. package/lib/intake/classify.mjs +309 -58
  91. package/lib/intake/daemon.mjs +121 -0
  92. package/lib/intake/filesystem-queue.mjs +31 -6
  93. package/lib/intake/intake-config.mjs +2 -1
  94. package/lib/intake/postgres-queue.mjs +45 -3
  95. package/lib/intake/prepare.mjs +3 -1
  96. package/lib/intake/quarantine.mjs +205 -0
  97. package/lib/intake/session-prelude.mjs +7 -1
  98. package/lib/intake/traceability.mjs +90 -0
  99. package/lib/knowledge/postgres-search.mjs +132 -0
  100. package/lib/knowledge/research-store.mjs +2 -0
  101. package/lib/knowledge/search.mjs +14 -4
  102. package/lib/maintenance/cleanup.mjs +315 -0
  103. package/lib/mcp/memory-bridge.mjs +276 -0
  104. package/lib/mcp/server.mjs +11 -3
  105. package/lib/mcp/tools/skills.mjs +32 -11
  106. package/lib/mcp/tools/workflow.mjs +25 -0
  107. package/lib/mcp-catalog.json +12 -8
  108. package/lib/mcp-platform-config.mjs +16 -8
  109. package/lib/migrations/index.mjs +106 -0
  110. package/lib/migrations/v1-baseline.mjs +33 -0
  111. package/lib/model-registry.mjs +1 -1
  112. package/lib/observation-store.mjs +9 -4
  113. package/lib/opencode-runtime-plugin.mjs +1 -1
  114. package/lib/orchestration-policy.mjs +4 -4
  115. package/lib/outcomes/record.mjs +2 -0
  116. package/lib/overrides/resolver.mjs +3 -3
  117. package/lib/parity.mjs +4 -4
  118. package/lib/policy/engine.mjs +2 -2
  119. package/lib/profiles/lifecycle.mjs +1 -1
  120. package/lib/profiles/rebrand.mjs +46 -0
  121. package/lib/project-init-shared.mjs +12 -0
  122. package/lib/prompt-metadata.mjs +4 -4
  123. package/lib/provider-capabilities.js +20 -7
  124. package/lib/providers/auth-manager.mjs +58 -17
  125. package/lib/providers/circuit-breaker.mjs +14 -0
  126. package/lib/providers/contract.mjs +67 -3
  127. package/lib/providers/creds.mjs +219 -0
  128. package/lib/providers/scaffold.mjs +107 -0
  129. package/lib/reflect.mjs +49 -12
  130. package/lib/role-preload.mjs +5 -0
  131. package/lib/roles/catalog.mjs +1 -1
  132. package/lib/roles/manifest.mjs +2 -2
  133. package/lib/scheduler/index.mjs +112 -0
  134. package/lib/scheduler/solo.mjs +183 -0
  135. package/lib/server/index.mjs +29 -29
  136. package/lib/server/insights.mjs +14 -12
  137. package/lib/server/langfuse-login.mjs +58 -0
  138. package/lib/server/static/assets/index-ab25c707.js +1 -1
  139. package/lib/session-store.mjs +6 -4
  140. package/lib/setup.mjs +14 -3
  141. package/lib/{agent-contracts-enforce.mjs → specialist-contracts-enforce.mjs} +4 -4
  142. package/lib/{agent-contracts.mjs → specialist-contracts.mjs} +9 -8
  143. package/lib/{agents → specialists}/postconditions.mjs +3 -3
  144. package/lib/{agents → specialists}/schema.mjs +6 -6
  145. package/lib/status.mjs +13 -11
  146. package/lib/storage/backup.mjs +2 -2
  147. package/lib/tags/lifecycle.mjs +278 -0
  148. package/lib/tags/vocabulary.mjs +140 -0
  149. package/lib/telemetry/client.mjs +5 -1
  150. package/lib/telemetry/otel-tracer.mjs +184 -0
  151. package/lib/telemetry/skill-calls.mjs +73 -12
  152. package/lib/uninstall/uninstall.mjs +1 -1
  153. package/lib/update.mjs +1 -1
  154. package/lib/validator.mjs +57 -56
  155. package/lib/version.mjs +51 -0
  156. package/lib/worker/trace.mjs +5 -1
  157. package/lib/workflows/instantiate.mjs +320 -0
  158. package/package.json +16 -3
  159. package/personas/construct.md +5 -3
  160. package/platforms/claude/CLAUDE.md +1 -1
  161. package/rules/common/development-workflow.md +2 -1
  162. package/rules/common/no-fabrication.md +69 -0
  163. package/rules/common/review-before-change.md +58 -0
  164. package/scripts/{sync-agents.mjs → sync-specialists.mjs} +171 -68
  165. package/skills/ai/prompt-optimizer.md +3 -3
  166. package/skills/exploration/dependency-graph-reading.md +98 -0
  167. package/skills/exploration/tracer-bullet-method.md +71 -0
  168. package/skills/exploration/unknown-codebase-onboarding.md +91 -0
  169. package/skills/operating/change-management.md +91 -0
  170. package/skills/operating/incident-response.md +75 -0
  171. package/skills/operating/oncall-rotation.md +95 -0
  172. package/skills/operating/orchestration-reference.md +2 -2
  173. package/skills/strategy/competitive-landscape.md +75 -0
  174. package/skills/strategy/market-research-methods.md +87 -0
  175. package/skills/strategy/narrative-arc.md +77 -0
  176. package/skills/strategy/pricing-positioning.md +94 -0
  177. package/specialists/contracts.json +1002 -0
  178. package/specialists/contracts.schema.json +83 -0
  179. package/specialists/policy-inventory.json +160 -0
  180. package/{agents → specialists}/prompts/cx-accessibility.md +3 -1
  181. package/{agents → specialists}/prompts/cx-ai-engineer.md +3 -1
  182. package/{agents → specialists}/prompts/cx-architect.md +3 -1
  183. package/{agents → specialists}/prompts/cx-business-strategist.md +3 -1
  184. package/{agents → specialists}/prompts/cx-data-analyst.md +3 -1
  185. package/{agents → specialists}/prompts/cx-data-engineer.md +3 -1
  186. package/{agents → specialists}/prompts/cx-debugger.md +3 -1
  187. package/{agents → specialists}/prompts/cx-designer.md +3 -1
  188. package/{agents → specialists}/prompts/cx-devil-advocate.md +3 -1
  189. package/{agents → specialists}/prompts/cx-docs-keeper.md +4 -2
  190. package/{agents → specialists}/prompts/cx-engineer.md +4 -2
  191. package/{agents → specialists}/prompts/cx-evaluator.md +3 -1
  192. package/{agents → specialists}/prompts/cx-explorer.md +3 -1
  193. package/{agents → specialists}/prompts/cx-legal-compliance.md +3 -1
  194. package/{agents → specialists}/prompts/cx-operations.md +3 -1
  195. package/{agents → specialists}/prompts/cx-orchestrator.md +4 -2
  196. package/{agents → specialists}/prompts/cx-platform-engineer.md +3 -1
  197. package/{agents → specialists}/prompts/cx-product-manager.md +3 -1
  198. package/{agents → specialists}/prompts/cx-qa.md +3 -1
  199. package/{agents → specialists}/prompts/cx-rd-lead.md +3 -1
  200. package/{agents → specialists}/prompts/cx-release-manager.md +3 -1
  201. package/{agents → specialists}/prompts/cx-researcher.md +3 -1
  202. package/{agents → specialists}/prompts/cx-reviewer.md +4 -2
  203. package/{agents → specialists}/prompts/cx-security.md +3 -1
  204. package/{agents → specialists}/prompts/cx-sre.md +4 -2
  205. package/{agents → specialists}/prompts/cx-test-automation.md +3 -1
  206. package/{agents → specialists}/prompts/cx-trace-reviewer.md +5 -3
  207. package/{agents → specialists}/prompts/cx-ux-researcher.md +3 -1
  208. package/{agents → specialists}/registry.json +651 -418
  209. package/{agents → specialists}/role-manifests.json +8 -8
  210. package/templates/docs/construct_guide.md +6 -6
  211. package/templates/docs/skill-artifact.md +1 -1
  212. package/templates/provider-scaffold/health.test.mjs +30 -0
  213. package/templates/provider-scaffold/index.mjs +48 -0
  214. package/templates/workflows/cross-team-handoff.yml +85 -0
  215. package/templates/workflows/engineering-onboarding.yml +77 -0
  216. package/templates/workflows/new-feature.yml +53 -0
  217. package/agents/contracts.json +0 -387
  218. /package/{agents → specialists}/teams.json +0 -0
@@ -0,0 +1,91 @@
1
+ <!--
2
+ skills/exploration/unknown-codebase-onboarding.md (Unknown Codebase Onboarding)
3
+ Use when a specialist is operating in a new or unfamiliar codebase and
4
+ needs a systematic path from zero context to productive contribution.
5
+ Covers first-hour, first-day, and first-week checkpoints.
6
+ -->
7
+
8
+ # Unknown Codebase Onboarding
9
+
10
+ Use when entering an unfamiliar codebase for the first time, or when the task requires understanding a system you haven't touched before.
11
+
12
+ ## First-hour checklist (orientation)
13
+
14
+ The goal in the first hour is to build a mental model of the system's shape, not to understand every detail.
15
+
16
+ **1. Start with the entry points:**
17
+ ```bash
18
+ # What runs? What are the main binaries / services?
19
+ ls bin/ scripts/ cmd/ src/main*
20
+
21
+ # What does the README say is the first command to run?
22
+ cat README.md | head -60
23
+ ```
24
+
25
+ **2. Understand the dependency graph:**
26
+ ```bash
27
+ cat package.json | jq '{name, version, scripts, dependencies: (.dependencies | keys), devDependencies: (.devDependencies | keys)}'
28
+ # or: cat Cargo.toml, go.mod, pom.xml, requirements.txt
29
+ ```
30
+
31
+ **3. Find the test suite:**
32
+ ```bash
33
+ ls tests/ test/ spec/ __tests__/
34
+ # What's the test runner? How do you run it?
35
+ grep -i test package.json | head -5
36
+ ```
37
+
38
+ **4. Find the data model:**
39
+ ```bash
40
+ ls db/ schema/ migrations/ prisma/ models/
41
+ # For a service: what does it store, and how is it structured?
42
+ ```
43
+
44
+ **5. Trace one request end-to-end:**
45
+ Pick the simplest happy path through the system and trace it from entry point to output. This reveals the architectural seams and where decisions live.
46
+
47
+ ## First-day checklist (orientation to action)
48
+
49
+ **Identify the change surface:**
50
+ - What is the most recently changed directory? (`git log --name-only --pretty=format: | sort | uniq -c | sort -rn | head -20`)
51
+ - What directories do most PRs touch? High-churn areas are where active work lives.
52
+
53
+ **Understand the invariants:**
54
+ - Are there comments marked `INVARIANT`, `IMPORTANT`, `DO NOT CHANGE`, or `CRITICAL`? These are the load-bearing beliefs.
55
+ - Are there tests marked `regression` or referencing bug IDs? These document specific failure modes.
56
+
57
+ **Find the configuration layer:**
58
+ ```bash
59
+ # Environment variables the system reads
60
+ grep -r 'process\.env\.\|os\.environ\|getenv' --include='*.js' --include='*.py' --include='*.go' | grep -v test | grep -v node_modules
61
+ ```
62
+
63
+ **Identify the seams:**
64
+ - Where does the system boundary end? What does it call out to (APIs, databases, queues)?
65
+ - What are the contracts at those seams (types, schemas, documented expectations)?
66
+
67
+ ## First-week checklist (productive contribution)
68
+
69
+ **Build a dependency map:**
70
+ - Which modules are leaf nodes (pure logic, few dependencies)?
71
+ - Which modules are hubs (imported everywhere, high coupling)?
72
+ - Leaf nodes are safe to modify; hub changes have blast radius.
73
+
74
+ **Read the ADRs and postmortems:**
75
+ - Architecture decisions (`docs/adr/`, `decisions/`, `DECISIONS.md`) explain why the code is shaped the way it is.
76
+ - Postmortems explain what has already broken and how the system defends against it. Don't break a defense you don't understand.
77
+
78
+ **Find the test coverage gaps:**
79
+ - Which modules have no tests? These are the highest-risk areas to modify.
80
+ - Which tests are flaky (retry logic, `skip`, `todo`)? Unreliable tests produce unreliable confidence.
81
+
82
+ **Validate your mental model:**
83
+ - Before making a change, explain to a colleague (or write down) what the change does and why it won't break anything. If you can't explain it, you don't understand it yet.
84
+ - After making a change, check: did any behavior you didn't intend to change actually change? Diff the test output.
85
+
86
+ ## Anti-patterns when onboarding
87
+
88
+ - **Deep-diving before breadth-surveying**: the codebase is large; get the shape before the details.
89
+ - **Modifying without understanding invariants**: breaking a behavior that was intentional because you didn't know why it existed.
90
+ - **Trusting test coverage numbers**: 80% coverage means 80% of lines are executed, not that 80% of behaviors are tested.
91
+ - **Ignoring comments with bug IDs**: comments that say `// workaround for PROJ-123` are load-bearing. Look up the issue before removing them.
@@ -0,0 +1,91 @@
1
+ <!--
2
+ skills/operating/change-management.md (Change Management)
3
+ Use when categorizing a technical or organizational change, designing
4
+ a rollout plan, or determining what approval gates are appropriate.
5
+ Covers the Type 1 / Type 2 door framework, irreversibility analysis,
6
+ and rollback planning.
7
+ -->
8
+
9
+ # Change Management
10
+
11
+ Use when a change needs to be categorized by reversibility, when designing rollout gates, or when the team is uncertain how much approval process a change warrants.
12
+
13
+ ## Type 1 / Type 2 door framework
14
+
15
+ From Jeff Bezos's 1997 Amazon shareholder letter, widely adopted in engineering practice.
16
+
17
+ **Type 1 (one-way door):** irreversible or nearly irreversible decisions. Once made, you cannot easily go back. These deserve deliberation proportional to their irreversibility.
18
+
19
+ **Type 2 (two-way door):** reversible decisions. If the outcome is not what you expected, you can reverse course. These should be made quickly and by the smallest appropriate team.
20
+
21
+ **The error to avoid:** treating Type 2 decisions as Type 1. This is over-process and slows velocity. The inverse error (treating Type 1 as Type 2) is less common but more costly, it produces outcomes you cannot undo.
22
+
23
+ ## Irreversibility analysis
24
+
25
+ Before applying process overhead, characterize the change:
26
+
27
+ | Dimension | Questions |
28
+ |---|---|
29
+ | Data | Does this destroy, transform, or expose data in a way that can't be undone? |
30
+ | External commitments | Does this change a customer-facing API, SLA, or contractual commitment? |
31
+ | Infrastructure | Does this change cost structure, provider lock-in, or architectural constraints? |
32
+ | Organizational | Does this change team structure, ownership, or decision authority in ways that are hard to reverse? |
33
+ | Regulatory | Does this trigger compliance obligations that, once triggered, can't be untriggered? |
34
+
35
+ A change that answers "yes" to any of these is at least partially Type 1. The more "yes" answers, the more deliberation is warranted.
36
+
37
+ ## Rollout gate design
38
+
39
+ **Principle:** the smaller the blast radius of a failure, the fewer gates are needed before the next stage.
40
+
41
+ **Standard progressive rollout:**
42
+ 1. Shadow (traffic mirroring, no user impact)
43
+ 2. Canary (1-5% of traffic, monitored closely)
44
+ 3. Staged (10% → 25% → 50% → 100%, with soak time at each stage)
45
+ 4. Full rollout
46
+
47
+ **Gate criteria (decide before rollout starts):**
48
+ - What metrics are you watching?
49
+ - What threshold triggers a rollback?
50
+ - Who has authority to advance to the next stage?
51
+ - Who has authority to pause or roll back?
52
+
53
+ Gates without pre-defined criteria become political. Define the criteria before anyone has invested in the outcome.
54
+
55
+ ## Rollback planning
56
+
57
+ **Rule:** if you don't have a rollback plan before you deploy, you don't have a plan.
58
+
59
+ **Rollback plan minimum:**
60
+ - What is the rollback action (revert deploy, run migration-down, disable feature flag)?
61
+ - How long does rollback take?
62
+ - Is there a data migration that can't be reversed? If so, what's the strategy?
63
+ - Who executes the rollback, and how are they notified?
64
+
65
+ **Rollback triggers:**
66
+ - Define in terms of observable signals, not opinions. "Error rate > 1% for 5 minutes" is a trigger. "Things feel wrong" is not.
67
+
68
+ ## Approval gates
69
+
70
+ **For Type 2 changes:** the default should be no approval gate, or approval by the team lead. Adding approval gates to reversible changes is a tax on velocity that buys nothing.
71
+
72
+ **For Type 1 changes:** approval gates should match the scope of irreversibility:
73
+ - Data schema changes with a migration: DBA or senior engineer review.
74
+ - External API changes: product owner + customer success (customer impact).
75
+ - Infrastructure changes with cost implications: engineering lead + finance stakeholder.
76
+ - Organizational restructuring: executive sponsor.
77
+
78
+ **Anti-pattern:** using approval gates as a substitute for design review. Gates check whether the change is approved; they don't improve the quality of the change. Design review should happen before the gate, not at it.
79
+
80
+ ## Communication plan
81
+
82
+ For any change with external impact, the communication plan is part of the change plan.
83
+
84
+ **Minimum elements:**
85
+ - Who needs to know (customers, partners, other teams)?
86
+ - When do they need to know (before, during, or after the change)?
87
+ - What channel (email, status page, in-product, account team)?
88
+ - What's the message (what changed, why, what they need to do)?
89
+ - Who owns the communication?
90
+
91
+ For Type 1 changes, write the communication before executing the change, not after.
@@ -0,0 +1,75 @@
1
+ <!--
2
+ skills/operating/incident-response.md (Incident Response)
3
+ Use when a production issue is active, when drafting incident process,
4
+ or when running a postmortem. Covers severity tiers, war-room roles,
5
+ communication cadence, blameless postmortem structure, and MTTR
6
+ discipline.
7
+ -->
8
+
9
+ # Incident Response
10
+
11
+ Use when an issue is active in production, when building incident process from scratch, or when reviewing postmortems for quality.
12
+
13
+ ## Severity tiers
14
+
15
+ Define tiers in terms of customer impact, not system state. A database at 80% CPU is not an incident; a checkout flow returning 500s is.
16
+
17
+ | Tier | Customer impact | Response time | Escalation |
18
+ |---|---|---|---|
19
+ | SEV-1 | Complete outage or data loss for any customers | Immediate; all-hands | CEO, CTO, on-call lead in 15 min |
20
+ | SEV-2 | Significant degradation affecting >10% of users or a critical path | Within 15 min | On-call lead, product lead |
21
+ | SEV-3 | Partial degradation, workaround exists | Within 1 hour | On-call engineer |
22
+ | SEV-4 | Minor issue, no customer impact yet | Next business day | Backlog |
23
+
24
+ Sev assignment belongs to the incident commander, not the engineer who discovered it.
25
+
26
+ ## War-room roles
27
+
28
+ Assign these before the call gets noisy:
29
+
30
+ - **Incident commander (IC)**: owns the decision tree. Delegates; does not debug. Calls the all-clear. One person only.
31
+ - **Technical lead**: owns diagnosis and remediation. Reports status to IC every 10 minutes.
32
+ - **Comms lead**: owns customer-facing status page updates and internal stakeholder messages. Never blocks on perfect information.
33
+ - **Scribe**: documents timeline, decisions, and action items in real time. Even partial notes are better than none.
34
+
35
+ Rule: if someone doesn't have a role, they should be a silent observer or leave the call.
36
+
37
+ ## Communication cadence
38
+
39
+ **During the incident:**
40
+ - External: update status page within 5 minutes of SEV-1 declaration, then every 30 minutes. "We are investigating an issue affecting X" is always better than silence.
41
+ - Internal: Slack incident channel, pinned message, updated on same cadence.
42
+ - Escalation: when ETA to resolution is unknown after 30 minutes, escalate one level.
43
+
44
+ **External message template:**
45
+ > We are aware of an issue affecting [feature/service]. Our team is actively investigating. We will provide an update by [time]. [Link to status page]
46
+
47
+ Never estimate resolution time in external comms unless you have high confidence. "By 3pm PT" that slips twice destroys trust faster than silence.
48
+
49
+ ## MTTR discipline
50
+
51
+ Mean time to recovery is the metric that matters during an incident. Every step in the response should be evaluated by: "does this reduce MTTR or not?"
52
+
53
+ Common MTTR killers:
54
+ - Running full diagnosis before attempting rollback (rollback first, understand later)
55
+ - Waiting for approval from someone not on the call
56
+ - Unclear ownership of the remediation step
57
+ - Comms blocking on engineering (they should run in parallel)
58
+
59
+ **Rollback-first rule:** for software incidents, the fastest path to recovery is almost always reverting the most recent change. Diagnose the root cause after the customer impact is gone.
60
+
61
+ ## Blameless postmortem structure
62
+
63
+ Blameless means the analysis focuses on systems and processes, not on individual error. The goal is improvements that prevent recurrence, not punishment.
64
+
65
+ **Required sections:**
66
+ 1. **Timeline**: minute-by-minute reconstruction. Include when monitoring alerted, when the first human noticed, when diagnosis began, when remediation started, when recovery was confirmed.
67
+ 2. **Impact**: quantified customer impact (users affected, revenue at risk, SLA breached or not).
68
+ 3. **Root cause**: the systemic factor that made this failure possible. Not "human error", that's never a root cause. Ask "why was this configuration possible?" not "why did the engineer misconfigure it?"
69
+ 4. **Contributing factors**: secondary conditions that amplified impact or delayed recovery.
70
+ 5. **Action items**: each item has an owner and a due date. No owner = no item.
71
+
72
+ **Five-whys for root cause:**
73
+ Ask "why" five times until you reach a system-level explanation. Stop when you hit something that a process, test, or monitoring improvement can address.
74
+
75
+ **Distribution:** share postmortems broadly (engineering-wide, leadership summary). Hoarding postmortems prevents organizational learning.
@@ -0,0 +1,95 @@
1
+ <!--
2
+ skills/operating/oncall-rotation.md (On-Call Rotation)
3
+ Use when designing an on-call schedule, reviewing runbook quality, or
4
+ handling escalation protocols. Covers handoff structure, runbook quality
5
+ bar, escalation chains, and on-call health indicators.
6
+ -->
7
+
8
+ # On-Call Rotation
9
+
10
+ Use when setting up on-call, reviewing its health, or handling an escalation during a rotation.
11
+
12
+ ## Rotation design
13
+
14
+ **Coverage model options:**
15
+
16
+ - **Follow-the-sun**: different engineers cover different time zones. Requires team distribution across 3+ time zones to avoid coverage gaps. Reduces overnight pages.
17
+ - **Single-shift**: one engineer covers a full week. Simpler coordination. Works for small teams where follow-the-sun isn't viable. Requires enforced recovery time after high-incident weeks.
18
+ - **Paired on-call**: primary + secondary. Secondary only engages if primary doesn't acknowledge within N minutes. Reduces burnout from false alarms; adds coordination cost.
19
+
20
+ **Rotation length:**
21
+ - 1 week per rotation is the industry standard for teams with reasonable incident rates.
22
+ - Longer rotations (2 weeks) reduce context-switching but increase risk of burnout during high-incident periods.
23
+ - Short rotations (<1 week) reduce individual exposure but increase handoff overhead.
24
+
25
+ **On-call health indicators:**
26
+ - Average pages per shift: >5 actionable pages/week is a process smell; >10 is a reliability emergency.
27
+ - False alarm rate: >30% of pages should not have paged are training the team to ignore alerts.
28
+ - After-hours page frequency: tracking this over time is how you build the case for reliability investment.
29
+
30
+ ## Runbook quality bar
31
+
32
+ A runbook that takes more than 5 minutes to find the right section has failed its design goal. A runbook that can't be followed by a new engineer at 2am has also failed.
33
+
34
+ **Required sections for every runbook:**
35
+ 1. **Alert description**: what fired, what it measures, what threshold triggered it.
36
+ 2. **Impact assessment**: how to determine customer impact (which metrics to check, which queries to run).
37
+ 3. **Triage steps**: concrete commands or links in priority order. Not explanations; steps.
38
+ 4. **Escalation path**: who to page next if triage doesn't resolve within 30 minutes. Named people with contact method.
39
+ 5. **Common resolutions**: the 3-5 fixes that cover 80% of this alert's pages. Link to rollback procedure.
40
+ 6. **Related alerts**: alerts that fire together with this one; the combination often indicates the root cause faster.
41
+
42
+ **Runbook review cadence:** every runbook should be reviewed and verified after each page that required it. Stale runbooks are worse than no runbooks because they create false confidence.
43
+
44
+ ## Handoff protocol
45
+
46
+ **At shift end:**
47
+ - Document any open or ongoing issues with current status.
48
+ - Note any alerts that fired but were suppressed or ignored (and why).
49
+ - Flag any systems in degraded state that might page in the next shift.
50
+ - Confirm the incoming engineer acknowledges the handoff, async is not a handoff.
51
+
52
+ **Handoff template:**
53
+ ```
54
+ Shift: [start] → [end]
55
+ Pages: [count] actionable, [count] false alarms
56
+ Open issues:
57
+ - [issue]: current status, expected resolution, owner
58
+ Watch items (might page):
59
+ - [system]: reason for concern, what to check if it fires
60
+ Suppressed alerts:
61
+ - [alert]: reason suppressed, when to re-enable
62
+ ```
63
+
64
+ ## Escalation chain
65
+
66
+ **Design principles:**
67
+ - Every engineer on-call must know the full escalation chain before they go on.
68
+ - Escalation should never require asking who to escalate to during an incident.
69
+ - The escalation chain should be in the runbook, in the incident channel topic, and in the rotation documentation.
70
+
71
+ **When to escalate immediately (don't wait):**
72
+ - SEV-1 in production with no clear path to resolution within 30 minutes
73
+ - Data loss or risk of data loss
74
+ - Security incident or suspected breach
75
+ - Financial impact beyond a defined threshold
76
+
77
+ **Escalation anti-patterns:**
78
+ - Escalating silently (notify the escalation path that you're escalating and why)
79
+ - Escalating and then detaching (you're still on the call unless explicitly relieved)
80
+ - Failing to escalate because "I don't want to wake them up", that's what the on-call contract is for
81
+
82
+ ## On-call health and sustainability
83
+
84
+ On-call is a tax on engineering velocity. Track it explicitly.
85
+
86
+ **Metrics to report monthly:**
87
+ - Total pages per engineer per shift
88
+ - After-hours page rate
89
+ - Pages that required human action vs. self-resolved
90
+ - Runbook coverage rate (pages that had a runbook vs. those that didn't)
91
+
92
+ **Sustainability signals:**
93
+ - Engineers expressing reluctance to be on-call is a signal, not a discipline issue.
94
+ - High turnover on teams with heavy on-call burden is a reliability cost, not a people cost.
95
+ - If on-call requires more than 10 hours/week of active response on average, the system is broken.
@@ -67,7 +67,7 @@ Do not duplicate skill internals inside agent prompts. Reference the relevant sk
67
67
 
68
68
  ## Agent-to-agent service contracts
69
69
 
70
- Every producer→consumer pair has an explicit contract in `agents/contracts.json`, loaded via `lib/agent-contracts.mjs`. Specialists call the MCP tool `agent_contract` at the start of a handoff to see:
70
+ Every producer→consumer pair has an explicit contract in `specialists/contracts.json`, loaded via `lib/specialist-contracts.mjs`. Specialists call the MCP tool `agent_contract` at the start of a handoff to see:
71
71
 
72
72
  - `input.mustContain`: fields the packet must carry
73
73
  - `input.schema`: JSON schema (when applicable) from `lib/schemas/`
@@ -75,7 +75,7 @@ Every producer→consumer pair has an explicit contract in `agents/contracts.jso
75
75
  - `output.schema` / `output.shape`: expected return shape
76
76
  - `postconditions`: what must be true before marking DONE
77
77
 
78
- Examples of contracts (full list in `agents/contracts.json`):
78
+ Examples of contracts (full list in `specialists/contracts.json`):
79
79
 
80
80
  - `researcher-to-architect`: research brief with ≥2 primary sources → decision
81
81
  - `product-manager-to-architect`: PRD handoff → decision with Rejected alternatives
@@ -0,0 +1,75 @@
1
+ <!--
2
+ skills/strategy/competitive-landscape.md (Competitive Landscape Analysis)
3
+ Use when the team needs a structured read on where competitors sit, what
4
+ customers have already decided, and where defensible whitespace exists.
5
+ Covers Porter Five Forces, Jobs-to-be-Done framing, and competitive
6
+ response sequencing.
7
+ -->
8
+
9
+ # Competitive Landscape Analysis
10
+
11
+ Use when the team needs a structured read on market positioning before committing direction.
12
+
13
+ ## Porter Five Forces, applied to software products
14
+
15
+ Run each force as a question, not a score. The goal is to surface which force is the
16
+ active constraint on your strategy right now.
17
+
18
+ ### Threat of new entrants
19
+ - What stops a better-funded team from replicating your core capability in 18 months?
20
+ - Moats that compound: data flywheel, switching cost, workflow embeds, network effects. Pick the one that applies, don't claim all four.
21
+ - Regulatory barriers (SOC 2, HIPAA, FedRAMP) are real but temporary, they slow entry, they don't stop it.
22
+
23
+ ### Bargaining power of suppliers
24
+ - Model providers, cloud infrastructure, and key open-source dependencies are all suppliers.
25
+ - Concentration risk: how many alternatives exist? What's the migration cost if one raises prices or shuts down?
26
+ - Lock-in signals: proprietary APIs, undocumented behavior you rely on, single-vendor fine-tuning.
27
+
28
+ ### Bargaining power of buyers
29
+ - SMB buyers have low switching costs and high price sensitivity. Enterprise buyers have high switching costs and low price sensitivity, but a long sales cycle to match.
30
+ - Who actually approves the purchase? Who blocks it? These are often different people.
31
+ - Churn rate is the revealed preference signal. "They say they like it" is not data.
32
+
33
+ ### Threat of substitutes
34
+ - The substitute is rarely a direct competitor. It's the customer doing it themselves (spreadsheet, internal tool, hiring a human).
35
+ - Ask: what does the customer do today if your product goes offline for a week? That's the substitute.
36
+ - Substitutes get more dangerous when your segment moves upmarket and leaves the low end exposed.
37
+
38
+ ### Competitive rivalry
39
+ - Crowded markets with undifferentiated offerings compete on price. Avoid this unless unit economics are exceptional.
40
+ - Rivalry intensity signals: frequency of feature matching, public pricing wars, customer churn going peer-to-peer.
41
+
42
+ ## Jobs-to-be-Done framing
43
+
44
+ Forces analysis tells you where power sits. JTBD tells you what customers are actually hiring your product to do.
45
+
46
+ **The hire/fire framing:**
47
+ - What job was the customer trying to get done before they found you?
48
+ - What did they fire to hire you? (The fired solution is your real substitute.)
49
+ - What circumstances trigger the hire? (The trigger is your acquisition moment, optimize for it.)
50
+
51
+ **Functional vs. emotional vs. social jobs:**
52
+ - Functional: the task they need to complete.
53
+ - Emotional: how they want to feel while doing it (confident, in control, not embarrassed).
54
+ - Social: how they want to be seen by others because of it.
55
+
56
+ Enterprise B2B products often win or lose on the social job (does this make the champion look smart to their VP?).
57
+
58
+ ## Competitive response sequencing
59
+
60
+ When a competitor moves:
61
+ 1. **Classify the move**: is this feature parity (they're catching up) or capability shift (they're changing the game)?
62
+ 2. **Test before responding**: does anyone in your current customer base care? Run a 5-customer pulse before committing resources.
63
+ 3. **Response options** (in order of cost):
64
+ - Ignore (if it doesn't affect the customer jobs you own)
65
+ - Narrate (position why your approach is intentionally different)
66
+ - Match (only if the feature addresses a job you claim to own)
67
+ - Leapfrog (only if you have a structural advantage, don't out-resource a well-funded competitor on a feature race)
68
+
69
+ ## Whitespace identification
70
+
71
+ Whitespace is where customers have unsatisfied jobs your segment ignores.
72
+
73
+ - Run a win/loss analysis on the last 20 closed deals. What patterns explain the losses that weren't price-based?
74
+ - Look at the jobs customers do in adjacent tools after they close the loop in yours. That adjacency is the whitespace.
75
+ - Validate with a demand signal before building: can you pre-sell, get letters of intent, or get named demand from 3+ distinct customers?
@@ -0,0 +1,87 @@
1
+ <!--
2
+ skills/strategy/market-research-methods.md (Market Research Methods)
3
+ Use when planning customer discovery, validating product direction, or
4
+ sizing a market. Covers qualitative and quantitative methods, JTBD
5
+ interview technique, survey design traps, and research-to-decision
6
+ handoff.
7
+ -->
8
+
9
+ # Market Research Methods
10
+
11
+ Use when the team needs to validate assumptions before committing resources, or when a decision is being made on vibes rather than signal.
12
+
13
+ ## Qualitative methods
14
+
15
+ ### Jobs-to-be-Done interviews
16
+
17
+ The only interview format worth running for product direction. The goal is to understand the customer's decision story, not to collect feature requests.
18
+
19
+ **Recruiting:** target customers who recently switched (to you, away from you, or to a substitute). Recent decisions produce vivid recall. Loyal long-term customers explain their current satisfaction, not their original hire.
20
+
21
+ **Interview arc (30-45 minutes):**
22
+ 1. **First thought**: "When did you first realize you needed something for this?" Surfaces the trigger and timeline.
23
+ 2. **Decision story**: "Walk me through how you actually solved it." Don't ask what they want; ask what they did.
24
+ 3. **Passive looking**: "Were you looking for a solution before you found one?" Maps latent-to-active journey.
25
+ 4. **Active looking**: "What did you consider? Why did you reject each one?"
26
+ 5. **First use**: "What did you do right after you signed up / started using it?"
27
+ 6. **Anxiety and progress**: "What worried you? What made you feel it was working?"
28
+
29
+ **Anti-patterns:**
30
+ - "What features would you want?", produces a wish list, not a decision signal.
31
+ - Leading with your solution, contaminates the demand signal.
32
+ - Asking about the future, customers are poor forecasters of their own behavior.
33
+
34
+ ### Contextual inquiry
35
+
36
+ Observe customers doing the job in their actual environment. Watch for workarounds, handoffs to other tools, and moments of friction that they've normalized and won't mention in an interview.
37
+
38
+ ## Quantitative methods
39
+
40
+ ### Survey design
41
+
42
+ Surveys measure prevalence of known patterns, not discovery. Run qualitative first.
43
+
44
+ **Scale rules:**
45
+ - Use 5-point Likert for agreement/frequency; 7-point for satisfaction/importance.
46
+ - Anchor both ends explicitly: "1 = strongly disagree, 5 = strongly agree."
47
+ - Randomize option order for non-ordinal questions to reduce position bias.
48
+
49
+ **Question traps to avoid:**
50
+ - Double-barreled: "Is the product fast and easy to use?", one question, two dimensions.
51
+ - Leading: "How much do you enjoy using…?", primes positive response.
52
+ - Hypothetical: "Would you use this feature?", intent ≠ behavior; use price or time-tradeoff framing instead.
53
+ - Recall over 90 days, reliability drops sharply.
54
+
55
+ **Sample sizes:**
56
+ - Directional signal (±10 pp): n ≥ 100
57
+ - Decision-grade (±5 pp): n ≥ 400
58
+ - Segment cuts multiply requirements: each additional segment you want to analyze independently needs its own sample size.
59
+
60
+ ### Instrumentation and behavioral data
61
+
62
+ Behavioral data is the gold standard because it captures revealed preference, not stated preference.
63
+
64
+ Key instrumentation contracts:
65
+ - **Activation event**: the single action that predicts retention at 30 days (find this via cohort analysis).
66
+ - **Engagement breadth**: how many distinct features does a retained user touch?
67
+ - **Time-to-value**: how long from signup to activation event? Optimize this before optimizing acquisition.
68
+
69
+ ## Market sizing
70
+
71
+ Use TAM/SAM/SOM only as a forcing function for conversation, not as a precision forecast.
72
+
73
+ - **TAM** (total addressable market): the revenue available if you had 100% of every relevant customer.
74
+ - **SAM** (serviceable addressable market): the segment you can reach with your current GTM.
75
+ - **SOM** (serviceable obtainable market): what you can realistically capture in 18-24 months.
76
+
77
+ **Bottom-up sizing is more credible than top-down:**
78
+ - Count the buyers, estimate the contract value, model conversion rate.
79
+ - "X% of a $Y billion market" tells investors nothing about why you'll capture it.
80
+
81
+ ## Research-to-decision handoff
82
+
83
+ Research is only valuable when it changes a decision. Before fielding any study, answer: "What decision will this inform, and what finding would change our plan?"
84
+
85
+ Document as: "If we find [X], we will [action]. If we find [Y], we will [different action]."
86
+
87
+ If both answers lead to the same action, skip the research.
@@ -0,0 +1,77 @@
1
+ <!--
2
+ skills/strategy/narrative-arc.md (Strategic Narrative Construction)
3
+ Use when drafting a strategy memo, PRD positioning section, board update,
4
+ or fundraising narrative. Covers Andy Raskin's strategic narrative
5
+ structure, the five components of a compelling story, and common failure
6
+ modes in executive communication.
7
+ -->
8
+
9
+ # Strategic Narrative Construction
10
+
11
+ Use when the argument must move people, not just inform them. Strategic narrative is the difference between a document that gets read and one that changes what people do.
12
+
13
+ ## Andy Raskin's five-move structure
14
+
15
+ The most replicable framework for B2B strategic narrative. Originates from Raskin's coaching of Salesforce, Zuora, and Gong.
16
+
17
+ ### Move 1: Name the undeniable shift
18
+
19
+ Identify a shift in the world that is already happening and that everyone in the room can recognize as real. Do not start with your product. Start with the world changing.
20
+
21
+ > "Buyers now do 70% of their research before contacting a vendor", not "our product helps with sales."
22
+
23
+ The shift must be:
24
+ - External (not something you caused)
25
+ - Undeniable (skeptics can't argue it isn't happening)
26
+ - Urgent (the implication is clear: act now or be left behind)
27
+
28
+ **Common failure:** calling internal company changes a shift. "We're scaling fast" is not a shift; it's a status update.
29
+
30
+ ### Move 2: Name the winners and losers
31
+
32
+ Who wins because of the shift? Who loses? The audience should recognize themselves in the winner column if they engage, and in the loser column if they don't.
33
+
34
+ This creates stakes. Without stakes, the narrative is interesting but not motivating.
35
+
36
+ ### Move 3: Tease the promised land
37
+
38
+ Describe the world after, what it looks like for the winner. This is the transformation, not the solution. It's a destination, not a feature.
39
+
40
+ The promised land must be:
41
+ - Specific enough to be vivid
42
+ - Desirable to the target customer
43
+ - Achievable with effort (not utopian)
44
+
45
+ ### Move 4: Introduce your capabilities as the path
46
+
47
+ Only now introduce your product. Present capabilities as the specific things that make the promised land reachable. Each capability maps to an obstacle on the path.
48
+
49
+ Frame as: "Here's why the promised land has been hard to reach, and here's what we built to remove that obstacle."
50
+
51
+ ### Move 5: Present evidence
52
+
53
+ Social proof, customer stories, and data that confirm others have successfully made the journey. The evidence should feel like proof that the promised land is real and reachable.
54
+
55
+ ## Application to PRDs
56
+
57
+ In a product requirements document, the narrative arc goes in the positioning section:
58
+
59
+ - **Context** = the shift (what changed in the world or for users)
60
+ - **Problem** = the losers (who's failing today and why)
61
+ - **Vision** = the promised land (what success looks like)
62
+ - **Bet** = our specific capabilities (why our approach unlocks the vision)
63
+ - **Evidence** = research, customer signals, analogous markets
64
+
65
+ ## Application to board updates
66
+
67
+ Board updates fail when they lead with metrics. Metrics are evidence, not story. Lead with: what changed in the world, how the company is positioned relative to that change, and what the plan is for the next 90 days.
68
+
69
+ Structure: shift → where we stand → what we're doing → what we need.
70
+
71
+ ## Common failure modes
72
+
73
+ - **Solutions looking for problems**: the narrative leads with the product. Fix by asking: "What world-shift makes this product necessary right now?"
74
+ - **Vague promised land**: "a world where X is easier" is not vivid. Name the specific outcome, in the customer's units.
75
+ - **Missing stakes**: if the reader can ignore the narrative without cost, there are no stakes. Make the cost of inaction visible.
76
+ - **Evidence-free claims**: assertions without customer quotes, data, or analogous proof feel like marketing. Every claim in the arc needs a backing signal the audience can evaluate.
77
+ - **Talking to everyone**: a narrative that is for everyone is compelling to no one. Name the specific job title, company stage, or situation the narrative is for. Everything else is wasted.