|
| 1 | +--- |
| 2 | +title: Author a Skill |
| 3 | +description: Step-by-step guide to creating a new ClawBio skill from scratch |
| 4 | +--- |
| 5 | + |
| 6 | +# Author a Skill |
| 7 | + |
| 8 | +This guide walks you through creating a new bioinformatics skill for ClawBio, from initial idea to submitted pull request. |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +A complete skill consists of: |
| 13 | + |
| 14 | +1. A `SKILL.md` describing the methodology, domain decisions, and safety rules |
| 15 | +2. Demo data that anyone can run without their own files |
| 16 | +3. A Python script with `--input`, `--output`, and `--demo` flags |
| 17 | +4. Reproducibility files: `commands.sh`, `environment.yml`, and `checksums.sha256` |
| 18 | + |
| 19 | +You do not need all of these to start. A SKILL.md-only contribution is valuable on its own. |
| 20 | + |
| 21 | +## Step 1 — Scaffold |
| 22 | + |
| 23 | +```bash |
| 24 | +cd ClawBio |
| 25 | +clawbio init my-skill-name |
| 26 | +``` |
| 27 | + |
| 28 | +This creates `skills/my-skill-name/` with template files. |
| 29 | + |
| 30 | +## Step 2 — Write SKILL.md |
| 31 | + |
| 32 | +The SKILL.md is the most important file. It encodes the domain decisions a trained scientist would make. Fill in: |
| 33 | + |
| 34 | +- **Frontmatter**: name, version, inputs, outputs, domain tags |
| 35 | +- **Domain Decisions**: thresholds, classification rules, guideline references with DOIs |
| 36 | +- **Safety Rules**: what the skill must never do, when to defer to a human |
| 37 | +- **Agent Boundary**: what the skill does and does not cover |
| 38 | + |
| 39 | +See the [SKILL.md specification](../reference/skillmd-spec.md) for the full schema. |
| 40 | + |
| 41 | +## Step 3 — Add Demo Data |
| 42 | + |
| 43 | +Create synthetic or public-domain test data in `demo/`. Requirements: |
| 44 | + |
| 45 | +- Must not contain real patient data |
| 46 | +- Should be small enough to run in under 30 seconds |
| 47 | +- Should exercise all major code paths |
| 48 | + |
| 49 | +## Step 4 — Implement |
| 50 | + |
| 51 | +Write your Python script with a standard CLI interface: |
| 52 | + |
| 53 | +```python |
| 54 | +import argparse |
| 55 | + |
| 56 | +def main(): |
| 57 | + parser = argparse.ArgumentParser() |
| 58 | + parser.add_argument("--input", help="Input file path") |
| 59 | + parser.add_argument("--output", help="Output directory") |
| 60 | + parser.add_argument("--demo", action="store_true", help="Run with demo data") |
| 61 | + args = parser.parse_args() |
| 62 | + |
| 63 | + if args.demo: |
| 64 | + args.input = "demo/sample_input.tsv" |
| 65 | + args.output = args.output or "/tmp/demo" |
| 66 | + |
| 67 | + # Your skill logic here |
| 68 | + |
| 69 | +if __name__ == "__main__": |
| 70 | + main() |
| 71 | +``` |
| 72 | + |
| 73 | +## Step 5 — Validate and Submit |
| 74 | + |
| 75 | +```bash |
| 76 | +# Validate your skill structure |
| 77 | +clawbio validate skills/my-skill-name/ |
| 78 | + |
| 79 | +# Run demo mode |
| 80 | +python skills/my-skill-name/my_skill_name.py --demo --output /tmp/demo |
| 81 | + |
| 82 | +# Create a branch and submit |
| 83 | +git checkout -b skill/my-skill-name |
| 84 | +git add skills/my-skill-name/ |
| 85 | +git commit -m "Add my-skill-name skill" |
| 86 | +git push origin skill/my-skill-name |
| 87 | +``` |
| 88 | + |
| 89 | +Then open a pull request at [github.com/ClawBio/ClawBio](https://github.com/ClawBio/ClawBio). |
| 90 | + |
| 91 | +## Tips |
| 92 | + |
| 93 | +- Start with SKILL.md — the domain decisions are harder and more valuable than the code |
| 94 | +- Reference authoritative guidelines (CPIC, ACMG, EDAM) with DOIs where possible |
| 95 | +- Keep demo data small and deterministic |
| 96 | +- Look at [PharmGx Reporter](../skills/pharmgx-reporter.md) as a reference implementation |
0 commit comments