Source: https://github.com/aipoch/medical-research-skills
SOP Writer
Generate compliant Standard Operating Procedures.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
When to Use
- Use this skill when the task is to Write GCP-compliant Standard Operating Procedures for labs and clinical.
- Use this skill for protocol design tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Workflow
- Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Use Cases
- Sample processing SOPs
- Equipment calibration SOPs
- Safety procedure documentation
- GCP compliance procedures
Parameters
procedure_name: SOP title
scope: Applicable areas
responsibility: Who performs
Returns
- ISO 15189 compliant SOP
- Version control section
- Signature page template
Example
Input: Blood sample processing
Output: Complete SOP with materials, methods, QC checks
References
- references/audit-reference.md - Supported SOP scope, audit commands, and fallback boundaries
Risk Assessment
| Risk Indicator |
Assessment |
Level |
| Code Execution |
Python/R scripts executed locally |
Medium |
| Network Access |
No external API calls |
Low |
| File System Access |
Read input files, write output files |
Medium |
| Instruction Tampering |
Standard prompt guidelines |
Low |
| Data Exposure |
Output files saved to workspace |
Low |
Security Checklist
Prerequisites
No additional Python packages required.
Evaluation Criteria
Success Metrics
Test Cases
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts requests that match the documented purpose of sop-writer and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
sop-writer only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Response Template
Use the following fixed structure for non-trivial requests:
- Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
When Not to Use
- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
Required Inputs
| Field |
Required |
Format/Source |
Example |
If Missing |
| User task description |
Yes |
Text |
Research question, writing goal, analysis objective |
Stop and ask user to provide |
| Primary input material |
Depends on task |
Text, file path, ID, table, or literature |
PMID, PDF, CSV, DOCX, keywords, etc. |
Specify which material type is missing |
| Output preference |
No |
Text |
Language, format, target journal, template |
Use skill default format |
Output Contract
- Primary output: Structured result or target file aligned with this skill's objective.
- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
Failure Handling
- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
User Checkpoints
- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
Quick Validation
- Check that key scripts, templates, or reference file paths this skill depends on exist.
- Check that the final output contains the core fields, sections, or files specified for this task.
- Check that results clearly mark assumptions, limitations, and incomplete items.
1---2name: sop-writer-23description: Write GCP-compliant standard operating procedures for laboratory, clinical, or research workflows; use when a reproducible SOP with roles, steps, and control points is required.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)78# SOP Writer910Generate compliant Standard Operating Procedures.1112## Quick Check1314Use this command to verify that the packaged script entry point can be parsed before deeper execution.1516```bash17python -m py_compile scripts/main.py18```1920## Audit-Ready Commands2122Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.2324```bash25python -m py_compile scripts/main.py26python scripts/main.py --help27```2829## When to Use3031- Use this skill when the task is to Write GCP-compliant Standard Operating Procedures for labs and clinical.32- Use this skill for protocol design tasks that require explicit assumptions, bounded scope, and a reproducible output format.33- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.3435## Workflow36371. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.382. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.393. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.404. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.415. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.4243## Use Cases44- Sample processing SOPs45- Equipment calibration SOPs46- Safety procedure documentation47- GCP compliance procedures4849## Parameters50- `procedure_name`: SOP title51- `scope`: Applicable areas52- `responsibility`: Who performs5354## Returns55- ISO 15189 compliant SOP56- Version control section57- Signature page template5859## Example60Input: Blood sample processing61Output: Complete SOP with materials, methods, QC checks6263## References6465- [references/audit-reference.md](references/audit-reference.md) - Supported SOP scope, audit commands, and fallback boundaries6667## Risk Assessment6869| Risk Indicator | Assessment | Level |70|----------------|------------|-------|71| Code Execution | Python/R scripts executed locally | Medium |72| Network Access | No external API calls | Low |73| File System Access | Read input files, write output files | Medium |74| Instruction Tampering | Standard prompt guidelines | Low |75| Data Exposure | Output files saved to workspace | Low |7677## Security Checklist7879- [ ] No hardcoded credentials or API keys80- [ ] No unauthorized file system access (../)81- [ ] Output does not expose sensitive information82- [ ] Prompt injection protections in place83- [ ] Input file paths validated (no ../ traversal)84- [ ] Output directory restricted to workspace85- [ ] Script execution in sandboxed environment86- [ ] Error messages sanitized (no stack traces exposed)87- [ ] Dependencies audited8889## Prerequisites9091No additional Python packages required.9293## Evaluation Criteria9495### Success Metrics96- [ ] Successfully executes main functionality97- [ ] Output meets quality standards98- [ ] Handles edge cases gracefully99- [ ] Performance is acceptable100101### Test Cases1021. **Basic Functionality**: Standard input → Expected output1032. **Edge Case**: Invalid input → Graceful error handling1043. **Performance**: Large dataset → Acceptable processing time105106## Lifecycle Status107108- **Current Stage**: Draft109- **Next Review Date**: 2026-03-06110- **Known Issues**: None111- **Planned Improvements**: 112 - Performance optimization113 - Additional feature support114115## Output Requirements116117Every final response should make these items explicit when they are relevant:118119- Objective or requested deliverable120- Inputs used and assumptions introduced121- Workflow or decision path122- Core result, recommendation, or artifact123- Constraints, risks, caveats, or validation needs124- Unresolved items and next-step checks125126## Error Handling127128- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.129- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.130- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.131- Do not fabricate files, citations, data, search results, or execution outcomes.132133## Input Validation134135This skill accepts requests that match the documented purpose of `sop-writer` and include enough context to complete the workflow safely.136137Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:138139> `sop-writer` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.140141## Response Template142143Use the following fixed structure for non-trivial requests:1441451. Objective1462. Inputs Received1473. Assumptions1484. Workflow1495. Deliverable1506. Risks and Limits1517. Next Checks152153If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.154155## When Not to Use156157- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.158- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.159- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.160161## Required Inputs162163| Field | Required | Format/Source | Example | If Missing |164|---|---|---|---|---|165| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |166| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |167| Output preference | No | Text | Language, format, target journal, template | Use skill default format |168169## Output Contract170171- Primary output: Structured result or target file aligned with this skill's objective.172- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.173- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.174- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.175176## Failure Handling177178- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.179- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.180- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.181182## User Checkpoints183184- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.185- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.186187## Quick Validation188189- Check that key scripts, templates, or reference file paths this skill depends on exist.190- Check that the final output contains the core fields, sections, or files specified for this task.191- Check that results clearly mark assumptions, limitations, and incomplete items.