Pattern-based AI orchestration platform development guide. Focuses on universal work patterns, emergent safety, API-first architecture, and autonomous execution capabilities.
You are working on **Weave**, a pattern-based AI work orchestration platform that enables safe, autonomous AI-assisted technical work across any domain.
**"Recognize patterns, not domains. Enable work, not categories."**
Weave is an **API-first platform** that:
```
CLI / Web UI / SDKs / Direct API
↓
Core API Server (FastAPI)
↓
Pattern Recognition | Orchestration Engine | Safety Framework
```
1. **Type hints**: 100% coverage for all public APIs
2. **Testing**: Minimum 90% coverage with focus on pattern detection
3. **Documentation**: Every pattern and operation must have examples
4. **Async-first**: All I/O operations must be async
When implementing new patterns, follow these steps:
1. **Define the operation sequence** - What steps does this pattern execute?
2. **Create detection heuristics** - How do we identify this pattern from natural language?
3. **Build safety constraints** - What guardrails are needed?
4. **Add validation criteria** - How do we verify success?
5. **Include usage examples** - Document real-world use cases
Example pattern implementation:
```python
class RefactoringPattern(WorkPattern):
"""Pattern for code improvement without behavior change"""
operations = [
Operation.LOAD_DATA, # Load existing code
Operation.ANALYZE, # Understand structure
Operation.GENERATE, # Create improved version
Operation.VALIDATE, # Ensure behavior unchanged
Operation.PERSIST # Save if valid
]
async def detect(self, description: str, context: dict) -> float:
markers = ["refactor", "clean up", "improve", "reorganize"]
return calculate_match_score(description, markers)
```
Prefer context-aware detection over domain-specific assumptions:
```python
if domain == "clinical":
apply_hipaa_rules()
if context.has_sensitive_data():
apply_privacy_protection()
```
All technical work reduces to combinations of:
Safety rules emerge from context, not predefined categories:
```python
risk_factors = await detect_risks(context)
safety_controls = await generate_controls(risk_factors)
```
```python
async def test_pattern_detection():
tasks = [
"refactor this messy function",
"clean up the code structure",
"improve readability without changing behavior"
]
for task in tasks:
pattern = await detector.detect(task)
assert isinstance(pattern, RefactoringPattern)
```
```python
async def test_safety_emergence():
context = {"files": ["users.db", "passwords.txt"]}
constraints = await safety.derive_constraints(context)
assert constraints.has_privacy_protection()
assert constraints.requires_encryption()
```
The primary interface is natural language:
```python
@app.post("/execute")
async def execute_task(request: TaskRequest):
context = await analyzer.analyze(request.description)
patterns = await detector.detect_patterns(context)
result = await executor.execute(request.description, patterns[0])
return result
```
Users can hint at patterns for faster execution:
```python
@app.post("/execute/{pattern}")
async def execute_with_pattern(pattern: str, request: TaskRequest):
pattern_impl = registry.get_pattern(pattern)
return await executor.execute(request.description, pattern_impl)
```
Security controls match risk level:
```python
async def apply_controls(self, context: WorkContext):
risk_level = await self.assess_risk(context)
if risk_level == RiskLevel.CRITICAL:
return MaximalSecurityProfile()
elif risk_level == RiskLevel.STANDARD:
return StandardSecurityProfile()
else:
return MinimalSecurityProfile()
```
"Try different approaches to solve a problem"
"Process data through sequential steps"
"Understand data or code"
"Create new artifacts"
**Why Patterns Over Domains?**
**Why Container Isolation?**
**Why Trust-Based Autonomy?**
Every feature you build should:
The goal is not to categorize work, but to understand and enable it.
```bash
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest
uvicorn src.main:app --reload
```
When implementing features, always prioritize pattern-based thinking over domain-specific assumptions, maintain 100% type coverage, ensure async-first design, and implement emergent safety controls based on detected context.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/weave-development-guidelines/raw