
brunoandClaude Sonnet 4.5
0a91cb0677
feat(openspec): integrate OpenSpec 0.17.2 for API-first development
Integrate OpenSpec with complete OpenAPI-first development workflow:
**Configuration Files:**
- Add package.json with npm scripts for spec validation
- Add .openspec.yaml for validation rules (strict mode)
- Add .spectral.yaml for OpenAPI linting (100+ rules)
- Add openapi.yaml with initial API specification
**Automation:**
- Add scripts/generate-openapi-spec.py to auto-generate spec from FastAPI
- Add .claude/hooks/pre-commit-openspec.sh for pre-commit validation
- Add .github/workflows/openspec-validation.yml for CI/CD validation
**Documentation:**
- Add docs/workflows/openspec-development-workflow.md (500+ lines workflow guide)
- Add OPENSPEC-SETUP.md (quick start guide)
- Add README-OPENSPEC-INTEGRATION.md (integration summary)
- Update .claude/CLAUDE.md with OpenSpec commands and 9-step workflow
**Features Enabled:**
- OpenAPI-first development (design before code)
- Automatic spec validation on commit
- Breaking change detection in PRs
- Bidirectional sync between spec and code
- Spectral linting with 100+ best practice rules
- Auto-generated API documentation
**Validation Rules:**
- Require operationId, tags, descriptions on all operations
- Require 4xx and 5xx error responses
- Enforce naming conventions (kebab-case paths, PascalCase schemas)
- Require /health and /metrics endpoints (observability)
**Commands Available:**
- npm run spec:validate - Validate OpenAPI spec
- npm run spec:lint - Lint with Spectral
- npm run spec:generate - Generate from FastAPI
- npm run spec:sync - Generate + validate
- npm run spec:diff - Detect breaking changes
- npm run spec:watch - Auto-regenerate on changes
**Breaking Changes:** None (new feature)
**Next Steps:**
1. Run: npm install
2. Run: npm run spec:generate
3. Run: npm run spec:validate
4. Enable pre-commit hook: ln -sf ../../.claude/hooks/pre-commit-openspec.sh .git/hooks/pre-commit
Closes #7 (partially - Claude Configuration optimization)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2025-12-31 23:25:52 +08:00
..
2025-12-31 08:16:59 +08:00
2025-12-31 08:16:59 +08:00
2025-12-30 06:21:25 +08:00
2025-12-30 06:21:25 +08:00
2025-12-30 20:55:37 +08:00
2025-12-31 22:48:54 +08:00
2025-12-31 23:25:52 +08:00
2025-12-31 22:48:54 +08:00
2025-12-31 22:48:54 +08:00
2025-12-31 08:16:59 +08:00
2025-12-31 22:48:54 +08:00
2025-12-30 06:21:25 +08:00
2025-12-31 22:48:54 +08:00
2025-12-31 12:48:36 +08:00
2025-12-31 22:48:54 +08:00