A complete example showing how to use RUNE specifications with Claude Projects for consistent code generation.
| File | Description |
|---|---|
project_instructions.md |
Custom instructions to paste into your Claude Project |
specs/api_client.rune |
RUNE spec for an async HTTP JSON client |
specs/data_validator.rune |
RUNE spec for schema-based data validation |
Go to claude.ai and create a new Project.
Copy the contents of project_instructions.md into your project’s Custom Instructions field.
Upload the following files to Project Knowledge:
specs/api_client.runespecs/data_validator.runeTry these prompts:
"Implement api_client.rune"
"Implement data_validator.rune with full pytest test suite"
"Create a RUNE spec for a function that parses ISO 8601 date strings"
"Does this implementation match data_validator.rune?" [paste code]
You: Implement api_client.rune
Claude: Reads the spec, generates a complete
fetch_json()implementation with httpx, input validation for all constraints, error handling for HTTP status codes, and a full pytest test suite covering all 12 test cases from the spec.
You: I need a RUNE spec for a function that hashes passwords using bcrypt
Claude: Asks about salt rounds preference, generates a complete RUNE spec with SIGNATURE, BEHAVIOR rules for input validation, TESTS for happy path / empty input / Unicode, and EDGE_CASES for very long passwords.
You: Does this code match api_client.rune? [pastes code]
Claude: Compares the code against the spec, identifies that the timeout validation is missing and two edge cases are unhandled, suggests specific fixes.
claude-project-example/
├── README.md # This file
├── project_instructions.md # Claude Project custom instructions
└── specs/
├── api_client.rune # HTTP client specification
└── data_validator.rune # Data validation specification