@ngxtm/devkit 3.11.1 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILLS_INDEX.md +1 -1
- package/merged-commands/learn.md +88 -21
- package/merged-commands/skill/sync.md +108 -0
- package/package.json +3 -2
- package/rules-index.json +8 -1
- package/skills/learn/SKILL.md +88 -21
- package/skills-index.json +1 -1
- package/templates/base/rules/auto-skill.md +3 -2
- package/templates/base/rules/command-routing.md +71 -0
- package/templates/dotnet/rules/dotnet/aspnet-core/SKILL.md +92 -0
- package/templates/dotnet/rules/dotnet/aspnet-core/references/REFERENCE.md +335 -0
- package/templates/dotnet/rules/dotnet/best-practices/SKILL.md +101 -0
- package/templates/dotnet/rules/dotnet/best-practices/references/REFERENCE.md +256 -0
- package/templates/dotnet/rules/dotnet/blazor/SKILL.md +146 -0
- package/templates/dotnet/rules/dotnet/blazor/references/REFERENCE.md +392 -0
- package/templates/dotnet/rules/dotnet/language/SKILL.md +82 -0
- package/templates/dotnet/rules/dotnet/language/references/REFERENCE.md +222 -0
- package/templates/dotnet/rules/dotnet/patterns.rule.md +388 -0
- package/templates/dotnet/rules/dotnet/razor-pages/SKILL.md +124 -0
- package/templates/dotnet/rules/dotnet/razor-pages/references/REFERENCE.md +321 -0
- package/templates/dotnet/rules/dotnet/security/SKILL.md +89 -0
- package/templates/dotnet/rules/dotnet/security/references/REFERENCE.md +295 -0
- package/templates/dotnet/rules/dotnet/tooling/SKILL.md +92 -0
- package/templates/dotnet/rules/dotnet/tooling/references/REFERENCE.md +300 -0
package/SKILLS_INDEX.md
CHANGED
|
@@ -1036,7 +1036,7 @@ Identifies high-quality leads for your product or service by analyzing your busi
|
|
|
1036
1036
|
### learn
|
|
1037
1037
|
`skills/learn`
|
|
1038
1038
|
|
|
1039
|
-
|
|
1039
|
+
Guided project building — you code, AI mentors. Build your own product step-by-step with best practices and deep understanding.
|
|
1040
1040
|
|
|
1041
1041
|
### legacy-modernizer
|
|
1042
1042
|
`skills/legacy-modernizer`
|
package/merged-commands/learn.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: learn
|
|
3
|
-
description:
|
|
3
|
+
description: Guided project building — you code, AI mentors. Build your own product step-by-step with best practices and deep understanding.
|
|
4
4
|
argument-hint: [topic]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Learn Mode
|
|
7
|
+
# Learn Mode v3.0
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> Build your product. Write every line. Understand every decision.
|
|
10
10
|
|
|
11
11
|
## Activation
|
|
12
12
|
|
|
13
|
-
`/learn "topic"` — e.g., `/learn "JWT auth in Express"`, `/learn "
|
|
13
|
+
`/learn "topic"` — e.g., `/learn "JWT auth in Express"`, `/learn "build real-time chat"`
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -44,13 +44,23 @@ If multiple detected → ask user. If none → ask user.
|
|
|
44
44
|
|
|
45
45
|
3. **Codebase scan**: Read key project files (entry points, configs, existing code related to topic) for context. Use project's conventions in all examples.
|
|
46
46
|
|
|
47
|
-
4. **
|
|
47
|
+
4. **Difficulty from codingLevel** (read from `.claude/.ck.json`):
|
|
48
48
|
- Level 0-1 → **Deep**: full concepts, analogies, Socratic questions at every step
|
|
49
49
|
- Level 2-3 → **Standard**: concepts + code, balanced explanations
|
|
50
50
|
- Level 4-5 → **Quick**: minimal explanation, jump straight to code
|
|
51
51
|
- Not set → ask user with `AskUserQuestion`
|
|
52
52
|
|
|
53
|
-
5. **
|
|
53
|
+
5. **Teaching mode** — ask user via `AskUserQuestion`:
|
|
54
|
+
|
|
55
|
+
| Mode | Who codes? | AI does what? | Best for |
|
|
56
|
+
|------|-----------|---------------|----------|
|
|
57
|
+
| **Guided** | User writes all code | Describe task + review after | Deep understanding, own the code |
|
|
58
|
+
| **Scaffolded** | User fills in key parts | Provide skeleton + hints | Learning new patterns |
|
|
59
|
+
| **Demonstrated** | AI writes, user reads | Write code + explain | Quick overview, reading comprehension |
|
|
60
|
+
|
|
61
|
+
Default suggestion based on difficulty: Deep → Guided, Standard → Scaffolded, Quick → Demonstrated.
|
|
62
|
+
|
|
63
|
+
6. **Create output file**: `learn/{YYYY-MM-DD}-{topic-slug}.md` with YAML frontmatter:
|
|
54
64
|
```yaml
|
|
55
65
|
---
|
|
56
66
|
topic: "{topic}"
|
|
@@ -58,7 +68,8 @@ language: {detected}
|
|
|
58
68
|
phase: INIT
|
|
59
69
|
step: 0
|
|
60
70
|
total_steps: 0
|
|
61
|
-
|
|
71
|
+
difficulty: {deep|standard|quick}
|
|
72
|
+
teaching: {guided|scaffolded|demonstrated}
|
|
62
73
|
started: {ISO timestamp}
|
|
63
74
|
updated: {ISO timestamp}
|
|
64
75
|
---
|
|
@@ -66,7 +77,7 @@ updated: {ISO timestamp}
|
|
|
66
77
|
|
|
67
78
|
---
|
|
68
79
|
|
|
69
|
-
## Phase 2: LEARN (skip entirely in Quick
|
|
80
|
+
## Phase 2: LEARN (skip entirely in Quick difficulty)
|
|
70
81
|
|
|
71
82
|
1. **WebSearch** official docs: `WebSearch("{topic} {language} official documentation")`, then `WebFetch` the most relevant result. Cite sources in tutorial.
|
|
72
83
|
|
|
@@ -86,24 +97,75 @@ Update frontmatter: `phase: LEARN`
|
|
|
86
97
|
|
|
87
98
|
1. **Plan steps**: Break implementation into 3-7 verifiable steps. Show plan to user.
|
|
88
99
|
|
|
89
|
-
2. **For each step**:
|
|
100
|
+
2. **For each step, follow the teaching mode**:
|
|
101
|
+
|
|
102
|
+
### Guided Mode (user codes everything)
|
|
103
|
+
|
|
104
|
+
a. **Describe the task**: Explain WHAT to implement and WHY. Include:
|
|
105
|
+
- The goal of this step
|
|
106
|
+
- Which file(s) to create or modify
|
|
107
|
+
- Key concepts/APIs to use
|
|
108
|
+
- Acceptance criteria (what "done" looks like)
|
|
109
|
+
- **Do NOT show the solution code.**
|
|
110
|
+
|
|
111
|
+
b. **User codes**: Tell user to write the code. Wait for them to say "done" or ask for help.
|
|
112
|
+
- If user asks for a hint → give a small hint, not the full answer
|
|
113
|
+
- If user is stuck after 2 hints → offer to show one specific part
|
|
114
|
+
|
|
115
|
+
c. **AI reviews**: Read the file(s) user modified. Provide:
|
|
116
|
+
- Does it work? Run verify commands.
|
|
117
|
+
- Best-practice review: naming, patterns, security, performance
|
|
118
|
+
- Specific feedback: "Line X: consider Y because Z"
|
|
119
|
+
- If issues found → explain and let user fix (don't fix for them)
|
|
120
|
+
|
|
121
|
+
d. **Socratic**: "Why did you choose this approach?" or "What happens if X fails?" via `AskUserQuestion`
|
|
122
|
+
|
|
123
|
+
### Scaffolded Mode (AI provides skeleton, user fills in)
|
|
90
124
|
|
|
91
|
-
a. **Explain** what we're
|
|
125
|
+
a. **Explain** what we're building and why
|
|
126
|
+
|
|
127
|
+
b. **Write skeleton code** with clearly marked `// TODO: implement` sections. Use `Edit`/`Write` tools. The skeleton should include:
|
|
128
|
+
- File structure and imports
|
|
129
|
+
- Function signatures with parameter types
|
|
130
|
+
- Comments describing what each TODO section should do
|
|
131
|
+
- Keep TODOs focused (each is 3-15 lines of real code)
|
|
132
|
+
|
|
133
|
+
c. **User fills in TODOs**: Wait for user to complete them.
|
|
134
|
+
|
|
135
|
+
d. **AI reviews**: Read filled-in code. Same review process as Guided mode.
|
|
136
|
+
|
|
137
|
+
### Demonstrated Mode (AI codes, user reads)
|
|
138
|
+
|
|
139
|
+
a. **Explain** what we're doing and why
|
|
92
140
|
|
|
93
141
|
b. **Write real code** — no placeholders, no pseudocode. Use project conventions. Use `Edit` for existing files, `Write` for new files.
|
|
94
142
|
|
|
95
|
-
c. **
|
|
96
|
-
|
|
143
|
+
c. **Explain key decisions**: After writing, highlight WHY specific choices were made.
|
|
144
|
+
|
|
145
|
+
### All Modes — after coding:
|
|
146
|
+
|
|
147
|
+
e. **Tiered verify**:
|
|
148
|
+
- Always: run syntax check command from language table
|
|
97
149
|
- When possible: run the code
|
|
98
150
|
- If test framework detected: write/run a test
|
|
99
151
|
|
|
100
|
-
|
|
152
|
+
f. **Best-practice review** (all modes): Check the completed code for:
|
|
153
|
+
- Security issues (injection, XSS, exposed secrets)
|
|
154
|
+
- Anti-patterns for the language/framework
|
|
155
|
+
- Naming and convention consistency with project
|
|
156
|
+
- Performance concerns
|
|
157
|
+
- Present findings to user with explanations
|
|
101
158
|
|
|
102
|
-
|
|
103
|
-
- If user reports error → debug
|
|
159
|
+
g. **Checkpoint**: `AskUserQuestion` — "Step {N}/{total} verified. Ready for next?"
|
|
160
|
+
- If user reports error → debug together (Guided: guide user to fix; Demonstrated: fix directly)
|
|
104
161
|
- If user needs explanation → explain, then continue
|
|
105
162
|
|
|
106
|
-
|
|
163
|
+
h. **Explain-back check** (every 2-3 steps): Ask user via `AskUserQuestion`:
|
|
164
|
+
> "Quick check — can you explain in your own words what we built in the last {N} steps and how they connect?"
|
|
165
|
+
- If user explains well → acknowledge and continue
|
|
166
|
+
- If gaps → re-explain the unclear parts before proceeding
|
|
167
|
+
|
|
168
|
+
i. **Write to tutorial file**: step title, explanation, code, key points, verify result
|
|
107
169
|
|
|
108
170
|
Update frontmatter: `phase: BUILD`, `step: {N}`, `total_steps: {total}`
|
|
109
171
|
|
|
@@ -126,22 +188,27 @@ Display: `Tutorial saved: learn/{filename}.md`
|
|
|
126
188
|
|
|
127
189
|
## Principles
|
|
128
190
|
|
|
129
|
-
1. **
|
|
130
|
-
2. **
|
|
131
|
-
3. **
|
|
132
|
-
4. **
|
|
191
|
+
1. **User owns the code** — in Guided/Scaffolded mode, user writes; AI reviews, never writes for them
|
|
192
|
+
2. **Verify everything** — never assume code works
|
|
193
|
+
3. **Real code only** — no placeholders, no pseudocode (except Scaffolded TODOs)
|
|
194
|
+
4. **User controls pace** — always checkpoint before proceeding
|
|
195
|
+
5. **Teach with their code** — use project's actual codebase, not generic examples
|
|
196
|
+
6. **Best practices always** — review every step for security, patterns, conventions
|
|
197
|
+
7. **Understanding > completion** — if user doesn't understand, stop and re-explain
|
|
133
198
|
|
|
134
199
|
---
|
|
135
200
|
|
|
136
201
|
## Error Handling
|
|
137
202
|
|
|
138
203
|
- **Verify tool missing**: Ask user to install or switch to manual verification
|
|
139
|
-
- **Code doesn't work on user's machine**: Get error message, debug
|
|
204
|
+
- **Code doesn't work on user's machine**: Get error message, debug together, re-verify, update tutorial
|
|
140
205
|
- **Language not detected**: Ask user to specify, set verify strategy accordingly
|
|
206
|
+
- **User stuck in Guided mode**: After 2 hints, offer to show solution for that specific part only
|
|
141
207
|
|
|
142
208
|
---
|
|
143
209
|
|
|
144
210
|
## Version History
|
|
145
211
|
|
|
212
|
+
- **3.0.0** - Teaching modes (guided/scaffolded/demonstrated), best-practice review, explain-back checkpoints, user-codes-first philosophy
|
|
146
213
|
- **2.0.0** - Rewrite: adaptive difficulty via codingLevel, 4 phases, WebSearch, Socratic method, resume support, tiered verify, 17 languages, codebase-aware
|
|
147
214
|
- **1.0.0** - Initial release
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sync new skills from upstream repos with AI evaluation
|
|
3
|
+
argument-hint: [options]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sync Skills from Upstream
|
|
7
|
+
|
|
8
|
+
> AI-assisted upstream skill sync: fetch, evaluate, select, build.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### Step 1: Pre-flight Check
|
|
13
|
+
|
|
14
|
+
Verify clean working directory:
|
|
15
|
+
```bash
|
|
16
|
+
git status --porcelain
|
|
17
|
+
```
|
|
18
|
+
If not clean → ask user to commit or stash first.
|
|
19
|
+
|
|
20
|
+
### Step 2: Fetch Upstream
|
|
21
|
+
|
|
22
|
+
Run the sync script to clone upstream repos and get a report:
|
|
23
|
+
```bash
|
|
24
|
+
npm run sync:upstream
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This creates a sync branch and clones repos to temp directory.
|
|
28
|
+
|
|
29
|
+
### Step 3: Evaluate New Skills
|
|
30
|
+
|
|
31
|
+
After the script runs, it shows which skills are new. For each **new** skill:
|
|
32
|
+
|
|
33
|
+
1. Read its `SKILL.md` from the temp directory
|
|
34
|
+
2. Evaluate:
|
|
35
|
+
- **Useful**: Skill covers a distinct domain not already well-covered
|
|
36
|
+
- **Duplicate**: Similar skill already exists in the local collection
|
|
37
|
+
- **Irrelevant**: Too niche or low quality
|
|
38
|
+
|
|
39
|
+
3. Present summary to user:
|
|
40
|
+
```
|
|
41
|
+
Upstream sync found N new skills:
|
|
42
|
+
|
|
43
|
+
✅ Useful (X):
|
|
44
|
+
- skill-name: short reason
|
|
45
|
+
- skill-name: short reason
|
|
46
|
+
|
|
47
|
+
⚠️ Possibly duplicate (Y):
|
|
48
|
+
- skill-name: overlaps with existing-skill
|
|
49
|
+
|
|
50
|
+
❌ Skip (Z):
|
|
51
|
+
- skill-name: reason
|
|
52
|
+
|
|
53
|
+
Sync options:
|
|
54
|
+
1. Sync all useful (X skills)
|
|
55
|
+
2. Sync all useful + duplicates (X+Y skills)
|
|
56
|
+
3. Let me choose manually
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 4: Copy Selected Skills
|
|
60
|
+
|
|
61
|
+
Use `AskUserQuestion` to get user's choice. Then for selected skills:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
cp -r /tmp/devkit-sync/{source}/{skill-name} ./skills/{skill-name}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 5: Rebuild Indexes
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm run build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This regenerates all indexes (merged-commands, rules-index, skills-index, skills-compact).
|
|
74
|
+
|
|
75
|
+
### Step 6: Review & Commit
|
|
76
|
+
|
|
77
|
+
Show summary of changes:
|
|
78
|
+
```bash
|
|
79
|
+
git diff --stat
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Ask user if they want to commit:
|
|
83
|
+
```bash
|
|
84
|
+
git add skills/ merged-commands/ SKILLS_INDEX.md skills-index.json skills-compact.json rules-index.json
|
|
85
|
+
git commit -m "feat(skills): sync N new skills from upstream"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Options
|
|
89
|
+
|
|
90
|
+
- `$ARGUMENTS` can specify:
|
|
91
|
+
- `--auto`: Skip evaluation, sync all new skills automatically
|
|
92
|
+
- `--dry-run`: Only show report, don't copy anything
|
|
93
|
+
- A specific upstream name to sync from (e.g., `antigravity` or `agent-assistant`)
|
|
94
|
+
|
|
95
|
+
## Evaluation Criteria
|
|
96
|
+
|
|
97
|
+
When evaluating skills, consider:
|
|
98
|
+
- Does it cover a technology the project uses or might use?
|
|
99
|
+
- Is there already a similar skill? (check by name and description)
|
|
100
|
+
- Is the SKILL.md well-structured with actionable content?
|
|
101
|
+
- Is it too generic (just says "be a senior X engineer")?
|
|
102
|
+
|
|
103
|
+
## Important
|
|
104
|
+
|
|
105
|
+
- **NEVER** auto-sync without user confirmation (unless `--auto` flag)
|
|
106
|
+
- **ALWAYS** run `npm run build` after copying skills
|
|
107
|
+
- Keep the sync branch for PR review if needed
|
|
108
|
+
- The temp directory is at the path shown by the sync script output
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngxtm/devkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Per-project AI skills with smart tech detection - lightweight and context-optimized",
|
|
5
5
|
"main": "cli/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"devkit": "cli/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "npm run merge-commands && npm run organize-rules && npm run generate-index",
|
|
10
|
+
"build": "npm run merge-commands && npm run organize-rules && npm run generate-index && npm run build-compact-index",
|
|
11
|
+
"build-compact-index": "node scripts/build-compact-index.js",
|
|
11
12
|
"merge-commands": "node scripts/merge-commands.js",
|
|
12
13
|
"organize-rules": "node scripts/organize-rules.js",
|
|
13
14
|
"generate-index": "node scripts/generate-index.js",
|
package/rules-index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-
|
|
3
|
+
"generatedAt": "2026-02-19T07:09:25.835Z",
|
|
4
4
|
"templates": {
|
|
5
5
|
"dart": {
|
|
6
6
|
"path": "templates/dart/rules",
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
],
|
|
10
10
|
"sizeKB": 4
|
|
11
11
|
},
|
|
12
|
+
"dotnet": {
|
|
13
|
+
"path": "templates/dotnet/rules",
|
|
14
|
+
"rules": [
|
|
15
|
+
"dotnet"
|
|
16
|
+
],
|
|
17
|
+
"sizeKB": 92
|
|
18
|
+
},
|
|
12
19
|
"flutter": {
|
|
13
20
|
"path": "templates/flutter/rules",
|
|
14
21
|
"rules": [
|
package/skills/learn/SKILL.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: learn
|
|
3
|
-
description:
|
|
3
|
+
description: Guided project building — you code, AI mentors. Build your own product step-by-step with best practices and deep understanding.
|
|
4
4
|
argument-hint: [topic]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Learn Mode
|
|
7
|
+
# Learn Mode v3.0
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> Build your product. Write every line. Understand every decision.
|
|
10
10
|
|
|
11
11
|
## Activation
|
|
12
12
|
|
|
13
|
-
`/learn "topic"` — e.g., `/learn "JWT auth in Express"`, `/learn "
|
|
13
|
+
`/learn "topic"` — e.g., `/learn "JWT auth in Express"`, `/learn "build real-time chat"`
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -44,13 +44,23 @@ If multiple detected → ask user. If none → ask user.
|
|
|
44
44
|
|
|
45
45
|
3. **Codebase scan**: Read key project files (entry points, configs, existing code related to topic) for context. Use project's conventions in all examples.
|
|
46
46
|
|
|
47
|
-
4. **
|
|
47
|
+
4. **Difficulty from codingLevel** (read from `.claude/.ck.json`):
|
|
48
48
|
- Level 0-1 → **Deep**: full concepts, analogies, Socratic questions at every step
|
|
49
49
|
- Level 2-3 → **Standard**: concepts + code, balanced explanations
|
|
50
50
|
- Level 4-5 → **Quick**: minimal explanation, jump straight to code
|
|
51
51
|
- Not set → ask user with `AskUserQuestion`
|
|
52
52
|
|
|
53
|
-
5. **
|
|
53
|
+
5. **Teaching mode** — ask user via `AskUserQuestion`:
|
|
54
|
+
|
|
55
|
+
| Mode | Who codes? | AI does what? | Best for |
|
|
56
|
+
|------|-----------|---------------|----------|
|
|
57
|
+
| **Guided** | User writes all code | Describe task + review after | Deep understanding, own the code |
|
|
58
|
+
| **Scaffolded** | User fills in key parts | Provide skeleton + hints | Learning new patterns |
|
|
59
|
+
| **Demonstrated** | AI writes, user reads | Write code + explain | Quick overview, reading comprehension |
|
|
60
|
+
|
|
61
|
+
Default suggestion based on difficulty: Deep → Guided, Standard → Scaffolded, Quick → Demonstrated.
|
|
62
|
+
|
|
63
|
+
6. **Create output file**: `learn/{YYYY-MM-DD}-{topic-slug}.md` with YAML frontmatter:
|
|
54
64
|
```yaml
|
|
55
65
|
---
|
|
56
66
|
topic: "{topic}"
|
|
@@ -58,7 +68,8 @@ language: {detected}
|
|
|
58
68
|
phase: INIT
|
|
59
69
|
step: 0
|
|
60
70
|
total_steps: 0
|
|
61
|
-
|
|
71
|
+
difficulty: {deep|standard|quick}
|
|
72
|
+
teaching: {guided|scaffolded|demonstrated}
|
|
62
73
|
started: {ISO timestamp}
|
|
63
74
|
updated: {ISO timestamp}
|
|
64
75
|
---
|
|
@@ -66,7 +77,7 @@ updated: {ISO timestamp}
|
|
|
66
77
|
|
|
67
78
|
---
|
|
68
79
|
|
|
69
|
-
## Phase 2: LEARN (skip entirely in Quick
|
|
80
|
+
## Phase 2: LEARN (skip entirely in Quick difficulty)
|
|
70
81
|
|
|
71
82
|
1. **WebSearch** official docs: `WebSearch("{topic} {language} official documentation")`, then `WebFetch` the most relevant result. Cite sources in tutorial.
|
|
72
83
|
|
|
@@ -86,24 +97,75 @@ Update frontmatter: `phase: LEARN`
|
|
|
86
97
|
|
|
87
98
|
1. **Plan steps**: Break implementation into 3-7 verifiable steps. Show plan to user.
|
|
88
99
|
|
|
89
|
-
2. **For each step**:
|
|
100
|
+
2. **For each step, follow the teaching mode**:
|
|
101
|
+
|
|
102
|
+
### Guided Mode (user codes everything)
|
|
103
|
+
|
|
104
|
+
a. **Describe the task**: Explain WHAT to implement and WHY. Include:
|
|
105
|
+
- The goal of this step
|
|
106
|
+
- Which file(s) to create or modify
|
|
107
|
+
- Key concepts/APIs to use
|
|
108
|
+
- Acceptance criteria (what "done" looks like)
|
|
109
|
+
- **Do NOT show the solution code.**
|
|
110
|
+
|
|
111
|
+
b. **User codes**: Tell user to write the code. Wait for them to say "done" or ask for help.
|
|
112
|
+
- If user asks for a hint → give a small hint, not the full answer
|
|
113
|
+
- If user is stuck after 2 hints → offer to show one specific part
|
|
114
|
+
|
|
115
|
+
c. **AI reviews**: Read the file(s) user modified. Provide:
|
|
116
|
+
- Does it work? Run verify commands.
|
|
117
|
+
- Best-practice review: naming, patterns, security, performance
|
|
118
|
+
- Specific feedback: "Line X: consider Y because Z"
|
|
119
|
+
- If issues found → explain and let user fix (don't fix for them)
|
|
120
|
+
|
|
121
|
+
d. **Socratic**: "Why did you choose this approach?" or "What happens if X fails?" via `AskUserQuestion`
|
|
122
|
+
|
|
123
|
+
### Scaffolded Mode (AI provides skeleton, user fills in)
|
|
90
124
|
|
|
91
|
-
a. **Explain** what we're
|
|
125
|
+
a. **Explain** what we're building and why
|
|
126
|
+
|
|
127
|
+
b. **Write skeleton code** with clearly marked `// TODO: implement` sections. Use `Edit`/`Write` tools. The skeleton should include:
|
|
128
|
+
- File structure and imports
|
|
129
|
+
- Function signatures with parameter types
|
|
130
|
+
- Comments describing what each TODO section should do
|
|
131
|
+
- Keep TODOs focused (each is 3-15 lines of real code)
|
|
132
|
+
|
|
133
|
+
c. **User fills in TODOs**: Wait for user to complete them.
|
|
134
|
+
|
|
135
|
+
d. **AI reviews**: Read filled-in code. Same review process as Guided mode.
|
|
136
|
+
|
|
137
|
+
### Demonstrated Mode (AI codes, user reads)
|
|
138
|
+
|
|
139
|
+
a. **Explain** what we're doing and why
|
|
92
140
|
|
|
93
141
|
b. **Write real code** — no placeholders, no pseudocode. Use project conventions. Use `Edit` for existing files, `Write` for new files.
|
|
94
142
|
|
|
95
|
-
c. **
|
|
96
|
-
|
|
143
|
+
c. **Explain key decisions**: After writing, highlight WHY specific choices were made.
|
|
144
|
+
|
|
145
|
+
### All Modes — after coding:
|
|
146
|
+
|
|
147
|
+
e. **Tiered verify**:
|
|
148
|
+
- Always: run syntax check command from language table
|
|
97
149
|
- When possible: run the code
|
|
98
150
|
- If test framework detected: write/run a test
|
|
99
151
|
|
|
100
|
-
|
|
152
|
+
f. **Best-practice review** (all modes): Check the completed code for:
|
|
153
|
+
- Security issues (injection, XSS, exposed secrets)
|
|
154
|
+
- Anti-patterns for the language/framework
|
|
155
|
+
- Naming and convention consistency with project
|
|
156
|
+
- Performance concerns
|
|
157
|
+
- Present findings to user with explanations
|
|
101
158
|
|
|
102
|
-
|
|
103
|
-
- If user reports error → debug
|
|
159
|
+
g. **Checkpoint**: `AskUserQuestion` — "Step {N}/{total} verified. Ready for next?"
|
|
160
|
+
- If user reports error → debug together (Guided: guide user to fix; Demonstrated: fix directly)
|
|
104
161
|
- If user needs explanation → explain, then continue
|
|
105
162
|
|
|
106
|
-
|
|
163
|
+
h. **Explain-back check** (every 2-3 steps): Ask user via `AskUserQuestion`:
|
|
164
|
+
> "Quick check — can you explain in your own words what we built in the last {N} steps and how they connect?"
|
|
165
|
+
- If user explains well → acknowledge and continue
|
|
166
|
+
- If gaps → re-explain the unclear parts before proceeding
|
|
167
|
+
|
|
168
|
+
i. **Write to tutorial file**: step title, explanation, code, key points, verify result
|
|
107
169
|
|
|
108
170
|
Update frontmatter: `phase: BUILD`, `step: {N}`, `total_steps: {total}`
|
|
109
171
|
|
|
@@ -126,22 +188,27 @@ Display: `Tutorial saved: learn/{filename}.md`
|
|
|
126
188
|
|
|
127
189
|
## Principles
|
|
128
190
|
|
|
129
|
-
1. **
|
|
130
|
-
2. **
|
|
131
|
-
3. **
|
|
132
|
-
4. **
|
|
191
|
+
1. **User owns the code** — in Guided/Scaffolded mode, user writes; AI reviews, never writes for them
|
|
192
|
+
2. **Verify everything** — never assume code works
|
|
193
|
+
3. **Real code only** — no placeholders, no pseudocode (except Scaffolded TODOs)
|
|
194
|
+
4. **User controls pace** — always checkpoint before proceeding
|
|
195
|
+
5. **Teach with their code** — use project's actual codebase, not generic examples
|
|
196
|
+
6. **Best practices always** — review every step for security, patterns, conventions
|
|
197
|
+
7. **Understanding > completion** — if user doesn't understand, stop and re-explain
|
|
133
198
|
|
|
134
199
|
---
|
|
135
200
|
|
|
136
201
|
## Error Handling
|
|
137
202
|
|
|
138
203
|
- **Verify tool missing**: Ask user to install or switch to manual verification
|
|
139
|
-
- **Code doesn't work on user's machine**: Get error message, debug
|
|
204
|
+
- **Code doesn't work on user's machine**: Get error message, debug together, re-verify, update tutorial
|
|
140
205
|
- **Language not detected**: Ask user to specify, set verify strategy accordingly
|
|
206
|
+
- **User stuck in Guided mode**: After 2 hints, offer to show solution for that specific part only
|
|
141
207
|
|
|
142
208
|
---
|
|
143
209
|
|
|
144
210
|
## Version History
|
|
145
211
|
|
|
212
|
+
- **3.0.0** - Teaching modes (guided/scaffolded/demonstrated), best-practice review, explain-back checkpoints, user-codes-first philosophy
|
|
146
213
|
- **2.0.0** - Rewrite: adaptive difficulty via codingLevel, 4 phases, WebSearch, Socratic method, resume support, tiered verify, 17 languages, codebase-aware
|
|
147
214
|
- **1.0.0** - Initial release
|
package/skills-index.json
CHANGED
|
@@ -1977,7 +1977,7 @@
|
|
|
1977
1977
|
{
|
|
1978
1978
|
"name": "learn",
|
|
1979
1979
|
"path": "skills/learn",
|
|
1980
|
-
"description": "
|
|
1980
|
+
"description": "Guided project building — you code, AI mentors. Build your own product step-by-step with best practices and deep understanding."
|
|
1981
1981
|
},
|
|
1982
1982
|
{
|
|
1983
1983
|
"name": "legacy-modernizer",
|
|
@@ -48,11 +48,12 @@ User Request → Extract keywords (react, auth, test, etc.)
|
|
|
48
48
|
### Step 1: Read Compact Index
|
|
49
49
|
```
|
|
50
50
|
Read: .claude/skills-compact.json
|
|
51
|
-
Format: { "_categories": {...}, "skills": { "skill-name": "category
|
|
51
|
+
Format: { "_categories": {...}, "skills": { "skill-name": { "c": "category", "d": "short description" } } }
|
|
52
|
+
Note: Some skills may be just a category string if no description available.
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
### Step 2: Match by Name/Keyword
|
|
55
|
-
Look for skills whose name contains user's keywords:
|
|
56
|
+
Look for skills whose name OR description contains user's keywords:
|
|
56
57
|
- User says "react" → find skills with "react" in name
|
|
57
58
|
- User says "authentication" → find "auth" skills
|
|
58
59
|
- User says "docker" → find "docker" skills
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Command Routing Guide
|
|
2
|
+
|
|
3
|
+
> Help Claude choose the right command and execution mode for each task.
|
|
4
|
+
|
|
5
|
+
## Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Is this a learning/educational request?
|
|
9
|
+
→ /learn
|
|
10
|
+
|
|
11
|
+
Is this brainstorming/ideation only (no code)?
|
|
12
|
+
→ /brainstorm
|
|
13
|
+
|
|
14
|
+
Is this just planning (no implementation)?
|
|
15
|
+
→ /plan
|
|
16
|
+
|
|
17
|
+
Is this a bug fix?
|
|
18
|
+
→ /fix (simple) or /fix:hard (complex)
|
|
19
|
+
|
|
20
|
+
Is this a small, well-defined task?
|
|
21
|
+
→ /cook:fast
|
|
22
|
+
|
|
23
|
+
Is this a medium task with clear requirements?
|
|
24
|
+
→ /cook:auto (auto: plan → code → commit)
|
|
25
|
+
→ OR /plan → /code (manual control)
|
|
26
|
+
|
|
27
|
+
Is this a complex, full-lifecycle feature?
|
|
28
|
+
→ /cook:hard (includes brainstorm+research+plan+code+test+review)
|
|
29
|
+
→ OR /brainstorm → /plan → /code (manual, more control)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Anti-Patterns
|
|
33
|
+
|
|
34
|
+
- **NEVER** chain `/brainstorm` → `/plan` before `/cook:hard` — it already includes both internally, causing duplicate work
|
|
35
|
+
- **NEVER** use `/cook:hard` for trivial fixes — overkill, wastes context
|
|
36
|
+
- **NEVER** use `/cook:fast` for complex features — skips research/design, leads to rework
|
|
37
|
+
|
|
38
|
+
## Command Reference
|
|
39
|
+
|
|
40
|
+
| Command | Complexity | Multi-Agent | Best For |
|
|
41
|
+
|---------|-----------|-------------|----------|
|
|
42
|
+
| `/cook:fast` | Low | Light (scouter, engineer) | Well-defined small tasks |
|
|
43
|
+
| `/cook` | Medium | Yes (full team) | Standard feature work |
|
|
44
|
+
| `/cook:auto` | Medium | Yes (plan → code → git) | Autonomous implementation |
|
|
45
|
+
| `/cook:hard` | High | Full (8 phases, all agents) | Complex features from scratch |
|
|
46
|
+
| `/brainstorm` | N/A | No | Ideation, design exploration |
|
|
47
|
+
| `/plan` | N/A | Optional (researcher) | Creating implementation plans |
|
|
48
|
+
| `/code` | Medium | Yes (tester, reviewer) | Executing an existing plan |
|
|
49
|
+
| `/learn` | N/A | No | Interactive tutorials |
|
|
50
|
+
| `/fix` | Low | No | Quick bug fixes |
|
|
51
|
+
| `/fix:hard` | Medium | Yes (debugger, tester) | Complex debugging |
|
|
52
|
+
|
|
53
|
+
## Multi-Agent Phases in /cook:hard
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Phase 1: brainstormer → Requirements discovery
|
|
57
|
+
Phase 2: researcher → Best practices research
|
|
58
|
+
Phase 3: scouter → Codebase analysis
|
|
59
|
+
Phase 4: designer → UI/UX design (if needed)
|
|
60
|
+
Phase 5: planner → Implementation plan
|
|
61
|
+
Phase 6: tech-lead → Routes to specialist engineers
|
|
62
|
+
Phase 7: tester → Testing
|
|
63
|
+
Phase 8: reviewer → Code review
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## When to Suggest Skills
|
|
67
|
+
|
|
68
|
+
After choosing the right command, check if a domain-specific skill would help:
|
|
69
|
+
- User says "react" → suggest `/react-expert` skill alongside chosen command
|
|
70
|
+
- User says "auth" → suggest `/auth-implementation-patterns` skill
|
|
71
|
+
- See `auto-skill.md` for full detection flow
|