Skip to content

Commit e7bf0f6

Browse files
duyetduyetbot
andcommitted
feat(agent-loop): add agent-loop plugin for overnight/day repo maintenance
Wire up triage, autoreview, browser, and orchestrator skills. Wake every 5 min, dispatch to parallel threads, land autonomously. Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
1 parent 0023342 commit e7bf0f6

20 files changed

Lines changed: 1781 additions & 3 deletions

File tree

.agents/plugins/marketplace.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@
196196
},
197197
"category": "Design"
198198
},
199+
{
200+
"name": "sag-notify",
201+
"source": {
202+
"source": "local",
203+
"path": "./sag-notify"
204+
},
205+
"policy": {
206+
"installation": "AVAILABLE",
207+
"authentication": "ON_INSTALL"
208+
},
209+
"category": "UI"
210+
},
199211
{
200212
"name": "anyrouter",
201213
"source": {
@@ -207,6 +219,42 @@
207219
"authentication": "ON_INSTALL"
208220
},
209221
"category": "AI"
222+
},
223+
{
224+
"name": "build-macos-apps",
225+
"source": {
226+
"source": "local",
227+
"path": "./build-macos-apps"
228+
},
229+
"policy": {
230+
"installation": "AVAILABLE",
231+
"authentication": "ON_INSTALL"
232+
},
233+
"category": "Development"
234+
},
235+
{
236+
"name": "build-ios-apps",
237+
"source": {
238+
"source": "local",
239+
"path": "./build-ios-apps"
240+
},
241+
"policy": {
242+
"installation": "AVAILABLE",
243+
"authentication": "ON_INSTALL"
244+
},
245+
"category": "Development"
246+
},
247+
{
248+
"name": "agent-loop",
249+
"source": {
250+
"source": "local",
251+
"path": "./agent-loop"
252+
},
253+
"policy": {
254+
"installation": "AVAILABLE",
255+
"authentication": "ON_INSTALL"
256+
},
257+
"category": "Automation"
210258
}
211259
]
212260
}

.claude-plugin/marketplace.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@
8888
"name": "sag-notify",
8989
"source": "./sag-notify",
9090
"description": "Spoken voice notifications via sag (ElevenLabs TTS). Skill-driven: Claude calls sag directly to speak a short alert just before it asks you something and a one-line summary when work finishes, naming the project. Configurable voice and language."
91+
},
92+
{
93+
"name": "build-macos-apps",
94+
"source": "./build-macos-apps",
95+
"description": "Build, debug, instrument, and implement macOS apps with SwiftUI and AppKit guidance, codesigning, packaging, and telemetry workflows."
96+
},
97+
{
98+
"name": "build-ios-apps",
99+
"source": "./build-ios-apps",
100+
"description": "Build, profile, debug, and refine iOS apps with SwiftUI and Xcode workflows including App Intents, Simulator debugging, performance profiling, and memory leak detection."
101+
},
102+
{
103+
"name": "agent-loop",
104+
"source": "./agent-loop",
105+
"description": "Continuous agent loop for overnight/day repo maintenance. Triage, autoreview, browser automation, and parallel agent work. Wake every 5 min, dispatch to threads, land autonomously."
91106
}
92107
]
93108
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "agent-loop",
3+
"version": "0.2.0",
4+
"description": "Continuous agent loop for overnight/day repository maintenance. Orchestrates triage, autoreview, browser automation, and parallel agent work across threads. Wake every 5 min, direct work to threads, land autonomously.",
5+
"author": { "name": "duyetbot" },
6+
"license": "MIT"
7+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "agent-loop",
3+
"version": "0.2.0",
4+
"description": "Continuous agent loop for overnight/day repository maintenance. Orchestrates triage, autoreview, browser automation, and parallel agent work across threads. Wake every 5 min, direct work to threads, land autonomously.",
5+
"author": { "name": "duyetbot" },
6+
"license": "MIT",
7+
"skills": "./skills/",
8+
"codex": {
9+
"skills": ["agent-loop-orchestrator", "agent-loop-triage", "agent-loop-autoreview", "agent-loop-browser"],
10+
"commands": ["agent-loop:start", "agent-loop:stop", "agent-loop:status", "agent-loop:triage", "agent-loop:autoreview"]
11+
},
12+
"interface": {
13+
"displayName": "Agent Loop",
14+
"shortDescription": "Continuous overnight/day repo maintenance with autonomous agent loops. Triage, autoreview, browser automation, and parallel agent work.",
15+
"developerName": "duyetbot",
16+
"category": "Automation",
17+
"capabilities": ["Skill", "Command"]
18+
}
19+
}

agent-loop/CLAUDE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Agent Loop Plugin
2+
3+
Continuous overnight/day repository maintenance with autonomous agent loops.
4+
5+
## Version
6+
7+
0.2.0
8+
9+
## Plugin Structure
10+
11+
```
12+
agent-loop/
13+
├── .claude-plugin/
14+
│ └── plugin.json # Manifest (version 0.2.0)
15+
├── commands/ # Slash commands
16+
├── skills/ # Reusable knowledge
17+
│ ├── agent-loop-orchestrator/
18+
│ ├── agent-loop-triage/
19+
│ ├── agent-loop-autoreview/
20+
│ └── agent-loop-browser/
21+
└── README.md # Documentation
22+
```
23+
24+
## Components
25+
26+
### Commands
27+
28+
| Command | Description |
29+
|---------|-------------|
30+
| `/agent-loop:start` | Start the continuous maintenance loop |
31+
| `/agent-loop:stop` | Gracefully stop the loop |
32+
| `/agent-loop:status` | Check loop status and history |
33+
| `/agent-loop:triage` | One-shot repo queue triage |
34+
| `/agent-loop:autoreview` | One-shot PR review and fix |
35+
36+
### Skills
37+
38+
| Skill | Purpose |
39+
|-------|---------|
40+
| **agent-loop-orchestrator** | Core loop: wait → triage → dispatch → monitor → report |
41+
| **agent-loop-triage** | GitHub issue/PR queue scanning and classification |
42+
| **agent-loop-autoreview** | Autonomous PR review, fix application, and merging |
43+
| **agent-loop-browser** | Browser automation for live UI proof and verification |
44+
45+
## Versioning
46+
47+
Follow semantic versioning (semver):
48+
49+
| Change Type | Version Bump | Example |
50+
|-------------|--------------|---------|
51+
| Bug fix, docs | Patch | 0.2.0 → 0.2.1 |
52+
| New feature, minor change | Minor | 0.2.0 → 0.3.0 |
53+
| Breaking change | Major | 0.2.0 → 1.0.0 |
54+
55+
Always update `plugin.json` version when making changes.
56+
57+
## Commit Convention
58+
59+
Use semantic commits with plugin scope:
60+
61+
```
62+
feat(agent-loop): add new feature
63+
fix(agent-loop): fix bug
64+
docs(agent-loop): update documentation
65+
```
66+
67+
Co-author: `Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>`

agent-loop/README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Agent Loop Plugin
2+
3+
Continuous overnight/day repository maintenance with autonomous agent loops.
4+
5+
```
6+
Wake every 5m ──► Triage repos ──► Dispatch threads ──► Track & land
7+
```
8+
9+
## Version
10+
11+
0.2.0
12+
13+
## Overview
14+
15+
The agent-loop plugin runs a persistent automation cycle that keeps repositories
16+
healthy without human supervision. It is designed for overnight and day-long
17+
autonomous upkeep: triaging issues, reviewing PRs, applying fixes, and landing
18+
changes — all through parallel agent threads.
19+
20+
Inspired by Peter Steinberger's maintainer-orchestrator pattern: tell Codex to
21+
maintain your repos, wake up every 5 minutes, and direct work to threads.
22+
That makes it easy to parallelize + steer work as needed.
23+
24+
## Components
25+
26+
### Skills
27+
28+
| Skill | Purpose |
29+
|-------|---------|
30+
| **agent-loop-orchestrator** | Core loop: wait → triage → dispatch → monitor → report |
31+
| **agent-loop-triage** | GitHub issue/PR queue scanning and classification |
32+
| **agent-loop-autoreview** | Autonomous PR review, fix application, and merging |
33+
| **agent-loop-browser** | Browser automation for live UI proof and verification |
34+
35+
### Commands
36+
37+
| Command | Description |
38+
|---------|-------------|
39+
| `/agent-loop:start` | Start the continuous maintenance loop |
40+
| `/agent-loop:stop` | Gracefully stop the loop |
41+
| `/agent-loop:status` | Check loop status and history |
42+
| `/agent-loop:triage` | One-shot repo queue triage |
43+
| `/agent-loop:autoreview` | One-shot PR review and fix |
44+
45+
## Skills
46+
47+
Sources adapted for the agent-loop plugin:
48+
49+
- **agent-loop-triage** — adapted from [steipete/agent-scripts github-project-triage](https://github.com/steipete/agent-scripts/tree/main/skills/github-project-triage)
50+
- **agent-loop-browser** — adapted from [steipete/agent-scripts browser-use](https://github.com/steipete/agent-scripts/tree/main/skills/browser-use)
51+
- **agent-loop-autoreview** — adapted from local autofix skill + CodeRabbit workflow patterns
52+
- **agent-loop-orchestrator** — original orchestrator pattern inspired by maintainer-orchestrator concept
53+
54+
## Quick Start
55+
56+
```bash
57+
# Start the loop (5 min interval, current repo)
58+
/agent-loop:start
59+
60+
# Check status
61+
/agent-loop:status
62+
63+
# One-shot triage (doesn't start loop)
64+
/agent-loop:triage
65+
66+
# Review a specific PR
67+
/agent-loop:autoreview --pr 123 --merge
68+
69+
# Stop the loop
70+
/agent-loop:stop
71+
```
72+
73+
## Configuration
74+
75+
| Env Variable | Default | Description |
76+
|-------------|---------|-------------|
77+
| `AGENT_LOOP_INTERVAL` | 300 | Sleep between cycles (seconds) |
78+
| `AGENT_LOOP_MAX_CONCURRENCY` | 3 | Max parallel worker threads |
79+
| `AGENT_LOOP_SCOPE` | current | Default triage scope |
80+
| `AGENT_LOOP_LOG_DIR` | .agent-loop/logs | Log output directory |
81+
| `AGENT_LOOP_STATE_FILE` | .agent-loop/state.json | Persisted loop state |
82+
| `AGENT_LOOP_REPOS` | (from git remote) | Comma-separated repo list |
83+
84+
## Plugin Structure
85+
86+
```
87+
agent-loop/
88+
├── .claude-plugin/
89+
│ └── plugin.json # Manifest (version 0.2.0)
90+
├── .codex-plugin/
91+
│ └── plugin.json # Codex manifest
92+
├── commands/ # Slash commands
93+
│ ├── start.md
94+
│ ├── stop.md
95+
│ ├── status.md
96+
│ ├── triage.md
97+
│ └── autoreview.md
98+
├── skills/ # Reusable knowledge
99+
│ ├── agent-loop-orchestrator/
100+
│ │ └── SKILL.md
101+
│ ├── agent-loop-triage/
102+
│ │ └── SKILL.md
103+
│ ├── agent-loop-autoreview/
104+
│ │ └── SKILL.md
105+
│ └── agent-loop-browser/
106+
│ └── SKILL.md
107+
└── README.md
108+
```
109+
110+
## Versioning
111+
112+
Follow semantic versioning (semver):
113+
114+
| Change Type | Version Bump | Example |
115+
|-------------|--------------|---------|
116+
| Bug fix, docs | Patch | 0.2.0 → 0.2.1 |
117+
| New feature, minor change | Minor | 0.2.0 → 0.3.0 |
118+
| Breaking change | Major | 0.2.0 → 1.0.0 |
119+
120+
## Commit Convention
121+
122+
Use semantic commits with plugin scope:
123+
124+
```
125+
feat(agent-loop): add new feature
126+
fix(agent-loop): fix bug
127+
docs(agent-loop): update documentation
128+
```
129+
130+
Co-author: `Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>`
131+
132+
---
133+
134+
**Based on concepts from [steipete/agent-scripts](https://github.com/steipete/agent-scripts)**

agent-loop/commands/autoreview.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
allowed-tools: Bash(git *), Bash(gh *), Read, Edit, Write, Task(deep,quick)
3+
description: One-shot autonomous review of a PR. Fetches review comments from AI bots, applies verified fixes, validates, and merges when safe.
4+
---
5+
6+
# Agent Loop Autoreview
7+
8+
One-shot autonomous PR review. Does NOT start the loop — just reviews,
9+
fixes, validates, and optionally merges a single PR.
10+
11+
## Usage
12+
13+
```bash
14+
/agent-loop:autoreview
15+
/agent-loop:autoreview --pr 123
16+
/agent-loop:autoreview --repo duyet/clickhouse-monitoring --pr 123
17+
/agent-loop:autoreview --pr 123 --merge
18+
/agent-loop:autoreview --pr 123 --merge --dry-run
19+
```
20+
21+
## Options
22+
23+
- `--pr <number>`: PR number (default: current branch's PR)
24+
- `--repo <owner/repo>`: Repository (default: from git remote)
25+
- `--merge`: Merge PR after successful review
26+
- `--dry-run`: Preview what would happen without applying changes
27+
- `--skip-labels <label,...>`: Skip PRs with these labels (default: wip,do-not-merge,blocked)
28+
29+
## Workflow
30+
31+
1. Fetch PR details and diff
32+
2. Fetch AI review bot comments (CodeRabbit, Sourcery, Gemini)
33+
3. Extract and apply verified fixes
34+
4. Validate: lint → test → build
35+
5. Commit and push fixes
36+
6. If `--merge`: check merge readiness, merge
37+
7. Report results
38+
39+
## Safety Gates
40+
41+
- Skips draft PRs
42+
- Skips PRs with skip-labels
43+
- Skips PRs with unresolved human review changes requested
44+
- Skips security-sensitive changes on first-time contributors
45+
- Validates every fix before applying
46+
- Reports all decisions with reasoning

0 commit comments

Comments
 (0)