feat: implement all 17 loop-engineering improvements · octo-patch/loop-engineering@384c4c3 · GitHub
Skip to content

Commit 384c4c3

Browse files
Cobus GreylingCobus Greyling
authored andcommitted
feat: implement all 17 loop-engineering improvements
- loop-audit v1.3.0: unit tests, CHANGELOG, release workflow - loop-init scaffold CLI for all five patterns and three tools - Complete starters: dependency-sweeper, post-merge-cleanup, Claude/Codex L2 variants - Daily triage dogfood workflow; PR audit comments in CI - Registry JSON schema validation; expanded registry metadata - Docs: pattern-picker, anti-patterns, multi-loop, SECURITY.md - MCP connector cookbook; loop-run-log and loop-budget templates - Three new failure stories; showcase and README updates - Primitives matrix appendix for Cursor/Windsurf/Aider
1 parent 37922a9 commit 384c4c3

70 files changed

Lines changed: 2521 additions & 129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/audit.yml‎

Lines changed: 38 additions & 2 deletions

‎.github/workflows/daily-triage.yml‎

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Daily Triage (dogfood)
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * 1-5'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
12+
jobs:
13+
triage:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
cache-dependency-path: tools/loop-audit/package-lock.json
23+
24+
- name: Build loop-audit
25+
run: |
26+
cd tools/loop-audit
27+
npm ci
28+
npm run build
29+
30+
- name: Run reference audit
31+
id: audit
32+
run: |
33+
cd tools/loop-audit
34+
node dist/cli.js ../.. --json > /tmp/audit.json
35+
SCORE=$(node -e "console.log(JSON.parse(require('fs').readFileSync('/tmp/audit.json','utf8')).score)")
36+
LEVEL=$(node -e "console.log(JSON.parse(require('fs').readFileSync('/tmp/audit.json','utf8')).level)")
37+
echo "score=$SCORE" >> "$GITHUB_OUTPUT"
38+
echo "level=$LEVEL" >> "$GITHUB_OUTPUT"
39+
40+
- name: Check workflow health
41+
id: workflows
42+
run: |
43+
FAILING=0
44+
for wf in validate-patterns audit; do
45+
STATUS=$(gh run list --workflow="${wf}.yml" --limit 1 --json conclusion -q '.[0].conclusion' 2>/dev/null || echo "unknown")
46+
echo "${wf}: ${STATUS}"
47+
if [ "$STATUS" = "failure" ]; then FAILING=$((FAILING + 1)); fi
48+
done
49+
echo "failing=$FAILING" >> "$GITHUB_OUTPUT"
50+
env:
51+
GH_TOKEN: ${{ github.token }}
52+
53+
- name: Update STATE.md
54+
run: |
55+
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
56+
SCORE="${{ steps.audit.outputs.score }}"
57+
LEVEL="${{ steps.audit.outputs.level }}"
58+
FAILING="${{ steps.workflows.outputs.failing }}"
59+
cat > STATE.md <<EOF
60+
# Loop State — loop-engineering reference
61+
62+
Last run: ${DATE} (automated daily-triage workflow)
63+
64+
## High Priority (loop is acting or waiting on human)
65+
66+
- Maintain loop readiness score ≥ 58 (current: **${SCORE}**, level **${LEVEL}**).
67+
- Publish \`@cobusgreyling/loop-audit\` to npm if not yet live (enables \`npx\` installs).
68+
$([ "$FAILING" -gt 0 ] && echo "- **${FAILING}** dogfood workflow(s) failing — investigate CI.")
69+
70+
## Watch List
71+
72+
- Expand contributor failure stories (dependency sweeper, multi-loop).
73+
- Complete Claude Code / Codex starters for all L2 patterns.
74+
- Run \`loop-init\` on a fresh project and verify scaffold output.
75+
76+
## Recent Noise (ignored this run)
77+
78+
—
79+
80+
---
81+
Run log: Updated by \`.github/workflows/daily-triage.yml\`. See \`LOOP.md\` for cadence and gates.
82+
EOF
83+
84+
- name: Commit STATE.md if changed
85+
run: |
86+
git config user.name "loop-engineering-bot"
87+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
88+
git add STATE.md
89+
git diff --staged --quiet || git commit -m "chore(loop): daily triage update STATE.md [automated]"
90+
git push || echo "No push needed or nothing to commit"
91+
92+
- name: Open weekly loop report issue (Mondays)
93+
if: github.event.schedule == '0 8 * * 1-5' && format('{0}', github.run_attempt) == '1'
94+
run: |
95+
DAY=$(date -u +%u)
96+
if [ "$DAY" != "1" ]; then echo "Not Monday — skip issue"; exit 0; fi
97+
EXISTING=$(gh issue list --label "loop-report" --state open --limit 1 --json number -q '.[0].number' 2>/dev/null || true)
98+
if [ -n "$EXISTING" ] && [ "$EXISTING" != "null" ]; then
99+
echo "Open loop-report issue #$EXISTING exists"
100+
exit 0
101+
fi
102+
gh label create "loop-report" --color "3ee8c5" --description "Weekly loop triage report" 2>/dev/null || true
103+
gh issue create \
104+
--title "Loop report — week of $(date -u +%Y-%m-%d)" \
105+
--label "loop-report" \
106+
--body "## Automated daily triage summary
107+
108+
- Loop readiness: **${{ steps.audit.outputs.score }}** (${{ steps.audit.outputs.level }})
109+
- See updated \`STATE.md\` on main
110+
- Review high-priority items and close or re-prioritize
111+
112+
_Generated by daily-triage workflow. Human reviews and decides actions._"
113+
env:
114+
GH_TOKEN: ${{ github.token }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release loop-audit
2+
3+
on:
4+
push:
5+
tags:
6+
- 'loop-audit-v*'
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
test-and-publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
cache: 'npm'
23+
cache-dependency-path: tools/loop-audit/package-lock.json
24+
25+
- name: Install, build, test
26+
working-directory: tools/loop-audit
27+
run: |
28+
npm ci
29+
npm run build
30+
npm test
31+
32+
- name: Publish to npm
33+
working-directory: tools/loop-audit
34+
run: npm publish --access public
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release loop-init
2+
3+
on:
4+
push:
5+
tags:
6+
- 'loop-init-v*'
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Build & publish
24+
working-directory: tools/loop-init
25+
run: |
26+
npm install
27+
npm run build
28+
npm publish --access public
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

‎.github/workflows/validate-patterns.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ jobs:
3939
run: |
4040
test -f templates/pattern-template.md || (echo "Missing pattern-template.md"; exit 1)
4141
test -f templates/STATE.md.template || (echo "Missing STATE template"; exit 1)
42+
test -f templates/loop-run-log.md.template || (echo "Missing loop-run-log template"; exit 1)
43+
test -f templates/loop-budget.md.template || (echo "Missing loop-budget template"; exit 1)
4244
echo "Templates present ✓"
45+
46+
- name: Validate registry.yaml schema
47+
run: |
48+
npm install --no-save yaml@2
49+
node scripts/validate-registry.mjs

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ Also add an entry to `patterns/registry.yaml`.
5050
- Failures are first-class content
5151
- Tool-agnostic by default; tool-specific in labeled sections
5252

53-
## Questions
53+
## Community
5454

55-
Open an issue with label `question` or `pattern-request`.
55+
- **Questions**: open an issue with label `question` or `pattern-request`
56+
- **Discussions**: enable GitHub Discussions on the repo for pattern Q&A (recommended for maintainers)
57+
- **Security**: see [SECURITY.md](./SECURITY.md) — do not file public issues for exploitable vulnerabilities
5658

5759
Thank you for helping make this the go-to reference for loop engineering.

‎LOOP.md‎

Lines changed: 36 additions & 39 deletions

0 commit comments

Comments
 (0)