Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c38f4ef
Build: Include resources in sdist and wheel builds
cursoragent Nov 18, 2025
62e24dd
feat: Code2Spec Strategic Plan Phase 0 implementation (v0.6.9) (#26)
djm81 Nov 20, 2025
1114403
feat: Add JSON/YAML support for plan bundles (#27)
djm81 Nov 20, 2025
55de8ca
feat: add batch update support for plan review and updates (v0.7.0)
Nov 20, 2025
3b78316
fix: remove whitespace from blank lines and apply formatting
Nov 20, 2025
0ab0055
docs: align all documentation with CLI-first, integration-focused pos…
Nov 22, 2025
cde027c
fix: resolve type checking errors in constitution_evidence_extractor
Nov 22, 2025
b6ba0ff
Fix typecheck error
Nov 22, 2025
58fb2c6
Fix all type check errors
Nov 22, 2025
0279c3d
Fix type annotations
Nov 22, 2025
a9f2e67
Merge remote-tracking branch 'origin/main' into dev
Nov 22, 2025
df5f15a
Merge remote-tracking branch 'origin/main' into dev
Nov 22, 2025
f0689c9
feat: Phase 4 complete - Contract generation and density scoring
Nov 24, 2025
35263ce
Merge remote-tracking branch 'origin/main' into dev
Nov 24, 2025
455eda6
feat: Complete Phase 4.1 Bridge Configuration Schema and Add Conflict…
djm81 Nov 26, 2025
33f9e04
Fix integration test
Nov 26, 2025
9720702
feat: update prompt templates with standardized parameter names
Nov 26, 2025
56449ea
Update prompts and cli order
Nov 27, 2025
5819540
feat: CLI reorganization and Specmatic integration (v0.10.0) (#32)
djm81 Nov 27, 2025
f387f30
feat: complete CLI reorganization (v0.10.1)
Nov 27, 2025
9ca0d0d
feat: migration tool test coverage and enhanced analysis features (#33)
djm81 Nov 30, 2025
27eef55
feat: enhance target user extraction and remove GWT format references…
djm81 Nov 30, 2025
b180c6d
merge: resolve conflicts with main, keeping dev version (v0.11.3)
djm81 Nov 30, 2025
d40c2d0
feat: version 0.11.4 - SDD hash stability, enforce sdd bug fix, promp…
djm81 Dec 1, 2025
1077e00
Improve review template
djm81 Dec 1, 2025
aee6a97
fix: resolve Rich Progress display conflicts and contract violations …
djm81 Dec 1, 2025
633bd03
chore: bump version to 0.11.5
djm81 Dec 1, 2025
a6a1e90
style: fix formatting issues
djm81 Dec 2, 2025
926355e
feat: version 0.11.4 - SDD hash stability, enforce sdd bug fix, promp…
djm81 Dec 2, 2025
f2f42b8
Merge branch 'feature/cli-ux-polish' into dev
djm81 Dec 2, 2025
35381e7
merge: resolve conflicts with main, keeping dev version (v0.11.5)
djm81 Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 19 additions & 85 deletions .cursor/commands/specfact.01-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,110 +10,44 @@ You **MUST** consider the user input before proceeding (if not empty).

## Purpose

Import an existing codebase into a SpecFact plan bundle. Analyzes code structure using AI-first semantic understanding or AST-based fallback to generate a plan bundle representing the current system.

**When to use:**

- Starting SpecFact on an existing project (brownfield)
- Converting legacy code to contract-driven format
- Creating initial plan from codebase structure

**Quick Example:**

```bash
/specfact.01-import --bundle legacy-api --repo .
```
Import codebase → plan bundle. CLI extracts routes/schemas/relationships/contracts. LLM enriches context/"why"/completeness.

## Parameters

### Target/Input

- `--bundle NAME` (required argument) - Project bundle name (e.g., legacy-api, auth-module)
- `--repo PATH` - Repository path. Default: current directory (.)
- `--entry-point PATH` - Subdirectory for partial analysis. Default: None (analyze entire repo)
- `--enrichment PATH` - Path to LLM enrichment report. Default: None

### Output/Results

- `--report PATH` - Analysis report path. Default: .specfact/reports/brownfield/analysis-<timestamp>.md

### Behavior/Options

- `--shadow-only` - Observe without enforcing. Default: False
- `--enrich-for-speckit` - Auto-enrich for Spec-Kit compliance. Default: False

### Advanced/Configuration

- `--confidence FLOAT` - Minimum confidence score (0.0-1.0). Default: 0.5
- `--key-format FORMAT` - Feature key format: 'classname' or 'sequential'. Default: classname
**Target/Input**: `--bundle NAME` (optional, defaults to active plan), `--repo PATH`, `--entry-point PATH`, `--enrichment PATH`
**Output/Results**: `--report PATH`
**Behavior/Options**: `--shadow-only`, `--enrich-for-speckit`
**Advanced/Configuration**: `--confidence FLOAT` (0.0-1.0), `--key-format FORMAT` (classname|sequential)

## Workflow

### Step 1: Parse Arguments

- Extract `--bundle` (required)
- Extract `--repo` (default: current directory)
- Extract optional parameters (confidence, enrichment, etc.)

### Step 2: Execute CLI
1. **Execute CLI**: `specfact import from-code [<bundle>] --repo <path> [options]`
- CLI extracts: routes (FastAPI/Flask/Django), schemas (Pydantic), relationships, contracts (OpenAPI scaffolds), source tracking
- Uses active plan if bundle not specified

```bash
specfact import from-code <bundle-name> --repo <path> [options]
```
2. **LLM Enrichment** (if `--enrichment` provided):
- Read `.specfact/projects/<bundle>/enrichment_context.md`
- Enrich: business context, "why" reasoning, missing acceptance criteria
- Validate: contracts vs code, feature/story alignment

### Step 3: Present Results

- Display generated plan bundle location
- Show analysis report path
- Present summary of features/stories detected
3. **Present**: Bundle location, report path, summary (features/stories/contracts/relationships)

## CLI Enforcement

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

**Rules:**

1. **ALWAYS execute CLI first**: Run `specfact import from-code` before any analysis
2. **ALWAYS use non-interactive mode for CI/CD**: Use `--no-interactive` flag in Copilot environments
3. **NEVER modify .specfact folder directly**: All operations must go through CLI
4. **NEVER create YAML/JSON directly**: All artifacts must be CLI-generated
5. **Use CLI output as grounding**: Parse CLI output, don't regenerate it
**ALWAYS execute CLI first**. Never modify `.specfact/` directly. Use CLI output as grounding.

## Expected Output

## Success

```text
✓ Project bundle created: .specfact/projects/legacy-api/
✓ Analysis report: .specfact/reports/brownfield/analysis-2025-11-26T10-30-00.md
✓ Features detected: 12
✓ Stories detected: 45
```

## Error (Missing Bundle)

```text
✗ Project bundle name is required
Usage: specfact import from-code <bundle-name> [options]
```
**Success**: Bundle location, report path, summary (features/stories/contracts/relationships)
**Error**: Missing bundle name or bundle already exists

## Common Patterns

```bash
# Basic import
/specfact.01-import --repo . # Uses active plan
/specfact.01-import --bundle legacy-api --repo .

# Import with confidence threshold
/specfact.01-import --bundle legacy-api --repo . --confidence 0.7

# Import with enrichment report
/specfact.01-import --bundle legacy-api --repo . --enrichment enrichment-report.md

# Partial analysis (subdirectory only)
/specfact.01-import --bundle auth-module --repo . --entry-point src/auth/

# Spec-Kit compliance mode
/specfact.01-import --bundle legacy-api --repo . --enrich-for-speckit
/specfact.01-import --repo . --entry-point src/auth/
/specfact.01-import --repo . --enrichment report.md
```

## Context
Expand Down
72 changes: 19 additions & 53 deletions .cursor/commands/specfact.02-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,17 @@ You **MUST** consider the user input before proceeding (if not empty).

## Purpose

Manage project bundles: initialize new bundles, add features and stories, and update plan metadata. This unified command replaces multiple granular commands for better LLM workflow integration.
Manage project bundles: initialize, add features/stories, update metadata (idea/features/stories).

**When to use:**
**When to use:** Creating bundles, adding features/stories, updating metadata.

- Creating a new project bundle (greenfield)
- Adding features/stories to existing bundles
- Updating plan metadata (idea, features, stories)

**Quick Example:**

```bash
/specfact.02-plan init legacy-api
/specfact.02-plan add-feature --bundle legacy-api --key FEATURE-001 --title "User Auth"
```
**Quick:** `/specfact.02-plan init legacy-api` or `/specfact.02-plan add-feature --key FEATURE-001 --title "User Auth"`

## Parameters

### Target/Input

- `--bundle NAME` - Project bundle name (required for most operations)
- `--bundle NAME` - Project bundle name (optional, defaults to active plan set via `plan select`)
- `--key KEY` - Feature/story key (e.g., FEATURE-001, STORY-001)
- `--feature KEY` - Parent feature key (for story operations)

Expand All @@ -56,28 +47,18 @@ Manage project bundles: initialize new bundles, add features and stories, and up
### Step 1: Parse Arguments

- Determine operation: `init`, `add-feature`, `add-story`, `update-idea`, `update-feature`, `update-story`
- Extract required parameters (bundle name, keys, etc.)
- Extract parameters (bundle name defaults to active plan if not specified, keys, etc.)

### Step 2: Execute CLI

```bash
# Initialize bundle
specfact plan init <bundle-name> [--interactive/--no-interactive] [--scaffold/--no-scaffold]

# Add feature
specfact plan add-feature --bundle <name> --key <key> --title <title> [--outcomes <outcomes>] [--acceptance <acceptance>]

# Add story
specfact plan add-story --bundle <name> --feature <feature-key> --key <story-key> --title <title> [--acceptance <acceptance>]

# Update idea
specfact plan update-idea --bundle <name> [--title <title>] [--narrative <narrative>] [--target-users <users>] [--value-hypothesis <hypothesis>] [--constraints <constraints>]

# Update feature
specfact plan update-feature --bundle <name> --key <key> [--title <title>] [--outcomes <outcomes>] [--acceptance <acceptance>] [--constraints <constraints>] [--confidence <score>] [--draft/--no-draft]

# Update story
specfact plan update-story --bundle <name> --feature <feature-key> --key <story-key> [--title <title>] [--acceptance <acceptance>] [--story-points <points>] [--value-points <points>] [--confidence <score>] [--draft/--no-draft]
specfact plan add-feature [--bundle <name>] --key <key> --title <title> [--outcomes <outcomes>] [--acceptance <acceptance>]
specfact plan add-story [--bundle <name>] --feature <feature-key> --key <story-key> --title <title> [--acceptance <acceptance>]
specfact plan update-idea [--bundle <name>] [--title <title>] [--narrative <narrative>] [--target-users <users>] [--value-hypothesis <hypothesis>] [--constraints <constraints>]
specfact plan update-feature [--bundle <name>] --key <key> [--title <title>] [--outcomes <outcomes>] [--acceptance <acceptance>] [--constraints <constraints>] [--confidence <score>] [--draft/--no-draft]
specfact plan update-story [--bundle <name>] --feature <feature-key> --key <story-key> [--title <title>] [--acceptance <acceptance>] [--story-points <points>] [--value-points <points>] [--confidence <score>] [--draft/--no-draft]
# --bundle defaults to active plan if not specified
```

### Step 3: Present Results
Expand All @@ -90,13 +71,7 @@ specfact plan update-story --bundle <name> --feature <feature-key> --key <story-

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

**Rules:**

1. **ALWAYS execute CLI first**: Run appropriate `specfact plan` command before any analysis
2. **ALWAYS use non-interactive mode for CI/CD**: Use `--no-interactive` flag in Copilot environments
3. **NEVER modify .specfact folder directly**: All operations must go through CLI
4. **NEVER create YAML/JSON directly**: All artifacts must be CLI-generated
5. **Use CLI output as grounding**: Parse CLI output, don't regenerate it
**Rules:** Execute CLI first, use `--no-interactive` in CI/CD, never modify `.specfact/` directly, use CLI output as grounding.

## Expected Output

Expand All @@ -118,28 +93,19 @@ Outcomes: Secure login, Session management
## Error (Missing Bundle)

```text
✗ Project bundle name is required
Usage: specfact plan <operation> --bundle <name> [options]
✗ Project bundle name is required (or set active plan with 'plan select')
Usage: specfact plan <operation> [--bundle <name>] [options]
```

## Common Patterns

```bash
# Initialize new bundle
/specfact.02-plan init legacy-api
/specfact.02-plan init auth-module --no-interactive

# Add feature with full metadata
/specfact.02-plan add-feature --bundle legacy-api --key FEATURE-001 --title "User Auth" --outcomes "Secure login, Session management" --acceptance "Users can log in, Sessions persist"

# Add story to feature
/specfact.02-plan add-story --bundle legacy-api --feature FEATURE-001 --key STORY-001 --title "Login API" --acceptance "API returns JWT token" --story-points 5

# Update feature metadata
/specfact.02-plan update-feature --bundle legacy-api --key FEATURE-001 --title "Updated Title" --confidence 0.9

# Update idea section
/specfact.02-plan update-idea --bundle legacy-api --target-users "Developers, DevOps" --value-hypothesis "Reduce technical debt"
/specfact.02-plan add-feature --key FEATURE-001 --title "User Auth" --outcomes "Secure login" --acceptance "Users can log in"
/specfact.02-plan add-story --feature FEATURE-001 --key STORY-001 --title "Login API" --acceptance "API returns JWT"
/specfact.02-plan update-feature --key FEATURE-001 --title "Updated Title" --confidence 0.9
/specfact.02-plan update-idea --target-users "Developers, DevOps" --value-hypothesis "Reduce technical debt"
# --bundle defaults to active plan if not specified
```

## Context
Expand Down
Loading
Loading