Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ All notable changes to the Specify CLI and templates are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to to [Semantic Versioning](https://semver.org/spec/v2.0.0/).

## [0.0.117] - 2026-03-09

### Changed

- **LevelUp Command Rename**: Renamed `/levelup.spec` to `/levelup.specify` for consistency with `architect.specify` and full-verb naming convention
- Renamed command file `spec.md` → `specify.md`
- Updated all internal references across extension files and documentation
- No backward compatibility - users must use `/levelup.specify`

## [0.0.116] - 2026-03-08

### Fixed
Expand Down Expand Up @@ -335,7 +344,7 @@ Integrated upstream changes while preserving fork-specific features:
- **LevelUp Extension**: Modularized `/spec.levelup` into dedicated extension with 5 CDR-based commands (#56)
- `/levelup.init` - Brownfield codebase scan to discover Context Decision Records (CDRs)
- `/levelup.clarify` - Resolve CDR ambiguities and accept/reject decisions
- `/levelup.spec` - Extract CDRs from current feature spec context (replaces old `/spec.levelup`)
- `/levelup.specify` - Extract CDRs from current feature spec context (replaces old `/spec.levelup`)
- `/levelup.skills` - Build ONE skill at a time from accepted CDRs
- `/levelup.implement` - Compile accepted CDRs into PR to team-ai-directives
- CDRs stored in `.specify/memory/cdr.md` (similar to ADRs)
Expand All @@ -345,7 +354,7 @@ Integrated upstream changes while preserving fork-specific features:

### Changed

- **CLI Help Text**: Updated `/spec.levelup` references to `/levelup.spec` in init command help and next steps panel
- **CLI Help Text**: Updated `/spec.levelup` references to `/levelup.specify` in init command help and next steps panel
- **Context View Blackbox Enforcement**: Updated architect commands to strictly enforce blackbox system representation in Context View
- System MUST appear as a single unified node (no internal components)
- Only external actors (stakeholders/users) and external systems shown
Expand Down
165 changes: 57 additions & 108 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,114 +260,34 @@ team-ai-directives/

### Optional Architecture Support

The toolkit includes comprehensive architecture documentation support via the **Architect extension**. Architecture commands work in any project.
The toolkit includes comprehensive architecture documentation support via the **Architect extension**, which creates and manages Architecture Decision Records (ADRs) and Architecture Descriptions (AD.md) using the Rozanski & Woods methodology.

> **Note**: The Architect extension is bundled and auto-installed during `specify init`.

#### Two-Level Architecture System
**Key Features:**
- **Two-level architecture** - System-level ADRs on main branch, feature-level ADRs on feature branches
- **Automatic integration** - Hooks create feature ADRs during `/spec.plan` and validate alignment
- **Greenfield & Brownfield** - `/architect.specify` for new projects, `/architect.init` for existing codebases

| Level | Location | ADR File | Architecture Description | Hook Timing |
|-------|----------|----------|--------------------------|--------------|
| **System** | Main branch | `memory/adr.md` | `AD.md` (root) | N/A |
| **Feature** | Feature branch | `specs/{feature}/adr.md` | `specs/{feature}/AD.md` | before_plan with architect extension |
| **Validation** | Plan level | READ-ONLY via architect.validate | Validates plan alignment | after_plan with architect extension |

#### Architecture Workflow
**Quick Start:**

```bash
# Interactive PRD exploration to create system-level ADRs (greenfield)
# Greenfield: Create ADRs from PRD
/architect.specify "B2B SaaS platform for real-time supply chain management"

# Reverse-engineer architecture from existing codebase (brownfield)
/architect.init "Django monolith with PostgreSQL, React frontend, deployed on AWS ECS"

# Refine and clarify ADRs through targeted questions
/architect.clarify
# Brownfield: Reverse-engineer ADRs from code
/architect.init "Django monolith with PostgreSQL, React frontend"

# Generate full Architecture Description from ADRs
# Generate Architecture Description
/architect.implement

# Then proceed with normal workflow
/spec.specify "Feature within this architecture"

# Plan generation with architecture validation (if architect extension installed)
/spec.plan
- **before_plan hook** (architect extension): Create feature ADRs using architect.specify/clarify/implement
- **after_plan hook** (architect extension): Validate plan alignment using architect.validate --for-plan
```

**Architecture Integration via Hooks**:

- **before_plan** (architect extension): Automatically creates feature ADRs if adr.md exists
- **after_plan** (architect extension): Validates plan alignment with architecture (READ-ONLY)
- Hooks only activate if architect extension installed and adr.md present

#### Architecture Commands

| Command | Description |
|---------|-------------|
| `architect.init` | Reverse-engineer architecture from existing codebase (brownfield) |
| `architect.specify` | Interactive PRD exploration to create system-level ADRs |
| `architect.clarify` | Refine ADRs through targeted clarification questions |
| `architect.implement` | Generate full Architecture Description (AD.md) from ADRs |
| `architect.analyze` | Validate ADR ↔ AD consistency and quality |
| `architect.validate` | READ-ONLY: Validate plan alignment with architecture (plan level) |

**Feature Architecture Workflow**:

Feature-level ADRs and AD.md are created automatically via architect extension hooks during `/spec.plan` execution (if architect is installed and system architecture exists). No manual --architecture flag needed for feature architecture generation.

#### Architecture Configuration Options

The architecture commands support additional configuration options for fine-tuned control:

**Views Selection** (`--views`):

- `core` (default) - Generate the essential 5 views: Context, Functional, Information, Development, Deployment
- `all` - Include all 7 views including Concurrency and Operational
- `concurrency,operational` - Custom selection (comma-separated), always includes core views

```bash
# Default core views
/architect.init "E-commerce platform"

# All views including concurrency and operational
/architect.init --views all "High-throughput trading system"

# Custom selection
/architect.init --views concurrency "Real-time data processing pipeline"
```

**ADR Generation Heuristic** (`--adr-heuristic`):

- `surprising` (default) - Only document decisions that deviate from obvious ecosystem defaults
- `all` - Document every architectural decision
- `minimal` - Document only high-risk or non-obvious decisions

```bash
# Skip documenting obvious choices (PostgreSQL for relational data, React for SPA)
/architect.specify --adr-heuristic surprising "Standard web application"

# Document every decision
/architect.specify --adr-heuristic all "Complex multi-tenant system"

# Minimal documentation
/architect.specify --adr-heuristic minimal "Internal tool with simple requirements"
# Validate consistency
/architect.analyze
```

#### Rozanski & Woods Viewpoints
**Commands:** `architect.init`, `architect.specify`, `architect.clarify`, `architect.implement`, `architect.analyze`, `architect.validate`

The `architect.*` commands generate documentation covering:

1. **Context View** - System scope and external interactions
2. **Functional View** - Functional elements and responsibilities
3. **Information View** - Data storage, management, and flow
4. **Concurrency View** - Runtime processes and coordination
5. **Development View** - Code organization and CI/CD
6. **Deployment View** - Physical infrastructure and environments
7. **Operational View** - Operations, monitoring, and support

Plus cross-cutting **Perspectives**: Security, Performance & Scalability
📖 **Full documentation:** [extensions/architect/README.md](./extensions/architect/README.md)

### Framework Options

Expand Down Expand Up @@ -465,21 +385,25 @@ Use **`/spec.trace`** to generate comprehensive AI session execution traces capt
/spec.trace
```

**Benefits**: Session traces document AI agent decision-making, execution context, quality gates, and reusable patterns. Stored in `specs/{BRANCH}/trace.md` with your feature artifacts. Optional but enriches `/levelup.spec` CDR extraction when present.
**Benefits**: Session traces document AI agent decision-making, execution context, quality gates, and reusable patterns. Stored in `specs/{BRANCH}/trace.md` with your feature artifacts. Optional but enriches `/levelup.specify` CDR extraction when present.

### 8. Level up and contribute knowledge

Use the **levelup extension** to extract patterns from your completed feature and contribute reusable knowledge back to your team's shared repository.
Use the **levelup extension** to extract patterns from your completed feature and contribute reusable knowledge back to your team's shared repository via Context Decision Records (CDRs).

```bash
/levelup.spec # Extract CDRs from current feature spec (after /implement)
/levelup.specify # Extract CDRs from current feature spec (after /implement)
/levelup.clarify # Resolve ambiguities in discovered CDRs
/levelup.skills python-patterns # Build a skill from accepted CDRs
/levelup.implement # Create PR to team-ai-directives
```

For brownfield projects, use `/levelup.init` to scan the entire codebase for patterns.

**Commands:** `levelup.init`, `levelup.specify`, `levelup.clarify`, `levelup.skills`, `levelup.implement`, `levelup.trace`

📖 **Full documentation:** [extensions/levelup/README.md](./extensions/levelup/README.md)

For detailed step-by-step instructions, see our [comprehensive guide](./spec-driven.md).

## 📽️ Video Overview
Expand Down Expand Up @@ -806,22 +730,12 @@ Essential commands for the Spec-Driven Development workflow:

| Command | Description |
|--------------------------|-----------------------------------------------------------------------|
| `/architect.init` | Reverse-engineer architecture from codebase (brownfield) *(via architect extension)* |
| `/architect.specify` | Interactive PRD exploration to create ADRs *(via architect extension)* |
| `/architect.clarify` | Refine ADRs through clarification questions *(via architect extension)* |
| `/architect.implement`| Generate AD.md from ADRs *(via architect extension)* |
| `/architect.analyze` | Validate ADR <-> AD consistency *(via architect extension)* |
| `/spec.constitution` | Create or update project governing principles and development guidelines |
| `/spec.specify` | Define what you want to build (requirements and user stories) |
| `/spec.plan` | Create technical implementation plans with your chosen tech stack & SYNC/ASYNC triage |
| `/spec.tasks` | Generate actionable task lists for implementation |
| `/spec.implement` | Execute all tasks to build the feature according to the plan with dual execution loops (SYNC/ASYNC modes) |
| `/spec.trace` | Generate AI session execution traces with decisions, patterns, and evidence (optional, enriches `/levelup.spec`) |
| `/levelup.spec` | Extract CDRs from current feature spec context (replaces old `/spec.levelup`) |
| `/levelup.init` | Discover CDRs from entire codebase (brownfield analysis) |
| `/levelup.clarify` | Resolve ambiguities in discovered CDRs |
| `/levelup.skills` | Build a single skill from accepted CDRs |
| `/levelup.implement` | Compile accepted CDRs into PR to team-ai-directives |
| `/spec.trace` | Generate AI session execution traces with decisions, patterns, and evidence (optional, enriches `/levelup.specify`) |

#### Optional Commands

Expand All @@ -833,6 +747,41 @@ Additional commands for enhanced quality and validation:
| `/spec.analyze` | Cross-artifact consistency & coverage analysis (run after `/spec.tasks`, before `/spec.implement`) |
| `/spec.checklist` | Generate custom quality checklists that validate requirements completeness, clarity, and consistency (like "unit tests for English") |

#### Extension Commands

Commands provided by bundled extensions. See extension READMEs for full documentation.

**Architect Extension** - [📖 Documentation](./extensions/architect/README.md)

| Command | Description |
|--------------------------|-----------------------------------------------------------------------|
| `/architect.init` | Reverse-engineer architecture from codebase (brownfield) |
| `/architect.specify` | Interactive PRD exploration to create ADRs (greenfield) |
| `/architect.clarify` | Refine ADRs through clarification questions |
| `/architect.implement`| Generate AD.md from ADRs |
| `/architect.analyze` | Validate ADR ↔ AD consistency |
| `/architect.validate` | Validate plan alignment with architecture (READ-ONLY) |

**LevelUp Extension** - [📖 Documentation](./extensions/levelup/README.md)

| Command | Description |
|--------------------------|-----------------------------------------------------------------------|
| `/levelup.init` | Discover CDRs from entire codebase (brownfield analysis) |
| `/levelup.specify` | Extract CDRs from current feature spec context |
| `/levelup.clarify` | Resolve ambiguities in discovered CDRs |
| `/levelup.skills` | Build a single skill from accepted CDRs |
| `/levelup.implement` | Compile accepted CDRs into PR to team-ai-directives |
| `/levelup.trace` | Generate AI session execution traces |

**TDD Extension** - [📖 Documentation](./extensions/tdd/README.md)

| Command | Description |
|--------------------------|-----------------------------------------------------------------------|
| `/tdd.plan` | Planning phase - design before coding |
| `/tdd.tasks` | Detect language/framework + generate hybrid tests |
| `/tdd.implement`| Execute RED→GREEN→REFACTOR |
| `/tdd.validate` | Validate test quality |

### Environment Variables

| Variable | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ After initialization, you should see the following commands available in your AI
- `/spec.plan` - Generate implementation plans
- `/spec.tasks` - Break down into actionable tasks
- `/spec.implement` - Execute implementation with SYNC/ASYNC dual execution loops
- `/levelup.spec` - Extract patterns from current feature and create CDRs for team knowledge
- `/levelup.specify` - Extract patterns from current feature and create CDRs for team knowledge
- `/levelup.init` - Discover patterns from entire codebase (brownfield)
- `/levelup.clarify` - Resolve ambiguities in discovered CDRs
- `/levelup.implement` - Compile CDRs into PR to team-ai-directives
Expand Down
8 changes: 4 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ This guide will help you get started with Spec-Driven Development using Agentic
**Note:** The levelup extension runs inside the IDE and relies on the locally cloned directives repository from Stage 0.
**Alignment with 12 Factors:** This stage encompasses [IX. Traceability](https://tikalk.github.io/agentic-sdlc-12-factors/content/traceability.html), [X. Strategic Tooling](https://tikalk.github.io/agentic-sdlc-12-factors/content/strategic-tooling.html), [XI. Directives as Code](https://tikalk.github.io/agentic-sdlc-12-factors/content/directives-as-code.html), and [XII. Team Capability](https://tikalk.github.io/agentic-sdlc-12-factors/content/team-capability.html), linking artifacts, managing tools, versioning AI behavior, and systematizing learning.

1. **Extract CDRs from Feature (`/levelup.spec`)**
**Action:** Invoke `/levelup.spec` after completing `/implement` to extract patterns from the current feature. The command creates Context Decision Records (CDRs) in `.specify/memory/cdr.md` based on your spec, plan, tasks, and optional trace.
1. **Extract CDRs from Feature (`/levelup.specify`)**
**Action:** Invoke `/levelup.specify` after completing `/implement` to extract patterns from the current feature. The command creates Context Decision Records (CDRs) in `.specify/memory/cdr.md` based on your spec, plan, tasks, and optional trace.
**Purpose:** Captures coding patterns, best practices, and reusable knowledge from your completed implementation.

2. **Clarify and Accept (`/levelup.clarify`)**
Expand All @@ -108,13 +108,13 @@ This guide will help you get started with Spec-Driven Development using Agentic
**Example Commands:**

```text
/levelup.spec "Focus on the error handling patterns we developed"
/levelup.specify "Focus on the error handling patterns we developed"
/levelup.clarify
/levelup.skills python-error-handling
/levelup.implement
```

**Note:** For brownfield projects (scanning entire codebase without a feature context), use `/levelup.init` instead of `/levelup.spec`.
**Note:** For brownfield projects (scanning entire codebase without a feature context), use `/levelup.init` instead of `/levelup.specify`.

**Outcome:** CDRs documented in `.specify/memory/cdr.md`, optional skills in `.specify/drafts/skills/`, and a draft PR to team-ai-directives for team review.

Expand Down
44 changes: 44 additions & 0 deletions extensions/architect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Greenfield: /architect.specify --> /architect.clarify --> /architect.implement
| Feature ADRs | `specs/{feature}/adr.md` | Feature-level decisions |
| Feature AD | `specs/{feature}/AD.md` | Feature-level architecture |

## Two-Level Architecture System

| Level | Location | ADR File | Architecture Description | Hook Timing |
|-------|----------|----------|--------------------------|--------------|
| **System** | Main branch | `memory/adr.md` | `AD.md` (root) | N/A |
| **Feature** | Feature branch | `specs/{feature}/adr.md` | `specs/{feature}/AD.md` | before_plan hook |
| **Validation** | Plan level | READ-ONLY via architect.validate | Validates plan alignment | after_plan hook |

**Feature-level ADRs and AD.md** are created automatically via extension hooks during `/spec.plan` execution (if system architecture exists).

## Installation

The architect extension is **bundled by default** during project initialization:
Expand Down Expand Up @@ -130,6 +140,40 @@ analysis:
block_on_critical: true
```

### Views Selection (`--views`)

- `core` (default) - Generate the essential 5 views: Context, Functional, Information, Development, Deployment
- `all` - Include all 7 views including Concurrency and Operational
- `concurrency,operational` - Custom selection (comma-separated), always includes core views

```bash
# Default core views
/architect.init "E-commerce platform"

# All views including concurrency and operational
/architect.init --views all "High-throughput trading system"

# Custom selection
/architect.init --views concurrency "Real-time data processing pipeline"
```

### ADR Generation Heuristic (`--adr-heuristic`)

- `surprising` (default) - Only document decisions that deviate from obvious ecosystem defaults
- `all` - Document every architectural decision
- `minimal` - Document only high-risk or non-obvious decisions

```bash
# Skip documenting obvious choices (PostgreSQL for relational data, React for SPA)
/architect.specify --adr-heuristic surprising "Standard web application"

# Document every decision
/architect.specify --adr-heuristic all "Complex multi-tenant system"

# Minimal documentation
/architect.specify --adr-heuristic minimal "Internal tool with simple requirements"
```

## ADR Format (MADR)

Architecture Decision Records follow the MADR format:
Expand Down
Loading