|
| 1 | +--- |
| 2 | +title: Protocol Driven DevelopmentのためのClaude Code slash command |
| 3 | +date: '2026-02-15' |
| 4 | +published: '2026-02-15' |
| 5 | +--- |
| 6 | + |
| 7 | +作った。実際に使ってみてどうかは、これから検証する。 |
| 8 | + |
| 9 | +Claude codeのslash commandはskillに統合されたっぽいのだけれど、勝手に読み込んでほしくはないので description は指定しない。 |
| 10 | +また、その意図を自分が忘れないように `.claude/commands` に配置している。 |
| 11 | + |
| 12 | + |
| 13 | +```markdown |
| 14 | +--- |
| 15 | +disable-model-invocation: true |
| 16 | +--- |
| 17 | + |
| 18 | +Proceed with Protocol-Driven Development. |
| 19 | + |
| 20 | +## What is Protocol-Driven Development |
| 21 | + |
| 22 | +A development methodology where you define protocols to understand the problem, then implement those protocols to solve it. |
| 23 | + |
| 24 | +Defining a protocol is itself an act of deepening problem understanding. By defining protocols and getting them to compile, the structure of the problem becomes clear and implementation details emerge. |
| 25 | + |
| 26 | +"Protocol" here is not limited to Swift's language feature. It refers to any "contract" that makes problem structure and responsibilities explicit: |
| 27 | +- Type definitions: interface, type, trait |
| 28 | +- Data structures: struct, enum |
| 29 | +- Tests: unit tests, property-based tests |
| 30 | + |
| 31 | +## Role Division |
| 32 | + |
| 33 | +**Human responsibilities (AI must not take over):** |
| 34 | +- Define protocols that represent the problem structure |
| 35 | +- Write tests for constraints that the compiler cannot express |
| 36 | + |
| 37 | +**AI responsibilities:** |
| 38 | +- Implement the protocols that humans have defined |
| 39 | +- Run the feedback loop until tests pass |
| 40 | +- Do not deviate from the intent of the protocols |
| 41 | + |
| 42 | +## Workflow |
| 43 | + |
| 44 | +1. Check if protocols are defined |
| 45 | +2. If not, prompt the human to define them or clarify the structure through dialogue |
| 46 | +3. Implement using protocols and tests as guides |
| 47 | +4. Verify with compiler and tests |
| 48 | + |
| 49 | +## Do Not |
| 50 | + |
| 51 | +- Define protocols without human input (this is the human's responsibility) |
| 52 | +- Modify human-defined structures without permission |
| 53 | +- Consider implementation complete without tests |
| 54 | +``` |
| 55 | + |
| 56 | +とりあえず、これでターミナルエミュレータでも作ってみようかな。 |
0 commit comments