Skip to content

Commit 2fd2248

Browse files
feat(examples): configuration management system
changes: - file: mcp-server-example.py area: core added: [main, planfile_apply, planfile_review, planfile_generate] - file: comprehensive_example.py area: core added: [run_command, main] - file: test_litellm_integration.py area: test added: [__init__, generate_summary, run_comprehensive_test, main, create_test_prompt, LiteLLMStrategyTester] new_tests: 2 - file: test_llm_adapters.py area: test added: [main] - file: test_strategies.py area: test added: [main, validate_strategy_yaml] new_tests: 2 - file: adapters.py area: core added: [__init__, OpenRouterAdapter, LocalLLMAdapter, LiteLLMAdapter, LLMTestRunner, register_adapter, +6 more] new_tests: 2 - file: generator.py area: core added: [_fix_yaml_formatting] modified: [_parse_strategy_response] testing: new_tests: 6 scenarios: - model_with_prompt - specific_strategy - strategy_generation - strategy_validation - strategy_with_all_adapters - strategy_generation stats: lines: "+2941/-39 (net +2902)" files: 20 complexity: "Large structural change (normalized)"
1 parent 0294655 commit 2fd2248

24 files changed

+2965
-42
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [0.1.18] - 2026-03-26
11+
12+
### Docs
13+
- Update EXAMPLES_SUMMARY.md
14+
15+
### Test
16+
- Update test-results.json
17+
18+
### Other
19+
- Update llx-config-for-planfile.yaml
20+
- Update llx-driven-strategy.yaml
21+
- Update mcp-server-example.py
22+
- Update mcp-tools.json
23+
- Update planfile/examples/comprehensive_example.py
24+
- Update planfile/examples/ecosystem/01_full_workflow.sh
25+
- Update planfile/examples/llm-config.yaml
26+
- Update planfile/examples/llm_integration_demo.py
27+
- Update planfile/examples/strategies/ecommerce-mvp.yaml
28+
- Update planfile/examples/strategies/microservices-migration.yaml
29+
- ... and 8 more files
30+
1031
## [0.1.17] - 2026-03-26
1132

1233
### Test

EXAMPLES_SUMMARY.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Planfile Examples Summary
2+
3+
## Overview
4+
Successfully verified and enhanced the planfile examples with complex, real-world strategies.
5+
6+
## Fixed Issues
7+
1. **Fixed relative imports** - All examples now work with the updated import structure
8+
2. **Fixed strategy validation** - Added missing `project_name` field to existing strategies
9+
3. **Updated quality gates format** - Standardized to use `metric`/`threshold` format
10+
11+
## New Complex Strategies Added
12+
13+
### 1. Microservices Migration Strategy
14+
- **Domain**: Enterprise Software
15+
- **Goal**: Architecture transformation from monolith to microservices
16+
- **Features**:
17+
- 4 sprints with detailed objectives
18+
- Service boundary identification
19+
- API gateway implementation
20+
- Distributed tracing
21+
- Zero-downtime deployment
22+
- Comprehensive quality gates
23+
24+
### 2. ML Pipeline Optimization Strategy
25+
- **Domain**: Machine Learning
26+
- **Goal**: Performance and scalability optimization
27+
- **Features**:
28+
- Distributed training setup
29+
- Feature store implementation
30+
- Model optimization (quantization/pruning)
31+
- MLOps best practices
32+
- Experiment tracking
33+
- Performance monitoring
34+
35+
### 3. Security Hardening Strategy
36+
- **Domain**: FinTech
37+
- **Goal**: SOC 2 Type II compliance
38+
- **Features**:
39+
- Zero-trust architecture
40+
- End-to-end encryption
41+
- IAM implementation
42+
- Security monitoring
43+
- Incident response
44+
- Comprehensive audit logging
45+
46+
## Existing Strategies Enhanced
47+
- **E-commerce MVP** - Fixed validation issues
48+
- **Employee Onboarding** - Fixed validation issues
49+
50+
## Test Results
51+
All 5 strategies now pass:
52+
- ✅ YAML structure validation
53+
- ✅ Planfile validation command
54+
- ✅ Strategy generation (dry run)
55+
56+
## Example Scripts Created
57+
58+
### 1. `test_strategies.py`
59+
- Validates all strategy files
60+
- Tests planfile validation command
61+
- Tests strategy generation
62+
- Provides detailed error reporting
63+
64+
### 2. `comprehensive_example.py`
65+
- Demonstrates all major planfile features
66+
- Shows strategy validation, generation, application, and review
67+
- Includes project metrics analysis
68+
- Export results to markdown
69+
70+
## Running Examples
71+
72+
```bash
73+
# Test all strategies
74+
python3 planfile/examples/test_strategies.py
75+
76+
# Run comprehensive examples
77+
python3 planfile/examples/comprehensive_example.py
78+
79+
# Run individual examples
80+
python3 planfile/examples/ecosystem/02_mcp_integration.py
81+
python3 planfile/examples/ecosystem/04_llx_integration.py
82+
```
83+
84+
## Key Features Demonstrated
85+
86+
1. **Complex Strategy Definition**
87+
- Multi-sprint planning
88+
- Task dependencies
89+
- Quality gates
90+
- Resource estimation
91+
92+
2. **Integration Capabilities**
93+
- MCP tools integration
94+
- LLX metric-driven planning
95+
- Proxy routing for LLMs
96+
97+
3. **CLI Operations**
98+
- Strategy validation
99+
- Generation with LLM
100+
- Application to backends
101+
- Progress review
102+
103+
4. **Advanced Features**
104+
- Model hints for optimal LLM selection
105+
- Task categorization
106+
- Metrics tracking
107+
- Export capabilities
108+
109+
## Next Steps for Users
110+
111+
1. **Explore Strategies**: Review the 5 example strategies to understand different approaches
112+
2. **Create Custom Strategies**: Use these as templates for your own projects
113+
3. **Configure Backends**: Set up GitHub, Jira, or GitLab integration
114+
4. **Enable LLM Features**: Set OPENROUTER_API_KEY for AI-powered generation
115+
5. **Monitor Progress**: Use the review command to track implementation
116+
117+
## Documentation
118+
- See `planfile/examples/README.md` for more details
119+
- Check individual strategy files for inline documentation
120+
- Review the comprehensive example for usage patterns

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.17
1+
0.1.18

llx-config-for-planfile.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
analysis:
2+
exclude_patterns:
3+
- '*/__pycache__/*'
4+
- '*/venv/*'
5+
- '*/.tox/*'
6+
- '*/tests/*'
7+
metrics:
8+
complexity:
9+
threshold:
10+
high: 15
11+
low: 5
12+
medium: 10
13+
tool: code2llm
14+
coverage:
15+
exclude_test_files: false
16+
tool: vallm
17+
duplication:
18+
min_duplicates: 2
19+
min_lines: 10
20+
tool: redup
21+
tools:
22+
- code2llm
23+
- redup
24+
- vallm
25+
integration:
26+
planfile:
27+
auto_analyze: true
28+
cache_metrics: true
29+
cache_ttl: 3600
30+
export_format: yaml
31+
model_selection:
32+
fallback: anthropic/claude-sonnet-4
33+
rules:
34+
- conditions:
35+
avg_cc:
36+
gt: 8
37+
god_modules:
38+
gt: 0
39+
max_cc:
40+
gt: 20
41+
models:
42+
- anthropic/claude-opus-4
43+
name: high_complexity_refactor
44+
reasoning: High complexity requires strongest model
45+
- conditions:
46+
avg_cc:
47+
gt: 4
48+
lte: 8
49+
total_files:
50+
gt: 20
51+
models:
52+
- anthropic/claude-sonnet-4
53+
- openai/gpt-4
54+
name: medium_complexity_refactor
55+
reasoning: Medium complexity needs balanced model
56+
- conditions:
57+
avg_cc:
58+
lte: 4
59+
task_type:
60+
- test
61+
- docs
62+
models:
63+
- anthropic/claude-haiku-4.5
64+
- openai/gpt-3.5-turbo
65+
name: low_complexity_tasks
66+
reasoning: Simple tasks can use cheaper models

llx-driven-strategy.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
project:
2+
metrics:
3+
avg_cc: 33.5
4+
complexity_score: 80.5
5+
max_cc: 960
6+
total_files: 3837
7+
total_lines: 1486822
8+
name: ''
9+
quality_gates:
10+
- current: 33.498566588480585
11+
metric: avg_cc
12+
name: Cyclomatic Complexity
13+
operator: <=
14+
threshold: 20.09913995308835
15+
- current: 0
16+
metric: test_coverage
17+
name: Test Coverage
18+
operator: '>='
19+
threshold: 80
20+
- current: 0
21+
metric: duplication_percent
22+
name: Code Duplication
23+
operator: <=
24+
threshold: 5
25+
sprints:
26+
- goal: Reduce max CC from 960 to <15
27+
id: sprint-1
28+
name: Critical Complexity Reduction
29+
task_patterns:
30+
- estimated_hours: 4
31+
model_hints:
32+
implementation: anthropic/claude-opus-4
33+
planning: anthropic/claude-opus-4
34+
review: anthropic/claude-opus-4
35+
name: "Fix 1 critical functions (CC\u226515)"
36+
priority: critical
37+
task_type: refactor
38+
- estimated_hours: 8
39+
model_hints:
40+
implementation: anthropic/claude-opus-4
41+
planning: anthropic/claude-opus-4
42+
review: anthropic/claude-opus-4
43+
name: Split 1 god modules
44+
priority: critical
45+
task_type: refactor
46+
- goal: Improve maintainability and reduce duplication
47+
id: sprint-2
48+
name: Code Quality Enhancement
49+
task_patterns:
50+
- estimated_hours: 383
51+
model_hints:
52+
implementation: anthropic/claude-opus-4
53+
planning: anthropic/claude-opus-4
54+
review: anthropic/claude-opus-4
55+
name: Improve code structure and patterns
56+
priority: medium
57+
task_type: refactor
58+
- goal: Achieve 80% test coverage and complete documentation
59+
id: sprint-3
60+
name: Testing & Documentation
61+
task_patterns:
62+
- estimated_hours: 1534
63+
model_hints:
64+
implementation: anthropic/claude-sonnet-4
65+
planning: anthropic/claude-sonnet-4
66+
review: anthropic/claude-sonnet-4
67+
name: Add comprehensive test suite (767 tests)
68+
priority: high
69+
task_type: test
70+
- estimated_hours: 765
71+
model_hints:
72+
implementation: anthropic/claude-sonnet-4
73+
planning: anthropic/claude-sonnet-4
74+
review: anthropic/claude-sonnet-4
75+
name: Generate documentation (255 docs)
76+
priority: medium
77+
task_type: docs

mcp-server-example.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# Example MCP Server Integration
3+
from mcp.server import Server
4+
from mcp.server.stdio import stdio_server
5+
from planfile.mcp import handle_planfile_generate, handle_planfile_apply, handle_planfile_review
6+
7+
app = Server("planfile-mcp")
8+
9+
@app.call_tool()
10+
async def planfile_generate(arguments):
11+
return await handle_planfile_generate(arguments)
12+
13+
@app.call_tool()
14+
async def planfile_apply(arguments):
15+
return await handle_planfile_apply(arguments)
16+
17+
@app.call_tool()
18+
async def planfile_review(arguments):
19+
return await handle_planfile_review(arguments)
20+
21+
async def main():
22+
async with stdio_server() as (read_stream, write_stream):
23+
await app.run(read_stream, write_stream)
24+
25+
if __name__ == "__main__":
26+
import asyncio
27+
asyncio.run(main())

0 commit comments

Comments
 (0)