agentleFS
Facta-DevFacta-Dev/beautifulnodejs/.claude/skills/ownership-author/SKILL.md

ownership-author

Skill0 starsChanged 33 days agoMITView on GitHub

Review aliasing, locking, and async-propagation patterns in <app> packages; produce a line-anchored report of shared-state interleaving, lock placement, and Deps interface wiring across the <scope> slice before the diff lands.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not activate for pure formatting, doc-only, or migration-only diffs.

    line 18
  2. Distinctive:

    Never reach for global mutable singletons (or dynamic-execution tricks) to fix sharing.

    line 24
  3. Very specific:

    Keep critical sections synchronous: no await inside a section another request can observe half-mutated.

    line 26
  4. Very specific:

    Every stat needs a source.

    line 31
  5. Distinctive:

    Do not emit the final review as a fenced code block when raw line-anchored output is expected — the report is plain text with one finding …

    line 32
  6. Distinctive:

    Verify claims against the tree before reporting: read the cited file and line.

    line 33
  7. Very specific:

    No dynamic-execution escape hatch (node:vm, eval, new Function) to paper over sharing.

    line 35

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

<app> Ownership Author

A reusable review workflow for aliasing and concurrency correctness in the <app> TypeScript codebase. An agent (e.g. the ownership reviewer role) invokes this skill on any diff that touches src/features/<slice>/**/*.ts or src/platform/**/*.ts; the skill is the workflow, the agent is the role. The output is a line-anchored report, not a rewrite.

When to Activate

  • A diff modifies a Deps interface, a use case, a handler in http.ts, or any interface wiring in ports.ts.
  • Shared state is introduced or mutated (a hub map, an outbox worker, a cache) across concurrent async flows.
  • An AbortSignal is dropped, wrapped, or replaced in the request path, or an async task outlives its request.
  • A reviewer asks for an ownership pass before approving a PR that crosses Fastify's shared-event-loop request concurrence.

Do not activate for pure formatting, doc-only, or migration-only diffs.

Core Principles

  • Compiles is not correct. A slice alias that passes pnpm build (tsc) and interleaves badly on the second concurrent request is a bug this skill owns.
  • The composition root stays thin. src/bin/api.ts wires consumer-defined ports into Deps; logic lives in the use cases.
  • Never reach for global mutable singletons (or dynamic-execution tricks) to fix sharing. The fix is a copy, an owned queue, or an explicit lock discipline.
  • Cite the failure mode, not the rule. "Shared-state race" is the rule; "races on the second concurrent request because Fastify serves requests concurrently on one event loop" is the review.
  • Keep critical sections synchronous: no await inside a section another request can observe half-mutated; serialize through an owner loop (single worker/consumer) when ownership must move; Promise.all only for independent work — never hold a guard across a long I/O wait.

Rules

  • Anti-hallucination: do not fabricate file paths, line numbers, or diagnostics. Every finding must cite a path and line that exists in the diff or the working tree.
  • Every stat needs a source. If you claim "races on the second request", cite the concurrent event-loop request model; if you cite a compiler or lint check, name it (tsc --noEmit, require-atomic-updates). No unsourced numbers.
  • Do not emit the final review as a fenced code block when raw line-anchored output is expected — the report is plain text with one finding per line, severity-prefixed.
  • Verify claims against the tree before reporting: read the cited file and line. A finding that cites a line the diff does not contain is a hallucination.
  • Deps fields stay use cases and consumer-defined ports; a field that inlines a service or another slice's type is a BLOCK.
  • No dynamic-execution escape hatch (node:vm, eval, new Function) to paper over sharing; src code importing these is a BLOCK. Propose the safe alternative (structuredClone, an owned queue, an explicit copy) instead.

Research References

Provenance table — fill the link column from the primary source before relying on a claim. No claim may appear in a finding without a row here.

claimsourceyearlink
Fastify serves each request concurrently on one shared event loop; awaits interleaveNode.js event loop documentation2024<TODO: primary doc link>
JS has no runtime race detector; interleaving is caught by review at await boundaries, not tooling— (documented delta vs go test -race)—<TODO: primary doc link>
Cancellation propagates as an AbortSignal checked at await boundariesNode.js AbortSignal documentation2024<TODO: primary doc link>
Objects/arrays share references across assignment; a deep copy needs structuredCloneMDN structuredClone2023<TODO: primary doc link>

Output Format

A line-anchored report, one finding per line, severity-prefixed, followed by a summary line. Plain text — not a fenced block:

BLOCK  src/platform/realtime/hub.ts:42  subscribers map mutated from WS callbacks with no ownership boundary — interleaves on the second concurrent connection; serialize through an owner loop or guard the mutation.
WARN   src/features/widgets/postgres.ts:18  list() returns a shared connection-scoped row array; callers can mutate it — return a copied/frozen variant.
PASS   src/features/widgets/usecase.ts  the AbortSignal flows from the request through the use case into the queries call.

Summary line: ownership-author: N block(s), M warning(s), K pass — verdict: BLOCK | APPROVE.

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.