Skip to content

feat(tools): add loop-sync CLI for drift detection and configuration …#47

Open
hsms4710-pixel wants to merge 1 commit into
cobusgreyling:mainfrom
hsms4710-pixel:feat/add-loop-sync-tool
Open

feat(tools): add loop-sync CLI for drift detection and configuration …#47
hsms4710-pixel wants to merge 1 commit into
cobusgreyling:mainfrom
hsms4710-pixel:feat/add-loop-sync-tool

Conversation

@hsms4710-pixel

Copy link
Copy Markdown

Summary

This PR introduces loop-sync, a new CLI tool that detects drift between STATE.md and LOOP.md files. This addresses a common pain point in Loop Engineering workflows where state and loop definitions can become out of sync over time.

Problem

When maintaining Loop Engineering projects, developers often find:

  • STATE.md and LOOP.md diverge as project evolves
  • Manual sync is error-prone and time-consuming
  • No automated way to validate consistency

Solution

loop-sync provides:

  • Drift Detection: Identifies missing patterns, outdated goals, and inconsistent configurations
  • Consistency Scoring: Quantifies sync health (0-100 scale)
  • Actionable Suggestions: Specific commands to run for each issue
  • Multiple Output Formats: Human-readable text and machine-readable JSON

Files Added

  • tools/loop-sync/src/sync.ts - Core sync logic (drift detection, scoring, suggestions)
  • tools/loop-sync/src/cli.ts - CLI interface
  • tools/loop-sync/test/sync.test.mjs - Comprehensive test suite
  • tools/loop-sync/package.json - Package configuration
  • tools/loop-sync/README.md - Usage documentation

Features:

  • Drift detection with severity levels (error/warning/info)
  • Consistency scoring system
  • Comprehensive sync suggestions
  • JSON and text output formats
  • Integration with existing loop-cli

Usage:
npx @loop-engineering/cli loop-sync --state STATE.md --loop LOOP.md
npx @loop-engineering/cli loop-sync --state STATE.md --loop LOOP.md --json

Example Output

Analyzing sync status... State: STATE.md Loop: LOOP.md

📊 Consistency Score: 75/100

⚠️ Issues Found: [WARNING] Pattern 'refactor-auth' in STATE.md not found in LOOP.md Suggestion: Add pattern to LOOP.md or remove from STATE.md

[INFO] Goal section in STATE.md differs from LOOP.md Suggestion: Run 'loop-sync --fix' to synchronize

✅ Suggestions: 3 actionable items

Testing

cd tools/loop-sync
npm test
All tests pass. The tool integrates seamlessly with the existing loop-cli package.

…sync

- Detect drift between STATE.md ↔ LOOP.md
- Check for missing required files (STATE.md, LOOP.md, AGENTS.md)
- Scan skills directory for version information
- Calculate consistency score (0-100) with health levels
- Provide actionable suggestions for fixing issues
- Support JSON and human-readable output formats
- Include comprehensive test suite

This tool helps teams maintain consistent Loop configurations
across their repositories and detect configuration drift early.

Closes #none (new feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant