island-mode-server
CLAUDE.md0 starsChanged 2 months agoMITView on GitHub
An Agent Skill package: markdown only, plus one test file carried into the target project. There is no package.json here and nothing in this repository executes. It teaches an agent to build an island-mode server in someone else's codebase: a Node/NestJS box at a physical site holding a live RxDB replica of the site's slice of Firestore, taking over the LAN when the internet drops and flushing offline work back on reconnect. The cloud side is Next.js route handlers as…
- Reads credentials
In this repositoryOne other file it gives its agents.
- island-mode-serverSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 94
Every cloud write to a replicated collection stamps serverTimestamp and _deleted: false.
- Distinctive: line 107
Plain punctuation: No em-dashes, en-dashes, arrows, middle dots or smart quotes anywhere in this repository's markdown, code blocks …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repository is
An Agent Skill package: markdown only, plus one test file carried into the target
project. There is no package.json here and nothing in this repository executes. It teaches an agent to build
an island-mode server in someone else's codebase: a Node/NestJS box at a physical site holding a live RxDB
replica of the site's slice of Firestore, taking over the LAN when the internet drops and flushing offline
work back on reconnect. The cloud side is Next.js route handlers as the reference API.
The commands and code in references/ describe the app the agent will generate, not this repository.
assets/behavior.test.ts cannot run here: it imports ./hmac.util, ./auth-guard, ./stock and
../next/network-manager, which exist only once the templates have been copied into a host project. Do not
add a package.json or a vitest config to make it runnable; verify it by reading it against the templates in
references/, or by running it in a target project after adaptation.
The skill was written by the engineers who have shipped this module, and audited against the earlier
implementation, the on-premise fallback of a multi-location venue booking system. references/provenance.md
is the rationale layer and the audit ledger: the only place that distinguishes what the audit changed, what
was kept deliberately, and what was designed here and has never run in production. Read it before
"simplifying" anything.
Sibling directories under ../ (booking-kiosk, help-center-markdown and the others) are other skills,
not dependencies.
Structure
SKILL.md: the router, loaded whole on every activation, so it stays between 130 and 160 lines, the closing index line aside. It carries only what an agent must know before choosing a reference: the frontmatter trigger, the architecture diagram and where the seam lives, the six critical facts, the four hard rules, the quick start and the reference directory, then the line linking the skills index. Deep material belongs inreferences/.README.md: the human-facing front door, in the section order every Timerise skill shares: the pitch, install for every skills-compatible host, the file table, the four non-negotiables, the seams table, verification. Never routing detail or template code.CHANGELOG.md: Keep a Changelog, newest release first. The version lives here, in the README's current-release line and in the git tag, and the three agree; there is no version in theSKILL.mdfrontmatter.references/*.md: seven topic files plusprovenance.md, loaded on demand.architecture.mdholds the modes, the tiers, the meta-fields and the seam contract (Adaptation contract), which stands in for anadaptation.md.assets/behavior.test.ts: the vitest suite carried into the target project, 17 tests across 6 describe blocks.evals/:prompts.mdholds what an operator types after installing, in their words; the first prompt is the agent eval run before every release. Every other file there is one eval run: measured frontmatter that is never edited, then the notes of the person who ran it. Add a prompt rather than rewording one that has results. The procedure is section 10 of the index's STANDARD.md..github/workflows/agent-eval.yml: the caller of the index's reusable eval workflow, copied verbatim from STANDARD.md and the same in every skill. Do not edit it, and never add a trigger onpushorpull_request.
Editing conventions
- Code blocks name their destination on the first line as a comment:
// local-server/src/stock.tsfor the local server,// lib/island/network-manager.tsfor the terminal client,// app/api/...for the cloud routes. A block that continues a file already introduced omits it. - Templates compile under
strictand--noUncheckedIndexedAccessagainst the library versions named in the Verification status ofprovenance.md. Changing the suite means changing its count there and in the README; do not let the claim drift from the file. - Identifiers are shared across files.
AuthGuard,decodeOfflineToken,generateHmac,verifyHmac,StockService,SyncFlushService,ReplicationService,NetworkManager,replicationStamp,todayAtSite,effectiveStock,syncedIds. Rename in all files or none. - Two kinds of name. The domain vocabulary the host renames is the rename table in
architecture.md:location / booking / inventory / lock / staff / pricing, scoped bylocationId. Never rename inside the skill to match one product. The identifiers above, the meta-fields and the env var names are the authoring contract of this repository and stay consistent here. - Keep the indexes in sync. Adding, renaming or splitting a file in
references/orassets/means updating the quick start and the reference directory inSKILL.md(with its trigger keywords), the file table inREADME.md, and any cross-links. Links between references are sibling-style ([sync-flush.md](sync-flush.md)); links fromSKILL.mdarereferences/-prefixed; links from the README arereferences/-prefixed and wrapped in backticks. - The non-negotiables are never presented as optional. The four hard rules in
SKILL.mdand the four non-negotiables inREADME.mdare one list in one order: auth on cloud ingestion, the offline-gated token fallback, per-ID delta reset, no locally invented business rules. They are entries 1 to 4 of the ledger, which records why each holds. Changing one is a MAJOR release. The ledger has ten entries under Fixed in the templates, and that count lives there only. - The ledger stays truthful. Any change to a template updates
provenance.md: a new defect of the earlier implementation fixed is a numbered entry under Fixed in the templates; a questionable earlier choice kept is an entry under Kept deliberately with the reason it is safe; anything the earlier implementation never ran is an entry under Added. - Do not remove the odd-looking parts. The dual sync path, last-write-wins on bidirectional collections,
the per-ID fold-out, the offline gate on the token fallback, the fleet-wide HMAC secret,
apiBaseUrl: ''when nothing answers. Each is a ledger entry; checkprovenance.mdbefore touching one. - Measured numbers are load-bearing. The 30 s HMAC replay window, the 5 s health cadence, the three consecutive failures, the stale threshold at twice the cron cadence and the test count are design parameters or facts this repository verifies. Do not restate one loosely and do not invent new ones.
- Content invariants. These recur across references, and changing one means sweeping all of them.
- The meta-fields (
_offlineCreated,_locallyModified,_synced,serverTimestamp,_deleted) are declared inarchitecture.mdand appear in every RxDB schema inreplication.md. An undeclared meta-field is itself a ledger entry. - Every cloud write to a replicated collection stamps
serverTimestampand_deleted: false; omitting it makes the document permanently invisible to replication. - The seams table in
architecture.mdis the full boundary with the host. A template that needs something new from the host adds it there or does not belong. - The env var names in
operations.mdare the canonical list (SYNC_SECRET,TERMINAL_SECRET,LOCK_ACCESS_TOKEN,KIOSK_API_KEYand the rest), referenced by the same names inauth.md,sync-flush.mdandlocal-api.md. - The local server is NestJS and the cloud examples are Next.js route handlers, both stated as substitutable; keep a new template's framework-specific surface thin enough that the claim holds.
- The meta-fields (
- The front door describes properties, not failures. The README intro, the
SKILL.mdframing and the frontmatter description say what the templates hold and the suite verifies, never what the earlier implementation got wrong. Every factual claim in the README (library versions, the test count) restatesprovenance.md. - Plain punctuation. No em-dashes, en-dashes, arrows, middle dots or smart quotes anywhere in this repository's markdown, code blocks included. Prose wraps at 110 columns; table rows and commands stay on one line.
- Claims are verifiable. A changed factual claim says how it was verified: against RxDB, the Firebase SDKs, NestJS, the Firestore documentation, or a reproduction. Never from memory.
- Evals are not skill content. A new prompt or an eval result is committed as
chore(evals): ..., never causes a version bump and never rides in a release commit. A failing run stays committed; the fix is the next release. - Commits follow Conventional Commits, releases follow section 9 of the index's STANDARD.md, and no file or commit message names a tool or a model as author.
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.

