feat(constraints): add loop-constraints file + enforcement skill#71
Open
neerajdad123-byte wants to merge 3 commits into
Open
feat(constraints): add loop-constraints file + enforcement skill#71neerajdad123-byte wants to merge 3 commits into
neerajdad123-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
requested changes
Jun 26, 2026
cobusgreyling
left a comment
Owner
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.
Author
|
Fixed — draft-release-notes restored alongside loop-constraints in both src/auditor.ts and dist/auditor.js. Both |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)