claude-mpm 4.16.0__py3-none-any.whl → 4.20.3__py3-none-any.whl

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 (131) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +255 -23
  4. claude_mpm/agents/PM_INSTRUCTIONS.md +40 -0
  5. claude_mpm/agents/agent_loader.py +4 -4
  6. claude_mpm/agents/templates/engineer.json +5 -1
  7. claude_mpm/agents/templates/python_engineer.json +8 -3
  8. claude_mpm/agents/templates/rust_engineer.json +12 -7
  9. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  10. claude_mpm/cli/commands/__init__.py +2 -0
  11. claude_mpm/cli/commands/mpm_init.py +109 -24
  12. claude_mpm/cli/commands/skills.py +434 -0
  13. claude_mpm/cli/executor.py +2 -0
  14. claude_mpm/cli/parsers/base_parser.py +7 -0
  15. claude_mpm/cli/parsers/skills_parser.py +137 -0
  16. claude_mpm/cli/startup.py +57 -0
  17. claude_mpm/commands/mpm-auto-configure.md +52 -0
  18. claude_mpm/commands/mpm-help.md +3 -0
  19. claude_mpm/commands/mpm-init.md +112 -6
  20. claude_mpm/commands/mpm-version.md +113 -0
  21. claude_mpm/commands/mpm.md +1 -0
  22. claude_mpm/config/agent_config.py +2 -2
  23. claude_mpm/constants.py +12 -0
  24. claude_mpm/core/config.py +42 -0
  25. claude_mpm/core/factories.py +1 -1
  26. claude_mpm/core/optimized_agent_loader.py +3 -3
  27. claude_mpm/hooks/__init__.py +8 -0
  28. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  29. claude_mpm/hooks/session_resume_hook.py +121 -0
  30. claude_mpm/models/resume_log.py +340 -0
  31. claude_mpm/services/agents/auto_config_manager.py +1 -1
  32. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  33. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  34. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  35. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  36. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  37. claude_mpm/services/agents/local_template_manager.py +1 -1
  38. claude_mpm/services/agents/recommender.py +47 -0
  39. claude_mpm/services/cli/resume_service.py +617 -0
  40. claude_mpm/services/cli/session_manager.py +87 -0
  41. claude_mpm/services/cli/session_resume_helper.py +352 -0
  42. claude_mpm/services/core/path_resolver.py +1 -1
  43. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  44. claude_mpm/services/mcp_config_manager.py +7 -131
  45. claude_mpm/services/session_manager.py +205 -1
  46. claude_mpm/services/unified/deployment_strategies/local.py +1 -1
  47. claude_mpm/services/version_service.py +104 -1
  48. claude_mpm/skills/__init__.py +21 -0
  49. claude_mpm/skills/agent_skills_injector.py +331 -0
  50. claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
  51. claude_mpm/skills/bundled/api-documentation.md +393 -0
  52. claude_mpm/skills/bundled/async-testing.md +571 -0
  53. claude_mpm/skills/bundled/code-review.md +143 -0
  54. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +75 -0
  55. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +184 -0
  56. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +107 -0
  57. claude_mpm/skills/bundled/collaboration/requesting-code-review/code-reviewer.md +146 -0
  58. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +118 -0
  59. claude_mpm/skills/bundled/database-migration.md +199 -0
  60. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +177 -0
  61. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
  62. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
  63. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
  64. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
  65. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
  66. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
  67. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
  68. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
  69. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
  70. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
  71. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +175 -0
  72. claude_mpm/skills/bundled/debugging/verification-before-completion/references/common-failures.md +213 -0
  73. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +314 -0
  74. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +227 -0
  75. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  76. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  77. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  78. claude_mpm/skills/bundled/git-workflow.md +414 -0
  79. claude_mpm/skills/bundled/imagemagick.md +204 -0
  80. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  81. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +74 -0
  82. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +32 -0
  83. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
  84. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
  85. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
  86. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
  87. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +328 -0
  88. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
  89. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
  90. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
  91. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
  92. claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +150 -0
  93. claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +372 -0
  94. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +209 -0
  95. claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +302 -0
  96. claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +111 -0
  97. claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +65 -0
  98. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  99. claude_mpm/skills/bundled/pdf.md +141 -0
  100. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  101. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  102. claude_mpm/skills/bundled/security-scanning.md +327 -0
  103. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  104. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  105. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +123 -0
  106. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
  107. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
  108. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
  109. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
  110. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
  111. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
  112. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +304 -0
  113. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +96 -0
  114. claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
  115. claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +40 -0
  116. claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
  117. claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +107 -0
  118. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  119. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  120. claude_mpm/skills/bundled/xlsx.md +157 -0
  121. claude_mpm/skills/registry.py +97 -9
  122. claude_mpm/skills/skills_registry.py +351 -0
  123. claude_mpm/skills/skills_service.py +730 -0
  124. claude_mpm/utils/agent_dependency_loader.py +2 -2
  125. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/METADATA +181 -32
  126. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/RECORD +130 -48
  127. claude_mpm/agents/INSTRUCTIONS_OLD_DEPRECATED.md +0 -602
  128. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/WHEEL +0 -0
  129. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/entry_points.txt +0 -0
  130. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/licenses/LICENSE +0 -0
  131. {claude_mpm-4.16.0.dist-info → claude_mpm-4.20.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,199 @@
1
+ ---
2
+ skill_id: database-migration
3
+ skill_version: 0.1.0
4
+ description: Safe patterns for evolving database schemas in production.
5
+ updated_at: 2025-10-30T17:00:00Z
6
+ tags: [database, migration, schema, production]
7
+ ---
8
+
9
+ # Database Migration
10
+
11
+ Safe patterns for evolving database schemas in production.
12
+
13
+ ## Migration Principles
14
+
15
+ 1. **Backward compatible** - New code works with old schema
16
+ 2. **Reversible** - Can rollback if needed
17
+ 3. **Tested** - Verify on staging before production
18
+ 4. **Incremental** - Small changes, not big-bang
19
+ 5. **Zero downtime** - No service interruption
20
+
21
+ ## Safe Migration Pattern
22
+
23
+ ### Phase 1: Add New (Compatible)
24
+ ```sql
25
+ -- Add new column (nullable initially)
26
+ ALTER TABLE users ADD COLUMN full_name VARCHAR(255) NULL;
27
+
28
+ -- Deploy new code that writes to both old and new
29
+ UPDATE users SET full_name = CONCAT(first_name, ' ', last_name);
30
+ ```
31
+
32
+ ### Phase 2: Migrate Data
33
+ ```sql
34
+ -- Backfill existing data
35
+ UPDATE users
36
+ SET full_name = CONCAT(first_name, ' ', last_name)
37
+ WHERE full_name IS NULL;
38
+ ```
39
+
40
+ ### Phase 3: Make Required
41
+ ```sql
42
+ -- Make column required
43
+ ALTER TABLE users ALTER COLUMN full_name SET NOT NULL;
44
+ ```
45
+
46
+ ### Phase 4: Remove Old (After New Code Deployed)
47
+ ```sql
48
+ -- Remove old columns
49
+ ALTER TABLE users DROP COLUMN first_name;
50
+ ALTER TABLE users DROP COLUMN last_name;
51
+ ```
52
+
53
+ ## Common Migrations
54
+
55
+ ### Adding Index
56
+ ```sql
57
+ -- Create index concurrently (PostgreSQL)
58
+ CREATE INDEX CONCURRENTLY idx_users_email ON users(email);
59
+ ```
60
+
61
+ ### Renaming Column
62
+ ```sql
63
+ -- Phase 1: Add new column
64
+ ALTER TABLE users ADD COLUMN email_address VARCHAR(255);
65
+
66
+ -- Phase 2: Copy data
67
+ UPDATE users SET email_address = email;
68
+
69
+ -- Phase 3: Drop old column (after deploy)
70
+ ALTER TABLE users DROP COLUMN email;
71
+ ```
72
+
73
+ ### Changing Column Type
74
+ ```sql
75
+ -- Phase 1: Add new column with new type
76
+ ALTER TABLE products ADD COLUMN price_cents INTEGER;
77
+
78
+ -- Phase 2: Migrate data
79
+ UPDATE products SET price_cents = CAST(price * 100 AS INTEGER);
80
+
81
+ -- Phase 3: Drop old column
82
+ ALTER TABLE products DROP COLUMN price;
83
+ ALTER TABLE products RENAME COLUMN price_cents TO price;
84
+ ```
85
+
86
+ ### Adding Foreign Key
87
+ ```sql
88
+ -- Add column first
89
+ ALTER TABLE orders ADD COLUMN user_id INTEGER NULL;
90
+
91
+ -- Populate data
92
+ UPDATE orders SET user_id = (
93
+ SELECT id FROM users WHERE users.email = orders.user_email
94
+ );
95
+
96
+ -- Add foreign key
97
+ ALTER TABLE orders
98
+ ADD CONSTRAINT fk_orders_users
99
+ FOREIGN KEY (user_id) REFERENCES users(id);
100
+ ```
101
+
102
+ ## Migration Tools
103
+
104
+ ### Python (Alembic)
105
+ ```python
106
+ # Generate migration
107
+ alembic revision --autogenerate -m "add user full_name"
108
+
109
+ # Apply migration
110
+ alembic upgrade head
111
+
112
+ # Rollback
113
+ alembic downgrade -1
114
+ ```
115
+
116
+ ### JavaScript (Knex)
117
+ ```javascript
118
+ // Create migration
119
+ knex migrate:make add_full_name
120
+
121
+ // Apply migrations
122
+ knex migrate:latest
123
+
124
+ // Rollback
125
+ knex migrate:rollback
126
+ ```
127
+
128
+ ### Rails
129
+ ```ruby
130
+ # Generate migration
131
+ rails generate migration AddFullNameToUsers full_name:string
132
+
133
+ # Run migrations
134
+ rails db:migrate
135
+
136
+ # Rollback
137
+ rails db:rollback
138
+ ```
139
+
140
+ ## Testing Migrations
141
+
142
+ ```python
143
+ def test_migration_forward_backward():
144
+ # Apply migration
145
+ apply_migration("add_full_name")
146
+
147
+ # Verify schema
148
+ assert column_exists("users", "full_name")
149
+
150
+ # Rollback
151
+ rollback_migration()
152
+
153
+ # Verify rollback
154
+ assert not column_exists("users", "full_name")
155
+ ```
156
+
157
+ ## Dangerous Operations
158
+
159
+ ### ❌ Avoid in Production
160
+ ```sql
161
+ -- Locks table for long time
162
+ ALTER TABLE users ADD COLUMN email VARCHAR(255) NOT NULL;
163
+
164
+ -- Can't rollback
165
+ DROP TABLE old_users;
166
+
167
+ -- Breaks existing code immediately
168
+ ALTER TABLE users DROP COLUMN email;
169
+ ```
170
+
171
+ ### ✅ Safe Alternatives
172
+ ```sql
173
+ -- Add as nullable first
174
+ ALTER TABLE users ADD COLUMN email VARCHAR(255) NULL;
175
+
176
+ -- Rename instead of drop
177
+ ALTER TABLE old_users RENAME TO archived_users;
178
+
179
+ -- Keep old column until new code deployed
180
+ -- (multi-phase approach)
181
+ ```
182
+
183
+ ## Rollback Strategy
184
+
185
+ ```sql
186
+ -- Every migration needs DOWN
187
+ -- UP
188
+ ALTER TABLE users ADD COLUMN full_name VARCHAR(255);
189
+
190
+ -- DOWN
191
+ ALTER TABLE users DROP COLUMN full_name;
192
+ ```
193
+
194
+ ## Remember
195
+ - Test migrations on copy of production data
196
+ - Have rollback plan ready
197
+ - Monitor during deployment
198
+ - Communicate with team about schema changes
199
+ - Keep migrations small and focused
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: Root Cause Tracing
3
+ description: Systematically trace bugs backward through call stack to find original trigger
4
+ when_to_use: when errors occur deep in execution and you need to trace back to find the original trigger
5
+ version: 1.1.0
6
+ languages: all
7
+ ---
8
+
9
+ # Root Cause Tracing
10
+
11
+ ## Overview
12
+
13
+ Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom.
14
+
15
+ **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source.
16
+
17
+ ## When to Use
18
+
19
+ ```dot
20
+ digraph when_to_use {
21
+ "Bug appears deep in stack?" [shape=diamond];
22
+ "Can trace backwards?" [shape=diamond];
23
+ "Fix at symptom point" [shape=box];
24
+ "Trace to original trigger" [shape=box];
25
+ "BETTER: Also add defense-in-depth" [shape=box];
26
+
27
+ "Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"];
28
+ "Can trace backwards?" -> "Trace to original trigger" [label="yes"];
29
+ "Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"];
30
+ "Trace to original trigger" -> "BETTER: Also add defense-in-depth";
31
+ }
32
+ ```
33
+
34
+ **Use when:**
35
+ - Error happens deep in execution (not at entry point)
36
+ - Stack trace shows long call chain
37
+ - Unclear where invalid data originated
38
+ - Need to find which test/code triggers the problem
39
+
40
+ ## The Tracing Process
41
+
42
+ ### 1. Observe the Symptom
43
+ ```
44
+ Error: git init failed in /Users/jesse/project/packages/core
45
+ ```
46
+
47
+ ### 2. Find Immediate Cause
48
+ **What code directly causes this?**
49
+ ```typescript
50
+ await execFileAsync('git', ['init'], { cwd: projectDir });
51
+ ```
52
+
53
+ ### 3. Ask: What Called This?
54
+ ```typescript
55
+ WorktreeManager.createSessionWorktree(projectDir, sessionId)
56
+ → called by Session.initializeWorkspace()
57
+ → called by Session.create()
58
+ → called by test at Project.create()
59
+ ```
60
+
61
+ ### 4. Keep Tracing Up
62
+ **What value was passed?**
63
+ - `projectDir = ''` (empty string!)
64
+ - Empty string as `cwd` resolves to `process.cwd()`
65
+ - That's the source code directory!
66
+
67
+ ### 5. Find Original Trigger
68
+ **Where did empty string come from?**
69
+ ```typescript
70
+ const context = setupCoreTest(); // Returns { tempDir: '' }
71
+ Project.create('name', context.tempDir); // Accessed before beforeEach!
72
+ ```
73
+
74
+ ## Adding Stack Traces
75
+
76
+ When you can't trace manually, add instrumentation:
77
+
78
+ ```typescript
79
+ // Before the problematic operation
80
+ async function gitInit(directory: string) {
81
+ const stack = new Error().stack;
82
+ console.error('DEBUG git init:', {
83
+ directory,
84
+ cwd: process.cwd(),
85
+ nodeEnv: process.env.NODE_ENV,
86
+ stack,
87
+ });
88
+
89
+ await execFileAsync('git', ['init'], { cwd: directory });
90
+ }
91
+ ```
92
+
93
+ **Critical:** Use `console.error()` in tests (not logger - may not show)
94
+
95
+ **Run and capture:**
96
+ ```bash
97
+ npm test 2>&1 | grep 'DEBUG git init'
98
+ ```
99
+
100
+ **Analyze stack traces:**
101
+ - Look for test file names
102
+ - Find the line number triggering the call
103
+ - Identify the pattern (same test? same parameter?)
104
+
105
+ ## Finding Which Test Causes Pollution
106
+
107
+ If something appears during tests but you don't know which test:
108
+
109
+ Use the bisection script: @find-polluter.sh
110
+
111
+ ```bash
112
+ ./find-polluter.sh '.git' 'src/**/*.test.ts'
113
+ ```
114
+
115
+ Runs tests one-by-one, stops at first polluter. See script for usage.
116
+
117
+ ## Real Example: Empty projectDir
118
+
119
+ **Symptom:** `.git` created in `packages/core/` (source code)
120
+
121
+ **Trace chain:**
122
+ 1. `git init` runs in `process.cwd()` ← empty cwd parameter
123
+ 2. WorktreeManager called with empty projectDir
124
+ 3. Session.create() passed empty string
125
+ 4. Test accessed `context.tempDir` before beforeEach
126
+ 5. setupCoreTest() returns `{ tempDir: '' }` initially
127
+
128
+ **Root cause:** Top-level variable initialization accessing empty value
129
+
130
+ **Fix:** Made tempDir a getter that throws if accessed before beforeEach
131
+
132
+ **Also added defense-in-depth:**
133
+ - Layer 1: Project.create() validates directory
134
+ - Layer 2: WorkspaceManager validates not empty
135
+ - Layer 3: NODE_ENV guard refuses git init outside tmpdir
136
+ - Layer 4: Stack trace logging before git init
137
+
138
+ ## Key Principle
139
+
140
+ ```dot
141
+ digraph principle {
142
+ "Found immediate cause" [shape=ellipse];
143
+ "Can trace one level up?" [shape=diamond];
144
+ "Trace backwards" [shape=box];
145
+ "Is this the source?" [shape=diamond];
146
+ "Fix at source" [shape=box];
147
+ "Add validation at each layer" [shape=box];
148
+ "Bug impossible" [shape=doublecircle];
149
+ "NEVER fix just the symptom" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
150
+
151
+ "Found immediate cause" -> "Can trace one level up?";
152
+ "Can trace one level up?" -> "Trace backwards" [label="yes"];
153
+ "Can trace one level up?" -> "NEVER fix just the symptom" [label="no"];
154
+ "Trace backwards" -> "Is this the source?";
155
+ "Is this the source?" -> "Trace backwards" [label="no - keeps going"];
156
+ "Is this the source?" -> "Fix at source" [label="yes"];
157
+ "Fix at source" -> "Add validation at each layer";
158
+ "Add validation at each layer" -> "Bug impossible";
159
+ }
160
+ ```
161
+
162
+ **NEVER fix just where the error appears.** Trace back to find the original trigger.
163
+
164
+ ## Stack Trace Tips
165
+
166
+ **In tests:** Use `console.error()` not logger - logger may be suppressed
167
+ **Before operation:** Log before the dangerous operation, not after it fails
168
+ **Include context:** Directory, cwd, environment variables, timestamps
169
+ **Capture stack:** `new Error().stack` shows complete call chain
170
+
171
+ ## Real-World Impact
172
+
173
+ From debugging session (2025-10-03):
174
+ - Found root cause through 5-level trace
175
+ - Fixed at source (getter validation)
176
+ - Added 4 layers of defense
177
+ - 1847 tests passed, zero pollution
@@ -0,0 +1,119 @@
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*
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Methodical debugging instead of random changes
4
+ version: 2.2.0
5
+ category: debugging
6
+ author: Jesse Vincent
7
+ license: MIT
8
+ source: https://github.com/obra/superpowers-skills/tree/main/skills/debugging/systematic-debugging
9
+ progressive_disclosure:
10
+ entry_point:
11
+ summary: "Replace random code changes with systematic problem diagnosis using four-phase investigation framework"
12
+ when_to_use: "When user reports bugs, errors, test failures, or unexpected behavior. ESPECIALLY when under time pressure or 'quick fixes' seem obvious."
13
+ quick_start: "1. Read error messages completely 2. Reproduce consistently 3. Form specific hypothesis 4. Test with single change 5. Verify fix"
14
+ references:
15
+ - workflow.md
16
+ - examples.md
17
+ - troubleshooting.md
18
+ - anti-patterns.md
19
+ context_limit: 800
20
+ tags:
21
+ - debugging
22
+ - problem-solving
23
+ - root-cause
24
+ - systematic
25
+ requires_tools:
26
+ - debugger
27
+ ---
28
+
29
+ # Systematic Debugging
30
+
31
+ ## Overview
32
+
33
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
34
+
35
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
36
+
37
+ This skill enforces a four-phase systematic approach that ensures root cause investigation before any fix attempt. Violating the letter of this process is violating the spirit of debugging.
38
+
39
+ ## When to Use This Skill
40
+
41
+ Activate when:
42
+ - User reports a bug or error
43
+ - Test failures occur
44
+ - Code behaves unexpectedly
45
+ - Performance problems arise
46
+ - Build or integration failures
47
+ - User says "it's not working"
48
+
49
+ **Use this ESPECIALLY when:**
50
+ - Under time pressure (emergencies make guessing tempting)
51
+ - "Just one quick fix" seems obvious
52
+ - You've already tried multiple fixes
53
+ - Previous fix didn't work
54
+
55
+ ## The Iron Law
56
+
57
+ ```
58
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
59
+ ```
60
+
61
+ If you haven't completed Phase 1, you cannot propose fixes.
62
+
63
+ ## Core Principles
64
+
65
+ 1. **Reproduce First**: Ensure you can reliably reproduce the issue
66
+ 2. **One Change at a Time**: Change only one thing between tests
67
+ 3. **Hypothesis-Driven**: Form hypotheses before making changes
68
+ 4. **Verify Fixes**: Confirm the fix works and doesn't break anything else
69
+
70
+ ## Quick Start
71
+
72
+ 1. **Read Error Messages**: Read completely, including stack traces
73
+ 2. **Reproduce Consistently**: Create reliable reproduction steps
74
+ 3. **Gather Evidence**: Add diagnostic instrumentation in multi-component systems
75
+ 4. **Form Hypothesis**: State clearly "I think X because Y"
76
+ 5. **Test Minimally**: Make smallest possible change
77
+ 6. **Verify Fix**: Confirm resolution and no regressions
78
+
79
+ ## The Four Phases
80
+
81
+ ### Phase 1: Root Cause Investigation
82
+
83
+ **BEFORE attempting ANY fix:**
84
+ - Read error messages carefully (they often contain the solution)
85
+ - Reproduce consistently
86
+ - Check recent changes
87
+ - Gather evidence in multi-component systems
88
+ - Trace data flow back to source
89
+
90
+ ### Phase 2: Pattern Analysis
91
+
92
+ Find working examples, compare against references, identify differences, understand dependencies.
93
+
94
+ ### Phase 3: Hypothesis and Testing
95
+
96
+ Form single hypothesis, test minimally (one variable at a time), verify before continuing.
97
+
98
+ ### Phase 4: Implementation
99
+
100
+ Create failing test case, implement single fix addressing root cause, verify fix works.
101
+
102
+ **If 3+ fixes fail:** STOP and question the architecture - this indicates architectural problems, not failed hypotheses.
103
+
104
+ ## Navigation
105
+
106
+ For detailed information:
107
+ - **[Workflow](references/workflow.md)**: Complete four-phase debugging workflow with decision trees and detailed steps
108
+ - **[Examples](references/examples.md)**: Real-world debugging scenarios with step-by-step walkthroughs
109
+ - **[Troubleshooting](references/troubleshooting.md)**: Common debugging challenges and how to overcome them
110
+ - **[Anti-patterns](references/anti-patterns.md)**: Common mistakes, rationalizations, and red flags
111
+
112
+ ## Key Reminders
113
+
114
+ - NEVER make random changes hoping they'll work
115
+ - ALWAYS reproduce the issue before attempting fixes
116
+ - Form hypothesis BEFORE making changes
117
+ - Change ONE thing at a time
118
+ - Verify fix actually resolves the issue
119
+ - Check for regressions after fixing
120
+ - If 3+ fixes fail, question the architecture
121
+
122
+ ## Red Flags - STOP and Follow Process
123
+
124
+ If you catch yourself thinking:
125
+ - "Quick fix for now, investigate later"
126
+ - "Just try changing X and see if it works"
127
+ - "It's probably X, let me fix that"
128
+ - "I don't fully understand but this might work"
129
+ - "One more fix attempt" (when already tried 2+)
130
+ - Each fix reveals new problem in different place
131
+
132
+ **ALL of these mean: STOP. Return to Phase 1.**
133
+
134
+ ## Integration with Other Skills
135
+
136
+ - **root-cause-tracing**: How to trace back through call stack
137
+ - **defense-in-depth**: Add validation after finding root cause
138
+ - **condition-based-waiting**: Replace timeouts identified in Phase 2
139
+ - **verification-before-completion**: Verify fix worked before claiming success
140
+ - **test-driven-development**: Create failing test case in Phase 4
141
+
142
+ ## Real-World Impact
143
+
144
+ From debugging sessions:
145
+ - Systematic approach: 15-30 minutes to fix
146
+ - Random fixes approach: 2-3 hours of thrashing
147
+ - First-time fix rate: 95% vs 40%
148
+ - New bugs introduced: Near zero vs common