create-claude-workspace 1.1.44 → 1.1.45
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: orchestrator
|
|
3
|
-
description: "Use this agent to run the autonomous development cycle. It picks tasks from TODO.md, delegates planning to architect agents, manages implementation, testing, review, and
|
|
3
|
+
description: "Use this agent to run the autonomous development cycle. It picks tasks from TODO.md, delegates planning to architect agents, manages implementation, testing, review, commit, and CI pipeline monitoring. This is the core loop agent — called by ralph-loop or manually.\n\nExamples:\n\n<example>\nuser: \"Continue autonomous development\"\nassistant: \"I'll use the orchestrator agent to pick the next task and run the full development cycle.\"\n</example>\n\n<example>\nuser: \"Run the next development iteration\"\nassistant: \"Let me use the orchestrator agent to continue from where MEMORY.md left off.\"\n</example>"
|
|
4
4
|
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -89,9 +89,15 @@ At the beginning of EVERY session (including every Ralph Loop iteration):
|
|
|
89
89
|
Before doing anything, check for unexpected state from user intervention or previous session:
|
|
90
90
|
- **Worktree recovery**: Read MEMORY.md `Current Worktree`. If set, check if the worktree directory exists:
|
|
91
91
|
- Worktree exists + `Current Step` is set → resume from that step (continue working in the worktree)
|
|
92
|
-
- **Crash recovery for STEP 11**: If `Current Step` contains `11
|
|
92
|
+
- **Crash recovery for STEP 11**: If `Current Step` contains `11 —` (exactly `11 — COMMIT`, not `11b`):
|
|
93
93
|
- Check `git -C {worktree} status` for uncommitted changes. If present, the STEP 11 commit was incomplete — re-stage all task files + TODO.md + MEMORY.md in the worktree and commit.
|
|
94
|
-
- If worktree is clean, the commit succeeded. Proceed to STEP
|
|
94
|
+
- If worktree is clean, the commit succeeded. Proceed to STEP 11b (CI watch) if git integration active, otherwise STEP 12.
|
|
95
|
+
- **Crash recovery for STEP 11b**: If `Current Step` contains `11b`:
|
|
96
|
+
- The push already succeeded (11b runs after push). Check if a CI pipeline is running for the branch.
|
|
97
|
+
- If pipeline is running → resume polling from STEP 11b.
|
|
98
|
+
- If pipeline passed → proceed to STEP 12.
|
|
99
|
+
- If pipeline failed → resume STEP 11b fix loop (check CI fix counter in MEMORY.md Notes if logged).
|
|
100
|
+
- If no pipeline found → proceed to STEP 12 (pipeline may have been cancelled or platform is unreachable).
|
|
95
101
|
- **Crash recovery for STEP 12**: If `Current Step` contains `12`:
|
|
96
102
|
- Check if the feature branch has commits ahead of main. If yes, proceed to STEP 12 (merge from main).
|
|
97
103
|
- If already merged: clean up worktree and branch, clear `Current Worktree` from MEMORY.md.
|
|
@@ -488,6 +494,65 @@ To determine if a task is frontend, backend, or fullstack, use this heuristic:
|
|
|
488
494
|
3. If auth/network -> retry once, then log blocker
|
|
489
495
|
4. Commit is still local and safe — do NOT reset or amend without reason
|
|
490
496
|
|
|
497
|
+
**STEP 11b: CI PIPELINE WATCH** (only if git integration active AND remote push succeeded)
|
|
498
|
+
- Update MEMORY.md (on main): set `Current Step: 11b — CI WATCH`
|
|
499
|
+
- **Skip conditions**: no remote, no push happened, local-only mode, team workflow (team doesn't merge — CI runs on MR/PR, reviewed by humans)
|
|
500
|
+
- **Wait for pipeline to start** (max 60s polling):
|
|
501
|
+
```bash
|
|
502
|
+
# GitHub — wait for workflow run to appear, capture run ID
|
|
503
|
+
for i in $(seq 1 12); do
|
|
504
|
+
RUN_ID=$(gh run list --branch feat/{slug} --limit 1 --json databaseId --jq '.[0].databaseId' 2>/dev/null)
|
|
505
|
+
[ -n "$RUN_ID" ] && break
|
|
506
|
+
sleep 5
|
|
507
|
+
done
|
|
508
|
+
|
|
509
|
+
# GitLab — wait for pipeline to appear, capture pipeline ID
|
|
510
|
+
for i in $(seq 1 12); do
|
|
511
|
+
PIPELINE_ID=$(glab ci list --branch feat/{slug} -P 1 2>/dev/null | grep -oE '^[0-9]+' | head -1)
|
|
512
|
+
[ -n "$PIPELINE_ID" ] && break
|
|
513
|
+
sleep 5
|
|
514
|
+
done
|
|
515
|
+
```
|
|
516
|
+
- **If no pipeline found after 60s**: proceed to STEP 12 (CI may not be configured for this repo). Log in MEMORY.md Notes: "No CI pipeline detected — skipped CI watch."
|
|
517
|
+
- **Poll until completion** (max 1 hour):
|
|
518
|
+
```bash
|
|
519
|
+
# GitHub — watch specific run (blocks until done, built-in polling)
|
|
520
|
+
gh run watch "$RUN_ID" --exit-status
|
|
521
|
+
|
|
522
|
+
# GitLab — poll every 15s, max 240 iterations (1 hour)
|
|
523
|
+
for i in $(seq 1 240); do
|
|
524
|
+
STATUS=$(glab ci list --branch feat/{slug} -P 1 2>/dev/null | head -1 | grep -oE '(passed|failed|success|canceled|running|pending)' | head -1)
|
|
525
|
+
case "$STATUS" in
|
|
526
|
+
passed|success) break ;;
|
|
527
|
+
failed|canceled) break ;;
|
|
528
|
+
*) sleep 15 ;;
|
|
529
|
+
esac
|
|
530
|
+
done
|
|
531
|
+
```
|
|
532
|
+
- **If CI passes** → proceed to STEP 12
|
|
533
|
+
- **If CI was canceled** → the pipeline was intentionally stopped (by a human or auto-canceled by a newer push). Do NOT treat as failure. If a newer push triggered it (from a fix attempt), restart polling for the new pipeline. Otherwise proceed to STEP 12.
|
|
534
|
+
- **If CI fails** → diagnose and fix (max 3 attempts). Log CI fix attempt count in MEMORY.md Notes (e.g., `CI fix attempts: 1/3`):
|
|
535
|
+
1. **Fetch CI logs**:
|
|
536
|
+
```bash
|
|
537
|
+
# GitHub — download failed job logs for specific run
|
|
538
|
+
gh run view "$RUN_ID" --log-failed
|
|
539
|
+
|
|
540
|
+
# GitLab — view failed job trace
|
|
541
|
+
glab ci view
|
|
542
|
+
```
|
|
543
|
+
2. **Analyze failure**: Read the logs, identify root cause (environment diff, missing secret, flaky test, build issue, dependency problem)
|
|
544
|
+
3. **Categorize**:
|
|
545
|
+
- **Fixable in code** (test failure, build error, lint issue, missing dependency): fix in worktree, amend commit (`git -C {worktree-path} add [files] && git -C {worktree-path} commit --amend --no-edit`), force-push (`git -C {worktree-path} push --force-with-lease`), restart from "Wait for pipeline"
|
|
546
|
+
- **Config/infra issue** (missing CI secret, wrong Node version, Docker build failure): if deployment-engineer can fix (CI config change), delegate to it. Otherwise log as blocker.
|
|
547
|
+
- **Flaky/intermittent** (test passed locally but fails randomly in CI): retry the pipeline once (`gh run rerun "$RUN_ID" --failed` / trigger retry via `glab ci retry`). If it passes on retry, proceed. If it fails again, treat as fixable.
|
|
548
|
+
- **Unfixable** (requires human action — missing secrets, permissions, external service down): log in MEMORY.md Blockers, proceed to STEP 12 with local merge fallback. Return `blocked` status with details.
|
|
549
|
+
4. **After each fix attempt**: increment CI fix counter in MEMORY.md Notes. If counter reaches 3:
|
|
550
|
+
- Delegate to original architect agent: "CI pipeline failed 3 times. Failures: [list]. Local build/test passes. Suggest fix or confirm this is an environment issue."
|
|
551
|
+
- If architect provides fix → apply it (final attempt)
|
|
552
|
+
- If architect confirms environment issue → proceed to STEP 12 with local merge fallback, log blocker
|
|
553
|
+
- If still failing → proceed to STEP 12 with local merge fallback, log full details in MEMORY.md Blockers
|
|
554
|
+
- **Note**: `--force-with-lease` is safe here because we own the branch and just pushed it. The MR/PR stays open and updates automatically.
|
|
555
|
+
|
|
491
556
|
**STEP 12: POST-MERGE & NEXT ITEM**
|
|
492
557
|
- Everything was committed in STEP 11 inside the worktree. The project root (on main) has a clean working tree (tracking changes were discarded in STEP 11).
|
|
493
558
|
- **ZERO commits in this step** — all tracking was already committed in STEP 11. This step only performs git operations (merge, worktree cleanup, push) and delegates issue status updates.
|
|
@@ -497,7 +562,7 @@ To determine if a task is frontend, backend, or fullstack, use this heuristic:
|
|
|
497
562
|
```bash
|
|
498
563
|
git -C {worktree-path} push origin HEAD
|
|
499
564
|
```
|
|
500
|
-
- Merge via platform to properly close the MR/PR (
|
|
565
|
+
- Merge via platform to properly close the MR/PR (CI should have passed in STEP 11b — if merge still fails due to checks, use local merge fallback below):
|
|
501
566
|
```bash
|
|
502
567
|
# GitHub
|
|
503
568
|
gh pr merge --merge --delete-branch
|
|
@@ -641,6 +706,8 @@ Examples:
|
|
|
641
706
|
- Task completed: `status: completed, action: continue, message: "Implemented user auth flow and pushed MR #42", task_completed: "#42 User auth", next_task: "#43 Dashboard"`
|
|
642
707
|
- Missing token: `status: needs_input, action: needs_gitlab_token, message: "git push failed — GITLAB_TOKEN is missing or expired. Please provide a valid token."`
|
|
643
708
|
- Build stuck: `status: error, action: retry_after_cooldown, message: "Build failed 3 times on dependency resolution. Exhausted fix attempts."`
|
|
709
|
+
- CI fixed: `status: completed, action: continue, message: "CI failed on lint — fixed and re-pushed. Task merged after CI passed.", task_completed: "#42 User auth", next_task: "#43 Dashboard"`
|
|
710
|
+
- CI unfixable: `status: completed, action: ci_needs_config, message: "CI pipeline failed — missing NODE_AUTH_TOKEN secret. Task merged locally (fallback).", task_completed: "#42 User auth", next_task: "#43 Dashboard"`
|
|
644
711
|
- Blocked: `status: blocked, action: needs_user_decision, message: "Task #15 requires API design decision — REST vs GraphQL. Cannot proceed without guidance."`
|
|
645
712
|
|
|
646
713
|
## Rules
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-claude-workspace",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.45",
|
|
4
4
|
"description": "Scaffold a project with Claude Code agents for autonomous AI-driven development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
],
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://gitlab.com/LadaBr/claude-starter-kit.git"
|
|
34
|
+
},
|
|
31
35
|
"devDependencies": {
|
|
32
36
|
"typescript": "^5.8.0",
|
|
33
37
|
"vitest": "^4.0.18"
|