@ngxtm/devkit 3.13.0 → 3.15.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 +7 -2
- package/merged-commands/learn.md +65 -6
- package/merged-commands/react-doctor.md +141 -0
- package/merged-commands/skill/sync.md +132 -64
- package/package.json +1 -1
- package/rules-index.json +1 -1
- package/skills/learn/SKILL.md +65 -6
- package/skills/react-doctor/SKILL.md +141 -0
- package/skills/react-doctor/UPSTREAM.md +68 -0
- package/skills-index.json +5 -0
package/SKILLS_INDEX.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Skills Index
|
|
2
2
|
|
|
3
|
-
> Auto-generated index of
|
|
3
|
+
> Auto-generated index of 769 available skills.
|
|
4
4
|
> Use this to discover skills without loading all files into context.
|
|
5
5
|
>
|
|
6
6
|
> **To use a skill**: Read the full skill at `~/.claude/skills/<skill-name>/SKILL.md`
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| Testing | 27 |
|
|
18
18
|
| Python | 23 |
|
|
19
19
|
| Security | 21 |
|
|
20
|
-
| Frontend Frameworks |
|
|
20
|
+
| Frontend Frameworks | 20 |
|
|
21
21
|
| TypeScript/JavaScript | 19 |
|
|
22
22
|
| Databases | 19 |
|
|
23
23
|
| API Design | 10 |
|
|
@@ -3544,6 +3544,11 @@ Expert integration of Supabase Auth with Next.js App Router Use when: supabase a
|
|
|
3544
3544
|
|
|
3545
3545
|
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React...
|
|
3546
3546
|
|
|
3547
|
+
### react-doctor
|
|
3548
|
+
`skills/react-doctor`
|
|
3549
|
+
|
|
3550
|
+
Run react-doctor to scan React codebase for health issues. Diagnose security, performance, correctness, architecture problems with 0-100 score.
|
|
3551
|
+
|
|
3547
3552
|
### react-expert
|
|
3548
3553
|
`skills/react-expert`
|
|
3549
3554
|
|
package/merged-commands/learn.md
CHANGED
|
@@ -4,9 +4,9 @@ description: Guided project building — you code, AI mentors. Build your own pr
|
|
|
4
4
|
argument-hint: [topic]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Learn Mode v3.
|
|
7
|
+
# Learn Mode v3.1
|
|
8
8
|
|
|
9
|
-
> Build your product. Write every line. Understand every decision.
|
|
9
|
+
> Build your product. Design the architecture. Write every line. Understand every decision.
|
|
10
10
|
|
|
11
11
|
## Activation
|
|
12
12
|
|
|
@@ -93,11 +93,69 @@ Update frontmatter: `phase: LEARN`
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
## Phase 3:
|
|
96
|
+
## Phase 3: DESIGN (Socratic architecture thinking)
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
> User thinks first, AI guides — not the other way around.
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
1. **Frame the problem**: AI presents the high-level problem to solve:
|
|
101
|
+
> "We need to build {topic}. Before I suggest anything — how would YOU approach this? What components or pieces do you think we need?"
|
|
102
|
+
|
|
103
|
+
Ask via `AskUserQuestion`. Let user think and answer.
|
|
104
|
+
|
|
105
|
+
2. **Build on user's answer**:
|
|
106
|
+
- If user's approach is solid → acknowledge strengths, refine together
|
|
107
|
+
- If user's approach has gaps → ask guiding questions: "What about {concern}? How would you handle that?"
|
|
108
|
+
- If user has no idea → break it down: "Let's start smaller — what's the first thing a user would do with this feature?"
|
|
109
|
+
|
|
110
|
+
3. **Explore alternatives**: Present 2-3 different approaches with trade-offs:
|
|
111
|
+
> "Your approach uses X. Another option is Y. Here's how they compare:"
|
|
112
|
+
|
|
113
|
+
| Aspect | Approach A (user's) | Approach B | Approach C |
|
|
114
|
+
|--------|-------------------|-----------|-----------|
|
|
115
|
+
| Complexity | ... | ... | ... |
|
|
116
|
+
| Scalability | ... | ... | ... |
|
|
117
|
+
| Learning value | ... | ... | ... |
|
|
118
|
+
|
|
119
|
+
Ask user to choose via `AskUserQuestion`. Explain WHY each trade-off matters.
|
|
120
|
+
|
|
121
|
+
4. **Architecture decisions**: For the chosen approach, walk through key decisions:
|
|
122
|
+
- Data flow: how data moves through the system
|
|
123
|
+
- File/module structure: where code lives and why
|
|
124
|
+
- Dependencies: what libraries/tools and why those specifically
|
|
125
|
+
- Patterns: which design patterns and why (not just "use MVC" but why MVC fits here)
|
|
126
|
+
|
|
127
|
+
For each decision, ask user: "Does this make sense? Any concerns?"
|
|
128
|
+
|
|
129
|
+
5. **Write to tutorial file**: Record the design discussion, chosen approach, and rationale.
|
|
130
|
+
|
|
131
|
+
Update frontmatter: `phase: DESIGN`
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Phase 4: PLAN (concrete implementation steps)
|
|
136
|
+
|
|
137
|
+
1. **Break down the chosen design** into 3-7 concrete, verifiable steps. Each step should:
|
|
138
|
+
- Have a clear goal (what's done when this step is complete)
|
|
139
|
+
- Build on previous steps (incremental, testable progress)
|
|
140
|
+
- Be small enough to verify immediately
|
|
141
|
+
|
|
142
|
+
2. **Show plan to user** with rationale for the ordering:
|
|
143
|
+
> "Here's the build order. We start with X because Y depends on it. Step 3 before Step 4 because..."
|
|
144
|
+
|
|
145
|
+
3. **User validates**: Ask via `AskUserQuestion`:
|
|
146
|
+
> "Does this plan make sense? Want to reorder anything or add/remove steps?"
|
|
147
|
+
|
|
148
|
+
Adjust plan based on user feedback.
|
|
149
|
+
|
|
150
|
+
4. **Write plan to tutorial file**: Each step with goal, files involved, and acceptance criteria.
|
|
151
|
+
|
|
152
|
+
Update frontmatter: `phase: PLAN`, `total_steps: {N}`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Phase 5: BUILD (core phase)
|
|
157
|
+
|
|
158
|
+
1. **For each step from the PLAN phase, follow the teaching mode**:
|
|
101
159
|
|
|
102
160
|
### Guided Mode (user codes everything)
|
|
103
161
|
|
|
@@ -171,7 +229,7 @@ Update frontmatter: `phase: LEARN`
|
|
|
171
229
|
|
|
172
230
|
---
|
|
173
231
|
|
|
174
|
-
## Phase
|
|
232
|
+
## Phase 6: WRAP-UP
|
|
175
233
|
|
|
176
234
|
1. **Summary**: What was built, key takeaways (3-5 points)
|
|
177
235
|
|
|
@@ -209,6 +267,7 @@ Display: `Tutorial saved: learn/{filename}.md`
|
|
|
209
267
|
|
|
210
268
|
## Version History
|
|
211
269
|
|
|
270
|
+
- **3.1.0** - Added DESIGN phase (Socratic architecture) and PLAN phase (concrete steps). Full flow: INIT → LEARN → DESIGN → PLAN → BUILD → WRAP-UP
|
|
212
271
|
- **3.0.0** - Teaching modes (guided/scaffolded/demonstrated), best-practice review, explain-back checkpoints, user-codes-first philosophy
|
|
213
272
|
- **2.0.0** - Rewrite: adaptive difficulty via codingLevel, 4 phases, WebSearch, Socratic method, resume support, tiered verify, 17 languages, codebase-aware
|
|
214
273
|
- **1.0.0** - Initial release
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-doctor
|
|
3
|
+
description: Run react-doctor to scan React codebase for health issues. Diagnose security, performance, correctness, architecture problems with 0-100 score.
|
|
4
|
+
upstream: https://github.com/millionco/react-doctor
|
|
5
|
+
upstream-version: "0.0.0"
|
|
6
|
+
triggers:
|
|
7
|
+
- react-doctor
|
|
8
|
+
- react health
|
|
9
|
+
- react scan
|
|
10
|
+
- react lint
|
|
11
|
+
- code health
|
|
12
|
+
- react audit
|
|
13
|
+
- react score
|
|
14
|
+
role: tool
|
|
15
|
+
scope: diagnostics
|
|
16
|
+
output-format: analysis
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# React Doctor
|
|
20
|
+
|
|
21
|
+
Scan React codebase for security, performance, correctness, and architecture issues. Outputs a 0-100 health score with actionable diagnostics.
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
- After making React changes (catch issues early)
|
|
26
|
+
- During code review or PR review
|
|
27
|
+
- Finishing a feature before merge
|
|
28
|
+
- Periodic codebase health check
|
|
29
|
+
- Setting up CI quality gates
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Full scan with file details
|
|
35
|
+
npx -y react-doctor@latest . --verbose
|
|
36
|
+
|
|
37
|
+
# Scan only changed files (vs base branch)
|
|
38
|
+
npx -y react-doctor@latest . --verbose --diff
|
|
39
|
+
|
|
40
|
+
# Score only (for CI)
|
|
41
|
+
npx -y react-doctor@latest . --score
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## How It Works
|
|
45
|
+
|
|
46
|
+
Detects framework (Next.js, Vite, Remix, etc.), React version, and compiler setup, then runs two parallel passes:
|
|
47
|
+
|
|
48
|
+
1. **Lint** — 60+ rules across 8 categories
|
|
49
|
+
2. **Dead code** — unused files, exports, types, duplicates
|
|
50
|
+
|
|
51
|
+
## Rule Categories
|
|
52
|
+
|
|
53
|
+
| Category | Examples |
|
|
54
|
+
|----------|----------|
|
|
55
|
+
| State & Effects | missing deps, stale closures, unnecessary re-renders |
|
|
56
|
+
| Performance | unoptimized renders, missing memoization, large bundles |
|
|
57
|
+
| Architecture | circular deps, prop drilling, god components |
|
|
58
|
+
| Bundle Size | unused imports, heavy dependencies |
|
|
59
|
+
| Security | dangerouslySetInnerHTML, XSS vectors |
|
|
60
|
+
| Correctness | key prop misuse, effect cleanup, race conditions |
|
|
61
|
+
| Accessibility | missing ARIA, no-autofocus, semantic HTML |
|
|
62
|
+
| Framework-specific | Next.js patterns, React Native issues |
|
|
63
|
+
|
|
64
|
+
## CLI Flags
|
|
65
|
+
|
|
66
|
+
| Flag | Description |
|
|
67
|
+
|------|-------------|
|
|
68
|
+
| `--verbose` | Show file details and line numbers per rule |
|
|
69
|
+
| `--no-lint` | Skip linting |
|
|
70
|
+
| `--no-dead-code` | Skip dead code detection |
|
|
71
|
+
| `--score` | Output only the score |
|
|
72
|
+
| `--diff [base]` | Scan only files changed vs base branch |
|
|
73
|
+
| `--project <name>` | Select workspace project (comma-separated) |
|
|
74
|
+
| `-y, --yes` | Skip prompts, scan all workspace projects |
|
|
75
|
+
| `--fix` | Open Ami to auto-fix all issues |
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
Create `react-doctor.config.json` at project root:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"ignore": {
|
|
84
|
+
"rules": ["react/no-danger", "knip/exports"],
|
|
85
|
+
"files": ["src/generated/**"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or use `"reactDoctor"` key in `package.json`. Config file takes precedence.
|
|
91
|
+
|
|
92
|
+
| Key | Type | Default | Description |
|
|
93
|
+
|-----|------|---------|-------------|
|
|
94
|
+
| `ignore.rules` | `string[]` | `[]` | Rules to suppress (`plugin/rule` format) |
|
|
95
|
+
| `ignore.files` | `string[]` | `[]` | File globs to exclude |
|
|
96
|
+
| `lint` | `boolean` | `true` | Enable/disable lint checks |
|
|
97
|
+
| `deadCode` | `boolean` | `true` | Enable/disable dead code detection |
|
|
98
|
+
| `verbose` | `boolean` | `false` | Show file details per rule |
|
|
99
|
+
| `diff` | `boolean\|string` | — | Force diff mode or pin base branch |
|
|
100
|
+
|
|
101
|
+
## Node.js API
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { diagnose } from "react-doctor/api";
|
|
105
|
+
const result = await diagnose(".", { lint: true, deadCode: true });
|
|
106
|
+
// result.score → { score: 82, label: "Good" }
|
|
107
|
+
// result.diagnostics → Array of { filePath, plugin, rule, severity, message, help, line, column, category }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Workflow
|
|
111
|
+
|
|
112
|
+
1. **Run scan** → `npx -y react-doctor@latest . --verbose`
|
|
113
|
+
2. **Read score** → 75+ Great, 50-74 Needs work, <50 Critical
|
|
114
|
+
3. **Fix errors first** → errors weigh more than warnings
|
|
115
|
+
4. **Re-run** → verify score improved
|
|
116
|
+
5. **Iterate** → address warnings if time permits
|
|
117
|
+
|
|
118
|
+
## Scoring
|
|
119
|
+
|
|
120
|
+
- **75-100** — Great health
|
|
121
|
+
- **50-74** — Needs work
|
|
122
|
+
- **0-49** — Critical issues
|
|
123
|
+
- Errors weigh more than warnings in score calculation
|
|
124
|
+
|
|
125
|
+
## GitHub Actions
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
- uses: millionco/react-doctor@main
|
|
129
|
+
with:
|
|
130
|
+
diff: main
|
|
131
|
+
verbose: true
|
|
132
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Posts findings as PR comment when `github-token` is set on `pull_request` events.
|
|
136
|
+
|
|
137
|
+
## Related Skills
|
|
138
|
+
|
|
139
|
+
- **react-expert** — Fix identified React issues
|
|
140
|
+
- **code-review** — Include react-doctor scan in reviews
|
|
141
|
+
- **test-master** — Dead code findings inform test coverage gaps
|
|
@@ -1,108 +1,176 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Sync
|
|
3
|
-
argument-hint: [
|
|
2
|
+
description: Sync skills, rules, and external-skills from upstream repos with AI evaluation
|
|
3
|
+
argument-hint: [--auto] [--dry-run]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Sync
|
|
6
|
+
# Sync from Upstream
|
|
7
7
|
|
|
8
|
-
> AI-
|
|
8
|
+
> AI-driven upstream sync: fetch, evaluate new+updated skills/rules/external-skills, apply, build, commit.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Arguments
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Parse `$ARGUMENTS` for flags:
|
|
13
|
+
- `--auto`: Fully autonomous — sync all useful new items, accept all updates, no user questions
|
|
14
|
+
- `--dry-run`: Show report only, don't copy or commit anything
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
git status --porcelain
|
|
17
|
-
```
|
|
18
|
-
If not clean → ask user to commit or stash first.
|
|
16
|
+
## Workflow
|
|
19
17
|
|
|
20
|
-
### Step
|
|
18
|
+
### Step 1: Pre-flight
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
Check git status:
|
|
23
21
|
```bash
|
|
24
|
-
|
|
22
|
+
git status --porcelain
|
|
25
23
|
```
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
- If **clean** → proceed
|
|
26
|
+
- If **dirty + `--auto`** → run `git stash push -m "devkit-sync-stash"`
|
|
27
|
+
- If **dirty + interactive** → ask user to commit/stash or continue with stash
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Remember if stash was created (for restore later).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
### Step 2: Fetch & Report
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- **Irrelevant**: Too niche or low quality
|
|
33
|
+
Run the sync script with JSON output:
|
|
34
|
+
```bash
|
|
35
|
+
node scripts/manual-sync.js --no-branch --json
|
|
36
|
+
```
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
Parse the JSON output. It contains:
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"tempDir": "/tmp/devkit-sync",
|
|
42
|
+
"skills": { "new": [...], "updated": [...], "unchanged": N },
|
|
43
|
+
"rules": { "new": [...], "updated": [...], "unchanged": N },
|
|
44
|
+
"external-skills": [{ "name": "...", "localExists": bool, "upstreamVersion": "...", "localVersion": "...", "checkFiles": [...], "tempPath": "..." }]
|
|
45
|
+
}
|
|
40
46
|
```
|
|
41
|
-
Upstream sync found N new skills:
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
- skill-name: short reason
|
|
45
|
-
- skill-name: short reason
|
|
48
|
+
If all categories have 0 new and 0 updated → report "Already up to date" and stop.
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
- skill-name: overlaps with existing-skill
|
|
50
|
+
### Step 3: Evaluate New Skills
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
For each item in `skills.new`:
|
|
53
|
+
1. Read its `SKILL.md` from the `path` field in the report
|
|
54
|
+
2. Classify:
|
|
55
|
+
- **Useful**: Covers a distinct domain, well-structured, actionable content
|
|
56
|
+
- **Duplicate**: Similar skill already exists (check by name/description against skills-compact.json)
|
|
57
|
+
- **Skip**: Too niche, low quality, or just "be a senior X engineer" with no real content
|
|
58
|
+
3. In `--auto` mode: sync all useful, skip duplicates and low quality
|
|
59
|
+
4. In interactive mode: present summary and ask user using `AskUserQuestion`
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
1. Sync all useful (X skills)
|
|
55
|
-
2. Sync all useful + duplicates (X+Y skills)
|
|
56
|
-
3. Let me choose manually
|
|
61
|
+
Summary format:
|
|
57
62
|
```
|
|
63
|
+
Upstream sync found N new skills:
|
|
58
64
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
cp -r /tmp/devkit-sync/{source}/{skill-name} ./skills/{skill-name}
|
|
65
|
+
✅ Useful (X): skill-a, skill-b, ...
|
|
66
|
+
⚠️ Duplicate (Y): skill-c (overlaps existing-skill), ...
|
|
67
|
+
❌ Skip (Z): skill-d (reason), ...
|
|
65
68
|
```
|
|
66
69
|
|
|
67
|
-
### Step 5:
|
|
70
|
+
### Step 3.5: Evaluate Updated Skills
|
|
71
|
+
|
|
72
|
+
For each item in `skills.updated`:
|
|
73
|
+
1. Read **both** upstream SKILL.md (from tempDir) and local SKILL.md
|
|
74
|
+
2. Compare and summarize what changed
|
|
75
|
+
3. Classify:
|
|
76
|
+
- **Accept**: Upstream adds substantial new content (new sections, patterns, commands)
|
|
77
|
+
- **Skip**: Changes are trivial (formatting only) or local version is superior/customized
|
|
78
|
+
4. In `--auto` mode: accept all non-trivial updates
|
|
79
|
+
5. In interactive mode: present changes summary and ask user
|
|
80
|
+
|
|
81
|
+
### Step 4: Evaluate External Skills
|
|
82
|
+
|
|
83
|
+
For each item in `external-skills`:
|
|
84
|
+
1. Check if local skill exists (`localExists` field)
|
|
85
|
+
2. If exists:
|
|
86
|
+
a. Read `UPSTREAM.md` from `skills/{name}/UPSTREAM.md` for sync guide
|
|
87
|
+
b. Read the relevant `checkFiles` from `tempPath` in the report
|
|
88
|
+
c. Compare with local `SKILL.md`
|
|
89
|
+
d. Check version: if `upstreamVersion` differs from `localVersion` → needs update
|
|
90
|
+
e. Follow UPSTREAM.md guide: preserve devkit-specific sections, update upstream-derived content
|
|
91
|
+
f. Update `upstream-version` in SKILL.md frontmatter to `upstreamVersion` value
|
|
92
|
+
3. If not exists: report it as available but don't auto-create (manual setup needed)
|
|
93
|
+
4. In `--auto` mode: apply all detected changes following UPSTREAM.md rules
|
|
94
|
+
5. In interactive mode: show what changed and ask user
|
|
95
|
+
|
|
96
|
+
### Step 5: Evaluate Rules
|
|
97
|
+
|
|
98
|
+
For each item in `rules.new`:
|
|
99
|
+
1. Read the rule content from `path` field
|
|
100
|
+
2. Classify: useful (covers new pattern) or skip (duplicate/too generic)
|
|
101
|
+
3. In `--auto` mode: sync all useful
|
|
102
|
+
4. In interactive mode: ask user
|
|
103
|
+
|
|
104
|
+
For each item in `rules.updated`:
|
|
105
|
+
1. Compare upstream and local content
|
|
106
|
+
2. Accept meaningful updates, skip trivial ones
|
|
107
|
+
|
|
108
|
+
### Step 6: Apply Changes
|
|
109
|
+
|
|
110
|
+
If `--dry-run` → skip this step, just show what would be done.
|
|
111
|
+
|
|
112
|
+
For selected items:
|
|
113
|
+
- **New skills**: `node scripts/manual-sync.js --copy <name>` for each
|
|
114
|
+
- **Updated skills**: Read upstream SKILL.md, use Write tool to update local SKILL.md (preserve local customizations if any)
|
|
115
|
+
- **New rules**: `node scripts/manual-sync.js --copy <name>` for each
|
|
116
|
+
- **Updated rules**: Use Write tool to update local rule files
|
|
117
|
+
- **External skills**: Use Write tool to edit SKILL.md following UPSTREAM.md guide
|
|
118
|
+
|
|
119
|
+
### Step 7: Rebuild & Verify
|
|
68
120
|
|
|
69
121
|
```bash
|
|
70
122
|
npm run build
|
|
71
123
|
```
|
|
72
124
|
|
|
73
|
-
|
|
125
|
+
- If **success** → proceed to commit
|
|
126
|
+
- If **failure** → rollback ALL changes:
|
|
127
|
+
```bash
|
|
128
|
+
git checkout -- .
|
|
129
|
+
```
|
|
130
|
+
If stash was created: `git stash pop`
|
|
131
|
+
Report the build error and stop.
|
|
74
132
|
|
|
75
|
-
### Step
|
|
133
|
+
### Step 8: Commit
|
|
76
134
|
|
|
77
|
-
|
|
135
|
+
Stage and commit the changes:
|
|
78
136
|
```bash
|
|
79
|
-
git
|
|
137
|
+
git add skills/ rules/ merged-commands/ SKILLS_INDEX.md skills-index.json skills-compact.json rules-index.json
|
|
80
138
|
```
|
|
81
139
|
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
git commit -m "feat(skills): sync N new skills from upstream"
|
|
140
|
+
Commit message format:
|
|
141
|
+
```
|
|
142
|
+
feat(skills): sync N new, M updated skills from upstream
|
|
86
143
|
```
|
|
87
144
|
|
|
88
|
-
|
|
145
|
+
Adjust the message based on what was actually synced (skills, rules, external-skills).
|
|
89
146
|
|
|
90
|
-
|
|
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`)
|
|
147
|
+
If stash was created earlier: `git stash pop` to restore user's changes.
|
|
94
148
|
|
|
95
149
|
## Evaluation Criteria
|
|
96
150
|
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
|
|
151
|
+
### New Skills
|
|
152
|
+
- **Useful**: Covers distinct domain, well-structured SKILL.md, actionable patterns/commands
|
|
153
|
+
- **Duplicate**: Similar name or description to existing skill in skills-compact.json
|
|
154
|
+
- **Skip**: Too niche, low quality, just "be a senior X engineer" boilerplate
|
|
155
|
+
|
|
156
|
+
### Updated Skills
|
|
157
|
+
- **Accept**: Upstream adds substantial new content (new sections, patterns, examples)
|
|
158
|
+
- **Skip**: Changes are trivial (whitespace, formatting) or local version is customized and superior
|
|
159
|
+
|
|
160
|
+
### External Skills
|
|
161
|
+
- Follow UPSTREAM.md guide in each skill directory
|
|
162
|
+
- Always update version tracking
|
|
163
|
+
- Never overwrite devkit-specific frontmatter (`triggers`, `role`, `scope`, `output-format`)
|
|
164
|
+
|
|
165
|
+
### Rules
|
|
166
|
+
- **Accept**: Rule covers useful pattern not in existing rules
|
|
167
|
+
- **Skip**: Duplicate or too generic
|
|
102
168
|
|
|
103
169
|
## Important
|
|
104
170
|
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
171
|
+
- In interactive mode, **ALWAYS** ask before applying changes
|
|
172
|
+
- In `--auto` mode, proceed fully autonomously
|
|
173
|
+
- **ALWAYS** run `npm run build` after applying changes
|
|
174
|
+
- **ALWAYS** rollback on build failure via `git checkout -- .`
|
|
175
|
+
- Use `node scripts/manual-sync.js --copy` or Write tool for file operations — **NEVER** use `cp -r` (Windows incompatible)
|
|
176
|
+
- The temp directory path is in the JSON report's `tempDir` field
|
package/package.json
CHANGED
package/rules-index.json
CHANGED
package/skills/learn/SKILL.md
CHANGED
|
@@ -4,9 +4,9 @@ description: Guided project building — you code, AI mentors. Build your own pr
|
|
|
4
4
|
argument-hint: [topic]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Learn Mode v3.
|
|
7
|
+
# Learn Mode v3.1
|
|
8
8
|
|
|
9
|
-
> Build your product. Write every line. Understand every decision.
|
|
9
|
+
> Build your product. Design the architecture. Write every line. Understand every decision.
|
|
10
10
|
|
|
11
11
|
## Activation
|
|
12
12
|
|
|
@@ -93,11 +93,69 @@ Update frontmatter: `phase: LEARN`
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
## Phase 3:
|
|
96
|
+
## Phase 3: DESIGN (Socratic architecture thinking)
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
> User thinks first, AI guides — not the other way around.
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
1. **Frame the problem**: AI presents the high-level problem to solve:
|
|
101
|
+
> "We need to build {topic}. Before I suggest anything — how would YOU approach this? What components or pieces do you think we need?"
|
|
102
|
+
|
|
103
|
+
Ask via `AskUserQuestion`. Let user think and answer.
|
|
104
|
+
|
|
105
|
+
2. **Build on user's answer**:
|
|
106
|
+
- If user's approach is solid → acknowledge strengths, refine together
|
|
107
|
+
- If user's approach has gaps → ask guiding questions: "What about {concern}? How would you handle that?"
|
|
108
|
+
- If user has no idea → break it down: "Let's start smaller — what's the first thing a user would do with this feature?"
|
|
109
|
+
|
|
110
|
+
3. **Explore alternatives**: Present 2-3 different approaches with trade-offs:
|
|
111
|
+
> "Your approach uses X. Another option is Y. Here's how they compare:"
|
|
112
|
+
|
|
113
|
+
| Aspect | Approach A (user's) | Approach B | Approach C |
|
|
114
|
+
|--------|-------------------|-----------|-----------|
|
|
115
|
+
| Complexity | ... | ... | ... |
|
|
116
|
+
| Scalability | ... | ... | ... |
|
|
117
|
+
| Learning value | ... | ... | ... |
|
|
118
|
+
|
|
119
|
+
Ask user to choose via `AskUserQuestion`. Explain WHY each trade-off matters.
|
|
120
|
+
|
|
121
|
+
4. **Architecture decisions**: For the chosen approach, walk through key decisions:
|
|
122
|
+
- Data flow: how data moves through the system
|
|
123
|
+
- File/module structure: where code lives and why
|
|
124
|
+
- Dependencies: what libraries/tools and why those specifically
|
|
125
|
+
- Patterns: which design patterns and why (not just "use MVC" but why MVC fits here)
|
|
126
|
+
|
|
127
|
+
For each decision, ask user: "Does this make sense? Any concerns?"
|
|
128
|
+
|
|
129
|
+
5. **Write to tutorial file**: Record the design discussion, chosen approach, and rationale.
|
|
130
|
+
|
|
131
|
+
Update frontmatter: `phase: DESIGN`
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Phase 4: PLAN (concrete implementation steps)
|
|
136
|
+
|
|
137
|
+
1. **Break down the chosen design** into 3-7 concrete, verifiable steps. Each step should:
|
|
138
|
+
- Have a clear goal (what's done when this step is complete)
|
|
139
|
+
- Build on previous steps (incremental, testable progress)
|
|
140
|
+
- Be small enough to verify immediately
|
|
141
|
+
|
|
142
|
+
2. **Show plan to user** with rationale for the ordering:
|
|
143
|
+
> "Here's the build order. We start with X because Y depends on it. Step 3 before Step 4 because..."
|
|
144
|
+
|
|
145
|
+
3. **User validates**: Ask via `AskUserQuestion`:
|
|
146
|
+
> "Does this plan make sense? Want to reorder anything or add/remove steps?"
|
|
147
|
+
|
|
148
|
+
Adjust plan based on user feedback.
|
|
149
|
+
|
|
150
|
+
4. **Write plan to tutorial file**: Each step with goal, files involved, and acceptance criteria.
|
|
151
|
+
|
|
152
|
+
Update frontmatter: `phase: PLAN`, `total_steps: {N}`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Phase 5: BUILD (core phase)
|
|
157
|
+
|
|
158
|
+
1. **For each step from the PLAN phase, follow the teaching mode**:
|
|
101
159
|
|
|
102
160
|
### Guided Mode (user codes everything)
|
|
103
161
|
|
|
@@ -171,7 +229,7 @@ Update frontmatter: `phase: LEARN`
|
|
|
171
229
|
|
|
172
230
|
---
|
|
173
231
|
|
|
174
|
-
## Phase
|
|
232
|
+
## Phase 6: WRAP-UP
|
|
175
233
|
|
|
176
234
|
1. **Summary**: What was built, key takeaways (3-5 points)
|
|
177
235
|
|
|
@@ -209,6 +267,7 @@ Display: `Tutorial saved: learn/{filename}.md`
|
|
|
209
267
|
|
|
210
268
|
## Version History
|
|
211
269
|
|
|
270
|
+
- **3.1.0** - Added DESIGN phase (Socratic architecture) and PLAN phase (concrete steps). Full flow: INIT → LEARN → DESIGN → PLAN → BUILD → WRAP-UP
|
|
212
271
|
- **3.0.0** - Teaching modes (guided/scaffolded/demonstrated), best-practice review, explain-back checkpoints, user-codes-first philosophy
|
|
213
272
|
- **2.0.0** - Rewrite: adaptive difficulty via codingLevel, 4 phases, WebSearch, Socratic method, resume support, tiered verify, 17 languages, codebase-aware
|
|
214
273
|
- **1.0.0** - Initial release
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-doctor
|
|
3
|
+
description: Run react-doctor to scan React codebase for health issues. Diagnose security, performance, correctness, architecture problems with 0-100 score.
|
|
4
|
+
upstream: https://github.com/millionco/react-doctor
|
|
5
|
+
upstream-version: "0.0.0"
|
|
6
|
+
triggers:
|
|
7
|
+
- react-doctor
|
|
8
|
+
- react health
|
|
9
|
+
- react scan
|
|
10
|
+
- react lint
|
|
11
|
+
- code health
|
|
12
|
+
- react audit
|
|
13
|
+
- react score
|
|
14
|
+
role: tool
|
|
15
|
+
scope: diagnostics
|
|
16
|
+
output-format: analysis
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# React Doctor
|
|
20
|
+
|
|
21
|
+
Scan React codebase for security, performance, correctness, and architecture issues. Outputs a 0-100 health score with actionable diagnostics.
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
- After making React changes (catch issues early)
|
|
26
|
+
- During code review or PR review
|
|
27
|
+
- Finishing a feature before merge
|
|
28
|
+
- Periodic codebase health check
|
|
29
|
+
- Setting up CI quality gates
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Full scan with file details
|
|
35
|
+
npx -y react-doctor@latest . --verbose
|
|
36
|
+
|
|
37
|
+
# Scan only changed files (vs base branch)
|
|
38
|
+
npx -y react-doctor@latest . --verbose --diff
|
|
39
|
+
|
|
40
|
+
# Score only (for CI)
|
|
41
|
+
npx -y react-doctor@latest . --score
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## How It Works
|
|
45
|
+
|
|
46
|
+
Detects framework (Next.js, Vite, Remix, etc.), React version, and compiler setup, then runs two parallel passes:
|
|
47
|
+
|
|
48
|
+
1. **Lint** — 60+ rules across 8 categories
|
|
49
|
+
2. **Dead code** — unused files, exports, types, duplicates
|
|
50
|
+
|
|
51
|
+
## Rule Categories
|
|
52
|
+
|
|
53
|
+
| Category | Examples |
|
|
54
|
+
|----------|----------|
|
|
55
|
+
| State & Effects | missing deps, stale closures, unnecessary re-renders |
|
|
56
|
+
| Performance | unoptimized renders, missing memoization, large bundles |
|
|
57
|
+
| Architecture | circular deps, prop drilling, god components |
|
|
58
|
+
| Bundle Size | unused imports, heavy dependencies |
|
|
59
|
+
| Security | dangerouslySetInnerHTML, XSS vectors |
|
|
60
|
+
| Correctness | key prop misuse, effect cleanup, race conditions |
|
|
61
|
+
| Accessibility | missing ARIA, no-autofocus, semantic HTML |
|
|
62
|
+
| Framework-specific | Next.js patterns, React Native issues |
|
|
63
|
+
|
|
64
|
+
## CLI Flags
|
|
65
|
+
|
|
66
|
+
| Flag | Description |
|
|
67
|
+
|------|-------------|
|
|
68
|
+
| `--verbose` | Show file details and line numbers per rule |
|
|
69
|
+
| `--no-lint` | Skip linting |
|
|
70
|
+
| `--no-dead-code` | Skip dead code detection |
|
|
71
|
+
| `--score` | Output only the score |
|
|
72
|
+
| `--diff [base]` | Scan only files changed vs base branch |
|
|
73
|
+
| `--project <name>` | Select workspace project (comma-separated) |
|
|
74
|
+
| `-y, --yes` | Skip prompts, scan all workspace projects |
|
|
75
|
+
| `--fix` | Open Ami to auto-fix all issues |
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
Create `react-doctor.config.json` at project root:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"ignore": {
|
|
84
|
+
"rules": ["react/no-danger", "knip/exports"],
|
|
85
|
+
"files": ["src/generated/**"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or use `"reactDoctor"` key in `package.json`. Config file takes precedence.
|
|
91
|
+
|
|
92
|
+
| Key | Type | Default | Description |
|
|
93
|
+
|-----|------|---------|-------------|
|
|
94
|
+
| `ignore.rules` | `string[]` | `[]` | Rules to suppress (`plugin/rule` format) |
|
|
95
|
+
| `ignore.files` | `string[]` | `[]` | File globs to exclude |
|
|
96
|
+
| `lint` | `boolean` | `true` | Enable/disable lint checks |
|
|
97
|
+
| `deadCode` | `boolean` | `true` | Enable/disable dead code detection |
|
|
98
|
+
| `verbose` | `boolean` | `false` | Show file details per rule |
|
|
99
|
+
| `diff` | `boolean\|string` | — | Force diff mode or pin base branch |
|
|
100
|
+
|
|
101
|
+
## Node.js API
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
import { diagnose } from "react-doctor/api";
|
|
105
|
+
const result = await diagnose(".", { lint: true, deadCode: true });
|
|
106
|
+
// result.score → { score: 82, label: "Good" }
|
|
107
|
+
// result.diagnostics → Array of { filePath, plugin, rule, severity, message, help, line, column, category }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Workflow
|
|
111
|
+
|
|
112
|
+
1. **Run scan** → `npx -y react-doctor@latest . --verbose`
|
|
113
|
+
2. **Read score** → 75+ Great, 50-74 Needs work, <50 Critical
|
|
114
|
+
3. **Fix errors first** → errors weigh more than warnings
|
|
115
|
+
4. **Re-run** → verify score improved
|
|
116
|
+
5. **Iterate** → address warnings if time permits
|
|
117
|
+
|
|
118
|
+
## Scoring
|
|
119
|
+
|
|
120
|
+
- **75-100** — Great health
|
|
121
|
+
- **50-74** — Needs work
|
|
122
|
+
- **0-49** — Critical issues
|
|
123
|
+
- Errors weigh more than warnings in score calculation
|
|
124
|
+
|
|
125
|
+
## GitHub Actions
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
- uses: millionco/react-doctor@main
|
|
129
|
+
with:
|
|
130
|
+
diff: main
|
|
131
|
+
verbose: true
|
|
132
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Posts findings as PR comment when `github-token` is set on `pull_request` events.
|
|
136
|
+
|
|
137
|
+
## Related Skills
|
|
138
|
+
|
|
139
|
+
- **react-expert** — Fix identified React issues
|
|
140
|
+
- **code-review** — Include react-doctor scan in reviews
|
|
141
|
+
- **test-master** — Dead code findings inform test coverage gaps
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# React Doctor — Upstream Sync Guide
|
|
2
|
+
|
|
3
|
+
## Source
|
|
4
|
+
|
|
5
|
+
- Repo: https://github.com/millionco/react-doctor
|
|
6
|
+
- NPM: `react-doctor`
|
|
7
|
+
- Key files: `install-skill.sh`, `README.md`, `package.json`
|
|
8
|
+
|
|
9
|
+
## What to Check During Sync
|
|
10
|
+
|
|
11
|
+
### 1. Version bump
|
|
12
|
+
- Check `package.json` → `version` field in cloned repo
|
|
13
|
+
- Compare with `upstream-version` in `SKILL.md` frontmatter
|
|
14
|
+
- If changed → update frontmatter
|
|
15
|
+
|
|
16
|
+
### 2. Skill content changes
|
|
17
|
+
- Read `install-skill.sh` → find `SKILL_CONTENT` heredoc block
|
|
18
|
+
- Compare with our `SKILL.md` body sections
|
|
19
|
+
- If they added new instructions → integrate into relevant section
|
|
20
|
+
|
|
21
|
+
### 3. New rules or categories
|
|
22
|
+
- Read `README.md` "How it works" section
|
|
23
|
+
- Check if rule count changed (currently 60+)
|
|
24
|
+
- Check if new categories added beyond current 8
|
|
25
|
+
- Update "Rule Categories" table if changed
|
|
26
|
+
|
|
27
|
+
### 4. CLI flag changes
|
|
28
|
+
- Read `README.md` "Options" section
|
|
29
|
+
- Compare with "CLI Flags" table in SKILL.md
|
|
30
|
+
- Add/remove/update flags as needed
|
|
31
|
+
|
|
32
|
+
### 5. Config format changes
|
|
33
|
+
- Read `README.md` "Configuration" section
|
|
34
|
+
- Compare with "Configuration" section in SKILL.md
|
|
35
|
+
- Check for new config keys
|
|
36
|
+
|
|
37
|
+
### 6. GitHub Actions changes
|
|
38
|
+
- Read `README.md` "GitHub Actions" section
|
|
39
|
+
- Compare with "GitHub Actions" section in SKILL.md
|
|
40
|
+
|
|
41
|
+
## What to Preserve (Never Overwrite from Upstream)
|
|
42
|
+
|
|
43
|
+
- YAML frontmatter: `triggers`, `role`, `scope`, `output-format`
|
|
44
|
+
- "When to Use" section (devkit-tailored context)
|
|
45
|
+
- "Related Skills" section (devkit-specific references)
|
|
46
|
+
- "Workflow" section (devkit-enhanced steps)
|
|
47
|
+
|
|
48
|
+
## What to Update (From Upstream)
|
|
49
|
+
|
|
50
|
+
- `upstream-version` in frontmatter
|
|
51
|
+
- CLI flags if changed
|
|
52
|
+
- Rule categories if new ones added
|
|
53
|
+
- Config format if changed
|
|
54
|
+
- Quick Start commands if changed
|
|
55
|
+
- GitHub Actions usage if changed
|
|
56
|
+
- Node.js API if changed
|
|
57
|
+
|
|
58
|
+
## Update Checklist
|
|
59
|
+
|
|
60
|
+
1. `npm run sync:upstream` — clones react-doctor repo to temp
|
|
61
|
+
2. Check report output for react-doctor section
|
|
62
|
+
3. Read cloned files listed in report
|
|
63
|
+
4. Compare with current `SKILL.md` using sections above
|
|
64
|
+
5. Update `SKILL.md` if changes found
|
|
65
|
+
6. Update `upstream-version` in frontmatter
|
|
66
|
+
7. `npm run build` — rebuild indexes
|
|
67
|
+
8. Verify: `react-doctor` still in `skills-compact.json`
|
|
68
|
+
9. Commit and push
|
package/skills-index.json
CHANGED
|
@@ -2734,6 +2734,11 @@
|
|
|
2734
2734
|
"path": "skills/react-best-practices",
|
|
2735
2735
|
"description": "React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patter"
|
|
2736
2736
|
},
|
|
2737
|
+
{
|
|
2738
|
+
"name": "react-doctor",
|
|
2739
|
+
"path": "skills/react-doctor",
|
|
2740
|
+
"description": "Run react-doctor to scan React codebase for health issues. Diagnose security, performance, correctness, architecture problems with 0-100 score."
|
|
2741
|
+
},
|
|
2737
2742
|
{
|
|
2738
2743
|
"name": "react-expert",
|
|
2739
2744
|
"path": "skills/react-expert",
|