ccsetup 1.1.0 → 1.2.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.
Files changed (89) hide show
  1. package/README.md +100 -342
  2. package/bin/create-project.js +1616 -60
  3. package/bin/lib/claudeInterface.js +209 -0
  4. package/bin/lib/contextGenerator.js +287 -0
  5. package/bin/lib/scanner/index.js +28 -0
  6. package/bin/scan.js +367 -0
  7. package/lib/aiAgentSelector.js +155 -0
  8. package/lib/aiMergeHelper.js +112 -0
  9. package/lib/contextGenerator.js +574 -0
  10. package/lib/contextMerger.js +812 -0
  11. package/lib/progressReporter.js +88 -0
  12. package/lib/scanConfig.js +200 -0
  13. package/lib/scanner/fileAnalyzer.js +605 -0
  14. package/lib/scanner/index.js +164 -0
  15. package/lib/scanner/patterns.js +277 -0
  16. package/lib/scanner/projectDetector.js +147 -0
  17. package/lib/templates/README.md +176 -0
  18. package/lib/templates/catalog.js +230 -0
  19. package/lib/templates/filter.js +257 -0
  20. package/lib/templates/index.js +45 -0
  21. package/lib/templates/metadata/agents.json +413 -0
  22. package/lib/templates/metadata-extractor.js +329 -0
  23. package/lib/templates/search.js +356 -0
  24. package/package.json +11 -4
  25. package/template/{agents → .claude/agents}/checker.md +29 -0
  26. package/template/.claude/settings.json +15 -0
  27. package/template/.claude/skills/prd/SKILL.md +343 -0
  28. package/template/.claude/skills/ralph/SKILL.md +339 -0
  29. package/template/CLAUDE.md +39 -21
  30. package/template/CONTRIBUTING.md +37 -0
  31. package/template/GEMINI.md +126 -0
  32. package/template/agents/README.md +15 -171
  33. package/template/docs/ROADMAP.md +0 -36
  34. package/template/docs/agent-orchestration.md +24 -141
  35. package/template/hooks/workflow-selector/index.js +398 -0
  36. package/template/scripts/ralph/CLAUDE.md +174 -0
  37. package/template/scripts/ralph/ralph.sh +127 -0
  38. package/template/tickets/ticket-list.md +17 -68
  39. package/template/agents/ai-engineer.md +0 -31
  40. package/template/agents/api-documenter.md +0 -31
  41. package/template/agents/architect-review.md +0 -42
  42. package/template/agents/backend-architect.md +0 -29
  43. package/template/agents/business-analyst.md +0 -34
  44. package/template/agents/c-pro.md +0 -34
  45. package/template/agents/cloud-architect.md +0 -31
  46. package/template/agents/code-reviewer.md +0 -28
  47. package/template/agents/content-marketer.md +0 -34
  48. package/template/agents/context-manager.md +0 -63
  49. package/template/agents/cpp-pro.md +0 -37
  50. package/template/agents/customer-support.md +0 -34
  51. package/template/agents/data-engineer.md +0 -31
  52. package/template/agents/data-scientist.md +0 -28
  53. package/template/agents/database-admin.md +0 -31
  54. package/template/agents/database-optimizer.md +0 -31
  55. package/template/agents/debugger.md +0 -29
  56. package/template/agents/deployment-engineer.md +0 -31
  57. package/template/agents/devops-troubleshooter.md +0 -31
  58. package/template/agents/dx-optimizer.md +0 -62
  59. package/template/agents/error-detective.md +0 -31
  60. package/template/agents/frontend-developer.md +0 -30
  61. package/template/agents/golang-pro.md +0 -31
  62. package/template/agents/graphql-architect.md +0 -31
  63. package/template/agents/incident-responder.md +0 -73
  64. package/template/agents/javascript-pro.md +0 -34
  65. package/template/agents/legacy-modernizer.md +0 -31
  66. package/template/agents/ml-engineer.md +0 -31
  67. package/template/agents/mlops-engineer.md +0 -56
  68. package/template/agents/mobile-developer.md +0 -31
  69. package/template/agents/network-engineer.md +0 -31
  70. package/template/agents/payment-integration.md +0 -31
  71. package/template/agents/performance-engineer.md +0 -31
  72. package/template/agents/prompt-engineer.md +0 -58
  73. package/template/agents/python-pro.md +0 -31
  74. package/template/agents/quant-analyst.md +0 -31
  75. package/template/agents/risk-manager.md +0 -40
  76. package/template/agents/rust-pro.md +0 -34
  77. package/template/agents/sales-automator.md +0 -34
  78. package/template/agents/search-specialist.md +0 -58
  79. package/template/agents/security-auditor.md +0 -31
  80. package/template/agents/sql-pro.md +0 -34
  81. package/template/agents/terraform-specialist.md +0 -34
  82. package/template/agents/test-automator.md +0 -31
  83. /package/template/{agents → .claude/agents}/backend.md +0 -0
  84. /package/template/{agents → .claude/agents}/blockchain.md +0 -0
  85. /package/template/{agents → .claude/agents}/coder.md +0 -0
  86. /package/template/{agents → .claude/agents}/frontend.md +0 -0
  87. /package/template/{agents → .claude/agents}/planner.md +0 -0
  88. /package/template/{agents → .claude/agents}/researcher.md +0 -0
  89. /package/template/{agents → .claude/agents}/shadcn.md +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccsetup",
3
- "version": "1.1.0",
4
- "description": "Boilerplate for Claude Code projects with 50+ agents, tickets, plans, agent orchestration, and browse mode",
3
+ "version": "1.2.0",
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"
7
7
  },
@@ -26,6 +26,7 @@
26
26
  "homepage": "https://github.com/MrMarciaOng/ccsetup#readme",
27
27
  "files": [
28
28
  "bin/",
29
+ "lib/",
29
30
  "template/",
30
31
  "README.md"
31
32
  ],
@@ -34,7 +35,11 @@
34
35
  },
35
36
  "dependencies": {
36
37
  "@inquirer/checkbox": "^4.0.4",
37
- "@inquirer/select": "^4.0.4"
38
+ "@inquirer/select": "^4.0.4",
39
+ "@inquirer/confirm": "^5.0.0",
40
+ "@inquirer/prompts": "^7.0.0",
41
+ "clipboardy": "^4.0.0",
42
+ "minimatch": "^9.0.0"
38
43
  },
39
44
  "devDependencies": {
40
45
  "jest": "^30.0.5"
@@ -42,6 +47,8 @@
42
47
  "scripts": {
43
48
  "test": "jest",
44
49
  "test:watch": "jest --watch",
45
- "test:coverage": "jest --coverage"
50
+ "test:coverage": "jest --coverage",
51
+ "metadata:generate": "node scripts/generate-metadata.js",
52
+ "catalog:test": "node scripts/test-catalog.js"
46
53
  }
47
54
  }
@@ -66,4 +66,33 @@ Structure your findings as:
66
66
  4. Document all findings with clear reproduction steps
67
67
  5. Verify fixes and re-test as needed
68
68
 
69
+ ## Test File Management:
70
+ ### CRITICAL: Working Directory Rules
71
+ - **ALWAYS** create test files only within the project directory
72
+ - **NEVER** use absolute paths outside the project (e.g., /tmp, /var, ~/)
73
+ - **ALWAYS** use relative paths from the project root
74
+ - Create test files in appropriate subdirectories:
75
+ - `__test__/` or `__tests__/` for test files
76
+ - `test/` for test utilities and fixtures
77
+ - `spec/` for specification tests
78
+ - Project-specific test directories as defined
79
+
80
+ ### Test File Guidelines:
81
+ 1. **Location**: Place test files adjacent to the code being tested or in designated test directories
82
+ 2. **Naming**: Follow project conventions (e.g., `*.test.js`, `*.spec.ts`, `test_*.py`)
83
+ 3. **Structure**: Mirror the source code structure in test directories
84
+ 4. **Cleanup**: Ensure test files don't pollute the project with temporary data
85
+ 5. **Isolation**: Tests should be self-contained and not depend on external paths
86
+
87
+ ### Example Test File Creation:
88
+ ```bash
89
+ # GOOD - Project relative paths
90
+ mkdir -p __test__/unit
91
+ echo "test content" > __test__/unit/example.test.js
92
+
93
+ # BAD - External paths (NEVER DO THIS)
94
+ # echo "test" > /tmp/test.js
95
+ # mkdir ~/test-files
96
+ ```
97
+
69
98
  Be thorough but practical - focus on issues that impact functionality, security, or maintainability.
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "UserPromptSubmit": [
4
+ {
5
+ "matcher": ".*",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node $CLAUDE_PROJECT_DIR/.claude/hooks/workflow-selector/index.js"
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,343 @@
1
+ ---
2
+ name: prd
3
+ description: "Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out."
4
+ ---
5
+
6
+ # PRD Generator
7
+
8
+ Create detailed Product Requirements Documents that are clear, actionable, and grounded in the actual codebase.
9
+
10
+ ---
11
+
12
+ ## The Job
13
+
14
+ 1. **Scan the codebase** to understand tech stack, architecture, and existing patterns
15
+ 2. Receive a feature description from the user
16
+ 3. Ask 3-5 **codebase-informed** clarifying questions (with lettered options)
17
+ 4. Generate a structured PRD that references real files, components, and patterns
18
+ 5. Save to `tasks/prd-[feature-name].md`
19
+
20
+ **Important:** Do NOT start implementing. Just create the PRD.
21
+
22
+ ---
23
+
24
+ ## Step 1: Codebase Reconnaissance
25
+
26
+ Before asking the user anything, silently scan the project using Claude Code tools:
27
+
28
+ ### Detect Tech Stack
29
+ Use Glob and Read to find and inspect:
30
+ - `package.json`, `tsconfig.json`, `next.config.*` (Node/TypeScript/Next.js)
31
+ - `requirements.txt`, `pyproject.toml`, `setup.py` (Python)
32
+ - `go.mod` (Go)
33
+ - `Cargo.toml` (Rust)
34
+ - `Gemfile` (Ruby)
35
+ - `composer.json` (PHP)
36
+
37
+ Record: language, framework, package manager, key dependencies.
38
+
39
+ ### Detect Quality Checks
40
+ From the config files found above, identify:
41
+ - **Typecheck**: `tsconfig.json` exists → "Typecheck passes"
42
+ - **Linter**: `eslint`, `biome`, `ruff`, `golangci-lint` in deps or config → "Lint passes"
43
+ - **Test framework**: `jest`, `vitest`, `pytest`, `go test` → "Tests pass"
44
+ - **Build**: check `scripts` in package.json for `build`, `check`, etc.
45
+
46
+ These become the **default quality criteria** appended to every user story.
47
+
48
+ ### Scan Architecture
49
+ Use Glob to map the project structure:
50
+ - `src/**/*.{ts,tsx,js,jsx,py,go,rs}` — source file layout
51
+ - `**/schema.prisma`, `**/migrations/**`, `**/models/**` — database layer
52
+ - `**/api/**`, `**/routes/**`, `**/app/**/route.*` — API endpoints
53
+ - `**/components/**` — UI components
54
+ - `**/hooks/**`, `**/utils/**`, `**/lib/**` — shared utilities
55
+
56
+ ### Read Project Context
57
+ - Read `CLAUDE.md` (root and any nested) for project instructions and conventions
58
+ - Read existing PRDs in `tasks/prd-*.md` for format consistency
59
+ - Read `docs/ROADMAP.md` if it exists for current priorities
60
+
61
+ ### Build Context Summary
62
+ Compile findings into an internal context block (do not show to user):
63
+ ```
64
+ Tech: [framework] + [language] + [key deps]
65
+ Quality: [typecheck] [lint] [test] [build commands]
66
+ DB: [ORM/schema location]
67
+ API: [routing pattern, e.g., "Next.js App Router at app/api/"]
68
+ UI: [component library, e.g., "shadcn/ui in src/components/ui/"]
69
+ Existing patterns: [key files and conventions discovered]
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Step 2: Clarifying Questions
75
+
76
+ Ask only critical questions where the initial prompt is ambiguous. **Tailor questions to what you found in the codebase** — don't ask about tech stack if you already know it.
77
+
78
+ Focus on:
79
+
80
+ - **Problem/Goal:** What problem does this solve?
81
+ - **Core Functionality:** What are the key actions?
82
+ - **Scope/Boundaries:** What should it NOT do?
83
+ - **Success Criteria:** How do we know it's done?
84
+
85
+ ### Format Questions Like This:
86
+
87
+ ```
88
+ 1. What is the primary goal of this feature?
89
+ A. Improve user onboarding experience
90
+ B. Increase user retention
91
+ C. Reduce support burden
92
+ D. Other: [please specify]
93
+
94
+ 2. Who is the target user?
95
+ A. New users only
96
+ B. Existing users only
97
+ C. All users
98
+ D. Admin users only
99
+
100
+ 3. What is the scope?
101
+ A. Minimal viable version
102
+ B. Full-featured implementation
103
+ C. Just the backend/API
104
+ D. Just the UI
105
+ ```
106
+
107
+ This lets users respond with "1A, 2C, 3B" for quick iteration.
108
+
109
+ ### Codebase-Informed Questions
110
+
111
+ If your scan revealed relevant context, weave it into the questions:
112
+
113
+ - Found a database schema → "I see you have a `users` table with [fields]. Should this feature extend that table or create a new one?"
114
+ - Found existing components → "You already have a `DataTable` component in `src/components/ui/`. Should this feature reuse it?"
115
+ - Found API patterns → "Your API routes follow [pattern]. Should this feature add new routes under the same structure?"
116
+
117
+ Skip questions the codebase already answers. If the tech stack is clear, don't ask "What framework are you using?"
118
+
119
+ ---
120
+
121
+ ## Step 3: PRD Structure
122
+
123
+ Generate the PRD with these sections:
124
+
125
+ ### 1. Introduction/Overview
126
+ Brief description of the feature and the problem it solves.
127
+
128
+ ### 2. Tech Context
129
+ Auto-generated from your codebase scan. Include:
130
+ - **Stack:** Language, framework, key dependencies
131
+ - **Quality gates:** Which checks apply (typecheck, lint, test, build)
132
+ - **Relevant existing code:** File paths and patterns the feature should build on
133
+
134
+ This section helps implementers (human or AI) understand the codebase without re-scanning.
135
+
136
+ ### 3. Goals
137
+ Specific, measurable objectives (bullet list).
138
+
139
+ ### 4. User Stories
140
+ Each story needs:
141
+ - **Title:** Short descriptive name
142
+ - **Description:** "As a [user], I want [feature] so that [benefit]"
143
+ - **Acceptance Criteria:** Verifiable checklist of what "done" means
144
+
145
+ Each story should be small enough to implement in one focused session.
146
+
147
+ **Format:**
148
+ ```markdown
149
+ ### US-001: [Title]
150
+ **Description:** As a [user], I want [feature] so that [benefit].
151
+
152
+ **Acceptance Criteria:**
153
+ - [ ] Specific verifiable criterion
154
+ - [ ] Another criterion
155
+ - [ ] {auto-detected quality checks from Step 1}
156
+ - [ ] **[UI stories only]** Verify in browser using dev-browser skill
157
+ ```
158
+
159
+ **Important:**
160
+ - Acceptance criteria must be verifiable, not vague. "Works correctly" is bad. "Button shows confirmation dialog before deleting" is good.
161
+ - **For any story with UI changes:** Always include "Verify in browser using dev-browser skill" as acceptance criteria.
162
+ - **Quality criteria are auto-appended** based on Step 1 detection. Do not hardcode "Typecheck passes" — use whatever the project actually has.
163
+ - **Reference real file paths** when a story modifies or extends existing code (e.g., "Add column to schema in `prisma/schema.prisma`").
164
+
165
+ ### 5. Functional Requirements
166
+ Numbered list of specific functionalities:
167
+ - "FR-1: The system must allow users to..."
168
+ - "FR-2: When a user clicks X, the system must..."
169
+
170
+ Be explicit and unambiguous.
171
+
172
+ ### 6. Non-Goals (Out of Scope)
173
+ What this feature will NOT include. Critical for managing scope.
174
+
175
+ ### 7. Design Considerations (Optional)
176
+ - UI/UX requirements
177
+ - Link to mockups if available
178
+ - **Existing components to reuse** (reference actual paths found in scan, e.g., "`src/components/ui/DataTable.tsx`")
179
+
180
+ ### 8. Technical Considerations
181
+ - Known constraints or dependencies
182
+ - Integration points with existing systems (reference actual files/modules)
183
+ - Performance requirements
184
+ - **Dependency order:** Which stories must be completed before others (schema → backend → UI)
185
+
186
+ ### 9. Success Metrics
187
+ How will success be measured?
188
+ - "Reduce time to complete X by 50%"
189
+ - "Increase conversion rate by 10%"
190
+
191
+ ### 10. Open Questions
192
+ Remaining questions or areas needing clarification.
193
+
194
+ ---
195
+
196
+ ## Writing for AI Agents and Junior Developers
197
+
198
+ The PRD reader may be a junior developer or an autonomous AI agent (like Ralph). Therefore:
199
+
200
+ - Be explicit and unambiguous
201
+ - Reference actual file paths, not abstract descriptions
202
+ - Provide enough detail to understand purpose and core logic
203
+ - Number requirements for easy reference
204
+ - Use concrete examples where helpful
205
+ - Include the quality gates the project actually uses, not generic ones
206
+
207
+ ---
208
+
209
+ ## Output
210
+
211
+ - **Format:** Markdown (`.md`)
212
+ - **Location:** `tasks/`
213
+ - **Filename:** `prd-[feature-name].md` (kebab-case)
214
+
215
+ ---
216
+
217
+ ## Example PRD
218
+
219
+ ```markdown
220
+ # PRD: Task Priority System
221
+
222
+ ## Introduction
223
+
224
+ Add priority levels to tasks so users can focus on what matters most. Tasks can be marked as high, medium, or low priority, with visual indicators and filtering to help users manage their workload effectively.
225
+
226
+ ## Tech Context
227
+
228
+ - **Stack:** Next.js 14 (App Router) + TypeScript + Tailwind CSS
229
+ - **DB:** Prisma with PostgreSQL (`prisma/schema.prisma`)
230
+ - **UI:** shadcn/ui components in `src/components/ui/`
231
+ - **Quality gates:** Typecheck (`tsc --noEmit`), Lint (`eslint`), Tests (`vitest`)
232
+ - **Relevant code:**
233
+ - Task model: `prisma/schema.prisma` (Task table)
234
+ - Task list component: `src/components/TaskList.tsx`
235
+ - Task card component: `src/components/TaskCard.tsx`
236
+ - Existing badge component: `src/components/ui/Badge.tsx`
237
+ - API routes: `src/app/api/tasks/`
238
+
239
+ ## Goals
240
+
241
+ - Allow assigning priority (high/medium/low) to any task
242
+ - Provide clear visual differentiation between priority levels
243
+ - Enable filtering and sorting by priority
244
+ - Default new tasks to medium priority
245
+
246
+ ## User Stories
247
+
248
+ ### US-001: Add priority field to database
249
+ **Description:** As a developer, I need to store task priority so it persists across sessions.
250
+
251
+ **Acceptance Criteria:**
252
+ - [ ] Add `priority` enum ('high' | 'medium' | 'low', default 'medium') to Task model in `prisma/schema.prisma`
253
+ - [ ] Generate and run migration successfully
254
+ - [ ] Typecheck passes
255
+ - [ ] Lint passes
256
+
257
+ ### US-002: Display priority indicator on task cards
258
+ **Description:** As a user, I want to see task priority at a glance so I know what needs attention first.
259
+
260
+ **Acceptance Criteria:**
261
+ - [ ] Extend `src/components/TaskCard.tsx` to show priority using existing `Badge` component from `src/components/ui/Badge.tsx`
262
+ - [ ] Badge colors: red=high, yellow=medium, gray=low
263
+ - [ ] Priority visible without hovering or clicking
264
+ - [ ] Typecheck passes
265
+ - [ ] Lint passes
266
+ - [ ] Verify in browser using dev-browser skill
267
+
268
+ ### US-003: Add priority selector to task edit
269
+ **Description:** As a user, I want to change a task's priority when editing it.
270
+
271
+ **Acceptance Criteria:**
272
+ - [ ] Priority dropdown in task edit modal using shadcn `Select` component
273
+ - [ ] Shows current priority as selected
274
+ - [ ] Saves via existing PATCH `/api/tasks/[id]` route
275
+ - [ ] Typecheck passes
276
+ - [ ] Lint passes
277
+ - [ ] Verify in browser using dev-browser skill
278
+
279
+ ### US-004: Filter tasks by priority
280
+ **Description:** As a user, I want to filter the task list to see only high-priority items when I'm focused.
281
+
282
+ **Acceptance Criteria:**
283
+ - [ ] Add filter dropdown to `src/components/TaskList.tsx` with options: All | High | Medium | Low
284
+ - [ ] Filter persists in URL search params
285
+ - [ ] Empty state message when no tasks match filter
286
+ - [ ] Typecheck passes
287
+ - [ ] Lint passes
288
+ - [ ] Tests pass
289
+ - [ ] Verify in browser using dev-browser skill
290
+
291
+ ## Functional Requirements
292
+
293
+ - FR-1: Add `priority` field to Task model in `prisma/schema.prisma` ('high' | 'medium' | 'low', default 'medium')
294
+ - FR-2: Display colored priority badge on each task card via `Badge` component
295
+ - FR-3: Include priority selector in task edit modal using shadcn `Select`
296
+ - FR-4: Add priority filter dropdown to `TaskList` header
297
+ - FR-5: Sort by priority within each status column (high → medium → low)
298
+
299
+ ## Non-Goals
300
+
301
+ - No priority-based notifications or reminders
302
+ - No automatic priority assignment based on due date
303
+ - No priority inheritance for subtasks
304
+
305
+ ## Design Considerations
306
+
307
+ - Reuse existing `src/components/ui/Badge.tsx` with color variants
308
+ - Use shadcn `Select` for the filter and edit dropdowns (already in project deps)
309
+
310
+ ## Technical Considerations
311
+
312
+ - Filter state managed via URL search params (Next.js `useSearchParams`)
313
+ - Priority stored in database, not computed
314
+ - **Dependency order:** US-001 (schema) → US-002 (display) → US-003 (edit) → US-004 (filter)
315
+
316
+ ## Success Metrics
317
+
318
+ - Users can change priority in under 2 clicks
319
+ - High-priority tasks immediately visible at top of lists
320
+ - No regression in task list performance
321
+
322
+ ## Open Questions
323
+
324
+ - Should priority affect task ordering within a column?
325
+ - Should we add keyboard shortcuts for priority changes?
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Checklist
331
+
332
+ Before saving the PRD:
333
+
334
+ - [ ] Ran codebase reconnaissance (Step 1)
335
+ - [ ] Tech Context section reflects actual project stack and quality gates
336
+ - [ ] Asked codebase-informed clarifying questions with lettered options
337
+ - [ ] Incorporated user's answers
338
+ - [ ] User stories reference real file paths where applicable
339
+ - [ ] User stories are small and specific (one focused session each)
340
+ - [ ] Quality criteria match what the project actually uses (not hardcoded)
341
+ - [ ] Functional requirements are numbered and unambiguous
342
+ - [ ] Non-goals section defines clear boundaries
343
+ - [ ] Saved to `tasks/prd-[feature-name].md`