Skip to content
LucasXlabPublic

About

Find conflicting agent instructions and preview shared-rule updates without losing local notes. Offline Python CLI with recoverable file sync.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

English  ·  简体中文

agentrc

Shared rules. Local context.

Inspect, compare, generate, and sync agent instruction files. Preview a shared baseline update while keeping the notes outside its block.

Quick start  ·  Usage  ·  Guide  ·  Contribute

Find a conflict, fail the gate, and preview a recoverable baseline sync.

Find a conflict, fail the gate, and preview a recoverable baseline sync. Recording and reproduction.

Why agentrc?

Several tools can read different instruction files in the same repository. A shared rule drifts; a pasted update overwrites a local note. agentrc makes the files, exact differences, inferred commands, and sync plan available for review before a write.

Quick start

Python 3.11+ on macOS or Linux. The demo uses temporary synthetic files and checks the expected failed conflict gate. Runtime dependencies are empty.

Clone the published source and install it in an isolated environment:

git clone --branch noah/agentrc https://github.com/LucasXlab/agentrc.git
cd agentrc
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
python scripts/demo.py

The demo prints three operations: doctor exits 0, the deliberate TypeScript conflict makes check exit 1, and generate --stdout exits 0. The wrapper succeeds only when these results match.

For your first real check, replace /absolute/path/to/your/repo with your project directory:

agentrc doctor /absolute/path/to/your/repo
agentrc lint /absolute/path/to/your/repo
agentrc check /absolute/path/to/your/repo

Read the detected file list and the specific lint explanations before changing rules. If there are no instruction files, review a scaffold with agentrc generate /absolute/path/to/your/repo --stdout. sync needs existing target files; an empty target directory returns exit 2 instead of reporting a successful update.

Usage

Inspect before changing files

agentrc doctor ./project --json
agentrc diff ./first-checkout ./second-checkout --json
agentrc generate ./project --stdout

generate --stdout creates no file and does not execute inferred commands. A high file score does not cancel a recognized cross-file contradiction.

Preview a shared baseline

agentrc sync --baseline shared.md --target ./project --dry-run --json

Read the plan before applying it. Sync preserves text outside the baseline block, creates raw-byte backups for changed files, and leaves an identical rerun unchanged. Multiple writes are not one filesystem transaction.

check exits 1 for a failed gate. Invalid or incomplete operations exit 2; reports such as doctor and diff do not fail solely because they found drift.

Scope

Linting, scoring, and cross-file conflict checks are finite heuristics. They do not prove that instructions are correct or safe. Filesystem reads are bounded; Windows is unsupported. Review filenames and remaining prose before sharing output.

See the usage guide for more examples, exact parameters, and technical boundaries.

Contributing

Start with CONTRIBUTING.md. Use synthetic reproductions and report the validation you actually ran.

MIT License · 简体中文

About

Find conflicting agent instructions and preview shared-rule updates without losing local notes. Offline Python CLI with recoverable file sync.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages