SyncytiumMD
AGENTS.md6 starsChanged 7 days agoMITView on GitHub
Universal agent instructions generated by SyncytiumMD. Source of truth: .syncytium/. Single source of truth for every AI agent working on this repository. Every bridge file (CLAUDE.md, AGENTS.md, .cursor/rules/*.mdc, …) is generated from this directory by syncytium sync — never edit those by hand. SyncytiumMD is a CLI + library + MCP server that maintains one canonical context (.syncytium/) and transpiles it into the native instruction format of every AI coding tool in use. It also provides multi-agent coordination: a lease-based…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/adapter-standards.mdcCursor rule
- .cursor/rules/code-style.mdcCursor rule
- .cursor/rules/release-criteria.mdcCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/syncytium-architecture.mdcCursor rule
- .cursor/rules/syncytium-handoff.mdcCursor rule
- .cursor/rules/testing-standards.mdcCursor rule
- llms-full.txtllms.txt
- llms.txtllms.txt
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 2 are common, 12 are distinctive, and 12 are very specific to this project.
≈2
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 4
Do not edit manually unless you plan to run reverse-sync.
- Common: line 28
Notes: No npm credential exists locally or in GitHub secrets, so 0.3.1 cannot be published until the npm-side trusted publisher exists.
- Very specific: line 111
Every advertised tool carries MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) from src/mcp/safety.ts, and …
- Very specific: line 155
When adding or updating adapters in src/adapters/:
- Very specific: line 157
Every adapter must implement AgentAdapter from src/core/types.ts.
- Very specific: line 161
Every file must include a leading or trailing SyncytiumMD header comment (e.g.
- Very specific: line 167
Add unit tests verifying target file generation in tests/syncytium.test.ts.
- Distinctive: line 176
Write clean, modular, and self-documenting code.
- Distinctive: line 177
Always prefer strict types, immutable data structures, and pure functions where reasonable.
- Distinctive: line 178
Keep functions concise with a single responsibility.
- Distinctive: line 180
Avoid unnecessary dependencies.
- Distinctive: line 198
When a bug is fixed, add a test that fails without the change and name the regression in the test description.
- Very specific: line 234
Never hand-edit src/version.ts or package.json version independently: a unit test asserts they match, and --bump updates both together.
- Very specific: line 270
Every MCP tool declares honest readOnlyHint / destructiveHint / idempotentHint / openWorldHint annotations in src/mcp/safety.ts, and the …
- Common: line 282
Never log or echo secrets, tokens or full file contents to stdout: stdout is the MCP JSON-RPC transport.
- Distinctive: line 293
Write unit tests for all business logic and edge cases.
- Distinctive: line 295
Verify tests pass before completing any implementation task.
- Distinctive: line 296
Follow the Arrange-Act-Assert pattern for test clarity.
- Very specific: line 302
[ADR-001] Adopt SyncytiumMD as Universal Context Bridge: Use SyncytiumMD as the single source of truth (.syncytium/) to transpile and …
- Very specific: line 310
Read .syncytium/HANDOFF.md before starting work.
- Very specific: line 312
After finishing, run syncytium handoff --from "<name>" -g "<goal>" -d "<done>" -t "<todo>".
- Very specific: line 313
Never hand-edit generated files - change .syncytium/ and run syncytium sync.
- Distinctive: line 325
Before any repo-wide text search (grep/glob over unknown files), run query_graph on the symbol or path, then get_neighbors for its callers …
- Distinctive: line 328
Before editing a module others may import — including while fixing a failing test or reviewing a diff — check get_neighbors to scope the …
- Distinctive: line 334
Treat graph results as a map: verify the relevant source files before editing because source code remains authoritative.
- Distinctive: line 337
If you finish a multi-file task without a single Graphify query, state in one line why the graph was not needed.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
⚠️ AUTO-GENERATED BY SYNCYTIUM-MD ⚠️
This file is automatically synchronized from .syncytium/
Do not edit manually unless you plan to run reverse-sync.
Source of truth: .syncytium/
-->AGENTS.md - SyncytiumMD
Universal agent instructions generated by SyncytiumMD. Source of truth:
.syncytium/.
🤝 Live Handoff Status
- Active Agent:
opencode(Next:Human) - Status:
BLOCKED - Current Goal: v0.3.1 npm publish and MCP Registry listing are blocked on npm OIDC trusted-publisher setup
- Pending Tasks:
- On npmjs.com add a Trusted Publisher for syncytium-md: GitHub Actions, owner mrcbrbn5361, repo SyncytiumMD, workflow release.yml
- Re-run Release run 42053623967, then run the MCP Discovery workflow (or re-run 42053623576)
- Rotate any credential that was pasted into chat earlier
- Recently Touched:
.gitattributessrc/core/storage.tsserver.jsonsrc/mcp/safety.ts.github/workflows/release.yml.github/dependabot.ymlscripts/build-discovery.mjs.github/workflows/discoverability.yml
- Notes: No npm credential exists locally or in GitHub secrets, so 0.3.1 cannot be published until the npm-side trusted publisher exists. After that, both workflows are idempotent and need no secrets.
- Last Updated: 2026-11-05T15:24:48.885Z
System Architecture
System Architecture & Technology Stack
Single source of truth for every AI agent working on this repository. Every bridge file (
CLAUDE.md,AGENTS.md,.cursor/rules/*.mdc, …) is generated from this directory bysyncytium sync— never edit those by hand.
Overview
SyncytiumMD is a CLI + library + MCP server that maintains one canonical
context (.syncytium/) and transpiles it into the native instruction format of
every AI coding tool in use. It also provides multi-agent coordination: a
lease-based workspace lock, a handoff baton with an audit trail, and a local
visual knowledge graph.
Technology Stack
- Runtime: Node.js 20+ (ESM, build-first; tests run from
dist-tests/) - Language: TypeScript,
strictplusnoUnusedLocals,noUnusedParameters,noImplicitOverride,noImplicitReturns,verbatimModuleSyntax - Build: tsup (esbuild) with
dts: true→dist/{index,cli/index,mcp/index}.js - CLI: Commander.js + picocolors
- Validation: zod (config schema, rule frontmatter, ADR, every MCP tool input)
- Parsing: gray-matter (frontmatter) — all loaders deep-copy, see ADR-006
- Watching: chokidar
- MCP:
@modelcontextprotocol/sdkover stdio - UI: zero-dependency
node:httpserver + a single-page Three.js app (Three.js r128 loaded from cdnjs; the vault/doc panels degrade gracefully without it)
Module Map
| Path | Responsibility |
src/version.ts | The single in-code version string; a unit test pins it to package.json |
src/core/schemas.ts | Every zod schema: config, rule frontmatter, ADR, handoff, lock, stack |
src/core/paths.ts | slugify (path-traversal guard), gitignore-style glob matcher, root containment |
src/core/diff.ts | Dependency-free unified-diff generator used by diff |
src/core/storage.ts | .syncytium/ persistence, config validation/migration, ADR recovery |
src/core/templates.ts | Per-stack rule sets (11 stacks), banners, CI workflow template |
src/core/engine.ts | Orchestrator: init, sync, diff, doctor, lint, handoff, lock, graph, UI server, watch |
src/adapters/base.ts | Shared compile helpers, rule-id sanitising, user-section preservation |
src/adapters/registry.ts | Adapter registry, containment-checked writes, banner-only cleanup |
src/adapters/builtin/ | 10 built-in adapters + GenericAdapter for config-declared tools |
src/ui/markdown.ts | Canonical Markdown → HTML renderer (injected into the browser bundle) |
src/ui/template.ts | Obsidian Studio HTML: 3D graph, vault explorer, document reader |
src/mcp/server.ts | 22 MCP tools, every input zod-validated, output token-budgeted |
src/mcp/safety.ts | Tool annotations, per-tool rate limits, effect classification |
src/cli/index.ts | 22 CLI commands with a global --json mode |
Engine API
init · sync · diff · doctor · lint · validate · handoff ·
getHandoffHistory · addDecision · removeDecision · listDecisions ·
addRule · getRule · removeRule · listRules · exportBundle ·
clean · importExisting · getStatus · listTrash · restoreFromTrash ·
acquireLock · releaseLock · renewLock · getLockStatus ·
installGitHook · uninstallGitHook · installCiWorkflow ·
uninstallCiWorkflow · detectStack · getKnowledgeGraph ·
startUiServer · watch
Data Flow
.syncytium/ ──load──► CanonicalContext ──generate──► GeneratedFile[] ──write──► bridge files
▲ │
└──────────────────── diff / prune / preserve user sections ◄────────────────────────┘sync writes every generated file, then prunes banner-tagged files that no rule
produces any more. diff compares content and reports identical, modified
(with a unified patch), missing_on_disk, and unmanaged (orphans).
MCP Safety Model
Every advertised tool carries MCP annotations (readOnlyHint,
destructiveHint, idempotentHint, openWorldHint) from
src/mcp/safety.ts, and the server enforces a per-tool sliding-window call
budget in the same module. Destructive tools (remove_rule, remove_decision)
default to dryRun: true; an actual delete needs dryRun: false and
confirm: true. Before deleting, the engine archives the exact rule/ADR bytes
under .syncytium/memory/trash/, and syncytium_restore (plus
listTrash/restoreFromTrash in the library) can undo the operation.
doctor is read-only: it reports remediation strings but never executes them.
The contract is mechanical, not descriptive: every inputSchema is closed with
additionalProperties: false and documents each property, and every stable read
tool declares an outputSchema plus matching structuredContent. Mutation is
never hidden behind a read annotation — validate is read-only and the separate
validate_fix tool performs repairs.
Discovery
server.json describes the npm package to registry.modelcontextprotocol.io,
and mcpName in package.json proves npm ownership. .github/workflows/discoverability.yml
regenerates llms.txt / llms-full.txt, validates the manifest, and publishes
it with GitHub OIDC; no credential is stored in the repository.
Directory Layout
src/— source code and adapterstests/syncytium.test.ts— 123 tests, build-first (npm run build && tsc -p tsconfig.tests.json && node --test dist-tests/*.test.js)scripts/release.mjs— verify → publish → CDN-poll → global install.syncytium/— single source of truthrules/— canonical, stack-aware rulesmemory/decisions.md— ADRsmemory/handoff-history.json— baton audit trailmemory/lock.json— machine-local lease (git-ignored)HANDOFF.md— live agent state
Engineering Guidelines
📌 AI Tool Adapter Guidelines & Architecture
Standards for implementing new IDE and CLI bridge adapters in SyncytiumMD
AI Tool Adapter Guidelines
When adding or updating adapters in src/adapters/:
- Interface Contract:
- Every adapter must implement
AgentAdapterfromsrc/core/types.ts. - Implement
readonly id,readonly name,readonly category,readonly description,readonly defaultTargetFiles.
- Every adapter must implement
- Deterministic Output:
- The
generate(context: CanonicalContext)method must return an array ofGeneratedFile[]. - Every file must include a leading or trailing SyncytiumMD header comment (e.g.
# Auto-generated by SyncytiumMD) unless the format forbids comments.
- The
- Preserve User Modifications:
- Adapters should respect user custom sections where supported.
- Registration:
- Register all new adapters in
AdapterRegistry(src/adapters/registry.ts).
- Register all new adapters in
- Coverage:
- Add unit tests verifying target file generation in
tests/syncytium.test.ts.
- Add unit tests verifying target file generation in
📌 Code Style & Formatting
Enforce clean, readable, modern standards across the project
Code Style & Formatting
- Write clean, modular, and self-documenting code.
- Always prefer strict types, immutable data structures, and pure functions where reasonable.
- Keep functions concise with a single responsibility.
- Preserve existing comments and documentation unless explicitly asked to modify them.
- Avoid unnecessary dependencies; prefer standard library APIs where possible.
Repository-specific conventions
- Comments explain why. A comment restating what the code does is noise; a comment explaining a non-obvious constraint, a bug workaround, or a deliberate deviation is mandatory. Prefer a short comment at the point of the decision over a long block at the top of the file.
- Never let a shared, cached object escape.
gray-matterhands back the same object for identical content, andDEFAULT_CONFIG/INITIAL_RULES/INITIAL_DECISIONSare module-level singletons. Copy before mutating (seeclone()insrc/core/storage.tsanddeepClone()in the config path). - Order-dependent output is a bug. Rule loading is sorted explicitly so generated files are byte-identical across platforms.
- Derive, do not duplicate. The version lives in
src/version.ts, the Markdown renderer insrc/ui/markdown.ts(injected into the browser bundle viaFunction.prototype.toString()), and path safety insrc/core/paths.ts. A second copy will drift. - When a bug is fixed, add a test that fails without the change and name the regression in the test description.
📌 Release & Verification Criteria
Every change ships green: typecheck, build, tests, lint, and zero context drift
Release Criteria
A change is not done until all of these pass locally:
npm run typecheck # tsc --noEmit over src/ and tests/
npm run build # tsup, ESM + .d.ts
npm test # 129 tests, build-first + dist-tests (Node 20+)
npm run verify # all three, in orderBefore opening a PR
node dist/cli/index.js lint— canonical rules and frontmatter are valid.node dist/cli/index.js diff— no drift between.syncytium/and the committed bridge files. Commit the regenerated files together with the change.node dist/cli/index.js doctor— noerrorchecks. Warnings are acceptable only when they are pre-existing and unrelated.
Releasing
npm run release runs the whole pipeline and fails loudly:
typecheck→build→testnpm publish- polls
npm viewwith exponential backoff until the version is served npm install -gand verifies the installed version
Never hand-edit src/version.ts or package.json version independently: a unit
test asserts they match, and --bump updates both together.
Definition of done
- New behaviour has a test that fails without the change.
- Public behaviour changes are reflected in
README.mdandREADME.tr.md. - Architectural decisions go into
.syncytium/memory/decisions.mdviasyncytium adr add. - The handoff baton is updated before the turn ends:
syncytium handoff --from "<agent>" -g "<goal>" -d "<done>" -t "<todo>".
📌 Security & Safe Coding
Security rules, secrets handling, and sanitization
Security & Boundaries
- The Obsidian Studio server binds to
127.0.0.1and rejects any request whoseHostheader is not a loopback name. This is a DNS-rebinding guard: without it, any web page the user has open could read/api/filefrom their workspace.--allow-remotelifts the guard and must only be used knowingly. Access-Control-Allow-Originisnull(same-origin) by default./api/filerefuses in-root secrets (.env*,*.pem,*.key,id_rsa,.npmrc,.netrc, …) and everything under.git/, in addition to the path-traversal containment check.- Rule ids arrive from user-authored frontmatter and are interpolated into
generated file paths. Every path is slugified (
src/core/paths.ts) and every write is re-checked against the workspace root before touching disk. - The UI escapes
projectNameand all node ids, serialises its bootstrap config with</>/&/U+2028 escaped, and uses event delegation instead of inlineonclick— a hostile rule id in a cloned repo must not be able to run script. syncytium cleandeletes only files carrying the Syncytium banner. A user's own.cursor/rules/my-rule.mdcis never touched.- MCP tool inputs are validated with zod before they reach the engine.
- Every MCP tool declares honest
readOnlyHint/destructiveHint/idempotentHint/openWorldHintannotations insrc/mcp/safety.ts, and the server enforces a per-tool sliding-window rate limit there. A scanner or gateway can therefore reason about the surface, and a runaway agent loop is stopped in-process even when the client ignores the hints. - Destructive MCP tools are safe by default:
dryRundefaults totrueand an actual delete requiresdryRun: falseandconfirm: true. - Deletions are recoverable.
removeRule/removeDecisionarchive the exact source bytes under.syncytium/memory/trash/before touching the live file, andsyncytium_restore/restoreFromTrashundo the operation. syncytium_doctoris strictly read-only. Itsfixstrings are suggestions; it never runs them, spawns processes, or edits git/CI state.- Never log or echo secrets, tokens or full file contents to stdout: stdout is the MCP JSON-RPC transport.
📌 Testing Standards & Verification
Quality assurance and test verification guidelines
Target Files: **/*.test.ts, **/*.test.tsx, **/*.spec.ts, tests/**/*
Testing Guidelines
- Write unit tests for all business logic and edge cases.
- Mock external network requests, timers, and heavy I/O in unit test suites.
- Verify tests pass before completing any implementation task.
- Follow the Arrange-Act-Assert pattern for test clarity.
🧠 Key Decisions (ADR)
- [ADR-001] Adopt SyncytiumMD as Universal Context Bridge: Use SyncytiumMD as the single source of truth (.syncytium/) to transpile and synchronize rules, memories, and handoff state across all AI coding tools. (accepted, 2026-09-19)
- [ADR-002] Zero-Heavy-Dependencies Knowledge Graph UI: Implement an embedded Canvas-based force-directed graph server using native node:http and Server-Sent Events (SSE). (accepted, 2026-09-19)
- [ADR-003] Lease-Based Multi-Agent Collision Prevention Lock: Introduce syncytium lock with time-expiring leases (e.g. 30-45 minutes) stored in .syncytium/memory/lock.json. (accepted, 2026-09-19)
- [ADR-004] Automated Release Pipeline with NPM CDN Replication Polling: Implement scripts/release.mjs (npm run release) which verifies tests, publishes, polls npm view with exponential backoff until live, and then installs globally. (accepted, 2026-09-19)
- [ADR-005] High-Performance 3D Knowledge Galaxy with Physics Sleep & Geometry Pooling: Implement Three.js unit sphere geometry and material caching/pooling, simulation alpha decay with auto-sleeping (0% idle CPU load), LOD lazy text sprite generation, floating hover tooltips, and compact view mode (--compact, --no-files, --no-tags). (accepted, 2026-09-19)
- …and 10 more in
.syncytium/memory/decisions.md
Working Agreement
- Read
.syncytium/HANDOFF.mdbefore starting work; it holds the live goal and pending tasks. - Acquire the lease with
syncytium lock acquire --agent "<name>"; release it before you finish. - After finishing, run
syncytium handoff --from "<name>" -g "<goal>" -d "<done>" -t "<todo>". - Never hand-edit generated files - change
.syncytium/and runsyncytium sync.
<!-- vi3ecode:plugin:graphify:guidance:begin -->Graphify code intelligence (active)
The vi3ecode-graphify MCP server serves this project's code graph: modules,
dependencies, communities, and PR impact. Tools: query_graph, get_node,
get_neighbors, get_community, shortest_path, god_nodes, graph_stats, list_prs,
get_pr_impact, triage_prs. If your harness defers or hides MCP tools, load them
first (tool search for "graphify") instead of assuming they are missing.
Make the graph your first investigation step, not a fallback:
- Before any repo-wide text search (grep/glob over unknown files), run query_graph on the symbol or path, then get_neighbors for its callers and dependents.
- Before editing a module others may import — including while fixing a failing test or reviewing a diff — check get_neighbors to scope the blast radius; use get_pr_impact or triage_prs for branch/PR-level work.
- For architecture, ownership, or "where does X live" questions, start from query_graph, get_community, god_nodes, or graph_stats.
Treat graph results as a map: verify the relevant source files before editing because source code remains authoritative. Skip the graph only when the task already names the exact files and nothing else depends on the lines you change. If you finish a multi-file task without a single Graphify query, state in one line why the graph was not needed. If the server is unavailable or stale, continue from source and say so. Never run Graphify build or update commands yourself; Vi3ecode owns graph maintenance.
<!-- vi3ecode:plugin:graphify:guidance:end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

