ccsetup 1.2.0 → 1.2.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/README.md +93 -24
- package/bin/create-project.js +373 -773
- package/lib/templates/README.md +2 -2
- package/lib/templates/metadata/agents.json +1 -1
- package/package.json +3 -2
- package/template/.claude/settings.json +18 -1
- package/template/.claude/skills/codex-review/SKILL.md +139 -0
- package/template/.claude/skills/secops/SKILL.md +259 -0
- package/template/.codex/skills/codex-review/SKILL.md +139 -0
- package/template/.codex/skills/prd/SKILL.md +343 -0
- package/template/.codex/skills/ralph/SKILL.md +339 -0
- package/template/AGENTS.md +43 -0
- package/template/CLAUDE.md +106 -4
- package/template/docs/codex-setup.md +32 -0
- package/template/hooks/codex-review/index.js +105 -0
- package/template/scripts/codex-review/codex-review.sh +266 -0
- package/template/scripts/ralph/CODEX.md +76 -0
- package/template/scripts/ralph/ralph.sh +32 -9
- package/bin/lib/contextGenerator.js +0 -287
- package/bin/lib/scanner/index.js +0 -28
- package/bin/scan.js +0 -367
- package/lib/aiMergeHelper.js +0 -112
- package/lib/contextGenerator.js +0 -574
- package/lib/contextMerger.js +0 -812
- package/lib/progressReporter.js +0 -88
- package/lib/scanConfig.js +0 -200
- package/lib/scanner/fileAnalyzer.js +0 -605
- package/lib/scanner/index.js +0 -164
- package/lib/scanner/patterns.js +0 -277
- package/lib/scanner/projectDetector.js +0 -147
package/lib/templates/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Template Catalog System
|
|
2
2
|
|
|
3
|
-
The template catalog system provides a powerful foundation for browsing, filtering, and selecting from ccsetup's collection of
|
|
3
|
+
The template catalog system provides a powerful foundation for browsing, filtering, and selecting from ccsetup's collection of 8 core agent templates. This system implements Phase 1 of the template selection feature as outlined in PLAN-009.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ The template catalog system consists of:
|
|
|
25
25
|
- Caching for performance
|
|
26
26
|
|
|
27
27
|
### Generated Metadata (`metadata/agents.json`)
|
|
28
|
-
- Contains metadata for all
|
|
28
|
+
- Contains metadata for all 8 agents
|
|
29
29
|
- Organized by categories: Development, Backend, Planning, AI/ML, etc.
|
|
30
30
|
- Includes tags, tools, examples, and workflows for each agent
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccsetup",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Interactive setup for Claude Code projects with smart context scanning, merge strategies, 8 core agents, and orchestration workflows",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ccsetup": "bin/create-project.js"
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"jest": "^30.0.5"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
-
"test": "jest",
|
|
48
|
+
"test": "jest --testPathIgnorePatterns integration",
|
|
49
|
+
"test:integration": "jest --testPathPatterns integration",
|
|
49
50
|
"test:watch": "jest --watch",
|
|
50
51
|
"test:coverage": "jest --coverage",
|
|
51
52
|
"metadata:generate": "node scripts/generate-metadata.js",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(osv-scanner scan:*)",
|
|
5
|
+
"Bash(osv-scanner:*)"
|
|
6
|
+
]
|
|
7
|
+
},
|
|
2
8
|
"hooks": {
|
|
3
9
|
"UserPromptSubmit": [
|
|
4
10
|
{
|
|
@@ -10,6 +16,17 @@
|
|
|
10
16
|
}
|
|
11
17
|
]
|
|
12
18
|
}
|
|
19
|
+
],
|
|
20
|
+
"Stop": [
|
|
21
|
+
{
|
|
22
|
+
"matcher": ".*",
|
|
23
|
+
"hooks": [
|
|
24
|
+
{
|
|
25
|
+
"type": "command",
|
|
26
|
+
"command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/codex-review/index.js"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
13
30
|
]
|
|
14
31
|
}
|
|
15
|
-
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-review
|
|
3
|
+
description: "Get a second-opinion review from Codex CLI. Auto-detects: plan review, implementation review (plan + code changes), or code review (just changes). Runs up to 3 feedback iterations. Triggers on: codex review, second opinion, review this plan, review my code, review implementation, validate changes, codex feedback, code review."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Review — Plan, Implementation, and Code Review
|
|
7
|
+
|
|
8
|
+
Get a review from OpenAI's Codex CLI. The script auto-detects what to review based on context:
|
|
9
|
+
|
|
10
|
+
- **Plan review** — when a plan file is provided and no git changes exist
|
|
11
|
+
- **Implementation review** — when a plan file is provided and git changes exist (validates code against the plan)
|
|
12
|
+
- **Code review** — when no plan file is provided but git changes exist
|
|
13
|
+
|
|
14
|
+
Iterates up to 3 times, refining based on feedback.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## The Job
|
|
19
|
+
|
|
20
|
+
1. Determine what to review based on user intent and context
|
|
21
|
+
2. Find a plan file if needed (or skip for pure code review)
|
|
22
|
+
3. Call the review script
|
|
23
|
+
4. Present feedback, iterate up to 3 times
|
|
24
|
+
|
|
25
|
+
**Important:** This skill requires the `codex` CLI to be installed (`npm install -g @openai/codex`) and an OpenAI API key configured.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Step 1: Determine Review Type
|
|
30
|
+
|
|
31
|
+
Based on user intent:
|
|
32
|
+
- User says "review this plan", "second opinion" → find the plan file, pass it to the script
|
|
33
|
+
- User says "review my implementation", "validate changes", "does this match the plan" → **find the plan file and pass it to the script** (the script auto-includes git diff when changes exist, producing an implementation review)
|
|
34
|
+
- User says "review my code", "code review" → no plan file needed, run the script with no arguments
|
|
35
|
+
|
|
36
|
+
**Important:** For implementation reviews, you MUST pass the plan file path as an argument. The script uses it to compare the plan against the git diff. Without the plan file, you get a standalone code review instead.
|
|
37
|
+
|
|
38
|
+
If ambiguous, check:
|
|
39
|
+
1. Is there a recent plan file in `plans/` or `*plan*.md`?
|
|
40
|
+
2. Are there git changes (`git diff HEAD`)?
|
|
41
|
+
3. If a plan file exists and git changes exist, pass the plan file — the script auto-detects implementation review mode
|
|
42
|
+
4. If unsure, ask the user
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 2: Find the Plan (if needed)
|
|
47
|
+
|
|
48
|
+
Skip this step for pure code reviews (no plan context).
|
|
49
|
+
|
|
50
|
+
If the user provides a path argument, use that file.
|
|
51
|
+
|
|
52
|
+
Otherwise, find the most recently modified plan file:
|
|
53
|
+
1. Use Glob to search for `plans/**/*.md` and `*plan*.md`
|
|
54
|
+
2. Sort by modification time (most recent first)
|
|
55
|
+
3. Use the most recent file
|
|
56
|
+
|
|
57
|
+
If no plan file is found and one is needed, ask the user which file to review.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 3: Review Loop (max 3 iterations)
|
|
62
|
+
|
|
63
|
+
For each iteration:
|
|
64
|
+
|
|
65
|
+
### 3a. Get Review
|
|
66
|
+
|
|
67
|
+
Run the review script using the Bash tool:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# With a plan file (plan review or implementation review — auto-detected)
|
|
71
|
+
bash scripts/codex-review/codex-review.sh <plan-file-path>
|
|
72
|
+
|
|
73
|
+
# Without a plan file (code review of git changes)
|
|
74
|
+
bash scripts/codex-review/codex-review.sh
|
|
75
|
+
|
|
76
|
+
# Override model
|
|
77
|
+
bash scripts/codex-review/codex-review.sh [plan-file] --model o3-mini
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3b. Present Feedback
|
|
81
|
+
|
|
82
|
+
Show the user the review output with an iteration counter:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
## Codex Review (Iteration 1/3)
|
|
86
|
+
|
|
87
|
+
[review output]
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
Would you like me to update the [plan/code] based on this feedback and run another review?
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3c. Apply Changes
|
|
94
|
+
|
|
95
|
+
If the user wants to continue:
|
|
96
|
+
|
|
97
|
+
**For plan reviews:** Edit the plan file based on feedback, then re-review.
|
|
98
|
+
|
|
99
|
+
**For implementation/code reviews:** Fix the code based on feedback, then re-review (the git diff changes between iterations as code is updated).
|
|
100
|
+
|
|
101
|
+
If the user is satisfied, stop iterating.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Step 4: Final Summary
|
|
106
|
+
|
|
107
|
+
After all iterations (or when the user stops):
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
## Review Complete (N/3 iterations)
|
|
111
|
+
|
|
112
|
+
### Changes Made
|
|
113
|
+
- [bullet list of improvements applied]
|
|
114
|
+
|
|
115
|
+
### Remaining Suggestions (not applied)
|
|
116
|
+
- [any suggestions the user chose to skip]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Error Handling
|
|
122
|
+
|
|
123
|
+
Handle script exit codes:
|
|
124
|
+
- **Exit 1** — codex CLI not installed: "Install Codex CLI with `npm install -g @openai/codex`"
|
|
125
|
+
- **Exit 1** — nothing to review: "No plan file or git changes found. Provide a plan file or make some code changes first."
|
|
126
|
+
- **Exit 2** — Auth error: "Check your OpenAI API key configuration"
|
|
127
|
+
- **Exit 3** — Timeout: "Review timed out. Try a shorter plan or run again"
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Checklist
|
|
132
|
+
|
|
133
|
+
Before running:
|
|
134
|
+
- [ ] If reviewing a plan: plan file exists and has content
|
|
135
|
+
- [ ] If reviewing code: there are git changes to review
|
|
136
|
+
- [ ] `codex` CLI is available (the script checks this)
|
|
137
|
+
- [ ] Present iteration count clearly (1/3, 2/3, 3/3)
|
|
138
|
+
- [ ] After each iteration, ask user before continuing
|
|
139
|
+
- [ ] Stop after 3 iterations or user satisfaction
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
name: secops
|
|
4
|
+
description: >-
|
|
5
|
+
Scan dependencies for vulnerabilities using OSV Scanner before installing any packages.
|
|
6
|
+
Use when installing, updating, or auditing dependencies with pip, npm, cargo, go get,
|
|
7
|
+
gem, composer, nuget, or maven.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🔒 CRITICAL SECURITY - OSV-Scanner Requirement
|
|
11
|
+
|
|
12
|
+
**MANDATORY SECOPS POLICY**: All dependency installations MUST be scanned with `osv-scanner` BEFORE installation. This is a non-negotiable security requirement.
|
|
13
|
+
|
|
14
|
+
### Security Workflow - ALWAYS Follow This Order
|
|
15
|
+
|
|
16
|
+
**BEFORE installing ANY dependencies:**
|
|
17
|
+
|
|
18
|
+
1. **Query the OSV API to check the package before installing:**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
curl -s -X POST "https://api.osv.dev/v1/query" \
|
|
22
|
+
-H "Content-Type: application/json" \
|
|
23
|
+
-d '{"package": {"name": "PACKAGE_NAME", "ecosystem": "ECOSYSTEM"}, "version": "VERSION"}'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Package Manager | Ecosystem |
|
|
27
|
+
|---|---|
|
|
28
|
+
| pip | `PyPI` |
|
|
29
|
+
| npm/yarn/pnpm | `npm` |
|
|
30
|
+
| cargo | `crates.io` |
|
|
31
|
+
| go get | `Go` |
|
|
32
|
+
| gem | `RubyGems` |
|
|
33
|
+
| composer | `Packagist` |
|
|
34
|
+
| nuget | `NuGet` |
|
|
35
|
+
| maven | `Maven` |
|
|
36
|
+
|
|
37
|
+
- Empty `{}` = no known vulnerabilities → proceed
|
|
38
|
+
- Response contains `vulns` = **STOP**. Report to user, suggest safe version.
|
|
39
|
+
|
|
40
|
+
2. **Prepare the lockfile for scanning:**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# If only pyproject.toml exists, generate requirements.txt first
|
|
44
|
+
# (osv-scanner works best with concrete dependency lists)
|
|
45
|
+
|
|
46
|
+
# Check if requirements.txt exists
|
|
47
|
+
ls requirements.txt 2>/dev/null || echo "No requirements.txt found"
|
|
48
|
+
|
|
49
|
+
# If no requirements.txt, generate from pyproject.toml
|
|
50
|
+
uv pip compile pyproject.toml -o requirements.txt
|
|
51
|
+
|
|
52
|
+
# OR use uv to generate lock file
|
|
53
|
+
uv lock
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
3. **Scan the lockfile:**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
osv-scanner scan -r .
|
|
60
|
+
|
|
61
|
+
# Or specific lockfile:
|
|
62
|
+
osv-scanner scan -L requirements.txt
|
|
63
|
+
osv-scanner scan -L package-lock.json
|
|
64
|
+
osv-scanner scan -L Cargo.lock
|
|
65
|
+
osv-scanner scan -L go.sum
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
| Language | Lockfiles |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Python | `requirements.txt`, `Pipfile.lock`, `poetry.lock`, `uv.lock` |
|
|
71
|
+
| JavaScript | `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml` |
|
|
72
|
+
| Rust | `Cargo.lock` |
|
|
73
|
+
| Go | `go.mod`, `go.sum` |
|
|
74
|
+
| Ruby | `Gemfile.lock` |
|
|
75
|
+
| PHP | `composer.lock` |
|
|
76
|
+
| .NET | `packages.lock.json` |
|
|
77
|
+
|
|
78
|
+
4. **Review the scan results:**
|
|
79
|
+
|
|
80
|
+
- ❌ **If vulnerabilities are found:** STOP - Do NOT install. Report findings to the user and discuss mitigation options.
|
|
81
|
+
- ✅ **If scan is clean:** Proceed with installation.
|
|
82
|
+
|
|
83
|
+
5. **Only after clean scan, install dependencies:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Python with uv (this project's standard)
|
|
87
|
+
uv sync
|
|
88
|
+
uv pip install <package>
|
|
89
|
+
|
|
90
|
+
# Node.js
|
|
91
|
+
npm install
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
6. **After installation, scan the entire project:**
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Scan all dependencies recursively
|
|
98
|
+
osv-scanner scan -r .
|
|
99
|
+
|
|
100
|
+
# Scan with specific config
|
|
101
|
+
osv-scanner scan --config osv-scanner.toml .
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Generating Requirements Files
|
|
105
|
+
|
|
106
|
+
If a project only has `pyproject.toml` and you need to scan dependencies:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Generate requirements.txt from pyproject.toml
|
|
110
|
+
uv pip compile pyproject.toml -o requirements.txt
|
|
111
|
+
|
|
112
|
+
# OR generate detailed lock file
|
|
113
|
+
uv lock
|
|
114
|
+
|
|
115
|
+
# Then scan the generated file
|
|
116
|
+
osv-scanner scan -L requirements.txt
|
|
117
|
+
# OR
|
|
118
|
+
osv-scanner scan -L uv.lock
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Why generate requirements.txt?**
|
|
122
|
+
|
|
123
|
+
- OSV-Scanner provides better results with concrete dependency lists
|
|
124
|
+
- requirements.txt includes resolved transitive dependencies
|
|
125
|
+
- Lock files (uv.lock) capture exact versions for reproducible scans
|
|
126
|
+
|
|
127
|
+
### Examples
|
|
128
|
+
|
|
129
|
+
#### ❌ WRONG - Installing without scanning:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# This is FORBIDDEN - no security scan!
|
|
133
|
+
uv pip install requests
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### ✅ CORRECT - Full security workflow:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Step 1: Query OSV API
|
|
140
|
+
curl -s -X POST "https://api.osv.dev/v1/query" \
|
|
141
|
+
-H "Content-Type: application/json" \
|
|
142
|
+
-d '{"package": {"name": "requests", "ecosystem": "PyPI"}, "version": "2.28.0"}'
|
|
143
|
+
|
|
144
|
+
# Step 2: Ensure requirements.txt exists
|
|
145
|
+
if [ ! -f requirements.txt ]; then
|
|
146
|
+
uv pip compile pyproject.toml -o requirements.txt
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
# Step 3: Scan before installation
|
|
150
|
+
osv-scanner scan -L requirements.txt
|
|
151
|
+
|
|
152
|
+
# Step 4: If clean, proceed with installation
|
|
153
|
+
uv sync
|
|
154
|
+
|
|
155
|
+
# Step 5: Scan again after installation
|
|
156
|
+
osv-scanner scan -r .
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### ✅ CORRECT - Adding a new package:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Step 1: Add to pyproject.toml manually or:
|
|
163
|
+
# uv add <package> (this also installs - use with caution)
|
|
164
|
+
|
|
165
|
+
# Step 2: Generate/update requirements.txt
|
|
166
|
+
uv pip compile pyproject.toml -o requirements.txt
|
|
167
|
+
|
|
168
|
+
# Step 3: Scan the updated dependencies
|
|
169
|
+
osv-scanner scan -L requirements.txt
|
|
170
|
+
|
|
171
|
+
# Step 4: If vulnerabilities found, STOP and report
|
|
172
|
+
# Step 5: If clean, proceed with sync
|
|
173
|
+
uv sync
|
|
174
|
+
|
|
175
|
+
# Step 6: Final scan
|
|
176
|
+
osv-scanner scan -r .
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### When to Scan
|
|
180
|
+
|
|
181
|
+
Run `osv-scanner` in these situations:
|
|
182
|
+
|
|
183
|
+
- ✅ Before installing ANY new package
|
|
184
|
+
- ✅ Before updating existing packages
|
|
185
|
+
- ✅ Before accepting dependency changes from others
|
|
186
|
+
- ✅ Periodically on the entire project (weekly recommended)
|
|
187
|
+
- ✅ Before deploying to production
|
|
188
|
+
- ✅ When investigating security concerns
|
|
189
|
+
|
|
190
|
+
### Critical Rules
|
|
191
|
+
|
|
192
|
+
1. **NEVER bypass osv-scanner** - This is a security requirement, not a suggestion
|
|
193
|
+
2. **NEVER install packages without scanning first** - No exceptions
|
|
194
|
+
3. **NEVER ignore osv-scanner warnings** - Always report vulnerabilities to the user
|
|
195
|
+
4. **ALWAYS rescan after installation** - Verify the installed state is secure
|
|
196
|
+
5. **ALWAYS generate requirements.txt if missing** - Needed for accurate vulnerability scanning
|
|
197
|
+
|
|
198
|
+
### Reporting Format
|
|
199
|
+
|
|
200
|
+
When vulnerabilities are found, present them clearly and block installation:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
⚠️ Found 2 vulnerabilities — installation blocked pending review:
|
|
204
|
+
|
|
205
|
+
CRITICAL: lodash@4.17.20
|
|
206
|
+
- GHSA-35jh-r3h4-6jhm: Prototype Pollution
|
|
207
|
+
- Fix: upgrade to 4.17.21
|
|
208
|
+
|
|
209
|
+
HIGH: axios@0.21.1
|
|
210
|
+
- CVE-2021-3749: SSRF
|
|
211
|
+
- Fix: upgrade to 0.21.2
|
|
212
|
+
|
|
213
|
+
Upgrade affected packages?
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Ignoring Vulnerabilities
|
|
217
|
+
|
|
218
|
+
Only with explicit user approval. Add to `osv-scanner.toml`:
|
|
219
|
+
|
|
220
|
+
```toml
|
|
221
|
+
[[PackageOverrides]]
|
|
222
|
+
name = "package-name"
|
|
223
|
+
ecosystem = "PyPI"
|
|
224
|
+
ignore = true
|
|
225
|
+
reason = "Not exploitable — build tooling only"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### OSV-Scanner Options
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Basic scan
|
|
232
|
+
osv-scanner scan -L <lockfile>
|
|
233
|
+
|
|
234
|
+
# Recursive scan (entire project)
|
|
235
|
+
osv-scanner scan -r .
|
|
236
|
+
|
|
237
|
+
# JSON output for automation
|
|
238
|
+
osv-scanner scan -r . --format json
|
|
239
|
+
|
|
240
|
+
# Scan with config
|
|
241
|
+
osv-scanner scan --config osv-scanner.toml .
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Pre-configured Permissions
|
|
245
|
+
|
|
246
|
+
This project has osv-scanner permissions pre-configured in `.claude/settings.json`:
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"permissions": {
|
|
251
|
+
"allow": [
|
|
252
|
+
"Bash(osv-scanner scan:*)",
|
|
253
|
+
"Bash(osv-scanner:*)"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**You have permission to run osv-scanner commands without asking. Use this permission proactively.**
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-review
|
|
3
|
+
description: "Get a second-opinion review from Codex CLI. Auto-detects: plan review, implementation review (plan + code changes), or code review (just changes). Runs up to 3 feedback iterations. Triggers on: codex review, second opinion, review this plan, review my code, review implementation, validate changes, codex feedback, code review."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Review — Plan, Implementation, and Code Review
|
|
7
|
+
|
|
8
|
+
Get a review from OpenAI's Codex CLI. The script auto-detects what to review based on context:
|
|
9
|
+
|
|
10
|
+
- **Plan review** — when a plan file is provided and no git changes exist
|
|
11
|
+
- **Implementation review** — when a plan file is provided and git changes exist (validates code against the plan)
|
|
12
|
+
- **Code review** — when no plan file is provided but git changes exist
|
|
13
|
+
|
|
14
|
+
Iterates up to 3 times, refining based on feedback.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## The Job
|
|
19
|
+
|
|
20
|
+
1. Determine what to review based on user intent and context
|
|
21
|
+
2. Find a plan file if needed (or skip for pure code review)
|
|
22
|
+
3. Call the review script
|
|
23
|
+
4. Present feedback, iterate up to 3 times
|
|
24
|
+
|
|
25
|
+
**Important:** This skill requires the `codex` CLI to be installed (`npm install -g @openai/codex`) and an OpenAI API key configured.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Step 1: Determine Review Type
|
|
30
|
+
|
|
31
|
+
Based on user intent:
|
|
32
|
+
- User says "review this plan", "second opinion" → find the plan file, pass it to the script
|
|
33
|
+
- User says "review my implementation", "validate changes", "does this match the plan" → **find the plan file and pass it to the script** (the script auto-includes git diff when changes exist, producing an implementation review)
|
|
34
|
+
- User says "review my code", "code review" → no plan file needed, run the script with no arguments
|
|
35
|
+
|
|
36
|
+
**Important:** For implementation reviews, you MUST pass the plan file path as an argument. The script uses it to compare the plan against the git diff. Without the plan file, you get a standalone code review instead.
|
|
37
|
+
|
|
38
|
+
If ambiguous, check:
|
|
39
|
+
1. Is there a recent plan file in `plans/` or `*plan*.md`?
|
|
40
|
+
2. Are there git changes (`git diff HEAD`)?
|
|
41
|
+
3. If a plan file exists and git changes exist, pass the plan file — the script auto-detects implementation review mode
|
|
42
|
+
4. If unsure, ask the user
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 2: Find the Plan (if needed)
|
|
47
|
+
|
|
48
|
+
Skip this step for pure code reviews (no plan context).
|
|
49
|
+
|
|
50
|
+
If the user provides a path argument, use that file.
|
|
51
|
+
|
|
52
|
+
Otherwise, find the most recently modified plan file:
|
|
53
|
+
1. Use Glob to search for `plans/**/*.md` and `*plan*.md`
|
|
54
|
+
2. Sort by modification time (most recent first)
|
|
55
|
+
3. Use the most recent file
|
|
56
|
+
|
|
57
|
+
If no plan file is found and one is needed, ask the user which file to review.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 3: Review Loop (max 3 iterations)
|
|
62
|
+
|
|
63
|
+
For each iteration:
|
|
64
|
+
|
|
65
|
+
### 3a. Get Review
|
|
66
|
+
|
|
67
|
+
Run the review script using the Bash tool:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# With a plan file (plan review or implementation review — auto-detected)
|
|
71
|
+
bash scripts/codex-review/codex-review.sh <plan-file-path>
|
|
72
|
+
|
|
73
|
+
# Without a plan file (code review of git changes)
|
|
74
|
+
bash scripts/codex-review/codex-review.sh
|
|
75
|
+
|
|
76
|
+
# Override model
|
|
77
|
+
bash scripts/codex-review/codex-review.sh [plan-file] --model o3-mini
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3b. Present Feedback
|
|
81
|
+
|
|
82
|
+
Show the user the review output with an iteration counter:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
## Codex Review (Iteration 1/3)
|
|
86
|
+
|
|
87
|
+
[review output]
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
Would you like me to update the [plan/code] based on this feedback and run another review?
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3c. Apply Changes
|
|
94
|
+
|
|
95
|
+
If the user wants to continue:
|
|
96
|
+
|
|
97
|
+
**For plan reviews:** Edit the plan file based on feedback, then re-review.
|
|
98
|
+
|
|
99
|
+
**For implementation/code reviews:** Fix the code based on feedback, then re-review (the git diff changes between iterations as code is updated).
|
|
100
|
+
|
|
101
|
+
If the user is satisfied, stop iterating.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Step 4: Final Summary
|
|
106
|
+
|
|
107
|
+
After all iterations (or when the user stops):
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
## Review Complete (N/3 iterations)
|
|
111
|
+
|
|
112
|
+
### Changes Made
|
|
113
|
+
- [bullet list of improvements applied]
|
|
114
|
+
|
|
115
|
+
### Remaining Suggestions (not applied)
|
|
116
|
+
- [any suggestions the user chose to skip]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Error Handling
|
|
122
|
+
|
|
123
|
+
Handle script exit codes:
|
|
124
|
+
- **Exit 1** — codex CLI not installed: "Install Codex CLI with `npm install -g @openai/codex`"
|
|
125
|
+
- **Exit 1** — nothing to review: "No plan file or git changes found. Provide a plan file or make some code changes first."
|
|
126
|
+
- **Exit 2** — Auth error: "Check your OpenAI API key configuration"
|
|
127
|
+
- **Exit 3** — Timeout: "Review timed out. Try a shorter plan or run again"
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Checklist
|
|
132
|
+
|
|
133
|
+
Before running:
|
|
134
|
+
- [ ] If reviewing a plan: plan file exists and has content
|
|
135
|
+
- [ ] If reviewing code: there are git changes to review
|
|
136
|
+
- [ ] `codex` CLI is available (the script checks this)
|
|
137
|
+
- [ ] Present iteration count clearly (1/3, 2/3, 3/3)
|
|
138
|
+
- [ ] After each iteration, ask user before continuing
|
|
139
|
+
- [ ] Stop after 3 iterations or user satisfaction
|