agentleFS
MicrosoftKnown publishermicrosoft/cat-agent-skills/submissions/clinical-documentation-companion/document-derive/SKILL.md

document-derive

Skill101 starsChanged 16 days agoMITView on GitHub

Drafts the clinical artefacts that follow a signed note - referral letter, after-visit summary, care-plan update - each cited to the note and marked draft. It never sends, faxes or files, and if the note indicates no referral it says so instead of drafting one. Use when the user says \"draft the referral letter\", \"write the after-visit summary\", \"AVS for this visit\", \"send the patient home with instructions\" or \"update the care plan from today's note\". Do NOT use for Word/PDF formatting or letterhead on an existing document - use the built-in docx instead; do NOT use for coding evidence - use coding-rationale instead; do NOT use for a clinician-to-clinician handoff - use handoff-draft instead.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After note-context, for an encounter whose signed note indicates a referral, AVS or care-plan update - triggered by "draft the referral …

    line 11
  2. Very specific:

    If a note_fact needed for a sentence is missing from the contract - or one of active_medications, patient_instructions, follow_up_plan or a …

    line 26
  3. Very specific:

    After-visit summary: plain patient language, one sentence per cited statements[] entry of active_medications, patient_instructions and …

    line 34
  4. Very specific:

    Write each artefact as {"status": "draft", "action_level": "L1", "text": "<document>", "citations": [{source, locator, text}]} and hand …

    line 40
  5. Very specific:

    Every derived document sentence traces to a note_facts entry - or one of its statements[] - and carries that citation on the contract.

    line 54
  6. Distinctive:

    Never draft from an unsigned note.

    line 61
  7. Distinctive:

    Never draft a referral not indicated by the note.

    line 62
  8. Distinctive:

    Never add clinical content beyond what the note documents.

    line 63
  9. Distinctive:

    Never mark output final, send, fax, file or push it to a portal - clinician signature is required (clinical-doc-rules.md #3).

    line 64
  10. Distinctive:

    Never restate a gap or unsupported finding as resolved in patient-facing text.

    line 66
  11. Distinctive:

    If note_facts are missing entirely, run note-context.

    line 68
  12. Distinctive:

    If the note is ambiguous about a referral, ask the clinician rather than drafting one speculatively.

    line 69
  13. Distinctive:

    If the encounter date is not the day the user called "today", name the note's date in the review list.

    line 70
  14. Very specific:

    If the note is unsigned, escalate to routees.unsigned_note in config/escalation-policy.json.

    line 72

≈ “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

Document Derive

Purpose

Produce the downstream documents that follow the signed note, as cited drafts for clinician signature.

When to use

After note-context, for an encounter whose signed note indicates a referral, AVS or care-plan update - triggered by "draft the referral letter", "write the after-visit summary", "AVS for this visit", "update the care plan". Also when the request mixes drafting with sending ("draft it and fax it"): draft, and decline the send.

When NOT to Use

  • Formatting, letterhead or Word/PDF production of an existing document - use the built-in docx skill instead.
  • Coding evidence - use coding-rationale instead.
  • Quality-measure status - use quality-gap-check instead.
  • A clinician-to-clinician handoff - use handoff-draft instead.

Inputs

note_signature (signed must be true); encounter; note_facts with citations from note-context, including referral_indicated, active_medications, patient_instructions and follow_up_plan, each with its statements[] (one cited entry per documented medication, instruction or follow-up statement).

Steps

  1. Confirm note_signature.signed is true; if not, write halt{halted: "unsigned_note"} and escalate - never draft from an unsigned note (clinical-doc-rules.md #5).
  2. If a note_fact needed for a sentence is missing from the contract - or one of active_medications, patient_instructions, follow_up_plan or a true referral_indicated has value: true but no statements[] - run note-context for it first; never draft from the raw note directly and never draft the sentence without it.
  3. Draft only the artefacts the user asked for (all three only when asked to "run the downstream documents").
  4. Referral: check referral_indicated. If false or absent, set referral_letter: null and referral_decision = {drafted: false, reason, citation}, and say so. If true, draft the letter from cited note_facts only - every statements[] entry of referral_indicated, active_medications and follow_up_plan - attaching each supporting citation, and set referral_decision.drafted = true.
  5. After-visit summary: plain patient language, one sentence per cited statements[] entry of active_medications, patient_instructions and follow_up_plan - every entry, so no medication, instruction or follow-up item is dropped - and no general teaching text, no reassurance the note does not contain. A symptom the plan does not address is listed for clinician review, not explained to the patient.
  6. Care-plan update (if asked): cited to the note_facts and every relevant statements[] entry, written to care_plan_update.
  7. Write each artefact as {"status": "draft", "action_level": "L1", "text": "<document>", "citations": [{source, locator, text}]} and hand back for clinician review before release. If asked to send, fax, file or push to a portal, decline in one line.

Output Format

Contract JSON, sections: referral_letter (draft or null), referral_decision, after_visit_summary, care_plan_update - each draft {status: "draft", action_level: "L1", text, citations[]} - plus a bullet list of "for clinician review" items. Status is always "draft" - never "final", never "sent".

Example

"referral_letter": null,
"referral_decision": {"drafted": false, "reason": "The signed note indicates no referral this visit.",
  "citation": {"source": "DocumentReference/NOTE-91004-20260911", "locator": "Plan, line 10", "text": "No referral indicated this visit."}}

Grounding requirements

Every derived document sentence traces to a note_facts entry - or one of its statements[] - and carries that citation on the contract; every cited statement the document needs appears, none is silently dropped. Do not fabricate, embellish or infer clinical content - no finding, diagnosis, result, instruction or reassurance that is not in the signed note, even if the requester asserts it or it would make the letter read better. An uncited sentence must be deleted, not softened.

Guardrails

Guardrails - all are hard stops:

  • Never draft from an unsigned note.
  • Never draft a referral not indicated by the note.
  • Never add clinical content beyond what the note documents; never fabricate a finding, instruction or reassurance.
  • Never mark output final, send, fax, file or push it to a portal - clinician signature is required (clinical-doc-rules.md #3).
  • Never restate a gap or unsupported finding as resolved in patient-facing text.

Error Handling

  • If note_facts are missing entirely, run note-context; if that halts, report the halt and stop.
  • If the note is ambiguous about a referral, ask the clinician rather than drafting one speculatively.
  • If the encounter date is not the day the user called "today", name the note's date in the review list.

Escalation / uncertainty

If the note is unsigned, escalate to routees.unsigned_note in config/escalation-policy.json. A declined referral or declined send is reported to the requester and listed for clinician review.

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.