Skip to content

Commit 8d2aab1

Browse files
authored
Release v0.16.1 - Persona Workflows & Type Checking Fixes (#47)
* feat: v0.13.2 - Add --install-deps option and enhance contract workflow (#42) * feat: AI IDE contract enhancement workflow and critical bug fixes (v0.13.0) - Added generate contracts-prompt command for AI IDE integration - Added generate contracts-apply with comprehensive 6-step validation - Fixed AttributeError in sync.py, import_cmd.py, enforce.py (71 test failures resolved) - Renamed --apply all to --apply all-contracts for clarity - Bundle-specific prompt storage (.specfact/projects/<bundle>/prompts/) - Enhanced error messages and validation feedback - Updated documentation (commands, directory structure, IDE integration) - Updated internal implementation plans Version bump: 0.12.1 → 0.13.0 * feat: v0.13.2 - Add --install-deps option and enhance contract workflow - Add specfact init --install-deps option for streamlined setup - Enhance contracts-apply with automatic code quality checks - Optimize test execution in contracts-apply (scoped pytest runs) - Strengthen LLM abort conditions in generated prompts - Clarify contract application requirements (ALL eligible functions) - Update documentation for new features - Bump version to 0.13.2 and sync across all files * fix: v0.13.3 - Improve data model detection in contract analysis - Fix false positives for Pydantic data model files - Properly distinguish between class methods and module-level functions - Add support for common helper methods (compute_summary, update_summary, etc.) - Increase E2E test timeouts from 5s to 20s for slow tests - Files like models/plan.py and models/protocol.py now correctly identified as data models * feat: Add /specfact.07-contracts slash command for contract enhancement workflow - New sequential workflow: analyze contracts → generate prompts → apply contracts - Processes files one at a time for careful review - Supports user selection of files to enhance - Includes validation and confirmation steps - Updated documentation with new slash command * docs: Update prompt validation checklist with specfact.07-contracts * docs: Update prompt validation checklist to match actual prompt structure - Updated required sections to match actual format: - User Input (with ) - Purpose - Parameters (organized by groups) - Workflow - CLI Enforcement - Expected Output - Common Patterns - Context (with {ARGS}) - Removed outdated sections (CRITICAL, Wait States, Goal, Operating Constraints) - Updated wait state validation to reflect actual structure * fix: Update prompt validation tool to match actual prompt structure - Updated required sections to match actual format: - User Input, Purpose, Parameters, Workflow, CLI Enforcement, Expected Output, Common Patterns, Context - Removed outdated sections (CRITICAL, Wait States, Goal, Operating Constraints) - Made CLI enforcement rule matching flexible (multiple variants) - Updated dual-stack workflow markers to be flexible - Added specfact.07-contracts to CLI_COMMANDS mapping - Updated wait state validation to check for User Input section and - All 9 prompts now pass validation * fix: Resolve prompt validation warnings - Added 'Use CLI output as grounding' to specfact.07-contracts.md - Added explicit CLI enforcement rules to specfact.validate.md - Added enrichment report location to specfact.01-import.md workflow - All 9 prompts now pass validation with 0 errors and 0 warnings * Update prompts and validation * feat: Include specfact.07-contracts in init command - Added specfact.07-contracts to SPECFACT_COMMANDS list in ide_setup.py - Updated VS Code settings example in ide-integration.md to include new prompt - New contract enhancement workflow prompt will now be copied during init * Fix ruff linter errors * fix: Update test_validate_structure to match new prompt structure - Updated test to use new required sections (User Input, Purpose, Parameters, Workflow, CLI Enforcement, Expected Output, Common Patterns, Context) - Test now matches actual prompt structure used in resources/prompts/ - All prompt validation tests passing * Add missing contracts to analyze agent2 --------- Co-authored-by: Dominikus Nold <[email protected]> * feat: implement Phase 4.11 Dual-Stack Enrichment Pattern (#43) - Add dual-stack workflow documentation to all 10 prompt templates - Enhance CLI enforcement rules with CLI vs LLM capabilities - Create validation utilities (cli_first_validator.py) with 4 functions - Add comprehensive tests (23 test cases, all passing) - Create end-user guide (docs/guides/dual-stack-enrichment.md) - Create technical specification (docs/technical/dual-stack-pattern.md) - Fix test timeouts for 12 integration/e2e tests (add @pytest.mark.timeout(20)) - Update .cursor/commands/ prompts with dual-stack pattern Implements: - CLI-first principle enforcement - Standard validation loop pattern documentation - Three-phase workflow (CLI Grounding → LLM Enrichment → CLI Artifact Creation) - .specfact/ folder protection validation - Format consistency validation All success criteria met for Phase 4.11. Future enhancements (metadata injection, code generation workflow, plan enrichment workflow) are deferred to future phases. Closes: Phase 4.11 implementation Co-authored-by: Dominikus Nold <[email protected]> * feat: Phase 4.9 (Quick Start) and Phase 4.10 (CI Performance) Optimization (#44) * feat: implement Phase 4.9 (Quick Start) and Phase 4.10 (CI Performance) - Phase 4.9: Quick Start Optimization - Add incremental results callback to CodeAnalyzer for real-time feature discovery - Implement _suggest_next_steps() function with contextual next commands - Add early feedback mechanism showing first value within < 60 seconds - Enhance progress indicators with incremental updates every 5 features - Create comprehensive e2e tests (6 tests, all passing) - Phase 4.10: CI Performance Optimization - Create performance monitoring utility (src/specfact_cli/utils/performance.py) - Integrate performance tracking into import command with threshold-based detection - Add performance report display (non-CI mode only) for interactive feedback - Track all major operations: analyze_codebase, extract_relationships, etc. - Create comprehensive unit tests (8 tests, all passing) - Create comprehensive e2e tests (6 tests, all passing) Files: - src/specfact_cli/analyzers/code_analyzer.py - Added incremental callback support - src/specfact_cli/commands/import_cmd.py - Added next steps suggestions and performance tracking - src/specfact_cli/utils/performance.py - New performance monitoring utility - tests/unit/utils/test_performance.py - Unit tests (8 tests) - tests/e2e/test_quick_start_performance_e2e.py - E2E tests (6 tests) All tests passing. Documentation updated in internal repo. * chore: bump version to 0.14.0 and update changelog - Bump version from 0.13.3 to 0.14.0 (minor version for new features) - Sync version across pyproject.toml, src/__init__.py, and src/specfact_cli/__init__.py - Add comprehensive changelog entry for Phase 4.9 and 4.10 features --------- Co-authored-by: Dominikus Nold <[email protected]> * feat: Natural UX Flow - Phases 4.1-4.5 Complete (#45) * feat: implement Phases 4.1-4.5 - Natural UX Flow enhancements - Phase 4.1: Context Detection System - Auto-detect project type, language, framework, specs, and configuration - Smart defaults based on detected context - Comprehensive test coverage (8 unit + 3 E2E tests) - Phase 4.2: Progressive Disclosure - Hide advanced options by default - Reveal via --help-advanced flag - Custom ProgressiveDisclosureGroup for Typer - Test coverage (6 unit + 2 E2E tests) - Phase 4.3: Intelligent Suggestions & Template-Driven Quality - Context-aware command suggestions - Error-specific fix suggestions - Template system for specification quality - Feature, implementation plan, and contract extraction templates - Test coverage (10 unit + 6 E2E tests) - Phase 4.4: Enhanced Watch Mode - Hash-based change detection (SHA256) - Dependency tracking for incremental processing - LZ4 compression for cache (optional) - Persistent hash cache across sessions - Test coverage (9 unit + 2 E2E tests) - Phase 4.5: Unified Progress Display - Verified consistent n/m format across all commands - Rich Progress integration with timing information - Documentation Updates - New UX Features guide (guides/ux-features.md) - Updated command reference with --help-advanced - Updated workflows guide with watch mode enhancements - Updated first-steps guide with context detection info - Plan Status Updates - Marked Phases 4.1-4.5 as COMPLETE in internal plan - Updated progress percentages and status All tests passing (228 total, 61 new tests for these phases) * chore: bump version to 0.14.1 - Natural UX Flow Phases 4.1-4.5 - Phase 4.1: Context Detection System - Phase 4.2: Progressive Disclosure (--help-advanced) - Phase 4.3: Intelligent Suggestions & Template-Driven Quality - Phase 4.4: Enhanced Watch Mode (hash-based detection) - Phase 4.5: Unified Progress Display Added comprehensive documentation and 61 new tests (all passing) * chore: bump version to 0.14.2 - Update version in src/__init__.py, pyproject.toml, setup.py - Add changelog entry for 0.14.2 - Document Phase 4.2 Progressive Disclosure final implementation - Fix internal plan status inconsistencies and improve readability --------- Co-authored-by: Dominikus Nold <[email protected]> * chore: bump version to 0.15.0 - Phase 8.5: Bundle-Specific Artifact Organization completed - Fixed atomic bundle saves to preserve reports/ and logs/ directories - Removed legacy directories (plans/, gates/results/) from ensure_structure() - Migrated active bundle config to global config.yaml - Removed GWT patterns from ControlFlowAnalyzer - Added comprehensive tests for ControlFlowAnalyzer - Updated all documentation to reflect bundle-specific artifact organization - Fixed integration tests for new directory structure - Fixed progress bar UI in import from-code command BREAKING CHANGE: Report paths, SDD manifests, and task files now use bundle-specific locations * fix: remove duplicate 'First value' and 'Themes detected' messages from import command - Removed intermediate console.print messages that duplicated progress bar information - Progress bar already shows feature count in description - Final summary provides complete information (features, themes, stories) - Cleaner output without redundant messages * Fix formatting * fix: recognize simplified acceptance criteria format and add --output-questions option - Fixed ambiguity scanner to recognize simplified format (e.g., 'Must verify X works correctly (see contract examples)') as valid - Added --output-questions option to save questions directly to file, avoiding complex JSON parsing - Enhanced CLI enforcement warnings in prompt documentation - Updated version to 0.15.1 * Improve review prompt, add cleanup script * fix(plan): integrate INTERACTION_UX answers and improve coverage display - Add INTERACTION_UX category to integration logic in _integrate_clarification - Fix unclear findings count to accurately reflect findings that can generate questions - Improve coverage summary display: show '143 Partial' when all unclear, '5/143 Partial' when partially clarified - Fix format errors: remove unused question_id variable assignments - Bump version to 0.15.5 * chore: add findings.json to .gitignore * feat: Project Bundle Phase 5-6 - Persona Workflows & OpenAPI Enforcement (v0.16.1) (#46) * chore: bump version to 0.16.0 - Fixed contract generation path resolution for bundle-specific locations - Improved error handling for invalid personas with --list-personas flag - Fixed sdd_path possibly unbound errors in generate command - Enhanced persona workflow UX with optional --persona and better error messages - Fixed SDD discovery to correctly identify bundle-specific SDDs - Fixed contract generator logic errors - Updated all tests to use bundle-specific paths - Added comprehensive changelog entry for v0.16.0 * feat: complete Phase 5.1.6 - Developer & Architect template enhancements (v0.16.1) - Enhanced Developer template with task breakdown, technical design, code mappings, sprint context, and Definition of Done - Enhanced Architect template with architectural decisions, NFRs, protocols/state machines, contracts, risk assessment, and deployment architecture - Fixed Markdown linting issues (MD012, MD024, MD036) in persona templates - Fixed data model alignment issues in persona exporter (feature.constraints handling) - Enhanced context preparation to include protocols and contracts from bundle directory - Updated documentation to emphasize persona-based workflows and agile team integration - Added comprehensive Agile/Scrum Workflows guide - Added project export/import command documentation - Updated READMEs to position SpecFact as team collaboration tool for agile/scrum teams - Bumped version to 0.16.1 and updated CHANGELOG All three persona templates (Product Owner, Developer, Architect) are now production-ready and aligned with real-world agile/scrum expectations. * Add defaults for linter --------- Co-authored-by: Dominikus Nold <[email protected]> --------- Co-authored-by: Dominikus Nold <[email protected]>
1 parent d89daec commit 8d2aab1

File tree

167 files changed

+25218
-1402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+25218
-1402
lines changed

.cursor/commands/specfact.01-import.md

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,86 @@ Import codebase → plan bundle. CLI extracts routes/schemas/relationships/contr
1616

1717
**Target/Input**: `--bundle NAME` (optional, defaults to active plan), `--repo PATH`, `--entry-point PATH`, `--enrichment PATH`
1818
**Output/Results**: `--report PATH`
19-
**Behavior/Options**: `--shadow-only`, `--enrich-for-speckit`
19+
**Behavior/Options**: `--shadow-only`, `--enrich-for-speckit/--no-enrich-for-speckit` (default: enabled, uses PlanEnricher for consistent enrichment)
2020
**Advanced/Configuration**: `--confidence FLOAT` (0.0-1.0), `--key-format FORMAT` (classname|sequential)
2121

2222
## Workflow
2323

2424
1. **Execute CLI**: `specfact import from-code [<bundle>] --repo <path> [options]`
2525
- CLI extracts: routes (FastAPI/Flask/Django), schemas (Pydantic), relationships, contracts (OpenAPI scaffolds), source tracking
2626
- Uses active plan if bundle not specified
27+
- **Auto-enrichment enabled by default**: Automatically enhances vague acceptance criteria, incomplete requirements, and generic tasks using PlanEnricher (same logic as `plan review --auto-enrich`)
28+
- Use `--no-enrich-for-speckit` to disable auto-enrichment
2729

2830
2. **LLM Enrichment** (if `--enrichment` provided):
2931
- Read `.specfact/projects/<bundle>/enrichment_context.md`
3032
- Enrich: business context, "why" reasoning, missing acceptance criteria
3133
- Validate: contracts vs code, feature/story alignment
34+
- Save enrichment report to `.specfact/projects/<bundle-name>/reports/enrichment/` (bundle-specific, Phase 8.5, if created)
3235

3336
3. **Present**: Bundle location, report path, summary (features/stories/contracts/relationships)
3437

3538
## CLI Enforcement
3639

37-
**ALWAYS execute CLI first**. Never modify `.specfact/` directly. Use CLI output as grounding.
40+
**CRITICAL**: Always use SpecFact CLI commands. See [CLI Enforcement Rules](./shared/cli-enforcement.md) for details.
41+
42+
**Rules:**
43+
44+
- Execute CLI first - never create artifacts directly
45+
- Use `--no-interactive` flag in CI/CD environments
46+
- Never modify `.specfact/` directly
47+
- Use CLI output as grounding for validation
48+
- Code generation requires LLM (only via AI IDE slash prompts, not CLI-only)
49+
50+
## Dual-Stack Workflow (Copilot Mode)
51+
52+
When in copilot mode, follow this three-phase workflow:
53+
54+
### Phase 1: CLI Grounding (REQUIRED)
55+
56+
```bash
57+
# Execute CLI to get structured output
58+
specfact import from-code [<bundle>] --repo <path> --no-interactive
59+
```
60+
61+
**Capture**:
62+
63+
- CLI-generated artifacts (plan bundles, reports)
64+
- Metadata (timestamps, confidence scores)
65+
- Telemetry (execution time, file counts)
66+
67+
### Phase 2: LLM Enrichment (OPTIONAL, Copilot Only)
68+
69+
**Purpose**: Add semantic understanding to CLI output
70+
71+
**What to do**:
72+
73+
- Read CLI-generated artifacts (use file reading tools for display only)
74+
- Research codebase for additional context
75+
- Identify missing features/stories
76+
- Suggest confidence adjustments
77+
- Extract business context
78+
79+
**What NOT to do**:
80+
81+
- ❌ Create YAML/JSON artifacts directly
82+
- ❌ Modify CLI artifacts directly (use CLI commands to update)
83+
- ❌ Bypass CLI validation
84+
- ❌ Write to `.specfact/` folder directly (always use CLI)
85+
- ❌ Use direct file manipulation tools for writing (use CLI commands)
86+
87+
**Output**: Generate enrichment report (Markdown) saved to `.specfact/projects/<bundle-name>/reports/enrichment/` (bundle-specific, Phase 8.5)
88+
89+
### Phase 3: CLI Artifact Creation (REQUIRED)
90+
91+
```bash
92+
# Use enrichment to update plan via CLI
93+
specfact import from-code [<bundle>] --repo <path> --enrichment <enrichment-report> --no-interactive
94+
```
95+
96+
**Result**: Final artifacts are CLI-generated with validated enrichments
97+
98+
**Note**: If code generation is needed, use the validation loop pattern (see [CLI Enforcement Rules](./shared/cli-enforcement.md#standard-validation-loop-pattern-for-llm-generated-code))
3899

39100
## Expected Output
40101

@@ -44,8 +105,9 @@ Import codebase → plan bundle. CLI extracts routes/schemas/relationships/contr
44105
## Common Patterns
45106

46107
```bash
47-
/specfact.01-import --repo . # Uses active plan
48-
/specfact.01-import --bundle legacy-api --repo .
108+
/specfact.01-import --repo . # Uses active plan, auto-enrichment enabled by default
109+
/specfact.01-import --bundle legacy-api --repo . # Auto-enrichment enabled
110+
/specfact.01-import --repo . --no-enrich-for-speckit # Disable auto-enrichment
49111
/specfact.01-import --repo . --entry-point src/auth/
50112
/specfact.01-import --repo . --enrichment report.md
51113
```

.cursor/commands/specfact.02-plan.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,65 @@ specfact plan update-story [--bundle <name>] --feature <feature-key> --key <stor
7171

7272
**CRITICAL**: Always use SpecFact CLI commands. See [CLI Enforcement Rules](./shared/cli-enforcement.md) for details.
7373

74-
**Rules:** Execute CLI first, use `--no-interactive` in CI/CD, never modify `.specfact/` directly, use CLI output as grounding.
74+
**Rules:**
75+
76+
- Execute CLI first - never create artifacts directly
77+
- Use `--no-interactive` flag in CI/CD environments
78+
- Never modify `.specfact/` directly
79+
- Use CLI output as grounding for validation
80+
- Code generation requires LLM (only via AI IDE slash prompts, not CLI-only)
81+
82+
## Dual-Stack Workflow (Copilot Mode)
83+
84+
When in copilot mode, follow this three-phase workflow:
85+
86+
### Phase 1: CLI Grounding (REQUIRED)
87+
88+
```bash
89+
# Execute CLI to get structured output
90+
specfact plan <operation> [--bundle <name>] [options] --no-interactive
91+
```
92+
93+
**Capture**:
94+
95+
- CLI-generated artifacts (plan bundles, features, stories)
96+
- Metadata (timestamps, confidence scores)
97+
- Telemetry (execution time, file counts)
98+
99+
### Phase 2: LLM Enrichment (OPTIONAL, Copilot Only)
100+
101+
**Purpose**: Add semantic understanding to CLI output
102+
103+
**What to do**:
104+
105+
- Read CLI-generated artifacts (use file reading tools for display only)
106+
- Research codebase for additional context
107+
- Identify missing features/stories
108+
- Suggest confidence adjustments
109+
- Extract business context
110+
111+
**What NOT to do**:
112+
113+
- ❌ Create YAML/JSON artifacts directly
114+
- ❌ Modify CLI artifacts directly (use CLI commands to update)
115+
- ❌ Bypass CLI validation
116+
- ❌ Write to `.specfact/` folder directly (always use CLI)
117+
- ❌ Use direct file manipulation tools for writing (use CLI commands)
118+
119+
**Output**: Generate enrichment report (Markdown) or use `--batch-updates` JSON/YAML file
120+
121+
### Phase 3: CLI Artifact Creation (REQUIRED)
122+
123+
```bash
124+
# Use enrichment to update plan via CLI
125+
specfact plan update-feature [--bundle <name>] --key <key> [options] --no-interactive
126+
# Or use batch updates:
127+
specfact plan update-feature [--bundle <name>] --batch-updates <updates.json> --no-interactive
128+
```
129+
130+
**Result**: Final artifacts are CLI-generated with validated enrichments
131+
132+
**Note**: If code generation is needed, use the validation loop pattern (see [CLI Enforcement Rules](./shared/cli-enforcement.md#standard-validation-loop-pattern-for-llm-generated-code))
75133

76134
## Expected Output
77135

0 commit comments

Comments
 (0)