create-claude-workspace 1.1.97 → 1.1.99

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.
@@ -364,6 +364,7 @@ export function runClaude(opts, log, runOpts = {}) {
364
364
  isAuthServerError = true;
365
365
  }
366
366
  let usageLimitKilled = false;
367
+ let authErrorKilled = false;
367
368
  function detectTextSignals(lower) {
368
369
  if (USAGE_LIMIT_RE.test(lower)) {
369
370
  isUsageLimit = true;
@@ -377,8 +378,17 @@ export function runClaude(opts, log, runOpts = {}) {
377
378
  }
378
379
  if (RATE_LIMIT_RE.test(lower))
379
380
  isRateLimit = true;
380
- if (AUTH_ERROR_RE.test(lower))
381
+ if (AUTH_ERROR_RE.test(lower)) {
381
382
  isAuthError = true;
383
+ authErrorCount++;
384
+ // Kill on auth error burst — Claude CLI retries internally and spams
385
+ // "does not have access" / "authentication_error" dozens of times.
386
+ if (authErrorCount >= 3 && !authErrorKilled && !killed) {
387
+ authErrorKilled = true;
388
+ log.warn(`Auth error burst detected (${authErrorCount} errors) — killing process.`);
389
+ killChild('process_timeout');
390
+ }
391
+ }
382
392
  if (AUTH_SERVER_RE.test(lower) && /auth/i.test(lower))
383
393
  isAuthServerError = true;
384
394
  }
@@ -487,6 +497,11 @@ export function runClaude(opts, log, runOpts = {}) {
487
497
  detectErrorSignals(event);
488
498
  // Track pending tool calls — tool_use in assistant, tool_result in user
489
499
  if (event.type === 'assistant') {
500
+ // Reset resultReceived — Claude is still actively working, so any earlier
501
+ // result event (e.g. from a sub-agent with --include-partial-messages) was
502
+ // not the final one. Without this, postResultTimeout (30s) kills the process
503
+ // while Claude is thinking before its next tool call.
504
+ resultReceived = false;
490
505
  const blocks = getContentBlocks(event);
491
506
  if (blocks) {
492
507
  for (const block of blocks) {
@@ -528,15 +543,6 @@ export function runClaude(opts, log, runOpts = {}) {
528
543
  }
529
544
  const lower = text.toLowerCase();
530
545
  detectTextSignals(lower);
531
- // Kill on auth error burst (e.g. expired token causing infinite retry loop)
532
- if (AUTH_ERROR_RE.test(lower)) {
533
- authErrorCount++;
534
- if (authErrorCount >= 3 && !killed) {
535
- log.warn(`Auth error burst detected (${authErrorCount} errors) — killing process.`);
536
- killChild('process_timeout');
537
- return;
538
- }
539
- }
540
546
  process.stderr.write(text);
541
547
  });
542
548
  // ─── Close ───
@@ -114,7 +114,10 @@ What this task covers and what it does NOT cover.
114
114
  ### FILES
115
115
  List of all files to create/modify, with full paths.
116
116
  **Feature-first library organization (STRICT):** Every distinct feature/domain MUST have its own library group (`libs/[feature]/domain/`, `libs/[feature]/business/`, `libs/[feature]/infrastructure/`, etc.). NEVER put multiple features' types/logic into a single shared library (e.g. `shared/types` with `scan.ts`, `streak.ts`, `achievement.ts` is WRONG — each gets `libs/scan/domain/`, `libs/streak/domain/`, `libs/achievement/domain/`). `libs/shared/` is ONLY for truly cross-domain code (generic utilities, DI infrastructure).
117
- **For new libraries**: specify the `nx generate` command (e.g., `nx g @nx/js:library --directory=libs/auth/domain --no-interactive`).
117
+ **For new libraries**: prefer `@cibule/devkit` generators for onion architecture scaffolding they create correctly layered libraries with proper DI wiring:
118
+ - **New workspace** (Phase 0): `nx g @cibule/devkit:preset {orgName}` — initializes workspace with onion layers, shared infrastructure, and DI tokens.
119
+ - **New domain scope**: `nx g @cibule/devkit:scope {scopeName}` — creates `libs/{scope}/domain/`, `libs/{scope}/business/`, `libs/{scope}/api/`, `libs/{scope}/infrastructure-*/` with correct dependencies. Add `--frontend` flag if the scope includes a UI library.
120
+ - **Fallback** (non-onion or simple libraries): `nx g @nx/js:library --directory=libs/{path} --no-interactive`.
118
121
  - **Internal monorepo libs** (consumed only within the workspace): omit `--bundler` — they don't need a build step. TypeScript path aliases handle resolution.
119
122
  - **Publishable libs** (npm packages): use `--bundler=tsc` (or `--bundler=esbuild`/`--bundler=rollup` if needed) + `--publishable --importPath=@scope/name`. The generator creates the build target.
120
123
  - **NEVER manually configure build tools** (tsup, esbuild, rollup, webpack). Do NOT create `tsup.config.ts`, `esbuild.config.js`, `rollup.config.js`, or similar files — Nx generators handle build configuration. Use `nx build [lib]` to build.
@@ -413,8 +413,9 @@ To determine if a task is frontend, backend, or fullstack, use this heuristic:
413
413
  - Update MEMORY.md (on main): set `Current Step: 3 — IMPLEMENT`
414
414
  - **All file operations in the worktree** (`Current Worktree` from MEMORY.md). Use absolute paths for Read/Edit/Write and `cd {worktree}` for Bash commands.
415
415
  - **CLI commands and Nx Generators FIRST**: Always prioritize using CLI commands and `nx generate` over manual file creation. NEVER manually create `project.json`, `tsconfig.*`, or configure build/test/lint targets — generators and CLI tools handle this correctly. NEVER manually install or configure build tools (tsup, esbuild, rollup, webpack) — Nx generators handle build configuration. Internal libs don't need a build step; publishable libs get `--bundler` from the generator. This includes:
416
- - **Workspace scaffolding** (Phase 0): `create-nx-workspace` via the detected package manager runner (`bunx` / `npx` / `pnpm dlx` / `yarn dlx`) — architect decides preset and flags. If PKG is bun, use `bunx create-nx-workspace` and pass `--packageManager=bun`.
417
- - **Libraries/components/apps**: `nx generate` — see CLAUDE.md "Nx Generators" section
416
+ - **Workspace scaffolding** (Phase 0): `create-nx-workspace` via the detected package manager runner (`bunx` / `npx` / `pnpm dlx` / `yarn dlx`) — architect decides preset and flags. If PKG is bun, use `bunx create-nx-workspace` and pass `--packageManager=bun`. After workspace creation, run `nx g @cibule/devkit:preset {orgName}` to initialize onion architecture layers.
417
+ - **Domain scopes**: `nx g @cibule/devkit:scope {scopeName}` — creates layered library group (domain, business, api, infrastructure). Add `--frontend` for scopes with UI.
418
+ - **Libraries/components/apps**: `nx generate` — see CLAUDE.md "Nx Generators" section. Prefer `@cibule/devkit` generators for backend onion architecture over plain `@nx/js:library`.
418
419
  - **Plugins**: `nx add` (e.g., `nx add @nx/playwright`, `nx add @nx/eslint`)
419
420
  - **Code quality setup**: install via package manager, configure via CLI where possible
420
421
  - **Backend runtimes**: `wrangler init` (Workers), runtime-specific CLIs
@@ -40,6 +40,8 @@ If the codebase has no `nx.json` or `package.json` (brand new project), YOU must
40
40
 
41
41
  Document these decisions in the `## Architecture Decisions` section of TODO.md AND include them in the Phase 0 scaffolding task description so the architect knows exactly what to scaffold.
42
42
 
43
+ **@cibule/devkit generators**: For projects with a backend, Phase 0 scaffolding tasks MUST include `@cibule/devkit:preset` initialization and `@cibule/devkit:scope` for each domain scope. Mention these explicitly in the task description so the architect uses them instead of manually creating onion architecture libraries.
44
+
43
45
  After Phase 0 scaffolding completes, the orchestrator will update CLAUDE.md with the full tech stack.
44
46
 
45
47
  ### 3. Analyze
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-workspace",
3
- "version": "1.1.97",
3
+ "version": "1.1.99",
4
4
  "description": "Scaffold a project with Claude Code agents for autonomous AI-driven development",
5
5
  "type": "module",
6
6
  "bin": {