Skip to content

Commit 2e55b83

Browse files
committed
feat: implement Lean Architecture Improvements with 6 new features
- Lean Architecture Views: configurable --views flag (core 5 or all 7 views) - Surprise-Value Heuristic: --adr-heuristic for skipping obvious defaults - Constitution Cross-Reference: always-enabled ADR/constitution validation - ADR Template Improvements: Common Alternatives, Discovered status, no fabricated rejection - Existing Docs Deduplication: scan docs/ and *.md files to reference not duplicate - Risks & Gaps Analysis: cross-cutting Phase 2.5 in /architect.clarify Updates bash and PowerShell scripts, templates, and documentation.
1 parent 8c3e64d commit 2e55b83

File tree

16 files changed

+1102
-138
lines changed

16 files changed

+1102
-138
lines changed

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
### Added
13+
14+
- **Lean Architecture Views**: Configurable view generation with core vs optional views
15+
- Default "core" views: Context, Functional, Information, Development, Deployment
16+
- Optional views: Concurrency, Operational (via `--views` flag)
17+
- Support for: `--views all`, `--views core`, `--views concurrency,operational`
18+
- Marked optional views in templates with HTML comments
19+
20+
- **Surprise-Value Heuristic for ADRs**: Skip obvious ecosystem defaults, document only surprising/risky decisions
21+
- Configurable via `--adr-heuristic` flag: `surprising` (default), `all`, `minimal`
22+
- Heuristic rules distinguish obvious (PostgreSQL for relational) vs surprising (custom auth)
23+
- Configuration in `config.json`: `architecture.adr.heuristic`
24+
25+
- **Constitution Cross-Reference**: Strict checking for ADR/Constitution alignment
26+
- Always enabled in `/architect.clarify`
27+
- Detects duplicates (constitution already mandates), violations, unclear alignment
28+
- **Option A (Amend Constitution) as PRIMARY resolution** for violations
29+
- Adds "Constitution Alignment" section to ADR template
30+
31+
- **ADR Template Improvements**:
32+
- Renamed "Alternatives Considered" to "Common Alternatives"
33+
- Changed framing from "Rejected because" to neutral "Trade-offs"
34+
- Added "Discovered" status for reverse-engineered ADRs
35+
- Removed fabricated rejection rationale requirement
36+
- Added "Constitution Alignment" section with compliance tracking
37+
38+
- **Existing Docs Deduplication**: Scan and reference instead of duplicate
39+
- Scans `docs/` directory and root `*.md` files (configurable paths)
40+
- References existing docs (README, AGENTS.md, CONTRIBUTING) instead of duplicating
41+
- Auto-merges when existing architecture found (no prompt)
42+
- New `scan_existing_docs()` function in setup-architecture.sh
43+
44+
- **Risks & Gaps Analysis**: Cross-cutting analysis in `/architect.clarify`
45+
- Identifies operational gaps, technical debt, SPOFs, security concerns
46+
- Section-based gap IDs (e.g., `3.6.1` = Deployment view, gap #1)
47+
- Runs BEFORE constitution cross-reference (Phase 2.5)
48+
- Output integrated into existing view sections
49+
50+
### Changed
51+
52+
- **BREAKING: Architecture File Paths**: Updated to new two-file structure
53+
- Architecture Description: `AD.md` at project root (was `memory/architecture.md`)
54+
- Architecture Decision Records: `memory/adr.md` (unchanged)
55+
- Updated all scripts: `setup-architecture.sh`, `setup-plan.sh`, `common.sh`
56+
- Updated command templates: `architect.init.md`, `architect.specify.md`, `architect.clarify.md`
57+
58+
- **Configuration**: Added comprehensive architecture configuration
59+
- `architecture.views`: "core", "all", or comma-separated list
60+
- `architecture.adr.heuristic`: "surprising", "all", "minimal"
61+
- `architecture.adr.check_constitution`: true (always enabled)
62+
- `architecture.deduplication.scan_paths`: ["docs/", "*.md"]
63+
- Helper functions: `get_architecture_views()`, `get_adr_heuristic()`, `get_architecture_config()`
64+
1265
## [0.3.0] - 2026-02-08
1366

1467
### Added

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,44 @@ The toolkit includes comprehensive architecture documentation support that works
380380

381381
**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`).
382382

383+
#### Architecture Configuration Options
384+
385+
The architecture commands support additional configuration options for fine-tuned control:
386+
387+
**Views Selection** (`--views`):
388+
389+
- `core` (default) - Generate the essential 5 views: Context, Functional, Information, Development, Deployment
390+
- `all` - Include all 7 views including Concurrency and Operational
391+
- `concurrency,operational` - Custom selection (comma-separated), always includes core views
392+
393+
```bash
394+
# Default core views
395+
/architect.init "E-commerce platform"
396+
397+
# All views including concurrency and operational
398+
/architect.init --views all "High-throughput trading system"
399+
400+
# Custom selection
401+
/architect.init --views concurrency "Real-time data processing pipeline"
402+
```
403+
404+
**ADR Generation Heuristic** (`--adr-heuristic`):
405+
406+
- `surprising` (default) - Only document decisions that deviate from obvious ecosystem defaults
407+
- `all` - Document every architectural decision
408+
- `minimal` - Document only high-risk or non-obvious decisions
409+
410+
```bash
411+
# Skip documenting obvious choices (PostgreSQL for relational data, React for SPA)
412+
/architect.specify --adr-heuristic surprising "Standard web application"
413+
414+
# Document every decision
415+
/architect.specify --adr-heuristic all "Complex multi-tenant system"
416+
417+
# Minimal documentation
418+
/architect.specify --adr-heuristic minimal "Internal tool with simple requirements"
419+
```
420+
383421
#### Rozanski & Woods Viewpoints
384422

385423
The `architect.*` commands generate documentation covering:

roadmap.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,44 @@
165165
-**Smart Trace Validation**: Documented and implemented in `/analyze` command (lines 209-236)
166166
- ⚠️ **Task-to-Issues Command**: Template exists at `templates/commands/taskstoissues.md` but only supports GitHub (multi-tracker support planned in Tier 1.5)
167167

168+
### **Lean Architecture Improvements** *(100% Complete)* - **COMPLETED** - 6 Architecture Enhancements
169+
170+
Major enhancements to the architecture system making it more flexible, intelligent, and integrated with existing documentation.
171+
172+
-**Lean Architecture Views**: Configurable view generation (core 5 + optional 2)
173+
- Default "core" views: Context, Functional, Information, Development, Deployment
174+
- Optional views: Concurrency, Operational (via `--views` flag)
175+
- `--views all`, `--views core`, `--views concurrency,operational`
176+
177+
-**Surprise-Value Heuristic**: Skip obvious ecosystem defaults, document only surprising/risky decisions
178+
- `--adr-heuristic surprising` (default), `all`, `minimal`
179+
- Configuration in `config.json`: `architecture.adr.heuristic`
180+
181+
-**Constitution Cross-Reference**: Strict checking for ADR/Constitution alignment
182+
- Always enabled in `/architect.clarify`
183+
- Detects duplicates, violations, unclear alignment
184+
- **Option A (Amend Constitution) as PRIMARY resolution**
185+
186+
-**ADR Template Improvements**:
187+
- "Common Alternatives" (not "Alternatives Considered")
188+
- Neutral "Trade-offs" framing (not "Rejected because")
189+
- "Discovered" status for reverse-engineered ADRs
190+
- "Constitution Alignment" section
191+
192+
-**Existing Docs Deduplication**: Scan and reference instead of duplicate
193+
- Scans `docs/` directory and root `*.md` files
194+
- References existing docs (README, AGENTS.md, CONTRIBUTING)
195+
- Auto-merges when existing architecture found
196+
197+
-**Risks & Gaps Analysis**: Cross-cutting analysis in `/architect.clarify`
198+
- Identifies operational gaps, tech debt, SPOFs, security concerns
199+
- Section-based gap IDs (e.g., `3.6.1`)
200+
- Runs BEFORE constitution cross-reference
201+
202+
**Files Modified**: 13 files including templates, scripts, and configuration
203+
204+
---
205+
168206
### **Optional Architecture Support** *(100% Complete)* - **COMPLETED** - Enterprise Architecture Features
169207

170208
Architecture support is now available in all workflow modes as optional commands. The `/architect` and `/constitution` commands work silently in any mode, with no warnings if files are missing.
@@ -742,6 +780,115 @@ Consolidates: Command-level model selection + context budgeting + two-model revi
742780

743781
### **Future Enhancement Categories**
744782

783+
### **Compound Engineering Integration** *(0% Complete)* - **MEDIUM PRIORITY** - Insights from EveryInc's Compound Engineering Plugin
784+
785+
**Reference**: Analysis of [EveryInc/compound-engineering-plugin](https://github.com/EveryInc/compound-engineering-plugin) (7.5k stars, 598 forks)
786+
787+
**Key Insight**: Compound Engineering Plugin focuses on workflow efficiency through multi-agent parallelization and knowledge compounding, while Agentic SDLC Spec Kit focuses on structured SDLC methodology. These approaches are complementary.
788+
789+
#### **Swarm Mode Parallel Execution** *(0% Complete)* - **HIGH PRIORITY**
790+
791+
- **Description**: Implement swarm mode execution (like Compound's `/slfg`) that runs multiple sub-agents in parallel for tasks marked with `[P]` markers, dramatically accelerating development workflows
792+
- **Key Components**:
793+
- Parallel agent spawning for independent tasks within phases
794+
- Worktree-based isolation (validates incident.io pattern with 5+ agents)
795+
- Coordinated execution with dependency awareness
796+
- Phase-respecting orchestration (Setup → Foundational → Stories)
797+
- **Benefits**:
798+
- 3-5x faster execution for parallelizable tasks
799+
- Validates incident.io multi-agent + worktree pattern
800+
- Maintains code isolation and merge safety
801+
- **Implementation**: Extend existing `[P]` marker system with swarm orchestration layer
802+
- **References**: incident.io workflow pattern, Worktrunk integration
803+
804+
#### **Multi-Agent Review System** *(0% Complete)* - **MEDIUM PRIORITY**
805+
806+
- **Description**: Implement specialized reviewer agents (like Compound's 15 review agents) that perform focused code reviews:
807+
- `security-sentinel`: Security vulnerability detection
808+
- `performance-oracle`: Performance optimization suggestions
809+
- `rails-reviewer`: Framework-specific best practices
810+
- `accessibility-guardian`: A11y compliance checking
811+
- `test-coverage-analyst`: Test quality validation
812+
- **Key Components**:
813+
- Temperature-tuned agents (review: 0.1, planning: 0.2, creative: 0.6)
814+
- Parallel review execution before merge
815+
- Review agent selection based on code changes
816+
- Aggregated review reports with actionable items
817+
- **Benefits**:
818+
- Comprehensive pre-merge validation
819+
- Specialized expertise without context bloat
820+
- Consistent quality gates across team
821+
- **Integration**: Hook into `/spec.analyze` and pre-merge workflows
822+
823+
#### **Knowledge Compounding System** *(0% Complete)* - **MEDIUM PRIORITY**
824+
825+
- **Description**: Enhance `/spec.levelup` with systematic knowledge capture inspired by Compound's philosophy: "Each unit of engineering work should make subsequent units easier"
826+
- **Key Components**:
827+
- Pattern extraction from completed features
828+
- Anti-pattern documentation from failed approaches
829+
- Reusable solution templates for common problems
830+
- Team knowledge base with searchable patterns
831+
- Automatic skill generation from recurring patterns
832+
- **Workflow Enhancement**:
833+
```
834+
Plan → Work → Review → Compound → Repeat
835+
```
836+
- **Benefits**:
837+
- Institutional knowledge preservation
838+
- Accelerated future development through pattern reuse
839+
- Reduced repeated mistakes
840+
- Team learning velocity increase
841+
- **Integration**: Extend existing `/spec.levelup` with structured knowledge packets
842+
843+
#### **Browser Automation Integration** *(0% Complete)* - **LOW PRIORITY**
844+
845+
- **Description**: Integrate browser automation capabilities (like Compound's agent-browser CLI) for e2e testing and UI validation
846+
- **Key Components**:
847+
- Automated e2e test generation from specifications
848+
- Visual regression testing integration
849+
- UI interaction recording and replay
850+
- Screenshot-based validation in `/spec.implement`
851+
- **Benefits**:
852+
- Automated visual validation
853+
- Reduced manual QA effort
854+
- Better spec-to-implementation alignment
855+
- **Implementation**: Integration with Playwright, Puppeteer, or agent-browser
856+
857+
#### **Cross-Platform Plugin Converter** *(0% Complete)* - **LOW PRIORITY**
858+
859+
- **Description**: Create plugin conversion system (like Compound's Bun/TypeScript CLI) to convert between agent formats:
860+
- Claude Code plugins ↔ OpenCode format
861+
- Claude Code plugins ↔ Codex format
862+
- Custom agent format support
863+
- **Key Components**:
864+
- Agent format parsers and transformers
865+
- Tool mapping between platforms (bash/read/write/edit)
866+
- Temperature inference from agent names
867+
- MCP server conversion
868+
- **Benefits**:
869+
- Broader agent ecosystem compatibility
870+
- Reduced vendor lock-in
871+
- Easier migration between AI tools
872+
- **Implementation**: Python-based converter leveraging existing AGENT_CONFIG
873+
874+
#### **Task Delegation Templates** *(0% Complete)* - **MEDIUM PRIORITY*
875+
876+
- **Description**: Create rich task delegation system with specialized agent types inspired by Compound's agent ecosystem:
877+
- **Explore Agents**: Read-only codebase search (fresh slate, no context inheritance)
878+
- **Plan Agents**: Design/implementation planning (full context inheritance)
879+
- **Execute Agents**: Multi-step task execution with tool sequencing
880+
- **Review Agents**: Focused quality validation
881+
- **Key Components**:
882+
- Agent type selection matrix based on task characteristics
883+
- Context inheritance rules per agent type
884+
- Model selection guidance per agent type
885+
- "When NOT to Spawn" guidelines to prevent context bloat
886+
- **Benefits**:
887+
- Optimized agent utilization
888+
- Reduced unnecessary context window usage
889+
- Better task-agent matching
890+
- **Integration**: Extend Tier 2 Sub-Agent Coordination Framework
891+
745892
### **Beads-Backed Task Execution Tracker** *(0% Complete)* - **MEDIUM PRIORITY** - Agent-native persistent work tracking
746893

747894
**Problem Statement**:

scripts/bash/common.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,11 @@ get_feature_paths() {
297297
local feature_dir=$(find_feature_dir_by_prefix "$repo_root" "$current_branch")
298298

299299
# Project-level governance documents
300-
local memory_dir="$repo_root/.specify/memory"
300+
local memory_dir="$repo_root/memory"
301301
local constitution_file="$memory_dir/constitution.md"
302-
local architecture_file="$memory_dir/architecture.md"
302+
# New architecture structure: AD.md at root, ADRs in memory/
303+
local ad_file="$repo_root/AD.md"
304+
local adr_file="$memory_dir/adr.md"
303305

304306
cat <<EOF
305307
REPO_ROOT='$repo_root'
@@ -316,7 +318,8 @@ CONTEXT='$feature_dir/context.md'
316318
CONTRACTS_DIR='$feature_dir/contracts'
317319
TEAM_DIRECTIVES='${SPECIFY_TEAM_DIRECTIVES:-}'
318320
CONSTITUTION='$constitution_file'
319-
ARCHITECTURE='$architecture_file'
321+
AD='$ad_file'
322+
ADR='$adr_file'
320323
EOF
321324
}
322325

0 commit comments

Comments
 (0)