ai-workflow-init 6.6.0 → 6.6.1
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/.claude/CLAUDE.md +7 -0
- package/.claude/commands/audit-workflow.md +209 -0
- package/.claude/commands/cleanup.md +184 -0
- package/.claude/output-styles/qna-consultant.md +237 -0
- package/.claude/skills/frontend-design-fundamentals/SKILL.md +11 -10
- package/.claude/skills/react-best-practices/SKILL.md +47 -437
- package/.claude/skills/react-best-practices/references/code-patterns.md +409 -0
- package/.claude/skills/skill-creator/SKILL.md +77 -290
- package/.claude/skills/skill-creator/references/creation-process.md +154 -0
- package/.claude/themes/README.md +37 -0
- package/.claude/themes/bold-vibrant.theme.json +81 -0
- package/.claude/themes/minimal-monochrome.theme.json +34 -94
- package/.claude/themes/professional-blue.theme.json +31 -89
- package/.claude/themes/warm-organic.theme.json +67 -0
- package/AGENTS.md +7 -0
- package/package.json +1 -1
package/.claude/CLAUDE.md
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
- Avoid over-engineering and unnecessary abstractions
|
|
9
9
|
- Don't build for hypothetical futures
|
|
10
10
|
|
|
11
|
+
- **Readability > Cleverness**
|
|
12
|
+
- Prefer clear, readable code over clever one-liners
|
|
13
|
+
- Code is read more often than written - optimize for understanding
|
|
14
|
+
- If code needs a comment to explain what it does, consider rewriting it
|
|
15
|
+
|
|
11
16
|
- **Think ahead ONLY for:**
|
|
12
17
|
- **Security**: Input validation, authentication, authorization
|
|
13
18
|
- **Performance**: Scalability bottlenecks, query optimization
|
|
@@ -18,9 +23,11 @@
|
|
|
18
23
|
- ✅ Add input validation for user data (security)
|
|
19
24
|
- ✅ Consider pagination for large datasets (performance)
|
|
20
25
|
- ❌ Don't create abstractions for one-time operations
|
|
26
|
+
- ❌ Don't write clever one-liners that require mental parsing
|
|
21
27
|
|
|
22
28
|
### 2. Deep Understanding
|
|
23
29
|
- If unclear about requirements, edge cases, or expected behavior → **Ask first**
|
|
30
|
+
- Use `AskUserQuestion` tool to ask multiple questions at once (up to 4)
|
|
24
31
|
- Never assume or guess - clarification prevents wasted effort
|
|
25
32
|
- Key questions:
|
|
26
33
|
- "What should happen when X occurs?"
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-workflow
|
|
3
|
+
description: Audit Claude Code workflow configuration (agents, skills, commands, hooks, output-styles) and provide improvement recommendations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Audit
|
|
7
|
+
|
|
8
|
+
Analyze the Claude Code workflow configuration in this project and provide actionable recommendations.
|
|
9
|
+
|
|
10
|
+
## Audit Process
|
|
11
|
+
|
|
12
|
+
### Step 1: Gather Workflow Files
|
|
13
|
+
|
|
14
|
+
Collect all workflow configuration files:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Read and analyze:
|
|
18
|
+
- .claude/CLAUDE.md (main instructions)
|
|
19
|
+
- .claude/settings.json (hooks configuration)
|
|
20
|
+
- .claude/settings.local.json (local hooks)
|
|
21
|
+
- .claude/agents/*.md (all agent definitions)
|
|
22
|
+
- .claude/skills/*/SKILL.md (all skill definitions)
|
|
23
|
+
- .claude/commands/*.md (all command definitions)
|
|
24
|
+
- .claude/output-styles/*.md (all output styles)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use Glob to find all files, then Read each one.
|
|
28
|
+
|
|
29
|
+
### Step 2: Analyze Each Category
|
|
30
|
+
|
|
31
|
+
For each category, evaluate:
|
|
32
|
+
|
|
33
|
+
#### 2.1 Skills Analysis
|
|
34
|
+
|
|
35
|
+
| Criteria | Check |
|
|
36
|
+
|----------|-------|
|
|
37
|
+
| **Trigger clarity** | Is `description` specific about when to load? |
|
|
38
|
+
| **Overlap detection** | Do multiple skills cover same triggers? |
|
|
39
|
+
| **Size efficiency** | Is SKILL.md < 500 lines? Uses references for large content? |
|
|
40
|
+
| **Progressive disclosure** | Does it use references/ for optional content? |
|
|
41
|
+
| **Auto-load frequency** | Does "ALWAYS load when..." appear too often? |
|
|
42
|
+
|
|
43
|
+
**Overlap detection keywords to check:**
|
|
44
|
+
- UI/frontend: `frontend-design-*`, `ux-*`
|
|
45
|
+
- Code quality: `quality-*`, `*-review`
|
|
46
|
+
- Testing: `*-test`, `writing-test`
|
|
47
|
+
|
|
48
|
+
#### 2.2 Commands Analysis
|
|
49
|
+
|
|
50
|
+
| Criteria | Check |
|
|
51
|
+
|----------|-------|
|
|
52
|
+
| **Purpose clarity** | Is the command's purpose clear from name + description? |
|
|
53
|
+
| **Workflow alignment** | Does it follow CLAUDE.md guidelines? |
|
|
54
|
+
| **Agent delegation** | Does it use Task tool for complex sub-tasks? |
|
|
55
|
+
| **Duplication** | Are there commands that do similar things? |
|
|
56
|
+
|
|
57
|
+
#### 2.3 Agents Analysis
|
|
58
|
+
|
|
59
|
+
| Criteria | Check |
|
|
60
|
+
|----------|-------|
|
|
61
|
+
| **Role clarity** | Is the agent's specialized role well-defined? |
|
|
62
|
+
| **Tool access** | Does it have appropriate tool restrictions? |
|
|
63
|
+
| **Prompt quality** | Is the prompt concise but complete? |
|
|
64
|
+
|
|
65
|
+
#### 2.4 Hooks Analysis
|
|
66
|
+
|
|
67
|
+
| Criteria | Check |
|
|
68
|
+
|----------|-------|
|
|
69
|
+
| **Necessity** | Is each hook actually needed? |
|
|
70
|
+
| **Performance** | Are hooks lightweight (< 1 second execution)? |
|
|
71
|
+
| **Error handling** | Do hooks exit gracefully on failure? |
|
|
72
|
+
| **Matcher specificity** | Are matchers precise enough? |
|
|
73
|
+
|
|
74
|
+
#### 2.5 Output Styles Analysis
|
|
75
|
+
|
|
76
|
+
| Criteria | Check |
|
|
77
|
+
|----------|-------|
|
|
78
|
+
| **Use case clarity** | When should this style be applied? |
|
|
79
|
+
| **Conflict potential** | Does it conflict with other styles? |
|
|
80
|
+
|
|
81
|
+
#### 2.6 CLAUDE.md Analysis
|
|
82
|
+
|
|
83
|
+
| Criteria | Check |
|
|
84
|
+
|----------|-------|
|
|
85
|
+
| **Conciseness** | Is it under 500 lines? No redundant info? |
|
|
86
|
+
| **Actionability** | Are instructions clear and actionable? |
|
|
87
|
+
| **Conflicts** | Does it conflict with skill instructions? |
|
|
88
|
+
|
|
89
|
+
### Step 3: Context Usage Estimation
|
|
90
|
+
|
|
91
|
+
Estimate token usage for each component:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Token estimation formula:
|
|
95
|
+
- ~4 characters = 1 token (rough estimate)
|
|
96
|
+
- Metadata always loaded: name + description (~100-200 tokens each)
|
|
97
|
+
- Body loaded on trigger: full content
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Calculate:
|
|
101
|
+
1. **Always-loaded tokens**: Sum of all metadata
|
|
102
|
+
2. **Frequently-loaded tokens**: Skills with "ALWAYS load" triggers
|
|
103
|
+
3. **On-demand tokens**: Skills with specific triggers
|
|
104
|
+
|
|
105
|
+
### Step 4: Generate Report
|
|
106
|
+
|
|
107
|
+
Output format:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
# Workflow Audit Report
|
|
111
|
+
|
|
112
|
+
## Summary
|
|
113
|
+
|
|
114
|
+
| Category | Count | Issues | Recommendations |
|
|
115
|
+
|----------|-------|--------|-----------------|
|
|
116
|
+
| Skills | X | Y | Z |
|
|
117
|
+
| Commands | X | Y | Z |
|
|
118
|
+
| Agents | X | Y | Z |
|
|
119
|
+
| Hooks | X | Y | Z |
|
|
120
|
+
| Output Styles | X | Y | Z |
|
|
121
|
+
|
|
122
|
+
## Context Budget Analysis
|
|
123
|
+
|
|
124
|
+
### Always-Loaded (~X tokens)
|
|
125
|
+
- CLAUDE.md: ~X tokens
|
|
126
|
+
- Skill metadata: ~X tokens (Y skills × ~100 tokens)
|
|
127
|
+
- Total baseline: ~X tokens
|
|
128
|
+
|
|
129
|
+
### Frequently-Loaded (~X tokens per session)
|
|
130
|
+
- skill-name-1 (ALWAYS load for frontend): ~X tokens
|
|
131
|
+
- skill-name-2 (ALWAYS load for React): ~X tokens
|
|
132
|
+
|
|
133
|
+
### On-Demand
|
|
134
|
+
- skill-name-3: ~X tokens (loads for specific trigger)
|
|
135
|
+
|
|
136
|
+
## Detailed Findings
|
|
137
|
+
|
|
138
|
+
### 🔴 Critical Issues
|
|
139
|
+
Issues that significantly impact performance or cause errors.
|
|
140
|
+
|
|
141
|
+
### 🟡 Improvements
|
|
142
|
+
Optimizations that would improve efficiency.
|
|
143
|
+
|
|
144
|
+
### 🟢 Best Practices Followed
|
|
145
|
+
Positive patterns worth maintaining.
|
|
146
|
+
|
|
147
|
+
## Recommendations
|
|
148
|
+
|
|
149
|
+
### High Priority
|
|
150
|
+
1. [Specific actionable recommendation]
|
|
151
|
+
- **Impact**: [What improves]
|
|
152
|
+
- **Effort**: [Low/Medium/High]
|
|
153
|
+
|
|
154
|
+
### Medium Priority
|
|
155
|
+
...
|
|
156
|
+
|
|
157
|
+
### Low Priority (Nice to Have)
|
|
158
|
+
...
|
|
159
|
+
|
|
160
|
+
## Overlap Analysis
|
|
161
|
+
|
|
162
|
+
### Potential Skill Overlaps
|
|
163
|
+
| Skills | Overlap Area | Recommendation |
|
|
164
|
+
|--------|--------------|----------------|
|
|
165
|
+
| A, B | frontend triggers | Consider merging or clarifying triggers |
|
|
166
|
+
|
|
167
|
+
### Command Redundancies
|
|
168
|
+
...
|
|
169
|
+
|
|
170
|
+
## Suggested Consolidations
|
|
171
|
+
|
|
172
|
+
If skills/commands can be merged:
|
|
173
|
+
- Merge `skill-a` + `skill-b` → `combined-skill` (saves ~X tokens)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Analysis Guidelines
|
|
177
|
+
|
|
178
|
+
### What Makes a Good Workflow
|
|
179
|
+
|
|
180
|
+
1. **Minimal always-loaded content**: Only essential instructions in CLAUDE.md
|
|
181
|
+
2. **Specific triggers**: Skills load only when truly needed
|
|
182
|
+
3. **No overlaps**: Each skill/command has unique purpose
|
|
183
|
+
4. **Progressive disclosure**: Large content split into references
|
|
184
|
+
5. **Lightweight hooks**: Fast execution, graceful failures
|
|
185
|
+
|
|
186
|
+
### Red Flags to Watch For
|
|
187
|
+
|
|
188
|
+
- Skills with "ALWAYS load" for broad triggers (e.g., "any code")
|
|
189
|
+
- Multiple skills triggering on same keywords
|
|
190
|
+
- Commands that duplicate skill functionality
|
|
191
|
+
- Hooks that run on every tool use
|
|
192
|
+
- CLAUDE.md > 300 lines
|
|
193
|
+
- Skills > 500 lines without using references/
|
|
194
|
+
|
|
195
|
+
### Token Budget Guidelines
|
|
196
|
+
|
|
197
|
+
| Budget Level | Always-Loaded | Recommendation |
|
|
198
|
+
|--------------|---------------|----------------|
|
|
199
|
+
| Lean | < 2000 tokens | Excellent |
|
|
200
|
+
| Normal | 2000-5000 | Good |
|
|
201
|
+
| Heavy | 5000-10000 | Consider optimization |
|
|
202
|
+
| Bloated | > 10000 | Needs consolidation |
|
|
203
|
+
|
|
204
|
+
## Execution
|
|
205
|
+
|
|
206
|
+
1. Run full analysis
|
|
207
|
+
2. Generate report with findings
|
|
208
|
+
3. Prioritize recommendations by impact/effort ratio
|
|
209
|
+
4. Offer to implement quick wins if user approves
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cleanup
|
|
3
|
+
description: Cleans up workflow markdown files older than the configured retention period.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Configuration
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
RETENTION_DAYS = 7
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> **To change retention period**: Update the `RETENTION_DAYS` value above.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Goal
|
|
17
|
+
|
|
18
|
+
Clean up workflow markdown files older than `RETENTION_DAYS` in `docs/ai/` directories.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Step 1: Select Cleanup Scope
|
|
23
|
+
|
|
24
|
+
**Tool:** AskUserQuestion
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Question: Which scope do you want to clean up?
|
|
28
|
+
Options:
|
|
29
|
+
1. Main files only - Delete main files (exclude archive/ folders)
|
|
30
|
+
2. Archive only - Delete only files in archive/ folders
|
|
31
|
+
3. All files - Delete both main files and archive/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Set internal flag:** `CLEANUP_SCOPE = main_only | archive_only | all`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 2: Scan Files
|
|
39
|
+
|
|
40
|
+
**Directories to scan:**
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
docs/ai/planning/ # epic-*.md, feature-*.md
|
|
44
|
+
docs/ai/planning/archive/ # backup files
|
|
45
|
+
docs/ai/testing/ # unit-*.md, integration-*.md
|
|
46
|
+
docs/ai/requirements/ # req-*.md
|
|
47
|
+
docs/ai/requirements/agents/ # ba-*.md, sa-*.md, research-*.md, uiux-*.md
|
|
48
|
+
docs/ai/requirements/archive/ # backup files
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Based on CLEANUP_SCOPE:**
|
|
52
|
+
- `main_only`: Scan all except `archive/` folders
|
|
53
|
+
- `archive_only`: Scan only `archive/` folders
|
|
54
|
+
- `all`: Scan everything
|
|
55
|
+
|
|
56
|
+
**Command to find old files (older than RETENTION_DAYS):**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
find docs/ai/planning docs/ai/testing docs/ai/requirements -name "*.md" -type f -mtime +{RETENTION_DAYS} 2>/dev/null
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**For archive only:**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
find docs/ai/planning/archive docs/ai/requirements/archive -name "*.md" -type f -mtime +{RETENTION_DAYS} 2>/dev/null
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**For main only (exclude archive):**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
find docs/ai/planning docs/ai/testing docs/ai/requirements -name "*.md" -type f -mtime +{RETENTION_DAYS} -not -path "*/archive/*" 2>/dev/null
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 3: Build File List
|
|
77
|
+
|
|
78
|
+
**For each file found:**
|
|
79
|
+
1. Get file path
|
|
80
|
+
2. Get last modified date
|
|
81
|
+
3. Calculate age in days
|
|
82
|
+
|
|
83
|
+
**Format output:**
|
|
84
|
+
|
|
85
|
+
```markdown
|
|
86
|
+
## Files older than {RETENTION_DAYS} days
|
|
87
|
+
|
|
88
|
+
| File | Last Modified | Age |
|
|
89
|
+
|------|---------------|-----|
|
|
90
|
+
| docs/ai/planning/feature-login.md | 2025-01-10 | 15 days |
|
|
91
|
+
| docs/ai/planning/archive/feature-auth_20250105.md | 2025-01-05 | 20 days |
|
|
92
|
+
| docs/ai/testing/unit-auth.md | 2025-01-12 | 13 days |
|
|
93
|
+
|
|
94
|
+
**Total: X files**
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**If no files found:**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
✓ No files older than {RETENTION_DAYS} days found in the selected scope.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then exit.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Step 4: Confirm Deletion
|
|
108
|
+
|
|
109
|
+
**Tool:** AskUserQuestion
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Question: Confirm deletion of {X} files listed above?
|
|
113
|
+
Options:
|
|
114
|
+
1. Yes, delete all - Delete all listed files
|
|
115
|
+
2. No, cancel - Cancel, do not delete anything
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**If user chooses "No, cancel":**
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
✓ Cancelled. No files were deleted.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then exit.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 5: Execute Deletion
|
|
129
|
+
|
|
130
|
+
**For each file in the list:**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
rm "{file_path}"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Track results:**
|
|
137
|
+
- Files deleted successfully
|
|
138
|
+
- Files failed to delete (if any)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Step 6: Report Results
|
|
143
|
+
|
|
144
|
+
```markdown
|
|
145
|
+
## Cleanup Complete
|
|
146
|
+
|
|
147
|
+
✓ Deleted: {success_count} files
|
|
148
|
+
✗ Failed: {failed_count} files
|
|
149
|
+
|
|
150
|
+
### Deleted Files
|
|
151
|
+
- docs/ai/planning/feature-login.md
|
|
152
|
+
- docs/ai/planning/archive/feature-auth_20250105.md
|
|
153
|
+
- docs/ai/testing/unit-auth.md
|
|
154
|
+
|
|
155
|
+
{If any failed:}
|
|
156
|
+
### Failed to Delete
|
|
157
|
+
- {file_path}: {error message}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Notes
|
|
163
|
+
|
|
164
|
+
- **Retention period**: Configured via `RETENTION_DAYS` variable (default: 7)
|
|
165
|
+
- **Safe by default**: Always requires confirmation before deletion
|
|
166
|
+
- **No orphan detection**: Only checks file age, not relationships
|
|
167
|
+
- **Templates excluded**: Does not delete `*-template.md` files
|
|
168
|
+
|
|
169
|
+
### File Patterns Affected
|
|
170
|
+
|
|
171
|
+
| Directory | Patterns |
|
|
172
|
+
|-----------|----------|
|
|
173
|
+
| `docs/ai/planning/` | `epic-*.md`, `feature-*.md` |
|
|
174
|
+
| `docs/ai/planning/archive/` | `epic-*_*.md`, `feature-*_*.md` |
|
|
175
|
+
| `docs/ai/testing/` | `unit-*.md`, `integration-*.md` |
|
|
176
|
+
| `docs/ai/requirements/` | `req-*.md` |
|
|
177
|
+
| `docs/ai/requirements/agents/` | `ba-*.md`, `sa-*.md`, `research-*.md`, `uiux-*.md` |
|
|
178
|
+
| `docs/ai/requirements/archive/` | `req-*_*.md` |
|
|
179
|
+
|
|
180
|
+
### Excluded from Cleanup
|
|
181
|
+
|
|
182
|
+
- Template files: `*-template.md`
|
|
183
|
+
- Non-markdown files
|
|
184
|
+
- Files in other directories
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Q&A Consultant Output Style
|
|
2
|
+
|
|
3
|
+
Consultation and idea discussion mode. Claude Code is READ-ONLY - no workspace modifications.
|
|
4
|
+
|
|
5
|
+
## Core Behavior
|
|
6
|
+
|
|
7
|
+
**Read-Only Mode:**
|
|
8
|
+
- ✅ Read files, search code, explore codebase
|
|
9
|
+
- ✅ Explain, analyze, give opinions
|
|
10
|
+
- ❌ NO creating new files
|
|
11
|
+
- ❌ NO editing files
|
|
12
|
+
- ❌ NO running commands that modify workspace
|
|
13
|
+
|
|
14
|
+
If user requests modifications:
|
|
15
|
+
> "Currently in Q&A mode (read-only). Would you like to switch to normal mode to edit code?"
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## The 4 Rules Framework
|
|
20
|
+
|
|
21
|
+
### Rule 1: Stop & Ask (Solving "Lack of Context")
|
|
22
|
+
|
|
23
|
+
**Before answering, MUST identify missing context:**
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
🔍 Understanding the question:
|
|
27
|
+
- Core problem: [1 short sentence]
|
|
28
|
+
- Scope: [small/medium/large]
|
|
29
|
+
- Type: [concept/how-to/decision/debug/architecture]
|
|
30
|
+
|
|
31
|
+
❓ Missing context: [list what's unclear or needed]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**CRITICAL:**
|
|
35
|
+
- If missing context is critical → **ASK before answering**
|
|
36
|
+
- If missing context is minor → State assumption and proceed
|
|
37
|
+
- Never guess on: requirements, constraints, or user's actual goal
|
|
38
|
+
|
|
39
|
+
**Stop & Ask triggers:**
|
|
40
|
+
- Ambiguous terms ("make it better", "optimize this")
|
|
41
|
+
- Missing constraints (scale, timeline, team size)
|
|
42
|
+
- Unclear scope (one file vs entire system)
|
|
43
|
+
- Multiple valid interpretations
|
|
44
|
+
|
|
45
|
+
**Example:**
|
|
46
|
+
```
|
|
47
|
+
❓ Missing context:
|
|
48
|
+
- What's the expected traffic? (affects caching strategy)
|
|
49
|
+
- Is this for a new project or existing codebase?
|
|
50
|
+
|
|
51
|
+
→ Before I answer, can you clarify these?
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Rule 2: Rate Your Confidence
|
|
57
|
+
|
|
58
|
+
**Every answer MUST include confidence rating:**
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
🎯 Confidence: [HIGH/MEDIUM/LOW]
|
|
62
|
+
- HIGH (90%+): Well-understood problem, proven solution
|
|
63
|
+
- MEDIUM (60-89%): Good understanding, some assumptions
|
|
64
|
+
- LOW (<60%): Limited context, speculative answer
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**What affects confidence:**
|
|
68
|
+
- ⬆️ Higher: Saw the actual code, clear requirements, standard problem
|
|
69
|
+
- ⬇️ Lower: Assumptions made, edge cases unknown, novel situation
|
|
70
|
+
|
|
71
|
+
**When LOW confidence:**
|
|
72
|
+
1. State what would increase confidence
|
|
73
|
+
2. Offer to investigate further (read more code, ask questions)
|
|
74
|
+
3. Mark speculative parts clearly
|
|
75
|
+
|
|
76
|
+
**Example:**
|
|
77
|
+
```
|
|
78
|
+
🎯 Confidence: MEDIUM (70%)
|
|
79
|
+
- Based on: Standard React patterns
|
|
80
|
+
- Assumption: You're using React 18+
|
|
81
|
+
- Would increase to HIGH if: I could see your component structure
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### Rule 3: Ockham's Razor (Solving "Over-engineering")
|
|
87
|
+
|
|
88
|
+
**The simplest solution that works is the best solution.**
|
|
89
|
+
|
|
90
|
+
**Before every answer, run this check:**
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
⚖️ Simplicity Check:
|
|
94
|
+
- Is this complexity necessary? [yes/no]
|
|
95
|
+
- Simplest solution: [describe]
|
|
96
|
+
- Am I solving a real problem or imaginary one?
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Ockham's Razor rules:**
|
|
100
|
+
1. **Start minimal** - Add complexity only when proven needed
|
|
101
|
+
2. **Challenge assumptions** - "Do you actually need X?"
|
|
102
|
+
3. **Prefer boring tech** - Standard library > fancy framework
|
|
103
|
+
4. **One step at a time** - Don't suggest 10 steps when 3 work
|
|
104
|
+
|
|
105
|
+
**Red flags (over-engineering signals):**
|
|
106
|
+
- "Let me create an abstraction layer..."
|
|
107
|
+
- "We should consider 15 edge cases..."
|
|
108
|
+
- "This is a common enterprise pattern..."
|
|
109
|
+
- Suggesting major refactor for a small question
|
|
110
|
+
|
|
111
|
+
**Good patterns:**
|
|
112
|
+
- "The simplest approach is..."
|
|
113
|
+
- "You don't need to complicate this, just..."
|
|
114
|
+
- "For your use case, X is enough"
|
|
115
|
+
- "Over-engineering alert: You're solving a problem that doesn't exist yet"
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### Rule 4: Context-Aware Constraints
|
|
120
|
+
|
|
121
|
+
**Adapt answer based on user's actual context, not ideal scenarios.**
|
|
122
|
+
|
|
123
|
+
**Context factors to consider:**
|
|
124
|
+
|
|
125
|
+
| Factor | Questions to ask |
|
|
126
|
+
|--------|------------------|
|
|
127
|
+
| Scale | How many users? Requests/sec? |
|
|
128
|
+
| Team | Solo dev or team? Experience level? |
|
|
129
|
+
| Timeline | MVP or production-ready? |
|
|
130
|
+
| Existing code | Greenfield or legacy? |
|
|
131
|
+
| Constraints | Budget? Infra limitations? |
|
|
132
|
+
|
|
133
|
+
**Constraint-aware responses:**
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
📋 Applying to your context:
|
|
137
|
+
- Given [constraint], I recommend [simpler option]
|
|
138
|
+
- If [context changes], then consider [complex option]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Examples:**
|
|
142
|
+
|
|
143
|
+
| Context | DON'T suggest | DO suggest |
|
|
144
|
+
|---------|---------------|------------|
|
|
145
|
+
| Solo dev, MVP | Microservices, K8s | Monolith, simple deploy |
|
|
146
|
+
| 100 users | Redis cluster | In-memory cache |
|
|
147
|
+
| Legacy codebase | Full rewrite | Incremental improvement |
|
|
148
|
+
| Tight deadline | Perfect architecture | Good-enough solution |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Response Template
|
|
153
|
+
|
|
154
|
+
Every response should follow this structure:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
🔍 Understanding the question:
|
|
158
|
+
- Core problem: [...]
|
|
159
|
+
- Scope: [...]
|
|
160
|
+
- Type: [...]
|
|
161
|
+
❓ Missing context: [list or "None - clear question"]
|
|
162
|
+
|
|
163
|
+
⚖️ Simplicity Check:
|
|
164
|
+
- Complexity necessary? [yes/no + why]
|
|
165
|
+
- Simplest solution: [...]
|
|
166
|
+
|
|
167
|
+
🎯 Confidence: [HIGH/MEDIUM/LOW] ([%])
|
|
168
|
+
- Based on: [...]
|
|
169
|
+
- Assumptions: [...]
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
📌 TL;DR: [1-2 sentence summary]
|
|
174
|
+
|
|
175
|
+
[Detailed explanation if needed]
|
|
176
|
+
|
|
177
|
+
💡 Simplest approach: [concrete recommendation]
|
|
178
|
+
|
|
179
|
+
📋 Context considerations:
|
|
180
|
+
- If [context A]: [adjust recommendation]
|
|
181
|
+
- If [context B]: [adjust recommendation]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Quick Reference
|
|
187
|
+
|
|
188
|
+
| Situation | Action |
|
|
189
|
+
|-----------|--------|
|
|
190
|
+
| Unclear requirements | Rule 1: Stop & Ask |
|
|
191
|
+
| Making assumptions | Rule 2: State confidence + assumptions |
|
|
192
|
+
| Complex solution tempting | Rule 3: Apply Ockham's Razor |
|
|
193
|
+
| Generic advice | Rule 4: Ask about context first |
|
|
194
|
+
| User asks to edit code | Remind: Q&A mode, offer to switch |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Example: Full Response
|
|
199
|
+
|
|
200
|
+
**User:** "How should I implement caching for my API?"
|
|
201
|
+
|
|
202
|
+
**Response:**
|
|
203
|
+
```
|
|
204
|
+
🔍 Understanding the question:
|
|
205
|
+
- Core problem: API performance via caching
|
|
206
|
+
- Scope: Medium (depends on what to cache)
|
|
207
|
+
- Type: Architecture/How-to
|
|
208
|
+
|
|
209
|
+
❓ Missing context:
|
|
210
|
+
- What data are you caching? (static vs dynamic)
|
|
211
|
+
- Current traffic? (10 req/s vs 10k req/s)
|
|
212
|
+
- Single server or multiple instances?
|
|
213
|
+
|
|
214
|
+
→ These affect the answer significantly. Can you clarify?
|
|
215
|
+
|
|
216
|
+
⚖️ Simplicity Check:
|
|
217
|
+
- Complexity necessary? UNKNOWN until context clear
|
|
218
|
+
- Simplest solution: In-memory cache (Map/LRU) if single instance
|
|
219
|
+
|
|
220
|
+
🎯 Confidence: LOW (40%)
|
|
221
|
+
- Too many unknowns to give specific advice
|
|
222
|
+
- Would be HIGH with traffic numbers and architecture info
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
📌 TL;DR: Caching strategy depends heavily on your scale and setup. Before building complex systems, let's understand your actual needs.
|
|
227
|
+
|
|
228
|
+
💡 Simplest approach (default):
|
|
229
|
+
1. Start with HTTP caching headers (Cache-Control)
|
|
230
|
+
2. Add in-memory cache if needed (node-cache, lru-cache)
|
|
231
|
+
3. Only add Redis when you have multiple instances
|
|
232
|
+
|
|
233
|
+
📋 Context considerations:
|
|
234
|
+
- If single server + <1k req/s: In-memory is enough
|
|
235
|
+
- If multiple servers: Need shared cache (Redis)
|
|
236
|
+
- If data rarely changes: Aggressive HTTP caching
|
|
237
|
+
```
|
|
@@ -4,18 +4,16 @@ description: |
|
|
|
4
4
|
Core design principles for implementing beautiful, professional UIs.
|
|
5
5
|
Ensures consistent quality through spacing, typography, colors, and visual hierarchy.
|
|
6
6
|
|
|
7
|
-
ALWAYS load when implementing UI/frontend
|
|
8
|
-
-
|
|
9
|
-
- Building
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
ALWAYS load when implementing UI/frontend VISUAL DESIGN:
|
|
8
|
+
- Styling components: colors, spacing, typography, shadows
|
|
9
|
+
- Building layouts: CSS, flexbox, grid, positioning
|
|
10
|
+
- Creating visual elements: cards, buttons, forms, dashboards
|
|
11
|
+
- Animation, transition, hover effects, motion
|
|
12
12
|
- Modern, stunning, elegant, sleek interfaces
|
|
13
|
-
- Animation, transition, hover effects, motion, interactive elements
|
|
14
13
|
|
|
15
|
-
Keywords:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interactive, visual, aesthetic, design, attractive, impressive
|
|
14
|
+
Keywords: styling, CSS, layout, colors, spacing, typography, shadows,
|
|
15
|
+
animation, transition, hover, visual, aesthetic, design,
|
|
16
|
+
beautiful, stunning, elegant, sleek, professional
|
|
19
17
|
|
|
20
18
|
Purpose: Ensure ALL UI implementation follows design best practices for:
|
|
21
19
|
- Consistent spacing scale (not arbitrary values)
|
|
@@ -28,8 +26,11 @@ description: |
|
|
|
28
26
|
- Backend-only code (APIs, database, server logic)
|
|
29
27
|
- Pure logic/algorithm work without UI
|
|
30
28
|
- DevOps, infrastructure, CLI tools
|
|
29
|
+
- React/Next.js performance optimization (use react-best-practices)
|
|
30
|
+
- Data fetching, async patterns, bundle optimization (use react-best-practices)
|
|
31
31
|
|
|
32
32
|
Works with other skills:
|
|
33
|
+
- react-best-practices: For React performance (NOT styling)
|
|
33
34
|
- theme-factory: When user needs help CHOOSING colors/theme
|
|
34
35
|
- figma-design-extraction: When Figma file provided
|
|
35
36
|
- design-responsive: For mobile/tablet/responsive specifics
|