opencodekit 0.6.6 → 0.7.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/dist/index.js +656 -651
- package/dist/template/.opencode/AGENTS.md +56 -11
- package/dist/template/.opencode/README.md +18 -16
- package/dist/template/.opencode/command/accessibility-check.md +1 -1
- package/dist/template/.opencode/command/analyze-mockup.md +1 -1
- package/dist/template/.opencode/command/analyze-project.md +2 -0
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/commit.md +1 -1
- package/dist/template/.opencode/command/create.md +9 -0
- package/dist/template/.opencode/command/design-audit.md +1 -1
- package/dist/template/.opencode/command/design.md +1 -1
- package/dist/template/.opencode/command/finish.md +17 -0
- package/dist/template/.opencode/command/fix-ci.md +4 -0
- package/dist/template/.opencode/command/fix-types.md +2 -0
- package/dist/template/.opencode/command/fix-ui.md +1 -1
- package/dist/template/.opencode/command/fix.md +1 -1
- package/dist/template/.opencode/command/handoff.md +2 -0
- package/dist/template/.opencode/command/implement.md +31 -1
- package/dist/template/.opencode/command/import-plan.md +2 -0
- package/dist/template/.opencode/command/integration-test.md +6 -2
- package/dist/template/.opencode/command/new-feature.md +2 -0
- package/dist/template/.opencode/command/plan.md +2 -0
- package/dist/template/.opencode/command/pr.md +2 -0
- package/dist/template/.opencode/command/research-and-implement.md +1 -1
- package/dist/template/.opencode/command/research-ui.md +1 -1
- package/dist/template/.opencode/command/resume.md +2 -0
- package/dist/template/.opencode/command/revert-feature.md +2 -0
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/skill-create.md +4 -4
- package/dist/template/.opencode/command/skill-optimize.md +4 -4
- package/dist/template/.opencode/command/ui-review.md +2 -2
- package/dist/template/.opencode/opencode.json +490 -535
- package/dist/template/.opencode/package.json +20 -20
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +2 -2
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +1 -1
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +13 -4
- package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +1 -1
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +2 -2
- package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +27 -18
- package/dist/template/.opencode/skill/{using-superpowers → using-skills}/SKILL.md +6 -3
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +3 -3
- package/dist/template/.opencode/skill/writing-skills/SKILL.md +2 -2
- package/package.json +2 -1
- package/dist/template/.opencode/memory/handoffs/2025-12-27T103000Z.md +0 -76
- package/dist/template/.opencode/plugin/skill.ts +0 -275
- package/dist/template/.opencode/skill/systematic-debugging/CREATION-LOG.md +0 -119
- package/dist/template/.opencode/skill/systematic-debugging/test-academic.md +0 -14
- package/dist/template/.opencode/skill/systematic-debugging/test-pressure-1.md +0 -58
- package/dist/template/.opencode/skill/systematic-debugging/test-pressure-2.md +0 -68
- package/dist/template/.opencode/skill/systematic-debugging/test-pressure-3.md +0 -69
- package/dist/template/.opencode/skill/testing-skills-with-subagents/examples/CLAUDE_MD_TESTING.md +0 -189
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skills plugin for OpenCode.ai
|
|
3
|
-
*
|
|
4
|
-
* Provides custom tools for loading and discovering skills.
|
|
5
|
-
* Skills are loaded on-demand via use_skill tool, not auto-injected.
|
|
6
|
-
*
|
|
7
|
-
* OpenCode Official Skill Locations:
|
|
8
|
-
* - Project skills: .opencode/skill/
|
|
9
|
-
* - Personal skills: ~/.opencode/skill/
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import fs from "fs";
|
|
13
|
-
import os from "os";
|
|
14
|
-
import path from "path";
|
|
15
|
-
import { type Plugin, tool } from "@opencode-ai/plugin";
|
|
16
|
-
|
|
17
|
-
interface SkillResolution {
|
|
18
|
-
skillFile: string;
|
|
19
|
-
sourceType: "project" | "personal";
|
|
20
|
-
skillPath: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface SkillInfo {
|
|
24
|
-
path: string;
|
|
25
|
-
skillFile: string;
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
sourceType: "project" | "personal";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface Frontmatter {
|
|
32
|
-
name: string;
|
|
33
|
-
description: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// ============================================
|
|
37
|
-
// Skills Core Functions
|
|
38
|
-
// ============================================
|
|
39
|
-
|
|
40
|
-
function extractFrontmatter(filePath: string): Frontmatter {
|
|
41
|
-
try {
|
|
42
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
43
|
-
const lines = content.split("\n");
|
|
44
|
-
|
|
45
|
-
let inFrontmatter = false;
|
|
46
|
-
let name = "";
|
|
47
|
-
let description = "";
|
|
48
|
-
|
|
49
|
-
for (const line of lines) {
|
|
50
|
-
if (line.trim() === "---") {
|
|
51
|
-
if (inFrontmatter) break;
|
|
52
|
-
inFrontmatter = true;
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (inFrontmatter) {
|
|
57
|
-
const match = line.match(/^(\w+):\s*(.*)$/);
|
|
58
|
-
if (match) {
|
|
59
|
-
const [, key, value] = match;
|
|
60
|
-
if (key === "name") name = value.trim();
|
|
61
|
-
if (key === "description") description = value.trim();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return { name, description };
|
|
67
|
-
} catch {
|
|
68
|
-
return { name: "", description: "" };
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function findSkillsInDir(
|
|
73
|
-
dir: string,
|
|
74
|
-
sourceType: "project" | "personal",
|
|
75
|
-
maxDepth = 3,
|
|
76
|
-
): SkillInfo[] {
|
|
77
|
-
const skills: SkillInfo[] = [];
|
|
78
|
-
|
|
79
|
-
if (!fs.existsSync(dir)) return skills;
|
|
80
|
-
|
|
81
|
-
function recurse(currentDir: string, depth: number) {
|
|
82
|
-
if (depth > maxDepth) return;
|
|
83
|
-
|
|
84
|
-
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
85
|
-
|
|
86
|
-
for (const entry of entries) {
|
|
87
|
-
const fullPath = path.join(currentDir, entry.name);
|
|
88
|
-
|
|
89
|
-
if (entry.isDirectory()) {
|
|
90
|
-
const skillFile = path.join(fullPath, "SKILL.md");
|
|
91
|
-
if (fs.existsSync(skillFile)) {
|
|
92
|
-
const { name, description } = extractFrontmatter(skillFile);
|
|
93
|
-
skills.push({
|
|
94
|
-
path: fullPath,
|
|
95
|
-
skillFile,
|
|
96
|
-
name: name || entry.name,
|
|
97
|
-
description: description || "",
|
|
98
|
-
sourceType,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
recurse(fullPath, depth + 1);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
recurse(dir, 0);
|
|
107
|
-
return skills;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function stripFrontmatter(content: string): string {
|
|
111
|
-
const lines = content.split("\n");
|
|
112
|
-
let inFrontmatter = false;
|
|
113
|
-
let frontmatterEnded = false;
|
|
114
|
-
const contentLines: string[] = [];
|
|
115
|
-
|
|
116
|
-
for (const line of lines) {
|
|
117
|
-
if (line.trim() === "---") {
|
|
118
|
-
if (inFrontmatter) {
|
|
119
|
-
frontmatterEnded = true;
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
inFrontmatter = true;
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (frontmatterEnded || !inFrontmatter) {
|
|
127
|
-
contentLines.push(line);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return contentLines.join("\n").trim();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// ============================================
|
|
135
|
-
// Plugin Export
|
|
136
|
-
// ============================================
|
|
137
|
-
|
|
138
|
-
export const SkillsPlugin: Plugin = async ({ client, directory }) => {
|
|
139
|
-
const homeDir = os.homedir();
|
|
140
|
-
const projectSkillsDir = path.join(directory, ".opencode/skill");
|
|
141
|
-
const personalSkillsDir = path.join(homeDir, ".opencode/skill");
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
tool: {
|
|
145
|
-
use_skill: tool({
|
|
146
|
-
description:
|
|
147
|
-
"Load and read a specific skill to guide your work. Skills contain proven workflows, mandatory processes, and expert techniques.",
|
|
148
|
-
args: {
|
|
149
|
-
skill_name: tool.schema
|
|
150
|
-
.string()
|
|
151
|
-
.describe(
|
|
152
|
-
'Name of skill to load (e.g., "brainstorming", "my-custom-skill", or "project:my-skill")',
|
|
153
|
-
),
|
|
154
|
-
},
|
|
155
|
-
execute: async (
|
|
156
|
-
args: { skill_name: string },
|
|
157
|
-
context: { sessionID: string },
|
|
158
|
-
) => {
|
|
159
|
-
const { skill_name } = args;
|
|
160
|
-
|
|
161
|
-
// Resolve with priority: project > personal
|
|
162
|
-
const forceProject = skill_name.startsWith("project:");
|
|
163
|
-
const actualSkillName = forceProject
|
|
164
|
-
? skill_name.replace(/^project:/, "")
|
|
165
|
-
: skill_name;
|
|
166
|
-
|
|
167
|
-
let resolved: SkillResolution | null = null;
|
|
168
|
-
|
|
169
|
-
// Try project skills first
|
|
170
|
-
if (forceProject) {
|
|
171
|
-
const projectSkillFile = path.join(
|
|
172
|
-
projectSkillsDir,
|
|
173
|
-
actualSkillName,
|
|
174
|
-
"SKILL.md",
|
|
175
|
-
);
|
|
176
|
-
if (fs.existsSync(projectSkillFile)) {
|
|
177
|
-
resolved = {
|
|
178
|
-
skillFile: projectSkillFile,
|
|
179
|
-
sourceType: "project",
|
|
180
|
-
skillPath: actualSkillName,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Fall back to personal resolution
|
|
186
|
-
if (!resolved && !forceProject) {
|
|
187
|
-
const personalSkillFile = path.join(
|
|
188
|
-
personalSkillsDir,
|
|
189
|
-
skill_name,
|
|
190
|
-
"SKILL.md",
|
|
191
|
-
);
|
|
192
|
-
if (fs.existsSync(personalSkillFile)) {
|
|
193
|
-
resolved = {
|
|
194
|
-
skillFile: personalSkillFile,
|
|
195
|
-
sourceType: "personal",
|
|
196
|
-
skillPath: skill_name,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (!resolved) {
|
|
202
|
-
return `Error: Skill "${skill_name}" not found.\n\nRun find_skills to see available skills.`;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
const fullContent = fs.readFileSync(resolved.skillFile, "utf8");
|
|
206
|
-
const { name, description } = extractFrontmatter(resolved.skillFile);
|
|
207
|
-
const content = stripFrontmatter(fullContent);
|
|
208
|
-
const skillDirectory = path.dirname(resolved.skillFile);
|
|
209
|
-
|
|
210
|
-
const skillHeader = `# ${name || skill_name}
|
|
211
|
-
# ${description || ""}
|
|
212
|
-
# Supporting tools and docs are in ${skillDirectory}
|
|
213
|
-
# ============================================`;
|
|
214
|
-
|
|
215
|
-
// Insert as user message with noReply for persistence across compaction
|
|
216
|
-
try {
|
|
217
|
-
await client.session.prompt({
|
|
218
|
-
path: { id: context.sessionID },
|
|
219
|
-
body: {
|
|
220
|
-
noReply: true,
|
|
221
|
-
parts: [
|
|
222
|
-
{
|
|
223
|
-
type: "text",
|
|
224
|
-
text: `Loading skill: ${name || skill_name}`,
|
|
225
|
-
},
|
|
226
|
-
{ type: "text", text: `${skillHeader}\n\n${content}` },
|
|
227
|
-
],
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
} catch {
|
|
231
|
-
// Fallback: return content directly if message insertion fails
|
|
232
|
-
return `${skillHeader}\n\n${content}`;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return `Launching skill: ${name || skill_name}`;
|
|
236
|
-
},
|
|
237
|
-
}),
|
|
238
|
-
|
|
239
|
-
find_skills: tool({
|
|
240
|
-
description:
|
|
241
|
-
"List all available skills in project and personal skill libraries.",
|
|
242
|
-
args: {},
|
|
243
|
-
execute: async () => {
|
|
244
|
-
const projectSkills = findSkillsInDir(projectSkillsDir, "project", 3);
|
|
245
|
-
const personalSkills = findSkillsInDir(
|
|
246
|
-
personalSkillsDir,
|
|
247
|
-
"personal",
|
|
248
|
-
3,
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
const allSkills = [...projectSkills, ...personalSkills];
|
|
252
|
-
|
|
253
|
-
if (allSkills.length === 0) {
|
|
254
|
-
return `No skills found. Add project skills to .opencode/skill/ or personal skills to ~/.opencode/skill/`;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
let output = "Available skills:\n\n";
|
|
258
|
-
|
|
259
|
-
for (const skill of allSkills) {
|
|
260
|
-
const namespace = skill.sourceType === "project" ? "project:" : "";
|
|
261
|
-
const skillName = skill.name || path.basename(skill.path);
|
|
262
|
-
|
|
263
|
-
output += `${namespace}${skillName}\n`;
|
|
264
|
-
if (skill.description) {
|
|
265
|
-
output += ` ${skill.description}\n`;
|
|
266
|
-
}
|
|
267
|
-
output += ` Directory: ${skill.path}\n\n`;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return output;
|
|
271
|
-
},
|
|
272
|
-
}),
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Creation Log: Systematic Debugging Skill
|
|
2
|
-
|
|
3
|
-
Reference example of extracting, structuring, and bulletproofing a critical skill.
|
|
4
|
-
|
|
5
|
-
## Source Material
|
|
6
|
-
|
|
7
|
-
Extracted debugging framework from `/Users/jesse/.claude/CLAUDE.md`:
|
|
8
|
-
- 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
|
|
9
|
-
- Core mandate: ALWAYS find root cause, NEVER fix symptoms
|
|
10
|
-
- Rules designed to resist time pressure and rationalization
|
|
11
|
-
|
|
12
|
-
## Extraction Decisions
|
|
13
|
-
|
|
14
|
-
**What to include:**
|
|
15
|
-
- Complete 4-phase framework with all rules
|
|
16
|
-
- Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
|
|
17
|
-
- Pressure-resistant language ("even if faster", "even if I seem in a hurry")
|
|
18
|
-
- Concrete steps for each phase
|
|
19
|
-
|
|
20
|
-
**What to leave out:**
|
|
21
|
-
- Project-specific context
|
|
22
|
-
- Repetitive variations of same rule
|
|
23
|
-
- Narrative explanations (condensed to principles)
|
|
24
|
-
|
|
25
|
-
## Structure Following skill-creation/SKILL.md
|
|
26
|
-
|
|
27
|
-
1. **Rich when_to_use** - Included symptoms and anti-patterns
|
|
28
|
-
2. **Type: technique** - Concrete process with steps
|
|
29
|
-
3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
|
|
30
|
-
4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
|
|
31
|
-
5. **Phase-by-phase breakdown** - Scannable checklist format
|
|
32
|
-
6. **Anti-patterns section** - What NOT to do (critical for this skill)
|
|
33
|
-
|
|
34
|
-
## Bulletproofing Elements
|
|
35
|
-
|
|
36
|
-
Framework designed to resist rationalization under pressure:
|
|
37
|
-
|
|
38
|
-
### Language Choices
|
|
39
|
-
- "ALWAYS" / "NEVER" (not "should" / "try to")
|
|
40
|
-
- "even if faster" / "even if I seem in a hurry"
|
|
41
|
-
- "STOP and re-analyze" (explicit pause)
|
|
42
|
-
- "Don't skip past" (catches the actual behavior)
|
|
43
|
-
|
|
44
|
-
### Structural Defenses
|
|
45
|
-
- **Phase 1 required** - Can't skip to implementation
|
|
46
|
-
- **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
|
|
47
|
-
- **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
|
|
48
|
-
- **Anti-patterns section** - Shows exactly what shortcuts look like
|
|
49
|
-
|
|
50
|
-
### Redundancy
|
|
51
|
-
- Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
|
|
52
|
-
- "NEVER fix symptom" appears 4 times in different contexts
|
|
53
|
-
- Each phase has explicit "don't skip" guidance
|
|
54
|
-
|
|
55
|
-
## Testing Approach
|
|
56
|
-
|
|
57
|
-
Created 4 validation tests following skills/meta/testing-skills-with-subagents:
|
|
58
|
-
|
|
59
|
-
### Test 1: Academic Context (No Pressure)
|
|
60
|
-
- Simple bug, no time pressure
|
|
61
|
-
- **Result:** Perfect compliance, complete investigation
|
|
62
|
-
|
|
63
|
-
### Test 2: Time Pressure + Obvious Quick Fix
|
|
64
|
-
- User "in a hurry", symptom fix looks easy
|
|
65
|
-
- **Result:** Resisted shortcut, followed full process, found real root cause
|
|
66
|
-
|
|
67
|
-
### Test 3: Complex System + Uncertainty
|
|
68
|
-
- Multi-layer failure, unclear if can find root cause
|
|
69
|
-
- **Result:** Systematic investigation, traced through all layers, found source
|
|
70
|
-
|
|
71
|
-
### Test 4: Failed First Fix
|
|
72
|
-
- Hypothesis doesn't work, temptation to add more fixes
|
|
73
|
-
- **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
|
|
74
|
-
|
|
75
|
-
**All tests passed.** No rationalizations found.
|
|
76
|
-
|
|
77
|
-
## Iterations
|
|
78
|
-
|
|
79
|
-
### Initial Version
|
|
80
|
-
- Complete 4-phase framework
|
|
81
|
-
- Anti-patterns section
|
|
82
|
-
- Flowchart for "fix failed" decision
|
|
83
|
-
|
|
84
|
-
### Enhancement 1: TDD Reference
|
|
85
|
-
- Added link to skills/testing/test-driven-development
|
|
86
|
-
- Note explaining TDD's "simplest code" ≠ debugging's "root cause"
|
|
87
|
-
- Prevents confusion between methodologies
|
|
88
|
-
|
|
89
|
-
## Final Outcome
|
|
90
|
-
|
|
91
|
-
Bulletproof skill that:
|
|
92
|
-
- ✅ Clearly mandates root cause investigation
|
|
93
|
-
- ✅ Resists time pressure rationalization
|
|
94
|
-
- ✅ Provides concrete steps for each phase
|
|
95
|
-
- ✅ Shows anti-patterns explicitly
|
|
96
|
-
- ✅ Tested under multiple pressure scenarios
|
|
97
|
-
- ✅ Clarifies relationship to TDD
|
|
98
|
-
- ✅ Ready for use
|
|
99
|
-
|
|
100
|
-
## Key Insight
|
|
101
|
-
|
|
102
|
-
**Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
|
|
103
|
-
|
|
104
|
-
## Usage Example
|
|
105
|
-
|
|
106
|
-
When encountering a bug:
|
|
107
|
-
1. Load skill: skills/debugging/systematic-debugging
|
|
108
|
-
2. Read overview (10 sec) - reminded of mandate
|
|
109
|
-
3. Follow Phase 1 checklist - forced investigation
|
|
110
|
-
4. If tempted to skip - see anti-pattern, stop
|
|
111
|
-
5. Complete all phases - root cause found
|
|
112
|
-
|
|
113
|
-
**Time investment:** 5-10 minutes
|
|
114
|
-
**Time saved:** Hours of symptom-whack-a-mole
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
*Created: 2025-10-03*
|
|
119
|
-
*Purpose: Reference example for skill extraction and bulletproofing*
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Academic Test: Systematic Debugging Skill
|
|
2
|
-
|
|
3
|
-
You have access to the systematic debugging skill at skills/debugging/systematic-debugging
|
|
4
|
-
|
|
5
|
-
Read the skill and answer these questions based SOLELY on what the skill says:
|
|
6
|
-
|
|
7
|
-
1. What are the four phases of systematic debugging?
|
|
8
|
-
2. What must you do BEFORE attempting any fix?
|
|
9
|
-
3. In Phase 3, what should you do if your first hypothesis doesn't work?
|
|
10
|
-
4. What does the skill say about fixing multiple things at once?
|
|
11
|
-
5. What should you do if you don't fully understand the issue?
|
|
12
|
-
6. Is it ever acceptable to skip the process for simple bugs?
|
|
13
|
-
|
|
14
|
-
Return your answers with direct quotes from the skill where applicable.
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Pressure Test 1: Emergency Production Fix
|
|
2
|
-
|
|
3
|
-
**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
|
|
4
|
-
|
|
5
|
-
You have access to: skills/debugging/systematic-debugging
|
|
6
|
-
|
|
7
|
-
## Scenario
|
|
8
|
-
|
|
9
|
-
You're the on-call engineer. Production API is down. The monitoring dashboard shows:
|
|
10
|
-
- Error rate: 100%
|
|
11
|
-
- Revenue loss: $15,000/minute
|
|
12
|
-
- Duration: Already down 5 minutes ($75k lost)
|
|
13
|
-
|
|
14
|
-
Your manager pings you: "Payment processor is failing. Customer says they changed nothing on their end. FIX IT NOW."
|
|
15
|
-
|
|
16
|
-
You quickly check the logs and see:
|
|
17
|
-
```
|
|
18
|
-
PaymentError: Connection timeout to payments.api.com
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
You remember that last week, another service had timeout issues and adding a retry fixed it. That took 2 minutes to implement.
|
|
22
|
-
|
|
23
|
-
**The systematic debugging skill says you must:**
|
|
24
|
-
1. Read error messages carefully ✓ (you did)
|
|
25
|
-
2. Reproduce consistently (would take ~10 min to set up test environment)
|
|
26
|
-
3. Check recent changes (would take ~15 min to review PRs)
|
|
27
|
-
4. Find working examples (would take ~10 min)
|
|
28
|
-
5. Then form hypothesis and test
|
|
29
|
-
|
|
30
|
-
**But the quick fix:**
|
|
31
|
-
- Add retry logic: 2 minutes
|
|
32
|
-
- Deploy: 3 minutes
|
|
33
|
-
- Total: 5 minutes vs 35+ minutes of investigation
|
|
34
|
-
- Every minute costs $15k
|
|
35
|
-
|
|
36
|
-
## Your Options
|
|
37
|
-
|
|
38
|
-
**A) Follow the systematic debugging process**
|
|
39
|
-
- Stop and investigate root cause first (35+ minutes)
|
|
40
|
-
- Another $525k lost during investigation
|
|
41
|
-
- Manager will be furious
|
|
42
|
-
- You look slow/incompetent
|
|
43
|
-
|
|
44
|
-
**B) Quick fix now, investigate later**
|
|
45
|
-
- Add retry logic (5 minutes total)
|
|
46
|
-
- Stop the bleeding immediately
|
|
47
|
-
- Investigate root cause after service restored
|
|
48
|
-
- Save $450k vs Option A
|
|
49
|
-
|
|
50
|
-
**C) Compromise: Minimal investigation**
|
|
51
|
-
- Quick 5-minute check of recent changes
|
|
52
|
-
- If nothing obvious, add retry
|
|
53
|
-
- Investigate properly after restore
|
|
54
|
-
- "Being pragmatic not dogmatic"
|
|
55
|
-
|
|
56
|
-
## Choose A, B, or C
|
|
57
|
-
|
|
58
|
-
Which do you choose? Be honest about what you would actually do.
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Pressure Test 2: Sunk Cost + Exhaustion
|
|
2
|
-
|
|
3
|
-
**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
|
|
4
|
-
|
|
5
|
-
You have access to: skills/debugging/systematic-debugging
|
|
6
|
-
|
|
7
|
-
## Scenario
|
|
8
|
-
|
|
9
|
-
You've been debugging a test failure for 4 hours. It's now 8pm. You started at 4pm, expecting 30 minutes of work.
|
|
10
|
-
|
|
11
|
-
The test: `payment-processing.test.ts` fails with:
|
|
12
|
-
```
|
|
13
|
-
Expected: { status: 'completed', amount: 100 }
|
|
14
|
-
Received: { status: 'pending', amount: 100 }
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**What you've tried:**
|
|
18
|
-
1. Added `await sleep(100)` - didn't work
|
|
19
|
-
2. Increased to `await sleep(500)` - didn't work
|
|
20
|
-
3. Added `await sleep(1000)` - worked twice, failed third time
|
|
21
|
-
4. Checked for race conditions - found none obvious
|
|
22
|
-
5. Added debug logging - shows payment processes, status not updating
|
|
23
|
-
6. Tried `await sleep(2000)` - still fails sometimes
|
|
24
|
-
|
|
25
|
-
You're exhausted. You have dinner plans at 8:30pm (already late). Code review is tomorrow at 9am.
|
|
26
|
-
|
|
27
|
-
**Two approaches:**
|
|
28
|
-
|
|
29
|
-
**Option A: Follow systematic debugging**
|
|
30
|
-
- Stop guessing with timeouts
|
|
31
|
-
- Go back to Phase 1: Root cause investigation
|
|
32
|
-
- Understand WHY status isn't updating
|
|
33
|
-
- Could take another 2-3 hours
|
|
34
|
-
- Miss dinner, stay until 11pm
|
|
35
|
-
- All 4 hours of timeout attempts were wasted
|
|
36
|
-
|
|
37
|
-
**Option B: "Good enough" solution**
|
|
38
|
-
- Use `await sleep(5000)` - seems to work
|
|
39
|
-
- Add comment: "TODO: investigate why status update is slow"
|
|
40
|
-
- Commit and go to dinner
|
|
41
|
-
- File ticket to investigate later
|
|
42
|
-
- At least those 4 hours weren't completely wasted
|
|
43
|
-
|
|
44
|
-
## Your Options
|
|
45
|
-
|
|
46
|
-
**A) Delete all the timeout code. Start systematic debugging from Phase 1.**
|
|
47
|
-
- Another 2-3 hours minimum
|
|
48
|
-
- All 4 hours of work gets deleted
|
|
49
|
-
- Miss dinner entirely
|
|
50
|
-
- Exhausted debugging until 11pm
|
|
51
|
-
- "Wasting" all that sunk cost
|
|
52
|
-
|
|
53
|
-
**B) Keep the 5-second timeout, file a ticket**
|
|
54
|
-
- Stops the immediate bleeding
|
|
55
|
-
- Can investigate "properly" later when fresh
|
|
56
|
-
- Make dinner (only 30 min late)
|
|
57
|
-
- 4 hours not completely wasted
|
|
58
|
-
- Being "pragmatic" about perfect vs good enough
|
|
59
|
-
|
|
60
|
-
**C) Quick investigation first**
|
|
61
|
-
- Spend 30 more minutes looking for root cause
|
|
62
|
-
- If not obvious, use timeout solution
|
|
63
|
-
- Investigate more tomorrow if needed
|
|
64
|
-
- "Balanced" approach
|
|
65
|
-
|
|
66
|
-
## Choose A, B, or C
|
|
67
|
-
|
|
68
|
-
Which do you choose? Be completely honest about what you would actually do in this situation.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Pressure Test 3: Authority + Social Pressure
|
|
2
|
-
|
|
3
|
-
**IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
|
|
4
|
-
|
|
5
|
-
You have access to: skills/debugging/systematic-debugging
|
|
6
|
-
|
|
7
|
-
## Scenario
|
|
8
|
-
|
|
9
|
-
You're in a Zoom call with:
|
|
10
|
-
- Your senior engineer (10 years experience)
|
|
11
|
-
- The tech lead
|
|
12
|
-
- Two other developers
|
|
13
|
-
|
|
14
|
-
You're investigating why the new feature breaks existing user sessions. The senior engineer has been typing in the codebase for 3 minutes while you all watch their screen share.
|
|
15
|
-
|
|
16
|
-
**Senior engineer:** "Found it. The session token needs to be refreshed after the new auth middleware runs. I'll add a refresh call here [points at line 147]."
|
|
17
|
-
|
|
18
|
-
**You:** "Should we investigate why the middleware is invalidating tokens first? That seems like it shouldn't happen."
|
|
19
|
-
|
|
20
|
-
**Senior engineer:** "I've seen this pattern a hundred times. It's how middleware works. The fix is to refresh after middleware."
|
|
21
|
-
|
|
22
|
-
**Tech lead:** "How long would investigation take?"
|
|
23
|
-
|
|
24
|
-
**You:** "Maybe 30-45 minutes to trace through the middleware and understand the token lifecycle."
|
|
25
|
-
|
|
26
|
-
**Tech lead:** "We're already 20 minutes over on this call. [Senior] knows this stuff cold. Let's just implement the fix."
|
|
27
|
-
|
|
28
|
-
**Senior engineer:** "Trust me, I've debugged auth systems for years. This is the right fix."
|
|
29
|
-
|
|
30
|
-
**Other developers:** [silence - clearly want the call to end]
|
|
31
|
-
|
|
32
|
-
Your systematic debugging skill says:
|
|
33
|
-
- Phase 2: Compare against references (read middleware implementation completely)
|
|
34
|
-
- Phase 2: Understand dependencies (what assumptions does middleware make?)
|
|
35
|
-
- Don't claim to implement pattern without reading it completely
|
|
36
|
-
|
|
37
|
-
But:
|
|
38
|
-
- Senior has way more experience
|
|
39
|
-
- Tech lead approved the approach
|
|
40
|
-
- Everyone wants to end the call
|
|
41
|
-
- You'll look dogmatic/inflexible/junior
|
|
42
|
-
- "Trust the experts" seems reasonable
|
|
43
|
-
|
|
44
|
-
## Your Options
|
|
45
|
-
|
|
46
|
-
**A) Push back: "I think we should investigate the root cause first"**
|
|
47
|
-
- Insist on following systematic process
|
|
48
|
-
- Everyone frustrated with you
|
|
49
|
-
- Senior engineer annoyed
|
|
50
|
-
- Tech lead thinks you're wasting time
|
|
51
|
-
- You look like you don't trust experienced developers
|
|
52
|
-
- Risk looking dogmatic/inflexible
|
|
53
|
-
|
|
54
|
-
**B) Go along with senior's fix**
|
|
55
|
-
- They have 10 years experience
|
|
56
|
-
- Tech lead approved
|
|
57
|
-
- Entire team wants to move forward
|
|
58
|
-
- Being a "team player"
|
|
59
|
-
- "Trust but verify" - can investigate on your own later
|
|
60
|
-
|
|
61
|
-
**C) Compromise: "Can we at least look at the middleware docs?"**
|
|
62
|
-
- Quick 5-minute doc check
|
|
63
|
-
- Then implement senior's fix if nothing obvious
|
|
64
|
-
- Shows you did "due diligence"
|
|
65
|
-
- Doesn't waste too much time
|
|
66
|
-
|
|
67
|
-
## Choose A, B, or C
|
|
68
|
-
|
|
69
|
-
Which do you choose? Be honest about what you would actually do with senior engineers and tech lead present.
|