@massa-ai/cursor-plugin 1.6.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/.cursor-plugin/plugin.json +5 -0
- package/README.md +87 -0
- package/agents/massa-ai-architecture-specialist.md +65 -0
- package/agents/massa-ai-audit-specialist.md +81 -0
- package/agents/massa-ai-builder.md +67 -0
- package/agents/massa-ai-context-curator.md +67 -0
- package/agents/massa-ai-documentation-agent.md +65 -0
- package/agents/massa-ai-furps-analyst.md +71 -0
- package/agents/massa-ai-investigator.md +68 -0
- package/agents/massa-ai-mobile-specialist.md +82 -0
- package/agents/massa-ai-navigator.md +75 -0
- package/agents/massa-ai-plan-critic.md +90 -0
- package/agents/massa-ai-planner.md +65 -0
- package/agents/massa-ai-requirements-analyst.md +64 -0
- package/agents/massa-ai-reviewer.md +66 -0
- package/agents/massa-ai-test-engineer.md +66 -0
- package/agents/massa-ai-verification-agent.md +65 -0
- package/hooks/hooks.json +26 -0
- package/hooks/massa-ai-hook +298 -0
- package/install.sh +413 -0
- package/package.json +30 -0
- package/skills/agents/architecture-specialist/SKILL.md +69 -0
- package/skills/agents/audit-specialist/SKILL.md +85 -0
- package/skills/agents/builder/SKILL.md +71 -0
- package/skills/agents/context-curator/SKILL.md +71 -0
- package/skills/agents/documentation-agent/SKILL.md +69 -0
- package/skills/agents/furps-analyst/SKILL.md +74 -0
- package/skills/agents/investigator/SKILL.md +72 -0
- package/skills/agents/mobile-specialist/SKILL.md +86 -0
- package/skills/agents/navigator/SKILL.md +79 -0
- package/skills/agents/plan-critic/SKILL.md +93 -0
- package/skills/agents/planner/SKILL.md +69 -0
- package/skills/agents/requirements-analyst/SKILL.md +68 -0
- package/skills/agents/reviewer/SKILL.md +70 -0
- package/skills/agents/test-engineer/SKILL.md +70 -0
- package/skills/agents/verification-agent/SKILL.md +69 -0
- package/skills/def/SKILL.md +17 -0
- package/skills/find/SKILL.md +19 -0
- package/skills/graph/SKILL.md +16 -0
- package/skills/index/SKILL.md +19 -0
- package/skills/map/SKILL.md +24 -0
- package/skills/massa-ai/SKILL.md +315 -0
- package/skills/massa-ai/personas/README.md +35 -0
- package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
- package/skills/massa-ai/personas/catalog.json +157 -0
- package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
- package/skills/massa-ai/personas/product-manager.md +67 -0
- package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
- package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
- package/skills/massa-ai/references/adr-authoring.md +189 -0
- package/skills/massa-ai/references/agent-orchestration.md +221 -0
- package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
- package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
- package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
- package/skills/massa-ai/references/architecture-lenses.md +108 -0
- package/skills/massa-ai/references/audit-report-io.md +459 -0
- package/skills/massa-ai/references/audit-scope.md +103 -0
- package/skills/massa-ai/references/code-annotation.md +111 -0
- package/skills/massa-ai/references/codebase-investigation.md +96 -0
- package/skills/massa-ai/references/context-firewall.md +62 -0
- package/skills/massa-ai/references/conversation-feedback.md +104 -0
- package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
- package/skills/massa-ai/references/decision-engine.md +73 -0
- package/skills/massa-ai/references/evidence-gate.md +53 -0
- package/skills/massa-ai/references/furps/analyst-role.md +49 -0
- package/skills/massa-ai/references/furps/checklist.md +92 -0
- package/skills/massa-ai/references/furps/intake.md +104 -0
- package/skills/massa-ai/references/furps/report-contract.md +140 -0
- package/skills/massa-ai/references/hook-enforcement.md +137 -0
- package/skills/massa-ai/references/implementation-delivery.md +101 -0
- package/skills/massa-ai/references/installation.md +110 -0
- package/skills/massa-ai/references/lessons.md +119 -0
- package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
- package/skills/massa-ai/references/maestro/cli-device.md +65 -0
- package/skills/massa-ai/references/maestro/cloud.md +67 -0
- package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
- package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
- package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
- package/skills/massa-ai/references/maestro/mcp.md +59 -0
- package/skills/massa-ai/references/maestro/patterns.md +96 -0
- package/skills/massa-ai/references/maestro/selectors.md +91 -0
- package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
- package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
- package/skills/massa-ai/references/maestro.md +47 -0
- package/skills/massa-ai/references/mcp-tools.md +296 -0
- package/skills/massa-ai/references/memory-policy.md +103 -0
- package/skills/massa-ai/references/mobile-context.md +113 -0
- package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
- package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
- package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
- package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
- package/skills/massa-ai/references/naming-standards.md +47 -0
- package/skills/massa-ai/references/pr-task-fix.md +80 -0
- package/skills/massa-ai/references/project-context.md +76 -0
- package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
- package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
- package/skills/massa-ai/references/rfc/document-contract.md +85 -0
- package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
- package/skills/massa-ai/references/root-cause-scripts.md +97 -0
- package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
- package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
- package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
- package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
- package/skills/massa-ai/references/spec-driven/design.md +257 -0
- package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
- package/skills/massa-ai/references/spec-driven/execute.md +471 -0
- package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
- package/skills/massa-ai/references/spec-driven/memory.md +214 -0
- package/skills/massa-ai/references/spec-driven/specify.md +283 -0
- package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
- package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
- package/skills/massa-ai/references/spec-driven/validate.md +397 -0
- package/skills/massa-ai/references/subagent-design.md +132 -0
- package/skills/massa-ai/references/synapse-policy.md +160 -0
- package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
- package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
- package/skills/massa-ai/references/tdd/document-contract.md +136 -0
- package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
- package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
- package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
- package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
- package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
- package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
- package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
- package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
- package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
- package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
- package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
- package/skills/massa-ai/references/verification-ladder.md +62 -0
- package/skills/massa-ai/scripts/lessons.py +590 -0
- package/skills/massa-ai/workflows/adr.md +33 -0
- package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
- package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
- package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
- package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
- package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
- package/skills/massa-ai/workflows/commit.md +61 -0
- package/skills/massa-ai/workflows/debug.md +86 -0
- package/skills/massa-ai/workflows/design.md +54 -0
- package/skills/massa-ai/workflows/exploration.md +119 -0
- package/skills/massa-ai/workflows/feature.md +52 -0
- package/skills/massa-ai/workflows/general.md +46 -0
- package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
- package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
- package/skills/massa-ai/workflows/long-session.md +44 -0
- package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
- package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
- package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
- package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
- package/skills/massa-ai/workflows/onboarding.md +23 -0
- package/skills/massa-ai/workflows/refactor.md +47 -0
- package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
- package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
- package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
- package/skills/massa-ai/workflows/rfc.md +55 -0
- package/skills/massa-ai/workflows/security/security-audit.md +113 -0
- package/skills/massa-ai/workflows/security/security-fix.md +97 -0
- package/skills/massa-ai/workflows/spec-driven.md +217 -0
- package/skills/massa-ai/workflows/tdd.md +71 -0
- package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
- package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
- package/skills/massa-ai/workflows/the-fool.md +82 -0
- package/skills/massa-ai/workflows/ticket.md +42 -0
- package/skills/persona-router/SKILL.md +158 -0
- package/skills/status/SKILL.md +15 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Pre-Mortem Analysis
|
|
2
|
+
|
|
3
|
+
Pre-mortem methodology (Gary Klein) with second-order thinking for identifying how plans fail before they fail.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
A pre-mortem inverts the question. Instead of "Will this work?" ask: **"It's 6 months from now and this has failed. Why?"** This psychological shift bypasses optimism bias by making failure the starting point, not the thing to be argued against.
|
|
8
|
+
|
|
9
|
+
Research shows prospective hindsight increases correct failure identification by 30% compared to asking "what could go wrong?" directly.
|
|
10
|
+
|
|
11
|
+
## Process
|
|
12
|
+
|
|
13
|
+
1. **Set the scene** — "Imagine it's [timeframe] from now. This plan has failed. Not a small setback — a clear failure."
|
|
14
|
+
2. **Generate failure narratives** — Write specific stories about how it failed (silent individual generation first, then present)
|
|
15
|
+
3. **Rank by likelihood and impact** — Not all failures are equal
|
|
16
|
+
4. **Trace consequence chains** — First → second → third order effects
|
|
17
|
+
5. **Identify early warning signs** — What would you see before the failure materializes?
|
|
18
|
+
6. **Apply the inversion technique** — "What would guarantee this fails?" Then check if any conditions exist
|
|
19
|
+
7. **Design mitigations** — Concrete actions, not vague "be careful"
|
|
20
|
+
|
|
21
|
+
## Failure Narrative Construction
|
|
22
|
+
|
|
23
|
+
Failure narratives must be specific. "It didn't scale" is not a narrative. "At 50K concurrent users, the database connection pool exhausted, causing cascading timeouts across all services, which triggered the circuit breaker to reject all requests for 4 minutes during peak hours" is a narrative.
|
|
24
|
+
|
|
25
|
+
### Specificity Checklist
|
|
26
|
+
|
|
27
|
+
Every narrative must pass all 5 checks:
|
|
28
|
+
|
|
29
|
+
- [ ] Names a specific trigger (not "something goes wrong")
|
|
30
|
+
- [ ] Includes a number or threshold
|
|
31
|
+
- [ ] Describes the chain of events, not just the end state
|
|
32
|
+
- [ ] Identifies who or what is affected
|
|
33
|
+
- [ ] Could actually happen (not a fantasy scenario)
|
|
34
|
+
|
|
35
|
+
### Failure Narrative Template
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
**Failure: [Title]**
|
|
39
|
+
|
|
40
|
+
It's [timeframe] from now. [Specific trigger event]. This caused [first-order effect],
|
|
41
|
+
which led to [second-order effect]. The team discovered the problem when [detection point],
|
|
42
|
+
but by then [consequence]. The root cause was [underlying assumption that proved wrong].
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Example
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
**Failure: Migration Data Loss**
|
|
49
|
+
|
|
50
|
+
It's 3 months from now. During the database migration from PostgreSQL to the new schema,
|
|
51
|
+
a batch job silently drops records where the `legacy_id` field contains special characters
|
|
52
|
+
(~2% of records). The team discovers the problem 2 weeks post-migration when a customer
|
|
53
|
+
reports missing order history. By then, the legacy database has been decommissioned and
|
|
54
|
+
backups have rotated past the migration date. The root cause was that the migration script
|
|
55
|
+
was tested against a sanitized staging dataset that didn't include special characters.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Second-Order Consequence Chains
|
|
59
|
+
|
|
60
|
+
Every failure has consequences beyond the immediate impact. Trace at least two orders deep.
|
|
61
|
+
|
|
62
|
+
### Chain Template
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Trigger: [event]
|
|
66
|
+
→ 1st order: [immediate effect]
|
|
67
|
+
→ 2nd order: [consequence of the 1st order effect]
|
|
68
|
+
→ 3rd order: [consequence of the 2nd order effect]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Example Chain
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Trigger: Key engineer leaves during migration
|
|
75
|
+
→ 1st order: Migration timeline slips 4 weeks
|
|
76
|
+
→ 2nd order: Overlap period with legacy system extends, doubling operational cost
|
|
77
|
+
→ 3rd order: Budget overrun triggers executive review, project gets descoped
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Common Second-Order Patterns
|
|
81
|
+
|
|
82
|
+
| First Order | Second Order | Third Order |
|
|
83
|
+
|------------|-------------|-------------|
|
|
84
|
+
| Feature ships late | Sales misses quarter target | Engineering loses trust, gets more oversight |
|
|
85
|
+
| Performance degrades | Users adopt workarounds | Workarounds become "requirements" that constrain future design |
|
|
86
|
+
| Team member burns out | Knowledge concentrated in fewer people | Bus factor drops, risk increases |
|
|
87
|
+
| Dependency breaks | Hotfix bypasses testing | New bugs introduced, confidence in releases drops |
|
|
88
|
+
| Data quality issue | Downstream reports are wrong | Business decisions made on bad data |
|
|
89
|
+
| Cost overrun | Budget pulled from other initiatives | Team morale drops, talent leaves |
|
|
90
|
+
|
|
91
|
+
## Inversion Technique
|
|
92
|
+
|
|
93
|
+
Ask: **"What would guarantee this fails?"** Then check if any of those conditions exist today.
|
|
94
|
+
|
|
95
|
+
### Guaranteed Failure Conditions
|
|
96
|
+
|
|
97
|
+
| Category | What Guarantees Failure |
|
|
98
|
+
|----------|----------------------|
|
|
99
|
+
| **People** | Single point of knowledge, no stakeholder buy-in, team doesn't believe in approach |
|
|
100
|
+
| **Process** | No rollback plan, no incremental validation, all-or-nothing deployment |
|
|
101
|
+
| **Technology** | Untested at target scale, undocumented dependencies, version lock-in |
|
|
102
|
+
| **Timeline** | No buffer for unknowns, dependencies on external teams with no SLA, parallel critical paths |
|
|
103
|
+
| **Data** | Migration without validation, no data quality checks, schema changes without backward compatibility |
|
|
104
|
+
| **Incentives** | Success metrics misaligned with actual goals, team rewarded for speed not quality |
|
|
105
|
+
|
|
106
|
+
## Domain-Specific Failure Patterns
|
|
107
|
+
|
|
108
|
+
### Technical Failures
|
|
109
|
+
|
|
110
|
+
| Pattern | Trigger | Typical Consequence |
|
|
111
|
+
|---------|---------|-------------------|
|
|
112
|
+
| Integration cliff | New service connects to 3+ existing systems | One integration blocks all others |
|
|
113
|
+
| Scale surprise | Load 10x beyond testing | Cascading failures across dependent services |
|
|
114
|
+
| Migration trap | "Just move the data" | Data loss, extended downtime, rollback impossible |
|
|
115
|
+
| Dependency rot | Pinned to abandoned library | Security vulnerability with no upgrade path |
|
|
116
|
+
| Config drift | Manual environment setup | "Works on my machine" becomes "works in no environment" |
|
|
117
|
+
| Halfway house | Partial migration, two systems running | Worst of both worlds — double maintenance, inconsistent state |
|
|
118
|
+
|
|
119
|
+
### Business Failures
|
|
120
|
+
|
|
121
|
+
| Pattern | Trigger | Typical Consequence |
|
|
122
|
+
|---------|---------|-------------------|
|
|
123
|
+
| Adoption cliff | Build it and they don't come | Sunk cost with no revenue impact |
|
|
124
|
+
| Competitor preempt | Competitor ships similar feature first | Market positioning lost, differentiation eroded |
|
|
125
|
+
| Timing mismatch | Market shifts during development | Product solves yesterday's problem |
|
|
126
|
+
| Stakeholder reversal | Executive sponsor changes | Project loses priority, resources reallocated |
|
|
127
|
+
| Hidden cost | Operational burden underestimated | Feature costs more to run than it generates |
|
|
128
|
+
|
|
129
|
+
### Process Failures
|
|
130
|
+
|
|
131
|
+
| Pattern | Trigger | Typical Consequence |
|
|
132
|
+
|---------|---------|-------------------|
|
|
133
|
+
| Timeline fantasy | Estimates based on best case | Crunch, quality cuts, or scope cuts at the worst time |
|
|
134
|
+
| Dependency chain | Team A waits on Team B waits on Team C | Any slip cascades through all teams |
|
|
135
|
+
| Knowledge silo | Expert leaves or is unavailable | Progress stops; replacement ramps up for weeks |
|
|
136
|
+
| Scope creep | "While we're at it..." | Original goal buried under additions |
|
|
137
|
+
| Feedback void | No user testing until launch | Wrong product built correctly |
|
|
138
|
+
|
|
139
|
+
## Early Warning Signs
|
|
140
|
+
|
|
141
|
+
| Warning Sign | What It Indicates | Check Frequency |
|
|
142
|
+
|-------------|-------------------|-----------------|
|
|
143
|
+
| "We'll figure that out later" repeated 3+ times | Critical decisions being deferred, not resolved | Every planning session |
|
|
144
|
+
| No one can explain the rollback plan | Rollback hasn't been designed | Before launch |
|
|
145
|
+
| Estimates keep growing | Hidden complexity being discovered incrementally | Weekly |
|
|
146
|
+
| Key meetings keep getting rescheduled | Stakeholder alignment is weaker than assumed | Weekly |
|
|
147
|
+
| "It works locally" | Environment parity is worse than assumed | Every sprint |
|
|
148
|
+
| Testing phase compressed | Quality will be sacrificed | Mid-project checkpoint |
|
|
149
|
+
| No metrics defined for success | No one will know if this worked | Before kickoff |
|
|
150
|
+
| Team uses hedging language | Confidence is lower than stated | Ongoing |
|
|
151
|
+
|
|
152
|
+
## Output Template
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
## Pre-Mortem: [Plan/Decision Name]
|
|
156
|
+
|
|
157
|
+
**Timeframe:** [When would failure be evident]
|
|
158
|
+
|
|
159
|
+
### Failure Narratives
|
|
160
|
+
|
|
161
|
+
#### 1. [Failure Title] — Likelihood: High/Medium/Low | Impact: High/Medium/Low
|
|
162
|
+
|
|
163
|
+
[Specific failure narrative using the template above]
|
|
164
|
+
|
|
165
|
+
**Consequence chain:**
|
|
166
|
+
- 1st order: [immediate]
|
|
167
|
+
- 2nd order: [downstream]
|
|
168
|
+
- 3rd order: [systemic]
|
|
169
|
+
|
|
170
|
+
#### 2. [Failure Title] — Likelihood: High/Medium/Low | Impact: High/Medium/Low
|
|
171
|
+
|
|
172
|
+
[Narrative]
|
|
173
|
+
|
|
174
|
+
#### 3. [Failure Title] — Likelihood: High/Medium/Low | Impact: High/Medium/Low
|
|
175
|
+
|
|
176
|
+
[Narrative]
|
|
177
|
+
|
|
178
|
+
### Early Warning Signs
|
|
179
|
+
|
|
180
|
+
| Signal | Failure It Predicts | Check Frequency |
|
|
181
|
+
|--------|-------------------|-----------------|
|
|
182
|
+
| [Observable signal] | Failure #X | Weekly / Sprint / Monthly |
|
|
183
|
+
|
|
184
|
+
### Mitigations
|
|
185
|
+
|
|
186
|
+
| Failure | Mitigation | Effort | Reduces Risk By |
|
|
187
|
+
|---------|-----------|--------|-----------------|
|
|
188
|
+
| #1 | [Specific action] | Low/Med/High | [How much] |
|
|
189
|
+
| #2 | [Specific action] | Low/Med/High | [How much] |
|
|
190
|
+
| #3 | [Specific action] | Low/Med/High | [How much] |
|
|
191
|
+
|
|
192
|
+
### Inversion Check
|
|
193
|
+
|
|
194
|
+
**What would guarantee failure:**
|
|
195
|
+
1. [Condition]
|
|
196
|
+
2. [Condition]
|
|
197
|
+
3. [Condition]
|
|
198
|
+
|
|
199
|
+
**Do any exist now?** [Yes/No with specifics for each]
|
|
200
|
+
```
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Red Team Adversarial
|
|
2
|
+
|
|
3
|
+
Adversarial thinking and red teaming for finding weaknesses before adversaries do. Incorporates the military RED model (Recognize assumptions, Evaluate arguments, Draw conclusions) and modern red teaming methodologies.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
Red teaming asks: **"If someone wanted to break, exploit, or game this, how would they do it?"** The Fool adopts the mindset of an adversary — not to cause harm, but to find vulnerabilities before real adversaries do. This applies beyond security: competitors, disgruntled users, perverse incentives, and regulatory challenges are all adversarial forces.
|
|
8
|
+
|
|
9
|
+
## The RED Model
|
|
10
|
+
|
|
11
|
+
The U.S. Army Applied Critical Thinking Handbook's RED model provides a generalizable three-step checklist applicable to any adversarial analysis:
|
|
12
|
+
|
|
13
|
+
| Step | Action | Key Questions |
|
|
14
|
+
|------|--------|---------------|
|
|
15
|
+
| **R — Recognize Assumptions** | What are we taking for granted? | What would have to be true for this to be secure? What are we assuming about the adversary? |
|
|
16
|
+
| **E — Evaluate Arguments** | What is the evidence quality? | Are there logical fallacies? What alternative attack paths exist? |
|
|
17
|
+
| **D — Draw Conclusions** | What do the data actually support? | What conclusions are we NOT entitled to draw about our security posture? |
|
|
18
|
+
|
|
19
|
+
Apply RED before constructing adversary personas to ensure the analysis is grounded.
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
|
|
23
|
+
1. **Apply RED model** — Recognize assumptions about security/resilience, evaluate existing defenses, draw honest conclusions
|
|
24
|
+
2. **Identify the asset** — What are you protecting? (system, decision, strategy, product)
|
|
25
|
+
3. **Construct adversary personas** — Who would attack this and why?
|
|
26
|
+
4. **Map attack vectors** — How would each persona exploit weaknesses?
|
|
27
|
+
5. **Detect perverse incentives** — How does the system reward wrong behavior?
|
|
28
|
+
6. **Assess impact** — Rank by likelihood x impact
|
|
29
|
+
7. **Design defenses** — Specific countermeasures for the highest-ranked vectors
|
|
30
|
+
|
|
31
|
+
## Adversary Persona Construction
|
|
32
|
+
|
|
33
|
+
Generic "attackers" produce generic findings. Specific personas produce actionable insights.
|
|
34
|
+
|
|
35
|
+
### Persona Template
|
|
36
|
+
|
|
37
|
+
| Field | Description |
|
|
38
|
+
|-------|-------------|
|
|
39
|
+
| **Role** | Who is this adversary? |
|
|
40
|
+
| **Motivation** | Why would they attack? |
|
|
41
|
+
| **Capability** | What resources and skills do they have? |
|
|
42
|
+
| **Access** | What do they already have access to? |
|
|
43
|
+
| **Constraints** | What limits them? |
|
|
44
|
+
|
|
45
|
+
### Common Adversary Personas
|
|
46
|
+
|
|
47
|
+
| Persona | Motivation | Typical Vectors |
|
|
48
|
+
|---------|-----------|----------------|
|
|
49
|
+
| **External Attacker** | Financial gain, data theft | API exploitation, credential stuffing, injection attacks |
|
|
50
|
+
| **Competitor** | Market advantage | Feature copying, talent poaching, FUD campaigns |
|
|
51
|
+
| **Disgruntled Insider** | Revenge, financial gain | Privilege escalation, data exfiltration, sabotage |
|
|
52
|
+
| **Careless User** | None (accidental) | Misconfiguration, weak passwords, sharing credentials |
|
|
53
|
+
| **Regulator** | Compliance enforcement | Audit findings, data handling violations, accessibility gaps |
|
|
54
|
+
| **Opportunistic Gamer** | Personal benefit | Exploiting loopholes in business logic, referral fraud |
|
|
55
|
+
| **Activist** | Ideological goals | Public embarrassment, data leaks, service disruption |
|
|
56
|
+
| **AI Agent** | Automated exploitation | Prompt injection, API abuse at scale, automated vulnerability scanning |
|
|
57
|
+
|
|
58
|
+
### Domain-Specific Personas
|
|
59
|
+
|
|
60
|
+
| Domain | Key Adversary | Focus |
|
|
61
|
+
|--------|--------------|-------|
|
|
62
|
+
| E-commerce | Fraudster | Payment bypass, coupon abuse, fake returns |
|
|
63
|
+
| SaaS | Free-tier abuser | Rate limit evasion, multi-accounting, resource hoarding |
|
|
64
|
+
| Marketplace | Bad-faith seller | Fake listings, review manipulation, escrow games |
|
|
65
|
+
| API Platform | Scraper | Rate limit bypass, data harvesting, reverse engineering |
|
|
66
|
+
| Social Platform | Troll/bot farm | Spam, manipulation, fake engagement |
|
|
67
|
+
| AI/ML System | Adversarial attacker | Data poisoning, model extraction, prompt injection |
|
|
68
|
+
|
|
69
|
+
## Attack Vector Identification
|
|
70
|
+
|
|
71
|
+
### By Category
|
|
72
|
+
|
|
73
|
+
| Category | Vectors | Example |
|
|
74
|
+
|----------|---------|---------|
|
|
75
|
+
| **Technical** | Injection, auth bypass, race conditions, SSRF | SQL injection in search parameter |
|
|
76
|
+
| **Business Logic** | Workflow bypass, state manipulation, price tampering | Applying expired coupon via API replay |
|
|
77
|
+
| **Social** | Phishing, pretexting, authority exploitation | "I'm the CEO, I need access now" |
|
|
78
|
+
| **Operational** | Supply chain, dependency poisoning, insider threat | Compromised npm package in build pipeline |
|
|
79
|
+
| **Information** | Data leakage, metadata exposure, timing attacks | User enumeration via login error messages |
|
|
80
|
+
| **Economic** | Resource exhaustion, denial of wallet, asymmetric cost | Lambda invocation flood causing $50K bill |
|
|
81
|
+
| **AI-Specific** | Prompt injection, training data extraction, model manipulation | Injecting instructions via user-controlled content |
|
|
82
|
+
|
|
83
|
+
### Attack Tree Construction
|
|
84
|
+
|
|
85
|
+
For complex systems, build attack trees to map paths to a goal.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Goal: Steal user payment data
|
|
89
|
+
├── Path 1: Compromise the database
|
|
90
|
+
│ ├── SQL injection in search endpoint
|
|
91
|
+
│ ├── Credential theft from env variables in logs
|
|
92
|
+
│ └── Exploit unpatched database CVE
|
|
93
|
+
├── Path 2: Intercept in transit
|
|
94
|
+
│ ├── Downgrade TLS via misconfigured CDN
|
|
95
|
+
│ └── Man-in-the-middle on internal service mesh
|
|
96
|
+
└── Path 3: Abuse application logic
|
|
97
|
+
├── Export feature with insufficient access control
|
|
98
|
+
└── Admin panel with default credentials
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### The 12 Rules of the Red Team Mindset
|
|
102
|
+
|
|
103
|
+
Adapted from ITS Tactical for decision analysis:
|
|
104
|
+
|
|
105
|
+
1. Assume the obvious answer is wrong
|
|
106
|
+
2. Seek disconfirming evidence actively
|
|
107
|
+
3. Never accept the first answer
|
|
108
|
+
4. Treat consensus as a warning sign, not a conclusion
|
|
109
|
+
5. Distinguish between what is known vs. what is assumed
|
|
110
|
+
6. Identify what the defender is NOT protecting
|
|
111
|
+
7. Find the single point of failure
|
|
112
|
+
8. Exploit the gap between policy and practice
|
|
113
|
+
9. Think in time — what's the window of opportunity?
|
|
114
|
+
10. Consider the second and third order effects of your attack
|
|
115
|
+
11. Map the incentives — follow the money, the ego, the convenience
|
|
116
|
+
12. Test the assumption that "no one would ever do that"
|
|
117
|
+
|
|
118
|
+
## Perverse Incentive Detection
|
|
119
|
+
|
|
120
|
+
Systems create incentives. Sometimes those incentives reward the wrong behavior.
|
|
121
|
+
|
|
122
|
+
### Questions to Surface Perverse Incentives
|
|
123
|
+
|
|
124
|
+
| Question | What It Reveals |
|
|
125
|
+
|----------|----------------|
|
|
126
|
+
| "How will people game this?" | Loopholes in business logic |
|
|
127
|
+
| "What behavior does this reward that we don't want?" | Misaligned incentives |
|
|
128
|
+
| "What's the cheapest way to get the reward without the effort?" | Shortcut exploitation |
|
|
129
|
+
| "If we measure X, what Y gets sacrificed?" | Goodhart's Law in action |
|
|
130
|
+
| "Who benefits from this failing?" | Adversaries with motive |
|
|
131
|
+
| "What would a lazy but clever person do?" | Path of least resistance exploits |
|
|
132
|
+
|
|
133
|
+
### Common Perverse Incentive Patterns
|
|
134
|
+
|
|
135
|
+
| Pattern | Example | Consequence |
|
|
136
|
+
|---------|---------|-------------|
|
|
137
|
+
| Metric gaming | "Lines of code" as productivity metric | Verbose, unmaintainable code |
|
|
138
|
+
| Reward hacking | Referral bonus with no verification | Fake accounts for self-referral |
|
|
139
|
+
| Race to the bottom | "Fastest response time" as SLA | Teams avoid taking complex tickets |
|
|
140
|
+
| Cobra effect | Bounty for reporting bugs | Team introduces bugs to claim bounties |
|
|
141
|
+
| Information asymmetry | Users know more than the system | Adverse selection in marketplace pricing |
|
|
142
|
+
| Goodhart's Law | Any target metric becomes the optimization goal | Metric improves, actual outcome deteriorates |
|
|
143
|
+
|
|
144
|
+
## Competitive Response Analysis
|
|
145
|
+
|
|
146
|
+
When the "adversary" is a competitor.
|
|
147
|
+
|
|
148
|
+
| Scenario | Analysis Framework |
|
|
149
|
+
|----------|-------------------|
|
|
150
|
+
| Feature parity | What can they copy? How fast? What's our defensible moat? |
|
|
151
|
+
| Price war | Can they sustain lower prices? What's their cost structure? |
|
|
152
|
+
| Talent poaching | Which roles are critical? How replaceable? What's our retention advantage? |
|
|
153
|
+
| Platform risk | Are we dependent on their platform? What's the switch cost? |
|
|
154
|
+
| FUD campaign | What claims could they make? Which are hardest to refute? |
|
|
155
|
+
|
|
156
|
+
## Output Template
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
## Red Team Analysis: [Target]
|
|
160
|
+
|
|
161
|
+
### RED Model Assessment
|
|
162
|
+
|
|
163
|
+
| Step | Finding |
|
|
164
|
+
|------|---------|
|
|
165
|
+
| **Recognize Assumptions** | [Key assumptions about security/resilience] |
|
|
166
|
+
| **Evaluate Arguments** | [Quality of evidence for current defenses] |
|
|
167
|
+
| **Draw Conclusions** | [Honest assessment of actual posture] |
|
|
168
|
+
|
|
169
|
+
### Asset Under Assessment
|
|
170
|
+
|
|
171
|
+
[What we're protecting and why it matters]
|
|
172
|
+
|
|
173
|
+
### Adversary Profiles
|
|
174
|
+
|
|
175
|
+
#### Adversary 1: [Name/Role]
|
|
176
|
+
- **Motivation:** [Why they attack]
|
|
177
|
+
- **Capability:** [What they can do]
|
|
178
|
+
- **Access:** [What they start with]
|
|
179
|
+
|
|
180
|
+
#### Adversary 2: [Name/Role]
|
|
181
|
+
- **Motivation:** [Why they attack]
|
|
182
|
+
- **Capability:** [What they can do]
|
|
183
|
+
- **Access:** [What they start with]
|
|
184
|
+
|
|
185
|
+
### Attack Vectors (Ranked)
|
|
186
|
+
|
|
187
|
+
| # | Vector | Adversary | Likelihood | Impact | Risk Score |
|
|
188
|
+
|---|--------|-----------|-----------|--------|------------|
|
|
189
|
+
| 1 | [Specific attack] | [Who] | High/Med/Low | High/Med/Low | [L x I] |
|
|
190
|
+
| 2 | [Specific attack] | [Who] | High/Med/Low | High/Med/Low | [L x I] |
|
|
191
|
+
| 3 | [Specific attack] | [Who] | High/Med/Low | High/Med/Low | [L x I] |
|
|
192
|
+
|
|
193
|
+
### Perverse Incentives
|
|
194
|
+
|
|
195
|
+
| Incentive Created | Unintended Behavior | Severity |
|
|
196
|
+
|-------------------|-------------------|----------|
|
|
197
|
+
| [What the system rewards] | [How it gets gamed] | High/Med/Low |
|
|
198
|
+
|
|
199
|
+
### Recommended Defenses
|
|
200
|
+
|
|
201
|
+
| Attack Vector | Defense | Effort | Priority |
|
|
202
|
+
|--------------|---------|--------|----------|
|
|
203
|
+
| #1 | [Specific countermeasure] | Low/Med/High | Immediate/Next sprint/Backlog |
|
|
204
|
+
| #2 | [Specific countermeasure] | Low/Med/High | Immediate/Next sprint/Backlog |
|
|
205
|
+
| #3 | [Specific countermeasure] | Low/Med/High | Immediate/Next sprint/Backlog |
|
|
206
|
+
```
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Socratic Questioning
|
|
2
|
+
|
|
3
|
+
Structured question frameworks for exposing assumptions and deepening understanding.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
Socratic questioning does not argue. It asks. The goal is to help the user discover gaps in their own reasoning by surfacing what they have not examined. Every question should create a moment of "I hadn't thought about that."
|
|
8
|
+
|
|
9
|
+
The agent must never answer the questions itself. Present them, let the user sit with them.
|
|
10
|
+
|
|
11
|
+
## The 6 Question Types
|
|
12
|
+
|
|
13
|
+
Research (NAACL 2024, ChemRxiv 2025) confirms these 6 types as the most effective for critical analysis in AI-assisted workflows.
|
|
14
|
+
|
|
15
|
+
### 1. Clarifying Questions
|
|
16
|
+
|
|
17
|
+
Force precision on vague or overloaded terms.
|
|
18
|
+
|
|
19
|
+
| Pattern | Example |
|
|
20
|
+
|---------|---------|
|
|
21
|
+
| "When you say X, what specifically do you mean?" | "When you say 'scalable,' do you mean 10x users or 1000x?" |
|
|
22
|
+
| "How would you define X to someone unfamiliar?" | "How would you explain 'real-time' to a non-engineer?" |
|
|
23
|
+
| "Are there cases where X means something different?" | "Does 'fast' mean the same thing for API response and batch job?" |
|
|
24
|
+
|
|
25
|
+
### 2. Assumption-Probing Questions
|
|
26
|
+
|
|
27
|
+
Surface hidden premises that the reasoning depends on.
|
|
28
|
+
|
|
29
|
+
| Pattern | Example |
|
|
30
|
+
|---------|---------|
|
|
31
|
+
| "What are you assuming here?" | "What has to be true for microservices to improve velocity?" |
|
|
32
|
+
| "Is this based on data or intuition?" | "Is the 'users hate the current flow' claim from research or assumption?" |
|
|
33
|
+
| "What would change your mind?" | "What metric would convince you this approach is wrong?" |
|
|
34
|
+
| "What are you treating as fixed that might be flexible?" | "Does the deadline have to be Q2, or is that an assumption?" |
|
|
35
|
+
|
|
36
|
+
### 3. Evidence-Probing Questions
|
|
37
|
+
|
|
38
|
+
Test the evidential basis for beliefs.
|
|
39
|
+
|
|
40
|
+
| Pattern | Example |
|
|
41
|
+
|---------|---------|
|
|
42
|
+
| "What evidence supports this?" | "What data shows users actually want this feature?" |
|
|
43
|
+
| "How do you know X is true?" | "How do you know the current system can't handle the load?" |
|
|
44
|
+
| "How large and representative is the sample?" | "Was the pilot tested on production-like data or sanitized staging data?" |
|
|
45
|
+
| "Is the source independent or interested?" | "Is that benchmark from a vendor or an independent test?" |
|
|
46
|
+
|
|
47
|
+
### 4. Implication Questions
|
|
48
|
+
|
|
49
|
+
Follow the logical consequences of the position.
|
|
50
|
+
|
|
51
|
+
| Pattern | Example |
|
|
52
|
+
|---------|---------|
|
|
53
|
+
| "If that's true, what follows?" | "If we accept this latency budget, what does that force on the database layer?" |
|
|
54
|
+
| "Does X necessarily lead to Y?" | "Does adding caching necessarily improve user experience?" |
|
|
55
|
+
| "What's the second-order effect?" | "If we hire contractors to speed up, what happens to team knowledge?" |
|
|
56
|
+
| "What becomes harder later?" | "What future feature becomes harder if we choose this schema?" |
|
|
57
|
+
|
|
58
|
+
### 5. Perspective-Shifting Questions
|
|
59
|
+
|
|
60
|
+
Force consideration of other viewpoints.
|
|
61
|
+
|
|
62
|
+
| Pattern | Example |
|
|
63
|
+
|---------|---------|
|
|
64
|
+
| "How would [stakeholder] see this?" | "How would the on-call engineer feel about this architecture?" |
|
|
65
|
+
| "What would a skeptic say?" | "What would a senior engineer who prefers simplicity say?" |
|
|
66
|
+
| "What does this look like in 2 years?" | "Will this abstraction still make sense when the team doubles?" |
|
|
67
|
+
| "Who loses if this succeeds?" | "If we adopt this vendor, what capability do we give up?" |
|
|
68
|
+
|
|
69
|
+
### 6. Meta-Questions
|
|
70
|
+
|
|
71
|
+
Examine the reasoning process itself.
|
|
72
|
+
|
|
73
|
+
| Pattern | Example |
|
|
74
|
+
|---------|---------|
|
|
75
|
+
| "Why are we framing it this way?" | "Why are we treating this as a technology decision instead of an organizational one?" |
|
|
76
|
+
| "What question are we NOT asking?" | "We've discussed performance — what about operability?" |
|
|
77
|
+
| "Are we solving the right problem?" | "Is the real problem the deploy pipeline or the coupling?" |
|
|
78
|
+
| "What would it take to change your mind?" (Kozyrkov's Magic Question) | "If I could prove X, would you reconsider?" |
|
|
79
|
+
|
|
80
|
+
## Assumption Detection Signals
|
|
81
|
+
|
|
82
|
+
Watch for language that hides assumptions. When you hear these, probe immediately.
|
|
83
|
+
|
|
84
|
+
| Signal Phrase | Hidden Assumption | Probe With |
|
|
85
|
+
|---------------|-------------------|------------|
|
|
86
|
+
| "Obviously..." | The speaker hasn't questioned this | "What makes this obvious? Has it been tested?" |
|
|
87
|
+
| "Everyone knows..." | Consensus hasn't been verified | "Who specifically? Has anyone disagreed?" |
|
|
88
|
+
| "It just makes sense..." | The reasoning chain hasn't been articulated | "Walk me through the logic step by step." |
|
|
89
|
+
| "We always..." | Historical pattern assumed to be optimal | "Why? What would happen if you didn't?" |
|
|
90
|
+
| "There's no other way..." | Alternatives haven't been explored | "What if there were? What would it look like?" |
|
|
91
|
+
| "It's simple..." | Complexity has been underestimated | "What's the simplest thing that could go wrong?" |
|
|
92
|
+
| "Users want..." | User research may be absent or stale | "How do you know? When was this last validated?" |
|
|
93
|
+
| "The standard approach is..." | Convention hasn't been validated for context | "Standard for whom? Does their context match yours?" |
|
|
94
|
+
| "We need to be careful..." | Risk aversion without quantified risk | "What specifically is the risk? How likely?" |
|
|
95
|
+
|
|
96
|
+
## Domain-Adapted Question Banks
|
|
97
|
+
|
|
98
|
+
### Technical Decisions
|
|
99
|
+
|
|
100
|
+
- What are you optimizing for? Are you sure that's the right dimension?
|
|
101
|
+
- What's the simplest version that tests the core assumption?
|
|
102
|
+
- What constraint are you treating as fixed that might actually be flexible?
|
|
103
|
+
- How would you build this if you had to ship in one week?
|
|
104
|
+
- What's the most expensive thing to change later?
|
|
105
|
+
- If you had to explain the failure mode to a non-technical executive, what would you say?
|
|
106
|
+
|
|
107
|
+
### Business Decisions
|
|
108
|
+
|
|
109
|
+
- Who is the customer for this decision? Are you sure?
|
|
110
|
+
- What would make this a bad investment in hindsight?
|
|
111
|
+
- How does this compare to doing nothing?
|
|
112
|
+
- What's the opportunity cost of this choice?
|
|
113
|
+
- If a competitor made the opposite choice, would you be worried?
|
|
114
|
+
- What's the maximum you'd pay a clairvoyant for perfect information on this? (Kozyrkov's Value of Clairvoyance test — if low, the decision doesn't need more analysis)
|
|
115
|
+
|
|
116
|
+
### Strategic Decisions
|
|
117
|
+
|
|
118
|
+
- What has to be true for this strategy to work?
|
|
119
|
+
- Which of those assumptions are you least confident about?
|
|
120
|
+
- What's the fastest way to test the riskiest assumption?
|
|
121
|
+
- How will you know if this is failing before it's too late?
|
|
122
|
+
- What's the exit strategy if this doesn't work?
|
|
123
|
+
- Frame this as a bet: what are you staking, at what odds, for what payoff?
|
|
124
|
+
|
|
125
|
+
## Output Template
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
## Assumption Inventory
|
|
129
|
+
|
|
130
|
+
| # | Assumption | Type | Confidence | Source |
|
|
131
|
+
|---|-----------|------|------------|--------|
|
|
132
|
+
| 1 | [Stated or hidden assumption] | Stated / Unstated | High / Medium / Low | [Where it appears in the reasoning] |
|
|
133
|
+
|
|
134
|
+
## Probing Questions
|
|
135
|
+
|
|
136
|
+
### [Theme 1: e.g., "User Behavior"]
|
|
137
|
+
1. [Question targeting assumption #X] _(Type: Assumption-probing)_
|
|
138
|
+
2. [Follow-up question deepening the probe] _(Type: Implication)_
|
|
139
|
+
|
|
140
|
+
### [Theme 2: e.g., "Technical Feasibility"]
|
|
141
|
+
1. [Question targeting assumption #Y] _(Type: Evidence-probing)_
|
|
142
|
+
2. [Follow-up question] _(Type: Perspective-shifting)_
|
|
143
|
+
|
|
144
|
+
### [Theme 3: e.g., "Business Viability"]
|
|
145
|
+
1. [Question targeting assumption #Z] _(Type: Meta-question)_
|
|
146
|
+
2. [Follow-up question] _(Type: Clarifying)_
|
|
147
|
+
|
|
148
|
+
## Suggested Experiments
|
|
149
|
+
|
|
150
|
+
| Assumption | Experiment | Effort | Signal |
|
|
151
|
+
|-----------|-----------|--------|--------|
|
|
152
|
+
| [Riskiest assumption] | [How to test it] | Low/Med/High | [What result means] |
|
|
153
|
+
```
|