liteagents 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +441 -0
  2. package/LICENSE +21 -0
  3. package/README.md +179 -0
  4. package/cli.js +230 -0
  5. package/docs/.gitkeep +1 -0
  6. package/docs/CONTRIBUTING.md +739 -0
  7. package/docs/DUAL_PUBLISH_SUMMARY.md +177 -0
  8. package/docs/ERROR_HANDLING_IMPLEMENTATION.md +327 -0
  9. package/docs/GITHUB_PACKAGES.md +181 -0
  10. package/docs/GITHUB_SETUP.md +158 -0
  11. package/docs/INSTALLATION_DEMO.md +691 -0
  12. package/docs/INSTALLATION_LOCATIONS.md +299 -0
  13. package/docs/INSTALLER_GUIDE.md +1586 -0
  14. package/docs/INTEGRATION_ISSUES_9.1.md +341 -0
  15. package/docs/KNOWLEDGE_BASE.md +727 -0
  16. package/docs/MIGRATION.md +384 -0
  17. package/docs/PACKAGE_BASELINE.md +557 -0
  18. package/docs/PACKAGE_VALIDATION_REPORT.md +427 -0
  19. package/docs/PASS_INTEGRATION.md +307 -0
  20. package/docs/PASS_QUICK_START.md +150 -0
  21. package/docs/PRIVACY.md +203 -0
  22. package/docs/PUBLISHING.md +494 -0
  23. package/docs/QUICK-START.md +318 -0
  24. package/docs/RELEASE_NOTES_1.2.0.md +323 -0
  25. package/docs/SECURITY.md +317 -0
  26. package/docs/SILENT_MODE_GUIDE.md +526 -0
  27. package/docs/SKILLS_CONVERSION.md +154 -0
  28. package/docs/TESTING.md +582 -0
  29. package/docs/TEST_COVERAGE.md +347 -0
  30. package/docs/TROUBLESHOOTING.md +788 -0
  31. package/docs/UPDATED_VARIANT_CONFIGURATION.md +274 -0
  32. package/docs/VARIANT_CONFIGURATION.md +440 -0
  33. package/installer/cli.js +761 -0
  34. package/installer/installation-engine.js +1536 -0
  35. package/installer/package-manager.js +640 -0
  36. package/installer/path-manager.js +427 -0
  37. package/installer/report-template.js +298 -0
  38. package/installer/verification-system.js +274 -0
  39. package/package.json +83 -0
  40. package/packages/ampcode/AGENT.md +58 -0
  41. package/packages/ampcode/README.md +17 -0
  42. package/packages/ampcode/agents/1-create-prd.md +175 -0
  43. package/packages/ampcode/agents/2-generate-tasks.md +190 -0
  44. package/packages/ampcode/agents/3-process-task-list.md +225 -0
  45. package/packages/ampcode/agents/code-developer.md +198 -0
  46. package/packages/ampcode/agents/context-builder.md +142 -0
  47. package/packages/ampcode/agents/feature-planner.md +199 -0
  48. package/packages/ampcode/agents/market-researcher.md +89 -0
  49. package/packages/ampcode/agents/orchestrator.md +116 -0
  50. package/packages/ampcode/agents/quality-assurance.md +115 -0
  51. package/packages/ampcode/agents/system-architect.md +135 -0
  52. package/packages/ampcode/agents/ui-designer.md +184 -0
  53. package/packages/ampcode/commands/brainstorming.md +56 -0
  54. package/packages/ampcode/commands/code-review.md +107 -0
  55. package/packages/ampcode/commands/condition-based-waiting/example.ts +158 -0
  56. package/packages/ampcode/commands/condition-based-waiting.md +122 -0
  57. package/packages/ampcode/commands/debug.md +20 -0
  58. package/packages/ampcode/commands/docs-builder/templates.md +572 -0
  59. package/packages/ampcode/commands/docs-builder.md +106 -0
  60. package/packages/ampcode/commands/explain.md +18 -0
  61. package/packages/ampcode/commands/git-commit.md +14 -0
  62. package/packages/ampcode/commands/optimize.md +20 -0
  63. package/packages/ampcode/commands/refactor.md +21 -0
  64. package/packages/ampcode/commands/review.md +18 -0
  65. package/packages/ampcode/commands/root-cause-tracing/find-polluter.sh +63 -0
  66. package/packages/ampcode/commands/root-cause-tracing.md +176 -0
  67. package/packages/ampcode/commands/security.md +21 -0
  68. package/packages/ampcode/commands/ship.md +18 -0
  69. package/packages/ampcode/commands/skill-creator/scripts/init_skill.py +303 -0
  70. package/packages/ampcode/commands/skill-creator/scripts/package_skill.py +110 -0
  71. package/packages/ampcode/commands/skill-creator/scripts/quick_validate.py +65 -0
  72. package/packages/ampcode/commands/skill-creator.md +211 -0
  73. package/packages/ampcode/commands/stash.md +45 -0
  74. package/packages/ampcode/commands/systematic-debugging.md +297 -0
  75. package/packages/ampcode/commands/test-driven-development.md +390 -0
  76. package/packages/ampcode/commands/test-generate.md +18 -0
  77. package/packages/ampcode/commands/testing-anti-patterns.md +304 -0
  78. package/packages/ampcode/commands/verification-before-completion.md +152 -0
  79. package/packages/ampcode/settings.json +13 -0
  80. package/packages/ampcode/variants.json +8 -0
  81. package/packages/claude/CLAUDE.md +58 -0
  82. package/packages/claude/README.md +23 -0
  83. package/packages/claude/agents/1-create-prd.md +175 -0
  84. package/packages/claude/agents/2-generate-tasks.md +190 -0
  85. package/packages/claude/agents/3-process-task-list.md +225 -0
  86. package/packages/claude/agents/code-developer.md +198 -0
  87. package/packages/claude/agents/context-builder.md +142 -0
  88. package/packages/claude/agents/feature-planner.md +199 -0
  89. package/packages/claude/agents/market-researcher.md +89 -0
  90. package/packages/claude/agents/orchestrator.md +117 -0
  91. package/packages/claude/agents/quality-assurance.md +115 -0
  92. package/packages/claude/agents/system-architect.md +135 -0
  93. package/packages/claude/agents/ui-designer.md +184 -0
  94. package/packages/claude/commands/debug.md +20 -0
  95. package/packages/claude/commands/explain.md +18 -0
  96. package/packages/claude/commands/git-commit.md +14 -0
  97. package/packages/claude/commands/optimize.md +20 -0
  98. package/packages/claude/commands/refactor.md +21 -0
  99. package/packages/claude/commands/review.md +18 -0
  100. package/packages/claude/commands/security.md +21 -0
  101. package/packages/claude/commands/ship.md +18 -0
  102. package/packages/claude/commands/stash.md +45 -0
  103. package/packages/claude/commands/test-generate.md +18 -0
  104. package/packages/claude/skills/brainstorming/SKILL.md +56 -0
  105. package/packages/claude/skills/code-review/SKILL.md +107 -0
  106. package/packages/claude/skills/code-review/code-reviewer.md +146 -0
  107. package/packages/claude/skills/condition-based-waiting/SKILL.md +122 -0
  108. package/packages/claude/skills/condition-based-waiting/example.ts +158 -0
  109. package/packages/claude/skills/docs-builder/SKILL.md +106 -0
  110. package/packages/claude/skills/docs-builder/references/templates.md +572 -0
  111. package/packages/claude/skills/root-cause-tracing/SKILL.md +176 -0
  112. package/packages/claude/skills/root-cause-tracing/find-polluter.sh +63 -0
  113. package/packages/claude/skills/skill-creator/LICENSE.txt +202 -0
  114. package/packages/claude/skills/skill-creator/SKILL.md +211 -0
  115. package/packages/claude/skills/skill-creator/scripts/init_skill.py +303 -0
  116. package/packages/claude/skills/skill-creator/scripts/package_skill.py +110 -0
  117. package/packages/claude/skills/skill-creator/scripts/quick_validate.py +65 -0
  118. package/packages/claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  119. package/packages/claude/skills/systematic-debugging/SKILL.md +296 -0
  120. package/packages/claude/skills/systematic-debugging/test-academic.md +14 -0
  121. package/packages/claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  122. package/packages/claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  123. package/packages/claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  124. package/packages/claude/skills/test-driven-development/SKILL.md +392 -0
  125. package/packages/claude/skills/testing-anti-patterns/SKILL.md +304 -0
  126. package/packages/claude/skills/verification-before-completion/SKILL.md +152 -0
  127. package/packages/claude/variants.json +9 -0
  128. package/packages/droid/AGENTS.md +52 -0
  129. package/packages/droid/README.md +17 -0
  130. package/packages/droid/change_settings.json +61 -0
  131. package/packages/droid/commands/brainstorming.md +56 -0
  132. package/packages/droid/commands/code-review.md +107 -0
  133. package/packages/droid/commands/condition-based-waiting/example.ts +158 -0
  134. package/packages/droid/commands/condition-based-waiting.md +122 -0
  135. package/packages/droid/commands/debug.md +20 -0
  136. package/packages/droid/commands/docs-builder/templates.md +572 -0
  137. package/packages/droid/commands/docs-builder.md +106 -0
  138. package/packages/droid/commands/explain.md +18 -0
  139. package/packages/droid/commands/git-commit.md +14 -0
  140. package/packages/droid/commands/optimize.md +20 -0
  141. package/packages/droid/commands/refactor.md +21 -0
  142. package/packages/droid/commands/review.md +18 -0
  143. package/packages/droid/commands/root-cause-tracing/find-polluter.sh +63 -0
  144. package/packages/droid/commands/root-cause-tracing.md +176 -0
  145. package/packages/droid/commands/security.md +21 -0
  146. package/packages/droid/commands/ship.md +18 -0
  147. package/packages/droid/commands/skill-creator/scripts/init_skill.py +303 -0
  148. package/packages/droid/commands/skill-creator/scripts/package_skill.py +110 -0
  149. package/packages/droid/commands/skill-creator/scripts/quick_validate.py +65 -0
  150. package/packages/droid/commands/skill-creator.md +211 -0
  151. package/packages/droid/commands/stash.md +45 -0
  152. package/packages/droid/commands/systematic-debugging.md +297 -0
  153. package/packages/droid/commands/test-driven-development.md +390 -0
  154. package/packages/droid/commands/test-generate.md +18 -0
  155. package/packages/droid/commands/testing-anti-patterns.md +304 -0
  156. package/packages/droid/commands/verification-before-completion.md +152 -0
  157. package/packages/droid/droids/1-create-prd.md +170 -0
  158. package/packages/droid/droids/2-generate-tasks.md +190 -0
  159. package/packages/droid/droids/3-process-task-list.md +225 -0
  160. package/packages/droid/droids/code-developer.md +198 -0
  161. package/packages/droid/droids/context-builder.md +142 -0
  162. package/packages/droid/droids/feature-planner.md +199 -0
  163. package/packages/droid/droids/market-researcher.md +89 -0
  164. package/packages/droid/droids/orchestrator.md +116 -0
  165. package/packages/droid/droids/quality-assurance.md +115 -0
  166. package/packages/droid/droids/system-architect.md +135 -0
  167. package/packages/droid/droids/ui-designer.md +184 -0
  168. package/packages/droid/variants.json +8 -0
  169. package/packages/opencode/AGENTS.md +52 -0
  170. package/packages/opencode/README.md +17 -0
  171. package/packages/opencode/agent/1-create-prd.md +179 -0
  172. package/packages/opencode/agent/2-generate-tasks.md +194 -0
  173. package/packages/opencode/agent/3-process-task-list.md +229 -0
  174. package/packages/opencode/agent/code-developer.md +202 -0
  175. package/packages/opencode/agent/context-builder.md +146 -0
  176. package/packages/opencode/agent/feature-planner.md +203 -0
  177. package/packages/opencode/agent/market-researcher.md +93 -0
  178. package/packages/opencode/agent/orchestrator.md +120 -0
  179. package/packages/opencode/agent/quality-assurance.md +119 -0
  180. package/packages/opencode/agent/system-architect.md +139 -0
  181. package/packages/opencode/agent/ui-designer.md +188 -0
  182. package/packages/opencode/command/brainstorming.md +56 -0
  183. package/packages/opencode/command/code-review.md +107 -0
  184. package/packages/opencode/command/condition-based-waiting/example.ts +158 -0
  185. package/packages/opencode/command/condition-based-waiting.md +122 -0
  186. package/packages/opencode/command/debug.md +20 -0
  187. package/packages/opencode/command/docs-builder/templates.md +572 -0
  188. package/packages/opencode/command/docs-builder.md +106 -0
  189. package/packages/opencode/command/explain.md +18 -0
  190. package/packages/opencode/command/git-commit.md +14 -0
  191. package/packages/opencode/command/optimize.md +20 -0
  192. package/packages/opencode/command/refactor.md +21 -0
  193. package/packages/opencode/command/review.md +18 -0
  194. package/packages/opencode/command/root-cause-tracing/find-polluter.sh +63 -0
  195. package/packages/opencode/command/root-cause-tracing.md +176 -0
  196. package/packages/opencode/command/security.md +21 -0
  197. package/packages/opencode/command/ship.md +18 -0
  198. package/packages/opencode/command/skill-creator/scripts/init_skill.py +303 -0
  199. package/packages/opencode/command/skill-creator/scripts/package_skill.py +110 -0
  200. package/packages/opencode/command/skill-creator/scripts/quick_validate.py +65 -0
  201. package/packages/opencode/command/skill-creator.md +211 -0
  202. package/packages/opencode/command/stash.md +45 -0
  203. package/packages/opencode/command/systematic-debugging.md +297 -0
  204. package/packages/opencode/command/test-driven-development.md +390 -0
  205. package/packages/opencode/command/test-generate.md +18 -0
  206. package/packages/opencode/command/testing-anti-patterns.md +304 -0
  207. package/packages/opencode/command/verification-before-completion.md +152 -0
  208. package/packages/opencode/opencode.jsonc +201 -0
  209. package/packages/opencode/variants.json +8 -0
  210. package/packages/subagentic-manual.md +349 -0
  211. package/postinstall.js +21 -0
  212. package/tools/ampcode/manifest-template.json +14 -0
  213. package/tools/claude/manifest-template.json +14 -0
  214. package/tools/droid/manifest-template.json +14 -0
  215. package/tools/opencode/manifest-template.json +14 -0
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: root-cause-tracing
3
+ description: Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack, adding instrumentation when needed, to identify source of invalid data or incorrect behavior
4
+ usage: /root-cause-tracing <issue-description>
5
+ auto_trigger: false
6
+ ---
7
+
8
+ # Root Cause Tracing
9
+
10
+ ## Overview
11
+
12
+ 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.
13
+
14
+ **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source.
15
+
16
+ ## When to Use
17
+
18
+ ```dot
19
+ digraph when_to_use {
20
+ "Bug appears deep in stack?" [shape=diamond];
21
+ "Can trace backwards?" [shape=diamond];
22
+ "Fix at symptom point" [shape=box];
23
+ "Trace to original trigger" [shape=box];
24
+ "BETTER: Also add defense-in-depth" [shape=box];
25
+
26
+ "Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"];
27
+ "Can trace backwards?" -> "Trace to original trigger" [label="yes"];
28
+ "Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"];
29
+ "Trace to original trigger" -> "BETTER: Also add defense-in-depth";
30
+ }
31
+ ```
32
+
33
+ **Use when:**
34
+ - Error happens deep in execution (not at entry point)
35
+ - Stack trace shows long call chain
36
+ - Unclear where invalid data originated
37
+ - Need to find which test/code triggers the problem
38
+
39
+ ## The Tracing Process
40
+
41
+ ### 1. Observe the Symptom
42
+ ```
43
+ Error: git init failed in /Users/jesse/project/packages/core
44
+ ```
45
+
46
+ ### 2. Find Immediate Cause
47
+ **What code directly causes this?**
48
+ ```typescript
49
+ await execFileAsync('git', ['init'], { cwd: projectDir });
50
+ ```
51
+
52
+ ### 3. Ask: What Called This?
53
+ ```typescript
54
+ WorktreeManager.createSessionWorktree(projectDir, sessionId)
55
+ → called by Session.initializeWorkspace()
56
+ → called by Session.create()
57
+ → called by test at Project.create()
58
+ ```
59
+
60
+ ### 4. Keep Tracing Up
61
+ **What value was passed?**
62
+ - `projectDir = ''` (empty string!)
63
+ - Empty string as `cwd` resolves to `process.cwd()`
64
+ - That's the source code directory!
65
+
66
+ ### 5. Find Original Trigger
67
+ **Where did empty string come from?**
68
+ ```typescript
69
+ const context = setupCoreTest(); // Returns { tempDir: '' }
70
+ Project.create('name', context.tempDir); // Accessed before beforeEach!
71
+ ```
72
+
73
+ ## Adding Stack Traces
74
+
75
+ When you can't trace manually, add instrumentation:
76
+
77
+ ```typescript
78
+ // Before the problematic operation
79
+ async function gitInit(directory: string) {
80
+ const stack = new Error().stack;
81
+ console.error('DEBUG git init:', {
82
+ directory,
83
+ cwd: process.cwd(),
84
+ nodeEnv: process.env.NODE_ENV,
85
+ stack,
86
+ });
87
+
88
+ await execFileAsync('git', ['init'], { cwd: directory });
89
+ }
90
+ ```
91
+
92
+ **Critical:** Use `console.error()` in tests (not logger - may not show)
93
+
94
+ **Run and capture:**
95
+ ```bash
96
+ npm test 2>&1 | grep 'DEBUG git init'
97
+ ```
98
+
99
+ **Analyze stack traces:**
100
+ - Look for test file names
101
+ - Find the line number triggering the call
102
+ - Identify the pattern (same test? same parameter?)
103
+
104
+ ## Finding Which Test Causes Pollution
105
+
106
+ If something appears during tests but you don't know which test:
107
+
108
+ Use the bisection script: @find-polluter.sh
109
+
110
+ ```bash
111
+ ./find-polluter.sh '.git' 'src/**/*.test.ts'
112
+ ```
113
+
114
+ Runs tests one-by-one, stops at first polluter. See script for usage.
115
+
116
+ ## Real Example: Empty projectDir
117
+
118
+ **Symptom:** `.git` created in `packages/core/` (source code)
119
+
120
+ **Trace chain:**
121
+ 1. `git init` runs in `process.cwd()` ← empty cwd parameter
122
+ 2. WorktreeManager called with empty projectDir
123
+ 3. Session.create() passed empty string
124
+ 4. Test accessed `context.tempDir` before beforeEach
125
+ 5. setupCoreTest() returns `{ tempDir: '' }` initially
126
+
127
+ **Root cause:** Top-level variable initialization accessing empty value
128
+
129
+ **Fix:** Made tempDir a getter that throws if accessed before beforeEach
130
+
131
+ **Also added defense-in-depth:**
132
+ - Layer 1: Project.create() validates directory
133
+ - Layer 2: WorkspaceManager validates not empty
134
+ - Layer 3: NODE_ENV guard refuses git init outside tmpdir
135
+ - Layer 4: Stack trace logging before git init
136
+
137
+ ## Key Principle
138
+
139
+ ```dot
140
+ digraph principle {
141
+ "Found immediate cause" [shape=ellipse];
142
+ "Can trace one level up?" [shape=diamond];
143
+ "Trace backwards" [shape=box];
144
+ "Is this the source?" [shape=diamond];
145
+ "Fix at source" [shape=box];
146
+ "Add validation at each layer" [shape=box];
147
+ "Bug impossible" [shape=doublecircle];
148
+ "NEVER fix just the symptom" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
149
+
150
+ "Found immediate cause" -> "Can trace one level up?";
151
+ "Can trace one level up?" -> "Trace backwards" [label="yes"];
152
+ "Can trace one level up?" -> "NEVER fix just the symptom" [label="no"];
153
+ "Trace backwards" -> "Is this the source?";
154
+ "Is this the source?" -> "Trace backwards" [label="no - keeps going"];
155
+ "Is this the source?" -> "Fix at source" [label="yes"];
156
+ "Fix at source" -> "Add validation at each layer";
157
+ "Add validation at each layer" -> "Bug impossible";
158
+ }
159
+ ```
160
+
161
+ **NEVER fix just where the error appears.** Trace back to find the original trigger.
162
+
163
+ ## Stack Trace Tips
164
+
165
+ **In tests:** Use `console.error()` not logger - logger may be suppressed
166
+ **Before operation:** Log before the dangerous operation, not after it fails
167
+ **Include context:** Directory, cwd, environment variables, timestamps
168
+ **Capture stack:** `new Error().stack` shows complete call chain
169
+
170
+ ## Real-World Impact
171
+
172
+ From debugging session (2025-10-03):
173
+ - Found root cause through 5-level trace
174
+ - Fixed at source (getter validation)
175
+ - Added 4 layers of defense
176
+ - 1847 tests passed, zero pollution
@@ -0,0 +1,63 @@
1
+ #!/bin/bash
2
+ # Bisection script to find which test creates unwanted files/state
3
+ # Usage: ./find-polluter.sh <file_or_dir_to_check> <test_pattern>
4
+ # Example: ./find-polluter.sh '.git' 'src/**/*.test.ts'
5
+
6
+ set -e
7
+
8
+ if [ $# -ne 2 ]; then
9
+ echo "Usage: $0 <file_to_check> <test_pattern>"
10
+ echo "Example: $0 '.git' 'src/**/*.test.ts'"
11
+ exit 1
12
+ fi
13
+
14
+ POLLUTION_CHECK="$1"
15
+ TEST_PATTERN="$2"
16
+
17
+ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
18
+ echo "Test pattern: $TEST_PATTERN"
19
+ echo ""
20
+
21
+ # Get list of test files
22
+ TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
23
+ TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
24
+
25
+ echo "Found $TOTAL test files"
26
+ echo ""
27
+
28
+ COUNT=0
29
+ for TEST_FILE in $TEST_FILES; do
30
+ COUNT=$((COUNT + 1))
31
+
32
+ # Skip if pollution already exists
33
+ if [ -e "$POLLUTION_CHECK" ]; then
34
+ echo "⚠️ Pollution already exists before test $COUNT/$TOTAL"
35
+ echo " Skipping: $TEST_FILE"
36
+ continue
37
+ fi
38
+
39
+ echo "[$COUNT/$TOTAL] Testing: $TEST_FILE"
40
+
41
+ # Run the test
42
+ npm test "$TEST_FILE" > /dev/null 2>&1 || true
43
+
44
+ # Check if pollution appeared
45
+ if [ -e "$POLLUTION_CHECK" ]; then
46
+ echo ""
47
+ echo "🎯 FOUND POLLUTER!"
48
+ echo " Test: $TEST_FILE"
49
+ echo " Created: $POLLUTION_CHECK"
50
+ echo ""
51
+ echo "Pollution details:"
52
+ ls -la "$POLLUTION_CHECK"
53
+ echo ""
54
+ echo "To investigate:"
55
+ echo " npm test $TEST_FILE # Run just this test"
56
+ echo " cat $TEST_FILE # Review test code"
57
+ exit 1
58
+ fi
59
+ done
60
+
61
+ echo ""
62
+ echo "✅ No polluter found - all tests clean!"
63
+ exit 0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: skill-creator
3
+ description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
4
+ usage: /skill-creator <skill-type> <skill-description>
5
+ auto_trigger: false
6
+ license: Complete terms in LICENSE.txt
7
+ ---
8
+
9
+ # Skill Creator
10
+
11
+ This skill provides guidance for creating effective skills.
12
+
13
+ ## About Skills
14
+
15
+ Skills are modular, self-contained packages that extend Claude's capabilities by providing
16
+ specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
17
+ domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
18
+ equipped with procedural knowledge that no model can fully possess.
19
+
20
+ ### What Skills Provide
21
+
22
+ 1. Specialized workflows - Multi-step procedures for specific domains
23
+ 2. Tool integrations - Instructions for working with specific file formats or APIs
24
+ 3. Domain expertise - Company-specific knowledge, schemas, business logic
25
+ 4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
26
+
27
+ ### Anatomy of a Skill
28
+
29
+ Every skill consists of a required SKILL.md file and optional bundled resources:
30
+
31
+ ```
32
+ skill-name/
33
+ ├── SKILL.md (required)
34
+ │ ├── YAML frontmatter metadata (required)
35
+ │ │ ├── name: (required)
36
+ │ │ └── description: (required)
37
+ │ └── Markdown instructions (required)
38
+ └── Bundled Resources (optional)
39
+ ├── scripts/ - Executable code (Python/Bash/etc.)
40
+ ├── references/ - Documentation intended to be loaded into context as needed
41
+ └── assets/ - Files used in output (templates, icons, fonts, etc.)
42
+ ```
43
+
44
+ #### SKILL.md (required)
45
+
46
+ **Metadata Quality:** The `name` and `description` in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
47
+
48
+ #### Bundled Resources (optional)
49
+
50
+ ##### Scripts (`scripts/`)
51
+
52
+ Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
53
+
54
+ - **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
55
+ - **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
56
+ - **Benefits**: Token efficient, deterministic, may be executed without loading into context
57
+ - **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
58
+
59
+ ##### References (`references/`)
60
+
61
+ Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
62
+
63
+ - **When to include**: For documentation that Claude should reference while working
64
+ - **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
65
+ - **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
66
+ - **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
67
+ - **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
68
+ - **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
69
+
70
+ ##### Assets (`assets/`)
71
+
72
+ Files not intended to be loaded into context, but rather used within the output Claude produces.
73
+
74
+ - **When to include**: When the skill needs files that will be used in the final output
75
+ - **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
76
+ - **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
77
+ - **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
78
+
79
+ ### Progressive Disclosure Design Principle
80
+
81
+ Skills use a three-level loading system to manage context efficiently:
82
+
83
+ 1. **Metadata (name + description)** - Always in context (~100 words)
84
+ 2. **SKILL.md body** - When skill triggers (<5k words)
85
+ 3. **Bundled resources** - As needed by Claude (Unlimited*)
86
+
87
+ *Unlimited because scripts can be executed without reading into context window.
88
+
89
+ ## Skill Creation Process
90
+
91
+ To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable.
92
+
93
+ ### Step 1: Understanding the Skill with Concrete Examples
94
+
95
+ Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
96
+
97
+ To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
98
+
99
+ For example, when building an image-editor skill, relevant questions include:
100
+
101
+ - "What functionality should the image-editor skill support? Editing, rotating, anything else?"
102
+ - "Can you give some examples of how this skill would be used?"
103
+ - "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
104
+ - "What would a user say that should trigger this skill?"
105
+
106
+ To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
107
+
108
+ Conclude this step when there is a clear sense of the functionality the skill should support.
109
+
110
+ ### Step 2: Planning the Reusable Skill Contents
111
+
112
+ To turn concrete examples into an effective skill, analyze each example by:
113
+
114
+ 1. Considering how to execute on the example from scratch
115
+ 2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
116
+
117
+ Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
118
+
119
+ 1. Rotating a PDF requires re-writing the same code each time
120
+ 2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
121
+
122
+ Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
123
+
124
+ 1. Writing a frontend webapp requires the same boilerplate HTML/React each time
125
+ 2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
126
+
127
+ Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
128
+
129
+ 1. Querying BigQuery requires re-discovering the table schemas and relationships each time
130
+ 2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
131
+
132
+ To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
133
+
134
+ ### Step 3: Initializing the Skill
135
+
136
+ At this point, it is time to actually create the skill.
137
+
138
+ Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
139
+
140
+ When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
141
+
142
+ Usage:
143
+
144
+ ```bash
145
+ scripts/init_skill.py <skill-name> --path <output-directory>
146
+ ```
147
+
148
+ The script:
149
+
150
+ - Creates the skill directory at the specified path
151
+ - Generates a SKILL.md template with proper frontmatter and TODO placeholders
152
+ - Creates example resource directories: `scripts/`, `references/`, and `assets/`
153
+ - Adds example files in each directory that can be customized or deleted
154
+
155
+ After initialization, customize or remove the generated SKILL.md and example files as needed.
156
+
157
+ ### Step 4: Edit the Skill
158
+
159
+ When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
160
+
161
+ #### Start with Reusable Skill Contents
162
+
163
+ To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
164
+
165
+ Also, delete any example files and directories not needed for the skill. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
166
+
167
+ #### Update SKILL.md
168
+
169
+ **Writing Style:** Write the entire skill using **imperative/infinitive form** (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption.
170
+
171
+ To complete SKILL.md, answer the following questions:
172
+
173
+ 1. What is the purpose of the skill, in a few sentences?
174
+ 2. When should the skill be used?
175
+ 3. In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them.
176
+
177
+ ### Step 5: Packaging a Skill
178
+
179
+ Once the skill is ready, it should be packaged into a distributable zip file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
180
+
181
+ ```bash
182
+ scripts/package_skill.py <path/to/skill-folder>
183
+ ```
184
+
185
+ Optional output directory specification:
186
+
187
+ ```bash
188
+ scripts/package_skill.py <path/to/skill-folder> ./dist
189
+ ```
190
+
191
+ The packaging script will:
192
+
193
+ 1. **Validate** the skill automatically, checking:
194
+ - YAML frontmatter format and required fields
195
+ - Skill naming conventions and directory structure
196
+ - Description completeness and quality
197
+ - File organization and resource references
198
+
199
+ 2. **Package** the skill if validation passes, creating a zip file named after the skill (e.g., `my-skill.zip`) that includes all files and maintains the proper directory structure for distribution.
200
+
201
+ If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
202
+
203
+ ### Step 6: Iterate
204
+
205
+ After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
206
+
207
+ **Iteration workflow:**
208
+ 1. Use the skill on real tasks
209
+ 2. Notice struggles or inefficiencies
210
+ 3. Identify how SKILL.md or bundled resources should be updated
211
+ 4. Implement changes and test again