Skip to content

feat: add extended artifacts (data-model, research, contracts, checkl…#4

Merged
suportly merged 1 commit intomainfrom
feat/extended-artifacts
Dec 27, 2025
Merged

feat: add extended artifacts (data-model, research, contracts, checkl…#4
suportly merged 1 commit intomainfrom
feat/extended-artifacts

Conversation

@suportly
Copy link
Owner

…ist, quickstart)

Add support for 5 new artifact types that achieve feature parity with the bash/CLI version of spec-kit:

New Artifacts:

  • DataModel (data-model.md): Database schema and entity definitions
  • ResearchFindings (research.md): Technology decisions and ADRs
  • APIContract (contracts/api.md): Formal API specifications
  • QualityChecklist (checklists/requirements.md): Spec quality validation
  • QuickstartGuide (quickstart.md): Getting started documentation

Changes:

  • Added 10 new Pydantic models to schemas.py (+486 lines)
  • Added 5 new save methods to FileStorage class
  • Updated get_artifact_path() to support new artifact types
  • Exported all new models in init.py

All models include:

  • Pydantic validation and typing
  • to_markdown() export method
  • Proper directory structure (contracts/, checklists/ subdirs)
  • Backup functionality on overwrite

This is a purely additive change with full backward compatibility. No breaking changes to existing functionality.

Resolves feature parity gap between Python library and bash/CLI versions.

See EXTENDED_ARTIFACTS_IMPLEMENTATION.md for detailed documentation, usage examples, and migration guide.

…ist, quickstart)

Add support for 5 new artifact types that achieve feature parity with the
bash/CLI version of spec-kit:

New Artifacts:
- DataModel (data-model.md): Database schema and entity definitions
- ResearchFindings (research.md): Technology decisions and ADRs
- APIContract (contracts/api.md): Formal API specifications
- QualityChecklist (checklists/requirements.md): Spec quality validation
- QuickstartGuide (quickstart.md): Getting started documentation

Changes:
- Added 10 new Pydantic models to schemas.py (+486 lines)
- Added 5 new save methods to FileStorage class
- Updated get_artifact_path() to support new artifact types
- Exported all new models in __init__.py

All models include:
- Pydantic validation and typing
- to_markdown() export method
- Proper directory structure (contracts/, checklists/ subdirs)
- Backup functionality on overwrite

This is a purely additive change with full backward compatibility.
No breaking changes to existing functionality.

Resolves feature parity gap between Python library and bash/CLI versions.

See EXTENDED_ARTIFACTS_IMPLEMENTATION.md for detailed documentation,
usage examples, and migration guide.
@suportly suportly merged commit 95145ad into main Dec 27, 2025
suportly pushed a commit that referenced this pull request Dec 27, 2025
This implements Phase 2 of the extended artifacts feature, adding automatic
LLM-powered generation for all 5 artifact types that were added in Phase 1.

## New Features

- **ArtifactGenerator Module** (src/speckit/core/artifacts.py)
  - generate_data_model() - Generate database schemas from spec and plan
  - generate_research() - Document technology decisions from plan
  - generate_api_contract() - Create API specifications from spec and plan
  - generate_checklist() - Validate specification quality
  - generate_quickstart() - Create developer onboarding guides
  - All methods include async versions

- **Jinja2 Prompt Templates** (5 new files)
  - templates/data_model.jinja2 - Data model generation prompt
  - templates/research.jinja2 - Research findings generation prompt
  - templates/api_contract.jinja2 - API contract generation prompt
  - templates/checklist.jinja2 - Quality checklist generation prompt
  - templates/quickstart.jinja2 - Quickstart guide generation prompt

- **SpecKit Public API** (10 new methods)
  - kit.generate_data_model(spec, plan) -> DataModel
  - kit.generate_research(plan) -> ResearchFindings
  - kit.generate_api_contract(spec, plan) -> APIContract
  - kit.generate_checklist(spec) -> QualityChecklist
  - kit.generate_quickstart(spec, plan) -> QuickstartGuide
  - Plus async versions of all methods

## Benefits

- **Automation**: Generate comprehensive artifacts automatically using AI
- **Consistency**: Follow established patterns from existing workflow methods
- **Language Support**: All methods support multi-language output (pt-br, es, en)
- **Async Support**: Full async/await support for parallel generation
- **Developer Experience**: Simple, intuitive API matching core workflow

## Usage Example

```python
from speckit import SpecKit

kit = SpecKit("./my-project")

# Core workflow
spec = kit.specify("Add user authentication")
plan = kit.plan(spec)

# Extended artifacts (automatic generation!)
data_model = kit.generate_data_model(spec, plan)
research = kit.generate_research(plan)
contract = kit.generate_api_contract(spec, plan)
checklist = kit.generate_checklist(spec)
quickstart = kit.generate_quickstart(spec, plan)

# Save all artifacts
kit.storage.save_data_model(data_model, spec.feature_id)
kit.storage.save_research(research, spec.feature_id)
kit.storage.save_api_contract(contract, spec.feature_id)
kit.storage.save_checklist(checklist, spec.feature_id)
kit.storage.save_quickstart(quickstart, spec.feature_id)
```

## Files Changed

- src/speckit/core/artifacts.py (+340 lines) - NEW
- src/speckit/speckit.py (+245 lines) - Updated
- src/speckit/templates/data_model.jinja2 (+70 lines) - NEW
- src/speckit/templates/research.jinja2 (+66 lines) - NEW
- src/speckit/templates/api_contract.jinja2 (+86 lines) - NEW
- src/speckit/templates/checklist.jinja2 (+94 lines) - NEW
- src/speckit/templates/quickstart.jinja2 (+102 lines) - NEW
- PHASE_2_LLM_GENERATION.md (+324 lines) - NEW documentation
- test_extended_artifacts_generation.py (+80 lines) - NEW test

## Breaking Changes

None. Fully backward compatible.

## Related

- Phase 1: PR #4 (Extended Artifacts Models)
- Next: Phase 3 (Velospec Platform Integration)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants