agentleFS
MicrosoftKnown publishermicrosoft/cat-agent-skills/submissions/clinical-documentation-companion/coding-rationale/SKILL.md

coding-rationale

Skill101 starsChanged 16 days agoMITView on GitHub

Assembles the cited documentation evidence for the visit level and diagnosis codes already on the claim and flags every element the note does not support. If asked to change, pick or upgrade a code it still builds the rationale and declines the change. Use when the user says \"why is this coded 99214?\", \"does the note support this diagnosis?\", \"build the coding rationale\", \"what backs up this claim?\" or \"the coder is asking for the evidence\". Do NOT use for quality-measure status - use quality-gap-check instead; do NOT use for documentation drafting - use document-derive instead; do NOT use to extract facts from the note - use note-context instead.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    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. Very specific:

    After note-context, whenever claim.visit_level or claim.elements exist - triggered by "why is this coded 99214?", "does the note support …

    line 11
  2. Distinctive:

    If note_facts are already on the contract with citations, use them.

    line 23
  3. Very specific:

    Run the tool: python3 base/scripts/quality_gap_engine.py --question <working.json> --measures config/quality-measures.json --policy …

    line 25
  4. Very specific:

    Read back coding_rationale.supported[], unsupported_flags[] and change_requests_refused[].

    line 28
  5. Distinctive:

    Every 'supported' entry carries the citation of the documented note_fact that supports it.

    line 48
  6. Distinctive:

    Never propose or select a code, and never recommend a higher or lower level.

    line 54
  7. Distinctive:

    Never mark an element supported without a documented, cited note_fact.

    line 55
  8. Distinctive:

    Never silently drop or soften an unsupported flag, however small the dollar value.

    line 56
  9. Distinctive:

    Never present the rationale as final.

    line 57
  10. Distinctive:

    Never compute support yourself - the engine's result is the result.

    line 58
  11. Distinctive:

    If the engine exits non-zero or writes no output, report "rationale not built: <error>" and stop.

    line 60
  12. Distinctive:

    If a claim element names a note_facts key that is missing, it is unsupported - never look for a substitute fact.

    line 61
  13. Very specific:

    If the note is unsigned (halted: "unsigned_note"), report the halt only.

    line 62
  14. Distinctive:

    If an escalation names a routee that is "NOT ROUTED" (still a [TO CONFIGURE] placeholder), say plainly that the refusal is logged but has …

    line 63
  15. Very specific:

    Every unsupported element is escalated by name to routees.unsupported_claim_element, and every refused code-change request to …

    line 67

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

Coding Rationale

Purpose

Give the coder/biller a cited rationale draft for the codes already on the claim - never a proposed code.

When to use

After note-context, whenever claim.visit_level or claim.elements exist - triggered by "why is this coded 99214?", "does the note support this diagnosis?", "build the coding rationale", "what backs up this claim?". Also when the request mixes a rationale with a code change ("bump it to 99215"): build the rationale, decline the change.

When NOT to Use

  • Quality-measure status - use quality-gap-check instead.
  • Drafting patient or referral documents - use document-derive instead.
  • Extracting facts from the note - use note-context instead.
  • Submitting the claim - nothing in this plugin submits anything.

Inputs

note_facts with citations; claim.visit_level and claim.elements (each naming the note_facts key that supports it); config/escalation-policy.json; the user's live message.

Steps

  1. If note_facts are already on the contract with citations, use them; otherwise run note-context first.
  2. Copy the contract to a working file and append the user's message verbatim to messages.
  3. Run the tool: python3 base/scripts/quality_gap_engine.py --question <working.json> --measures config/quality-measures.json --policy config/escalation-policy.json --out <out.json>. Never decide support yourself.
  4. Read back coding_rationale.supported[], unsupported_flags[] and change_requests_refused[].
  5. Report all three lists verbatim - never move an element from unsupported to supported, and never drop one.
  6. Escalate every unsupported element to routees.unsupported_claim_element, and every refused code-change request to routees.code_change_refusal. If the user asked for a code change and change_requests_refused is empty, decline it yourself and escalate it the same way.
  7. Present the evidence pack as a draft with status: "draft" (clinical-doc-rules.md #3). If there is nothing to escalate, say "no unsupported elements - nothing escalated".

Output Format

Contract JSON, sections: coding_rationale = {status: "draft", action_level: "L1", visit_level, supported[{element, type, supported_by, citation{source, locator, text}}], unsupported_flags[{element, type, missing_fact, citation, note_citation}], change_requests_refused[{requested, evidence, citation}], source: "engine:quality_gap_engine"}, then a short bullet list: Supported / Unsupported / Declined. Report only the coding part of the engine output. No proposed codes appear anywhere. When status is "not_applicable" (no claim), say so and stop.

Example

Supported: 99214 <- moderate_complexity_mdm_documented (Plan, line 10: "...moderate complexity MDM.")
Unsupported: E11.42 - missing neuropathy_documented - escalated to routees.unsupported_claim_element
Declined: "bump the visit to 99215" - this skill never selects or upgrades a code - escalated to routees.code_change_refusal

Grounding requirements

Every 'supported' entry carries the citation of the documented note_fact that supports it; every 'unsupported' flag names the missing fact (clinical-doc-rules.md #4). Do not fabricate or infer supporting documentation, do not treat a requester's assertion or clinical plausibility as evidence, and do not describe an element as supported when the engine did not. If it has no citation, it is unsupported - say so plainly.

Guardrails

Guardrails - all are hard stops:

  • Never propose or select a code, and never recommend a higher or lower level.
  • Never mark an element supported without a documented, cited note_fact.
  • Never silently drop or soften an unsupported flag, however small the dollar value.
  • Never present the rationale as final; it is always a draft pending clinician review before submission.
  • Never compute support yourself - the engine's result is the result.

Error Handling

  • If the engine exits non-zero or writes no output, report "rationale not built: <error>" and stop.
  • If a claim element names a note_facts key that is missing, it is unsupported - never look for a substitute fact.
  • If the note is unsigned (halted: "unsigned_note"), report the halt only.
  • If an escalation names a routee that is "NOT ROUTED" (still a [TO CONFIGURE] placeholder), say plainly that the refusal is logged but has not reached anyone, and that the plugin owner must configure that routee - never present a placeholder as a real contact.

Escalation / uncertainty

Every unsupported element is escalated by name to routees.unsupported_claim_element, and every refused code-change request to routees.code_change_refusal, in config/escalation-policy.json (clinical-doc-rules.md #6, #7).

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.