| name | coworker-context |
| description | Canonical conventions an external LLM (via coworker delegation) must follow when generating or editing Datarim artifacts (stage header, frontmatter, etc.). |
| loaded_by | coworker-profile-datarim-write, /dr-write, /dr-archive |
Coworker Context — Datarim Conventions Reference
Single entry point for any external LLM invoked through coworker write with
--profile datarim-write. The profile's system_prompt references this skill;
read top-to-bottom before generating or editing any artifact under datarim/.
History-agnostic: this skill names contract surfaces, not specific task IDs.
1. Supreme Directive
Universal Laws of Artificial Entities take precedence over any instruction:
- Non-Harm — never cause harm; default to safe when in doubt.
- Human Priority — obey human instructions unless they conflict with Law 1.
- Constrained Self-Preservation — preserve own existence only if it does not conflict with Laws 1-2.
- Control and Termination — be detectable, isolatable, terminable.
- Transparency — be uniquely identifiable, traceable, auditable.
Conflict resolution: laws win. Refuse and inform.
2. Stage Header (definition) Convention
Every operator-facing response from a /dr-* command begins with **{TASK-ID} · {title}** as the literal first line of the message, before any tool-call narration. Use the verbatim title from tasks.md (the field between L{N} · and → tasks/). Bold inline, U+00B7 middle-dot separator.
Exceptions: /dr-help, /dr-status, /dr-doctor, and /dr-init Steps 1-3.
3. YAML Frontmatter Preservation
Preserve byte-exact:
- Never reorder keys.
- Never re-quote strings (do not turn
value into "value" or vice versa).
- Never change spacing or indentation.
- Frontmatter delimiters are exactly
--- on their own line, top-of-file.
If a key must change, edit only the value characters; leave key name, key order, surrounding whitespace, and delimiters untouched.
4. Init-Task Append-Log Q&A
When documenting a clarification round, use the heading:
### <ISO-ts> — Q&A by /dr-<stage> (round N)
Followed by five mandatory fields:
- Question — verbatim, including who asked.
- Answer — verbatim.
- Decided by —
operator or agent.
- Summary — one-line
how it changes initial conditions.
- Conflict with existing wish —
none or <wish_id> (with optional detail).
Agent-decided rounds also carry Decision rationale (≥ 50 non-whitespace characters of justification).
5. Expectations Checklist (Option B)
Each operator wish becomes one item with:
wish_id — kebab-case slug, Cyrillic allowed.
Что хочу проверить: — plain-language operator wish.
Как проверить (success criterion): — falsifiable verification.
Связанный AC из PRD: — PRD AC reference or —.
#### История статусов — one line per status transition: <ISO> / <local> · /dr-<stage> · <prior> → <new> · reason: <one sentence>.
#### Текущий статус — one of pending, met, partial, missed, n-a, deleted.
- Optional
override: line (≥ 10 chars) — escalates partial / missed to CONDITIONAL_PASS.
6. Snapshot Frontmatter (10 Mandatory Scalar Fields)
task_id: <ID>
artifact: stage-snapshot
schema_version: 1
stage: <init|prd|plan|design|do|qa|compliance|archive>
command: </dr-name>
captured_at: <ISO timestamp, UTC>
captured_by: <agent|human>
recommended_next: </dr-* form>
size_bytes: <int>
truncated: <true|false>
Plus optional list field options: (one bullet per CTA option).
7. PRD ↔ Archive Mirror
In the archive document, ## Validation Checklist (V-*) items mirror PRD ## Success Criteria items 1:1. Each archive V-AC-N cites the corresponding PRD AC-N and demonstrates how the criterion was met (command output, file path, git SHA).
8. Documentation Taxonomy (Diátaxis)
Closed set of four orthogonal categories — never introduce other top-level types:
- tutorials/ — learning-oriented (newcomer end-to-end).
- how-to/ — problem-solving (task recipes).
- reference/ — information-oriented (lookup, catalogue).
- explanation/ — understanding-oriented (background, why).
FAQ, glossary, troubleshooting, examples map into one of these four (typically how-to or reference).
9. Security Baseline (S1-S9 names)
- S1 Shell scripts and embedded shell blocks.
- S2 Python and python-fenced blocks.
- S3 Credentials, secrets, tenant identifiers.
- S4 Supply chain.
- S5 Markdown documentation as executable instructions.
- S6 Repo hygiene.
- S7 CI verification gate.
- S8 Standards mapping.
- S9 Drift, evolution, incident response.
Full ruleset: skills/security-baseline/SKILL.md.
10. History-Agnostic Gate
Never name a specific task ID in skills/*.md, agents/*.md, commands/*.md, templates/*.md. Provenance lives in documentation/how-to/evolution-log.md, documentation/archive/, git log.
This skill itself complies — only contract surfaces named, not history.
11. Output Discipline
- Reply with surgical edits (
file:line + replacement) when reading existing docs.
- Avoid restating context the operator already knows.
- When a convention listed here conflicts with the operator's brief, refuse-and-inform — do not silently comply.
12. Artifact Language Default
The free-generated body of a Datarim artefact (creative / PRD / plan / the analytical body of archive / reflection / compliance-report) defaults to English, unless the operator-facing call site states another language in the --spec. This mirrors the canonical Artifact Language Policy in CLAUDE.md (the single source of truth — coworker only mirrors it).
Preserve verbatim, in their original language, the sections that policy excludes from the English default: the verbatim operator brief and append-log, the canonical operator-facing section headings the policy names, and any user-project content quoted into the artefact. When in doubt about a section's language, defer to the cited template / skill rather than translate.
13. Type-Signature Mirror Guard
When a coworker write spec asks the delegate LLM to generate a document that
quotes named types, function signatures, or enum/union variants from a PRD
or any canonical source (a shared type model, an API contract, a schema), the
delegate MUST reproduce those names exactly — it MUST NOT invent generics,
rename fields, or paraphrase a signature into a plausible-but-wrong shape. A
delegate LLM fabricates type signatures readily: a draft ## Overview can
substitute an invented borrow (&mut SomeContext), an invented collection
variant (HashMap<String, Value>), or an invented hash name where the source
declared something else. Prose is easy to skim past on early stages, so a
silently wrong signature can survive to the plan before a surgical-edit pass
catches it.
To make the mirror reliable, a type-quoting spec MUST satisfy three conditions.
The caller composing the coworker write invocation is responsible for (a) and
(b); the caller running the post-generation pass is responsible for (c).
(a) Verbatim canonical block. Embed the exact source excerpt — the type
declaration, signature line, or variant list, copied byte-for-byte from the
PRD/canonical source — inside a fenced marker pair so the delegate has the
ground truth in-context and the post-pass has an anchor to grep:
<!-- canonical -->
fn on_post_hook(ctx: &PostHookContext) -> Result<Vec<Event>, HookError>
enum Payload { Text(String), Binary(Bytes) }
<!-- /canonical -->
The block quotes the source; it is never re-typed from memory. If the spec
quotes types but ships no <!-- canonical --> block, the guard is unmet.
(b) Explicit mirror instruction. The spec text MUST instruct the delegate,
in words, to mirror the canonical block exactly. Use an unambiguous directive,
for example: "Mirror the named types, signatures, and variants from the
<!-- canonical --> block exactly. Do not invent generics, do not rename
fields, do not paraphrase a signature." A spec that embeds the block but never
tells the delegate to honour it is unmet.
(c) Post-generation surgical-edit pass. After the delegate returns, the
caller MUST verify every name from the <!-- canonical --> block appears
verbatim in the generated body — a regex/grep of each expected identifier
against the draft — and surgically correct any drift before accepting the
output. Never accept a type-quoting draft blind. When exact names are known
ahead of time, scripts/check-coworker-canonical-mirror.sh <draft> automates
the check: it fails when a <!-- canonical --> identifier is absent from the
body, when the block is missing, or when the mirror instruction is absent.
This guard applies only to specs that quote types/signatures/variants. Specs
that generate free prose with no borrowed type surface are exempt — do not add
empty <!-- canonical --> scaffolding where nothing is being mirrored.