create-harness-vibe-coding 0.1.4 → 0.1.5
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 +25 -5
- package/package.json +1 -1
- package/src/index.js +43 -7
- package/templates/common/SETUP.md +23 -0
package/README.md
CHANGED
|
@@ -123,17 +123,37 @@ my-project/
|
|
|
123
123
|
|
|
124
124
|
## Usage
|
|
125
125
|
|
|
126
|
+
### Human
|
|
127
|
+
|
|
126
128
|
```bash
|
|
127
|
-
# Interactive mode
|
|
129
|
+
# Interactive mode — prompts for project name and directory
|
|
128
130
|
npx create-harness-vibe-coding@latest
|
|
131
|
+
```
|
|
129
132
|
|
|
130
|
-
|
|
131
|
-
npx create-harness-vibe-coding@latest my-app ./dist/my-app
|
|
133
|
+
### Agent / CI/CD
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
Agents and automation can skip all prompts with `-y`:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# One-liner with defaults (project name = my-vibe-project)
|
|
139
|
+
npx create-harness-vibe-coding@latest -y
|
|
140
|
+
|
|
141
|
+
# Named project, auto directory
|
|
142
|
+
npx create-harness-vibe-coding@latest my-app -y
|
|
143
|
+
|
|
144
|
+
# Named project, explicit directory
|
|
145
|
+
npx create-harness-vibe-coding@latest my-app ./dist/my-app -y
|
|
135
146
|
```
|
|
136
147
|
|
|
148
|
+
| Flag | Purpose |
|
|
149
|
+
|------|---------|
|
|
150
|
+
| `-y`, `--yes` | Skip all prompts. Uses positional args or defaults. |
|
|
151
|
+
| `-h`, `--help` | Print usage and exit. |
|
|
152
|
+
|
|
153
|
+
> [!TIP]
|
|
154
|
+
> Agents should always pass `-y` to avoid hanging on interactive prompts.
|
|
155
|
+
> If the agent needs to discover the CLI surface first, run with `--help`.
|
|
156
|
+
|
|
137
157
|
### After scaffolding, tell Claude:
|
|
138
158
|
|
|
139
159
|
```
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -4,10 +4,43 @@ import pc from 'picocolors';
|
|
|
4
4
|
import { askProjectName, askTargetDir } from './prompts.js';
|
|
5
5
|
import { generate } from './generator.js';
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
7
|
+
// ── CLI flags ──────────────────────────────────────────────
|
|
8
|
+
const raw = process.argv.slice(2);
|
|
9
|
+
const flags = new Set(raw.filter(a => a.startsWith('-')));
|
|
10
|
+
const has = name => flags.has(name) || flags.has(`--${name}`);
|
|
11
|
+
const showHelp = has('h') || has('help');
|
|
12
|
+
const skipPrompts = has('y') || has('yes');
|
|
13
|
+
|
|
14
|
+
if (showHelp) {
|
|
15
|
+
console.log('');
|
|
16
|
+
console.log(' create-harness-vibe-coding');
|
|
17
|
+
console.log('');
|
|
18
|
+
console.log(' Usage:');
|
|
19
|
+
console.log(' npx create-harness-vibe-coding@latest [project-name] [target-dir] [flags]');
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log(' Arguments:');
|
|
22
|
+
console.log(' project-name Name for the new project (default: my-vibe-project)');
|
|
23
|
+
console.log(' target-dir Directory to create the project in (default: ./<project-name>)');
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log(' Flags:');
|
|
26
|
+
console.log(' -y, --yes Skip all prompts, use defaults or provided args');
|
|
27
|
+
console.log(' -h, --help Show this help');
|
|
28
|
+
console.log('');
|
|
29
|
+
console.log(' Examples:');
|
|
30
|
+
console.log(' npx create-harness-vibe-coding@latest');
|
|
31
|
+
console.log(' npx create-harness-vibe-coding@latest -y');
|
|
32
|
+
console.log(' npx create-harness-vibe-coding@latest my-project');
|
|
33
|
+
console.log(' npx create-harness-vibe-coding@latest my-project ./dist/my-project -y');
|
|
34
|
+
console.log('');
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Positional args (non-flag)
|
|
39
|
+
const positional = raw.filter(a => !a.startsWith('-'));
|
|
40
|
+
const argName = positional[0];
|
|
41
|
+
const argDir = positional[1];
|
|
42
|
+
|
|
43
|
+
const DEFAULT_NAME = 'my-vibe-project';
|
|
11
44
|
|
|
12
45
|
console.log('');
|
|
13
46
|
console.log(pc.magenta('╔══════════════════════════════════════════╗'));
|
|
@@ -18,15 +51,18 @@ console.log('');
|
|
|
18
51
|
|
|
19
52
|
let projectName, targetDir;
|
|
20
53
|
|
|
21
|
-
// Non-interactive
|
|
22
|
-
if (argName) {
|
|
23
|
-
projectName = argName;
|
|
54
|
+
// Non-interactive: positionals provided OR -y/--yes flag set
|
|
55
|
+
if (argName || skipPrompts) {
|
|
56
|
+
projectName = argName || DEFAULT_NAME;
|
|
24
57
|
targetDir = argDir || `./${projectName}`;
|
|
25
58
|
|
|
26
59
|
console.log(pc.dim('────────────────────────────────────────────'));
|
|
27
60
|
console.log(` Project ${pc.green(projectName)}`);
|
|
28
61
|
console.log(` Directory ${pc.green(targetDir)}`);
|
|
29
62
|
console.log(` Creates ${pc.cyan('CLAUDE.md, docs/harness/PLAN.md, docs/, scripts/, .claude/, SETUP.md, tests/')}`);
|
|
63
|
+
if (skipPrompts) {
|
|
64
|
+
console.log(` Mode ${pc.dim('non-interactive (-y)')}`);
|
|
65
|
+
}
|
|
30
66
|
console.log(pc.dim('────────────────────────────────────────────'));
|
|
31
67
|
console.log('');
|
|
32
68
|
|
|
@@ -63,3 +63,26 @@ After bootstrap succeeds:
|
|
|
63
63
|
```bash
|
|
64
64
|
rm SETUP.md
|
|
65
65
|
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## For Agents (Self-Bootstrapping)
|
|
70
|
+
|
|
71
|
+
If you are an AI agent running `create-harness-vibe-coding` to scaffold your own project harness, use non-interactive mode:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx create-harness-vibe-coding@latest <project-name> <target-dir> -y
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Example:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx create-harness-vibe-coding@latest my-agent-project ./my-agent-project -y
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
After scaffolding, bootstrap the harness yourself:
|
|
84
|
+
|
|
85
|
+
1. Read `CLAUDE.md`, `MEMORY.md`, and `docs/README.md`.
|
|
86
|
+
2. Follow the Required Bootstrap Sequence above.
|
|
87
|
+
3. Run `node scripts/validate-harness.mjs --strict` when done.
|
|
88
|
+
4. Delete `SETUP.md`.
|