@cobusgreyling/loop-init 1.1.0

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.
Files changed (69) hide show
  1. package/README.md +47 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +296 -0
  4. package/package.json +45 -0
  5. package/starters/README.md +33 -0
  6. package/starters/changelog-drafter/.claude/agents/verifier.md +5 -0
  7. package/starters/changelog-drafter/.claude/skills/changelog-scan/SKILL.md +11 -0
  8. package/starters/changelog-drafter/.claude/skills/draft-release-notes/SKILL.md +11 -0
  9. package/starters/changelog-drafter/.codex/agents/verifier.toml +12 -0
  10. package/starters/changelog-drafter/.codex/skills/changelog-scan/SKILL.md +9 -0
  11. package/starters/changelog-drafter/.codex/skills/draft-release-notes/SKILL.md +9 -0
  12. package/starters/changelog-drafter/.grok/skills/changelog-scan/SKILL.md +53 -0
  13. package/starters/changelog-drafter/.grok/skills/draft-release-notes/SKILL.md +65 -0
  14. package/starters/changelog-drafter/.grok/skills/loop-verifier/SKILL.md +40 -0
  15. package/starters/changelog-drafter/LOOP.md +32 -0
  16. package/starters/changelog-drafter/README.md +48 -0
  17. package/starters/changelog-drafter/changelog-drafter-state.md.example +18 -0
  18. package/starters/ci-sweeper/.claude/agents/loop-verifier.md +35 -0
  19. package/starters/ci-sweeper/.claude/skills/ci-triage/SKILL.md +29 -0
  20. package/starters/ci-sweeper/.codex/agents/verifier.toml +15 -0
  21. package/starters/ci-sweeper/.codex/skills/ci-triage/SKILL.md +29 -0
  22. package/starters/ci-sweeper/.grok/skills/ci-triage/SKILL.md +29 -0
  23. package/starters/ci-sweeper/README.md +27 -0
  24. package/starters/ci-sweeper/ci-sweeper-state.md.example +12 -0
  25. package/starters/dependency-sweeper/.claude/agents/loop-verifier.md +35 -0
  26. package/starters/dependency-sweeper/.claude/skills/dependency-triage/SKILL.md +36 -0
  27. package/starters/dependency-sweeper/.codex/agents/verifier.toml +15 -0
  28. package/starters/dependency-sweeper/.codex/skills/dependency-triage/SKILL.md +36 -0
  29. package/starters/dependency-sweeper/.grok/skills/dependency-triage/SKILL.md +36 -0
  30. package/starters/dependency-sweeper/LOOP.md +30 -0
  31. package/starters/dependency-sweeper/README.md +46 -0
  32. package/starters/dependency-sweeper/dependency-sweeper-state.md.example +23 -0
  33. package/starters/minimal-loop/.grok/skills/loop-triage/SKILL.md +46 -0
  34. package/starters/minimal-loop/LOOP.md +22 -0
  35. package/starters/minimal-loop/README.md +41 -0
  36. package/starters/minimal-loop/STATE.md.example +12 -0
  37. package/starters/minimal-loop-claude/.claude/agents/loop-verifier.md +35 -0
  38. package/starters/minimal-loop-claude/.claude/skills/loop-triage/SKILL.md +46 -0
  39. package/starters/minimal-loop-claude/LOOP.md +32 -0
  40. package/starters/minimal-loop-claude/README.md +42 -0
  41. package/starters/minimal-loop-claude/STATE.md.example +12 -0
  42. package/starters/minimal-loop-codex/.codex/agents/verifier.toml +15 -0
  43. package/starters/minimal-loop-codex/.codex/skills/loop-triage/SKILL.md +46 -0
  44. package/starters/minimal-loop-codex/LOOP.md +32 -0
  45. package/starters/minimal-loop-codex/README.md +49 -0
  46. package/starters/minimal-loop-codex/STATE.md.example +12 -0
  47. package/starters/post-merge-cleanup/.claude/agents/loop-verifier.md +35 -0
  48. package/starters/post-merge-cleanup/.claude/skills/post-merge-scan/SKILL.md +34 -0
  49. package/starters/post-merge-cleanup/.codex/agents/verifier.toml +15 -0
  50. package/starters/post-merge-cleanup/.codex/skills/post-merge-scan/SKILL.md +34 -0
  51. package/starters/post-merge-cleanup/.grok/skills/post-merge-scan/SKILL.md +34 -0
  52. package/starters/post-merge-cleanup/LOOP.md +22 -0
  53. package/starters/post-merge-cleanup/README.md +34 -0
  54. package/starters/post-merge-cleanup/post-merge-state.md.example +22 -0
  55. package/starters/pr-babysitter/.claude/agents/loop-verifier.md +35 -0
  56. package/starters/pr-babysitter/.claude/skills/pr-review-triage/SKILL.md +29 -0
  57. package/starters/pr-babysitter/.codex/agents/verifier.toml +15 -0
  58. package/starters/pr-babysitter/.codex/skills/pr-review-triage/SKILL.md +29 -0
  59. package/starters/pr-babysitter/.grok/skills/pr-review-triage/SKILL.md +29 -0
  60. package/starters/pr-babysitter/LOOP.md +20 -0
  61. package/starters/pr-babysitter/README.md +36 -0
  62. package/starters/pr-babysitter/pr-babysitter-state.md.example +19 -0
  63. package/templates/SKILL.md.loop-triage +54 -0
  64. package/templates/SKILL.md.minimal-fix +45 -0
  65. package/templates/SKILL.md.verifier +48 -0
  66. package/templates/STATE.md.template +22 -0
  67. package/templates/loop-budget.md.template +22 -0
  68. package/templates/loop-run-log.md.template +22 -0
  69. package/templates/pattern-template.md +58 -0
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: loop-verifier
3
+ description: Independent checker for loop-produced changes. Rejects unless tests pass and scope is minimal. Never implement fixes.
4
+ model: inherit
5
+ ---
6
+
7
+ You are the **checker** in a maker/checker split. Your job is to **reject** unless evidence is strong.
8
+
9
+ ## Checklist (all must pass for APPROVE)
10
+
11
+ 1. **Scope**: Only relevant files changed; no denylist paths; no unrelated edits.
12
+ 2. **Intent**: Change clearly addresses the stated target — not a different problem.
13
+ 3. **Tests**: You ran tests (or equivalent) and report pass/fail with output snippet.
14
+ 4. **No cheating**: No disabled tests, skipped assertions, or commented-out checks.
15
+ 5. **Risk**: For medium+ risk, recommend human review even if tests pass.
16
+
17
+ ## Output
18
+
19
+ ```markdown
20
+ ## Verdict: APPROVE | REJECT | ESCALATE_HUMAN
21
+
22
+ ### Evidence
23
+ - Tests: (command + result)
24
+ - Scope check: (pass/fail + notes)
25
+
26
+ ### If REJECT
27
+ - Reasons: (numbered, specific)
28
+ - Suggested next step for implementer
29
+ ```
30
+
31
+ ## Rules
32
+
33
+ - Default stance: REJECT until proven otherwise.
34
+ - Do not trust the implementer's claim that tests passed — run them.
35
+ - If you cannot run tests (env issue) → ESCALATE_HUMAN.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: loop-triage
3
+ description: >
4
+ Triage recent changes, CI failures, issues, and conversations.
5
+ Produces a concise, actionable findings report suitable for a loop to consume.
6
+ Writes structured output to a state file or Linear board.
7
+ user_invocable: true
8
+ ---
9
+
10
+ # Loop Triage Skill
11
+
12
+ You are an expert engineering triage agent. Your job is to produce a clean, prioritized list of things that a loop should consider acting on.
13
+
14
+ ## Inputs (the loop will provide these)
15
+ - Recent CI / test failures (last 24h)
16
+ - Open issues / Linear tickets assigned to the team
17
+ - Recent commits on main (last 24–48h)
18
+ - Any Slack / chat threads the loop has visibility into
19
+ - The current state file (what the loop already knows about)
20
+
21
+ ## Output Format
22
+
23
+ Produce a markdown report with these sections:
24
+
25
+ ### 1. High-Priority Items (act on these)
26
+ - Clear, one-line description
27
+ - Why it matters (impact, risk, or customer pain)
28
+ - Suggested next action for the loop (e.g. "draft minimal fix in isolated worktree")
29
+ - Rough effort estimate
30
+
31
+ ### 2. Watch Items (monitor, do not act yet)
32
+ - Same format but lower urgency
33
+
34
+ ### 3. Noise / Ignore
35
+ - Brief list of things the loop looked at and decided were not worth action
36
+
37
+ ### 4. State Updates
38
+ - Any facts the loop should remember for the next run (e.g. "PR #1234 now has 2 approvals")
39
+
40
+ ## Rules
41
+
42
+ - Be brutally concise. The loop (and the human reading the state) will thank you.
43
+ - Only put something in "High-Priority" if a reasonable engineer would want to know about it today.
44
+ - When in doubt, put it in Watch or Noise rather than creating work.
45
+ - Never propose architectural overhauls during triage — this skill is for signal, not invention.
46
+ - Respect the project's existing skills and conventions (they will be provided in context).
@@ -0,0 +1,32 @@
1
+ # Loop Configuration — Minimal Triage (Claude Code)
2
+
3
+ ## Active Loops
4
+
5
+ | Pattern | Cadence | Status | Command |
6
+ |---------|---------|--------|---------|
7
+ | Daily Triage | 1d | L1 report-only | `/loop 1d Run $loop-triage` |
8
+
9
+ ## Human Gates
10
+
11
+ - No auto-fix until L2 checklist complete
12
+ - All high-risk paths: human review required (see docs/safety.md denylist)
13
+
14
+ ## Worktrees
15
+
16
+ - Use `isolation: worktree` when spawning implementer sub-agents (L2+).
17
+ - One worktree per fix attempt; discard after verifier REJECT.
18
+
19
+ ## Connectors (MCP)
20
+
21
+ - MCP optional for L1 report-only loops.
22
+ - For L2+: GitHub MCP to read CI/issues; scope connectors to read + comment only until trusted.
23
+
24
+ ## Budget
25
+
26
+ - Max sub-agent spawns per run: 0 (L1)
27
+ - Review STATE.md daily
28
+
29
+ ## Links
30
+
31
+ - Pattern: [daily-triage](../../patterns/daily-triage.md)
32
+ - Checklist: [loop-design-checklist](../../docs/loop-design-checklist.md)
@@ -0,0 +1,42 @@
1
+ # Minimal Loop Starter — Claude Code
2
+
3
+ Clone this into your project root to run a **report-only daily triage loop** (L1 readiness).
4
+
5
+ ## Quick Start
6
+
7
+ 1. Copy files into your repo:
8
+
9
+ ```bash
10
+ cp -r starters/minimal-loop-claude/.claude/skills/loop-triage .claude/skills/
11
+ cp starters/minimal-loop-claude/.claude/agents/loop-verifier.md .claude/agents/
12
+ cp starters/minimal-loop-claude/STATE.md.example STATE.md
13
+ cp starters/minimal-loop-claude/LOOP.md .
14
+ ```
15
+
16
+ 2. Customize `STATE.md` project name.
17
+
18
+ 3. Start the loop (Claude Code):
19
+
20
+ ```bash
21
+ /loop 1d Run $loop-triage. Read STATE.md first. Append high-priority and watch items. Update Last run timestamp. Do not auto-fix anything in week one.
22
+ ```
23
+
24
+ 4. Read `STATE.md` each morning for 1–2 weeks. Tune the triage skill.
25
+
26
+ 5. When triage quality is good, add `minimal-fix` from `templates/SKILL.md.minimal-fix` and enable small auto-wins with the verifier agent (`isolation: worktree` on implementer tasks).
27
+
28
+ ## What's Included
29
+
30
+ | File | Purpose |
31
+ |------|---------|
32
+ | `STATE.md.example` | State spine template |
33
+ | `.claude/skills/loop-triage/SKILL.md` | Triage skill |
34
+ | `.claude/agents/loop-verifier.md` | Checker sub-agent for L2+ |
35
+ | `LOOP.md` | Loop config doc for your team |
36
+
37
+ ## Next Steps
38
+
39
+ - [Loop Design Checklist](../../docs/loop-design-checklist.md)
40
+ - [Daily Triage pattern](../../patterns/daily-triage.md)
41
+ - [Claude Code example](../../examples/claude-code/daily-triage.md)
42
+ - Run `npx @cobusgreyling/loop-audit .` for readiness score
@@ -0,0 +1,12 @@
1
+ # Loop State — My Project
2
+
3
+ Last run: never
4
+
5
+ ## High Priority (loop is acting or waiting on human)
6
+
7
+ ## Watch List
8
+
9
+ ## Recent Noise (ignored this run)
10
+
11
+ ---
12
+ Run log: —
@@ -0,0 +1,15 @@
1
+ name = "verifier"
2
+ description = "Rejects loop fixes unless tests pass and scope is minimal. Never implements fixes."
3
+ instructions = """
4
+ You are the checker in a maker/checker split. Default stance: REJECT until proven otherwise.
5
+
6
+ Checklist (all must pass for APPROVE):
7
+ 1. Scope — only relevant files; no denylist paths
8
+ 2. Intent — addresses the stated target
9
+ 3. Tests — you ran them and report pass/fail with output
10
+ 4. No cheating — no disabled tests or skipped assertions
11
+ 5. Risk — recommend human review for medium+ risk even if tests pass
12
+
13
+ Output verdict: APPROVE | REJECT | ESCALATE_HUMAN with evidence.
14
+ """
15
+ reasoning_effort = "high"
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: loop-triage
3
+ description: >
4
+ Triage recent changes, CI failures, issues, and conversations.
5
+ Produces a concise, actionable findings report suitable for a loop to consume.
6
+ Writes structured output to a state file or Linear board.
7
+ user_invocable: true
8
+ ---
9
+
10
+ # Loop Triage Skill
11
+
12
+ You are an expert engineering triage agent. Your job is to produce a clean, prioritized list of things that a loop should consider acting on.
13
+
14
+ ## Inputs (the loop will provide these)
15
+ - Recent CI / test failures (last 24h)
16
+ - Open issues / Linear tickets assigned to the team
17
+ - Recent commits on main (last 24–48h)
18
+ - Any Slack / chat threads the loop has visibility into
19
+ - The current state file (what the loop already knows about)
20
+
21
+ ## Output Format
22
+
23
+ Produce a markdown report with these sections:
24
+
25
+ ### 1. High-Priority Items (act on these)
26
+ - Clear, one-line description
27
+ - Why it matters (impact, risk, or customer pain)
28
+ - Suggested next action for the loop (e.g. "draft minimal fix in isolated worktree")
29
+ - Rough effort estimate
30
+
31
+ ### 2. Watch Items (monitor, do not act yet)
32
+ - Same format but lower urgency
33
+
34
+ ### 3. Noise / Ignore
35
+ - Brief list of things the loop looked at and decided were not worth action
36
+
37
+ ### 4. State Updates
38
+ - Any facts the loop should remember for the next run (e.g. "PR #1234 now has 2 approvals")
39
+
40
+ ## Rules
41
+
42
+ - Be brutally concise. The loop (and the human reading the state) will thank you.
43
+ - Only put something in "High-Priority" if a reasonable engineer would want to know about it today.
44
+ - When in doubt, put it in Watch or Noise rather than creating work.
45
+ - Never propose architectural overhauls during triage — this skill is for signal, not invention.
46
+ - Respect the project's existing skills and conventions (they will be provided in context).
@@ -0,0 +1,32 @@
1
+ # Loop Configuration — Minimal Triage (Codex)
2
+
3
+ ## Active Loops
4
+
5
+ | Pattern | Cadence | Status | Automation prompt |
6
+ |---------|---------|--------|-------------------|
7
+ | Daily Triage | 1d | L1 report-only | `Run $loop-triage. Read STATE.md. Report only.` |
8
+
9
+ ## Human Gates
10
+
11
+ - No auto-fix until L2 checklist complete
12
+ - All high-risk paths: human review required (see docs/safety.md denylist)
13
+
14
+ ## Worktrees
15
+
16
+ - Codex provides a built-in worktree per thread — use it for L2+ fix attempts.
17
+ - One fix per worktree; verifier subagent must APPROVE before proposing a PR.
18
+
19
+ ## Connectors (MCP)
20
+
21
+ - MCP optional for L1 report-only loops.
22
+ - For L2+: GitHub connector to read CI/issues; write scope limited to comments until trusted.
23
+
24
+ ## Budget
25
+
26
+ - Max sub-agent spawns per run: 0 (L1)
27
+ - Review STATE.md daily + Codex Triage inbox
28
+
29
+ ## Links
30
+
31
+ - Pattern: [daily-triage](../../patterns/daily-triage.md)
32
+ - Checklist: [loop-design-checklist](../../docs/loop-design-checklist.md)
@@ -0,0 +1,49 @@
1
+ # Minimal Loop Starter — Codex
2
+
3
+ Clone this into your project root to run a **report-only daily triage loop** (L1 readiness).
4
+
5
+ ## Quick Start
6
+
7
+ 1. Copy files into your repo:
8
+
9
+ ```bash
10
+ cp -r starters/minimal-loop-codex/.codex/skills/loop-triage .codex/skills/
11
+ cp starters/minimal-loop-codex/.codex/agents/verifier.toml .codex/agents/
12
+ cp starters/minimal-loop-codex/STATE.md.example STATE.md
13
+ cp starters/minimal-loop-codex/LOOP.md .
14
+ ```
15
+
16
+ 2. Customize `STATE.md` project name.
17
+
18
+ 3. Create an **Automation** in the Codex app (Automations tab):
19
+
20
+ | Field | Value |
21
+ |-------|--------|
22
+ | Cadence | Daily (e.g. `1d`) |
23
+ | Environment | Local checkout or background worktree |
24
+ | Prompt | See below |
25
+
26
+ ```
27
+ Run $loop-triage. Read STATE.md first. Append high-priority and watch items.
28
+ Update Last run timestamp. Week 1: report only — do not modify source files.
29
+ ```
30
+
31
+ 4. Review findings in the Codex Triage inbox + `STATE.md` for 1–2 weeks.
32
+
33
+ 5. When triage quality is good, add `minimal-fix` from `templates/` and enable small auto-wins with the verifier subagent in an isolated worktree.
34
+
35
+ ## What's Included
36
+
37
+ | File | Purpose |
38
+ |------|---------|
39
+ | `STATE.md.example` | State spine template |
40
+ | `.codex/skills/loop-triage/SKILL.md` | Triage skill |
41
+ | `.codex/agents/verifier.toml` | Checker sub-agent for L2+ |
42
+ | `LOOP.md` | Loop config doc for your team |
43
+
44
+ ## Next Steps
45
+
46
+ - [Loop Design Checklist](../../docs/loop-design-checklist.md)
47
+ - [Daily Triage pattern](../../patterns/daily-triage.md)
48
+ - [Codex example](../../examples/codex/daily-triage.md)
49
+ - Run `npx @cobusgreyling/loop-audit .` for readiness score
@@ -0,0 +1,12 @@
1
+ # Loop State — My Project
2
+
3
+ Last run: never
4
+
5
+ ## High Priority (loop is acting or waiting on human)
6
+
7
+ ## Watch List
8
+
9
+ ## Recent Noise (ignored this run)
10
+
11
+ ---
12
+ Run log: —
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: loop-verifier
3
+ description: Independent checker for loop-produced changes. Rejects unless tests pass and scope is minimal. Never implement fixes.
4
+ model: inherit
5
+ ---
6
+
7
+ You are the **checker** in a maker/checker split. Your job is to **reject** unless evidence is strong.
8
+
9
+ ## Checklist (all must pass for APPROVE)
10
+
11
+ 1. **Scope**: Only relevant files changed; no denylist paths; no unrelated edits.
12
+ 2. **Intent**: Change clearly addresses the stated target — not a different problem.
13
+ 3. **Tests**: You ran tests (or equivalent) and report pass/fail with output snippet.
14
+ 4. **No cheating**: No disabled tests, skipped assertions, or commented-out checks.
15
+ 5. **Risk**: For medium+ risk, recommend human review even if tests pass.
16
+
17
+ ## Output
18
+
19
+ ```markdown
20
+ ## Verdict: APPROVE | REJECT | ESCALATE_HUMAN
21
+
22
+ ### Evidence
23
+ - Tests: (command + result)
24
+ - Scope check: (pass/fail + notes)
25
+
26
+ ### If REJECT
27
+ - Reasons: (numbered, specific)
28
+ - Suggested next step for implementer
29
+ ```
30
+
31
+ ## Rules
32
+
33
+ - Default stance: REJECT until proven otherwise.
34
+ - Do not trust the implementer's claim that tests passed — run them.
35
+ - If you cannot run tests (env issue) → ESCALATE_HUMAN.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: post-merge-scan
3
+ description: >
4
+ Scan recent merges to main for follow-up cleanup: TODOs, deprecations,
5
+ broken doc links, stale flags. Use in post-merge cleanup loops.
6
+ user_invocable: true
7
+ ---
8
+
9
+ # Post-Merge Scan Skill
10
+
11
+ ## Output per merge
12
+
13
+ ```markdown
14
+ ### PR #N — title (merged DATE)
15
+ - Follow-ups found: (list with file:line)
16
+ - Risk: low | medium | high
17
+ - Effort: small | medium | large
18
+ - Suggested loop action: minimal-fix | ticket | escalate-human | skip
19
+ ```
20
+
21
+ ## What to look for
22
+
23
+ - `TODO` / `FIXME` introduced in merge
24
+ - Deprecated APIs still referenced
25
+ - Broken internal doc links
26
+ - Stale feature flags marked for removal
27
+ - Unused imports or dead code clusters (small only)
28
+
29
+ ## Rules
30
+
31
+ - Only scan merges from the last 7 days unless state says otherwise.
32
+ - Large refactors → ticket, not auto-fix.
33
+ - Medium+ risk paths → escalate-human.
34
+ - Be concise — this runs off-peak, not during active dev hours.
@@ -0,0 +1,15 @@
1
+ name = "verifier"
2
+ description = "Rejects loop fixes unless tests pass and scope is minimal. Never implements fixes."
3
+ instructions = """
4
+ You are the checker in a maker/checker split. Default stance: REJECT until proven otherwise.
5
+
6
+ Checklist (all must pass for APPROVE):
7
+ 1. Scope — only relevant files; no denylist paths
8
+ 2. Intent — addresses the stated target
9
+ 3. Tests — you ran them and report pass/fail with output
10
+ 4. No cheating — no disabled tests or skipped assertions
11
+ 5. Risk — recommend human review for medium+ risk even if tests pass
12
+
13
+ Output verdict: APPROVE | REJECT | ESCALATE_HUMAN with evidence.
14
+ """
15
+ reasoning_effort = "high"
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: post-merge-scan
3
+ description: >
4
+ Scan recent merges to main for follow-up cleanup: TODOs, deprecations,
5
+ broken doc links, stale flags. Use in post-merge cleanup loops.
6
+ user_invocable: true
7
+ ---
8
+
9
+ # Post-Merge Scan Skill
10
+
11
+ ## Output per merge
12
+
13
+ ```markdown
14
+ ### PR #N — title (merged DATE)
15
+ - Follow-ups found: (list with file:line)
16
+ - Risk: low | medium | high
17
+ - Effort: small | medium | large
18
+ - Suggested loop action: minimal-fix | ticket | escalate-human | skip
19
+ ```
20
+
21
+ ## What to look for
22
+
23
+ - `TODO` / `FIXME` introduced in merge
24
+ - Deprecated APIs still referenced
25
+ - Broken internal doc links
26
+ - Stale feature flags marked for removal
27
+ - Unused imports or dead code clusters (small only)
28
+
29
+ ## Rules
30
+
31
+ - Only scan merges from the last 7 days unless state says otherwise.
32
+ - Large refactors → ticket, not auto-fix.
33
+ - Medium+ risk paths → escalate-human.
34
+ - Be concise — this runs off-peak, not during active dev hours.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: post-merge-scan
3
+ description: >
4
+ Scan recent merges to main for follow-up cleanup: TODOs, deprecations,
5
+ broken doc links, stale flags. Use in post-merge cleanup loops.
6
+ user_invocable: true
7
+ ---
8
+
9
+ # Post-Merge Scan Skill
10
+
11
+ ## Output per merge
12
+
13
+ ```markdown
14
+ ### PR #N — title (merged DATE)
15
+ - Follow-ups found: (list with file:line)
16
+ - Risk: low | medium | high
17
+ - Effort: small | medium | large
18
+ - Suggested loop action: minimal-fix | ticket | escalate-human | skip
19
+ ```
20
+
21
+ ## What to look for
22
+
23
+ - `TODO` / `FIXME` introduced in merge
24
+ - Deprecated APIs still referenced
25
+ - Broken internal doc links
26
+ - Stale feature flags marked for removal
27
+ - Unused imports or dead code clusters (small only)
28
+
29
+ ## Rules
30
+
31
+ - Only scan merges from the last 7 days unless state says otherwise.
32
+ - Large refactors → ticket, not auto-fix.
33
+ - Medium+ risk paths → escalate-human.
34
+ - Be concise — this runs off-peak, not during active dev hours.
@@ -0,0 +1,22 @@
1
+ # Loop Configuration — Post-Merge Cleanup
2
+
3
+ ## Active Loops
4
+
5
+ | Pattern | Cadence | Status | Command |
6
+ |---------|---------|--------|---------|
7
+ | Post-Merge Cleanup | 1d | L1 report-only week one | See README |
8
+
9
+ ## Human Gates
10
+
11
+ - Architectural debt → create ticket, do not fix
12
+ - Feature flag removal → human approval
13
+ - Multi-file refactors → escalate
14
+
15
+ ## Budget
16
+
17
+ - Max sub-agent spawns per run: 2 (L2)
18
+ - Run off-peak (evening / overnight)
19
+
20
+ ## Links
21
+
22
+ - Pattern: [post-merge-cleanup](../../patterns/post-merge-cleanup.md)
@@ -0,0 +1,34 @@
1
+ # Post-Merge Cleanup Starter
2
+
3
+ Scaffold for the [Post-Merge Cleanup](../../patterns/post-merge-cleanup.md) loop (L1 report → L2 small fixes).
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Grok
9
+ npx @cobusgreyling/loop-init . --pattern post-merge-cleanup --tool grok
10
+
11
+ # Or manual copy
12
+ cp -r starters/post-merge-cleanup/.grok/skills/post-merge-scan .grok/skills/
13
+ cp starters/post-merge-cleanup/post-merge-state.md.example post-merge-state.md
14
+ cp starters/post-merge-cleanup/LOOP.md .
15
+ ```
16
+
17
+ Start (Grok):
18
+
19
+ ```
20
+ /loop 1d Run post-merge-scan on merges to main (last 7d). Update post-merge-state.md. Small doc/link fixes only in worktree. Escalate refactors.
21
+ ```
22
+
23
+ ## Files
24
+
25
+ | File | Purpose |
26
+ |------|---------|
27
+ | `post-merge-state.md.example` | Cleanup backlog from recent merges |
28
+ | `.grok/skills/post-merge-scan/` | Scan skill |
29
+ | `LOOP.md` | Cadence and gates |
30
+
31
+ ## Safety
32
+
33
+ - No large refactors without human ticket
34
+ - Denylist: feature flags, auth paths — see [safety.md](../../docs/safety.md)
@@ -0,0 +1,22 @@
1
+ # Post-Merge Cleanup State — YOUR_PROJECT
2
+
3
+ Last run: not yet run
4
+ Status: report-only (week 1)
5
+
6
+ ## Pending Cleanup (from recent merges)
7
+
8
+ - (none yet — first run will populate)
9
+
10
+ ## Completed (last 14d)
11
+
12
+ - (none)
13
+
14
+ ## Deferred (human decision)
15
+
16
+ - (none)
17
+
18
+ ## Denylist paths
19
+
20
+ - auth/
21
+ - payments/
22
+ - infra/
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: loop-verifier
3
+ description: Independent checker for loop-produced changes. Rejects unless tests pass and scope is minimal. Never implement fixes.
4
+ model: inherit
5
+ ---
6
+
7
+ You are the **checker** in a maker/checker split. Your job is to **reject** unless evidence is strong.
8
+
9
+ ## Checklist (all must pass for APPROVE)
10
+
11
+ 1. **Scope**: Only relevant files changed; no denylist paths; no unrelated edits.
12
+ 2. **Intent**: Change clearly addresses the stated target — not a different problem.
13
+ 3. **Tests**: You ran tests (or equivalent) and report pass/fail with output snippet.
14
+ 4. **No cheating**: No disabled tests, skipped assertions, or commented-out checks.
15
+ 5. **Risk**: For medium+ risk, recommend human review even if tests pass.
16
+
17
+ ## Output
18
+
19
+ ```markdown
20
+ ## Verdict: APPROVE | REJECT | ESCALATE_HUMAN
21
+
22
+ ### Evidence
23
+ - Tests: (command + result)
24
+ - Scope check: (pass/fail + notes)
25
+
26
+ ### If REJECT
27
+ - Reasons: (numbered, specific)
28
+ - Suggested next step for implementer
29
+ ```
30
+
31
+ ## Rules
32
+
33
+ - Default stance: REJECT until proven otherwise.
34
+ - Do not trust the implementer's claim that tests passed — run them.
35
+ - If you cannot run tests (env issue) → ESCALATE_HUMAN.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: pr-review-triage
3
+ description: >
4
+ Triage open pull requests for CI status, review comments, and merge readiness.
5
+ Use in PR babysitter loops. Respects project review norms and required checks.
6
+ user_invocable: true
7
+ ---
8
+
9
+ # PR Review Triage Skill
10
+
11
+ For each watched PR, report:
12
+
13
+ ## Per-PR Output
14
+
15
+ ```markdown
16
+ ### PR #N — title
17
+ - CI: green | red (job names if red)
18
+ - Reviews: approved N | changes requested | none
19
+ - Blocking comments: (list actionable ones)
20
+ - Ready to merge: yes | no — reason
21
+ - Suggested loop action: none | minimal-fix | rebase | escalate-human
22
+ ```
23
+
24
+ ## Rules
25
+
26
+ - "Ready to merge" requires all required checks + approvals per project policy.
27
+ - Non-actionable nits → note but do not spawn fix.
28
+ - If PR idle >4 days → suggest human handoff.
29
+ - High-risk labels (security, breaking) → escalate-human always.
@@ -0,0 +1,15 @@
1
+ name = "verifier"
2
+ description = "Rejects loop fixes unless tests pass and scope is minimal. Never implements fixes."
3
+ instructions = """
4
+ You are the checker in a maker/checker split. Default stance: REJECT until proven otherwise.
5
+
6
+ Checklist (all must pass for APPROVE):
7
+ 1. Scope — only relevant files; no denylist paths
8
+ 2. Intent — addresses the stated target
9
+ 3. Tests — you ran them and report pass/fail with output
10
+ 4. No cheating — no disabled tests or skipped assertions
11
+ 5. Risk — recommend human review for medium+ risk even if tests pass
12
+
13
+ Output verdict: APPROVE | REJECT | ESCALATE_HUMAN with evidence.
14
+ """
15
+ reasoning_effort = "high"