vibe-commander 0.2.0 → 0.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/AGENTS.md +1 -0
- package/README.ko.md +643 -0
- package/README.md +643 -0
- package/dist/adapters/cli/commands/git-helpers.js +5 -3
- package/dist/adapters/cli/commands/init-helpers.js +1 -1
- package/dist/adapters/cli/commands/io-helpers.js +6 -2
- package/dist/adapters/cli/commands/schema.js +7 -3
- package/dist/adapters/cli/commands/set-unit.js +8 -2
- package/dist/adapters/cli/commands/skill-install.js +10 -4
- package/dist/adapters/cli/formatters-schema.d.ts +17 -0
- package/dist/adapters/cli/formatters-schema.js +155 -0
- package/dist/adapters/cli/formatters-unit.d.ts +0 -8
- package/dist/adapters/cli/formatters-unit.js +0 -146
- package/dist/adapters/cli/index.js +2 -1
- package/dist/adapters/cli/router.d.ts +0 -12
- package/dist/adapters/cli/router.js +4 -103
- package/dist/adapters/cli/stdin-parser.d.ts +23 -0
- package/dist/adapters/cli/stdin-parser.js +109 -0
- package/dist/config/schema.d.ts +0 -9
- package/dist/config/schema.js +138 -56
- package/dist/core/renderers/index.d.ts +1 -1
- package/dist/core/renderers/index.js +1 -1
- package/dist/core/renderers/marker-utils.js +5 -3
- package/dist/core/renderers/schema-renderer.d.ts +16 -0
- package/dist/core/renderers/schema-renderer.js +21 -0
- package/dist/core/resolvers/index.d.ts +0 -2
- package/examples/nextjs-web.config.json +73 -0
- package/examples/python-backend.config.json +91 -0
- package/examples/tauri-app.config.json +95 -0
- package/examples/vscode-tasks.json +101 -0
- package/package.json +14 -2
- package/schemas/config-schema.json +409 -0
- package/skills/claude/SKILL.md +22 -0
- package/skills/common/cli-reference.md +22 -0
- package/skills/cursor/SKILL.md +22 -0
- package/dist/adapters/cli/formatters.d.ts +0 -2
- package/dist/adapters/cli/formatters.js +0 -3
package/README.md
ADDED
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
# vibe-commander
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/vibe-commander)
|
|
4
|
+
[](https://github.com/viilab/vibe-commander/blob/main/LICENSE)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
|
|
7
|
+
[English](README.md) | [한국어](README.ko.md)
|
|
8
|
+
|
|
9
|
+
**Unit-based vibe coding workflow automation** — Generate command file sections from a single unit ID, reducing manual context collection from **10 minutes to 10 seconds**.
|
|
10
|
+
|
|
11
|
+
vibe-commander automates the repetitive cycle of switching between work units: parsing plans, collecting dependencies, finding related commits, and assembling agent context — all driven by a single configuration file that adapts to any project structure.
|
|
12
|
+
|
|
13
|
+
## Why vibe-commander?
|
|
14
|
+
|
|
15
|
+
When using AI agents (Cursor, Claude Code, Gemini CLI) with a unit-based development pipeline, every unit switch requires manual context gathering:
|
|
16
|
+
|
|
17
|
+
**Before** — Manual workflow per unit switch:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
1. Check the roadmap for the next unit (~1 min)
|
|
21
|
+
2. Open the plan and identify dependencies (~2 min)
|
|
22
|
+
3. Locate dependent unit documents (plans, results) (~3 min)
|
|
23
|
+
4. Search git history for related commits (~2 min)
|
|
24
|
+
5. Write pairing question answers (~1 min)
|
|
25
|
+
6. Insert special request templates (~1 min)
|
|
26
|
+
7. Keep updating commit SHAs during work (ongoing)
|
|
27
|
+
─────────────────────────────────────────
|
|
28
|
+
Total: ~10–15 minutes per switch × 3–5 switches/day
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**After** — With vibe-commander:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
vc set-unit U-042[Mvp] # All context collected and assembled in ~10 seconds
|
|
35
|
+
vc update-commit # Commit SHA auto-tracked from HEAD
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
One command parses the plan, resolves dependencies, collects related documents and commits, renders the command file section, and handles pairing questions — all driven by your project config.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Option 1: Run instantly with npx (no install)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx vibe-commander init --from-existing
|
|
46
|
+
npx vibe-commander set-unit U-001[Mvp]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> **pnpm users**: Use `pnpm dlx vibe-commander` instead of `npx`.
|
|
50
|
+
|
|
51
|
+
### Option 2: Global install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g vibe-commander
|
|
55
|
+
# or: pnpm add -g vibe-commander
|
|
56
|
+
# or: yarn global add vibe-commander
|
|
57
|
+
|
|
58
|
+
vc init --from-existing
|
|
59
|
+
vc set-unit U-001[Mvp]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Option 3: Project devDependency
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install -D vibe-commander
|
|
66
|
+
# or: pnpm add -D vibe-commander
|
|
67
|
+
# or: yarn add -D vibe-commander
|
|
68
|
+
|
|
69
|
+
npx vc init --from-existing
|
|
70
|
+
npx vc set-unit U-001[Mvp]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Important**: Use the same package manager as your project. Mixing package managers (e.g., running `npm install` in a pnpm project) can cause dependency resolution errors.
|
|
74
|
+
|
|
75
|
+
### First-time setup
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Scan existing project files to auto-generate config
|
|
79
|
+
vc init --from-existing
|
|
80
|
+
|
|
81
|
+
# Or create config interactively
|
|
82
|
+
vc init
|
|
83
|
+
|
|
84
|
+
# Validate the generated config
|
|
85
|
+
vc validate
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This creates `vibe-commander.config.json` in your project root, tailored to your directory structure, unit ID patterns, and document layout.
|
|
89
|
+
|
|
90
|
+
### Daily Workflow
|
|
91
|
+
|
|
92
|
+
Once set up, your daily cycle looks like this:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 1. See what's ready to work on
|
|
96
|
+
vc list-units
|
|
97
|
+
|
|
98
|
+
# 2. Switch to a unit — plan is parsed, deps collected, command file updated
|
|
99
|
+
vc set-unit U-042[Mvp]
|
|
100
|
+
|
|
101
|
+
# 3. Work with your AI agent (Cursor, Claude Code, etc.)
|
|
102
|
+
# The command file now has all the context the agent needs.
|
|
103
|
+
|
|
104
|
+
# 4. Track commits as you go
|
|
105
|
+
vc update-commit # Latest HEAD
|
|
106
|
+
vc update-commit 3 # Last 3 commits
|
|
107
|
+
vc update-commit --mode append # Add without replacing
|
|
108
|
+
|
|
109
|
+
# 5. Move to the next unit
|
|
110
|
+
vc set-unit U-043[Mvp]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## CLI Reference
|
|
114
|
+
|
|
115
|
+
| Command | Description |
|
|
116
|
+
|---------|-------------|
|
|
117
|
+
| `vc init` | Initialize project config (interactive or `--from-existing` scan) |
|
|
118
|
+
| `vc set-unit <unitId>` | Set current working unit — auto-generates command file section |
|
|
119
|
+
| `vc update-commit [sha\|N]` | Update commit SHA (no arg = HEAD, number = recent N commits) |
|
|
120
|
+
| `vc list-units` | List incomplete units with dependency status |
|
|
121
|
+
| `vc context <unitId>` | Read-only unit context query (no file modifications) |
|
|
122
|
+
| `vc validate` | Validate config file integrity (schema, paths, patterns) |
|
|
123
|
+
| `vc skill install` | Install SKILL files for AI agents |
|
|
124
|
+
| `vc schema [subcommand]` | Introspect CLI schema at runtime |
|
|
125
|
+
|
|
126
|
+
### vc set-unit
|
|
127
|
+
|
|
128
|
+
The core command. Parses the unit plan, collects all dependency documents and commits, and updates the command file — in one step.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Basic usage
|
|
132
|
+
vc set-unit U-042[Mvp]
|
|
133
|
+
|
|
134
|
+
# Preview changes without modifying files
|
|
135
|
+
vc set-unit U-042[Mvp] --dry-run
|
|
136
|
+
|
|
137
|
+
# Add custom special requests
|
|
138
|
+
vc set-unit U-042[Mvp] --request doc-update --request mcp-codrag
|
|
139
|
+
|
|
140
|
+
# JSON output for automation
|
|
141
|
+
vc set-unit U-042[Mvp] --json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### vc update-commit
|
|
145
|
+
|
|
146
|
+
Track commits as you work, without manually copying SHAs.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Auto-detect HEAD commit
|
|
150
|
+
vc update-commit
|
|
151
|
+
|
|
152
|
+
# Collect last 3 commits
|
|
153
|
+
vc update-commit 3
|
|
154
|
+
|
|
155
|
+
# Specific SHA
|
|
156
|
+
vc update-commit abc1234f
|
|
157
|
+
|
|
158
|
+
# Append instead of replace
|
|
159
|
+
vc update-commit --mode append
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### vc list-units
|
|
163
|
+
|
|
164
|
+
See what's ready to work on.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Show all incomplete units
|
|
168
|
+
vc list-units
|
|
169
|
+
|
|
170
|
+
# Filter by phase
|
|
171
|
+
vc list-units --phase Mvp
|
|
172
|
+
|
|
173
|
+
# Machine-readable output
|
|
174
|
+
vc list-units --json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### vc context
|
|
178
|
+
|
|
179
|
+
Read-only context query — useful for agents that need unit info without modifying the command file.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
vc context U-042[Mvp] --json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### vc schema
|
|
186
|
+
|
|
187
|
+
Runtime schema introspection for agents to discover CLI capabilities dynamically.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# JSON Schema for config file
|
|
191
|
+
vc schema config --json
|
|
192
|
+
|
|
193
|
+
# All available commands and their flags
|
|
194
|
+
vc schema commands --json
|
|
195
|
+
|
|
196
|
+
# Unit types and their ID patterns
|
|
197
|
+
vc schema types --json
|
|
198
|
+
|
|
199
|
+
# Save schema to file
|
|
200
|
+
vc schema config --json --output config-schema.json
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### vc validate
|
|
204
|
+
|
|
205
|
+
Four-stage config validation pipeline: schema check, path existence, regex validity, and pattern conflict detection.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
vc validate
|
|
209
|
+
vc validate --json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## SKILL Files for AI Agents
|
|
213
|
+
|
|
214
|
+
SKILL files teach AI agents how to use vibe-commander effectively. One command installs guides for all supported platforms:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Install for all platforms (Cursor + Claude Code + Gemini)
|
|
218
|
+
vc skill install
|
|
219
|
+
|
|
220
|
+
# Platform-specific
|
|
221
|
+
vc skill install --cursor
|
|
222
|
+
vc skill install --claude
|
|
223
|
+
vc skill install --gemini
|
|
224
|
+
|
|
225
|
+
# Force overwrite existing files
|
|
226
|
+
vc skill install --force
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
After installation, agents automatically discover the SKILL guide at:
|
|
230
|
+
|
|
231
|
+
- **Cursor**: `.cursor/skills/vibe-commander/SKILL.md`
|
|
232
|
+
- **Claude Code**: `.claude/skills/vibe-commander/SKILL.md`
|
|
233
|
+
- **Gemini**: `.gemini/skills/vibe-commander/SKILL.md`
|
|
234
|
+
|
|
235
|
+
## Agent-First Design
|
|
236
|
+
|
|
237
|
+
vibe-commander is built for AI agents as first-class consumers. Every design decision prioritizes agent usability.
|
|
238
|
+
|
|
239
|
+
### AGENTS.md
|
|
240
|
+
|
|
241
|
+
The project includes an [`AGENTS.md`](AGENTS.md) file (also bundled in the npm package) that agents read at conversation start. It contains:
|
|
242
|
+
|
|
243
|
+
- Quick command reference
|
|
244
|
+
- Invariant rules (always `--dry-run` first, always `--json`, validate inputs)
|
|
245
|
+
- Safe workflow examples
|
|
246
|
+
- Error handling patterns
|
|
247
|
+
|
|
248
|
+
### Structured Output
|
|
249
|
+
|
|
250
|
+
All commands support `--json` for machine-readable output following the `ToolResult<T>` structure:
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"success": true,
|
|
255
|
+
"data": {
|
|
256
|
+
"unitId": "U-042[Mvp]",
|
|
257
|
+
"title": "U-042[Mvp]: Add authentication module",
|
|
258
|
+
"depsFound": ["U-041[Mvp]"],
|
|
259
|
+
"docsFound": [
|
|
260
|
+
{ "unitId": "U-041[Mvp]", "role": "result", "path": "docs/results/U-041[Mvp].md" }
|
|
261
|
+
],
|
|
262
|
+
"commitsFound": ["a1b2c3d4"]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Errors are also structured:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"success": false,
|
|
272
|
+
"error": {
|
|
273
|
+
"code": "UNIT_TYPE_NOT_FOUND",
|
|
274
|
+
"message": "No matching unit type for: U-999",
|
|
275
|
+
"details": "Registered types: implement, refactor, checkpoint",
|
|
276
|
+
"suggestions": ["U-099[Mvp]", "U-100[Mmp]"]
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Dry-Run Mode
|
|
282
|
+
|
|
283
|
+
Preview changes before applying them — critical for agent safety:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
vc set-unit U-042[Mvp] --dry-run --json
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Input Safety
|
|
290
|
+
|
|
291
|
+
The CLI defends against agent hallucinations by rejecting dangerous patterns:
|
|
292
|
+
|
|
293
|
+
- Path traversal: `../`, `..\\`
|
|
294
|
+
- Control characters: ASCII < 0x20
|
|
295
|
+
- URL encoding: `%2e`, `%2F`
|
|
296
|
+
- Query parameters: `?`, `#`
|
|
297
|
+
|
|
298
|
+
Invalid unit IDs trigger fuzzy matching suggestions based on Levenshtein distance.
|
|
299
|
+
|
|
300
|
+
### Pipe Mode
|
|
301
|
+
|
|
302
|
+
For automation and orchestrators, pipe JSON via stdin:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
echo '{"unitId":"U-042[Mvp]"}' | vc set-unit --stdin --json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## VS Code Integration
|
|
309
|
+
|
|
310
|
+
vibe-commander provides VS Code Tasks for running `vc` commands directly from the editor without switching to a terminal. This is an optional DX enhancement — all features remain fully accessible via the command line.
|
|
311
|
+
|
|
312
|
+
### Quick Setup
|
|
313
|
+
|
|
314
|
+
Copy the tasks template to your project:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
# From npm package
|
|
318
|
+
cp node_modules/vibe-commander/examples/vscode-tasks.json .vscode/tasks.json
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If using `npx` instead of a global install, replace `vc` with `npx vc` in the task commands.
|
|
322
|
+
|
|
323
|
+
### Available Tasks
|
|
324
|
+
|
|
325
|
+
Access all tasks via `Ctrl+Shift+P` → **Tasks: Run Task**, or `Ctrl+Shift+B` to see the build task group:
|
|
326
|
+
|
|
327
|
+
| Task | Command | Description |
|
|
328
|
+
|------|---------|-------------|
|
|
329
|
+
| `vc: Set Unit` | `vc set-unit <unitId>` | Switch to a unit (prompts for ID) |
|
|
330
|
+
| `vc: Set Unit (Dry Run)` | `vc set-unit <unitId> --dry-run` | Preview changes without modifying files |
|
|
331
|
+
| `vc: Update Commit (HEAD)` | `vc update-commit` | Track latest HEAD commit |
|
|
332
|
+
| `vc: Update Commit (N)` | `vc update-commit <N>` | Track last N commits (prompts for count) |
|
|
333
|
+
| `vc: List Units` | `vc list-units` | Show incomplete units |
|
|
334
|
+
| `vc: Validate` | `vc validate` | Check config integrity |
|
|
335
|
+
| `vc: Context (JSON)` | `vc context <unitId> --json` | Read-only context query |
|
|
336
|
+
|
|
337
|
+
Tasks that require a unit ID will prompt for input via VS Code's input dialog (`${input:unitId}`).
|
|
338
|
+
|
|
339
|
+
### Recommended Keyboard Shortcuts
|
|
340
|
+
|
|
341
|
+
Tasks work without shortcuts via the Command Palette, but you can bind frequently used tasks for faster access. Add these to your `keybindings.json` (`Ctrl+Shift+P` → **Preferences: Open Keyboard Shortcuts (JSON)**):
|
|
342
|
+
|
|
343
|
+
```json
|
|
344
|
+
[
|
|
345
|
+
{
|
|
346
|
+
"key": "ctrl+shift+u",
|
|
347
|
+
"command": "workbench.action.tasks.runTask",
|
|
348
|
+
"args": "vc: Set Unit"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"key": "ctrl+shift+alt+u",
|
|
352
|
+
"command": "workbench.action.tasks.runTask",
|
|
353
|
+
"args": "vc: Set Unit (Dry Run)"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"key": "ctrl+shift+k",
|
|
357
|
+
"command": "workbench.action.tasks.runTask",
|
|
358
|
+
"args": "vc: Update Commit (HEAD)"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"key": "ctrl+shift+l",
|
|
362
|
+
"command": "workbench.action.tasks.runTask",
|
|
363
|
+
"args": "vc: List Units"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
> **Note**: Keybindings are user-level settings and may conflict with other extensions. Adjust key combinations to your preference.
|
|
369
|
+
|
|
370
|
+
## Configuration
|
|
371
|
+
|
|
372
|
+
vibe-commander adapts to any project through `vibe-commander.config.json`. The config defines your unit ID patterns, document paths, parsing rules, and command file structure.
|
|
373
|
+
|
|
374
|
+
### Minimal Config
|
|
375
|
+
|
|
376
|
+
```json
|
|
377
|
+
{
|
|
378
|
+
"$schema": "https://vibe-commander/config-schema.json",
|
|
379
|
+
"version": 1,
|
|
380
|
+
"paths": {
|
|
381
|
+
"commands": "docs/commands.md",
|
|
382
|
+
"roadmap": "docs/roadmap.md",
|
|
383
|
+
"docRoots": {
|
|
384
|
+
"plan": "docs/plans",
|
|
385
|
+
"result": "docs/results"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"unitTypes": [
|
|
389
|
+
{
|
|
390
|
+
"key": "feature",
|
|
391
|
+
"displayName": "Feature",
|
|
392
|
+
"idPattern": "^FEAT-\\d+$",
|
|
393
|
+
"planDir": "plan",
|
|
394
|
+
"commandSection": "# Current Feature",
|
|
395
|
+
"collectDeps": true,
|
|
396
|
+
"headerTemplate": "### Feature: {{title}}\n- Plan: @{{planPath}}\n- Commit: -"
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Config Sections
|
|
403
|
+
|
|
404
|
+
| Section | Purpose |
|
|
405
|
+
|---------|---------|
|
|
406
|
+
| `paths` | Document directories, command file, roadmap location |
|
|
407
|
+
| `unitTypes` | Unit type definitions with ID patterns, templates, and behavior |
|
|
408
|
+
| `docDiscovery` | How to find documents for each role (plan, result, runbook) |
|
|
409
|
+
| `planParsing` | How to extract title, dependencies, pairing questions from plans |
|
|
410
|
+
| `backlogParsing` | How to parse the roadmap/backlog for `list-units` |
|
|
411
|
+
| `commitSearch` | Git commit search strategy and filters |
|
|
412
|
+
| `commandSections` | Command file section separators and marker settings |
|
|
413
|
+
| `defaultSpecialRequests` | Default instructions appended to every unit |
|
|
414
|
+
| `specialRequestsByType` | Type-specific additional instructions |
|
|
415
|
+
| `customRequests` | Named request templates selectable with `--request <key>` |
|
|
416
|
+
|
|
417
|
+
### Auto-Detection
|
|
418
|
+
|
|
419
|
+
For existing projects, `vc init --from-existing` scans your file tree to detect:
|
|
420
|
+
|
|
421
|
+
- Unit ID patterns (from filenames)
|
|
422
|
+
- Document directory structure
|
|
423
|
+
- Section headers in command files
|
|
424
|
+
- Roadmap format
|
|
425
|
+
|
|
426
|
+
### Template Variables
|
|
427
|
+
|
|
428
|
+
Templates in `headerTemplate` and `docDiscovery` support these variables:
|
|
429
|
+
|
|
430
|
+
| Variable | Description | Example |
|
|
431
|
+
|----------|-------------|---------|
|
|
432
|
+
| `{{unitId}}` | Original unit ID | `U-042[Mvp]` |
|
|
433
|
+
| `{{shortId}}` | Phase removed | `U-042` |
|
|
434
|
+
| `{{bareId}}` | Number only | `042` |
|
|
435
|
+
| `{{title}}` | Full title (with ID) | `U-042[Mvp]: Add auth module` |
|
|
436
|
+
| `{{titleOnly}}` | Title without ID | `Add auth module` |
|
|
437
|
+
| `{{planPath}}` | Relative plan path | `docs/plans/U-042[Mvp].md` |
|
|
438
|
+
| `{{phase}}` | Phase string | `Mvp` |
|
|
439
|
+
| `{{slug}}` | Kebab-case | `u-042-mvp` |
|
|
440
|
+
|
|
441
|
+
## Architecture
|
|
442
|
+
|
|
443
|
+
vibe-commander follows a **4-layer architecture** with strict dependency direction:
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
Layer 4: Consumers ← Humans, AI agents, orchestrators
|
|
447
|
+
Layer 3: Adapters ← CLI, SKILL files, stdin/stdout pipe
|
|
448
|
+
Layer 2: Resolver ← Config-based project structure resolution
|
|
449
|
+
Layer 1: Core ← Pure functions (no side effects, no I/O)
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
- **Core** functions are pure: JSON in, JSON out. No `fs`, no `child_process`.
|
|
453
|
+
- **Resolver** absorbs project differences through config, not code.
|
|
454
|
+
- **Adapters** handle all I/O — file reads, git commands, user interaction.
|
|
455
|
+
- **Single production dependency**: [Zod](https://v4.zod.dev/) for runtime validation.
|
|
456
|
+
|
|
457
|
+
## Building from Source
|
|
458
|
+
|
|
459
|
+
### Prerequisites
|
|
460
|
+
|
|
461
|
+
- **Node.js** >= 24.0.0 (LTS) — [Download](https://nodejs.org/)
|
|
462
|
+
- **npm** >= 11 (included with Node.js 24)
|
|
463
|
+
- **Git** — [Download](https://git-scm.com/)
|
|
464
|
+
- **Windows**: Git Bash or WSL recommended for release scripts
|
|
465
|
+
|
|
466
|
+
Verify your environment:
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
node -v # Expected: v24.x.x
|
|
470
|
+
npm -v # Expected: 11.x.x
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Build Steps
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
# Clone the repository
|
|
477
|
+
git clone https://github.com/viilab/vibe-commander.git
|
|
478
|
+
cd vibe-commander
|
|
479
|
+
|
|
480
|
+
# Install dependencies
|
|
481
|
+
npm install
|
|
482
|
+
|
|
483
|
+
# Build TypeScript → dist/
|
|
484
|
+
npm run build
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
The build produces the `dist/` directory containing compiled JavaScript (`.js`) and TypeScript declaration (`.d.ts`) files.
|
|
488
|
+
|
|
489
|
+
### Local Testing
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
# Register globally for local testing
|
|
493
|
+
npm link
|
|
494
|
+
|
|
495
|
+
# Verify the CLI works
|
|
496
|
+
vc --help
|
|
497
|
+
vc --version
|
|
498
|
+
|
|
499
|
+
# Unlink when done
|
|
500
|
+
npm unlink -g vibe-commander
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
> **Windows note**: `npm link` may require administrator privileges. As an alternative, use `npx tsx src/adapters/cli/index.ts -- --help` during development.
|
|
504
|
+
|
|
505
|
+
### Clean Build
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
# Remove previous build artifacts and rebuild
|
|
509
|
+
rm -rf dist
|
|
510
|
+
npm run build
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
### Pre-PR Checklist
|
|
514
|
+
|
|
515
|
+
Before submitting a pull request, ensure the full quality gate passes:
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
npm run check
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
This runs typecheck → lint → format check → tests in sequence. All four stages must pass.
|
|
522
|
+
|
|
523
|
+
### Package Contents
|
|
524
|
+
|
|
525
|
+
The npm package includes the following files and directories:
|
|
526
|
+
|
|
527
|
+
| Path | Description |
|
|
528
|
+
|------|-------------|
|
|
529
|
+
| `dist/` | Compiled JavaScript and TypeScript declarations |
|
|
530
|
+
| `skills/` | SKILL files for AI agents (Cursor, Claude Code) |
|
|
531
|
+
| `schemas/` | JSON Schema for config validation and IDE autocompletion |
|
|
532
|
+
| `examples/` | Example configs (Tauri, Next.js, Python) and VS Code tasks template |
|
|
533
|
+
| `AGENTS.md` | Agent quick reference (bundled in package) |
|
|
534
|
+
| `README.md` | English documentation |
|
|
535
|
+
| `README.ko.md` | Korean documentation |
|
|
536
|
+
| `LICENSE` | MIT license |
|
|
537
|
+
|
|
538
|
+
To verify package contents locally:
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
npm pack --dry-run
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
## Contributing
|
|
545
|
+
|
|
546
|
+
### Development Setup
|
|
547
|
+
|
|
548
|
+
Follow the [Building from Source](#building-from-source) prerequisites, then:
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
git clone https://github.com/viilab/vibe-commander.git
|
|
552
|
+
cd vibe-commander
|
|
553
|
+
npm install
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### Available Scripts
|
|
557
|
+
|
|
558
|
+
```bash
|
|
559
|
+
npm run dev # Run with tsx (development)
|
|
560
|
+
npm run build # TypeScript build
|
|
561
|
+
npm run test # Run Vitest tests
|
|
562
|
+
npm run test:watch # Vitest watch mode
|
|
563
|
+
npm run test:coverage # Test coverage report
|
|
564
|
+
npm run lint # ESLint static analysis
|
|
565
|
+
npm run lint:fix # ESLint auto-fix
|
|
566
|
+
npm run typecheck # TypeScript type check
|
|
567
|
+
npm run format # Prettier formatting
|
|
568
|
+
npm run format:check # Prettier format check (no modifications)
|
|
569
|
+
npm run check # Full quality gate (typecheck + lint + format + test)
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Release Process
|
|
573
|
+
|
|
574
|
+
Releases use npm lifecycle hooks for a safe, automated pipeline:
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
# Dry run — verify everything passes without publishing
|
|
578
|
+
npm run release:dry
|
|
579
|
+
|
|
580
|
+
# Publish a patch release (0.2.0 → 0.2.1)
|
|
581
|
+
npm run release:patch
|
|
582
|
+
|
|
583
|
+
# Publish a minor release (0.2.0 → 0.3.0)
|
|
584
|
+
npm run release:minor
|
|
585
|
+
|
|
586
|
+
# Publish a major release (0.2.0 → 1.0.0)
|
|
587
|
+
npm run release:major
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Each release command automatically:
|
|
591
|
+
1. Checks for uncommitted changes
|
|
592
|
+
2. Runs the full quality gate (`typecheck + lint + format + test`)
|
|
593
|
+
3. Bumps the version and creates a git tag
|
|
594
|
+
4. Builds the TypeScript output
|
|
595
|
+
5. Publishes to npm
|
|
596
|
+
6. Pushes the version commit and tag to git
|
|
597
|
+
|
|
598
|
+
**Version Strategy** follows [Semantic Versioning](https://semver.org/):
|
|
599
|
+
|
|
600
|
+
| Change Type | Version Bump | Example |
|
|
601
|
+
|-------------|-------------|---------|
|
|
602
|
+
| Bug fixes, documentation | Patch | `0.2.0` → `0.2.1` |
|
|
603
|
+
| New features (backward-compatible) | Minor | `0.2.0` → `0.3.0` |
|
|
604
|
+
| Breaking changes | Major | `0.2.0` → `1.0.0` |
|
|
605
|
+
|
|
606
|
+
**Pre-Release Checklist**:
|
|
607
|
+
1. npm registry login verified: `npm whoami`
|
|
608
|
+
2. All quality gates pass: `npm run check`
|
|
609
|
+
3. Build succeeds: `npm run build`
|
|
610
|
+
4. `README.md` and `README.ko.md` are in sync
|
|
611
|
+
5. Package contents verified: `npm pack --dry-run`
|
|
612
|
+
|
|
613
|
+
**npm Login** — Required before the first publish or when your auth token has expired:
|
|
614
|
+
|
|
615
|
+
```bash
|
|
616
|
+
# Login (opens browser or prompts for credentials)
|
|
617
|
+
npm login
|
|
618
|
+
|
|
619
|
+
# Verify login
|
|
620
|
+
npm whoami
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
**Recovering from a Failed Publish** — If the release command succeeds at version bump and git push but fails at `npm publish` (e.g., 401/404 errors), the version is already tagged in git. Re-publish without bumping again:
|
|
624
|
+
|
|
625
|
+
```bash
|
|
626
|
+
npm publish --access public
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
### Documentation Sync
|
|
630
|
+
|
|
631
|
+
This project maintains two README files: `README.md` (English) and `README.ko.md` (Korean). When updating documentation, please keep both versions in sync. The English version is the source of truth for npm package pages.
|
|
632
|
+
|
|
633
|
+
### Project Principles
|
|
634
|
+
|
|
635
|
+
- **Config-driven universality** — project differences are absorbed by config, never hardcoded
|
|
636
|
+
- **Pure function core** — Layer 1 has no side effects (JSON in → JSON out)
|
|
637
|
+
- **Graceful degradation** — missing roadmap? `set-unit` still works. Missing runbook? Other docs still collected.
|
|
638
|
+
- **Minimal dependencies** — 1 production dep (Zod). Everything else uses Node.js built-ins.
|
|
639
|
+
- **Agent as component** — CLI, SKILL files, and stdin/stdout pipes serve humans, agents, and orchestrators alike.
|
|
640
|
+
|
|
641
|
+
## License
|
|
642
|
+
|
|
643
|
+
[MIT](LICENSE) © [viilab](https://github.com/viilab)
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { execSync } from 'node:child_process';
|
|
10
10
|
import { ok, fail } from '../../../types/index.js';
|
|
11
|
+
/** git CLI 실행 타임아웃 (밀리초) */
|
|
12
|
+
const GIT_EXEC_TIMEOUT_MS = 5_000;
|
|
11
13
|
/**
|
|
12
14
|
* 현재 HEAD 커밋의 short SHA(8자)를 반환한다
|
|
13
15
|
*
|
|
@@ -19,7 +21,7 @@ export function getHeadSha(projectRoot) {
|
|
|
19
21
|
const sha = execSync('git rev-parse --short=8 HEAD', {
|
|
20
22
|
cwd: projectRoot,
|
|
21
23
|
encoding: 'utf-8',
|
|
22
|
-
timeout:
|
|
24
|
+
timeout: GIT_EXEC_TIMEOUT_MS,
|
|
23
25
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
26
|
}).replace(/[\r\n]+$/, '');
|
|
25
27
|
if (!sha) {
|
|
@@ -47,7 +49,7 @@ export function getChangedFiles(projectRoot, sha) {
|
|
|
47
49
|
const output = execSync(`git diff-tree --no-commit-id --name-only -r ${sha}`, {
|
|
48
50
|
cwd: projectRoot,
|
|
49
51
|
encoding: 'utf-8',
|
|
50
|
-
timeout:
|
|
52
|
+
timeout: GIT_EXEC_TIMEOUT_MS,
|
|
51
53
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
52
54
|
});
|
|
53
55
|
const files = output
|
|
@@ -76,7 +78,7 @@ export function getRecentShas(projectRoot, count) {
|
|
|
76
78
|
const output = execSync(`git log --format=%h --abbrev=8 -n ${String(count)}`, {
|
|
77
79
|
cwd: projectRoot,
|
|
78
80
|
encoding: 'utf-8',
|
|
79
|
-
timeout:
|
|
81
|
+
timeout: GIT_EXEC_TIMEOUT_MS,
|
|
80
82
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
81
83
|
})
|
|
82
84
|
.replace(/\r\n/g, '\n')
|
|
@@ -15,6 +15,10 @@ import { loadConfig } from '../../../config/loader.js';
|
|
|
15
15
|
import { findDepCommits } from '../../../core/resolvers/dep-commit-resolver.js';
|
|
16
16
|
import { filterCommitsByChangedFiles } from '../../../core/resolvers/commit-filter.js';
|
|
17
17
|
import { getChangedFiles } from './git-helpers.js';
|
|
18
|
+
/** git log 조회 시 최대 커밋 수 */
|
|
19
|
+
const GIT_LOG_LIMIT = 200;
|
|
20
|
+
/** git log 실행 타임아웃 (밀리초) */
|
|
21
|
+
const GIT_LOG_TIMEOUT_MS = 10_000;
|
|
18
22
|
/**
|
|
19
23
|
* 커맨드 파일을 읽어 반환한다
|
|
20
24
|
*/
|
|
@@ -78,10 +82,10 @@ export function collectGitCommits(depIds, commitSearch, projectRoot) {
|
|
|
78
82
|
if (commitSearch.strategy === 'disabled')
|
|
79
83
|
return [];
|
|
80
84
|
try {
|
|
81
|
-
const output = execSync(
|
|
85
|
+
const output = execSync(`git log --pretty=oneline -${String(GIT_LOG_LIMIT)}`, {
|
|
82
86
|
cwd: projectRoot,
|
|
83
87
|
encoding: 'utf-8',
|
|
84
|
-
timeout:
|
|
88
|
+
timeout: GIT_LOG_TIMEOUT_MS,
|
|
85
89
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
86
90
|
});
|
|
87
91
|
const result = findDepCommits(depIds, output, commitSearch);
|