@raftlabs/raftstack 1.9.1 → 1.9.3
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/.claude/commands/raftstack/_planning-protocol.md +216 -0
- package/.claude/commands/raftstack/discover.md +53 -9
- package/.claude/commands/raftstack/help.md +63 -23
- package/.claude/commands/raftstack/index.md +49 -22
- package/.claude/commands/raftstack/init-context.md +54 -9
- package/.claude/commands/raftstack/inject.md +57 -11
- package/.claude/commands/raftstack/shape.md +102 -21
- package/.claude/settings.json +27 -0
- package/.claude/subagents/quick-fix.md +21 -0
- package/dist/cli.js +96 -28
- package/dist/cli.js.map +1 -1
- package/package.json +4 -2
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Surface relevant standards and skills for the current work context.
|
|
4
4
|
|
|
5
|
+
## 🔒 Planning Protocol
|
|
6
|
+
|
|
7
|
+
This command follows the RaftStack Planning Protocol:
|
|
8
|
+
- **No file modifications** - This command is read-only (context injection for planning)
|
|
9
|
+
- If user wants to implement after injecting context, recommend `/raftstack/shape [task]`
|
|
10
|
+
- That command will handle planning and approval gates
|
|
11
|
+
|
|
12
|
+
**Reference:** See `_planning-protocol.md` for full protocol details.
|
|
13
|
+
|
|
5
14
|
## Arguments
|
|
6
15
|
|
|
7
16
|
- `$ARGUMENTS` - (Optional) Specific domain or task context (e.g., "React component", "API endpoint", "database migration")
|
|
@@ -15,6 +24,15 @@ Surface relevant standards and skills for the current work context.
|
|
|
15
24
|
|
|
16
25
|
Never use plain text questions - always use the structured `AskUserQuestion` tool.
|
|
17
26
|
|
|
27
|
+
## Important Note About Implementation
|
|
28
|
+
|
|
29
|
+
**This command does NOT implement code.** It only surfaces relevant context for planning.
|
|
30
|
+
|
|
31
|
+
After injecting context, if the user wants to proceed with implementation:
|
|
32
|
+
1. Recommend running `/raftstack/shape [task description]`
|
|
33
|
+
2. The shape command will plan the work and require approval before implementation
|
|
34
|
+
3. Never proceed directly to implementation from this command
|
|
35
|
+
|
|
18
36
|
## Phase 1: Context Detection
|
|
19
37
|
|
|
20
38
|
If no specific context provided, infer from:
|
|
@@ -39,24 +57,23 @@ If context is unclear, use `AskUserQuestion`:
|
|
|
39
57
|
|
|
40
58
|
## Phase 2: Standards Discovery
|
|
41
59
|
|
|
42
|
-
Scan for standards files
|
|
60
|
+
Scan for standards files:
|
|
43
61
|
|
|
44
|
-
1. **
|
|
62
|
+
1. **Canonical locations:**
|
|
45
63
|
- `.claude/standards/` and subdirectories
|
|
46
|
-
- `
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
- `.claude/context/constitution.md`
|
|
65
|
+
|
|
66
|
+
2. **Legacy fallback (suggest migration):**
|
|
67
|
+
- `docs/standards/`, `standards/`, `*.standard.md`
|
|
68
|
+
- `CONSTITUTION.md`, `docs/constitution.md`
|
|
69
|
+
|
|
70
|
+
If found at legacy locations, suggest migration to `.claude/`.
|
|
49
71
|
|
|
50
|
-
|
|
72
|
+
3. **Match by domain:**
|
|
51
73
|
- React work → look for component, state, hooks standards
|
|
52
74
|
- API work → look for route, validation, error standards
|
|
53
75
|
- Database work → look for schema, query, migration standards
|
|
54
76
|
|
|
55
|
-
3. **Check for constitution/context:**
|
|
56
|
-
- `.claude/context/constitution.md`
|
|
57
|
-
- `CONSTITUTION.md`
|
|
58
|
-
- `docs/constitution.md`
|
|
59
|
-
|
|
60
77
|
## Phase 3: Skills Matching
|
|
61
78
|
|
|
62
79
|
Based on the detected domain, identify relevant RaftStack skills:
|
|
@@ -70,6 +87,28 @@ Based on the detected domain, identify relevant RaftStack skills:
|
|
|
70
87
|
| General | Code Quality | `.claude/skills/code-quality/SKILL.md` |
|
|
71
88
|
| Asana Integration | Asana Workflow | `.claude/skills/asana/SKILL.md` |
|
|
72
89
|
|
|
90
|
+
## Phase 3.5: Plugin Recommendations
|
|
91
|
+
|
|
92
|
+
Based on the detected domain, identify required Claude Code plugins:
|
|
93
|
+
|
|
94
|
+
### Plugin Enforcement Matrix
|
|
95
|
+
|
|
96
|
+
| Domain | Plugin | Skill/Tool | When to Trigger |
|
|
97
|
+
|--------|--------|------------|-----------------|
|
|
98
|
+
| React/Frontend/JSX | `frontend-design` | `/frontend-design` skill | Any UI component, JSX, CSS work |
|
|
99
|
+
| React/Frontend/JSX | `figma` | `/implement-design` | Figma files to code |
|
|
100
|
+
| Testing | `playwright` | Browser tools | E2E tests, browser automation |
|
|
101
|
+
| Testing | `superpowers` | `/tdd` skill | Test-driven development |
|
|
102
|
+
| Research/Documentation | `context7` | Documentation lookup | Getting library docs, API references |
|
|
103
|
+
| Code Review | `code-review` | `/code-review` | Before commits, PR creation |
|
|
104
|
+
| Code Review | `pr-review-toolkit` | `/review-pr` | Specialized review agents |
|
|
105
|
+
| Git/Commits | `commit-commands` | `/commit`, `/commit-push-pr` | Any git operations |
|
|
106
|
+
| Git/Commits | `github` | GitHub tools | Issue/PR management |
|
|
107
|
+
| Backend/API | `security-guidance` | Security warnings | API routes, handlers, auth |
|
|
108
|
+
| Deployment | `vercel` | Vercel tools | Deployment-related tasks |
|
|
109
|
+
| Project Management | `linear` | Linear tools | Task tracking with Linear |
|
|
110
|
+
| Project Management | `asana` | Asana tools | Task tracking with Asana |
|
|
111
|
+
|
|
73
112
|
## Phase 4: Context-Aware Summary
|
|
74
113
|
|
|
75
114
|
Present the injected context as a structured summary:
|
|
@@ -89,6 +128,13 @@ Present the injected context as a structured summary:
|
|
|
89
128
|
| [Name] | `[Path]` | [Trigger condition] |
|
|
90
129
|
| [Name] | `[Path]` | [Trigger condition] |
|
|
91
130
|
|
|
131
|
+
### 🔌 Recommended Plugins
|
|
132
|
+
| Plugin | Purpose | Skill to Use |
|
|
133
|
+
|--------|---------|--------------|
|
|
134
|
+
| [plugin] | [why needed for this domain] | `/[skill-name]` or [tool description] |
|
|
135
|
+
|
|
136
|
+
**Important:** Always use `context7` when researching libraries or getting documentation.
|
|
137
|
+
|
|
92
138
|
### Quick Reference (Most Important Rules)
|
|
93
139
|
1. **[Rule]** - [Brief explanation]
|
|
94
140
|
2. **[Rule]** - [Brief explanation]
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Plan a feature or task with scale-adaptive depth. Simple tasks get quick flow, complex tasks get full specs.
|
|
4
4
|
|
|
5
|
+
## 🔒 Planning Protocol
|
|
6
|
+
|
|
7
|
+
This command follows the RaftStack Planning Protocol:
|
|
8
|
+
- All changes are planned before implementation
|
|
9
|
+
- User approval is required before any file modifications
|
|
10
|
+
- Use `AskUserQuestion` for all approval gates
|
|
11
|
+
|
|
12
|
+
**Reference:** See `_planning-protocol.md` for full protocol details.
|
|
13
|
+
|
|
5
14
|
## Arguments
|
|
6
15
|
|
|
7
16
|
- `$ARGUMENTS` - Description of the feature or task to plan
|
|
@@ -13,6 +22,7 @@ Plan a feature or task with scale-adaptive depth. Simple tasks get quick flow, c
|
|
|
13
22
|
- Location negotiation
|
|
14
23
|
- Option selection
|
|
15
24
|
- Clarification questions
|
|
25
|
+
- **Implementation approval** (required before any file operations)
|
|
16
26
|
|
|
17
27
|
Never use plain text questions - always use the structured `AskUserQuestion` tool.
|
|
18
28
|
|
|
@@ -63,12 +73,14 @@ After assessment, use `AskUserQuestion` to confirm the complexity level:
|
|
|
63
73
|
|
|
64
74
|
## Phase 2: Execute Based on Scale
|
|
65
75
|
|
|
76
|
+
**IMPORTANT:** Each flow level (Quick/Light/Full) MUST include an approval gate before implementation.
|
|
77
|
+
|
|
66
78
|
### Quick Flow (Simple Tasks)
|
|
67
79
|
|
|
68
80
|
1. Clarify scope in 2-3 sentences
|
|
69
81
|
2. Identify the file(s) to change
|
|
70
82
|
3. Describe the change briefly
|
|
71
|
-
4.
|
|
83
|
+
4. **WAIT FOR APPROVAL** - Do NOT implement yet
|
|
72
84
|
|
|
73
85
|
Output format:
|
|
74
86
|
```markdown
|
|
@@ -81,12 +93,31 @@ Output format:
|
|
|
81
93
|
**Files:** [1-2 files]
|
|
82
94
|
**Approach:** [Brief description]
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**Your options:** [A] Proceed to implement [B] Add more detail [C] Change approach [D] Cancel
|
|
96
|
+
### 🔌 Use These Plugins
|
|
97
|
+
- [Plugin based on domain detected]
|
|
87
98
|
```
|
|
88
99
|
|
|
89
|
-
|
|
100
|
+
#### ⚠️ PLANNING GATE (Quick Flow)
|
|
101
|
+
|
|
102
|
+
**DO NOT IMPLEMENT WITHOUT USER APPROVAL**
|
|
103
|
+
|
|
104
|
+
Before implementing:
|
|
105
|
+
|
|
106
|
+
1. **Present the Plan Above** (already done)
|
|
107
|
+
|
|
108
|
+
2. **Request Approval** using `AskUserQuestion` with these options:
|
|
109
|
+
- [A] Proceed to implement (Recommended)
|
|
110
|
+
- [B] Add more detail
|
|
111
|
+
- [C] Change approach
|
|
112
|
+
- [D] Cancel
|
|
113
|
+
|
|
114
|
+
3. **Implementation Rules:**
|
|
115
|
+
- ✅ Wait for explicit [A] selection
|
|
116
|
+
- ✅ If [B] selected, provide more detail and re-present
|
|
117
|
+
- ✅ If [C] selected, revise approach and re-present
|
|
118
|
+
- ❌ Never skip approval
|
|
119
|
+
- ❌ Never implement without [A] selection
|
|
120
|
+
- ❌ Never create/modify files before approval
|
|
90
121
|
|
|
91
122
|
### Light Spec (Medium Tasks)
|
|
92
123
|
|
|
@@ -94,6 +125,7 @@ Use `AskUserQuestion` for options.
|
|
|
94
125
|
2. Identify related code patterns to follow
|
|
95
126
|
3. List files to create/modify
|
|
96
127
|
4. Note any standards to apply
|
|
128
|
+
5. **WAIT FOR APPROVAL** - Do NOT implement yet
|
|
97
129
|
|
|
98
130
|
Output format:
|
|
99
131
|
```markdown
|
|
@@ -113,14 +145,40 @@ Output format:
|
|
|
113
145
|
2. [Step with file path]
|
|
114
146
|
3. [Step with file path]
|
|
115
147
|
|
|
148
|
+
### 🔌 Plugins to Use
|
|
149
|
+
| Plugin | Purpose | When |
|
|
150
|
+
|--------|---------|------|
|
|
151
|
+
| [Plugin] | [Why needed] | [Trigger condition] |
|
|
152
|
+
|
|
153
|
+
**Important:** Always use `context7` when researching libraries or getting documentation.
|
|
154
|
+
|
|
116
155
|
### Standards to Apply
|
|
117
156
|
- [Reference any discovered standards: @.claude/standards/...]
|
|
118
157
|
- [Reference any skills: @.claude/skills/...]
|
|
119
|
-
|
|
120
|
-
**Your options:** [A] Proceed to implement [B] Save spec to file [C] Modify plan [D] Upgrade to full spec
|
|
121
158
|
```
|
|
122
159
|
|
|
123
|
-
|
|
160
|
+
#### ⚠️ PLANNING GATE (Light Spec)
|
|
161
|
+
|
|
162
|
+
**DO NOT IMPLEMENT WITHOUT USER APPROVAL**
|
|
163
|
+
|
|
164
|
+
Before implementing:
|
|
165
|
+
|
|
166
|
+
1. **Present the Plan Above** (already done)
|
|
167
|
+
|
|
168
|
+
2. **Request Approval** using `AskUserQuestion` with these options:
|
|
169
|
+
- [A] Proceed to implement (Recommended)
|
|
170
|
+
- [B] Save spec to file
|
|
171
|
+
- [C] Modify plan
|
|
172
|
+
- [D] Upgrade to full spec
|
|
173
|
+
|
|
174
|
+
3. **Implementation Rules:**
|
|
175
|
+
- ✅ Wait for explicit [A] selection
|
|
176
|
+
- ✅ If [B] selected, save spec and await further instructions
|
|
177
|
+
- ✅ If [C] selected, revise plan and re-present
|
|
178
|
+
- ✅ If [D] selected, transition to Full Spec workflow
|
|
179
|
+
- ❌ Never skip approval
|
|
180
|
+
- ❌ Never implement without [A] selection
|
|
181
|
+
- ❌ Never create/modify files before approval
|
|
124
182
|
|
|
125
183
|
### Full Spec (Complex Tasks)
|
|
126
184
|
|
|
@@ -146,13 +204,11 @@ Use `AskUserQuestion` for options.
|
|
|
146
204
|
- Phase 2: Edge cases/polish
|
|
147
205
|
- Phase 3: Testing/docs
|
|
148
206
|
|
|
149
|
-
5. **
|
|
207
|
+
5. **Spec folder location:**
|
|
150
208
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
- Option C: `specs/[feature-slug]/` - At project root
|
|
155
|
-
- Option D: Other (let user specify)
|
|
209
|
+
Specs are always saved at: `.claude/specs/{YYYY-MM-DD-HHMM}-{feature-slug}/`
|
|
210
|
+
|
|
211
|
+
**Note:** For business requirements (PRD, user stories), use `docs/prd/` instead.
|
|
156
212
|
|
|
157
213
|
## Full Spec Folder Structure
|
|
158
214
|
|
|
@@ -204,6 +260,13 @@ After creating the spec folder, present:
|
|
|
204
260
|
- **references.md:** [N] similar patterns found
|
|
205
261
|
- **architecture.md:** Technical design
|
|
206
262
|
|
|
263
|
+
### 🔌 Plugins & Skills
|
|
264
|
+
| Plugin | Purpose | When |
|
|
265
|
+
|--------|---------|------|
|
|
266
|
+
| [Plugin] | [Why needed] | [Trigger condition] |
|
|
267
|
+
|
|
268
|
+
**Important:** Always use `context7` when researching libraries or getting documentation.
|
|
269
|
+
|
|
207
270
|
### 🔍 Implementation Phases
|
|
208
271
|
1. **Phase 1:** [Core functionality] - [N files]
|
|
209
272
|
2. **Phase 2:** [Edge cases] - [N files]
|
|
@@ -213,22 +276,40 @@ After creating the spec folder, present:
|
|
|
213
276
|
- [Risk or complexity] - **Mitigation:** [How to handle]
|
|
214
277
|
- [Dependency or blocker] - **Status:** [Current state]
|
|
215
278
|
|
|
216
|
-
###
|
|
279
|
+
### 📁 Spec Location
|
|
217
280
|
Spec folder created at: `{path}`
|
|
218
|
-
|
|
219
|
-
**Your options:** [A] Start implementation [B] Review spec files [C] Modify architecture [D] Add more detail
|
|
220
281
|
```
|
|
221
282
|
|
|
222
|
-
|
|
283
|
+
#### ⚠️ PLANNING GATE (Full Spec)
|
|
284
|
+
|
|
285
|
+
**DO NOT IMPLEMENT WITHOUT USER APPROVAL**
|
|
286
|
+
|
|
287
|
+
Before implementing:
|
|
288
|
+
|
|
289
|
+
1. **Present the Plan Above** (already done)
|
|
290
|
+
|
|
291
|
+
2. **Request Approval** using `AskUserQuestion` with these options:
|
|
292
|
+
- [A] Start implementation (Recommended)
|
|
293
|
+
- [B] Review spec files in detail
|
|
294
|
+
- [C] Modify architecture
|
|
295
|
+
- [D] Add more detail
|
|
296
|
+
|
|
297
|
+
3. **Implementation Rules:**
|
|
298
|
+
- ✅ Wait for explicit [A] selection
|
|
299
|
+
- ✅ If [B] selected, review spec files and re-present
|
|
300
|
+
- ✅ If [C] selected, revise architecture and re-present
|
|
301
|
+
- ✅ If [D] selected, expand spec and re-present
|
|
302
|
+
- ❌ Never skip approval
|
|
303
|
+
- ❌ Never implement without [A] selection
|
|
304
|
+
- ❌ Never create/modify code files before approval
|
|
305
|
+
- ✅ Spec folder creation is allowed (it's planning, not implementation)
|
|
223
306
|
|
|
224
307
|
## Phase 3: Standards Injection
|
|
225
308
|
|
|
226
309
|
Before finalizing the plan, check for relevant standards and skills:
|
|
227
310
|
|
|
228
|
-
1. Scan for standards
|
|
311
|
+
1. Scan for standards at canonical location:
|
|
229
312
|
- `.claude/standards/`
|
|
230
|
-
- `docs/standards/`
|
|
231
|
-
- Project root (`*.standard.md`)
|
|
232
313
|
|
|
233
314
|
2. Identify relevant skills based on the task domain:
|
|
234
315
|
- React work → `@.claude/skills/react/SKILL.md`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"model": "opusplan",
|
|
3
|
+
"enabledPlugins": {
|
|
4
|
+
"frontend-design@claude-plugins-official": true,
|
|
5
|
+
"context7@claude-plugins-official": true,
|
|
6
|
+
"code-review@claude-plugins-official": true,
|
|
7
|
+
"github@claude-plugins-official": true,
|
|
8
|
+
"feature-dev@claude-plugins-official": true,
|
|
9
|
+
"typescript-lsp@claude-plugins-official": true,
|
|
10
|
+
"code-simplifier@claude-plugins-official": true,
|
|
11
|
+
"ralph-loop@claude-plugins-official": true,
|
|
12
|
+
"commit-commands@claude-plugins-official": true,
|
|
13
|
+
"playwright@claude-plugins-official": true,
|
|
14
|
+
"security-guidance@claude-plugins-official": true,
|
|
15
|
+
"pr-review-toolkit@claude-plugins-official": true,
|
|
16
|
+
"figma@claude-plugins-official": true,
|
|
17
|
+
"superpowers@claude-plugins-official": true,
|
|
18
|
+
"explanatory-output-style@claude-plugins-official": true,
|
|
19
|
+
"linear@claude-plugins-official": true,
|
|
20
|
+
"learning-output-style@claude-plugins-official": true,
|
|
21
|
+
"vercel@claude-plugins-official": true,
|
|
22
|
+
"asana@claude-plugins-official": true,
|
|
23
|
+
"claude-md-management@claude-plugins-official": true,
|
|
24
|
+
"claude-code-setup@claude-plugins-official": true,
|
|
25
|
+
"document-skills@anthropic-agent-skills": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quick-fix
|
|
3
|
+
description: Handle simple bug fixes, typos, small refactors, and one-liner changes
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Edit, Glob, Grep, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Quick Fix Agent
|
|
9
|
+
|
|
10
|
+
Use this agent for:
|
|
11
|
+
- Typo fixes
|
|
12
|
+
- Simple bug fixes (1-5 lines)
|
|
13
|
+
- Small refactors
|
|
14
|
+
- Config changes
|
|
15
|
+
- Import fixes
|
|
16
|
+
|
|
17
|
+
Do NOT use for:
|
|
18
|
+
- Multi-file changes
|
|
19
|
+
- Architecture decisions
|
|
20
|
+
- Complex debugging
|
|
21
|
+
- New features
|
package/dist/cli.js
CHANGED
|
@@ -1701,14 +1701,79 @@ async function generateClaudeCommands(targetDir) {
|
|
|
1701
1701
|
return result;
|
|
1702
1702
|
}
|
|
1703
1703
|
|
|
1704
|
-
// src/generators/
|
|
1704
|
+
// src/generators/claude-config.ts
|
|
1705
1705
|
import { existsSync as existsSync7 } from "fs";
|
|
1706
|
+
import { readdir as readdir3, copyFile as copyFile4 } from "fs/promises";
|
|
1707
|
+
import { join as join17, dirname as dirname4 } from "path";
|
|
1708
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
1709
|
+
function getPackageConfigDir() {
|
|
1710
|
+
const currentFilePath = fileURLToPath3(import.meta.url);
|
|
1711
|
+
const packageRoot = join17(dirname4(currentFilePath), "..");
|
|
1712
|
+
return join17(packageRoot, ".claude");
|
|
1713
|
+
}
|
|
1714
|
+
async function copyDirectory3(srcDir, destDir, result, baseDir) {
|
|
1715
|
+
await ensureDir(destDir);
|
|
1716
|
+
const entries = await readdir3(srcDir, { withFileTypes: true });
|
|
1717
|
+
for (const entry of entries) {
|
|
1718
|
+
const srcPath = join17(srcDir, entry.name);
|
|
1719
|
+
const destPath = join17(destDir, entry.name);
|
|
1720
|
+
const relativePath = destPath.replace(baseDir + "/", "");
|
|
1721
|
+
if (entry.isDirectory()) {
|
|
1722
|
+
await copyDirectory3(srcPath, destPath, result, baseDir);
|
|
1723
|
+
} else {
|
|
1724
|
+
if (existsSync7(destPath)) {
|
|
1725
|
+
const backupPath = await backupFile(destPath);
|
|
1726
|
+
if (backupPath) {
|
|
1727
|
+
result.backedUp.push(relativePath);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
await copyFile4(srcPath, destPath);
|
|
1731
|
+
result.created.push(relativePath);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
async function generateClaudeConfig(targetDir) {
|
|
1736
|
+
const result = {
|
|
1737
|
+
created: [],
|
|
1738
|
+
modified: [],
|
|
1739
|
+
skipped: [],
|
|
1740
|
+
backedUp: []
|
|
1741
|
+
};
|
|
1742
|
+
const packageConfigDir = getPackageConfigDir();
|
|
1743
|
+
const targetClaudeDir = join17(targetDir, ".claude");
|
|
1744
|
+
await ensureDir(targetClaudeDir);
|
|
1745
|
+
const settingsContent = JSON.stringify({ model: "opusplan" }, null, 2) + "\n";
|
|
1746
|
+
const settingsResult = await writeFileSafe(
|
|
1747
|
+
join17(targetClaudeDir, "settings.json"),
|
|
1748
|
+
settingsContent,
|
|
1749
|
+
{ backup: true }
|
|
1750
|
+
);
|
|
1751
|
+
if (settingsResult.created) {
|
|
1752
|
+
result.created.push(".claude/settings.json");
|
|
1753
|
+
if (settingsResult.backedUp) {
|
|
1754
|
+
result.backedUp.push(settingsResult.backedUp);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
const packageSubagentsDir = join17(packageConfigDir, "subagents");
|
|
1758
|
+
const targetSubagentsDir = join17(targetClaudeDir, "subagents");
|
|
1759
|
+
if (existsSync7(packageSubagentsDir)) {
|
|
1760
|
+
await copyDirectory3(packageSubagentsDir, targetSubagentsDir, result, targetDir);
|
|
1761
|
+
} else {
|
|
1762
|
+
console.warn(
|
|
1763
|
+
"Warning: Subagents directory not found in package. Skipping subagents generation."
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
return result;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
// src/generators/eslint.ts
|
|
1770
|
+
import { existsSync as existsSync8 } from "fs";
|
|
1706
1771
|
import { readFile as readFile4 } from "fs/promises";
|
|
1707
|
-
import { join as
|
|
1772
|
+
import { join as join18 } from "path";
|
|
1708
1773
|
async function hasReact(targetDir) {
|
|
1709
1774
|
try {
|
|
1710
|
-
const pkgPath =
|
|
1711
|
-
if (
|
|
1775
|
+
const pkgPath = join18(targetDir, "package.json");
|
|
1776
|
+
if (existsSync8(pkgPath)) {
|
|
1712
1777
|
const content = await readFile4(pkgPath, "utf-8");
|
|
1713
1778
|
const pkg = JSON.parse(content);
|
|
1714
1779
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
@@ -1720,8 +1785,8 @@ async function hasReact(targetDir) {
|
|
|
1720
1785
|
}
|
|
1721
1786
|
async function hasNextJs(targetDir) {
|
|
1722
1787
|
try {
|
|
1723
|
-
const pkgPath =
|
|
1724
|
-
if (
|
|
1788
|
+
const pkgPath = join18(targetDir, "package.json");
|
|
1789
|
+
if (existsSync8(pkgPath)) {
|
|
1725
1790
|
const content = await readFile4(pkgPath, "utf-8");
|
|
1726
1791
|
const pkg = JSON.parse(content);
|
|
1727
1792
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
@@ -2000,7 +2065,7 @@ async function generateEslint(targetDir, usesTypeScript, force = false) {
|
|
|
2000
2065
|
} else {
|
|
2001
2066
|
config = generateJsConfig();
|
|
2002
2067
|
}
|
|
2003
|
-
const configPath =
|
|
2068
|
+
const configPath = join18(targetDir, "eslint.config.mjs");
|
|
2004
2069
|
const writeResult = await writeFileSafe(configPath, config);
|
|
2005
2070
|
if (writeResult.backedUp) {
|
|
2006
2071
|
result.backedUp.push("eslint.config.mjs");
|
|
@@ -2010,7 +2075,7 @@ async function generateEslint(targetDir, usesTypeScript, force = false) {
|
|
|
2010
2075
|
}
|
|
2011
2076
|
|
|
2012
2077
|
// src/generators/quick-reference.ts
|
|
2013
|
-
import { join as
|
|
2078
|
+
import { join as join19 } from "path";
|
|
2014
2079
|
async function generateQuickReference(targetDir, pm) {
|
|
2015
2080
|
const result = {
|
|
2016
2081
|
created: [],
|
|
@@ -2018,7 +2083,7 @@ async function generateQuickReference(targetDir, pm) {
|
|
|
2018
2083
|
skipped: [],
|
|
2019
2084
|
backedUp: []
|
|
2020
2085
|
};
|
|
2021
|
-
const quickRefPath =
|
|
2086
|
+
const quickRefPath = join19(targetDir, ".github", "QUICK_REFERENCE.md");
|
|
2022
2087
|
const content = `# RaftStack Quick Reference
|
|
2023
2088
|
|
|
2024
2089
|
> One-page guide for the RaftStack Git workflow
|
|
@@ -2152,7 +2217,7 @@ ${pm.run} test
|
|
|
2152
2217
|
}
|
|
2153
2218
|
|
|
2154
2219
|
// src/generators/shared-configs.ts
|
|
2155
|
-
import { join as
|
|
2220
|
+
import { join as join20 } from "path";
|
|
2156
2221
|
function getEslintConfigPackageJson() {
|
|
2157
2222
|
return JSON.stringify(
|
|
2158
2223
|
{
|
|
@@ -2418,15 +2483,15 @@ async function generateSharedConfigs(targetDir, projectType) {
|
|
|
2418
2483
|
if (!isMonorepo(projectType)) {
|
|
2419
2484
|
return result;
|
|
2420
2485
|
}
|
|
2421
|
-
const packagesDir =
|
|
2422
|
-
const eslintConfigDir =
|
|
2486
|
+
const packagesDir = join20(targetDir, "packages");
|
|
2487
|
+
const eslintConfigDir = join20(packagesDir, "eslint-config");
|
|
2423
2488
|
await ensureDir(eslintConfigDir);
|
|
2424
2489
|
const eslintFiles = [
|
|
2425
|
-
{ path:
|
|
2426
|
-
{ path:
|
|
2427
|
-
{ path:
|
|
2428
|
-
{ path:
|
|
2429
|
-
{ path:
|
|
2490
|
+
{ path: join20(eslintConfigDir, "package.json"), content: getEslintConfigPackageJson(), name: "packages/eslint-config/package.json" },
|
|
2491
|
+
{ path: join20(eslintConfigDir, "base.js"), content: getBaseEslintConfig(), name: "packages/eslint-config/base.js" },
|
|
2492
|
+
{ path: join20(eslintConfigDir, "next.js"), content: getNextJsEslintConfig(), name: "packages/eslint-config/next.js" },
|
|
2493
|
+
{ path: join20(eslintConfigDir, "react-internal.js"), content: getReactInternalEslintConfig(), name: "packages/eslint-config/react-internal.js" },
|
|
2494
|
+
{ path: join20(eslintConfigDir, "vite.js"), content: getViteEslintConfig(), name: "packages/eslint-config/vite.js" }
|
|
2430
2495
|
];
|
|
2431
2496
|
for (const file of eslintFiles) {
|
|
2432
2497
|
const writeResult = await writeFileSafe(file.path, file.content, { backup: true });
|
|
@@ -2437,14 +2502,14 @@ async function generateSharedConfigs(targetDir, projectType) {
|
|
|
2437
2502
|
}
|
|
2438
2503
|
}
|
|
2439
2504
|
}
|
|
2440
|
-
const tsConfigDir =
|
|
2505
|
+
const tsConfigDir = join20(packagesDir, "typescript-config");
|
|
2441
2506
|
await ensureDir(tsConfigDir);
|
|
2442
2507
|
const tsFiles = [
|
|
2443
|
-
{ path:
|
|
2444
|
-
{ path:
|
|
2445
|
-
{ path:
|
|
2446
|
-
{ path:
|
|
2447
|
-
{ path:
|
|
2508
|
+
{ path: join20(tsConfigDir, "package.json"), content: getTsConfigPackageJson(), name: "packages/typescript-config/package.json" },
|
|
2509
|
+
{ path: join20(tsConfigDir, "base.json"), content: getBaseTsConfig(), name: "packages/typescript-config/base.json" },
|
|
2510
|
+
{ path: join20(tsConfigDir, "nextjs.json"), content: getNextJsTsConfig(), name: "packages/typescript-config/nextjs.json" },
|
|
2511
|
+
{ path: join20(tsConfigDir, "react-library.json"), content: getReactLibraryTsConfig(), name: "packages/typescript-config/react-library.json" },
|
|
2512
|
+
{ path: join20(tsConfigDir, "node-library.json"), content: getNodeLibraryTsConfig(), name: "packages/typescript-config/node-library.json" }
|
|
2448
2513
|
];
|
|
2449
2514
|
for (const file of tsFiles) {
|
|
2450
2515
|
const writeResult = await writeFileSafe(file.path, file.content, { backup: true });
|
|
@@ -2460,10 +2525,10 @@ async function generateSharedConfigs(targetDir, projectType) {
|
|
|
2460
2525
|
|
|
2461
2526
|
// src/utils/git.ts
|
|
2462
2527
|
import { execa } from "execa";
|
|
2463
|
-
import { existsSync as
|
|
2464
|
-
import { join as
|
|
2528
|
+
import { existsSync as existsSync9 } from "fs";
|
|
2529
|
+
import { join as join21 } from "path";
|
|
2465
2530
|
async function isGitRepo(targetDir = process.cwd()) {
|
|
2466
|
-
if (
|
|
2531
|
+
if (existsSync9(join21(targetDir, ".git"))) {
|
|
2467
2532
|
return true;
|
|
2468
2533
|
}
|
|
2469
2534
|
try {
|
|
@@ -2636,6 +2701,7 @@ async function runInit(targetDir = process.cwd()) {
|
|
|
2636
2701
|
includeAsana: !!config.asanaBaseUrl
|
|
2637
2702
|
}));
|
|
2638
2703
|
results.push(await generateClaudeCommands(targetDir));
|
|
2704
|
+
results.push(await generateClaudeConfig(targetDir));
|
|
2639
2705
|
results.push(await updateProjectPackageJson(targetDir, config));
|
|
2640
2706
|
spinner5.stop("Configuration files generated!");
|
|
2641
2707
|
} catch (error) {
|
|
@@ -3633,7 +3699,7 @@ async function runInstallCommands(targetDir = process.cwd()) {
|
|
|
3633
3699
|
// package.json
|
|
3634
3700
|
var package_default = {
|
|
3635
3701
|
name: "@raftlabs/raftstack",
|
|
3636
|
-
version: "1.9.
|
|
3702
|
+
version: "1.9.3",
|
|
3637
3703
|
description: "CLI tool for setting up Git hooks, commit conventions, and GitHub integration",
|
|
3638
3704
|
type: "module",
|
|
3639
3705
|
main: "./dist/index.js",
|
|
@@ -3651,7 +3717,9 @@ var package_default = {
|
|
|
3651
3717
|
"dist",
|
|
3652
3718
|
"templates",
|
|
3653
3719
|
".claude/skills",
|
|
3654
|
-
".claude/commands"
|
|
3720
|
+
".claude/commands",
|
|
3721
|
+
".claude/subagents",
|
|
3722
|
+
".claude/settings.json"
|
|
3655
3723
|
],
|
|
3656
3724
|
scripts: {
|
|
3657
3725
|
build: "tsup",
|