ccsetup 1.1.1 → 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 +144 -342
- package/bin/create-project.js +1246 -90
- package/bin/lib/claudeInterface.js +209 -0
- package/lib/aiAgentSelector.js +155 -0
- package/lib/templates/README.md +176 -0
- package/lib/templates/catalog.js +230 -0
- package/lib/templates/filter.js +257 -0
- package/lib/templates/index.js +45 -0
- package/lib/templates/metadata/agents.json +413 -0
- package/lib/templates/metadata-extractor.js +329 -0
- package/lib/templates/search.js +356 -0
- package/package.json +13 -5
- package/template/{agents → .claude/agents}/checker.md +29 -0
- package/template/.claude/settings.json +32 -0
- package/template/.claude/skills/codex-review/SKILL.md +139 -0
- package/template/.claude/skills/prd/SKILL.md +343 -0
- package/template/.claude/skills/ralph/SKILL.md +339 -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 +141 -21
- package/template/CONTRIBUTING.md +37 -0
- package/template/agents/README.md +15 -171
- package/template/docs/ROADMAP.md +0 -36
- package/template/docs/agent-orchestration.md +24 -141
- package/template/docs/codex-setup.md +32 -0
- package/template/hooks/codex-review/index.js +105 -0
- package/template/hooks/workflow-selector/index.js +398 -0
- package/template/scripts/codex-review/codex-review.sh +266 -0
- package/template/scripts/ralph/CLAUDE.md +174 -0
- package/template/scripts/ralph/CODEX.md +76 -0
- package/template/scripts/ralph/ralph.sh +150 -0
- package/template/tickets/ticket-list.md +17 -68
- package/template/agents/ai-engineer.md +0 -31
- package/template/agents/api-documenter.md +0 -31
- package/template/agents/architect-review.md +0 -42
- package/template/agents/backend-architect.md +0 -29
- package/template/agents/business-analyst.md +0 -34
- package/template/agents/c-pro.md +0 -34
- package/template/agents/cloud-architect.md +0 -31
- package/template/agents/code-reviewer.md +0 -28
- package/template/agents/content-marketer.md +0 -34
- package/template/agents/context-manager.md +0 -63
- package/template/agents/cpp-pro.md +0 -37
- package/template/agents/customer-support.md +0 -34
- package/template/agents/data-engineer.md +0 -31
- package/template/agents/data-scientist.md +0 -28
- package/template/agents/database-admin.md +0 -31
- package/template/agents/database-optimizer.md +0 -31
- package/template/agents/debugger.md +0 -29
- package/template/agents/deployment-engineer.md +0 -31
- package/template/agents/devops-troubleshooter.md +0 -31
- package/template/agents/dx-optimizer.md +0 -62
- package/template/agents/error-detective.md +0 -31
- package/template/agents/frontend-developer.md +0 -30
- package/template/agents/golang-pro.md +0 -31
- package/template/agents/graphql-architect.md +0 -31
- package/template/agents/incident-responder.md +0 -73
- package/template/agents/javascript-pro.md +0 -34
- package/template/agents/legacy-modernizer.md +0 -31
- package/template/agents/ml-engineer.md +0 -31
- package/template/agents/mlops-engineer.md +0 -56
- package/template/agents/mobile-developer.md +0 -31
- package/template/agents/network-engineer.md +0 -31
- package/template/agents/payment-integration.md +0 -31
- package/template/agents/performance-engineer.md +0 -31
- package/template/agents/prompt-engineer.md +0 -58
- package/template/agents/python-pro.md +0 -31
- package/template/agents/quant-analyst.md +0 -31
- package/template/agents/risk-manager.md +0 -40
- package/template/agents/rust-pro.md +0 -34
- package/template/agents/sales-automator.md +0 -34
- package/template/agents/search-specialist.md +0 -58
- package/template/agents/security-auditor.md +0 -31
- package/template/agents/sql-pro.md +0 -34
- package/template/agents/terraform-specialist.md +0 -34
- package/template/agents/test-automator.md +0 -31
- /package/template/{agents → .claude/agents}/backend.md +0 -0
- /package/template/{agents → .claude/agents}/blockchain.md +0 -0
- /package/template/{agents → .claude/agents}/coder.md +0 -0
- /package/template/{agents → .claude/agents}/frontend.md +0 -0
- /package/template/{agents → .claude/agents}/planner.md +0 -0
- /package/template/{agents → .claude/agents}/researcher.md +0 -0
- /package/template/{agents → .claude/agents}/shadcn.md +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ralph
|
|
3
|
+
description: "Convert PRDs to prd.json format for the Ralph autonomous agent system. Use when you have an existing PRD and need to convert it to Ralph's JSON format. Triggers on: convert this prd, turn this into ralph format, create prd.json from this, ralph json."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ralph PRD Converter
|
|
7
|
+
|
|
8
|
+
Converts existing PRDs to the prd.json format that Ralph uses for autonomous execution. Scans the codebase to populate quality checks, file hints, and story notes automatically.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The Job
|
|
13
|
+
|
|
14
|
+
1. **Scan the codebase** to detect quality commands and relevant file paths
|
|
15
|
+
2. Read the PRD (markdown file or text) — check for a Tech Context section first
|
|
16
|
+
3. Convert to `scripts/ralph/prd.json` with codebase-informed stories
|
|
17
|
+
4. Initialize `scripts/ralph/progress.txt` if it doesn't exist
|
|
18
|
+
|
|
19
|
+
**Important:** Do NOT start implementing. Just create the prd.json.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Step 1: Codebase Reconnaissance
|
|
24
|
+
|
|
25
|
+
Before converting, silently scan the project using Codex tools.
|
|
26
|
+
|
|
27
|
+
### If PRD has a Tech Context section
|
|
28
|
+
The improved `/prd` skill generates a Tech Context section with stack, quality gates, and relevant file paths. If present, use it directly — no need to re-scan.
|
|
29
|
+
|
|
30
|
+
### If PRD has no Tech Context section
|
|
31
|
+
Scan manually:
|
|
32
|
+
|
|
33
|
+
**Detect quality commands** — Read `package.json` scripts, config files, Makefiles:
|
|
34
|
+
- Look for: `typecheck`, `tsc`, `check-types` → record the exact script (e.g., `npm run typecheck`)
|
|
35
|
+
- Look for: `lint`, `eslint`, `biome check` → record exact script (e.g., `npm run lint`)
|
|
36
|
+
- Look for: `test`, `vitest`, `jest`, `pytest` → record exact script (e.g., `npm test`)
|
|
37
|
+
- Look for: `build` → record exact script (e.g., `npm run build`)
|
|
38
|
+
|
|
39
|
+
**Scan relevant files** — Use Glob to find files related to each user story:
|
|
40
|
+
- Database: `**/schema.prisma`, `**/models/**`, `**/migrations/**`
|
|
41
|
+
- API: `**/api/**`, `**/routes/**`, `**/app/**/route.*`
|
|
42
|
+
- Components: `**/components/**`
|
|
43
|
+
- Utilities: `**/hooks/**`, `**/utils/**`, `**/lib/**`
|
|
44
|
+
|
|
45
|
+
These become `notes` on each story — giving Ralph file-level hints for where to work.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Step 2: Output Format
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"project": "[Project Name]",
|
|
54
|
+
"branchName": "ralph/[feature-name-kebab-case]",
|
|
55
|
+
"description": "[Feature description from PRD title/intro]",
|
|
56
|
+
"qualityChecks": {
|
|
57
|
+
"typecheck": "npm run typecheck",
|
|
58
|
+
"lint": "npm run lint",
|
|
59
|
+
"test": "npm test",
|
|
60
|
+
"build": "npm run build"
|
|
61
|
+
},
|
|
62
|
+
"userStories": [
|
|
63
|
+
{
|
|
64
|
+
"id": "US-001",
|
|
65
|
+
"title": "[Story title]",
|
|
66
|
+
"description": "As a [user], I want [feature] so that [benefit]",
|
|
67
|
+
"acceptanceCriteria": [
|
|
68
|
+
"Criterion 1",
|
|
69
|
+
"Criterion 2",
|
|
70
|
+
"Typecheck passes",
|
|
71
|
+
"Lint passes"
|
|
72
|
+
],
|
|
73
|
+
"priority": 1,
|
|
74
|
+
"passes": false,
|
|
75
|
+
"notes": "Relevant files: prisma/schema.prisma, src/app/api/tasks/route.ts"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### The `qualityChecks` field
|
|
82
|
+
|
|
83
|
+
This is **new and critical**. It tells Ralph the exact commands to run, so each iteration doesn't have to guess. Only include checks that actually exist in the project:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
"qualityChecks": {
|
|
87
|
+
"typecheck": "npm run typecheck",
|
|
88
|
+
"lint": "npm run lint"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If a project has no typecheck, don't include it. If it uses `make check`, use that. Be exact.
|
|
93
|
+
|
|
94
|
+
### The `notes` field
|
|
95
|
+
|
|
96
|
+
Pre-populate with **file hints** from your codebase scan — relevant files the story will likely touch or extend:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
"notes": "Relevant files: prisma/schema.prisma (Task model), src/components/TaskCard.tsx (extend with badge)"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This gives each Ralph iteration a head start instead of scanning the codebase from scratch.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Story Size: The Number One Rule
|
|
107
|
+
|
|
108
|
+
**Each story must be completable in ONE Ralph iteration (one context window).**
|
|
109
|
+
|
|
110
|
+
Ralph spawns a fresh instance per iteration with no memory of previous work. If a story is too big, the LLM runs out of context before finishing and produces broken code.
|
|
111
|
+
|
|
112
|
+
### Right-sized stories:
|
|
113
|
+
- Add a database column and migration
|
|
114
|
+
- Add a UI component to an existing page
|
|
115
|
+
- Update a server action with new logic
|
|
116
|
+
- Add a filter dropdown to a list
|
|
117
|
+
|
|
118
|
+
### Too big (split these):
|
|
119
|
+
- "Build the entire dashboard" — Split into: schema, queries, UI components, filters
|
|
120
|
+
- "Add authentication" — Split into: schema, middleware, login UI, session handling
|
|
121
|
+
- "Refactor the API" — Split into one story per endpoint or pattern
|
|
122
|
+
|
|
123
|
+
**Rule of thumb:** If you cannot describe the change in 2-3 sentences, it is too big.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Story Ordering: Dependencies First
|
|
128
|
+
|
|
129
|
+
Stories execute in priority order. Earlier stories must not depend on later ones.
|
|
130
|
+
|
|
131
|
+
**Correct order:**
|
|
132
|
+
1. Schema/database changes (migrations)
|
|
133
|
+
2. Server actions / backend logic
|
|
134
|
+
3. UI components that use the backend
|
|
135
|
+
4. Dashboard/summary views that aggregate data
|
|
136
|
+
|
|
137
|
+
**Wrong order:**
|
|
138
|
+
1. UI component (depends on schema that does not exist yet)
|
|
139
|
+
2. Schema change
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Acceptance Criteria: Must Be Verifiable
|
|
144
|
+
|
|
145
|
+
Each criterion must be something Ralph can CHECK, not something vague.
|
|
146
|
+
|
|
147
|
+
### Good criteria (verifiable):
|
|
148
|
+
- "Add `status` column to tasks table with default 'pending'"
|
|
149
|
+
- "Filter dropdown has options: All, Active, Completed"
|
|
150
|
+
- "Clicking delete shows confirmation dialog"
|
|
151
|
+
|
|
152
|
+
### Bad criteria (vague):
|
|
153
|
+
- "Works correctly"
|
|
154
|
+
- "User can do X easily"
|
|
155
|
+
- "Good UX"
|
|
156
|
+
- "Handles edge cases"
|
|
157
|
+
|
|
158
|
+
### Quality criteria — use what the project actually has
|
|
159
|
+
|
|
160
|
+
Append the quality checks detected in Step 1. Examples:
|
|
161
|
+
|
|
162
|
+
- Project has typecheck + lint → append `"Typecheck passes"`, `"Lint passes"`
|
|
163
|
+
- Project has only tests → append `"Tests pass"`
|
|
164
|
+
- Project has a build step → append `"Build passes"`
|
|
165
|
+
|
|
166
|
+
Do **not** hardcode "Typecheck passes" if the project has no typecheck.
|
|
167
|
+
|
|
168
|
+
### For stories that change UI, also include:
|
|
169
|
+
```
|
|
170
|
+
"Verify in browser using dev-browser skill"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Conversion Rules
|
|
176
|
+
|
|
177
|
+
1. **Each user story becomes one JSON entry**
|
|
178
|
+
2. **IDs**: Sequential (US-001, US-002, etc.)
|
|
179
|
+
3. **Priority**: Based on dependency order, then document order
|
|
180
|
+
4. **All stories**: `passes: false`
|
|
181
|
+
5. **notes**: Pre-populate with relevant file paths from codebase scan
|
|
182
|
+
6. **branchName**: Derive from feature name, kebab-case, prefixed with `ralph/`
|
|
183
|
+
7. **qualityChecks**: Populated from detected project commands (Step 1)
|
|
184
|
+
8. **Quality criteria on stories**: Match what `qualityChecks` contains
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Splitting Large PRDs
|
|
189
|
+
|
|
190
|
+
If a PRD has big features, split them:
|
|
191
|
+
|
|
192
|
+
**Original:**
|
|
193
|
+
> "Add user notification system"
|
|
194
|
+
|
|
195
|
+
**Split into:**
|
|
196
|
+
1. US-001: Add notifications table to database
|
|
197
|
+
2. US-002: Create notification service for sending notifications
|
|
198
|
+
3. US-003: Add notification bell icon to header
|
|
199
|
+
4. US-004: Create notification dropdown panel
|
|
200
|
+
5. US-005: Add mark-as-read functionality
|
|
201
|
+
6. US-006: Add notification preferences page
|
|
202
|
+
|
|
203
|
+
Each is one focused change that can be completed and verified independently.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Example
|
|
208
|
+
|
|
209
|
+
**Input PRD with Tech Context:**
|
|
210
|
+
```markdown
|
|
211
|
+
# PRD: Task Status Feature
|
|
212
|
+
|
|
213
|
+
## Tech Context
|
|
214
|
+
- **Stack:** Next.js 14 (App Router) + TypeScript + Tailwind CSS
|
|
215
|
+
- **DB:** Prisma with PostgreSQL (`prisma/schema.prisma`)
|
|
216
|
+
- **UI:** shadcn/ui in `src/components/ui/`
|
|
217
|
+
- **Quality gates:** Typecheck (`tsc --noEmit`), Lint (`eslint`), Tests (`vitest`)
|
|
218
|
+
- **Relevant code:**
|
|
219
|
+
- Task model: `prisma/schema.prisma`
|
|
220
|
+
- Task list: `src/components/TaskList.tsx`
|
|
221
|
+
- Task card: `src/components/TaskCard.tsx`
|
|
222
|
+
- Badge: `src/components/ui/Badge.tsx`
|
|
223
|
+
- API: `src/app/api/tasks/`
|
|
224
|
+
|
|
225
|
+
## User Stories
|
|
226
|
+
### US-001: Add status field to database ...
|
|
227
|
+
### US-002: Display status badge on task cards ...
|
|
228
|
+
### US-003: Add status toggle ...
|
|
229
|
+
### US-004: Filter tasks by status ...
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Output prd.json:**
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"project": "TaskApp",
|
|
236
|
+
"branchName": "ralph/task-status",
|
|
237
|
+
"description": "Task Status Feature - Track task progress with status indicators",
|
|
238
|
+
"qualityChecks": {
|
|
239
|
+
"typecheck": "npx tsc --noEmit",
|
|
240
|
+
"lint": "npm run lint",
|
|
241
|
+
"test": "npx vitest run"
|
|
242
|
+
},
|
|
243
|
+
"userStories": [
|
|
244
|
+
{
|
|
245
|
+
"id": "US-001",
|
|
246
|
+
"title": "Add status field to tasks table",
|
|
247
|
+
"description": "As a developer, I need to store task status in the database.",
|
|
248
|
+
"acceptanceCriteria": [
|
|
249
|
+
"Add status column: 'pending' | 'in_progress' | 'done' (default 'pending')",
|
|
250
|
+
"Generate and run migration successfully",
|
|
251
|
+
"Typecheck passes",
|
|
252
|
+
"Lint passes"
|
|
253
|
+
],
|
|
254
|
+
"priority": 1,
|
|
255
|
+
"passes": false,
|
|
256
|
+
"notes": "Relevant files: prisma/schema.prisma (Task model)"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "US-002",
|
|
260
|
+
"title": "Display status badge on task cards",
|
|
261
|
+
"description": "As a user, I want to see task status at a glance.",
|
|
262
|
+
"acceptanceCriteria": [
|
|
263
|
+
"Each task card shows colored status badge",
|
|
264
|
+
"Badge colors: gray=pending, blue=in_progress, green=done",
|
|
265
|
+
"Typecheck passes",
|
|
266
|
+
"Lint passes",
|
|
267
|
+
"Verify in browser using dev-browser skill"
|
|
268
|
+
],
|
|
269
|
+
"priority": 2,
|
|
270
|
+
"passes": false,
|
|
271
|
+
"notes": "Relevant files: src/components/TaskCard.tsx (extend), src/components/ui/Badge.tsx (reuse with color variants)"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "US-003",
|
|
275
|
+
"title": "Add status toggle to task list rows",
|
|
276
|
+
"description": "As a user, I want to change task status directly from the list.",
|
|
277
|
+
"acceptanceCriteria": [
|
|
278
|
+
"Each row has status dropdown or toggle",
|
|
279
|
+
"Changing status saves immediately via PATCH /api/tasks/[id]",
|
|
280
|
+
"UI updates without page refresh",
|
|
281
|
+
"Typecheck passes",
|
|
282
|
+
"Lint passes",
|
|
283
|
+
"Verify in browser using dev-browser skill"
|
|
284
|
+
],
|
|
285
|
+
"priority": 3,
|
|
286
|
+
"passes": false,
|
|
287
|
+
"notes": "Relevant files: src/components/TaskList.tsx, src/app/api/tasks/[id]/route.ts"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"id": "US-004",
|
|
291
|
+
"title": "Filter tasks by status",
|
|
292
|
+
"description": "As a user, I want to filter the list to see only certain statuses.",
|
|
293
|
+
"acceptanceCriteria": [
|
|
294
|
+
"Filter dropdown: All | Pending | In Progress | Done",
|
|
295
|
+
"Filter persists in URL params",
|
|
296
|
+
"Typecheck passes",
|
|
297
|
+
"Lint passes",
|
|
298
|
+
"Tests pass",
|
|
299
|
+
"Verify in browser using dev-browser skill"
|
|
300
|
+
],
|
|
301
|
+
"priority": 4,
|
|
302
|
+
"passes": false,
|
|
303
|
+
"notes": "Relevant files: src/components/TaskList.tsx (add filter dropdown)"
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Archiving Previous Runs
|
|
312
|
+
|
|
313
|
+
**Before writing a new prd.json, check if there is an existing one from a different feature:**
|
|
314
|
+
|
|
315
|
+
1. Read the current `prd.json` if it exists
|
|
316
|
+
2. Check if `branchName` differs from the new feature's branch name
|
|
317
|
+
3. If different AND `progress.txt` has content beyond the header:
|
|
318
|
+
- Create archive folder: `archive/YYYY-MM-DD-feature-name/`
|
|
319
|
+
- Copy current `prd.json` and `progress.txt` to archive
|
|
320
|
+
- Reset `progress.txt` with fresh header
|
|
321
|
+
|
|
322
|
+
**The ralph.sh script handles this automatically** when you run it, but if you are manually updating prd.json between runs, archive first.
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Checklist Before Saving
|
|
327
|
+
|
|
328
|
+
Before writing prd.json, verify:
|
|
329
|
+
|
|
330
|
+
- [ ] Ran codebase reconnaissance or read PRD's Tech Context (Step 1)
|
|
331
|
+
- [ ] `qualityChecks` populated with exact commands from the project
|
|
332
|
+
- [ ] **Previous run archived** (if prd.json exists with different branchName, archive it first)
|
|
333
|
+
- [ ] Each story is completable in one iteration (small enough)
|
|
334
|
+
- [ ] Stories are ordered by dependency (schema → backend → UI)
|
|
335
|
+
- [ ] Story quality criteria match what `qualityChecks` contains (not hardcoded)
|
|
336
|
+
- [ ] UI stories have "Verify in browser using dev-browser skill" as criterion
|
|
337
|
+
- [ ] Acceptance criteria are verifiable (not vague)
|
|
338
|
+
- [ ] Story `notes` pre-populated with relevant file paths
|
|
339
|
+
- [ ] No story depends on a later story
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Codex Project Instructions
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
[Brief description of your project goes here]
|
|
6
|
+
|
|
7
|
+
## Primary Working Files
|
|
8
|
+
|
|
9
|
+
- `AGENTS.md` — project-specific guidance for Codex
|
|
10
|
+
- `.codex/skills/` — project-local Codex skills for this project (`prd`, `ralph`, `codex-review`)
|
|
11
|
+
- `docs/codex-setup.md` — Codex setup notes for this repo
|
|
12
|
+
- `docs/ROADMAP.md` — project goals and status
|
|
13
|
+
- `tickets/` — task tracking
|
|
14
|
+
- `plans/` — implementation and architecture plans
|
|
15
|
+
|
|
16
|
+
## Working Expectations
|
|
17
|
+
|
|
18
|
+
- Read this file before making changes.
|
|
19
|
+
- Check `docs/ROADMAP.md` and relevant tickets before starting non-trivial work.
|
|
20
|
+
- Prefer small, reviewable changes.
|
|
21
|
+
- Run the project quality checks before finishing.
|
|
22
|
+
|
|
23
|
+
## Repo Workflow
|
|
24
|
+
|
|
25
|
+
- Use plans in `plans/` for larger features.
|
|
26
|
+
- Track implementation work in `tickets/`.
|
|
27
|
+
- Use `scripts/codex-review/codex-review.sh` when you want a second-opinion review from Codex CLI.
|
|
28
|
+
- Use `scripts/ralph/ralph.sh --tool codex` for Ralph runs through Codex CLI.
|
|
29
|
+
|
|
30
|
+
## Codex Skills
|
|
31
|
+
|
|
32
|
+
This project ships project-local Codex skills in `.codex/skills/`, mirroring the Claude skill set:
|
|
33
|
+
|
|
34
|
+
- `prd`
|
|
35
|
+
- `ralph`
|
|
36
|
+
- `codex-review`
|
|
37
|
+
|
|
38
|
+
Keep these skills in the repository alongside `AGENTS.md` and the project docs.
|
|
39
|
+
|
|
40
|
+
## Project Conventions
|
|
41
|
+
|
|
42
|
+
- Update this file when you discover project-wide rules that future Codex sessions should know.
|
|
43
|
+
- Keep project-specific conventions here, and put reusable workflow guidance into project-local skills.
|
package/template/CLAUDE.md
CHANGED
|
@@ -15,9 +15,14 @@
|
|
|
15
15
|
```
|
|
16
16
|
.
|
|
17
17
|
├── CLAUDE.md # This file - project instructions for Claude
|
|
18
|
-
├── .claude/
|
|
19
|
-
│
|
|
20
|
-
├──
|
|
18
|
+
├── .claude/
|
|
19
|
+
│ ├── agents/ # 8 core agents (backend, blockchain, checker, coder, frontend, planner, researcher, shadcn)
|
|
20
|
+
│ ├── skills/ # /prd, /ralph, and /codex-review slash commands
|
|
21
|
+
│ └── hooks/ # Workflow selector and codex-review hooks
|
|
22
|
+
├── agents/ # Documentation only — see .claude/agents/ for active agents
|
|
23
|
+
├── scripts/
|
|
24
|
+
│ ├── ralph/ # Autonomous agent loop (ralph.sh + Claude/Codex instructions)
|
|
25
|
+
│ └── codex-review/ # Codex CLI review script (plans, implementations, code changes)
|
|
21
26
|
├── docs/ # Project documentation
|
|
22
27
|
├── plans/ # Project plans and architectural documents
|
|
23
28
|
└── tickets/ # Task tickets and issues
|
|
@@ -58,24 +63,60 @@
|
|
|
58
63
|
|
|
59
64
|
## Agents
|
|
60
65
|
|
|
61
|
-
See @agents/README.md for
|
|
66
|
+
8 core agents are pre-installed in `.claude/agents/`. See @agents/README.md for the full list and instructions for adding custom agents.
|
|
67
|
+
|
|
68
|
+
## Skills (Slash Commands)
|
|
69
|
+
|
|
70
|
+
- **/prd** — Scans the codebase, then generates a structured PRD with real file paths and auto-detected quality criteria. Saves to `tasks/prd-[feature-name].md`.
|
|
71
|
+
- **/ralph** — Converts a PRD into `scripts/ralph/prd.json` for autonomous execution with quality checks and file hints per story.
|
|
72
|
+
- **/codex-review** — Reviews plans, validates implementations against plans, or reviews code changes. Auto-detects what to review based on context. Iterates up to 3 times.
|
|
73
|
+
- **/secops** — **NEVER install packages without running this first.** Scans dependencies for vulnerabilities using OSV Scanner. Use before any `pip`, `npm`, `cargo`, `gem`, or other package manager install.
|
|
74
|
+
|
|
75
|
+
## Ralph — Autonomous Agent Loop
|
|
76
|
+
|
|
77
|
+
Ralph implements user stories from a PRD one at a time in a loop, with subagent verification after each story.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
./scripts/ralph/ralph.sh # Default: 10 iterations with Claude Code
|
|
81
|
+
./scripts/ralph/ralph.sh --tool claude # Use Claude Code explicitly
|
|
82
|
+
./scripts/ralph/ralph.sh --tool codex # Use Codex CLI
|
|
83
|
+
./scripts/ralph/ralph.sh --tool claude --model opus 20 # Specify model + iterations
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Typical workflow: `/prd` → `/ralph` → `./scripts/ralph/ralph.sh`
|
|
87
|
+
|
|
88
|
+
Prerequisites: `jq` plus the CLI for whichever runner you use (`claude` by default, or `codex` for `--tool codex`).
|
|
62
89
|
|
|
63
90
|
## Agent Orchestration
|
|
64
91
|
|
|
65
|
-
|
|
92
|
+
See @docs/agent-orchestration.md for detailed workflow patterns on how to chain agents effectively.
|
|
93
|
+
|
|
94
|
+
## Workflow Selector Hook (Optional)
|
|
95
|
+
|
|
96
|
+
An optional hook that suggests agent workflows based on your prompt. Claude will ask before applying.
|
|
97
|
+
|
|
98
|
+
To activate after installation:
|
|
99
|
+
```bash
|
|
100
|
+
export CCSETUP_WORKFLOW=1
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
When unset, the hook is inactive and Claude uses its default behavior. Install the hook with `npx ccsetup --install-hooks`.
|
|
104
|
+
|
|
105
|
+
## Codex Review Hook (Optional)
|
|
106
|
+
|
|
107
|
+
An optional hook that suggests running `/codex-review` when a plan file is modified or code changes are detected. Triggers on the `Stop` event.
|
|
108
|
+
|
|
109
|
+
To activate:
|
|
110
|
+
```bash
|
|
111
|
+
export CCSETUP_CODEX_REVIEW=1
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
When unset, the hook is inactive and produces no output.
|
|
66
115
|
|
|
67
116
|
## Tickets
|
|
68
117
|
|
|
69
118
|
See @tickets/README.md for ticket format and management approach
|
|
70
119
|
|
|
71
|
-
### Ticket Management
|
|
72
|
-
- **Ticket List**: Maintain @tickets/ticket-list.md as a centralized index of all tickets
|
|
73
|
-
- **Update ticket-list.md** whenever you:
|
|
74
|
-
- Create a new ticket (add to appropriate priority section)
|
|
75
|
-
- Change ticket status (update emoji and move if completed)
|
|
76
|
-
- Complete a ticket (move to completed section with date)
|
|
77
|
-
- **Status Emojis**: 🔴 Todo | 🟡 In Progress | 🟢 Done | 🔵 Blocked | ⚫ Cancelled
|
|
78
|
-
|
|
79
120
|
## Plans
|
|
80
121
|
|
|
81
122
|
See @plans/README.md for planning documents and architectural decisions
|
|
@@ -88,15 +129,94 @@ See @plans/README.md for planning documents and architectural decisions
|
|
|
88
129
|
|
|
89
130
|
## Important Instructions
|
|
90
131
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
2. **Ask clarifying questions**: Never make assumptions - ask questions when requirements are unclear
|
|
95
|
-
3. **Create planning documents**: Before implementing any code or features, create a markdown file documenting the approach
|
|
96
|
-
4. **Use plans directory**: When discussing ideas or next steps, create timestamped files in the plans directory (e.g., `plans/next-steps-YYYY-MM-DD-HH-MM-SS.md`) to maintain a record of decisions
|
|
97
|
-
5. **No code comments**: Never add comments to any code you write - code should be self-documenting
|
|
98
|
-
6. **Maintain ticket list**: Always update @tickets/ticket-list.md when creating, updating, or completing tickets to maintain a clear project overview
|
|
132
|
+
- Ask clarifying questions when requirements are unclear
|
|
133
|
+
- Self-documenting code — no code comments
|
|
134
|
+
- For complex features, consider creating a plan document in `/plans` before implementing
|
|
99
135
|
|
|
100
136
|
## Additional Notes
|
|
101
137
|
|
|
102
138
|
[Any other important information for Claude to know about this project]
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
# 🔒 CRITICAL SECURITY - OSV-Scanner Requirement
|
|
143
|
+
|
|
144
|
+
> **MANDATORY SECOPS POLICY**: All dependency installations MUST be scanned with `osv-scanner` BEFORE installation. **NEVER install packages without scanning first. No exceptions.**
|
|
145
|
+
|
|
146
|
+
### Security Workflow - ALWAYS Follow This Order
|
|
147
|
+
|
|
148
|
+
**BEFORE installing ANY dependencies:**
|
|
149
|
+
|
|
150
|
+
1. **Query the OSV API to check the package before installing:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
curl -s -X POST "https://api.osv.dev/v1/query" \
|
|
154
|
+
-H "Content-Type: application/json" \
|
|
155
|
+
-d '{"package": {"name": "PACKAGE_NAME", "ecosystem": "ECOSYSTEM"}, "version": "VERSION"}'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
| Package Manager | Ecosystem |
|
|
159
|
+
|---|---|
|
|
160
|
+
| pip | `PyPI` |
|
|
161
|
+
| npm/yarn/pnpm | `npm` |
|
|
162
|
+
| cargo | `crates.io` |
|
|
163
|
+
| go get | `Go` |
|
|
164
|
+
| gem | `RubyGems` |
|
|
165
|
+
| composer | `Packagist` |
|
|
166
|
+
| nuget | `NuGet` |
|
|
167
|
+
| maven | `Maven` |
|
|
168
|
+
|
|
169
|
+
- Empty `{}` = no known vulnerabilities → proceed
|
|
170
|
+
- Response contains `vulns` = **STOP**. Report to user, suggest safe version.
|
|
171
|
+
|
|
172
|
+
2. **Prepare the lockfile for scanning:**
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
osv-scanner scan -r .
|
|
176
|
+
|
|
177
|
+
# Or specific lockfile:
|
|
178
|
+
osv-scanner scan -L requirements.txt
|
|
179
|
+
osv-scanner scan -L package-lock.json
|
|
180
|
+
osv-scanner scan -L Cargo.lock
|
|
181
|
+
osv-scanner scan -L go.sum
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
3. **Review the scan results:**
|
|
185
|
+
|
|
186
|
+
- ❌ **If vulnerabilities are found:** STOP - Do NOT install. Report findings to the user and discuss mitigation options.
|
|
187
|
+
- ✅ **If scan is clean:** Proceed with installation.
|
|
188
|
+
|
|
189
|
+
4. **Only after clean scan, install dependencies.**
|
|
190
|
+
|
|
191
|
+
5. **After installation, rescan the entire project:**
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
osv-scanner scan -r .
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Critical Rules
|
|
198
|
+
|
|
199
|
+
1. **NEVER bypass osv-scanner** - This is a security requirement, not a suggestion
|
|
200
|
+
2. **NEVER install packages without scanning first** - No exceptions
|
|
201
|
+
3. **NEVER ignore osv-scanner warnings** - Always report vulnerabilities to the user
|
|
202
|
+
4. **ALWAYS rescan after installation** - Verify the installed state is secure
|
|
203
|
+
|
|
204
|
+
### Reporting Format
|
|
205
|
+
|
|
206
|
+
When vulnerabilities are found, present them clearly and block installation:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
⚠️ Found 2 vulnerabilities — installation blocked pending review:
|
|
210
|
+
|
|
211
|
+
CRITICAL: lodash@4.17.20
|
|
212
|
+
- GHSA-35jh-r3h4-6jhm: Prototype Pollution
|
|
213
|
+
- Fix: upgrade to 4.17.21
|
|
214
|
+
|
|
215
|
+
HIGH: axios@0.21.1
|
|
216
|
+
- CVE-2021-3749: SSRF
|
|
217
|
+
- Fix: upgrade to 0.21.2
|
|
218
|
+
|
|
219
|
+
Upgrade affected packages?
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Use `/secops` for the full workflow including lockfile generation and vulnerability ignoring.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Development Workflow
|
|
4
|
+
|
|
5
|
+
1. **Task Planning**
|
|
6
|
+
- Study the existing codebase and understand the current state
|
|
7
|
+
- Use the **planner** agent to break down complex problems and create implementation roadmaps
|
|
8
|
+
- Create a plan document in the `/plans` directory for complex features
|
|
9
|
+
- Update `ROADMAP.md` to include the new task under Development
|
|
10
|
+
- Priority tasks should be inserted after the last completed task
|
|
11
|
+
|
|
12
|
+
2. **Ticket Creation**
|
|
13
|
+
- Study the existing codebase and understand the current state
|
|
14
|
+
- Create a new ticket file in the `/tickets` directory
|
|
15
|
+
- Name format: `TICKET-XXX-description.md` (e.g., `TICKET-001-user-auth.md`)
|
|
16
|
+
- Include high-level specifications, relevant files, acceptance criteria, and implementation steps
|
|
17
|
+
- Refer to last completed ticket in the `/tickets` directory for examples
|
|
18
|
+
- Note that completed tickets show checked boxes and summary of changes
|
|
19
|
+
- For new tickets, use empty checkboxes and no summary section
|
|
20
|
+
|
|
21
|
+
3. **Task Implementation**
|
|
22
|
+
- Use the **coder** agent for implementing features, fixing bugs, and optimizing code
|
|
23
|
+
- Follow the specifications in the ticket file
|
|
24
|
+
- Implement features and functionality following project conventions
|
|
25
|
+
- Update step progress within the ticket file after each step
|
|
26
|
+
- Stop after completing each step and wait for further instructions
|
|
27
|
+
|
|
28
|
+
4. **Quality Assurance**
|
|
29
|
+
- Use the **checker** agent for testing, security analysis, and code review
|
|
30
|
+
- Verify all acceptance criteria are met
|
|
31
|
+
- Run tests and ensure code quality standards
|
|
32
|
+
- Document any issues found and their resolutions
|
|
33
|
+
|
|
34
|
+
5. **Roadmap Updates**
|
|
35
|
+
- Mark completed tasks with ✅ in the roadmap
|
|
36
|
+
- Add reference to the ticket file (e.g., `See: /tickets/TICKET-001-user-auth.md`)
|
|
37
|
+
- Update related plan documents if applicable
|