Commit bc1fc2b
feat: Add Claude skill for generating Allotropy parsers (#1160)
## Summary
- Adds a Claude skill to help developers quickly generate complete
Allotropy instrument parsers from example input files
- The skill analyzes files, suggests appropriate schemas, and generates
all necessary boilerplate code
- Includes three main scripts: analyze_file.py, list_schemas.py, and
create_parser.py
## Features
- **File Analysis**: Automatically detects file format and suggests
appropriate Allotrope schema based on content
- **Schema Discovery**: Lists all available schemas with filtering and
shows example parsers
- **Parser Generation**: Creates complete parser structure with reader,
structure, tests, and all required files
- **Smart Detection**: Recognizes measurement types (absorbance, CT
values, pH, etc.) to suggest the right schema
## Files Added
- `.claude/skills/parser-generator/skill.md` - Main skill definition for
Claude
- `.claude/skills/parser-generator/README.md` - Documentation for using
the skill
- `.claude/skills/parser-generator/scripts/analyze_file.py` - Analyzes
input files and suggests schemas
- `.claude/skills/parser-generator/scripts/list_schemas.py` - Lists
available Allotrope schemas
- `.claude/skills/parser-generator/scripts/create_parser.py` - Generates
complete parser structure
- `.claude/.ruff.toml` - Ruff configuration for Claude skill scripts
## Usage
1. Analyze a file: `python
.claude/skills/parser-generator/scripts/analyze_file.py <file>`
2. List schemas: `python
.claude/skills/parser-generator/scripts/list_schemas.py [filter]`
3. Generate parser: `python
.claude/skills/parser-generator/scripts/create_parser.py <name>
"<Display Name>"`
## Test Plan
- [x] Tested file analysis on Excel files (Exp6.xlsx)
- [x] Tested schema listing with filtering
- [x] All linting checks pass
- [x] Scripts are executable
This skill will significantly speed up the process of adding new
instrument parsers to the allotropy library.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.1 <noreply@anthropic.com>1 parent 1e48cc8 commit bc1fc2b
6 files changed
Lines changed: 1260 additions & 0 deletions
File tree
- .claude
- skills/parser-generator
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
0 commit comments