@nano-step/skill-manager 5.6.1 → 5.7.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/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/private-catalog.json +7 -2
- package/skills/deep-design/SKILL.md +402 -0
- package/skills/deep-design/evals/evals.json +23 -0
- package/skills/deep-design/skill.json +7 -0
- package/skills/feature-analysis/SKILL.md +290 -0
- package/skills/feature-analysis/skill.json +15 -0
- package/skills/nano-brain/skill.json +7 -0
- package/skills/pr-code-reviewer/CHANGELOG.md +329 -0
- package/skills/pr-code-reviewer/RESEARCH.md +60 -0
- package/skills/pr-code-reviewer/SKILL.md +537 -0
- package/skills/pr-code-reviewer/assets/config.json +60 -0
- package/skills/pr-code-reviewer/checklists/backend-express.md +357 -0
- package/skills/pr-code-reviewer/checklists/ci-cd.md +428 -0
- package/skills/pr-code-reviewer/checklists/consumer-search-matrix.md +339 -0
- package/skills/pr-code-reviewer/checklists/database.md +382 -0
- package/skills/pr-code-reviewer/checklists/frontend-vue-nuxt.md +426 -0
- package/skills/pr-code-reviewer/checklists/review-checklist.md +149 -0
- package/skills/pr-code-reviewer/references/checkpoint-system.md +58 -0
- package/skills/pr-code-reviewer/references/confidence-scoring.md +98 -0
- package/skills/pr-code-reviewer/references/framework-rules/express.md +39 -0
- package/skills/pr-code-reviewer/references/framework-rules/nestjs.md +41 -0
- package/skills/pr-code-reviewer/references/framework-rules/nextjs.md +58 -0
- package/skills/pr-code-reviewer/references/framework-rules/prisma.md +54 -0
- package/skills/pr-code-reviewer/references/framework-rules/react.md +61 -0
- package/skills/pr-code-reviewer/references/framework-rules/typeorm.md +52 -0
- package/skills/pr-code-reviewer/references/framework-rules/typescript.md +50 -0
- package/skills/pr-code-reviewer/references/framework-rules/vue-nuxt.md +53 -0
- package/skills/pr-code-reviewer/references/nano-brain-integration.md +46 -0
- package/skills/pr-code-reviewer/references/performance-patterns.md +26 -0
- package/skills/pr-code-reviewer/references/quality-patterns.md +25 -0
- package/skills/pr-code-reviewer/references/report-template.md +172 -0
- package/skills/pr-code-reviewer/references/security-patterns.md +31 -0
- package/skills/pr-code-reviewer/references/setup-wizard.md +207 -0
- package/skills/pr-code-reviewer/references/subagent-prompts.md +344 -0
- package/skills/pr-code-reviewer/references/verification-protocol.md +56 -0
- package/skills/pr-code-reviewer/skill.json +15 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Report Template
|
|
2
|
+
|
|
3
|
+
Save to `.opencode/reviews/{type}_{identifier}_{date}.md`.
|
|
4
|
+
Create `.opencode/reviews/` if it does not exist.
|
|
5
|
+
|
|
6
|
+
## Design Principle
|
|
7
|
+
|
|
8
|
+
**Short and meaningful.** People don't read long reports. Every section must earn its place.
|
|
9
|
+
|
|
10
|
+
- Critical + Warning = full detail (file, line, impact, fix)
|
|
11
|
+
- Improvements = one-liner with code suggestion
|
|
12
|
+
- Suggestions = count only (or brief list if < 3)
|
|
13
|
+
- Empty sections = omit entirely
|
|
14
|
+
- TL;DR at the top so the reader can stop after 3 lines if everything is clean
|
|
15
|
+
|
|
16
|
+
## Template
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
# Code Review: PR #{number} — {pr_title}
|
|
20
|
+
|
|
21
|
+
## TL;DR
|
|
22
|
+
|
|
23
|
+
**{APPROVE | REQUEST CHANGES | COMMENT}** — {one sentence reason}
|
|
24
|
+
|
|
25
|
+
| Critical | Warnings | Improvements | Suggestions |
|
|
26
|
+
|----------|----------|--------------|-------------|
|
|
27
|
+
| {count} | {count} | {count} | {count} |
|
|
28
|
+
|
|
29
|
+
{If Phase 4.5 dropped findings: "🔍 Verification: {N} finding(s) dropped as false positives"}
|
|
30
|
+
{If Phase 4.5 verified all findings: "🔍 All findings verified"}
|
|
31
|
+
{If Phase 4.5 was skipped (no critical/warning): omit this line entirely}
|
|
32
|
+
|
|
33
|
+
📊 **Result Confidence: {emoji} {score}/100**
|
|
34
|
+
Accuracy: {accuracy_rate}% ({false_positives} false positive(s) caught) | Consensus: {consensus_rate}% | Evidence: {evidence_rate}%
|
|
35
|
+
{If score < 80: "⚠️ {gate_message}"}
|
|
36
|
+
{If score >= 80: omit the warning line}
|
|
37
|
+
|
|
38
|
+
## What This PR Does
|
|
39
|
+
|
|
40
|
+
{1-3 sentences. Start with action verb. Include business impact if clear.}
|
|
41
|
+
|
|
42
|
+
**Key Changes:**
|
|
43
|
+
- **{category}**: {brief description}
|
|
44
|
+
- **{category}**: {brief description}
|
|
45
|
+
|
|
46
|
+
## Ticket Alignment
|
|
47
|
+
|
|
48
|
+
> Only included when a Linear ticket is linked. Omit entirely if no ticket found.
|
|
49
|
+
|
|
50
|
+
**Ticket**: [{ticket_id}]({linear_url}) — {ticket_title}
|
|
51
|
+
**Status**: {ticket_status} | **Priority**: {ticket_priority}
|
|
52
|
+
|
|
53
|
+
### Acceptance Criteria Coverage
|
|
54
|
+
|
|
55
|
+
| # | Criteria | Status | Notes |
|
|
56
|
+
|---|----------|--------|-------|
|
|
57
|
+
| 1 | {criteria_text} | ✅ Met / ⚠️ Partial / ❌ Missing | {brief note} |
|
|
58
|
+
|
|
59
|
+
{If all criteria met: "All acceptance criteria addressed."}
|
|
60
|
+
{If gaps found: "**{count} criteria not fully addressed** — see details above."}
|
|
61
|
+
{If criteria are ambiguous: "⚠️ **Ambiguous acceptance criteria** — '{original_text}' can be interpreted as: (a) {interpretation_1}, (b) {interpretation_2}. This PR implements interpretation (a/b). Verify with ticket author."}
|
|
62
|
+
|
|
63
|
+
## Premise Check (DELETION changes only)
|
|
64
|
+
|
|
65
|
+
> Only included when the PR deletes existing behavior. Omit for additions/modifications.
|
|
66
|
+
|
|
67
|
+
| Question | Answer |
|
|
68
|
+
|----------|--------|
|
|
69
|
+
| Why was this code added originally? | {reason} |
|
|
70
|
+
| Is the underlying problem solved? | {yes/no — explanation} |
|
|
71
|
+
| Would fixing the logic be more correct? | {yes/no — explanation} |
|
|
72
|
+
| Cross-repo implications? | {backend config, API contracts, etc.} |
|
|
73
|
+
|
|
74
|
+
**Verdict**: {REMOVAL CORRECT / SHOULD FIX INSTEAD / NEEDS CLARIFICATION}
|
|
75
|
+
|
|
76
|
+
## Critical Issues (MUST FIX)
|
|
77
|
+
|
|
78
|
+
### 1. {Title}
|
|
79
|
+
**`{file}:{line}`** | {Security/Logic/Performance}
|
|
80
|
+
{What's wrong and what could go wrong.}
|
|
81
|
+
**Fix:** {Concrete suggestion or code snippet}
|
|
82
|
+
|
|
83
|
+
### 2. {Title}
|
|
84
|
+
...
|
|
85
|
+
|
|
86
|
+
## Warnings (SHOULD FIX)
|
|
87
|
+
|
|
88
|
+
### 1. {Title}
|
|
89
|
+
**`{file}:{line}`** | {Category}
|
|
90
|
+
{Issue description.}
|
|
91
|
+
**Fix:** {Suggestion}
|
|
92
|
+
|
|
93
|
+
## Code Improvements
|
|
94
|
+
|
|
95
|
+
> Opportunities to make the code better — cleaner, faster, more idiomatic.
|
|
96
|
+
|
|
97
|
+
- **`{file}:{line}`** — {description}. Consider: `{code_suggestion}`
|
|
98
|
+
- **`{file}:{line}`** — {description}
|
|
99
|
+
|
|
100
|
+
## Suggestions ({count})
|
|
101
|
+
|
|
102
|
+
{If ≤ 3, list as one-liners. If > 3, just show the count.}
|
|
103
|
+
|
|
104
|
+
- `{file}:{line}` — {brief}
|
|
105
|
+
|
|
106
|
+
## Files Changed
|
|
107
|
+
|
|
108
|
+
| File | Type | Summary |
|
|
109
|
+
|------|------|---------|
|
|
110
|
+
| `{path}` | {LOGIC/DELETION/STYLE/REFACTOR/NEW} | {one-liner} |
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Sections to OMIT unless they contain actionable findings:**
|
|
114
|
+
- Traced Dependencies
|
|
115
|
+
- nano-brain Memory Context
|
|
116
|
+
- Test Coverage Analysis
|
|
117
|
+
- Praise (include only if genuinely noteworthy — one line max)
|
|
118
|
+
- Change Classification table
|
|
119
|
+
|
|
120
|
+
## PR Summary Generation Guidelines
|
|
121
|
+
|
|
122
|
+
### What This PR Does (1-3 sentences)
|
|
123
|
+
- Start with action verb: "Adds", "Fixes", "Refactors", "Updates"
|
|
124
|
+
- Mention the feature/bug/improvement
|
|
125
|
+
- Include business impact if clear
|
|
126
|
+
|
|
127
|
+
### Key Changes categories
|
|
128
|
+
- `Feature`: New functionality
|
|
129
|
+
- `Bugfix`: Fixes broken behavior
|
|
130
|
+
- `Refactor`: Code restructuring without behavior change
|
|
131
|
+
- `Performance`: Speed/memory improvements
|
|
132
|
+
- `Security`: Security fixes or hardening
|
|
133
|
+
- `Docs`: Documentation updates
|
|
134
|
+
- `Tests`: Test additions/modifications
|
|
135
|
+
- `Config`: Configuration changes
|
|
136
|
+
- `Dependencies`: Package updates
|
|
137
|
+
|
|
138
|
+
### File-by-File Summary
|
|
139
|
+
- **What changed**: Factual description of the code change
|
|
140
|
+
- **Why it matters**: Impact on users, developers, or system
|
|
141
|
+
- **Key modifications**: Specific functions/classes/lines changed
|
|
142
|
+
|
|
143
|
+
## PR Summary Pseudocode
|
|
144
|
+
|
|
145
|
+
```javascript
|
|
146
|
+
// Generate PR Summary (GitHub Copilot style)
|
|
147
|
+
const prSummary = `
|
|
148
|
+
## PR Overview
|
|
149
|
+
|
|
150
|
+
### What This PR Does
|
|
151
|
+
${generateHighLevelSummary(prMetadata, changedFiles)}
|
|
152
|
+
|
|
153
|
+
### Key Changes
|
|
154
|
+
${categorizeChanges(changedFiles).map(c => `- **${c.category}**: ${c.description}`).join('\n')}
|
|
155
|
+
|
|
156
|
+
## File-by-File Summary
|
|
157
|
+
|
|
158
|
+
| File | Change Type | Summary |
|
|
159
|
+
|------|-------------|---------|
|
|
160
|
+
${changedFiles.map(f => `| \`${f.path}\` | ${f.changeType} | ${f.oneLinerSummary} |`).join('\n')}
|
|
161
|
+
|
|
162
|
+
### Detailed File Changes
|
|
163
|
+
|
|
164
|
+
${changedFiles.map(f => `
|
|
165
|
+
#### \`${f.path}\` (+${f.additions}/-${f.deletions})
|
|
166
|
+
**What changed**: ${f.whatChanged}
|
|
167
|
+
**Why it matters**: ${f.whyItMatters}
|
|
168
|
+
**Key modifications**:
|
|
169
|
+
${f.keyModifications.map(m => `- ${m}`).join('\n')}
|
|
170
|
+
`).join('\n')}
|
|
171
|
+
`;
|
|
172
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Security Patterns
|
|
2
|
+
|
|
3
|
+
## OWASP Top 10 Detection
|
|
4
|
+
|
|
5
|
+
### 1. Injection
|
|
6
|
+
```javascript
|
|
7
|
+
// CRITICAL: SQL Injection
|
|
8
|
+
const query = `SELECT * FROM users WHERE id = ${userId}`;
|
|
9
|
+
|
|
10
|
+
// SECURE: Parameterized query
|
|
11
|
+
const query = 'SELECT * FROM users WHERE id = ?';
|
|
12
|
+
await db.query(query, [userId]);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Broken Authentication
|
|
16
|
+
```javascript
|
|
17
|
+
// CRITICAL: Weak hashing
|
|
18
|
+
crypto.createHash('md5').update(password);
|
|
19
|
+
|
|
20
|
+
// SECURE: Strong hashing
|
|
21
|
+
bcrypt.hash(password, 12);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 3. XSS
|
|
25
|
+
```javascript
|
|
26
|
+
// CRITICAL: Direct HTML insertion
|
|
27
|
+
element.innerHTML = userInput;
|
|
28
|
+
|
|
29
|
+
// SECURE: Text content
|
|
30
|
+
element.textContent = userInput;
|
|
31
|
+
```
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Setup Wizard (Phase -2)
|
|
2
|
+
|
|
3
|
+
Runs once when no `.opencode/code-reviewer.json` exists, or when user runs `/review --setup`.
|
|
4
|
+
|
|
5
|
+
## Wizard Flow
|
|
6
|
+
|
|
7
|
+
Ask each question conversationally. Accept number or name. If the user says "both" or lists multiple, select all that apply.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
### Question 1: Frontend framework
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
What frontend framework does this project use?
|
|
15
|
+
|
|
16
|
+
1. Nuxt 3
|
|
17
|
+
2. Next.js
|
|
18
|
+
3. Vue 3 (SPA, no SSR)
|
|
19
|
+
4. React (CRA / Vite)
|
|
20
|
+
5. None (API-only project)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
→ Maps to `stack.frontend`: `"nuxt"` | `"nextjs"` | `"vue"` | `"react"` | `null`
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Question 2: Backend framework
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
What backend framework?
|
|
31
|
+
|
|
32
|
+
1. Express
|
|
33
|
+
2. NestJS
|
|
34
|
+
3. Fastify
|
|
35
|
+
4. None (frontend-only project)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
→ Maps to `stack.backend`: `"express"` | `"nestjs"` | `"fastify"` | `null`
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Question 3: ORM / database access
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
How does the project access the database?
|
|
46
|
+
|
|
47
|
+
1. TypeORM
|
|
48
|
+
2. Prisma
|
|
49
|
+
3. Sequelize
|
|
50
|
+
4. Raw SQL / query builder
|
|
51
|
+
5. No database
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
→ Maps to `stack.orm`: `"typeorm"` | `"prisma"` | `"sequelize"` | `"raw"` | `null`
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### Question 4: Language
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
TypeScript, JavaScript, or mixed?
|
|
62
|
+
|
|
63
|
+
1. TypeScript (strict)
|
|
64
|
+
2. TypeScript (loose / partial)
|
|
65
|
+
3. JavaScript
|
|
66
|
+
4. Mixed
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
→ Maps to `stack.language`: `"typescript-strict"` | `"typescript"` | `"javascript"` | `"mixed"`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Question 5: State management (skip if backend-only)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Frontend state management?
|
|
77
|
+
|
|
78
|
+
1. Pinia
|
|
79
|
+
2. Vuex
|
|
80
|
+
3. Redux / Zustand
|
|
81
|
+
4. React hooks only
|
|
82
|
+
5. None / not applicable
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
→ Maps to `stack.state`: `"pinia"` | `"vuex"` | `"redux"` | `"hooks"` | `null`
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
### Question 6: Agent knowledge base
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Does your workspace have an AGENTS.md or a .agents/ knowledge folder?
|
|
95
|
+
|
|
96
|
+
1. Yes — I have AGENTS.md + .agents/ folder at workspace root
|
|
97
|
+
2. Yes — I have only AGENTS.md (no .agents/ folder)
|
|
98
|
+
3. No — I don't have any of these
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If yes:
|
|
102
|
+
- Ask for the **workspace root path** (the folder that contains all repos).
|
|
103
|
+
Example: `/Users/tamlh/workspaces/NUSTechnology/Projects/zengamingx`
|
|
104
|
+
- Auto-detect by going one level up from the current repo and checking for `AGENTS.md`.
|
|
105
|
+
- Verify: check if `.agents/_repos/` and `.agents/_domains/` directories exist.
|
|
106
|
+
|
|
107
|
+
→ Maps to `agents.workspace_root`, `agents.has_repos_dir`, `agents.has_domains_dir`
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Saving the Config
|
|
112
|
+
|
|
113
|
+
After all questions, write `.opencode/code-reviewer.json`:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"version": "3.3.0",
|
|
118
|
+
"stack": {
|
|
119
|
+
"frontend": "nuxt",
|
|
120
|
+
"backend": "express",
|
|
121
|
+
"orm": "typeorm",
|
|
122
|
+
"language": "typescript",
|
|
123
|
+
"state": "pinia"
|
|
124
|
+
},
|
|
125
|
+
"agents": {
|
|
126
|
+
"workspace_root": "/Users/tamlh/workspaces/NUSTechnology/Projects/zengamingx",
|
|
127
|
+
"has_agents_md": true,
|
|
128
|
+
"has_repos_dir": true,
|
|
129
|
+
"has_domains_dir": true
|
|
130
|
+
},
|
|
131
|
+
"workspace": {
|
|
132
|
+
"name": "",
|
|
133
|
+
"github": {
|
|
134
|
+
"owner": "",
|
|
135
|
+
"default_base": "main"
|
|
136
|
+
},
|
|
137
|
+
"linear": {
|
|
138
|
+
"enabled": true,
|
|
139
|
+
"extract_from": ["branch_name", "pr_description", "pr_title"],
|
|
140
|
+
"fetch_comments": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"output": {
|
|
144
|
+
"directory": ".opencode/reviews",
|
|
145
|
+
"filename_pattern": "{type}_{identifier}_{date}"
|
|
146
|
+
},
|
|
147
|
+
"report": {
|
|
148
|
+
"verbosity": "compact",
|
|
149
|
+
"show_suggestions": false,
|
|
150
|
+
"show_improvements": true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then show a confirmation:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
✅ Setup complete! Code reviewer configured for:
|
|
159
|
+
Frontend: Nuxt 3
|
|
160
|
+
Backend: Express
|
|
161
|
+
ORM: TypeORM
|
|
162
|
+
Language: TypeScript
|
|
163
|
+
State: Pinia
|
|
164
|
+
|
|
165
|
+
Knowledge base:
|
|
166
|
+
✅ AGENTS.md found at workspace root
|
|
167
|
+
✅ .agents/_repos/ — 37 repo files
|
|
168
|
+
✅ .agents/_domains/ — 7 domain files
|
|
169
|
+
|
|
170
|
+
Framework rules that will be applied:
|
|
171
|
+
• references/framework-rules/vue-nuxt.md
|
|
172
|
+
• references/framework-rules/express.md
|
|
173
|
+
• references/framework-rules/typeorm.md
|
|
174
|
+
• references/framework-rules/typescript.md
|
|
175
|
+
|
|
176
|
+
Config saved to: .opencode/code-reviewer.json
|
|
177
|
+
Run /review PR#123 to start your first review.
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Framework Rule File Mapping
|
|
183
|
+
|
|
184
|
+
| Stack value | Rule file | Applies to agent |
|
|
185
|
+
|-------------|-----------|-----------------|
|
|
186
|
+
| `frontend: "nuxt"` or `"vue"` | `framework-rules/vue-nuxt.md` | Quality + Security |
|
|
187
|
+
| `frontend: "nextjs"` | `framework-rules/nextjs.md` | Quality + Security |
|
|
188
|
+
| `frontend: "react"` | `framework-rules/react.md` | Quality + Security |
|
|
189
|
+
| `backend: "express"` | `framework-rules/express.md` | Security + Quality |
|
|
190
|
+
| `backend: "nestjs"` | `framework-rules/nestjs.md` | Security + Quality |
|
|
191
|
+
| `orm: "typeorm"` | `framework-rules/typeorm.md` | Security + Quality |
|
|
192
|
+
| `orm: "prisma"` | `framework-rules/prisma.md` | Security + Quality |
|
|
193
|
+
| `language: "typescript*"` | `framework-rules/typescript.md` | Quality |
|
|
194
|
+
|
|
195
|
+
Load ONLY the files that match the configured stack. Do not load all framework rules.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Re-running Setup
|
|
200
|
+
|
|
201
|
+
Users can reset at any time:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
/review --setup
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
This overwrites `.opencode/code-reviewer.json` entirely. Warn the user before overwriting existing config.
|