IRB-in-Hurry Skill
Automated KFSYSCC IRB form generation system. Generates DOCX forms from config.yml, converts to PDF/PNG for visual review.
Quick Start
Users do NOT need to manually edit YAML. Just provide any free-form text:
User: "我想做一個回溯性研究,看2018-2023年肺癌免疫治療的甲狀腺功能,大約200人。我是腫瘤內科陳雅文。"
Claude will:
- Save raw text to
raw/
- Distill into
config.yml (see distill.md)
- Ask for any missing required fields (IRB number, dates)
- Run
make all + make review
- Show dashboard and review opinions
Manual alternative
# If user prefers to edit YAML directly:
vim config.yml
make all
make review
Workflow Overview
When a user provides a study topic, proposal, or any text:
- Save raw input -- Write to
raw/proposal_YYYYMMDD.md
- Distill to config -- Extract study type, PI, dates, subjects →
config.yml (see distill.md)
- Confirm with user -- Ask about any missing required fields (IRB number, exact dates)
- Generate forms --
make all → DOCX + PDF + PNG previews + dashboard
- Run reviewer --
make review → reviewers/review_*.md
- Visual validation -- Read
output/preview/*.png to verify layout
- Fix findings -- Address required revisions from reviewer
- Update checklist -- Track manual steps via
checklist.md
Study Type Classification
| Study Type |
Review Type |
Key Config Flags |
| Retrospective chart review |
expedited |
type: retrospective, consent_waiver: true |
| Prospective observational |
expedited or full_board |
type: prospective |
| Clinical trial (drug) |
full_board |
type: clinical_trial, drug_device: true |
| Clinical trial (device) |
full_board |
type: clinical_trial, drug_device: true |
| Genetic research |
full_board |
type: genetic, genetic: true |
| Multi-center study |
varies |
multicenter: true |
See study-types.md for the full decision tree.
Phase to Forms Mapping
| Phase |
Forms |
When |
| new |
SF001, SF002, SF094 + conditional |
Initial submission |
| amendment |
SF014, SF015, SF016, SF094 |
Protocol changes |
| re_review |
SF019 |
Responding to IRB queries |
| continuing |
SF030, SF031, SF023 |
Annual review |
| closure |
SF036, SF037, SF038, SF023 |
Study completion |
| sae |
SF079, SF044/SF074, SF080, SF024 |
Adverse events |
| ib_update |
SF082, SF083 |
Investigator's Brochure updates |
| import |
SF066, SF067, SF068, SF093 |
Drug import |
| suspension |
SF047, SF048 |
Study pause |
| appeal |
SF077, SF054 |
Decision appeal |
The form selector (scripts/form_selector.py) automatically adds conditional forms based on study type, review type, and config flags.
Config Schema (Key Fields)
study:
irb_no: "" # IRB case number
title_zh: "" # Chinese title
title_en: "" # English title
type: "" # retrospective | prospective | clinical_trial | genetic
review_type: "" # exempt | expedited | full_board
drug_device: false # Drug or device trial
genetic: false # Involves genetic data
multicenter: false # Multi-center study
pi:
name: "" # PI Chinese name
dept: "" # Department/title
dates:
study_start: "" # Study start date
study_end: "" # Study end date
subjects:
planned_n: 0 # Planned enrollment
consent_waiver: false # Waiver of informed consent
phase: "" # new | amendment | continuing | closure | sae | ...
See config-schema.md for the complete field reference.
Checkbox Convention
check(True) returns U+25A0 (filled square) = checked/yes
check(False) returns U+25A1 (empty square) = unchecked/no
All forms use this convention via docx_utils.check().
Project Structure
config.yml # Study metadata (single source of truth)
scripts/
docx_utils.py # Shared DOCX helpers (init_doc, add_p, add_ct, etc.)
form_selector.py # Phase + study type -> required forms
generate_all.py # Main orchestrator
checklist.py # Generates checklist.md with status
convert.py # DOCX -> PDF -> PNG pipeline
generators/
new_case.py # SF001, SF002, SF094, SF011, SF022
closure.py # SF036, SF037, SF038, SF023
consent.py # SF003, SF004, SF005, SF062, SF063, SF075, SF090-092
amendment.py # SF014, SF015, SF016
continuing_review.py # SF030, SF031, SF032
sae.py # SF079, SF044, SF074, SF080, SF024
ib_update.py # SF082, SF083, SF084, SF085
import_forms.py # SF066, SF067, SF068, SF093
suspension.py # SF047, SF048
appeal.py # SF077, SF054
re_review.py # SF019
other.py # SF076
output/ # Generated DOCX and PDF files
output/preview/ # PNG previews for visual validation
checklist.md # Auto-generated submission checklist
dashboard.sh # Terminal status dashboard
Form Details by Category
- New Case (新案審查) -- SF001, SF002, SF094, SF003-005
- Closure (結案審查) -- SF036, SF037, SF038, SF023
- Amendment (修正案審查) -- SF014, SF015, SF016
- Continuing Review (期中審查) -- SF030, SF031, SF032
- SAE & Non-compliance (嚴重不良反應) -- SF079, SF044, SF074, SF080, SF024
- Other Categories -- IB update, import, suspension, appeal
- Study Types & Routing -- Classification logic
- Config Schema -- All config.yml fields
- Brainstorm -- Research topic ideas tailored to KFSYSCC + Taiwan epidemiology
- Distill: Raw Text → Config -- How to extract config from free-form text
- Reviewer Criteria -- Simulated IRB review checklist
- Reviewer Guide -- Rules of thumb, red flags, 45 CFR 46.111 training
Validation
After generating forms:
- Run
python scripts/convert.py to create PDFs and PNG previews
- Read each
output/preview/*.png to visually verify layout and content
- Check
checklist.md for remaining manual steps (signatures, content sections)
- Run
./dashboard.sh for terminal status overview
Adding New Generators
Each generator function follows this signature:
def generate_sfXXX(config: dict, output_dir: str) -> str:
"""Generate SFXXX form. Returns output file path."""
doc = init_doc()
# ... build document ...
path = os.path.join(output_dir, "SFXXX_中文名稱.docx")
doc.save(path)
return path
Register in FORM_REGISTRY in scripts/form_selector.py, then add to the appropriate phase in PHASE_FORMS.
Submission
- Electronic: email to irb@kfsyscc.org
- Paper: 1 original + 1 copy to IRB office (B1 administrative building)
- Signed forms require PI wet signature before submission
1---2name: irb-form-generator3description: Automate KFSYSCC IRB document preparation — generates Word docs for all IRB submission phases (new case, amendment, continuing review, closure, SAE, etc.). Use when user mentions IRB, ethics review, human subjects research, form generation, or KFSYSCC. Triggers on study proposals, IRB submissions, or form filling tasks.4---56# IRB-in-Hurry Skill78Automated KFSYSCC IRB form generation system. Generates DOCX forms from `config.yml`, converts to PDF/PNG for visual review.910## Quick Start1112Users do NOT need to manually edit YAML. Just provide any free-form text:1314```15User: "我想做一個回溯性研究,看2018-2023年肺癌免疫治療的甲狀腺功能,大約200人。我是腫瘤內科陳雅文。"16```1718Claude will:191. Save raw text to `raw/`202. Distill into `config.yml` (see [distill.md](references/distill.md))213. Ask for any missing required fields (IRB number, dates)224. Run `make all` + `make review`235. Show dashboard and review opinions2425### Manual alternative2627```bash28# If user prefers to edit YAML directly:29vim config.yml30make all31make review32```3334## Workflow Overview3536When a user provides a study topic, proposal, or any text:37381. **Save raw input** -- Write to `raw/proposal_YYYYMMDD.md`392. **Distill to config** -- Extract study type, PI, dates, subjects → `config.yml` (see [distill.md](references/distill.md))403. **Confirm with user** -- Ask about any missing required fields (IRB number, exact dates)414. **Generate forms** -- `make all` → DOCX + PDF + PNG previews + dashboard425. **Run reviewer** -- `make review` → `reviewers/review_*.md`436. **Visual validation** -- Read `output/preview/*.png` to verify layout447. **Fix findings** -- Address required revisions from reviewer458. **Update checklist** -- Track manual steps via `checklist.md`4647## Study Type Classification4849| Study Type | Review Type | Key Config Flags |50|---|---|---|51| Retrospective chart review | expedited | `type: retrospective`, `consent_waiver: true` |52| Prospective observational | expedited or full_board | `type: prospective` |53| Clinical trial (drug) | full_board | `type: clinical_trial`, `drug_device: true` |54| Clinical trial (device) | full_board | `type: clinical_trial`, `drug_device: true` |55| Genetic research | full_board | `type: genetic`, `genetic: true` |56| Multi-center study | varies | `multicenter: true` |5758See [study-types.md](references/study-types.md) for the full decision tree.5960## Phase to Forms Mapping6162| Phase | Forms | When |63|---|---|---|64| new | SF001, SF002, SF094 + conditional | Initial submission |65| amendment | SF014, SF015, SF016, SF094 | Protocol changes |66| re_review | SF019 | Responding to IRB queries |67| continuing | SF030, SF031, SF023 | Annual review |68| closure | SF036, SF037, SF038, SF023 | Study completion |69| sae | SF079, SF044/SF074, SF080, SF024 | Adverse events |70| ib_update | SF082, SF083 | Investigator's Brochure updates |71| import | SF066, SF067, SF068, SF093 | Drug import |72| suspension | SF047, SF048 | Study pause |73| appeal | SF077, SF054 | Decision appeal |7475The form selector (`scripts/form_selector.py`) automatically adds conditional forms based on study type, review type, and config flags.7677## Config Schema (Key Fields)7879```yaml80study:81 irb_no: "" # IRB case number82 title_zh: "" # Chinese title83 title_en: "" # English title84 type: "" # retrospective | prospective | clinical_trial | genetic85 review_type: "" # exempt | expedited | full_board86 drug_device: false # Drug or device trial87 genetic: false # Involves genetic data88 multicenter: false # Multi-center study8990pi:91 name: "" # PI Chinese name92 dept: "" # Department/title9394dates:95 study_start: "" # Study start date96 study_end: "" # Study end date9798subjects:99 planned_n: 0 # Planned enrollment100 consent_waiver: false # Waiver of informed consent101102phase: "" # new | amendment | continuing | closure | sae | ...103```104105See [config-schema.md](references/config-schema.md) for the complete field reference.106107## Checkbox Convention108109- `check(True)` returns **U+25A0** (filled square) = checked/yes110- `check(False)` returns **U+25A1** (empty square) = unchecked/no111112All forms use this convention via `docx_utils.check()`.113114## Project Structure115116```117config.yml # Study metadata (single source of truth)118scripts/119 docx_utils.py # Shared DOCX helpers (init_doc, add_p, add_ct, etc.)120 form_selector.py # Phase + study type -> required forms121 generate_all.py # Main orchestrator122 checklist.py # Generates checklist.md with status123 convert.py # DOCX -> PDF -> PNG pipeline124 generators/125 new_case.py # SF001, SF002, SF094, SF011, SF022126 closure.py # SF036, SF037, SF038, SF023127 consent.py # SF003, SF004, SF005, SF062, SF063, SF075, SF090-092128 amendment.py # SF014, SF015, SF016129 continuing_review.py # SF030, SF031, SF032130 sae.py # SF079, SF044, SF074, SF080, SF024131 ib_update.py # SF082, SF083, SF084, SF085132 import_forms.py # SF066, SF067, SF068, SF093133 suspension.py # SF047, SF048134 appeal.py # SF077, SF054135 re_review.py # SF019136 other.py # SF076137output/ # Generated DOCX and PDF files138output/preview/ # PNG previews for visual validation139checklist.md # Auto-generated submission checklist140dashboard.sh # Terminal status dashboard141```142143## Form Details by Category144145- [New Case (新案審查)](references/new-case.md) -- SF001, SF002, SF094, SF003-005146- [Closure (結案審查)](references/closure.md) -- SF036, SF037, SF038, SF023147- [Amendment (修正案審查)](references/amendment.md) -- SF014, SF015, SF016148- [Continuing Review (期中審查)](references/continuing-review.md) -- SF030, SF031, SF032149- [SAE & Non-compliance (嚴重不良反應)](references/sae.md) -- SF079, SF044, SF074, SF080, SF024150- [Other Categories](references/other-categories.md) -- IB update, import, suspension, appeal151- [Study Types & Routing](references/study-types.md) -- Classification logic152- [Config Schema](references/config-schema.md) -- All config.yml fields153- [Brainstorm](references/brainstorm.md) -- Research topic ideas tailored to KFSYSCC + Taiwan epidemiology154- [Distill: Raw Text → Config](references/distill.md) -- How to extract config from free-form text155- [Reviewer Criteria](references/reviewer.md) -- Simulated IRB review checklist156- [Reviewer Guide](references/reviewer-guide.md) -- Rules of thumb, red flags, 45 CFR 46.111 training157158## Validation159160After generating forms:1611621. Run `python scripts/convert.py` to create PDFs and PNG previews1632. Read each `output/preview/*.png` to visually verify layout and content1643. Check `checklist.md` for remaining manual steps (signatures, content sections)1654. Run `./dashboard.sh` for terminal status overview166167## Adding New Generators168169Each generator function follows this signature:170171```python172def generate_sfXXX(config: dict, output_dir: str) -> str:173 """Generate SFXXX form. Returns output file path."""174 doc = init_doc()175 # ... build document ...176 path = os.path.join(output_dir, "SFXXX_中文名稱.docx")177 doc.save(path)178 return path179```180181Register in `FORM_REGISTRY` in `scripts/form_selector.py`, then add to the appropriate phase in `PHASE_FORMS`.182183## Submission184185- Electronic: email to irb@kfsyscc.org186- Paper: 1 original + 1 copy to IRB office (B1 administrative building)187- Signed forms require PI wet signature before submission