name: ry-repair description: "Нормализация репозитория: source-of-truth scan, semantic entropy cleanup, stale docs/memory repair, validators, docs/memory sync. Используй для: ry-repair, почини систему, нормализуй репозиторий, убери противоречия. EN triggers: repository repair, semantic entropy cleanup, stale AI-tool context, contract normalization."
ry-repair
Purpose
Normalize a repository so OpenCode, Codex, and Claude Code can work from the same verified facts with minimal semantic entropy. This is a technical repair flow, not permission to change business logic silently.
For rldyour AI CLI configuration repositories, /ry-repair also verifies deterministic install/update/sync convergence through the root config/ry-repair-sync-contract.json and scripts/ry_repair_sync.py contract when that control plane is present.
Mode Selection
- Work project: run the full authoring repair workflow below.
- rldyour control plane or adapter config repo, goal = converge the installed
system: run consumer mode instead - update the checkout FROM GitHub
(
git pull --ff-only,git submodule update --init --recursive), thenpython3 scripts/ry_repair_sync.py --checkand--apply --install-system. In consumer mode do NOT author changes into the repository: no commits, no doc/contract/memory edits, no fullrepo publication. If fast-forward fails or validators reveal repository drift, report it and switch to authoring repair only on explicit owner instruction.
Workflow
- Detect repository type, branch/worktree, submodules, CI surface, deploy surface, and effective project policy from
RLDYOUR_PROJECT_POLICY,.rldyour/project-policy.local.json,.rldyour/project-policy.json, or built-in defaults. - Read native instruction/config surfaces:
AGENTS.md,.claude/CLAUDE.md,opencode.json,.opencode/commands,.opencode/skills,.opencode/agents,.opencode/plugins, and repository contracts. - Inspect Serena memories, plans, and research archives for stale facts, unsupported claims, missing taxonomy, duplicated rules, or contradictions with current code.
- Inspect GitHub issues, pull requests, and recent history through MCP or CLI when available. Verify every issue against current code before treating it as a fact.
- Inspect MCP/LSP/tooling config, plugin hook lifecycles, commands/skills/agents, CI gates, release manifests, dependency baselines, and docs source-of-truth declarations.
- When the root control plane is present, run
python3 scripts/ry_repair_sync.py --plan --target "$PWD"and use--checkbefore claiming local repo, system AI CLI config, Serena memory, or GitHub/fullrepo sync. For OS/mode work, pass explicit flags:--os macos|linux|wsl|windows,--mode standard|orchestrator, and--cmuxonly for macOS orchestrator mode. - Treat approved active inventories as system-wide: installed Claude/Codex/OpenCode configs, active agent/tool surfaces, CI workflows, runtime pins, docs, and release gates must match current MCP/provider policies. Do not keep permanent tool-specific absence gates for removed components.
- Detect semantic entropy: duplicated docs, stale pins, conflicting instructions, dead config, unclear source-of-truth, missing ADR/CONTEXT/FUTURE facts, broken validators, adapter parity drift, and natural-language policy overrides that are not materialized in project policy JSON.
- Produce a repair plan that separates:
- technical repairs the agent may apply;
- business, functional, security-posture, deployment-target, data-model, or ADR decisions that require the owner.
- Ask the owner in Russian before changing any decision-class item. Present concise options with a recommendation, reason, and impact.
- Apply technical-only repairs using existing project patterns and native OpenCode surfaces. If the user explicitly states repository policy and no policy file exists, write
.rldyour/project-policy.jsonor.rldyour/project-policy.local.jsononly from that explicit instruction; do not infer ownership/destructive permissions from chat tone. - Run matching validators, tests, schema checks, plugin/hook checks, release/archive checks, installed-config checks, and instruction/memory freshness checks.
- Synchronize durable docs and Serena memories from verified code/config state, then finish through
flow-post-task-syncwhen durable artifacts changed.
Non-Negotiables
- Current code, config, runtime checks, and verified GitHub state are the source of truth. Memories and docs are derived evidence.
- Do not edit ADR meaning, business logic, functional behavior, pricing, deployment targets, security posture, or data contracts without owner approval.
- Hooks and plugins stay bounded and deterministic. They may mark state;
ry-repairperforms the repair. - Do not hide unresolved drift behind green summaries. Every blocked check names the blocker and next proof command.
- Do not report local repo, system config, Serena memory, or GitHub parity without evidence from
ry_repair_sync.py, installed-config validators, current git state, and fullrepo/GitHub checks where applicable.
Output
Report in Russian:
- Scope and source-of-truth map.
- Confirmed drift, grouped by severity.
- Technical repairs applied.
- Decision-class items left for owner approval.
- Exact validation commands and results.
- Docs/memory/fullrepo/git synchronization status.