agentleFS
tanitaka-techtanitaka-tech/todome/.agents/skills/todome-server-implementation/SKILL.md

todome-server-implementation

Skill1 starsChanged 7 months agoMITView on GitHub

Apply todome-specific server constraints when implementing or reviewing changes under `server/`. Use when editing Bun/Hono/WebSocket handlers, storage, AI integration, GitHub sync, timeline logic, or any server-side payload that must stay aligned with `client/src/types.ts`.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 8 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put new code in the matching module: ws/handlers, storage, domain, ai, github, or utilities.

    line 12
  2. Very specific:

    Keep dependencies directional: ws/handlers may call ai/*, storage/*, and github/*, but storage should not import handlers.

    line 13
  3. Very specific:

    When adding a new WebSocket type, update both server/ws/handlers/index.ts and the matching union in client/src/types.ts.

    line 14
  4. Very specific:

    Use broadcast() and sendTo() instead of writing raw ws.send(JSON.stringify(...)).

    line 15
  5. Very specific:

    After state changes, emit the corresponding *_sync event so the client fully resynchronizes.

    line 16
  6. Very specific:

    Use getDbPath() for SQLite location decisions, keep schema changes in server/db.ts, and preserve the wsNeedsReload assumptions around …

    line 17
  7. Very specific:

    After persisted changes, keep GitHub sync behavior intact with scheduleAutosync() when the existing flow expects it.

    line 18
  8. Very specific:

    Keep Claude Agent SDK usage on the existing query()-based path and preserve the current permission model unless the task explicitly changes …

    line 19
  9. Very specific:

    Put unit tests in server//*.test.ts using bun:test.

    line 23
  10. Distinctive:

    If you fix data processing, storage, migration, or cross-entity state bugs, add a regression test in the same change.

    line 24
  11. Distinctive:

    Check immutability when the code transforms arrays or objects.

    line 26
  12. Distinctive:

    Start from the entrypoint closest to the change, usually a handler or storage function.

    line 31
  13. Distinctive:

    Update shared client/server types whenever the payload changes.

    line 33
  14. Distinctive:

    Add or update tests before wrapping up the task.

    line 34
  15. Distinctive:

    After changes, run the relevant checks:

    line 35
  16. Distinctive:

    Run the full set when the change crosses boundaries or touches shared types.

    line 43
  17. Very specific:

    Use todome-server-navigator when the task first requires codebase orientation or handler tracing.

    line 47
  18. Very specific:

    Use todome-e2e-runner after UI-visible backend changes that need end-to-end confirmation.

    line 48
  19. Very specific:

    Use vercel-react-best-practices only if the server change also drives a React-side performance refactor.

    line 49
  20. Very specific:

    Call out any payload coupling with client/src/types.ts.

    line 54
  21. Distinctive:

    Prefer narrow, maintainable changes over new abstraction layers.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Todome Server Implementation

Apply the repo-specific server rules for todome. This skill mirrors the intent of server/AGENTS.md and .claude/rules/server.md, but packages it as an explicit Codex skill.

Core Rules

  • Put new code in the matching module: ws/handlers, storage, domain, ai, github, or utilities. Do not collapse new behavior into oversized files.
  • Keep dependencies directional: ws/handlers may call ai/*, storage/*, and github/*, but storage should not import handlers.
  • When adding a new WebSocket type, update both server/ws/handlers/index.ts and the matching union in client/src/types.ts.
  • Use broadcast() and sendTo() instead of writing raw ws.send(JSON.stringify(...)).
  • After state changes, emit the corresponding *_sync event so the client fully resynchronizes.
  • Use getDbPath() for SQLite location decisions, keep schema changes in server/db.ts, and preserve the wsNeedsReload assumptions around GitHub pull/restore.
  • After persisted changes, keep GitHub sync behavior intact with scheduleAutosync() when the existing flow expects it.
  • Keep Claude Agent SDK usage on the existing query()-based path and preserve the current permission model unless the task explicitly changes it.

Testing Rules

  • Put unit tests in server/**/*.test.ts using bun:test.
  • If you fix data processing, storage, migration, or cross-entity state bugs, add a regression test in the same change.
  • In multi-entity flows, assert not only the target behavior but also that unrelated tasks, goals, profile data, retros, life logs, or quotas stay unchanged.
  • Check immutability when the code transforms arrays or objects.
  • Include abnormal inputs such as broken JSON, missing keys, empty arrays, or invalid payloads when that is where the bug lives.

Workflow

  1. Start from the entrypoint closest to the change, usually a handler or storage function.
  2. Trace the full path: handler -> domain/AI/storage -> response broadcast.
  3. Update shared client/server types whenever the payload changes.
  4. Add or update tests before wrapping up the task.
  5. After changes, run the relevant checks:
bunx tsc --noEmit
cd client && npx tsc -b && npm run lint
bun run test

Run the full set when the change crosses boundaries or touches shared types.

Companion Skills

  • Use todome-server-navigator when the task first requires codebase orientation or handler tracing.
  • Use todome-e2e-runner after UI-visible backend changes that need end-to-end confirmation.
  • Use vercel-react-best-practices only if the server change also drives a React-side performance refactor.

Output Expectations

  • Return implementation guidance and edits in terms of actual repo modules, not generic backend advice.
  • Call out any payload coupling with client/src/types.ts.
  • Prefer narrow, maintainable changes over new abstraction layers.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.