SQL Optimization Patterns
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
Split a clinical note into canonical sections (Chief Complaint, HPI, PMH, Medications, Allergies, Assessment & Plan, etc.) before running OpenMed NER or de-identification, so section context…
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sections --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/segmenting-clinical-sections .claude/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .claude/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sectionsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sections --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/segmenting-clinical-sections .agents/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .agents/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sections --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/segmenting-clinical-sections .cursor/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .cursor/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/maziyarpanahi/openmed.git --path skills/segmenting-clinical-sections--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sections --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/segmenting-clinical-sections .gemini/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .gemini/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sectionsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/segmenting-clinical-sections .github/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .github/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install maziyarpanahi/openmed segmenting-clinical-sections --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/segmenting-clinical-sections .opencode/skills/segmenting-clinical-sections && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "segmenting-clinical-sections" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/segmenting-clinical-sections into .opencode/skills/segmenting-clinical-sections/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "segmenting-clinical-sections", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
segmenting-clinical-sectionsSplit a clinical note into canonical sections (Chief Complaint, HPI, PMH, Medications, Allergies, Assessment & Plan, etc.) before running OpenMed NER or de-identification, so section context…
Segmenting Clinical Sections is an agent skill from maziyarpanahi/openmed. Split a clinical note into canonical sections (Chief Complaint, HPI, PMH, Medications, Allergies, Assessment & Plan, etc.) before running OpenMed NER or de-identification, so section context sharpens downstream precision. Use when the user has a free-text note or discharge summary and wants section-aware processing, header detection, mapping headers to LOINC document-section codes, or per-section NER/de-id. Covers heuristic header detection, normalization to canonical section labels, LOINC/SecTag framing, and why…
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Database schema design. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 9dca507. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
loinc.orgncbi.nlm.nih.govhl7.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Segmenting Clinical Sections loads about 1.8k tokens when it runs. Until then it costs about 187 tokens; SKILL.md has 602 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from maziyarpanahi/openmed at commit 9dca507, republished under its Apache-2.0 licence (© maziyarpanahi). 602 words, ~1,761 tokens.
.claude/skills/segmenting-clinical-sections/SKILL.md (or your agent's skills folder).A clinical note is not flat text — it is a sequence of named sections (Chief Complaint, HPI, Past Medical History, Medications, Allergies, Assessment & Plan). The same phrase means different things in different sections: "diabetes" in PMH is historical context, "diabetes" in Assessment & Plan is an active problem, and "penicillin" under Allergies is an adverse-reaction flag, not a current medication. Splitting the note into canonical sections before NER or de-identification gives every downstream OpenMed step the context it needs to be more precise — and lets you process sensitive sections under stricter policies.
extracting-clinical-entities) or de-identification.import re
import openmed
# Synthetic note.
note = """CHIEF COMPLAINT: chest pain.
HPI: 54M with 2 hours of substernal pressure.
PAST MEDICAL HISTORY: type 2 diabetes, prior MI 2019.
MEDICATIONS: metformin 500 mg BID.
ALLERGIES: penicillin (rash).
ASSESSMENT AND PLAN: acute coronary syndrome; start aspirin, admit."""
# Map common header variants -> canonical section + LOINC document-section code.
SECTION_MAP = {
"chief complaint": ("Chief Complaint", "10154-3"),
"hpi": ("History of Present Illness", "10164-2"),
"history of present illness": ("History of Present Illness", "10164-2"),
"past medical history": ("Past Medical History", "11348-0"),
"medications": ("Medications", "10160-0"),
"allergies": ("Allergies", "48765-2"),
"assessment and plan": ("Assessment and Plan", "51847-2"),
}
HEADER_RE = re.compile(r"^(?P<h>[A-Z][A-Za-z /&]+):", re.MULTILINE)
# Split note into (canonical_label, loinc, body) chunks at each header.
chunks, matches = [], list(HEADER_RE.finditer(note))
for i, m in enumerate(matches):
raw = m.group("h").strip().lower()
label, loinc = SECTION_MAP.get(raw, (m.group("h").strip(), None))
body_start = m.end()
body_end = matches[i + 1].start() if i + 1 < len(matches) else len(note)
chunks.append({"section": label, "loinc": loinc,
"text": note[body_start:body_end].strip()})
# Run NER per section — pass the section label downstream as context.
for c in chunks:
ents = openmed.analyze_text(c["text"], model_name="disease_detection_superclinical",
output_format="dict")
c["entities"] = entsEach chunk now carries its canonical section label and LOINC code, so downstream context resolution can treat PMH findings as historical and A&P findings as active.
10164-2, PMH → 11348-0, Medications → 10160-0, Allergies → 48765-2,
A&P → 51847-2). Unknown headers keep their literal text and a null code.(section, loinc, body) spans between consecutive
headers, preserving original character offsets if you need to map results back.analyze_text / deidentify on each chunk and
carry the section label forward. This is where precision is won: section-aware
negation (PMH = historical) and section-specific de-id policy
(Social History / Family History often warrant stricter redaction).extracting-clinical-entities: feed each section chunk into
openmed.analyze_text and attach the section label to every entity — section
context measurably sharpens entity precision and downstream status assignment.deidentifying-clinical-text: run openmed.deidentify per section so
high-risk sections (Social/Family History) can use a stricter policy profile
than the body.resolving-clinical-context: the section label is a strong prior — PMH
biases temporality toward historical, A&P toward recent/active. Pass it as part
of the modifier window.reconciling-problem-lists: section provenance (PMH vs. A&P) is a key
signal for active-vs-resolved reconciliation.© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/segmenting-clinical-sections of maziyarpanahi/openmed.
Open the folder on GitHubat commit 9dca507
Segmenting Clinical Sections next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Segmenting Clinical Sections this skillmaziyarpanahi/openmed | 5.5k | — | ~1.8k | Automated safety check: Pass | Apache-2.0 | |
| SQL Optimization Patternsynulihao/AgentSkillOS | 618 | 11 repos | ~3.3k | Automated safety check: Pass | None | |
| Datamodellmnimbalyst/nimbalyst | 1.9k | — | ~713 | Automated safety check: Pass | MIT | |
| Add Mpk Taskmirage-project/mirage | 2.5k | — | ~4.5k | Automated safety check: Pass | Apache-2.0 | |
| B200 Flash Attention4 Plannermirage-project/mirage | 2.5k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Experiment Auditwanshuiyin/Auto-claude-code-research-in-sleep | 17k | 1 repos | ~2.7k | Automated safety check: Notes | MIT |
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
nimbalyst/nimbalyst
Create visual data models for database schemas using Nimbalyst's DataModelLM editor.
mirage-project/mirage
Step-by-step guide for adding a new task implementation to Mirage Persistent Kernel (MPK).
mirage-project/mirage
A skill your agent uses when the user wants to design or extend a FlashAttention-style forward kernel on B200/Blackwell, involving the two MMAs QKᵀ and PV, online softmax, S/P/O in TMEM, warp roles…
wanshuiyin/Auto-claude-code-research-in-sleep
Audit experiment integrity before claiming results. An agent skill from wanshuiyin/Auto-claude-code-research-in-sleep.
fastrepl/anarlog
Design or review schemas for crates/cloudsync using SQLite Sync constraints, not generic SQLite advice.
maziyarpanahi/openmed
Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.
maziyarpanahi/openmed
Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.
maziyarpanahi/openmed
Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.
maziyarpanahi/openmed
Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.
maziyarpanahi/openmed
Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.
maziyarpanahi/openmed
Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.
Categories
Split a clinical note into canonical sections (Chief Complaint, HPI, PMH, Medications, Allergies, Assessment & Plan, etc.) before running OpenMed NER or de-identification, so section context…. Segmenting Clinical Sections is an agent skill from maziyarpanahi/openmed.) before running OpenMed NER or de-identification, so section context sharpens downstream precision.
Segmenting Clinical Sections fits situations like: the user has a free-text note; discharge summary and wants section-aware processing; header detection; mapping headers to LOINC document-section codes.
Run `npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a claude-code`. Or copy the skill folder (skills/segmenting-clinical-sections in maziyarpanahi/openmed) into .claude/skills/segmenting-clinical-sections in your project. Claude Code loads it when a task matches its description.
Run `npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a codex`. Or copy the skill folder (skills/segmenting-clinical-sections in maziyarpanahi/openmed) into .agents/skills/segmenting-clinical-sections in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill segmenting-clinical-sections -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/segmenting-clinical-sections, .gemini/skills/segmenting-clinical-sections, .github/skills/segmenting-clinical-sections and .opencode/skills/segmenting-clinical-sections in your project.
SKILL.md names no scripts, command-line tools or credentials: Segmenting Clinical Sections is instructions for the agent only. Our summary lists: Python 3.
SKILL.md names 3 domains. As links in the text: loinc.org, ncbi.nlm.nih.gov and hl7.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Segmenting Clinical Sections is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Segmenting Clinical Sections: SQL Optimization Patterns (ynulihao/AgentSkillOS, 618 stars), Datamodellm (nimbalyst/nimbalyst, 1.9k stars), Add Mpk Task (mirage-project/mirage, 2.5k stars) and B200 Flash Attention4 Planner (mirage-project/mirage, 2.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,500 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 9, 2026.
Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.