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.
In this repository294 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- accessibility-passSkill
- accounting-root-skillSkill
- budget-and-forecastSkill
- financial-presentationsSkill
- financial-statementsSkill
- journal-entrySkill
- reconciliationSkill
- tax-preparationSkill
- acroform-writerSkill
- action-items-todoSkill
- agent-evaluation-designerSkill
- agent-harness-explorerSkill
- agent-performance-triageSkill
- agent-rai-impact-assessmentSkill
- agent-red-teamSkill
- ai-demo-assistantSkill
- ai-first-process-redesignSkill
- ai-usecase-assessmentSkill
- anonymised-case-study-writerSkill
- answer-researchSkill
- b2b-outreach-suiteSkill
- blog-content-auditorSkill
- blog-post-structure-passSkill
- booth-loop-videoSkill
- brand-template-enforcerSkill
- brand-voice-passSkill
- breathing-roomSkill
- browser-uat-analystSkill
- business-case-composerSkill
- business-osSkill
- call-for-speakers-digestSkill
- campaign-deck-builderSkill
- cim-teardownSkill
- company-profile-packSkill
- comps-analysisSkill
- coverage-meeting-prep-debriefSkill
- dd-checklistSkill
- document-diligenceSkill
- earnings-noteSkill
- ic-memoSkill
- merger-modelSkill
- pitch-deck-skeletonSkill
- case-preparation-briefSkill
- case-triageSkill
- chart-builderSkill
- classic-text-adventureSkill
- document-deriveSkill
- handoff-draftSkill
- note-contextSkill
- quality-gap-checkSkill
- clipchamp-videoSkill
- clt-hr-assistantSkill
- commenting-contentSkill
- competitive-battlecard-builderSkill
- competitive-strategySkill
- conditional-chat-reminderSkill
- conference-session-abstract-packSkill
- content-quality-auditorSkill
- copilot-agent-advisorSkill
- The first 60 shown.
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
- Very specific: line 11
After note-context, whenever claim.visit_level or claim.elements exist - triggered by "why is this coded 99214?", "does the note support …
- Distinctive: line 23
If note_facts are already on the contract with citations, use them.
- Very specific: line 25
Run the tool: python3 base/scripts/quality_gap_engine.py --question <working.json> --measures config/quality-measures.json --policy …
- Very specific: line 28
Read back coding_rationale.supported[], unsupported_flags[] and change_requests_refused[].
- Distinctive: line 48
Every 'supported' entry carries the citation of the documented note_fact that supports it.
- Distinctive: line 54
Never propose or select a code, and never recommend a higher or lower level.
- Distinctive: line 55
Never mark an element supported without a documented, cited note_fact.
- Distinctive: line 56
Never silently drop or soften an unsupported flag, however small the dollar value.
- Distinctive: line 57
Never present the rationale as final.
- Distinctive: line 58
Never compute support yourself - the engine's result is the result.
- Distinctive: line 60
If the engine exits non-zero or writes no output, report "rationale not built: <error>" and stop.
- Distinctive: line 61
If a claim element names a note_facts key that is missing, it is unsupported - never look for a substitute fact.
- Very specific: line 62
If the note is unsigned (halted: "unsigned_note"), report the halt only.
- Distinctive: line 63
If an escalation names a routee that is "NOT ROUTED" (still a [TO CONFIGURE] placeholder), say plainly that the refusal is logged but has …
- Very specific: line 67
Every unsupported element is escalated by name to routees.unsupported_claim_element, and every refused code-change request to …
≈ “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.
Files
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
- If note_facts are already on the contract with citations, use them; otherwise run note-context first.
- Copy the contract to a working file and append the user's message verbatim to
messages. - 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. - Read back
coding_rationale.supported[],unsupported_flags[]andchange_requests_refused[]. - Report all three lists verbatim - never move an element from unsupported to supported, and never drop one.
- 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_refusedis empty, decline it yourself and escalate it the same way. - 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_refusalGrounding 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).
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.

