Skip to content

Commit ec2697b

Browse files
authored
chore: merge dev to main (v0.22.0) (#74)
* 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]> * feat: implement Phase 5.3 lock enforcement with E2E tests - Add lock enforcement to project import command - Implement check_sections_locked_for_persona() helper - Add comprehensive E2E integration tests (5 tests, all passing) - Fix Markdown parser to handle *(mandatory)* markers - Disable agile validation in test mode for simpler test scenarios - Add lock workflow documentation to agile-scrum-workflows guide - Add lock command documentation to command reference - Fix template path resolution for development and installed scenarios - Update version to 0.16.2 Phase 5.3 (Lock Enforcement) complete: - Lock/unlock commands working - Import operations respect locks - Persona validation against locks - Real-world scenarios tested and working * feat: Add contract verify command and improve mock server reliability (Phase 6.4) (#48) * feat: implement Phase 6 OpenAPI Contract Enforcement - Phase 6.1: Add contract index to manifest for fast lookup - Phase 6.2: Implement contract serve and test commands - contract serve: Launch Specmatic mock server for contract testing - contract test: Generate Specmatic test suites from contracts - Phase 6.3: SDD Integration (already complete) - plan harden extracts OpenAPI contracts automatically - enforce sdd validates OpenAPI coverage percentage - Add comprehensive integration tests (8 tests, all passing) - Update end user documentation with contract command reference - Update internal plans to mark Phase 6 as complete - Fix enum serialization in manifest save (use model_dump(mode='json')) All tests passing, coverage maintained at 80%+ * feat: add contract verify command and improve mock server reliability - Add contract verify command (Phase 6.4) - all-in-one verification workflow - Improve mock server process management with port polling and better error handling - Add automatic example generation from OpenAPI schema - Fix path handling issues in contract commands (relative_to errors) - Fix exit code handling in contract test command - Update documentation with simplified workflow guide - Add comprehensive integration tests (4 tests for contract verify) - Update UI/UX consistency across all contract commands Closes: Phase 6.4 Contract Verify implementation Version: 0.16.2 → 0.16.3 * sync version * Fix unit test * fix: reorder contract checks and mock Specmatic in tests - Move Specmatic availability check after contract validation in contract test command - This ensures 'no contract' errors are shown before Specmatic errors - Add mocks for Specmatic availability in verify command tests - Mock generate_specmatic_examples in verify tests to avoid async issues - All 3 previously failing tests now pass Fixes: - test_test_contract_no_contract: Now checks contract before Specmatic - test_verify_contract_skip_mock: Mocks Specmatic availability - test_verify_contract_all_contracts: Mocks Specmatic availability and example generation * applied format * fix: resolve type errors for optional output_dir parameter - Add check to set default output_dir if None before using it - Ensures output_dir is always Path type when calling relative_to() and path operations - Fixes basedpyright errors at lines 1174 and 1191 Fixes: - reportOptionalMemberAccess: 'relative_to' is not a known attribute of 'None' - reportOptionalOperand: Operator '/' not supported for 'None' --------- Co-authored-by: Dominikus Nold <[email protected]> * Adding project version commands * chore: release 0.17.0 with warn CI version check * chore: remove run command per bridge plan * Update changelog * test: add version command integration coverage * Update getting started syntax * docs: v0.18.0 - update README positioning, deprecation messaging - Add Current Version section clarifying 0.x = analysis/enforcement - Add AI IDE Bridge documentation with workflow examples - Update implement command docstrings with deprecation warnings - Bump version to 0.18.0 across all version files - Update CHANGELOG with v0.18.0 documentation changes * docs: add AI IDE bridge workflow to getting-started and docs index - Add gap analysis and fix-prompt workflow to first-steps.md - Add 'Using AI IDEs?' section to docs/README.md - Update primary goal messaging to 'analyze → find gaps → enforce' * feat: restore bridge commands (fix-prompt, test-prompt) from stash * test: v0.19.0 - add bridge command tests and migration guide - Add 6 integration tests for fix-prompt and test-prompt commands - Add migration guide for upgrading from v0.16.x to v0.19.x - Bump version to 0.19.0 across all version files - Update CHANGELOG with v0.19.0 test coverage improvements * Add fixes on formatting * docs: improve Jekyll GitHub Pages integration with navigation and styling - Add YAML front matter to all documentation pages for proper Jekyll rendering - Implement left-side navigation sidebar for better UX - Fix CSS styling issues (white-on-white text, code block backgrounds) - Add custom default layout with two-column docs layout - Configure proper permalinks for all documentation pages - Fix Rouge syntax highlighting for code blocks with light theme - Ensure proper CSS asset generation and loading - Add responsive design for mobile devices * chore: prepare v0.20.0 LTS release - Update version to 0.20.0 in pyproject.toml, setup.py, and all __init__.py files - Add comprehensive v0.20.0 LTS release notes to CHANGELOG.md - Add LTS designation to README.md - Update migration guide to v0.20.0 LTS - Mark v0.20.0 as Long-Term Stable release This release marks the stabilization of SpecFact CLI's core analysis and enforcement capabilities, positioning the tool for public promotion and early adopter usage. * fix: Add external repository support for repro command (v0.20.1) (#52) * fix: add external repository support for repro command (0.20.1) - Add environment manager detection (hatch, poetry, uv, pip) - Make all validation tools optional with clear messaging - Add dynamic source directory detection - Update documentation for external repo support - Add comprehensive test coverage (25 new tests) Fixes critical design issue where repro command only worked on SpecFact CLI's own codebase. Now works on external repositories without requiring SpecFact CLI adoption. Closes: External repository support issue Reference: CRITICAL_DESIGN_ISSUE_EXTERNAL_REPO_SUPPORT.md * fix: add external repository support for generate commands (0.20.1) - Fix generate contracts-apply: use dynamic source/test detection - Fix generate test-prompt: use dynamic source directory detection - Add test directory detection utilities (detect_test_directories, find_test_files_for_source) - Use environment detection for Python/pytest invocations - Add comprehensive tests (6 new tests for test detection utilities) Completes external repository support fixes identified in analysis. All generate commands now work on external repositories. * test: add comprehensive tests for repro setup and init environment warning - Add 15 integration tests for repro setup command covering: - pyproject.toml creation and updates with CrossHair config - Environment manager detection (hatch, poetry, uv, pip) - Source directory detection (src/, lib/, package name) - CrossHair tool availability checking and installation - Error handling and user guidance - Add 5 e2e tests for init command environment manager warning: - Warning display when no environment manager detected - No warning when hatch/poetry/pip/uv detected - Update CHANGELOG.md with new features and test coverage improvements All tests passing (20/20) * feat: align init --install-deps with environment manager detection - Update init --install-deps to use build_tool_command for environment-aware installation - Automatically detect and use hatch, poetry, uv, or pip based on project configuration - Show detected environment manager message and command being used - Provide environment-specific installation guidance on errors - Add 5-minute timeout for package installation - Track environment manager in telemetry - Update help text to reflect environment manager awareness - Update CHANGELOG.md with improvements This ensures consistent behavior with repro setup command and proper integration with different Python project management tools. --------- Co-authored-by: Dominikus Nold <[email protected]> * feat: add automatic GitHub release creation after PyPI publishing - Add generate-release-notes.sh script to extract release notes from CHANGELOG.md - Add create-github-release.sh script to create GitHub releases with release notes - Add create-release job to workflow that runs after successful PyPI publishing - Release is only created when: - PyPI publishing succeeds (published=true) - Push to main branch - Version is newer than PyPI version - Release notes are automatically extracted from CHANGELOG.md for the version - Release includes proper title and formatted release notes This automates the release process so that every successful PyPI publication automatically creates a corresponding GitHub release with release notes. * fix: sidecar template code quality improvements (v0.20.5) (#58) * fix: update sidecar templates and bump patch version * fix: sidecar template code quality improvements (v0.20.5) - Fixed formatting and linting issues in sidecar template files - Removed unused imports and whitespace issues - Combined nested if statements to reduce complexity (SIM102) - Replaced for loop with any() expression (SIM110) - Fixed exception chaining with proper 'from None' syntax - Updated version to 0.20.5 in all version files - Updated CHANGELOG.md with formatting fixes documentation --------- Co-authored-by: Dominikus Nold <[email protected]> * fix: PlanBundle schema hotpatch (v0.20.6) - Add automatic PlanBundle schema hotpatch fix in populate_contracts.py - Fix schema change detection to save modified schemas (not just additions) - Fix unbound variable error (original_schemas_str) with proper initialization - Resolve Specmatic contract validation failures via automatic schema correction - Update version to 0.20.6 * feat(sync): DevOps backlog tracking and OpenSpec bridge adapter integration (v0.21.0) (#66) * fix(sync): proposal filtering and source tracking improvements - Fix proposal filtering: public repos only sync 'applied' proposals - Fix source tracking metadata updates (sanitized flag always updated) - Fix duplicate source tracking blocks in proposal.md files - Fix variable redeclaration errors in bridge_sync.py - Fix GitHub adapter source tracking handling (list/dict format) - Update documentation with proposal filtering behavior - Update slash command prompt with filtering examples - Add CLI validation for sync bridge command Fixes issues where proposals with 'proposed' status were incorrectly synced to public repositories, and ensures source tracking metadata is always kept up-to-date during sync operations. * docs: update README files for v0.21.0 with OpenSpec integration - Remove v0.20.0 LTS references, update to v0.21.0 - Add OpenSpec bridge adapter integration information - Add DevOps backlog tracking capabilities to feature list - Update Spec-Kit comparison to include OpenSpec - Add bridge adapter integrations section with examples - Update documentation index with bridge adapters link Highlights OpenSpec integration support starting with v0.21.0, including DevOps backlog tracking and bridge adapter capabilities. --------- Co-authored-by: Dominikus Nold <[email protected]> * docs: enhance directory-structure.md with change tracking details and add integration tests (#68) * feat: implement add-code-change-tracking - code change detection and progress comments - Add code_change_detector utility for git commit detection - Extend GitHubAdapter with progress comment support - Integrate code change tracking into BridgeSync - Add --track-code-changes and --add-progress-comment CLI flags - Support sanitization for public repository comments * fix: combine nested if statements in code_change_detector and fix formatting - Combine nested if statements in format_progress_comment sanitization logic - Apply black formatting to bridge_sync.py - Fix linting errors (SIM102) * style: apply black formatting to bridge_sync.py * fix: ensure source_tracking is passed to adapter for progress comments - Explicitly include source_tracking_list in proposal_with_progress - Ensures adapter can extract issue number from source tracking * feat: add --code-repo parameter for separate source code repository - Add --code-repo CLI parameter to specify source code repository - Use code_repo_path for code change detection instead of OpenSpec repo - Enables code change tracking when OpenSpec and source repos differ * fix: add code_repo_path parameter to export_change_proposals_to_devops signature - Add code_repo_path parameter to method signature - Update docstring to document the new parameter - Fixes basedpyright type checking error * fix: use repo parameter instead of undefined resolved_repo - Fix undefined variable error in code_repo_path assignment - Use repo parameter which is already resolved * fix: resolve code_repo_path before use in export_change_proposals_to_devops - Move code_repo_path resolution to after resolved_repo is defined - Fixes undefined variable error * fix: define code_repo_path_resolved before use in export call - Move code_repo_path_resolved definition to before the export call - Ensures variable is in scope when used * fix: move code_repo_path_resolved definition to correct scope - Define code_repo_path_resolved after resolved_repo is defined - Use ternary operator as suggested by linter - Fixes scope and formatting errors * fix: remove duplicate code_repo_path_resolved definition - Remove duplicate definition that was in wrong scope - Use the definition after resolved_repo is defined (line 1141) * fix: define code_repo_path in correct scope for export call - Define code_repo_path_for_export inside the export block where resolved_repo is in scope - Remove duplicate definition that was in wrong location - Fixes unbound variable error * fix: define code_repo_path_for_export in correct scope - Define code_repo_path_for_export using repo.resolve() directly - Fixes undefined variable error at line 1008 - Variable is now defined before use in export_change_proposals_to_devops call * docs: enhance backlog export documentation with comprehensive guide - Add Quick Start section for immediate usage - Expand Code Change Detection section with detailed workflow - Add Integration Workflow section for developers - Add Troubleshooting section - Improve examples with separate repository scenarios - Clarify prerequisites for issue creation vs code tracking - Add verification steps with actual commands * docs: complete backlog export documentation with integration workflow - Update Code Change Detection section with Repository Selection step - Add detailed Prerequisites section (separate for issue creation vs tracking) - Add Integration Workflow section with step-by-step guide - Expand explanation of --code-repo parameter usage - Add comprehensive examples for different scenarios * docs: add DevOps adapter integration guide for backlog tracking - Create comprehensive guide for GitHub Issues integration - Cover issue creation, code change tracking, and progress comments - Document separate repository scenarios with --code-repo - Include content sanitization for public repositories - Add troubleshooting section and best practices - Update guides README to include new guide * docs: add DevOps adapter integration guide references to main README - Add link to DevOps adapter integration guide in Spec-Kit section - Add link in General Guides section - Update Spec-Kit integration path to include new guide * docs: update sync-backlog slash prompt for multi-repo change detection - Add --code-repo parameter documentation - Add --track-code-changes and --add-progress-comment parameters - Update workflow steps to include code change tracking - Add examples for separate OpenSpec and source code repositories - Update CLI command examples with new parameters - Add code change tracking results to output examples - Clarify repository selection logic for code change detection * docs: add OpenSpec integration journey guide - Create comprehensive journey guide similar to speckit-journey.md - Explain WHY OpenSpec and SpecFact complement each other - Add visual Mermaid diagrams showing integration flow - Mark implementation status (✅ implemented vs ⏳ planned) - Cover DevOps export (implemented) and bridge adapter (planned) - Include complete workflow examples - Update guides README and main docs README - Emphasize brownfield modernization use case * docs: add OpenSpec journey link to main README * docs: improve Mermaid diagram colors for better contrast - Use modern color palette with high contrast - OpenSpec: Blue (#3b82f6) with dark stroke for visibility - SpecFact: Orange (#f97316) with dark stroke for visibility - DevOps: Slate gray (#64748b) for neutral elements - Add white text color for better readability - Add stroke borders for better definition - Colors work well in both light and dark modes * docs: add color styling to sequence diagram in OpenSpec journey - Add colored rectangles to sequence diagram for visual distinction - OpenSpec: Blue background (#3b82f6) - SpecFact: Orange background (#f97316) - DevOps: Slate gray background (#64748b) - Improves readability and visual consistency across all diagrams * docs: update bidirectional sync visual flow diagram colors - Update Bidirectional Sync Visual Flow diagram with modern colors - OpenSpec: Blue (#3b82f6) with dark stroke - SpecFact: Orange (#f97316) with dark stroke - Add white text color for better readability - All Visual Flow diagrams now use consistent color scheme * docs: emphasize OpenSpec journey in README files - Add OpenSpec Journey to main callout link section - Add OpenSpec Journey as prominent START HERE in Spec-Kit/OpenSpec section - Mark OpenSpec Journey with ⭐ START HERE in guides README - Add OpenSpec Journey link in top-level 'Why SpecFact?' section - Position OpenSpec Journey alongside Spec-Kit Journey as equal partner - Highlight DevOps export (✅) and bridge adapter (⏳) status * docs: enhance directory-structure.md with change tracking details and add integration tests - Enhanced directory-structure.md with BundleManifest structure details - Added explicit documentation of optional change_tracking and change_archive fields (v1.1+) - Clarified that fields are loaded via bridge adapters, not stored in bundle directory - Added BundleManifest structure example with change tracking fields - Added comprehensive integration tests for code change tracking - Test end-to-end code change detection and comment addition - Test with real git repository - Test with mocked GitHub issues - Test idempotency (multiple syncs) - Updated README files to emphasize OpenSpec journey guide - Updated CHANGELOG.md with documentation and testing improvements * Update changelog --------- Co-authored-by: Dominikus Nold <[email protected]> * fix: add sudo to GitHub CLI installation in workflow - Fix permission denied error when installing GitHub CLI - Add sudo to apt commands and file operations requiring root access - Resolves 'tee: /etc/apt/sources.list.d/github-cli.list: Permission denied' error * fix: resolve merge conflict markers in README.md - Remove conflict markers from README.md - Keep restructured README content from main branch - Ensure clean merge state * feat: add .specify/specs/ detection and improve schema version handling (#73) * feat: add .specify/specs/ detection and improve schema version handling - Add support for canonical Spec-Kit layout (.specify/specs/) - Add BridgeConfig.preset_speckit_specify() for .specify/specs/ structure - Update detection priority: .specify/specs/ > docs/specs/ > specs/ (root) - Update SpecKitScanner to prioritize .specify/specs/ first - Maintain backward compatibility with root-level specs/ layouts - Improve schema version management for new bundles - Add get_latest_schema_version() function for semantic clarity - Add LATEST_SCHEMA_VERSION alias (currently "1.1") - Update import_cmd.py and sync.py to use get_latest_schema_version() - New bundles now automatically use latest schema version - Update CHANGELOG.md for version 0.22.0 - Fix linting issues (SIM102: combine nested if statements) * fix: detect Spec-Kit changes in .specify/specs/ layout - Update _detect_speckit_changes() to check all three layouts - Priority: .specify/specs/ (canonical) > docs/specs/ > specs/ (root) - Ensures changes in canonical layout are properly detected for sync/conflict detection - Matches generate_bridge_config() detection logic Fixes review finding: P1 Badge - Detect Spec-Kit changes in .specify/specs layout --------- Co-authored-by: Dominikus Nold <[email protected]> * fix: make constitution check adapter-specific (Spec-Kit only) - Constitution check now only applies to Spec-Kit adapter - OpenSpec sync no longer blocked by constitution requirement - OpenSpec adapter uses has_custom_hooks to indicate active changes, not constitution - Constitution validation and bootstrap only run for Spec-Kit Fixes review finding: P1 Badge - OpenSpec sync blocked by constitution check * fix: use detected adapter tool directly in auto-detect - Auto-detect now uses detected_capabilities.tool directly instead of hard-coding fallback to generic-markdown - OpenSpec and other registered adapters can now be auto-detected - Proper error handling for unknown tool detection - Fixes both sync and import commands Fixes review findings: - P1 Badge: Sync auto-detect never selects OpenSpec adapter - P1 Badge: Auto-detect falls back to unregistered adapter --------- Co-authored-by: Dominikus Nold <[email protected]>
1 parent 410d3b3 commit ec2697b

File tree

81 files changed

+8550
-2583
lines changed

Some content is hidden

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

81 files changed

+8550
-2583
lines changed

.cursor/commands/specfact.sync-backlog.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
2020

2121
### Target/Input
2222

23-
- `--repo PATH` - Path to repository. Default: current directory (.)
23+
- `--repo PATH` - Path to OpenSpec repository containing change proposals. Default: current directory (.)
24+
- `--code-repo PATH` - Path to source code repository for code change detection (default: same as `--repo`). **Required when OpenSpec repository differs from source code repository.** For example, if OpenSpec proposals are in `specfact-cli-internal` but source code is in `specfact-cli`, use `--repo /path/to/specfact-cli-internal --code-repo /path/to/specfact-cli`.
2425
- `--target-repo OWNER/REPO` - Target repository for issue creation (format: owner/repo). Default: same as code repository
2526

2627
### Behavior/Options
@@ -49,6 +50,18 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
4950
- `--tmp-file PATH` - Specify temporary file path (used with --export-to-tmp or --import-from-tmp)
5051
- Default: `/tmp/specfact-proposal-<change-id>.md` or `/tmp/specfact-proposal-<change-id>-sanitized.md`
5152

53+
### Code Change Tracking (Advanced)
54+
55+
- `--track-code-changes/--no-track-code-changes` - Detect code changes (git commits, file modifications) and add progress comments to existing issues (default: False)
56+
- **Repository Selection**: Uses `--code-repo` if provided, otherwise uses `--repo` for code change detection
57+
- **Git Commit Detection**: Searches git log for commits mentioning the change proposal ID (e.g., `add-code-change-tracking`)
58+
- **File Change Tracking**: Extracts files modified in detected commits
59+
- **Progress Comment Generation**: Formats comment with commit details and file changes
60+
- **Duplicate Prevention**: Checks against existing comments to avoid duplicates
61+
- **Source Tracking Update**: Updates `proposal.md` with progress metadata
62+
- `--add-progress-comment/--no-add-progress-comment` - Add manual progress comment to existing issues without code change detection (default: False)
63+
- `--update-existing/--no-update-existing` - Update existing issue bodies when proposal content changes (default: False for safety). Uses content hash to detect changes.
64+
5265
### Advanced/Configuration
5366

5467
- `--adapter TYPE` - DevOps adapter type (github, ado, linear, jira). Default: github
@@ -101,8 +114,10 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
101114
**For non-sanitized proposals** (direct export):
102115

103116
```bash
104-
specfact sync bridge --adapter github --mode export-only --repo <path> \
117+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
105118
--no-sanitize --change-ids <id1,id2> \
119+
[--code-repo <source-code-path>] \
120+
[--track-code-changes] [--add-progress-comment] \
106121
[--target-repo <owner/repo>] [--repo-owner <owner>] [--repo-name <name>] \
107122
[--github-token <token>] [--use-gh-cli]
108123
```
@@ -111,13 +126,16 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
111126

112127
```bash
113128
# Step 3a: Export to temporary file for LLM review
114-
specfact sync bridge --adapter github --mode export-only --repo <path> \
129+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
115130
--sanitize --change-ids <id1,id2> \
131+
[--code-repo <source-code-path>] \
116132
--export-to-tmp --tmp-file /tmp/specfact-proposal-<change-id>.md \
117133
[--target-repo <owner/repo>] [--repo-owner <owner>] [--repo-name <name>] \
118134
[--github-token <token>] [--use-gh-cli]
119135
```
120136

137+
**Note**: When `--code-repo` is provided, code change detection uses that repository. Otherwise, code changes are detected in the OpenSpec repository (`--repo`).
138+
121139
### Step 4: LLM Sanitization Review (Slash Command Only, For Sanitized Proposals)
122140

123141
**Only execute if sanitization is required**:
@@ -173,6 +191,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
173191
- Show issue URLs and numbers
174192
- Indicate sanitization status (if applied)
175193
- List which proposals were sanitized vs exported directly
194+
- **Show code change tracking results** (if `--track-code-changes` was enabled):
195+
- Number of commits detected
196+
- Number of progress comments added
197+
- Repository used for code change detection (`--code-repo` or `--repo`)
176198
- **Show filtering warnings** (if proposals were filtered out due to status)
177199
- Example: `⚠ Filtered out 2 proposal(s) with non-applied status (public repos only sync archived/completed proposals)`
178200
- Present any warnings or errors
@@ -223,8 +245,9 @@ When in copilot mode, follow this workflow:
223245

224246
```bash
225247
# For each sanitized proposal, export to temp file
226-
specfact sync bridge --adapter github --mode export-only --repo <path> \
248+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
227249
--change-ids <change-id> --export-to-tmp --tmp-file /tmp/specfact-proposal-<change-id>.md \
250+
[--code-repo <source-code-path>] \
228251
[other options]
229252
```
230253

@@ -293,8 +316,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
293316

294317
```bash
295318
# Export non-sanitized proposals directly
296-
specfact sync bridge --adapter github --mode export-only --repo <path> \
319+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
297320
--change-ids <id1,id2> --no-sanitize \
321+
[--code-repo <source-code-path>] \
322+
[--track-code-changes] [--add-progress-comment] \
298323
[other options]
299324
```
300325

@@ -310,8 +335,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
310335

311336
```bash
312337
# For each approved sanitized proposal, import from temp file and create issue
313-
specfact sync bridge --adapter github --mode export-only --repo <path> \
338+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
314339
--change-ids <change-id> --import-from-tmp --tmp-file /tmp/specfact-proposal-<change-id>-sanitized.md \
340+
[--code-repo <source-code-path>] \
341+
[--track-code-changes] [--add-progress-comment] \
315342
[other options]
316343
```
317344

@@ -337,6 +364,11 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
337364
- Display sync results (issues created/updated)
338365
- Show issue URLs and numbers
339366
- Indicate which proposals were sanitized vs exported directly
367+
- **Show code change tracking results** (if `--track-code-changes` was enabled):
368+
- Number of commits detected per proposal
369+
- Number of progress comments added per issue
370+
- Repository used for code change detection (`--code-repo` or `--repo`)
371+
- Example: `✓ Detected 3 commits for 'add-feature-x', added 1 progress comment to issue #123`
340372
- **Show filtering warnings** (if proposals were filtered out):
341373
- Public repos: `⚠ Filtered out N proposal(s) with non-applied status (public repos only sync archived/completed proposals)`
342374
- Internal repos: `⚠ Filtered out N proposal(s) without source tracking entry and inactive status`
@@ -353,6 +385,7 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
353385
354386
Adapter: github
355387
Repository: nold-ai/specfact-cli-internal
388+
Code Repository: nold-ai/specfact-cli (separate repo)
356389
357390
Issues Created:
358391
- #14: Add DevOps Backlog Tracking Integration
@@ -363,6 +396,31 @@ Sanitization: Applied (different repos detected)
363396
Issue IDs saved to OpenSpec proposal files
364397
```
365398

399+
### Success (With Code Change Tracking)
400+
401+
```text
402+
✓ Successfully synced 3 change proposals
403+
404+
Adapter: github
405+
Repository: nold-ai/specfact-cli-internal
406+
Code Repository: nold-ai/specfact-cli (separate repo)
407+
408+
Issues Created:
409+
- #14: Add DevOps Backlog Tracking Integration
410+
- #15: Add Change Tracking Data Model
411+
- #16: Implement OpenSpec Bridge Adapter
412+
413+
Code Change Tracking:
414+
- Detected 5 commits for 'add-devops-backlog-tracking'
415+
- Added 1 progress comment to issue #14
416+
- Detected 3 commits for 'add-change-tracking-datamodel'
417+
- Added 1 progress comment to issue #15
418+
- No new commits detected for 'implement-openspec-bridge-adapter'
419+
420+
Sanitization: Applied (different repos detected)
421+
Issue IDs saved to OpenSpec proposal files
422+
```
423+
366424
### Error (Missing Token)
367425

368426
```text

.github/prompts/specfact.sync-backlog.prompt.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
2020

2121
### Target/Input
2222

23-
- `--repo PATH` - Path to repository. Default: current directory (.)
23+
- `--repo PATH` - Path to OpenSpec repository containing change proposals. Default: current directory (.)
24+
- `--code-repo PATH` - Path to source code repository for code change detection (default: same as `--repo`). **Required when OpenSpec repository differs from source code repository.** For example, if OpenSpec proposals are in `specfact-cli-internal` but source code is in `specfact-cli`, use `--repo /path/to/specfact-cli-internal --code-repo /path/to/specfact-cli`.
2425
- `--target-repo OWNER/REPO` - Target repository for issue creation (format: owner/repo). Default: same as code repository
2526

2627
### Behavior/Options
@@ -49,6 +50,18 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
4950
- `--tmp-file PATH` - Specify temporary file path (used with --export-to-tmp or --import-from-tmp)
5051
- Default: `/tmp/specfact-proposal-<change-id>.md` or `/tmp/specfact-proposal-<change-id>-sanitized.md`
5152

53+
### Code Change Tracking (Advanced)
54+
55+
- `--track-code-changes/--no-track-code-changes` - Detect code changes (git commits, file modifications) and add progress comments to existing issues (default: False)
56+
- **Repository Selection**: Uses `--code-repo` if provided, otherwise uses `--repo` for code change detection
57+
- **Git Commit Detection**: Searches git log for commits mentioning the change proposal ID (e.g., `add-code-change-tracking`)
58+
- **File Change Tracking**: Extracts files modified in detected commits
59+
- **Progress Comment Generation**: Formats comment with commit details and file changes
60+
- **Duplicate Prevention**: Checks against existing comments to avoid duplicates
61+
- **Source Tracking Update**: Updates `proposal.md` with progress metadata
62+
- `--add-progress-comment/--no-add-progress-comment` - Add manual progress comment to existing issues without code change detection (default: False)
63+
- `--update-existing/--no-update-existing` - Update existing issue bodies when proposal content changes (default: False for safety). Uses content hash to detect changes.
64+
5265
### Advanced/Configuration
5366

5467
- `--adapter TYPE` - DevOps adapter type (github, ado, linear, jira). Default: github
@@ -101,8 +114,10 @@ Sync OpenSpec change proposals to DevOps backlog tools (GitHub Issues, ADO, Line
101114
**For non-sanitized proposals** (direct export):
102115

103116
```bash
104-
specfact sync bridge --adapter github --mode export-only --repo <path> \
117+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
105118
--no-sanitize --change-ids <id1,id2> \
119+
[--code-repo <source-code-path>] \
120+
[--track-code-changes] [--add-progress-comment] \
106121
[--target-repo <owner/repo>] [--repo-owner <owner>] [--repo-name <name>] \
107122
[--github-token <token>] [--use-gh-cli]
108123
```
@@ -111,13 +126,16 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
111126

112127
```bash
113128
# Step 3a: Export to temporary file for LLM review
114-
specfact sync bridge --adapter github --mode export-only --repo <path> \
129+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
115130
--sanitize --change-ids <id1,id2> \
131+
[--code-repo <source-code-path>] \
116132
--export-to-tmp --tmp-file /tmp/specfact-proposal-<change-id>.md \
117133
[--target-repo <owner/repo>] [--repo-owner <owner>] [--repo-name <name>] \
118134
[--github-token <token>] [--use-gh-cli]
119135
```
120136

137+
**Note**: When `--code-repo` is provided, code change detection uses that repository. Otherwise, code changes are detected in the OpenSpec repository (`--repo`).
138+
121139
### Step 4: LLM Sanitization Review (Slash Command Only, For Sanitized Proposals)
122140

123141
**Only execute if sanitization is required**:
@@ -173,6 +191,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
173191
- Show issue URLs and numbers
174192
- Indicate sanitization status (if applied)
175193
- List which proposals were sanitized vs exported directly
194+
- **Show code change tracking results** (if `--track-code-changes` was enabled):
195+
- Number of commits detected
196+
- Number of progress comments added
197+
- Repository used for code change detection (`--code-repo` or `--repo`)
176198
- **Show filtering warnings** (if proposals were filtered out due to status)
177199
- Example: `⚠ Filtered out 2 proposal(s) with non-applied status (public repos only sync archived/completed proposals)`
178200
- Present any warnings or errors
@@ -223,8 +245,9 @@ When in copilot mode, follow this workflow:
223245

224246
```bash
225247
# For each sanitized proposal, export to temp file
226-
specfact sync bridge --adapter github --mode export-only --repo <path> \
248+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
227249
--change-ids <change-id> --export-to-tmp --tmp-file /tmp/specfact-proposal-<change-id>.md \
250+
[--code-repo <source-code-path>] \
228251
[other options]
229252
```
230253

@@ -293,8 +316,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
293316

294317
```bash
295318
# Export non-sanitized proposals directly
296-
specfact sync bridge --adapter github --mode export-only --repo <path> \
319+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
297320
--change-ids <id1,id2> --no-sanitize \
321+
[--code-repo <source-code-path>] \
322+
[--track-code-changes] [--add-progress-comment] \
298323
[other options]
299324
```
300325

@@ -310,8 +335,10 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
310335

311336
```bash
312337
# For each approved sanitized proposal, import from temp file and create issue
313-
specfact sync bridge --adapter github --mode export-only --repo <path> \
338+
specfact sync bridge --adapter github --mode export-only --repo <openspec-path> \
314339
--change-ids <change-id> --import-from-tmp --tmp-file /tmp/specfact-proposal-<change-id>-sanitized.md \
340+
[--code-repo <source-code-path>] \
341+
[--track-code-changes] [--add-progress-comment] \
315342
[other options]
316343
```
317344

@@ -337,6 +364,11 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
337364
- Display sync results (issues created/updated)
338365
- Show issue URLs and numbers
339366
- Indicate which proposals were sanitized vs exported directly
367+
- **Show code change tracking results** (if `--track-code-changes` was enabled):
368+
- Number of commits detected per proposal
369+
- Number of progress comments added per issue
370+
- Repository used for code change detection (`--code-repo` or `--repo`)
371+
- Example: `✓ Detected 3 commits for 'add-feature-x', added 1 progress comment to issue #123`
340372
- **Show filtering warnings** (if proposals were filtered out):
341373
- Public repos: `⚠ Filtered out N proposal(s) with non-applied status (public repos only sync archived/completed proposals)`
342374
- Internal repos: `⚠ Filtered out N proposal(s) without source tracking entry and inactive status`
@@ -353,6 +385,7 @@ specfact sync bridge --adapter github --mode export-only --repo <path> \
353385
354386
Adapter: github
355387
Repository: nold-ai/specfact-cli-internal
388+
Code Repository: nold-ai/specfact-cli (separate repo)
356389
357390
Issues Created:
358391
- #14: Add DevOps Backlog Tracking Integration
@@ -363,6 +396,31 @@ Sanitization: Applied (different repos detected)
363396
Issue IDs saved to OpenSpec proposal files
364397
```
365398

399+
### Success (With Code Change Tracking)
400+
401+
```text
402+
✓ Successfully synced 3 change proposals
403+
404+
Adapter: github
405+
Repository: nold-ai/specfact-cli-internal
406+
Code Repository: nold-ai/specfact-cli (separate repo)
407+
408+
Issues Created:
409+
- #14: Add DevOps Backlog Tracking Integration
410+
- #15: Add Change Tracking Data Model
411+
- #16: Implement OpenSpec Bridge Adapter
412+
413+
Code Change Tracking:
414+
- Detected 5 commits for 'add-devops-backlog-tracking'
415+
- Added 1 progress comment to issue #14
416+
- Detected 3 commits for 'add-change-tracking-datamodel'
417+
- Added 1 progress comment to issue #15
418+
- No new commits detected for 'implement-openspec-bridge-adapter'
419+
420+
Sanitization: Applied (different repos detected)
421+
Issue IDs saved to OpenSpec proposal files
422+
```
423+
366424
### Error (Missing Token)
367425

368426
```text

0 commit comments

Comments
 (0)