v0.4.1 — Instruction Reach Architecture

How init, update, and drift detection connect

Step 1
synlynk init
_static_scan() +
discover_agents()
Step 2
Scan existing files
Read CLAUDE.md,
.cursor/rules, etc.
Extract non-synlynk content
Step 3
Generate + Append
Build tool-native block
Insert between markers
Preserve user content
Step 4
Write Manifest
.synlynk/
instructions.json
SHA per file+section
Runtime
synlynk exec
Every agent invocation
Runtime
_check_instruction_drift()
Hash synlynk sections
Compare vs manifest
Sentinel
INSTRUCTION_DRIFT
New event type
Sev2 by default
Ack suppresses
Output
sentinel.md
File + section
that drifted
Line-diff summary
On-Demand
synlynk instructions
status / diff / update
On-Demand
Human review
Absorb new patterns
into template
On-Demand
synlynk instructions update
Re-generates synlynk
section, refreshes manifest

Instruction File Targets

Tool File Marker syntax Native features used Detection
Claude Code CLAUDE.md <!-- synlynk:start --> Section headers, code blocks claude --version
AGY / Gemini GEMINI.md <!-- synlynk:start --> Section headers, code blocks agy --version
Codex AGENTS.md <!-- synlynk:start --> Section headers, code blocks codex --version
Cursor .cursor/rules/synlynk.mdc <!-- synlynk:start --> Frontmatter: globs, alwaysApply .cursor/ dir exists
GitHub Copilot .github/copilot-instructions.md <!-- synlynk:start --> Plain markdown, no frontmatter .github/ dir exists
Windsurf .windsurfrules # synlynk:start Hash-comment rules format .windsurfrules exists
Universal AI_INSTRUCTIONS.md <!-- synlynk:start --> Always written — manual paste target Always

Does this architecture look right? Let me know in the terminal and we'll move to the detailed design sections.