feat(constraints): add loop-constraints file + enforcement skill#71
feat(constraints): add loop-constraints file + enforcement skill#71neerajdad123-byte wants to merge 3 commits into
Conversation
- New templates/loop-constraints.md: single source of truth for all loop guardrails (denylist paths, push/merge rules, human gates, budget caps) - New templates/SKILL.md.loop-constraints: skill that reads constraints file at start of every run and enforces every rule - loop-audit: scores constraints file (+4 pts) and skill (+2 pts); detects both in auditProject; new finding for missing constraints - loop-init: scaffoldConstraints() generates loop-constraints.md + loop-constraints skill in target project - docs/safety.md: cross-reference to new constraints file Closes: the gap where constraints were only soft prompts scattered across safety.md, LOOP.md, and skill files. Now a single structured file + runtime enforcement skill. Tests: loop-audit 11/11, loop-cost 7/7, loop-init 6/6
…de loop-constraints
cobusgreyling
left a comment
There was a problem hiding this comment.
Thanks, CI passed. One fix needed before merge: in LOOP_SKILL_NAMES (both src/auditor.ts and dist/auditor.js), please add loop-constraints without removing draft-release-notes. Right now │ draft-release-notes was swapped out, which would regress scoring for projects using that skill.
|
Fixed — draft-release-notes restored alongside loop-constraints in both src/auditor.ts and dist/auditor.js. Both |
cobusgreyling
left a comment
There was a problem hiding this comment.
Re-reviewed against current main — this looks ready to merge.
Fixed since last review: LOOP_SKILL_NAMES now includes both loop-constraints and draft-release-notes (no regression). ✓
What I like:
loop-constraints.md+ enforcement skill closes a real gap (constraints were scattered across safety/LOOP/skills)loop-initscaffolds both files automatically — great adoption pathloop-auditscoring (+4 file, +2 skill) is proportional- Tool-specific examples in
examples/{grok,claude-code,codex}/match repo conventions
Small nits before merge (non-blocking, but appreciated):
- Add a
loop-inittest assertingloop-constraints.md+ skill are scaffolded (like issue-triage/ci-sweeper tests) - Add an
auditor.test.mjscase for constraints file + skill scoring - Cross-link from README Quick Links table and
docs/safety.mdis done — consider one line indocs/QUICKSTART.mdmentioning constraints as optional week-1 hardening
Happy to merge once CI is green on latest main rebase.
feat(constraints): loop-constraints file + enforcement skill (#71)
|
Merged via #86 — thanks @neerajdad123-byte! Rebased cleanly onto latest main; all tests green. |
Summary
Adds a structured constraints system — a single loop-constraints.md file where users define rules (e.g. "Don't push
before telling me", "Never edit auth/") and a loop-constraints skill that reads and enforces them at the start of
every loop run. Closes the gap where constraints were only soft prompts scattered across safety.md, LOOP.md, and
individual skill files.
Changes
Checklist (from CONTRIBUTING)
Testing / Dogfood
loop-audit: 11/11 passed
loop-cost: 7/7 passed
loop-init: 6/6 passed
node tools/loop-audit/dist/cli.js . → Score: 100/100 L3
node tools/loop-init/dist/cli.js /tmp/test -p daily-triage -t grok --dry-run → scaffolds constraints file + skill
correctly
Screenshots / Examples
$ npx @cobusgreyling/loop-audit .
Score: 100/100 Level: L3
✓ loop-constraints.md present.
$ npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok --dry-run
would copy: ...templates/loop-constraints.md → loop-constraints.md
would copy: ...templates/SKILL.md.loop-constraints → .grok/skills/loop-constraints/SKILL.md
Files (11)
templates/loop-constraints.md [ADDED] (+30)
templates/SKILL.md.loop-constraints [ADDED] (+52)
examples/grok/constraints.md [ADDED] (+32)
examples/claude-code/constraints.md [ADDED] (+29)
examples/codex/constraints.md [ADDED] (+20)
docs/safety.md [MODIFIED] (+11 -2)
tools/loop-audit/src/auditor.ts [MODIFIED] (+36 -2)
tools/loop-audit/dist/auditor.d.ts [MODIFIED] (+4)
tools/loop-audit/dist/auditor.js [MODIFIED] (+34 -1)
tools/loop-audit/test/auditor.test.mjs [MODIFIED] (+1)
tools/loop-init/src/cli.ts [MODIFIED] (+17)
tools/loop-init/dist/cli.js [MODIFIED] (+9)