Configuration
This page documents how to configure Spectr projects.
Project Configuration
Section titled “Project Configuration”Spectr projects are configured using spectr/project.md, which defines conventions and guidelines for your project.
Default Configuration
Section titled “Default Configuration”When you initialize a Spectr project with spectr init, it creates a default spectr/project.md:
spectr init /path/to/projectThis creates:
spectr/project.md- Project conventionsspectr/AGENTS.md- AI assistant instructionsspectr/specs/- Master specifications directoryspectr/changes/- Changes and proposals directory
Project.md Structure
Section titled “Project.md Structure”The project.md file defines how changes and specs should be created:
# Project: Spectr
## Capabilities
Spectr uses the following capability structure:- Each capability has a name: `auth`, `api-design`, `webhooks`- Each capability has one spec file: `spectr/specs/<capability>/spec.md`- Each capability is independently versioned and modified
## Change Organization
Changes are organized in `spectr/changes/<change-id>/`:- `proposal.md` - Why and what- `tasks.md` - Implementation checklist- `design.md` (optional) - Technical decisions- `specs/` - Spec deltas for affected capabilities
## Naming Conventions
### Change IDs- Use kebab-case: `add-two-factor-auth`- Start with verb: `add-`, `update-`, `remove-`, `refactor-`- Keep concise and descriptive- Ensure uniqueness across all changes and archives
### Capability Names- Use kebab-case: `auth`, `api-design`, `webhook-config`- Single purpose per capability- 10-minute understandability rule
## File Formats
### Spec FilesSpecs use standard Markdown with structured requirements:
```markdown### Requirement: Feature NameDescription of requirement.
#### Scenario: Success case- **WHEN** user performs action- **THEN** expected resultChange Deltas
Section titled “Change Deltas”Deltas use section headers to indicate changes:
## ADDED Requirements- New capabilities## MODIFIED Requirements- Changed behavior## REMOVED Requirements- Deprecated features## RENAMED Requirements- Name changes
## Customizing Your Project
### Change ID Naming Rules
Edit `project.md` to define change ID requirements:
```markdown## Change ID Naming- Format: kebab-case- Must start with: add-, update-, remove-, refactor-- Length: 20-50 characters- Pattern: [verb]-[noun-phrase]Capability Naming Rules
Section titled “Capability Naming Rules”## Capability Naming- Format: kebab-case- Prefix: [domain]-[feature]- Examples: auth-mfa, api-pagination, webhooks-retryValidation Rules
Section titled “Validation Rules”## Validation Rules- Every requirement must have at least 1 scenario- Every scenario must use #### Scenario: format- Change must affect at least 1 spec- Spec deltas must use operation headersDirectory Structure
Section titled “Directory Structure”After initialization, your project looks like:
your-project/├── CLAUDE.md├── spectr/│ ├── project.md # Configuration (you edit this)│ ├── AGENTS.md # AI instructions (you edit this)│ ├── specs/ # Master specifications│ │ ├── auth/│ │ │ └── spec.md│ │ ├── api-design/│ │ │ └── spec.md│ │ └── webhooks/│ │ └── spec.md│ └── changes/ # Proposed and archived changes│ ├── add-two-factor-auth/│ │ ├── proposal.md│ │ ├── tasks.md│ │ └── specs/│ │ └── auth/spec.md│ └── archive/ # Completed changes│ └── 2025-01-15-add-two-factor-auth/└── ...rest of project...Best Practices
Section titled “Best Practices”Project Configuration
Section titled “Project Configuration”- Document conventions - Make your naming rules explicit in
project.md - Define scope - Clarify what capabilities your project manages
- Set validation rules - Document what makes a valid spec or change
- Provide examples - Include example change proposals
Capability Design
Section titled “Capability Design”- Single purpose - Each capability does one thing well
- Clear boundaries - No overlap with other capabilities
- Consistent naming - Follow your naming conventions
- Meaningful names - Someone should understand it in 10 minutes
Change Organization
Section titled “Change Organization”- Focused proposals - One major feature per change
- Complete deltas - All affected specs must be updated
- Clear requirements - Write requirements that are testable
- Comprehensive tasks - Break implementation into clear steps
Environment Variables
Section titled “Environment Variables”Spectr respects these environment variables:
# Set working directoryexport SPECTR_DIR=/path/to/project/spectr
# Enable debug loggingexport DEBUG=spectr:*
# Set output formatexport SPECTR_FORMAT=jsonIntegration with Workflows
Section titled “Integration with Workflows”CI/CD Integration
Section titled “CI/CD Integration”Validate changes in CI/CD:
# In your CI/CD pipelinespectr validate --strict --no-interactiveGit Hooks
Section titled “Git Hooks”Validate before commit:
#!/bin/bashspectr validate --strict || exit 1GitHub Actions
Section titled “GitHub Actions”Example GitHub Actions workflow:
name: Validate Spectr Changes
on: [pull_request]
jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Spectr run: go install github.com/connerohnesorge/spectr@latest - name: Validate run: spectr validate --strict --no-interactiveTroubleshooting Configuration
Section titled “Troubleshooting Configuration”Invalid configuration format
Section titled “Invalid configuration format”Ensure project.md follows Markdown conventions:
# Check syntaxspectr validate --strictCapability not found
Section titled “Capability not found”If a capability doesn’t exist:
- Check spelling matches exactly
- Verify file exists:
ls spectr/specs/<capability>/spec.md - Ensure directory structure is correct
Naming conflicts
Section titled “Naming conflicts”If change IDs conflict:
- List all changes:
spectr list - List archived changes:
ls spectr/changes/archive/ - Use unique ID or add suffix:
add-feature-2
Advanced Configuration
Section titled “Advanced Configuration”Multi-Repository Setup
Section titled “Multi-Repository Setup”For monorepos or multiple Spectr instances:
# Initialize multiple Spectr projectsspectr init ./services/authspectr init ./services/paymentsspectr init ./services/webhooksEach has independent:
project.md- Own conventionsspecs/- Own capabilitieschanges/- Own proposals
Custom Validation Rules
Section titled “Custom Validation Rules”Extend validation in project.md:
## Validation Rules- Scenarios must include both WHEN and THEN- Requirements must reference related issues- Change proposals require team approval- All tasks must include effort estimatesConfiguration Examples
Section titled “Configuration Examples”Minimal Project
Section titled “Minimal Project”# Project: MyApp
## Capabilities- auth- api- frontend
## Change NamingFormat: `add-`, `update-`, `remove-` prefix with kebab-case nameComprehensive Project
Section titled “Comprehensive Project”# Project: Enterprise Platform
## Capabilities by Domain### Auth Domain- user-authentication- multi-factor-auth- session-management
### API Domain- api-versioning- rate-limiting- oauth-integration
## Validation Rules- Every requirement: 1+ scenario- Every scenario: WHEN + THEN format- Change scope: 1-3 capabilities- Tasks: Estimated hours required
## Naming Conventions- Changes: [verb]-[noun-phrase] (20-50 chars)- Capabilities: [domain]-[feature]- Requirements: Action-oriented verbs
## Approval Process- Changes: Require technical review- Specs: Require architecture team sign-off- Archives: Require deployment confirmation