Skip to content

Commit 489b5b1

Browse files
committed
feat: refactor architecture validation with architect.validate
- Add READ-ONLY adlc.architect.validate command for plan alignment checks - Add extension hooks: before_plan (create ADRs), after_plan (validate) - Simplify CLI: remove --tdd, --architecture; keep --contracts, --data-models - Update spec-template.md with multi-line Framework Options format - Move architecture validation from spec to plan level via hooks - Add setup-architect.sh/ps1 validate actions with graceful skip - Update docs: README.md, architecture.md, architect README.md - Bump version to 0.0.114 Files changed: 18 Lines: +617, -230
1 parent a3f11eb commit 489b5b1

18 files changed

Lines changed: 617 additions & 230 deletions

File tree

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,49 @@ All notable changes to the Specify CLI and templates are documented here.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to to [Semantic Versioning](https://semver.org/spec/v2.0.0/).
99

10+
## [0.0.114] - 2026-03-07
11+
12+
### Added
13+
14+
- **Architect Validation Integration**: Added READ-ONLY `adlc.architect.validate` command that validates plan alignment with architecture
15+
- Validates 7 PILLAR checks: component alignment, interface contracts, data model consistency, context/functional/information/development view alignment
16+
- Checks diagram consistency: system boundaries and data flows
17+
- Returns structured JSON with blocking, high-severity, and warnings findings
18+
- Gracefully skips when architecture doesn't exist (returns `{"status":"skipped"}`)
19+
20+
- **Extension Hooks for Architect**: Added automatic extension hook integration for architect workflow
21+
- `before_plan` hook: Creates feature-level ADRs using `adlc.architect.specify`
22+
- `after_plan` hook: Validates plan alignment using `adlc.architect.validate --for-plan`
23+
- Hooks execute automatically when `.specify/memory/adr.md` exists
24+
25+
- **Multi-line Framework Options Format**: Updated spec-template.md to use multi-line format for clarity
26+
```
27+
contracts={contracts}
28+
data_models={data_models}
29+
```
30+
31+
### Changed
32+
33+
- **Simplified Framework Options**: Removed deprecated CLI flags (--tdd, --architecture)
34+
- Retained only user-configurable flags: `--contracts`, `--no-contracts`, `--data-models`, `--no-data-models`
35+
- TDD and architecture validation now handled via extensions (architect, tdd)
36+
37+
- **Architecture Validation Workflow**: Moved validation from spec level to plan level
38+
- Previous: validation in clarify.md (spec spec)
39+
- New: validation via architect.validate command with after_plan hook (plan level)
40+
- README.md and docs/architecture.md updated with new workflow
41+
42+
- **Architect Extension Scripts**: Added validate action to setup-architect.sh and setup-architect.ps1
43+
- bash: New `action_validate()` function with graceful skip behavior
44+
- PowerShell: New `Invoke-Validate()` function with graceful skip behavior
45+
46+
### Documentation
47+
48+
- `extensions/architect/README.md`: Added validate command to commands table and hooks integration section
49+
- `extensions/architect/commands/validate.md`: Complete command documentation with flags and usage
50+
- `docs/architecture.md`: Updated workflow to describe hooks-based architecture validation
51+
- `README.md`: Added Framework Options section documenting simplified CLI flags
52+
1053
## [0.0.112] - 2026-03-06
1154

1255
### Fixed

README.md

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -199,40 +199,6 @@ specify init my-project --debug
199199
specify init my-project --github-token $GITHUB_TOKEN
200200
```
201201

202-
### Framework Options
203-
204-
Fine-grained control over development approach available via command-line flags:
205-
206-
```bash
207-
# Test-Driven Development
208-
/spec.specify --tdd (enabled by default)
209-
210-
# Smart Contracts (API specifications)
211-
/spec.specify --contracts (enabled by default)
212-
213-
# Data Models (entity relationships)
214-
/spec.specify --data-models (enabled by default)
215-
216-
# Risk-Based Testing
217-
/spec.specify --risk-tests (enabled by default)
218-
```
219-
220-
#### Auto-Detection System
221-
222-
Framework options are automatically detected by downstream commands from spec.md metadata:
223-
224-
- **`/spec.plan`**, **`/spec.tasks`**, **`/spec.implement`**, **`/spec.clarify`**, **`/spec.analyze`**, **`/spec.checklist`**: Auto-detect framework options from the current feature's spec.md
225-
- **`/architect.*`**: Option-agnostic (system-level architecture should not be constrained by feature-level options)
226-
227-
#### Complete Example
228-
229-
```bash
230-
specify init my-project \
231-
--ai claude \
232-
--script sh \
233-
--team-ai-directives https://github.com/your-org/team-ai-directives.git
234-
```
235-
236202
### Optional Architecture Support
237203

238204
The toolkit includes comprehensive architecture documentation support via the **Architect extension**. Architecture commands work in any project.
@@ -241,10 +207,11 @@ The toolkit includes comprehensive architecture documentation support via the **
241207
242208
#### Two-Level Architecture System
243209

244-
| Level | Location | ADR File | Architecture Description | Commands |
245-
|-------|----------|----------|--------------------------|----------|
246-
| **System** | Main branch | `memory/adr.md` | `AD.md` (root) | `architect.*` |
247-
| **Feature** | Feature branch | `specs/{feature}/adr.md` | `specs/{feature}/AD.md` | `spec.plan --architecture` |
210+
| Level | Location | ADR File | Architecture Description | Hook Timing |
211+
|-------|----------|----------|--------------------------|--------------|
212+
| **System** | Main branch | `memory/adr.md` | `AD.md` (root) | N/A |
213+
| **Feature** | Feature branch | `specs/{feature}/adr.md` | `specs/{feature}/AD.md` | before_plan with architect extension |
214+
| **Validation** | Plan level | READ-ONLY via architect.validate | Validates plan alignment | after_plan with architect extension |
248215

249216
#### Architecture Workflow
250217

@@ -264,10 +231,18 @@ The toolkit includes comprehensive architecture documentation support via the **
264231
# Then proceed with normal workflow
265232
/spec.specify "Feature within this architecture"
266233

267-
# Or generate feature-level architecture during planning
268-
/spec.plan --architecture
234+
# Plan generation with architecture validation (if architect extension installed)
235+
/spec.plan
236+
- **before_plan hook** (architect extension): Create feature ADRs using architect.specify/clarify/implement
237+
- **after_plan hook** (architect extension): Validate plan alignment using architect.validate --for-plan
269238
```
270239

240+
**Architecture Integration via Hooks**:
241+
242+
- **before_plan** (architect extension): Automatically creates feature ADRs if adr.md exists
243+
- **after_plan** (architect extension): Validates plan alignment with architecture (READ-ONLY)
244+
- Hooks only activate if architect extension installed and adr.md present
245+
271246
#### Architecture Commands
272247

273248
| Command | Description |
@@ -276,9 +251,12 @@ The toolkit includes comprehensive architecture documentation support via the **
276251
| `architect.specify` | Interactive PRD exploration to create system-level ADRs |
277252
| `architect.clarify` | Refine ADRs through targeted clarification questions |
278253
| `architect.implement` | Generate full Architecture Description (AD.md) from ADRs |
279-
| `architect.analyze` | Validate ADR <-> AD consistency and quality |
254+
| `architect.analyze` | Validate ADR ↔ AD consistency and quality |
255+
| `architect.validate` | READ-ONLY: Validate plan alignment with architecture (plan level) |
280256

281-
**Feature Architecture**: Use `/spec.plan --architecture` or set `architecture=true` in spec.md Framework Options to generate feature-level architecture (`specs/{feature}/AD.md` and `specs/{feature}/adr.md`).
257+
**Feature Architecture Workflow**:
258+
259+
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.
282260

283261
#### Architecture Configuration Options
284262

@@ -332,6 +310,52 @@ The `architect.*` commands generate documentation covering:
332310

333311
Plus cross-cutting **Perspectives**: Security, Performance & Scalability
334312

313+
### Framework Options
314+
315+
The spec-kit supports the following framework options, configurable during feature creation:
316+
317+
| Option | Description | Default |
318+
|--------|-------------|---------|
319+
| `--contracts` | Enable service contracts (API schemas, test assertions) | Enabled |
320+
| `--no-contracts` | Disable service contracts | - |
321+
| `--data-models` | Generate data model documentation | Enabled |
322+
| `--no-data-models` | Skip data model generation | - |
323+
324+
**Example**:
325+
```bash
326+
./create-new-feature.sh --contracts --no-data-models "User authentication"
327+
```
328+
329+
**Usage Pattern**:
330+
331+
Set flags during feature creation. The flags are stored in each `spec.md` file and auto-detected by all `/spec.*` commands.
332+
333+
**Example in spec.md**:
334+
```markdown
335+
## Framework Options
336+
337+
contracts=true
338+
data_models=false
339+
```
340+
341+
**Workflow Integration**:
342+
343+
| Feature | Architecture Location | Activation |
344+
|---------|----------------------|-------------|
345+
| Feature ADRs (pre-plan) | before_plan hook (architect extension) | Generates feature-level ADRs if adr.md exists |
346+
| Architecture validation (post-plan) | after_plan hook (architect extension) | architect.validate validates plan alignment |
347+
| Plan generation | plan.md core command | Executes data model + UX validation (inline) |
348+
349+
**Advanced Features** (extension-based):
350+
351+
| Feature | Extension | Activation |
352+
|---------|-----------|-------------|
353+
| Test-Driven Development (TDD) | tdd extension | Hooks activate after /spec.tasks, /spec.implement |
354+
| Architecture integration | architect extension | before_plan (create ADRs), after_plan (validate) |
355+
| Risk-based testing | tdd extension | Part of TDD workflow |
356+
357+
These are extension-based, requiring explicit installation for opt-in behavior.
358+
335359
### 2. Establish project principles
336360

337361
Launch your AI assistant in the project directory. The `/spec.*` commands are available in the assistant.
@@ -589,15 +613,6 @@ Skills configuration is stored in `~/.config/specify/config.json`:
589613
| `--team-ai-directives` | Option | Path or URL to team-ai-directives repository |
590614
| `--ai-skills` | Flag | Install Prompt.MD templates as agent skills in agent-specific `skills/` directory (requires `--ai`) |
591615

592-
### `/spec.specify` Framework Options
593-
594-
| Argument/Option | Type | Description |
595-
|-----------------|----------|-----------------------------------------------------------------------------|
596-
| `--tdd/--no-tdd` | Option | Enable/disable TDD (Test-Driven Development) |
597-
| `--contracts/--no-contracts` | Option | Enable/disable API contract generation |
598-
| `--data-models/--no-data-models` | Option | Enable/disable data model generation |
599-
| `--risk-tests/--no-risk-tests` | Option | Enable/disable risk-based test generation |
600-
601616
### `specify skill` Commands & Options
602617

603618
The Skills Package Manager is accessed via the `specify skill` subcommand:

docs/architecture.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,31 @@ The analyze command validates consistency between ADRs and AD.md:
185185

186186
## Integration with Spec Workflow
187187

188-
Architecture commands work alongside specification commands:
188+
Architecture commands work alongside specification commands via extension hooks:
189189

190190
```
191191
/architect.specify --> /architect.clarify --> /architect.implement
192-
|
193-
v
194-
/spec.specify --> /spec.plan --architecture --> /spec.tasks --> /spec.implement
192+
|
193+
v
194+
/architect extension hooks (before_plan / after_plan)
195+
|
196+
v
197+
/spec.specify --> /spec.plan --> /spec.tasks --> /spec.implement
195198
```
196199

197-
The `--architecture` flag in `/spec.plan` generates feature-level architecture (AD.md and adr.md in `specs/{feature}/`).
200+
**Architecture Workflow** (architect extension hooks):
201+
202+
| Hook | Timing | Purpose |
203+
|------|--------|---------|
204+
| **before_plan** | Before plan generation | Create feature ADRs using architect.specify/clarify/implement |
205+
| **after_plan** | After plan generation | Validate plan alignment using architect.validate --for-plan (READ-ONLY) |
206+
| **Activation** | adr.md exists | Hooks only fire if `.specify/memory/adr.md` present |
207+
208+
**Feature Architecture Generation**:
209+
210+
- Manual: Run `/architect.specify``/architect.clarify``/architect.implement` to create feature ADRs and AD.md
211+
- Automatic: architect extension before_plan hook executes same commands when adr.md exists
212+
- Validation: architect extension after_plan hook validates plan alignment with architecture (READ-ONLY via architect.validate)
198213

199214
## Configuration
200215

docs/quickstart.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,6 @@ This guide will help you get started with Spec-Driven Development using Agentic
1111
**Note:** Run these steps in a standard terminal before opening the Intelligent IDE.
1212
**Alignment with 12 Factors:** This stage establishes the foundation guided by [I. Strategic Mindset](https://tikalk.github.io/agentic-sdlc-12-factors/content/strategic-mindset.html) and [II. Context Scaffolding](https://tikalk.github.io/agentic-sdlc-12-factors/content/context-scaffolding.html), positioning the developer as orchestrator and assembling necessary context for AI collaboration.
1313

14-
### Framework Options
15-
16-
Core workflow commands support fine-grained control over development approach:
17-
18-
#### Configuration Options
19-
20-
Fine-grained control over development approach via command-line flags:
21-
22-
```bash
23-
# Test-Driven Development
24-
/spec.specify --tdd (enabled by default)
25-
26-
# Smart Contracts (API specifications)
27-
/spec.specify --contracts (enabled by default)
28-
29-
# Data Models (entity relationships)
30-
/spec.specify --data-models (enabled by default)
31-
32-
# Risk-Based Testing
33-
/spec.specify --risk-tests (enabled by default)
34-
```
35-
36-
#### Auto-Detection System
37-
38-
Downstream commands automatically detect framework options from spec.md metadata:
39-
40-
- **`/spec.plan`**, **`/spec.tasks`**, **`/spec.implement`**, **`/spec.clarify`**, **`/spec.analyze`**, **`/spec.checklist`**: Auto-detect framework options from the current feature's spec.md
41-
- **`/architect.*`**: Option-agnostic (system-level architecture should not be constrained by feature-level options)
42-
4314
1. **Project Initialization (`/init`)**
4415
**Action:** From the project root, run the Agentic SDLC Spec Kit `init` command (e.g., `specify init <project> --team-ai-directives https://github.com/your-org/team-ai-directives.git`) to configure local settings and clone the shared `team-ai-directives` modules.
4516
**Purpose:** Creates the handshake that brings the repository into the managed Agentic SDLC ecosystem, wiring credentials, endpoints, and shared knowledge needed for subsequent commands.

evals/prompts/spec-prompt.txt

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,6 @@ You are tasked with creating a detailed feature specification.
33
USER REQUIREMENTS:
44
{{ user_input }}
55

6-
MODE DETECTION: Check if the user input mentions "build mode" or "minimal spec":
7-
- If YES → Create a LEAN specification (STOP being comprehensive, be MINIMAL)
8-
- If NO → Create a COMPREHENSIVE specification (5+ user stories, detailed requirements)
9-
10-
⚠️ LEAN MODE RULES (when "build mode" or "minimal spec" detected) ⚠️
11-
CRITICAL: This is NOT a comprehensive spec. Keep it SHORT, SIMPLE, and INFORMAL.
12-
13-
HARD LIMITS (DO NOT EXCEED):
14-
- 2 user stories MAXIMUM (not 3, not 4, just 2)
15-
- 1-2 acceptance criteria per story MAXIMUM (not 3-5 per story)
16-
- 3-5 functional requirements TOTAL (FR-001 through FR-005 MAX)
17-
- 1-2 non-functional requirements TOTAL (skip specific metrics for simple features)
18-
- 2-3 edge cases TOTAL (brief, one sentence each)
19-
- 2-3 success criteria TOTAL
20-
- TOTAL OUTPUT: Aim for 30-40 lines of content (not counting section headers)
21-
22-
LEAN MODE FORMATTING (less formal):
23-
- NO story IDs (no US-001, US-002) - just describe the stories
24-
- NO priority levels (no [P1], [P2], [P3])
25-
- NO formal "Acceptance Criteria:" headers - just bullet points
26-
- NO requirement IDs unless there are 4+ requirements (then use FR-001, FR-002...)
27-
- Simpler, more conversational language
28-
- Combine Overview + User Stories into one concise section if appropriate
29-
- Focus on CORE functionality only
30-
316
CRITICAL: First, identify if this is a SECURITY-CRITICAL feature by checking for:
327
- Authentication/authorization systems
338
- Payment processing, credit cards, financial transactions
@@ -39,29 +14,24 @@ If YES → Section 4 (Non-Functional Requirements) MUST comprehensively address
3914

4015
INSTRUCTIONS:
4116
Create a feature specification document with the following structure.
42-
Adjust detail level based on mode (LEAN for build mode, COMPREHENSIVE otherwise).
4317

4418
IMPORTANT: Use ## (level 2) markdown headers for ALL major sections below:
4519

4620
## 1. Overview Section
4721
Brief description of the feature
4822

4923
## 2. User Stories
50-
COMPREHENSIVE mode: 5+ prioritized user stories (P1, P2, P3) with detailed acceptance criteria, formal IDs (US-001, US-002)
51-
LEAN mode: 2 user stories maximum, simple format without IDs or priorities
24+
5+ prioritized user stories (P1, P2, P3) with detailed acceptance criteria, formal IDs (US-001, US-002)
5225
- Clear "As a [role], I want [feature], so that [benefit]" format
53-
- LEAN mode: Brief bullet points (1-2 per story), no "Acceptance Criteria:" header, no Given/When/Then
54-
- COMPREHENSIVE mode: Detailed acceptance criteria in Given/When/Then format with formal structure
26+
- Detailed acceptance criteria in Given/When/Then format with formal structure
5527
- Independent testability for each story
5628

5729
## 3. Functional Requirements
58-
COMPREHENSIVE mode: Detailed coverage with IDs (FR-001, FR-002... up to FR-015+)
59-
LEAN mode: 3-5 core requirements ONLY, simple bullet points or use FR-001 to FR-005 if numbering helps clarity
30+
Detailed coverage with IDs (FR-001, FR-002... up to FR-015+)
6031

6132
## 4. Non-Functional Requirements
6233
Performance, security, scalability requirements (NFR-001, NFR-002, etc.)
63-
LEAN mode: 1-3 critical NFRs only, NO detailed metrics for simple features (health checks, basic CRUD)
64-
COMPREHENSIVE mode: Detailed NFRs with specific measurable targets
34+
Detailed NFRs with specific measurable targets
6535

6636
🔒 SECURITY REQUIREMENTS (MANDATORY for authentication/payments/PII/healthcare):
6737
You MUST include ALL of the following security requirements:
@@ -83,8 +53,7 @@ COMPREHENSIVE mode: Detailed NFRs with specific measurable targets
8353
## 5. Edge Cases
8454
MANDATORY SECTION - This section heading MUST appear in output with content below it.
8555
Document boundary conditions and error scenarios:
86-
COMPREHENSIVE mode: Detailed coverage with multiple scenarios per category
87-
LEAN mode: 2-3 key edge cases only (brief, 1-2 sentences each)
56+
Detailed coverage with multiple scenarios per category
8857

8958
- For multi-step flows (checkout, onboarding, wizards), include:
9059
* Failed transitions between steps (payment declined, timeout, network errors)
@@ -100,8 +69,7 @@ LEAN mode: 2-3 key edge cases only (brief, 1-2 sentences each)
10069
* Partial failures and retry logic
10170

10271
## 6. Success Criteria
103-
COMPREHENSIVE mode: Comprehensive coverage with IDs (SC-001 to SC-010+)
104-
LEAN mode: 2-3 key success criteria ONLY, simple bullet points without SC-001, SC-002 IDs
72+
Comprehensive coverage with IDs (SC-001 to SC-010+)
10573

10674
IMPORTANT CONSTRAINTS:
10775
- Do NOT include technical implementation details (no specific frameworks, libraries, or tech stack)
@@ -117,12 +85,4 @@ IMPORTANT CONSTRAINTS:
11785
* Edge cases for each transition (what happens if step fails, timeout, etc.)
11886
* Success criteria for the entire flow
11987

120-
⚠️ FINAL REMINDER FOR LEAN MODE ⚠️
121-
If "build mode" or "minimal spec" was detected:
122-
- You are writing a MINIMAL, INFORMAL spec - NOT a comprehensive enterprise document
123-
- Use SIMPLE formatting: no US-001/FR-001/SC-001 IDs, no [P1]/[P2] priorities
124-
- STOP after 2 simple user stories, 3-5 functional reqs, 1-2 NFRs, 3 edge cases, 3 success criteria
125-
- Do NOT add formal headers like "Acceptance Criteria:" - just use bullet points
126-
- Your output should be ~30-40 lines of content, conversational and focused
127-
128-
OUTPUT: A complete feature specification document.
88+
OUTPUT: A complete feature specification document.

0 commit comments

Comments
 (0)