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.
In this repository23 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- add-handlerSkill
- add-moduleSkill
- claim-checkSkill
- clean-room-rebuildSkill
- corpus-retrievalSkill
- depguard-guardSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- graphifySkill
- grillingSkill
- learnSkill
- planSkill
- researchSkill
- reviewSkill
- shipSkill
- specSkill
- tddSkill
- verified-statusSkill
- nodejs-best-practicesSkill
- nodejs-portSkill
- nodejs-reviewSkill
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
- Distinctive: line 18
Do not activate for pure formatting, doc-only, or migration-only diffs.
- Distinctive: line 24
Never reach for global mutable singletons (or dynamic-execution tricks) to fix sharing.
- Very specific: line 26
Keep critical sections synchronous: no await inside a section another request can observe half-mutated.
- Very specific: line 31
Every stat needs a source.
- Distinctive: line 32
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 …
- Distinctive: line 33
Verify claims against the tree before reporting: read the cited file and line.
- Very specific: line 35
No dynamic-execution escape hatch (node:vm, eval, new Function) to paper over sharing.
≈ “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.
Files
<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
Depsinterface, a use case, a handler inhttp.ts, or any interface wiring inports.ts. - Shared state is introduced or mutated (a hub map, an outbox worker, a cache) across concurrent async flows.
- An
AbortSignalis 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.tswires consumer-defined ports intoDeps; 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
awaitinside a section another request can observe half-mutated; serialize through an owner loop (single worker/consumer) when ownership must move;Promise.allonly 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.
Depsfields 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.
| claim | source | year | link |
| Fastify serves each request concurrently on one shared event loop; awaits interleave | Node.js event loop documentation | 2024 | <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 boundaries | Node.js AbortSignal documentation | 2024 | <TODO: primary doc link> |
| Objects/arrays share references across assignment; a deep copy needs structuredClone | MDN structuredClone | 2023 | <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.
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.

