Troubleshooting
Common issues and solutions for SpecFact CLI.
Installation Issues
Command Not Found
Issue: specfact: command not found
Solutions:
-
Check installation:
pip show specfact-cli -
Reinstall:
pip install --upgrade specfact-cli
Plan Select Command is Slow
Symptom: specfact plan select takes a long time (5+ seconds) to list plans.
Cause: Plan bundles may be missing summary metadata (older schema version 1.0).
Solution:
# Upgrade all plan bundles to latest schema (adds summary metadata)
specfact plan upgrade --all
# Verify upgrade worked
specfact plan select --last 5
Performance Improvement: After upgrade, plan select is 44% faster (3.6s vs 6.5s) and scales better with large plan bundles.
-
Use uvx (no installation needed):
uvx specfact-cli@latest --help
Permission Denied
Issue: Permission denied when running commands
Solutions:
-
Use user install:
pip install --user specfact-cli -
Check PATH:
echo $PATH # Should include ~/.local/bin -
Add to PATH:
export PATH="$HOME/.local/bin:$PATH"
Import Issues
Spec-Kit Not Detected
Issue: No Spec-Kit project found when running import from-bridge --adapter speckit
Solutions:
-
Check directory structure:
ls -la .specify/ ls -la specs/ -
Verify Spec-Kit format:
- Should have
.specify/directory - Should have
specs/directory with feature folders - Should have
specs/[###-feature-name]/spec.mdfiles
- Should have
-
Use explicit path:
specfact import from-bridge --adapter speckit --repo /path/to/speckit-project
Code Analysis Fails (Brownfield) ⭐
Issue: Analysis failed or No features detected when analyzing legacy code
Solutions:
-
Check repository path:
specfact import from-code --bundle legacy-api --repo . --verbose -
Lower confidence threshold (for legacy code with less structure):
specfact import from-code --bundle legacy-api --repo . --confidence 0.3 -
Check file structure:
find . -name "*.py" -type f | head -10 -
Use CoPilot mode (recommended for brownfield - better semantic understanding):
specfact --mode copilot import from-code --bundle legacy-api --repo . --confidence 0.7 -
For legacy codebases, start with minimal confidence and review extracted features:
specfact import from-code --bundle legacy-api --repo . --confidence 0.2
Sync Issues
Watch Mode Not Starting
Issue: Watch mode exits immediately or doesn’t detect changes
Solutions:
-
Check repository path:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --watch --interval 5 --verbose -
Verify directory exists:
ls -la .specify/ ls -la .specfact/ -
Check permissions:
ls -la .specfact/projects/ -
Try one-time sync first:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --bidirectional
Bidirectional Sync Conflicts
Issue: Conflicts during bidirectional sync
Solutions:
-
Check conflict resolution:
- SpecFact takes priority by default
- Manual resolution may be needed
-
Review changes:
git status git diff -
Use one-way sync:
# Spec-Kit → SpecFact only specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . # SpecFact → Spec-Kit only (manual) # Edit Spec-Kit files manually
Enforcement Issues
Enforcement Not Working
Issue: Violations not being blocked or warned
Solutions:
-
Check enforcement configuration (use CLI commands):
specfact enforce show-config -
Verify enforcement mode:
specfact enforce stage --preset balanced -
Run validation:
specfact repro --verbose -
Check severity levels:
- HIGH → BLOCK (in balanced/strict mode)
- MEDIUM → WARN (in balanced/strict mode)
- LOW → LOG (in all modes)
False Positives
Issue: Valid code being flagged as violations
Solutions:
-
Review violation details:
specfact repro --verbose -
Adjust confidence threshold:
specfact import from-code --bundle legacy-api --repo . --confidence 0.7 -
Check enforcement rules (use CLI commands):
specfact enforce show-config -
Use minimal mode (observe only):
specfact enforce stage --preset minimal
Constitution Issues
Constitution Missing or Minimal
Issue: Constitution required or Constitution is minimal when running sync bridge --adapter speckit
Solutions:
-
Auto-generate bootstrap constitution (recommended for brownfield):
specfact constitution bootstrap --repo .This analyzes your repository (README.md, pyproject.toml, .cursor/rules/, docs/rules/) and generates a bootstrap constitution.
-
Enrich existing minimal constitution:
specfact constitution enrich --repo .This fills placeholders in an existing constitution with repository context.
-
Validate constitution completeness:
specfact constitution validateThis checks if the constitution is complete and ready for use.
-
Manual creation (for greenfield):
- Run
/speckit.constitutioncommand in your AI assistant - Fill in the constitution template manually
- Run
When to use each option:
- Bootstrap (brownfield): Use when you want to extract principles from existing codebase
- Enrich (existing constitution): Use when you have a minimal constitution with placeholders
- Manual (greenfield): Use when starting a new project and want full control
Constitution Validation Fails
Issue: specfact constitution validate reports issues
Solutions:
-
Check for placeholders:
grep -r "\[.*\]" .specify/memory/constitution.md -
Run enrichment:
specfact constitution enrich --repo . -
Review validation output:
specfact constitution validate --constitution .specify/memory/constitution.mdThe output will list specific issues (missing sections, placeholders, etc.).
-
Fix issues manually or re-run bootstrap:
specfact constitution bootstrap --repo . --overwrite
Plan Comparison Issues
Plans Not Found
Issue: Plan not found when running plan compare
Solutions:
-
Check plan locations:
ls -la .specfact/projects/ ls -la .specfact/projects/<bundle-name>/reports/brownfield/ -
Use explicit paths (bundle directory paths):
specfact plan compare \ --manual .specfact/projects/manual-plan \ --auto .specfact/projects/auto-derived -
Generate auto-derived plan first:
specfact import from-code --bundle legacy-api --repo .
No Deviations Found (Expected Some)
Issue: Comparison shows no deviations but you expect some
Solutions:
-
Check feature key normalization:
- Different key formats may normalize to the same key
- Check
reference/feature-keys.mdfor details
-
Verify plan contents (use CLI commands):
specfact plan review <bundle-name> -
Use verbose mode:
specfact plan compare --bundle legacy-api --verbose
IDE Integration Issues
Slash Commands Not Working
Issue: Slash commands not recognized in IDE
Solutions:
-
Reinitialize IDE integration:
specfact init --ide cursor --force -
Check command files:
ls -la .cursor/commands/specfact-*.md -
Restart IDE: Some IDEs require restart to discover new commands
-
Check IDE settings:
- VS Code: Check
.vscode/settings.json - Cursor: Check
.cursor/settings.json
- VS Code: Check
Command Files Not Created
Issue: Command files not created after specfact init
Solutions:
-
Check permissions:
ls -la .cursor/commands/ -
Use force flag:
specfact init --ide cursor --force -
Check IDE type:
specfact init --ide cursor # For Cursor specfact init --ide vscode # For VS Code
Mode Detection Issues
Wrong Mode Detected
Issue: CI/CD mode when CoPilot should be detected (or vice versa)
Solutions:
-
Use explicit mode:
specfact --mode copilot import from-code my-project --repo . -
Check environment variables:
echo $COPILOT_API_URL echo $VSCODE_PID -
Set mode explicitly:
export SPECFACT_MODE=copilot specfact import from-code --bundle legacy-api --repo . -
See Operational Modes for details
Performance Issues
Slow Analysis
Issue: Code analysis takes too long
Solutions:
-
Use CI/CD mode (faster):
specfact --mode cicd import from-code my-project --repo . -
Increase confidence threshold (fewer features):
specfact import from-code --bundle legacy-api --repo . --confidence 0.8 -
Exclude directories:
# Use .gitignore or exclude patterns specfact import from-code --bundle legacy-api --repo . --exclude "tests/"
Watch Mode High CPU
Issue: Watch mode uses too much CPU
Solutions:
-
Increase interval:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --watch --interval 10 -
Use one-time sync:
specfact sync bridge --adapter speckit --bundle <bundle-name> --repo . --bidirectional -
Check file system events:
- Too many files being watched
- Consider excluding directories
Getting Help
If you’re still experiencing issues:
-
Check logs:
specfact repro --verbose 2>&1 | tee debug.log -
Search documentation:
-
Community support:
-
Direct support:
Happy building! 🚀