create-claude-workspace 1.1.19 → 1.1.21
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 +11 -12
- package/dist/index.js +44 -15
- package/dist/template/.claude/CLAUDE.md +2 -2
- package/dist/template/.claude/agents/project-initializer.md +1 -1
- package/dist/template/.claude/docker/docker-entrypoint.sh +1 -1
- package/dist/template/.claude/scripts/autonomous.mjs +449 -606
- package/dist/template/.claude/scripts/docker-run.mjs +270 -296
- package/dist/template/.claude/scripts/lib/claude-runner.mjs +402 -0
- package/dist/template/.claude/scripts/lib/errors.mjs +83 -0
- package/dist/template/.claude/scripts/lib/logger.mjs +59 -0
- package/dist/template/.claude/scripts/lib/state.mjs +65 -0
- package/dist/template/.claude/scripts/lib/types.mjs +20 -0
- package/dist/template/.claude/scripts/lib/utils.mjs +279 -0
- package/dist/template/.claude/templates/PLAN.md +76 -0
- package/dist/template/.claude/templates/claude-md.md +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -29,8 +29,8 @@ Answer the discovery questions (non-technical). Claude generates the full pipeli
|
|
|
29
29
|
|
|
30
30
|
Pick one:
|
|
31
31
|
|
|
32
|
-
- **Unattended** (recommended): `
|
|
33
|
-
- **Docker** (fully isolated): `
|
|
32
|
+
- **Unattended** (recommended): `npx create-claude-workspace run` — clean context per task, survives rate limits
|
|
33
|
+
- **Docker** (fully isolated): `npx create-claude-workspace docker` — container sandbox, safe `--skip-permissions`
|
|
34
34
|
- **Interactive**: `claude --agent orchestrator`, then `/ralph-loop:ralph-loop Continue autonomous development according to CLAUDE.md`
|
|
35
35
|
|
|
36
36
|
### npx Options
|
|
@@ -45,11 +45,11 @@ npx create-claude-workspace --docker # scaffold + run in Docker
|
|
|
45
45
|
### Docker Options
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ANTHROPIC_API_KEY=sk-...
|
|
48
|
+
npx create-claude-workspace docker --max-iterations 20 # limit iterations
|
|
49
|
+
npx create-claude-workspace docker --shell # interactive shell
|
|
50
|
+
npx create-claude-workspace docker --rebuild # force rebuild image
|
|
51
|
+
npx create-claude-workspace docker --login # run 'claude auth login' on host first
|
|
52
|
+
ANTHROPIC_API_KEY=sk-... npx create-claude-workspace docker # API key
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
**Authentication:** The Docker container uses your host machine's Claude auth automatically.
|
|
@@ -99,17 +99,16 @@ ralph-loop -> orchestrator agent (autonomous development)
|
|
|
99
99
|
|
|
100
100
|
## Autonomous Mode (Unattended)
|
|
101
101
|
|
|
102
|
-
The
|
|
102
|
+
The autonomous loop runs Claude Code in separate invocations with clean context per task. MEMORY.md maintains continuity between invocations.
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
# Unattended (
|
|
106
|
-
|
|
105
|
+
# Unattended (--skip-permissions is added automatically)
|
|
106
|
+
npx create-claude-workspace run
|
|
107
107
|
|
|
108
108
|
# Custom options
|
|
109
|
-
|
|
109
|
+
npx create-claude-workspace run --max-iterations 20 --delay 10000
|
|
110
110
|
|
|
111
111
|
# All options:
|
|
112
|
-
# --skip-permissions Required for unattended (adds --dangerously-skip-permissions)
|
|
113
112
|
# --max-iterations <n> Safety limit (default: 50)
|
|
114
113
|
# --max-turns <n> Max turns per Claude invocation (default: 50)
|
|
115
114
|
# --delay <ms> Pause between tasks (default: 5000)
|
package/dist/index.js
CHANGED
|
@@ -60,23 +60,34 @@ function printHelp() {
|
|
|
60
60
|
${C.b}create-claude-workspace${C.n} — Scaffold autonomous AI-driven development with Claude Code
|
|
61
61
|
|
|
62
62
|
${C.b}Usage:${C.n}
|
|
63
|
-
npx create-claude-workspace [directory] [options]
|
|
63
|
+
npx create-claude-workspace [directory] [options] # scaffold
|
|
64
|
+
npx create-claude-workspace run [options] # autonomous loop
|
|
65
|
+
npx create-claude-workspace docker [options] # Docker runner
|
|
66
|
+
npx create-claude-workspace validate # check prerequisites
|
|
64
67
|
|
|
65
|
-
${C.b}
|
|
68
|
+
${C.b}Scaffold options:${C.n}
|
|
66
69
|
directory Target directory (default: current directory)
|
|
67
|
-
|
|
68
|
-
${C.b}Options:${C.n}
|
|
69
70
|
--update Overwrite existing agent files with latest version
|
|
70
71
|
--run Start autonomous development after scaffolding
|
|
71
72
|
--docker Use Docker for autonomous run (implies --run)
|
|
72
73
|
-h, --help Show this help
|
|
73
74
|
|
|
75
|
+
${C.b}Run options:${C.n}
|
|
76
|
+
--max-iterations <n> Max iterations (default: 50)
|
|
77
|
+
--max-turns <n> Max turns per invocation (default: 50)
|
|
78
|
+
--process-timeout <ms> Max time per invocation (default: 1800000)
|
|
79
|
+
--activity-timeout <ms> Max silence before kill (default: 300000)
|
|
80
|
+
--notify-command <cmd> Shell command on critical events
|
|
81
|
+
--resume Resume from checkpoint
|
|
82
|
+
--dry-run Validate prerequisites only
|
|
83
|
+
See 'npx create-claude-workspace run --help' for all options.
|
|
84
|
+
|
|
74
85
|
${C.b}Examples:${C.n}
|
|
75
86
|
npx create-claude-workspace # scaffold in current directory
|
|
76
|
-
npx create-claude-workspace
|
|
77
|
-
npx create-claude-workspace --
|
|
78
|
-
npx create-claude-workspace
|
|
79
|
-
npx create-claude-workspace
|
|
87
|
+
npx create-claude-workspace run # start autonomous loop
|
|
88
|
+
npx create-claude-workspace run --resume # resume from checkpoint
|
|
89
|
+
npx create-claude-workspace docker # run in Docker
|
|
90
|
+
npx create-claude-workspace validate # check prerequisites
|
|
80
91
|
|
|
81
92
|
${C.b}What it creates:${C.n}
|
|
82
93
|
.claude/agents/ 10 specialist agents (orchestrator, architects, etc.)
|
|
@@ -90,6 +101,7 @@ ${C.b}What it creates:${C.n}
|
|
|
90
101
|
function ask(question) {
|
|
91
102
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
92
103
|
return new Promise((res) => {
|
|
104
|
+
rl.on('close', () => res(''));
|
|
93
105
|
rl.question(question, (answer) => {
|
|
94
106
|
rl.close();
|
|
95
107
|
res(answer.trim());
|
|
@@ -116,12 +128,14 @@ function listFiles(dir, base = dir) {
|
|
|
116
128
|
}
|
|
117
129
|
function ensureGitignore(targetDir) {
|
|
118
130
|
const gitignorePath = join(targetDir, '.gitignore');
|
|
119
|
-
const entries = ['.npmrc', '.docker-compose.auth.yml'];
|
|
131
|
+
const entries = ['.npmrc', '.docker-compose.auth.yml', '.claude/autonomous.log', '.claude/autonomous.lock', '.claude/autonomous-state.json'];
|
|
120
132
|
if (existsSync(gitignorePath)) {
|
|
121
133
|
let content = readFileSync(gitignorePath, 'utf-8');
|
|
122
134
|
const added = [];
|
|
135
|
+
if (!content.endsWith('\n'))
|
|
136
|
+
content += '\n';
|
|
123
137
|
for (const entry of entries) {
|
|
124
|
-
if (!content.
|
|
138
|
+
if (!content.split('\n').some(line => line.trim() === entry)) {
|
|
125
139
|
content += `\n${entry}`;
|
|
126
140
|
added.push(entry);
|
|
127
141
|
}
|
|
@@ -133,9 +147,9 @@ function ensureGitignore(targetDir) {
|
|
|
133
147
|
}
|
|
134
148
|
}
|
|
135
149
|
// ─── Run ───
|
|
136
|
-
function runAutonomous(targetDir, docker) {
|
|
150
|
+
function runAutonomous(targetDir, docker, extraArgs = []) {
|
|
137
151
|
const script = docker ? '.claude/scripts/docker-run.mjs' : '.claude/scripts/autonomous.mjs';
|
|
138
|
-
const args = docker ? [script] : [script, '--skip-permissions'];
|
|
152
|
+
const args = docker ? [script, ...extraArgs] : [script, '--skip-permissions', ...extraArgs];
|
|
139
153
|
if (docker) {
|
|
140
154
|
info('Starting Docker-based autonomous development...');
|
|
141
155
|
}
|
|
@@ -146,12 +160,27 @@ function runAutonomous(targetDir, docker) {
|
|
|
146
160
|
const child = spawn('node', args, {
|
|
147
161
|
cwd: targetDir,
|
|
148
162
|
stdio: 'inherit',
|
|
149
|
-
shell: true,
|
|
150
163
|
});
|
|
151
164
|
child.on('close', (code) => process.exit(code ?? 0));
|
|
152
165
|
}
|
|
153
166
|
// ─── Main ───
|
|
154
167
|
async function main() {
|
|
168
|
+
// Subcommand routing: run, docker, validate, plan
|
|
169
|
+
const firstArg = process.argv[2];
|
|
170
|
+
if (firstArg === 'run') {
|
|
171
|
+
const extraArgs = process.argv.slice(3);
|
|
172
|
+
runAutonomous(process.cwd(), false, extraArgs);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (firstArg === 'docker') {
|
|
176
|
+
const extraArgs = process.argv.slice(3);
|
|
177
|
+
runAutonomous(process.cwd(), true, extraArgs);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (firstArg === 'validate') {
|
|
181
|
+
runAutonomous(process.cwd(), false, ['--dry-run']);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
155
184
|
const opts = parseArgs();
|
|
156
185
|
if (opts.help) {
|
|
157
186
|
printHelp();
|
|
@@ -217,10 +246,10 @@ async function main() {
|
|
|
217
246
|
console.log(` claude --agent project-initializer`);
|
|
218
247
|
console.log('');
|
|
219
248
|
console.log(` ${C.d}# Autonomous development in Docker${C.n}`);
|
|
220
|
-
console.log(`
|
|
249
|
+
console.log(` npx create-claude-workspace docker`);
|
|
221
250
|
console.log('');
|
|
222
251
|
console.log(` ${C.d}# Autonomous development without Docker${C.n}`);
|
|
223
|
-
console.log(`
|
|
252
|
+
console.log(` npx create-claude-workspace run`);
|
|
224
253
|
console.log('');
|
|
225
254
|
}
|
|
226
255
|
if (opts.run) {
|
|
@@ -53,10 +53,10 @@ You: "I'll delegate this to the project-initializer agent."
|
|
|
53
53
|
|
|
54
54
|
```powershell
|
|
55
55
|
# Docker — isolated, safe (recommended)
|
|
56
|
-
|
|
56
|
+
npx create-claude-workspace docker # all platforms (Windows / macOS / Linux)
|
|
57
57
|
|
|
58
58
|
# Without Docker (uses --agent orchestrator automatically)
|
|
59
|
-
|
|
59
|
+
npx create-claude-workspace run
|
|
60
60
|
|
|
61
61
|
# Interactive — start Claude with orchestrator as top-level agent
|
|
62
62
|
claude --agent orchestrator
|
|
@@ -302,5 +302,5 @@ Then tell the user:
|
|
|
302
302
|
- GitLab/GitHub: [N] milestones + [M] issues created
|
|
303
303
|
|
|
304
304
|
Start autonomous development:
|
|
305
|
-
- **Unattended**: `
|
|
305
|
+
- **Unattended**: `npx create-claude-workspace run` (recommended — clean context per task, survives rate limits)
|
|
306
306
|
- **Interactive**: `/ralph-loop:ralph-loop Use orchestrator agent to continue autonomous development according to CLAUDE.md`"
|
|
@@ -44,7 +44,7 @@ if [[ -z "${ANTHROPIC_API_KEY:-}" ]]; then
|
|
|
44
44
|
echo " Then re-run docker-run.mjs"
|
|
45
45
|
echo ""
|
|
46
46
|
echo " Option 2 — API key:"
|
|
47
|
-
echo " ANTHROPIC_API_KEY=sk-...
|
|
47
|
+
echo " ANTHROPIC_API_KEY=sk-... npx create-claude-workspace docker"
|
|
48
48
|
echo ""
|
|
49
49
|
exit 1
|
|
50
50
|
fi
|