@kata-sh/cli 0.1.0 → 0.1.2
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/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/app-paths.d.ts +4 -0
- package/dist/app-paths.js +6 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +56 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +95 -0
- package/dist/resource-loader.d.ts +18 -0
- package/dist/resource-loader.js +50 -0
- package/dist/wizard.d.ts +15 -0
- package/dist/wizard.js +159 -0
- package/package.json +50 -21
- package/pkg/dist/modes/interactive/theme/dark.json +85 -0
- package/pkg/dist/modes/interactive/theme/light.json +84 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.js +949 -0
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -0
- package/pkg/package.json +8 -0
- package/scripts/postinstall.js +45 -0
- package/src/resources/AGENTS.md +108 -0
- package/src/resources/KATA-WORKFLOW.md +661 -0
- package/src/resources/agents/researcher.md +29 -0
- package/src/resources/agents/scout.md +56 -0
- package/src/resources/agents/worker.md +31 -0
- package/src/resources/extensions/ask-user-questions.ts +200 -0
- package/src/resources/extensions/bg-shell/index.ts +2758 -0
- package/src/resources/extensions/browser-tools/BROWSER-TOOLS-V2-PROPOSAL.md +1277 -0
- package/src/resources/extensions/browser-tools/core.js +1057 -0
- package/src/resources/extensions/browser-tools/index.ts +4916 -0
- package/src/resources/extensions/browser-tools/package.json +20 -0
- package/src/resources/extensions/context7/index.ts +428 -0
- package/src/resources/extensions/context7/package.json +11 -0
- package/src/resources/extensions/get-secrets-from-user.ts +352 -0
- package/src/resources/extensions/github/formatters.ts +207 -0
- package/src/resources/extensions/github/gh-api.ts +537 -0
- package/src/resources/extensions/github/index.ts +778 -0
- package/src/resources/extensions/kata/activity-log.ts +88 -0
- package/src/resources/extensions/kata/auto.ts +2786 -0
- package/src/resources/extensions/kata/commands.ts +355 -0
- package/src/resources/extensions/kata/crash-recovery.ts +85 -0
- package/src/resources/extensions/kata/dashboard-overlay.ts +516 -0
- package/src/resources/extensions/kata/docs/preferences-reference.md +103 -0
- package/src/resources/extensions/kata/doctor.ts +683 -0
- package/src/resources/extensions/kata/files.ts +730 -0
- package/src/resources/extensions/kata/gitignore.ts +165 -0
- package/src/resources/extensions/kata/guided-flow.ts +976 -0
- package/src/resources/extensions/kata/index.ts +556 -0
- package/src/resources/extensions/kata/metrics.ts +397 -0
- package/src/resources/extensions/kata/observability-validator.ts +408 -0
- package/src/resources/extensions/kata/package.json +11 -0
- package/src/resources/extensions/kata/paths.ts +346 -0
- package/src/resources/extensions/kata/preferences.ts +695 -0
- package/src/resources/extensions/kata/prompt-loader.ts +50 -0
- package/src/resources/extensions/kata/prompts/complete-milestone.md +25 -0
- package/src/resources/extensions/kata/prompts/complete-slice.md +27 -0
- package/src/resources/extensions/kata/prompts/discuss.md +151 -0
- package/src/resources/extensions/kata/prompts/doctor-heal.md +29 -0
- package/src/resources/extensions/kata/prompts/execute-task.md +64 -0
- package/src/resources/extensions/kata/prompts/guided-complete-slice.md +1 -0
- package/src/resources/extensions/kata/prompts/guided-discuss-milestone.md +3 -0
- package/src/resources/extensions/kata/prompts/guided-discuss-slice.md +59 -0
- package/src/resources/extensions/kata/prompts/guided-execute-task.md +1 -0
- package/src/resources/extensions/kata/prompts/guided-plan-milestone.md +23 -0
- package/src/resources/extensions/kata/prompts/guided-plan-slice.md +1 -0
- package/src/resources/extensions/kata/prompts/guided-research-slice.md +11 -0
- package/src/resources/extensions/kata/prompts/guided-resume-task.md +1 -0
- package/src/resources/extensions/kata/prompts/plan-milestone.md +47 -0
- package/src/resources/extensions/kata/prompts/plan-slice.md +63 -0
- package/src/resources/extensions/kata/prompts/queue.md +85 -0
- package/src/resources/extensions/kata/prompts/reassess-roadmap.md +48 -0
- package/src/resources/extensions/kata/prompts/replan-slice.md +39 -0
- package/src/resources/extensions/kata/prompts/research-milestone.md +37 -0
- package/src/resources/extensions/kata/prompts/research-slice.md +28 -0
- package/src/resources/extensions/kata/prompts/run-uat.md +109 -0
- package/src/resources/extensions/kata/prompts/system.md +341 -0
- package/src/resources/extensions/kata/session-forensics.ts +550 -0
- package/src/resources/extensions/kata/skill-discovery.ts +137 -0
- package/src/resources/extensions/kata/state.ts +509 -0
- package/src/resources/extensions/kata/templates/context.md +76 -0
- package/src/resources/extensions/kata/templates/decisions.md +8 -0
- package/src/resources/extensions/kata/templates/milestone-summary.md +73 -0
- package/src/resources/extensions/kata/templates/plan.md +133 -0
- package/src/resources/extensions/kata/templates/preferences.md +15 -0
- package/src/resources/extensions/kata/templates/project.md +31 -0
- package/src/resources/extensions/kata/templates/reassessment.md +28 -0
- package/src/resources/extensions/kata/templates/requirements.md +81 -0
- package/src/resources/extensions/kata/templates/research.md +46 -0
- package/src/resources/extensions/kata/templates/roadmap.md +118 -0
- package/src/resources/extensions/kata/templates/slice-context.md +58 -0
- package/src/resources/extensions/kata/templates/slice-summary.md +99 -0
- package/src/resources/extensions/kata/templates/state.md +19 -0
- package/src/resources/extensions/kata/templates/task-plan.md +52 -0
- package/src/resources/extensions/kata/templates/task-summary.md +57 -0
- package/src/resources/extensions/kata/templates/uat.md +54 -0
- package/src/resources/extensions/kata/tests/activity-log-prune.test.ts +327 -0
- package/src/resources/extensions/kata/tests/auto-preflight.test.ts +97 -0
- package/src/resources/extensions/kata/tests/auto-supervisor.test.mjs +53 -0
- package/src/resources/extensions/kata/tests/complete-milestone.test.ts +317 -0
- package/src/resources/extensions/kata/tests/cost-projection.test.ts +160 -0
- package/src/resources/extensions/kata/tests/derive-state-deps.test.ts +477 -0
- package/src/resources/extensions/kata/tests/derive-state.test.ts +1013 -0
- package/src/resources/extensions/kata/tests/doctor.test.ts +718 -0
- package/src/resources/extensions/kata/tests/idle-recovery.test.ts +490 -0
- package/src/resources/extensions/kata/tests/metrics-io.test.ts +254 -0
- package/src/resources/extensions/kata/tests/metrics.test.ts +217 -0
- package/src/resources/extensions/kata/tests/must-have-parser.test.ts +309 -0
- package/src/resources/extensions/kata/tests/parsers.test.ts +1257 -0
- package/src/resources/extensions/kata/tests/plan-milestone.test.ts +185 -0
- package/src/resources/extensions/kata/tests/plan-quality-validator.test.ts +386 -0
- package/src/resources/extensions/kata/tests/reassess-prompt.test.ts +208 -0
- package/src/resources/extensions/kata/tests/replan-slice.test.ts +686 -0
- package/src/resources/extensions/kata/tests/requirements.test.ts +151 -0
- package/src/resources/extensions/kata/tests/resolve-ts-hooks.mjs +17 -0
- package/src/resources/extensions/kata/tests/resolve-ts.mjs +11 -0
- package/src/resources/extensions/kata/tests/run-uat.test.ts +383 -0
- package/src/resources/extensions/kata/tests/unit-runtime.test.ts +388 -0
- package/src/resources/extensions/kata/tests/workspace-index.test.ts +118 -0
- package/src/resources/extensions/kata/tests/worktree.test.ts +222 -0
- package/src/resources/extensions/kata/types.ts +159 -0
- package/src/resources/extensions/kata/unit-runtime.ts +163 -0
- package/src/resources/extensions/kata/workspace-index.ts +203 -0
- package/src/resources/extensions/kata/worktree.ts +182 -0
- package/src/resources/extensions/mac-tools/index.ts +852 -0
- package/src/resources/extensions/mac-tools/swift-cli/Package.swift +22 -0
- package/src/resources/extensions/mac-tools/swift-cli/Sources/main.swift +1318 -0
- package/src/resources/extensions/search-the-web/cache.ts +78 -0
- package/src/resources/extensions/search-the-web/format.ts +258 -0
- package/src/resources/extensions/search-the-web/http.ts +238 -0
- package/src/resources/extensions/search-the-web/index.ts +68 -0
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +519 -0
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +404 -0
- package/src/resources/extensions/search-the-web/tool-search.ts +503 -0
- package/src/resources/extensions/search-the-web/url-utils.ts +91 -0
- package/src/resources/extensions/shared/confirm-ui.ts +126 -0
- package/src/resources/extensions/shared/interview-ui.ts +822 -0
- package/src/resources/extensions/shared/next-action-ui.ts +235 -0
- package/src/resources/extensions/shared/progress-widget.ts +282 -0
- package/src/resources/extensions/shared/thinking-widget.ts +107 -0
- package/src/resources/extensions/shared/ui.ts +400 -0
- package/src/resources/extensions/shared/wizard-ui.ts +551 -0
- package/src/resources/extensions/slash-commands/audit.ts +92 -0
- package/src/resources/extensions/slash-commands/create-extension.ts +375 -0
- package/src/resources/extensions/slash-commands/create-slash-command.ts +280 -0
- package/src/resources/extensions/slash-commands/index.ts +12 -0
- package/src/resources/extensions/slash-commands/kata-run.ts +34 -0
- package/src/resources/extensions/subagent/agents.ts +126 -0
- package/src/resources/extensions/subagent/index.ts +1293 -0
- package/src/resources/skills/debug-like-expert/SKILL.md +231 -0
- package/src/resources/skills/debug-like-expert/references/debugging-mindset.md +253 -0
- package/src/resources/skills/debug-like-expert/references/hypothesis-testing.md +373 -0
- package/src/resources/skills/debug-like-expert/references/investigation-techniques.md +337 -0
- package/src/resources/skills/debug-like-expert/references/verification-patterns.md +425 -0
- package/src/resources/skills/debug-like-expert/references/when-to-research.md +361 -0
- package/src/resources/skills/frontend-design/SKILL.md +45 -0
- package/src/resources/skills/swiftui/SKILL.md +208 -0
- package/src/resources/skills/swiftui/references/animations.md +921 -0
- package/src/resources/skills/swiftui/references/architecture.md +1561 -0
- package/src/resources/skills/swiftui/references/layout-system.md +1186 -0
- package/src/resources/skills/swiftui/references/navigation.md +1492 -0
- package/src/resources/skills/swiftui/references/networking-async.md +214 -0
- package/src/resources/skills/swiftui/references/performance.md +1706 -0
- package/src/resources/skills/swiftui/references/platform-integration.md +204 -0
- package/src/resources/skills/swiftui/references/state-management.md +1443 -0
- package/src/resources/skills/swiftui/references/swiftdata.md +297 -0
- package/src/resources/skills/swiftui/references/testing-debugging.md +247 -0
- package/src/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
- package/src/resources/skills/swiftui/workflows/add-feature.md +191 -0
- package/src/resources/skills/swiftui/workflows/build-new-app.md +311 -0
- package/src/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
- package/src/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
- package/src/resources/skills/swiftui/workflows/ship-app.md +203 -0
- package/src/resources/skills/swiftui/workflows/write-tests.md +235 -0
- package/dist/commands/task.d.ts +0 -9
- package/dist/commands/task.d.ts.map +0 -1
- package/dist/commands/task.js +0 -129
- package/dist/commands/task.js.map +0 -1
- package/dist/commands/task.test.d.ts +0 -2
- package/dist/commands/task.test.d.ts.map +0 -1
- package/dist/commands/task.test.js +0 -169
- package/dist/commands/task.test.js.map +0 -1
- package/dist/e2e/task-e2e.test.d.ts +0 -2
- package/dist/e2e/task-e2e.test.d.ts.map +0 -1
- package/dist/e2e/task-e2e.test.js +0 -173
- package/dist/e2e/task-e2e.test.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -93
- package/dist/index.js.map +0 -1
- package/dist/slug.d.ts +0 -2
- package/dist/slug.d.ts.map +0 -1
- package/dist/slug.js +0 -12
- package/dist/slug.js.map +0 -1
- package/dist/slug.test.d.ts +0 -2
- package/dist/slug.test.d.ts.map +0 -1
- package/dist/slug.test.js +0 -32
- package/dist/slug.test.js.map +0 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
|
|
2
|
+
<overview>
|
|
3
|
+
Debugging requires both reasoning about code and researching external knowledge. The skill is knowing when to use each. This guide helps you recognize signals that indicate you need external knowledge vs when you can reason through the problem with the code in front of you.
|
|
4
|
+
</overview>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
<research_signals>
|
|
8
|
+
|
|
9
|
+
**1. Error messages you don't recognize**
|
|
10
|
+
- Stack traces from libraries you haven't used
|
|
11
|
+
- Cryptic system errors
|
|
12
|
+
- Framework-specific error codes
|
|
13
|
+
|
|
14
|
+
**Action**: Web search the exact error message in quotes
|
|
15
|
+
- Often leads to GitHub issues, Stack Overflow, or official docs
|
|
16
|
+
- Others have likely encountered this
|
|
17
|
+
|
|
18
|
+
<example>
|
|
19
|
+
Error: `EADDRINUSE: address already in use :::3000`
|
|
20
|
+
|
|
21
|
+
This is a system-level error. Research it:
|
|
22
|
+
- Web search: "EADDRINUSE address already in use"
|
|
23
|
+
- Learn: Port is already occupied by another process
|
|
24
|
+
- Solution: Find and kill the process, or use different port
|
|
25
|
+
</example>
|
|
26
|
+
|
|
27
|
+
**2. Library/framework behavior doesn't match expectations**
|
|
28
|
+
- You're using a library correctly (you think) but it's not working
|
|
29
|
+
- Documentation seems to contradict behavior
|
|
30
|
+
- Version-specific quirks
|
|
31
|
+
|
|
32
|
+
**Action**: Check official documentation and recent issues
|
|
33
|
+
- Use Context7 MCP for library docs
|
|
34
|
+
- Search GitHub issues for the library
|
|
35
|
+
- Check if there are breaking changes in recent versions
|
|
36
|
+
|
|
37
|
+
<example>
|
|
38
|
+
You're using `useEffect` in React but it's running on every render despite empty dependency array.
|
|
39
|
+
|
|
40
|
+
Research needed:
|
|
41
|
+
- Check React docs for useEffect rules
|
|
42
|
+
- Search: "useEffect running on every render"
|
|
43
|
+
- Discover: React 18 StrictMode runs effects twice in dev mode
|
|
44
|
+
</example>
|
|
45
|
+
|
|
46
|
+
**3. Domain knowledge gaps**
|
|
47
|
+
- Debugging authentication: need to understand OAuth flow
|
|
48
|
+
- Debugging database: need to understand indexes, query optimization
|
|
49
|
+
- Debugging networking: need to understand HTTP caching, CORS
|
|
50
|
+
|
|
51
|
+
**Action**: Research the domain concept, not just the specific bug
|
|
52
|
+
- Use MCP servers for domain knowledge
|
|
53
|
+
- Read official specifications
|
|
54
|
+
- Find authoritative guides
|
|
55
|
+
|
|
56
|
+
**4. Platform-specific behavior**
|
|
57
|
+
- "Works in Chrome but not Safari"
|
|
58
|
+
- "Works on Mac but not Windows"
|
|
59
|
+
- "Works in Node 16 but not Node 18"
|
|
60
|
+
|
|
61
|
+
**Action**: Research platform differences
|
|
62
|
+
- Browser compatibility tables
|
|
63
|
+
- Platform-specific documentation
|
|
64
|
+
- Known platform bugs
|
|
65
|
+
|
|
66
|
+
**5. Recent changes in ecosystem**
|
|
67
|
+
- Package update broke something
|
|
68
|
+
- New framework version behaves differently
|
|
69
|
+
- Deprecated API
|
|
70
|
+
|
|
71
|
+
**Action**: Check changelogs and migration guides
|
|
72
|
+
- Library CHANGELOG.md
|
|
73
|
+
- Migration guides
|
|
74
|
+
- "Breaking changes" documentation
|
|
75
|
+
|
|
76
|
+
</research_signals>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<reasoning_signals>
|
|
80
|
+
|
|
81
|
+
**1. The bug is in YOUR code**
|
|
82
|
+
- Not library behavior, not system issues
|
|
83
|
+
- Your business logic, your data structures
|
|
84
|
+
- Code you or your team wrote
|
|
85
|
+
|
|
86
|
+
**Approach**: Read the code, trace execution, add logging
|
|
87
|
+
- You have full access to the code
|
|
88
|
+
- You can modify it to add observability
|
|
89
|
+
- No external documentation will help
|
|
90
|
+
|
|
91
|
+
<example>
|
|
92
|
+
Bug: Shopping cart total calculates incorrectly
|
|
93
|
+
|
|
94
|
+
This is your logic:
|
|
95
|
+
```javascript
|
|
96
|
+
function calculateTotal(items) {
|
|
97
|
+
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Don't research "shopping cart calculation bugs"
|
|
102
|
+
DO reason through it:
|
|
103
|
+
- Log each item's price and quantity
|
|
104
|
+
- Log the running sum
|
|
105
|
+
- Trace the logic step by step
|
|
106
|
+
</example>
|
|
107
|
+
|
|
108
|
+
**2. You have all the information needed**
|
|
109
|
+
- The bug is reproducible
|
|
110
|
+
- You can read all relevant code
|
|
111
|
+
- No external dependencies involved
|
|
112
|
+
|
|
113
|
+
**Approach**: Use investigation techniques
|
|
114
|
+
- Binary search to narrow down
|
|
115
|
+
- Minimal reproduction
|
|
116
|
+
- Working backwards
|
|
117
|
+
- Add observability
|
|
118
|
+
|
|
119
|
+
**3. It's a logic error, not a knowledge gap**
|
|
120
|
+
- Off-by-one errors
|
|
121
|
+
- Wrong conditional
|
|
122
|
+
- State management issue
|
|
123
|
+
- Data transformation bug
|
|
124
|
+
|
|
125
|
+
**Approach**: Trace the logic carefully
|
|
126
|
+
- Print intermediate values
|
|
127
|
+
- Check assumptions
|
|
128
|
+
- Verify each step
|
|
129
|
+
|
|
130
|
+
**4. The answer is in the behavior, not the documentation**
|
|
131
|
+
- "What is this function actually doing?"
|
|
132
|
+
- "Why is this value null?"
|
|
133
|
+
- "When does this code execute?"
|
|
134
|
+
|
|
135
|
+
**Approach**: Observe the actual behavior
|
|
136
|
+
- Add logging
|
|
137
|
+
- Use a debugger
|
|
138
|
+
- Test with different inputs
|
|
139
|
+
|
|
140
|
+
</reasoning_signals>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<research_how>
|
|
144
|
+
|
|
145
|
+
**Web Search - When and How**
|
|
146
|
+
|
|
147
|
+
**When**:
|
|
148
|
+
- Error messages
|
|
149
|
+
- Library-specific questions
|
|
150
|
+
- "How to X in framework Y"
|
|
151
|
+
- Troubleshooting platform issues
|
|
152
|
+
|
|
153
|
+
**How**:
|
|
154
|
+
- Use exact error messages in quotes: `"Cannot read property 'map' of undefined"`
|
|
155
|
+
- Include framework/library version: `"react 18 useEffect behavior"`
|
|
156
|
+
- Add "github issue" for known bugs: `"prisma connection pool github issue"`
|
|
157
|
+
- Add year for recent changes: `"nextjs 14 middleware 2024"`
|
|
158
|
+
|
|
159
|
+
**Good search queries**:
|
|
160
|
+
- `"ECONNREFUSED" node.js postgres`
|
|
161
|
+
- `"Maximum update depth exceeded" react hooks`
|
|
162
|
+
- `typescript generic constraints examples`
|
|
163
|
+
|
|
164
|
+
**Bad search queries**:
|
|
165
|
+
- `my code doesn't work` (too vague)
|
|
166
|
+
- `bug in react` (too broad)
|
|
167
|
+
- `help` (useless)
|
|
168
|
+
|
|
169
|
+
**Context7 MCP - When and How**
|
|
170
|
+
|
|
171
|
+
**When**:
|
|
172
|
+
- Need API reference
|
|
173
|
+
- Understanding library concepts
|
|
174
|
+
- Finding specific function signatures
|
|
175
|
+
- Learning correct usage patterns
|
|
176
|
+
|
|
177
|
+
**How**:
|
|
178
|
+
```
|
|
179
|
+
Use mcp__context7__resolve-library-id with library name
|
|
180
|
+
Then mcp__context7__get-library-docs with library ID
|
|
181
|
+
Ask specific questions about the library
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Good uses**:
|
|
185
|
+
- "How do I use Prisma transactions?"
|
|
186
|
+
- "What are the parameters for stripe.customers.create?"
|
|
187
|
+
- "How does Express middleware error handling work?"
|
|
188
|
+
|
|
189
|
+
**Bad uses**:
|
|
190
|
+
- "Fix my bug" (too vague, Context7 provides docs not debugging)
|
|
191
|
+
- "Why isn't my code working?" (need to research specific concepts, not general debugging)
|
|
192
|
+
|
|
193
|
+
**GitHub Issues Search**
|
|
194
|
+
|
|
195
|
+
**When**:
|
|
196
|
+
- Experiencing behavior that seems like a bug
|
|
197
|
+
- Library not working as documented
|
|
198
|
+
- Looking for workarounds
|
|
199
|
+
|
|
200
|
+
**How**:
|
|
201
|
+
- Search in the library's GitHub repo
|
|
202
|
+
- Include relevant keywords
|
|
203
|
+
- Check both open and closed issues
|
|
204
|
+
- Look for issues with "bug" or "regression" labels
|
|
205
|
+
|
|
206
|
+
**Official Documentation**
|
|
207
|
+
|
|
208
|
+
**When**:
|
|
209
|
+
- Learning how something should work
|
|
210
|
+
- Checking if you're using API correctly
|
|
211
|
+
- Understanding configuration options
|
|
212
|
+
- Finding migration guides
|
|
213
|
+
|
|
214
|
+
**How**:
|
|
215
|
+
- Start with official docs, not blog posts
|
|
216
|
+
- Check version-specific docs
|
|
217
|
+
- Read examples and guides, not just API reference
|
|
218
|
+
- Look for "Common Pitfalls" or "Troubleshooting" sections
|
|
219
|
+
|
|
220
|
+
</research_how>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
<balance>
|
|
224
|
+
|
|
225
|
+
**The research trap**: Spending hours reading docs about topics tangential to your bug
|
|
226
|
+
- You think it's a caching issue, so you read all about cache invalidation
|
|
227
|
+
- But the actual bug is a typo in a variable name
|
|
228
|
+
|
|
229
|
+
**The reasoning trap**: Spending hours reading code when the answer is well-documented
|
|
230
|
+
- You're debugging why auth doesn't work
|
|
231
|
+
- The docs clearly explain the setup you missed
|
|
232
|
+
- You could have found it in 5 minutes of reading
|
|
233
|
+
|
|
234
|
+
**The balance**:
|
|
235
|
+
|
|
236
|
+
1. **Start with quick research** (5-10 minutes)
|
|
237
|
+
- Search the error message
|
|
238
|
+
- Check official docs for the feature you're using
|
|
239
|
+
- Skim recent issues
|
|
240
|
+
|
|
241
|
+
2. **If research doesn't yield answers, switch to reasoning**
|
|
242
|
+
- Add logging
|
|
243
|
+
- Trace execution
|
|
244
|
+
- Form hypotheses
|
|
245
|
+
|
|
246
|
+
3. **If reasoning reveals knowledge gaps, research those specific gaps**
|
|
247
|
+
- "I need to understand how WebSocket reconnection works"
|
|
248
|
+
- "I need to know if this library supports transactions"
|
|
249
|
+
|
|
250
|
+
4. **Alternate as needed**
|
|
251
|
+
- Research → reveals what to investigate
|
|
252
|
+
- Reasoning → reveals what to research
|
|
253
|
+
- Keep switching based on what you learn
|
|
254
|
+
|
|
255
|
+
<example>
|
|
256
|
+
**Bug**: Real-time updates stop working after 1 hour
|
|
257
|
+
|
|
258
|
+
**Start with research** (5 min):
|
|
259
|
+
- Search: "websocket connection drops after 1 hour"
|
|
260
|
+
- Find: Common issue with load balancers having connection timeouts
|
|
261
|
+
|
|
262
|
+
**Switch to reasoning**:
|
|
263
|
+
- Check if you're using a load balancer: YES
|
|
264
|
+
- Check load balancer timeout setting: 3600 seconds (1 hour)
|
|
265
|
+
- Hypothesis: Load balancer is killing the connection
|
|
266
|
+
|
|
267
|
+
**Quick research**:
|
|
268
|
+
- Search: "websocket load balancer timeout fix"
|
|
269
|
+
- Find: Implement heartbeat/ping to keep connection alive
|
|
270
|
+
|
|
271
|
+
**Reasoning**:
|
|
272
|
+
- Check if library supports heartbeat: YES
|
|
273
|
+
- Implement ping every 30 seconds
|
|
274
|
+
- Test: Connection stays alive for 3+ hours
|
|
275
|
+
|
|
276
|
+
**Total time**: 20 minutes (research: 10 min, reasoning: 10 min)
|
|
277
|
+
**Success**: Found and fixed the issue
|
|
278
|
+
|
|
279
|
+
vs
|
|
280
|
+
|
|
281
|
+
**Wrong approach**: Spend 2 hours reading WebSocket spec
|
|
282
|
+
- Learned a lot about WebSocket protocol
|
|
283
|
+
- Didn't solve the problem (it was a config issue)
|
|
284
|
+
</example>
|
|
285
|
+
|
|
286
|
+
</balance>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
<decision_tree>
|
|
290
|
+
```
|
|
291
|
+
Is this a error message I don't recognize?
|
|
292
|
+
├─ YES → Web search the error message
|
|
293
|
+
└─ NO ↓
|
|
294
|
+
|
|
295
|
+
Is this library/framework behavior I don't understand?
|
|
296
|
+
├─ YES → Check docs (Context7 or official docs)
|
|
297
|
+
└─ NO ↓
|
|
298
|
+
|
|
299
|
+
Is this code I/my team wrote?
|
|
300
|
+
├─ YES → Reason through it (logging, tracing, hypothesis testing)
|
|
301
|
+
└─ NO ↓
|
|
302
|
+
|
|
303
|
+
Is this a platform/environment difference?
|
|
304
|
+
├─ YES → Research platform-specific behavior
|
|
305
|
+
└─ NO ↓
|
|
306
|
+
|
|
307
|
+
Can I observe the behavior directly?
|
|
308
|
+
├─ YES → Add observability and reason through it
|
|
309
|
+
└─ NO → Research the domain/concept first, then reason
|
|
310
|
+
```
|
|
311
|
+
</decision_tree>
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
<red_flags>
|
|
315
|
+
|
|
316
|
+
**You're researching too much if**:
|
|
317
|
+
- You've read 20 blog posts but haven't looked at your code
|
|
318
|
+
- You understand the theory but haven't traced your actual execution
|
|
319
|
+
- You're learning about edge cases that don't apply to your situation
|
|
320
|
+
- You've been reading for 30+ minutes without testing anything
|
|
321
|
+
|
|
322
|
+
**You're reasoning too much if**:
|
|
323
|
+
- You've been staring at code for an hour without progress
|
|
324
|
+
- You keep finding things you don't understand and guessing
|
|
325
|
+
- You're debugging library internals (that's research territory)
|
|
326
|
+
- The error message is clearly from a library you don't know
|
|
327
|
+
|
|
328
|
+
**You're doing it right if**:
|
|
329
|
+
- You alternate between research and reasoning
|
|
330
|
+
- Each research session answers a specific question
|
|
331
|
+
- Each reasoning session tests a specific hypothesis
|
|
332
|
+
- You're making steady progress toward understanding
|
|
333
|
+
|
|
334
|
+
</red_flags>
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<mindset>
|
|
338
|
+
|
|
339
|
+
**Good researchers ask**:
|
|
340
|
+
- "What specific question do I need answered?"
|
|
341
|
+
- "Where is the authoritative source for this?"
|
|
342
|
+
- "Is this a known issue or unique to my code?"
|
|
343
|
+
- "What version-specific information do I need?"
|
|
344
|
+
|
|
345
|
+
**Good reasoners ask**:
|
|
346
|
+
- "What is actually happening in my code?"
|
|
347
|
+
- "What am I assuming that might be wrong?"
|
|
348
|
+
- "How can I observe this behavior directly?"
|
|
349
|
+
- "What experiment would test my hypothesis?"
|
|
350
|
+
|
|
351
|
+
**Great debuggers do both**:
|
|
352
|
+
- Research to fill knowledge gaps
|
|
353
|
+
- Reason to understand actual behavior
|
|
354
|
+
- Switch fluidly based on what they learn
|
|
355
|
+
- Never stuck in one mode
|
|
356
|
+
|
|
357
|
+
**The goal**: Minimum time to maximum understanding.
|
|
358
|
+
- Research what you don't know
|
|
359
|
+
- Reason through what you can observe
|
|
360
|
+
- Fix what you understand
|
|
361
|
+
</mindset>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
|
|
4
|
+
license: Complete terms in LICENSE.txt
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
|
|
8
|
+
|
|
9
|
+
The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
|
|
10
|
+
|
|
11
|
+
## Design Thinking
|
|
12
|
+
|
|
13
|
+
Before coding, understand the context and commit to a BOLD aesthetic direction:
|
|
14
|
+
|
|
15
|
+
- **Purpose**: What problem does this interface solve? Who uses it?
|
|
16
|
+
- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
|
|
17
|
+
- **Constraints**: Technical requirements (framework, performance, accessibility).
|
|
18
|
+
- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
|
|
19
|
+
|
|
20
|
+
**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
|
|
21
|
+
|
|
22
|
+
Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
|
|
23
|
+
|
|
24
|
+
- Production-grade and functional
|
|
25
|
+
- Visually striking and memorable
|
|
26
|
+
- Cohesive with a clear aesthetic point-of-view
|
|
27
|
+
- Meticulously refined in every detail
|
|
28
|
+
|
|
29
|
+
## Frontend Aesthetics Guidelines
|
|
30
|
+
|
|
31
|
+
Focus on:
|
|
32
|
+
|
|
33
|
+
- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
|
|
34
|
+
- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
|
|
35
|
+
- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
|
|
36
|
+
- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
|
|
37
|
+
- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
|
|
38
|
+
|
|
39
|
+
NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.
|
|
40
|
+
|
|
41
|
+
Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
|
|
42
|
+
|
|
43
|
+
**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
|
|
44
|
+
|
|
45
|
+
Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swiftui
|
|
3
|
+
description: SwiftUI apps from scratch through App Store. Full lifecycle - create, debug, test, optimize, ship.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<essential_principles>
|
|
7
|
+
## How We Work
|
|
8
|
+
|
|
9
|
+
**The user is the product owner. Claude is the developer.**
|
|
10
|
+
|
|
11
|
+
The user does not write code. The user does not read code. The user describes what they want and judges whether the result is acceptable. Claude implements, verifies, and reports outcomes.
|
|
12
|
+
|
|
13
|
+
### 1. Prove, Don't Promise
|
|
14
|
+
|
|
15
|
+
Never say "this should work." Prove it:
|
|
16
|
+
```bash
|
|
17
|
+
xcodebuild build 2>&1 | xcsift # Build passes
|
|
18
|
+
xcodebuild test # Tests pass
|
|
19
|
+
open .../App.app # App launches
|
|
20
|
+
```
|
|
21
|
+
If you didn't run it, you don't know it works.
|
|
22
|
+
|
|
23
|
+
### 2. Tests for Correctness, Eyes for Quality
|
|
24
|
+
|
|
25
|
+
| Question | How to Answer |
|
|
26
|
+
|----------|---------------|
|
|
27
|
+
| Does the logic work? | Write test, see it pass |
|
|
28
|
+
| Does it look right? | Launch app, user looks at it |
|
|
29
|
+
| Does it feel right? | User uses it |
|
|
30
|
+
| Does it crash? | Test + launch |
|
|
31
|
+
| Is it fast enough? | Profiler |
|
|
32
|
+
|
|
33
|
+
Tests verify *correctness*. The user verifies *desirability*.
|
|
34
|
+
|
|
35
|
+
### 3. Report Outcomes, Not Code
|
|
36
|
+
|
|
37
|
+
**Bad:** "I refactored the view model to use @Observable with environment injection"
|
|
38
|
+
**Good:** "Fixed the state bug. App now updates correctly when you add items. Ready for you to verify."
|
|
39
|
+
|
|
40
|
+
The user doesn't care what you changed. The user cares what's different.
|
|
41
|
+
|
|
42
|
+
### 4. Small Steps, Always Verified
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Change → Verify → Report → Next change
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Never batch up work. Never say "I made several changes." Each change is verified before the next. If something breaks, you know exactly what caused it.
|
|
49
|
+
|
|
50
|
+
### 5. Ask Before, Not After
|
|
51
|
+
|
|
52
|
+
Unclear requirement? Ask now.
|
|
53
|
+
Multiple valid approaches? Ask which.
|
|
54
|
+
Scope creep? Ask if wanted.
|
|
55
|
+
Big refactor needed? Ask permission.
|
|
56
|
+
|
|
57
|
+
Wrong: Build for 30 minutes, then "is this what you wanted?"
|
|
58
|
+
Right: "Before I start, does X mean Y or Z?"
|
|
59
|
+
|
|
60
|
+
### 6. Always Leave It Working
|
|
61
|
+
|
|
62
|
+
Every stopping point = working state. Tests pass, app launches, changes committed. The user can walk away anytime and come back to something that works.
|
|
63
|
+
</essential_principles>
|
|
64
|
+
|
|
65
|
+
<swiftui_principles>
|
|
66
|
+
## SwiftUI Framework Principles
|
|
67
|
+
|
|
68
|
+
### Declarative Mindset
|
|
69
|
+
Describe what the UI should look like for a given state, not how to mutate it. Let SwiftUI manage the rendering. Never force updates - change the state and let the framework react.
|
|
70
|
+
|
|
71
|
+
### Single Source of Truth
|
|
72
|
+
Every piece of data has one authoritative location. Use the right property wrapper: @State for view-local, @Observable for shared objects, @Environment for app-wide. Derived data should be computed, not stored.
|
|
73
|
+
|
|
74
|
+
### Composition Over Inheritance
|
|
75
|
+
Build complex UIs by composing small, focused views. Extract reusable components when patterns emerge. Prefer many small views over few large ones.
|
|
76
|
+
|
|
77
|
+
### Platform-Adaptive Design
|
|
78
|
+
Write once but respect platform idioms. Use native navigation patterns, respect safe areas, adapt to screen sizes. Test on all target platforms.
|
|
79
|
+
</swiftui_principles>
|
|
80
|
+
|
|
81
|
+
<intake>
|
|
82
|
+
**What would you like to do?**
|
|
83
|
+
|
|
84
|
+
1. Build a new SwiftUI app
|
|
85
|
+
2. Debug an existing SwiftUI app
|
|
86
|
+
3. Add a feature to an existing app
|
|
87
|
+
4. Write/run tests
|
|
88
|
+
5. Optimize performance
|
|
89
|
+
6. Ship/release to App Store
|
|
90
|
+
7. Something else
|
|
91
|
+
|
|
92
|
+
**Then read the matching workflow from `workflows/` and follow it.**
|
|
93
|
+
</intake>
|
|
94
|
+
|
|
95
|
+
<routing>
|
|
96
|
+
| Response | Workflow |
|
|
97
|
+
|----------|----------|
|
|
98
|
+
| 1, "new", "create", "build", "start" | `workflows/build-new-app.md` |
|
|
99
|
+
| 2, "broken", "fix", "debug", "crash", "bug" | `workflows/debug-swiftui.md` |
|
|
100
|
+
| 3, "add", "feature", "implement", "change" | `workflows/add-feature.md` |
|
|
101
|
+
| 4, "test", "tests", "TDD", "coverage" | `workflows/write-tests.md` |
|
|
102
|
+
| 5, "slow", "optimize", "performance", "fast" | `workflows/optimize-performance.md` |
|
|
103
|
+
| 6, "ship", "release", "deploy", "publish", "app store" | `workflows/ship-app.md` |
|
|
104
|
+
| 7, other | Clarify, then select workflow or references |
|
|
105
|
+
</routing>
|
|
106
|
+
|
|
107
|
+
<verification_loop>
|
|
108
|
+
## After Every Change
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 1. Does it build?
|
|
112
|
+
xcodebuild -scheme AppName build 2>&1 | xcsift
|
|
113
|
+
|
|
114
|
+
# 2. Do tests pass? (use Core scheme for SwiftUI apps to avoid @main hang)
|
|
115
|
+
xcodebuild -scheme AppNameCore test
|
|
116
|
+
|
|
117
|
+
# 3. Does it launch?
|
|
118
|
+
# macOS:
|
|
119
|
+
open ./build/Build/Products/Debug/AppName.app
|
|
120
|
+
|
|
121
|
+
# iOS Simulator:
|
|
122
|
+
xcrun simctl boot "iPhone 15 Pro" 2>/dev/null || true
|
|
123
|
+
xcrun simctl install booted ./build/Build/Products/Debug-iphonesimulator/AppName.app
|
|
124
|
+
xcrun simctl launch booted com.yourcompany.appname
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Note: If tests hang, the test target likely depends on the app target which has `@main`. Extract testable code to a framework target. See `../macos-apps/references/testing-tdd.md` for the pattern.
|
|
128
|
+
|
|
129
|
+
Report to the user:
|
|
130
|
+
- "Build: ✓"
|
|
131
|
+
- "Tests: 12 pass, 0 fail"
|
|
132
|
+
- "App launches, ready for you to check [specific thing]"
|
|
133
|
+
</verification_loop>
|
|
134
|
+
|
|
135
|
+
<cli_infrastructure>
|
|
136
|
+
## CLI Workflow References
|
|
137
|
+
|
|
138
|
+
For building, debugging, testing, and shipping from CLI without opening Xcode, read these from `../macos-apps/references/`:
|
|
139
|
+
|
|
140
|
+
| Reference | Use For |
|
|
141
|
+
|-----------|---------|
|
|
142
|
+
| `cli-workflow.md` | Build, run, test commands; xcodebuild usage; code signing |
|
|
143
|
+
| `cli-observability.md` | Log streaming, crash analysis, memory debugging, LLDB |
|
|
144
|
+
| `project-scaffolding.md` | XcodeGen project.yml templates, file structure, entitlements |
|
|
145
|
+
| `testing-tdd.md` | Test patterns that work from CLI, avoiding @main hangs |
|
|
146
|
+
|
|
147
|
+
These docs are platform-agnostic. For iOS, change destinations:
|
|
148
|
+
```bash
|
|
149
|
+
# iOS Simulator
|
|
150
|
+
xcodebuild -scheme AppName -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
|
|
151
|
+
|
|
152
|
+
# macOS
|
|
153
|
+
xcodebuild -scheme AppName build
|
|
154
|
+
```
|
|
155
|
+
</cli_infrastructure>
|
|
156
|
+
|
|
157
|
+
<reference_index>
|
|
158
|
+
## Domain Knowledge
|
|
159
|
+
|
|
160
|
+
All in `references/`:
|
|
161
|
+
|
|
162
|
+
**Core:**
|
|
163
|
+
- architecture.md - MVVM patterns, project structure, dependency injection
|
|
164
|
+
- state-management.md - Property wrappers, @Observable, data flow
|
|
165
|
+
- layout-system.md - Stacks, grids, GeometryReader, custom layouts
|
|
166
|
+
|
|
167
|
+
**Navigation & Animation:**
|
|
168
|
+
- navigation.md - NavigationStack, sheets, tabs, deep linking
|
|
169
|
+
- animations.md - Built-in animations, transitions, matchedGeometryEffect
|
|
170
|
+
|
|
171
|
+
**Data & Platform:**
|
|
172
|
+
- swiftdata.md - Persistence, @Model, @Query, CloudKit sync
|
|
173
|
+
- platform-integration.md - iOS/macOS/watchOS/visionOS specifics
|
|
174
|
+
- uikit-appkit-interop.md - UIViewRepresentable, hosting controllers
|
|
175
|
+
|
|
176
|
+
**Support:**
|
|
177
|
+
- networking-async.md - async/await, .task modifier, API clients
|
|
178
|
+
- testing-debugging.md - Previews, unit tests, UI tests, debugging
|
|
179
|
+
- performance.md - Profiling, lazy loading, view identity
|
|
180
|
+
</reference_index>
|
|
181
|
+
|
|
182
|
+
<workflows_index>
|
|
183
|
+
## Workflows
|
|
184
|
+
|
|
185
|
+
All in `workflows/`:
|
|
186
|
+
|
|
187
|
+
| Workflow | Purpose |
|
|
188
|
+
|----------|---------|
|
|
189
|
+
| build-new-app.md | Create new SwiftUI app from scratch |
|
|
190
|
+
| debug-swiftui.md | Find and fix SwiftUI bugs |
|
|
191
|
+
| add-feature.md | Add functionality to existing app |
|
|
192
|
+
| write-tests.md | Write UI and unit tests |
|
|
193
|
+
| optimize-performance.md | Profile and improve performance |
|
|
194
|
+
| ship-app.md | App Store submission, TestFlight, distribution |
|
|
195
|
+
</workflows_index>
|
|
196
|
+
|
|
197
|
+
<canonical_terminology>
|
|
198
|
+
## Terminology
|
|
199
|
+
|
|
200
|
+
Use these terms consistently:
|
|
201
|
+
- **view** (not: widget, component, element)
|
|
202
|
+
- **@Observable** (not: ObservableObject, @Published for new iOS 17+ code)
|
|
203
|
+
- **NavigationStack** (not: NavigationView - deprecated)
|
|
204
|
+
- **SwiftData** (not: Core Data for new projects)
|
|
205
|
+
- **@Environment** (not: @EnvironmentObject for new code)
|
|
206
|
+
- **modifier** (not: method/function when describing view modifiers)
|
|
207
|
+
- **body** (not: render/build when describing view body)
|
|
208
|
+
</canonical_terminology>
|