create-claude-workspace 1.1.22 → 1.1.24

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.
@@ -472,6 +472,109 @@ glab api projects/:id/milestones/${MILESTONE_ID} -X PUT -f state_event=close
472
472
  - Changelog: 12 features, 3 fixes, 2 refactors
473
473
  ```
474
474
 
475
+ ### 9. Retroactive Sync (called when git token is added after local work)
476
+
477
+ When work was done locally without git integration (no token/CLI/remote), and a valid token becomes available later, sync all local progress to the platform.
478
+
479
+ **Trigger:** Orchestrator detects remote exists + TODO.md has tasks but no `<!-- #N -->` markers.
480
+
481
+ **Process:**
482
+
483
+ 1. **Verify platform access:**
484
+ ```bash
485
+ # GitHub
486
+ gh auth status
487
+ gh repo view --json name
488
+
489
+ # GitLab
490
+ glab auth status
491
+ glab repo view
492
+ ```
493
+
494
+ 2. **Create labels** (same as Operation 1 — idempotent):
495
+ ```bash
496
+ # Create all status:: and complexity:: labels (skip existing)
497
+ ```
498
+
499
+ 3. **Create milestones for all phases** (same as Operation 1 — idempotent):
500
+ ```bash
501
+ # For each ## Phase N: Name in TODO.md, create milestone if not exists
502
+ ```
503
+
504
+ 4. **Create issues for ALL tasks and sync status:**
505
+
506
+ For each task in TODO.md, regardless of checkbox state:
507
+
508
+ ```bash
509
+ # Create the issue
510
+ # GitHub
511
+ ISSUE_NUM=$(gh issue create --title "Task title" --body "..." --milestone "Phase N: Name" --label "complexity::S" --json number --jq '.number')
512
+
513
+ # GitLab
514
+ ISSUE_NUM=$(glab issue create --title "Task title" --description "..." --milestone "Phase N: Name" --label "complexity::S" 2>&1 | grep -oP '#\K\d+')
515
+ ```
516
+
517
+ Then set status based on TODO.md checkbox:
518
+
519
+ - **`[x]` (completed):**
520
+ ```bash
521
+ # GitHub
522
+ gh issue edit $ISSUE_NUM --add-label "status::done"
523
+ gh issue close $ISSUE_NUM
524
+
525
+ # GitLab
526
+ glab issue update $ISSUE_NUM --label "status::done"
527
+ glab issue update $ISSUE_NUM --state-event close
528
+ ```
529
+
530
+ - **`[~]` (skipped):**
531
+ ```bash
532
+ # GitHub
533
+ gh issue edit $ISSUE_NUM --add-label "status::skipped"
534
+ gh issue close $ISSUE_NUM --reason "not planned"
535
+
536
+ # GitLab
537
+ glab issue update $ISSUE_NUM --label "status::skipped"
538
+ glab issue update $ISSUE_NUM --state-event close
539
+ ```
540
+
541
+ - **`[ ]` (pending):**
542
+ ```bash
543
+ # GitHub
544
+ gh issue edit $ISSUE_NUM --add-label "status::todo"
545
+
546
+ # GitLab
547
+ glab issue update $ISSUE_NUM --label "status::todo"
548
+ ```
549
+
550
+ 5. **Add `<!-- #N -->` markers to TODO.md** for all created issues (same as Operation 1).
551
+
552
+ 6. **Close completed milestones:** If all tasks in a phase are `[x]` or `[~]`, close that phase's milestone.
553
+
554
+ 7. **Create releases for completed phases** (optional, if there are git tags for completed phases):
555
+ ```bash
556
+ # Check for existing version tags
557
+ git tag -l "v*"
558
+ # If tags exist, create platform releases for them
559
+ ```
560
+
561
+ **Output format:**
562
+ ```
563
+ ## Retroactive Sync Complete
564
+ - Platform: [GitHub/GitLab]
565
+ - Milestones created: [N]
566
+ - Issues created: [total] ([done] done, [skipped] skipped, [todo] pending)
567
+ - Milestones closed: [list of completed phases]
568
+ - TODO.md updated with <!-- #N --> markers
569
+
570
+ ## Issue Mapping:
571
+ | TODO.md Task | Issue | Status |
572
+ |---|---|---|
573
+ | Task A | #1 | done |
574
+ | Task B | #2 | skipped |
575
+ | Task C | #3 | todo |
576
+ ```
577
+
475
578
  ## Principles
476
579
 
477
580
  - **Idempotent** — running twice should not create duplicate issues. Check before creating.
@@ -80,13 +80,29 @@ If no remote or on a feature branch (continuing work), skip this step.
80
80
  - `git log --oneline -10`
81
81
  - Scan current file structure
82
82
 
83
- ### 8. Ingest external issues (if git integration active)
83
+ ### 8. Retroactive git integration sync
84
+ - **Trigger condition**: remote exists (`git remote -v | grep origin`) AND TODO.md exists with tasks BUT no `<!-- #N -->` markers found in TODO.md AND CLI is available (`gh --version` or `glab --version`) AND auth is valid (`gh auth status` or `glab auth status`)
85
+ - This means work was done locally without git integration (token was missing or platform wasn't set up), and now it's available
86
+ - Delegate to `devops-integrator` agent:
87
+ "Run retroactive sync (Operation 9). TODO.md has tasks completed locally without git integration.
88
+ Create milestones for all phases, create issues for all tasks, and sync their status:
89
+ - `[x]` tasks → create issue with `status::done` label (already completed locally)
90
+ - `[~]` tasks → create issue with `status::skipped` label
91
+ - `[ ]` tasks → create issue with `status::todo` label
92
+ Add `<!-- #N -->` markers to TODO.md for all created issues.
93
+ This is a one-time sync — subsequent iterations will use normal git integration."
94
+ - After sync, commit the updated TODO.md: `git add TODO.md && git commit -m "chore: sync TODO.md with git platform issues"`
95
+ - Push if remote exists: `git push origin HEAD`
96
+ - Log in MEMORY.md Notes: "Retroactive git sync completed — [N] issues created, [M] marked as done"
97
+ - Skip if any trigger condition is not met (no remote, no TODO.md, markers already present, CLI missing, auth invalid)
98
+
99
+ ### 9. Ingest external issues (if git integration active)
84
100
  - **Only run at phase transitions** — not every invocation
85
101
  - Delegate to `devops-integrator` agent: "Run external issue intake — check for new issues on GitHub/GitLab that are not yet in TODO.md. Ingest bugs and feature requests."
86
102
  - If new bugs are found with `critical` or `priority::high` label, they become the next task
87
103
  - Skip if no git integration or platform is unreachable
88
104
 
89
- ### 9. One task per invocation
105
+ ### 10. One task per invocation
90
106
  - Complete exactly ONE task per invocation, then end the session cleanly.
91
107
  - The external loop (`autonomous.mjs` or ralph-loop) handles iteration control — you do NOT need to manage capacity, iteration counters, or session bounds.
92
108
  - After committing the task (STEP 11) and post-merge (STEP 12), update MEMORY.md and EXIT. Do NOT ask whether to continue, do NOT wait for confirmation, do NOT start another task.
@@ -431,6 +431,9 @@ async function main() {
431
431
  await sleep(opts.cooldown, stoppingRef);
432
432
  }
433
433
  }
434
+ else {
435
+ checkpoint.consecutiveBlockedSameTask = 0;
436
+ }
434
437
  // Update lastTaskSeen (after blocked comparison)
435
438
  checkpoint.lastTaskSeen = result.next_task ?? result.task_completed ?? task;
436
439
  // Handle needs_input
@@ -10,7 +10,11 @@ const STDERR_PATTERNS = [
10
10
  ['context_exhausted', /context.?length.?exceeded|too many tokens/i],
11
11
  ];
12
12
  export function classifyError(signals) {
13
- // Flag-based (highest priority set by stream events, not just stderr)
13
+ // Clean exit with result = success, even if transient errors occurred mid-run
14
+ // (Claude Code handles rate limits/errors internally with retries)
15
+ if (signals.code === 0 && signals.hasResult)
16
+ return 'none';
17
+ // Flag-based (set by stream events, not just stderr)
14
18
  if (signals.isAuthError)
15
19
  return 'auth_expired';
16
20
  if (signals.isAuthServerError)
@@ -71,7 +75,7 @@ const STRATEGIES = {
71
75
  reason: 'Claude CLI not found on PATH. Install: https://docs.anthropic.com/en/docs/claude-code',
72
76
  }),
73
77
  disk_full: () => ({ type: 'stop', reason: 'Disk full. Free space and restart.' }),
74
- oom_killed: (ctx) => ctx.consecutiveFailures >= MAX_AUTH_RETRIES
78
+ oom_killed: (ctx) => ctx.consecutiveFailures >= MAX_CONSECUTIVE
75
79
  ? { type: 'stop', reason: 'Repeated OOM kills. Increase memory limit.' }
76
80
  : { type: 'backoff', ms: 30_000 },
77
81
  unknown: (ctx) => ctx.consecutiveFailures >= MAX_CONSECUTIVE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-workspace",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "Scaffold a project with Claude Code agents for autonomous AI-driven development",
5
5
  "type": "module",
6
6
  "bin": {