SyncytiumMD
CLAUDE.md6 starsChanged 7 days agoMITView on GitHub
This project uses SyncytiumMD to bridge context between AI tools. 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
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.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 CLAUDE.md into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 4
Do not edit manually unless you plan to run reverse-sync.
- Distinctive: 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 156
When adding or updating adapters in src/adapters/:
- Very specific: line 158
Every adapter must implement AgentAdapter from src/core/types.ts.
- Very specific: line 162
Every file must include a leading or trailing SyncytiumMD header comment (e.g.
- Very specific: line 168
Add unit tests verifying target file generation in tests/syncytium.test.ts.
- Distinctive: line 177
Write clean, modular, and self-documenting code.
- Distinctive: line 178
Always prefer strict types, immutable data structures, and pure functions where reasonable.
- Distinctive: line 179
Keep functions concise with a single responsibility.
- Distinctive: line 181
Avoid unnecessary dependencies.
- Distinctive: line 199
When a bug is fixed, add a test that fails without the change and name the regression in the test description.
- Very specific: line 235
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 271
Every MCP tool declares honest readOnlyHint / destructiveHint / idempotentHint / openWorldHint annotations in src/mcp/safety.ts, and the …
- Distinctive: line 283
Never log or echo secrets, tokens or full file contents to stdout: stdout is the MCP JSON-RPC transport.
- Distinctive: line 294
Write unit tests for all business logic and edge cases.
- Distinctive: line 296
Verify tests pass before completing any implementation task.
- Distinctive: line 297
Follow the Arrange-Act-Assert pattern for test clarity.
- Very specific: line 303
[ADR-001] Adopt SyncytiumMD as Universal Context Bridge: Use SyncytiumMD as the single source of truth (.syncytium/) to transpile and …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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/
-->CLAUDE.md - SyncytiumMD
This project uses SyncytiumMD to bridge context between AI tools.
🤝 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
🏗️ Architecture & Stack
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
Guidelines & Engineering Rules
📌 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)
- [ADR-006] Make the drift gate capable of failing: Add diff --check, which exits 1 on any modified, missing or orphaned file. The CI template and the generated pre-commit hook both call it. doctor additionally inspects the workflow text and warns when it does not use --check, because an existing workflow silently keeps the old no-op behaviour. (accepted, 2026-09-26)
- [ADR-007] Never delete a directory that shares its name with a generated target: clean now deletes only files carrying the Syncytium banner, file by file, and prunes a directory only once it is actually empty. sync additionally prunes banner-tagged files that the current rule set no longer generates, and diff reports them as 'unmanaged' with the reason. (accepted, 2026-09-26)
- [ADR-008] Escape every value that reaches the browser and stop inlining onclick handlers: projectName is HTML-escaped; the bootstrap config is serialised with angle brackets, ampersand and the U+2028/9 line separators escaped; the category value is allow-listed; and every node id is escaped and carried in a data-node-id attribute handled by one delegated document listener. No inline handlers and no globals on window remain. (accepted, 2026-09-26)
- …and 7 more in
.syncytium/memory/decisions.md
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.

