Skip to content

Conversation

@suportly
Copy link

No description provided.

alairjt and others added 11 commits December 19, 2025 13:28
This commit introduces the speckit-ai library, transforming spec-kit from
a Markdown-template-based toolkit into a standalone Python library with
universal LLM support via LiteLLM.

Core Features:
- SpecKit orchestrator class with full workflow methods
- LiteLLM provider wrapper supporting 100+ LLM providers
- Pydantic v2 models with to_markdown() serialization
- Instructor integration for structured outputs
- File-based artifact storage with backup support
- Hierarchical configuration (env vars → YAML → code)

Workflow Phases:
- constitution: Project principles and constraints
- specify: Generate feature specifications from descriptions
- clarify: Identify ambiguities and generate questions
- plan: Create technical implementation plans
- tasks: Generate dependency-ordered task breakdowns
- analyze: Cross-artifact consistency checking

Interfaces:
- Typer CLI with Rich formatting and progress indicators
- MCP server for AI assistant integration (Claude Desktop)
- Programmatic Python API for automation

Package Structure:
- src/speckit/ - Main package (22 modules)
- src/speckit/core/ - Workflow phase implementations
- src/speckit/storage/ - Artifact persistence layer
- src/speckit/templates/ - Jinja2 prompt templates
- src/speckit/mcp/ - MCP server integration
- tests/ - Unit and contract tests (39 passing)
- examples/ - Usage examples

Implements feature 001-python-litellm-library (103/118 tasks complete).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: implement speckit-ai Python library with LiteLLM integration
- Fix model_dump() to use mode='json' for datetime serialization in:
  - core/planner.py
  - core/tasker.py
  - core/analyzer.py
  - core/clarifier.py

- Add integration tests (tests/integration/test_workflow.py):
  - TestSpecifyWorkflow: specify and save
  - TestPlanWorkflow: generate technical plans
  - TestTasksWorkflow: generate task breakdowns
  - TestFullWorkflow: end-to-end workflow
  - TestClarifyWorkflow: identify ambiguities
  - TestAnalyzeWorkflow: consistency checking

All 7 integration tests pass with Claude Haiku API.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PyPI badge to header badges
- Add Python Library section to table of contents
- Add comprehensive documentation for speckit-ai package:
  - Installation instructions (pip install speckit-ai)
  - Optional MCP support installation
  - Quick Start example with full workflow
  - CLI usage examples
  - List of supported LLM providers (100+ via LiteLLM)
  - Environment variable configuration

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BREAKING CHANGES:
- Task.phase is now a string instead of PhaseType enum (for dynamic phases)
- Task now includes priority, dependency_reasons, and phase_label fields
- TaskBreakdown now includes Phase objects for proper phase organization

Changes:
- Task.to_markdown() now outputs multi-line format with:
  > Description: ...
  > Files: ...
  > Depends: T001 (reason)
  > Priority: P1
- Added Phase model for organizing tasks into named phases
- TaskBreakdown.to_markdown() now outputs full template structure:
  - Header with input/prerequisites
  - Format documentation
  - Phases grouped with purpose and checkpoints
  - Dependencies & Execution Order section
  - Summary table with metrics
- Updated tasks.jinja2 template to generate proper JSON structure
- Updated test fixtures to use new schema
- Bumped version to 0.2.0

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix bug in TaskBreakdown.to_markdown() that rendered tasks twice
- Add _deduplicate_tasks() and _deduplicate_phases() in TaskGenerator
- Add automatic duplicate detection in ConsistencyAnalyzer
- Add integration test for full artifact generation workflow
- Bump version to 0.2.1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Bump version from 0.2.1 to 0.2.2
- Add template improvements for plan, specification, and tasks
- Enhance core modules with additional functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Test language propagation through templates (specification, plan, tasks)
- Test language parameter handling in SpecificationBuilder, TechnicalPlanner, TaskGenerator
- Test SpecKit language config propagation
- Test edge cases (empty string, uppercase, etc.)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…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.
feat: add extended artifacts (data-model, research, contracts, checkl…
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>
@suportly suportly requested a review from localden as a code owner December 27, 2025 01:28
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