mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
7f890b1b3b
* feat: add Loops component type with referenced components Introduce "loops" as a new first-class component type — autonomous agentic workflows (goal + interval + stop condition) inspired by Loop Engineering and the Forward Future Loop Library. A loop references other components (agents, skills, hooks, commands) and the dashboard renders those references as clickable cards on the loop detail page. - Add 10 starter loops under cli-tool/components/loops/ (engineering, evaluation, operations) - Catalog generator: scan loops + write per-component content files - Dashboard: new type in icons/types/data, /loops page, and a "Referenced Components" section on the loop detail page - CLI: --loop flag installs the loop to .claude/loops/ and auto-installs its referenced components - Docs: CLAUDE.md and cli-tool rule updated Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES * feat: add 8 more loops (goal/loop/schedule patterns) Expand the loops catalog to 18, drawing ideas from community "Loop Engineering" patterns. Adds loops across the three trigger verbs (/goal, /loop, /schedule) and emphasizes the verifier-in-the-loop and budget / anti-spin guardrails: - engineering/five-minute-maintainer-loop - engineering/build-test-fix-loop - engineering/anti-spin-build-loop - engineering/completion-contract-loop (goal) - engineering/goal-refiner-loop (goal) - engineering/adversarial-review-loop (cross-model) - operations/overnight-pr-routine-loop (schedule) - evaluation/human-approval-loop (human-in-the-loop) All referenced components verified to exist; catalog regenerated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES --------- Co-authored-by: Claude <noreply@anthropic.com>
47 lines
2.7 KiB
Markdown
47 lines
2.7 KiB
Markdown
---
|
|
name: overnight-pr-routine-loop
|
|
description: A nightly routine that watches your open PRs, auto-fixes build failures, answers review comments in a fresh worktree, and rebases stale branches while you sleep.
|
|
category: operations
|
|
interval: daily
|
|
stop-condition: Every fixable PR is green and updated; anything ambiguous is left flagged for human review.
|
|
components: [command:git-workflow/worktree-init, command:git-workflow/create-pr, agent:git/git-workflow-manager, hook:automation/slack-notifications]
|
|
tags: [schedule, pull-requests, automation, loop]
|
|
---
|
|
|
|
# Overnight PR Routine
|
|
|
|
> **Loop Engineering** — the `/schedule` verb runs a routine *while you are gone*. This is the "I don't write code, I write loops, and they write the code while I sleep" pattern: a scheduled routine that lands the fixable PRs overnight.
|
|
|
|
## 🎯 Goal
|
|
Each night, work the open-PR queue: auto-fix build failures, answer review comments in an isolated worktree, rebase stale branches — and leave anything ambiguous for a human in the morning.
|
|
|
|
## ⏱️ Schedule
|
|
Trigger: `daily` (overnight routine, runs while your laptop is closed).
|
|
|
|
## ▶️ Run it
|
|
```
|
|
/schedule every night, watch my open PRs. For each: auto-fix build failures, answer review comments in a fresh worktree, and rebase what is stale. Leave anything ambiguous or product-sensitive for me. Keep state in git so a crash loses nothing. Post a morning summary.
|
|
```
|
|
|
|
## 🔁 Iteration steps
|
|
1. **Perceive** — list open PRs and their CI/review state.
|
|
2. **Isolate** — spin a fresh worktree per PR with `/worktree-init` (no cross-contamination).
|
|
3. **Act** — `git-workflow-manager` fixes build failures, addresses review comments, rebases stale branches.
|
|
4. **Verify** — re-run CI; push only when green; ambiguous items are flagged, never guessed.
|
|
5. **Report** — post a morning summary via `slack-notifications`; update each PR with `/create-pr`.
|
|
|
|
## 🛑 Stopping condition
|
|
Every fixable PR is green and updated; ambiguous/product-sensitive items are flagged for human review (not auto-merged).
|
|
|
|
## 💰 Budget & guardrails
|
|
A nightly spend ceiling; never auto-merges; isolated worktrees so parallel fixes don't collide; state in git so a crash is recoverable.
|
|
|
|
## 🧩 Referenced components
|
|
- `command:git-workflow/worktree-init` — isolated workspace per PR.
|
|
- `command:git-workflow/create-pr` — updates/opens PRs.
|
|
- `agent:git/git-workflow-manager` — safe rebases, fixes and comment replies.
|
|
- `hook:automation/slack-notifications` — the morning summary.
|
|
|
|
## 💡 Example
|
|
You wake up to three PRs rebased and green, two review comments answered with commits, and one PR flagged "needs a product decision" — exactly the one you should look at.
|