Compare commits
10 Commits
402efc3fea
...
4debcf00de
| Author | SHA1 | Date | |
|---|---|---|---|
| 4debcf00de | |||
| 539657f83f | |||
| d88a4190b0 | |||
| 4a4e41260d | |||
| 44ed4c59d6 | |||
| 6602791523 | |||
| b3a3fee38b | |||
| 6d604ef045 | |||
| 2f5600aeb0 | |||
| b67286c712 |
205
skills/ai-providers/synthetic-new.md
Normal file
205
skills/ai-providers/synthetic-new.md
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
# Skill: AI Provider - synthetic.new
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Primary AI provider for the Mylder platform. OpenAI-compatible API with access to DeepSeek, Kimi, and other high-performance models.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
**PRIMARY** - Use for all AI tasks unless fallback needed.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
```yaml
|
||||||
|
provider: synthetic.new
|
||||||
|
base_url: https://api.synthetic.new/openai/v1
|
||||||
|
api_key_env: SYNTHETIC_AI_API_KEY
|
||||||
|
compatibility: openai
|
||||||
|
rate_limit: 100 requests/minute
|
||||||
|
```
|
||||||
|
|
||||||
|
## Available Models
|
||||||
|
|
||||||
|
### DeepSeek-V3 (Coding & Implementation)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"model_id": "hf:deepseek-ai/DeepSeek-V3",
|
||||||
|
"best_for": ["code_generation", "implementation", "debugging", "refactoring"],
|
||||||
|
"context_window": 128000,
|
||||||
|
"max_output": 8192,
|
||||||
|
"temperature_range": [0.0, 2.0],
|
||||||
|
"recommended_temp": 0.3
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Use when:**
|
||||||
|
- Writing production code
|
||||||
|
- Debugging issues
|
||||||
|
- Code refactoring
|
||||||
|
- API implementation
|
||||||
|
- Database queries
|
||||||
|
|
||||||
|
### Kimi-K2-Thinking (Planning & Reasoning)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"model_id": "hf:moonshotai/Kimi-K2-Thinking",
|
||||||
|
"best_for": ["planning", "reasoning", "analysis", "architecture"],
|
||||||
|
"context_window": 200000,
|
||||||
|
"max_output": 4096,
|
||||||
|
"temperature_range": [0.0, 1.0],
|
||||||
|
"recommended_temp": 0.5
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Use when:**
|
||||||
|
- Task planning
|
||||||
|
- Architecture decisions
|
||||||
|
- Complex reasoning
|
||||||
|
- Research synthesis
|
||||||
|
- Trade-off analysis
|
||||||
|
|
||||||
|
## Model Selection Logic
|
||||||
|
```javascript
|
||||||
|
function selectModel(taskType, complexity) {
|
||||||
|
const modelMap = {
|
||||||
|
// Planning & Design
|
||||||
|
'research': 'hf:moonshotai/Kimi-K2-Thinking',
|
||||||
|
'planning': 'hf:moonshotai/Kimi-K2-Thinking',
|
||||||
|
'architecture': 'hf:moonshotai/Kimi-K2-Thinking',
|
||||||
|
'analysis': 'hf:moonshotai/Kimi-K2-Thinking',
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
'code': 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
'implementation': 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
'debugging': 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
'testing': 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
'review': 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
|
||||||
|
// Default
|
||||||
|
'default': 'hf:deepseek-ai/DeepSeek-V3'
|
||||||
|
};
|
||||||
|
|
||||||
|
return modelMap[taskType] || modelMap.default;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## n8n Integration
|
||||||
|
|
||||||
|
### HTTP Request Node Configuration
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"url": "https://api.synthetic.new/openai/v1/chat/completions",
|
||||||
|
"headers": {
|
||||||
|
"Authorization": "Bearer {{ $env.SYNTHETIC_AI_API_KEY }}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
"body": {
|
||||||
|
"model": "hf:deepseek-ai/DeepSeek-V3",
|
||||||
|
"messages": [
|
||||||
|
{ "role": "system", "content": "{{ systemPrompt }}" },
|
||||||
|
{ "role": "user", "content": "{{ userPrompt }}" }
|
||||||
|
],
|
||||||
|
"max_tokens": 4000,
|
||||||
|
"temperature": 0.7
|
||||||
|
},
|
||||||
|
"timeout": 120000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Code Node Helper
|
||||||
|
```javascript
|
||||||
|
// AI Request Helper for n8n Code Node
|
||||||
|
async function callSyntheticAI(systemPrompt, userPrompt, options = {}) {
|
||||||
|
const {
|
||||||
|
model = 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
maxTokens = 4000,
|
||||||
|
temperature = 0.7
|
||||||
|
} = options;
|
||||||
|
|
||||||
|
const response = await $http.request({
|
||||||
|
method: 'POST',
|
||||||
|
url: 'https://api.synthetic.new/openai/v1/chat/completions',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${$env.SYNTHETIC_AI_API_KEY}`,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
model,
|
||||||
|
messages: [
|
||||||
|
{ role: 'system', content: systemPrompt },
|
||||||
|
{ role: 'user', content: userPrompt }
|
||||||
|
],
|
||||||
|
max_tokens: maxTokens,
|
||||||
|
temperature
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.choices[0].message.content;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
### Retry Strategy
|
||||||
|
```javascript
|
||||||
|
const retryConfig = {
|
||||||
|
maxRetries: 3,
|
||||||
|
retryDelay: 1000, // ms
|
||||||
|
retryOn: [429, 500, 502, 503, 504],
|
||||||
|
fallbackProvider: 'z.ai' // Switch to fallback after max retries
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Common Errors
|
||||||
|
| Error Code | Cause | Action |
|
||||||
|
|------------|-------|--------|
|
||||||
|
| 401 | Invalid API key | Check SYNTHETIC_AI_API_KEY |
|
||||||
|
| 429 | Rate limit | Retry with backoff or fallback to z.ai |
|
||||||
|
| 500 | Server error | Retry or fallback |
|
||||||
|
| Timeout | Long response | Increase timeout or reduce max_tokens |
|
||||||
|
|
||||||
|
## Cost Optimization
|
||||||
|
|
||||||
|
### Token Estimation
|
||||||
|
```javascript
|
||||||
|
// Rough estimate: 1 token ≈ 4 characters
|
||||||
|
function estimateTokens(text) {
|
||||||
|
return Math.ceil(text.length / 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Budget check before request
|
||||||
|
function checkBudget(input, maxOutput, budgetTokens) {
|
||||||
|
const inputTokens = estimateTokens(input);
|
||||||
|
const totalEstimate = inputTokens + maxOutput;
|
||||||
|
return totalEstimate <= budgetTokens;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Best Practices
|
||||||
|
1. **Use appropriate model** - Kimi for reasoning, DeepSeek for coding
|
||||||
|
2. **Set max_tokens wisely** - Don't over-allocate
|
||||||
|
3. **Cache common responses** - Use KV store for repeated queries
|
||||||
|
4. **Batch similar requests** - Group related tasks
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
```bash
|
||||||
|
# Test API connection
|
||||||
|
curl -X POST https://api.synthetic.new/openai/v1/chat/completions \
|
||||||
|
-H "Authorization: Bearer $SYNTHETIC_AI_API_KEY" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"model": "hf:deepseek-ai/DeepSeek-V3",
|
||||||
|
"messages": [{"role": "user", "content": "Hello"}],
|
||||||
|
"max_tokens": 50
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Related Skills
|
||||||
|
- `ai-providers/z-ai.md` - Fallback provider
|
||||||
|
- `code/implement.md` - Code generation with AI
|
||||||
|
- `design-thinking/ideate.md` - Solution brainstorming
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 500 tokens
|
||||||
|
- Max output: 800 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: haiku (configuration lookup)
|
||||||
261
skills/ai-providers/z-ai.md
Normal file
261
skills/ai-providers/z-ai.md
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
# Skill: AI Provider - z.ai
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Fallback AI provider with GLM (General Language Model) support. Use when synthetic.new is unavailable or when GLM models are superior for specific tasks.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
**FALLBACK** - Use when:
|
||||||
|
1. synthetic.new rate limits or errors
|
||||||
|
2. GLM models outperform alternatives for the task
|
||||||
|
3. New models available earlier on z.ai
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
```yaml
|
||||||
|
provider: z.ai
|
||||||
|
base_url: https://api.z.ai/v1
|
||||||
|
api_key_env: Z_AI_API_KEY
|
||||||
|
compatibility: openai
|
||||||
|
rate_limit: 60 requests/minute
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** API key needs to be configured. Check z.ai dashboard for key generation.
|
||||||
|
|
||||||
|
## Available Models
|
||||||
|
|
||||||
|
### GLM-4-Plus (Reasoning & Analysis)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"model_id": "glm-4-plus",
|
||||||
|
"best_for": ["reasoning", "analysis", "chinese_language", "long_context"],
|
||||||
|
"context_window": 128000,
|
||||||
|
"max_output": 4096,
|
||||||
|
"temperature_range": [0.0, 1.0],
|
||||||
|
"recommended_temp": 0.5,
|
||||||
|
"strengths": ["Chinese content", "Logical reasoning", "Long documents"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Use when:**
|
||||||
|
- Complex logical reasoning
|
||||||
|
- Chinese language content
|
||||||
|
- Long document analysis
|
||||||
|
- Comparative analysis
|
||||||
|
|
||||||
|
### GLM-4-Flash (Fast Responses)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"model_id": "glm-4-flash",
|
||||||
|
"best_for": ["quick_responses", "simple_tasks", "high_volume"],
|
||||||
|
"context_window": 32000,
|
||||||
|
"max_output": 2048,
|
||||||
|
"temperature_range": [0.0, 1.0],
|
||||||
|
"recommended_temp": 0.3,
|
||||||
|
"strengths": ["Speed", "Cost efficiency", "Simple tasks"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Use when:**
|
||||||
|
- Quick classification
|
||||||
|
- Simple transformations
|
||||||
|
- High-volume processing
|
||||||
|
- Cost-sensitive operations
|
||||||
|
|
||||||
|
### GLM-4-Long (Extended Context)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"model_id": "glm-4-long",
|
||||||
|
"best_for": ["long_documents", "codebase_analysis", "summarization"],
|
||||||
|
"context_window": 1000000,
|
||||||
|
"max_output": 4096,
|
||||||
|
"temperature_range": [0.0, 1.0],
|
||||||
|
"recommended_temp": 0.3,
|
||||||
|
"strengths": ["1M token context", "Document processing", "Code analysis"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Use when:**
|
||||||
|
- Entire codebase analysis
|
||||||
|
- Long document summarization
|
||||||
|
- Multi-file code review
|
||||||
|
|
||||||
|
## Model Selection Logic
|
||||||
|
```javascript
|
||||||
|
function selectZAIModel(taskType, contextLength) {
|
||||||
|
// Context-based selection
|
||||||
|
if (contextLength > 128000) {
|
||||||
|
return 'glm-4-long';
|
||||||
|
}
|
||||||
|
|
||||||
|
const modelMap = {
|
||||||
|
// Fast operations
|
||||||
|
'classification': 'glm-4-flash',
|
||||||
|
'extraction': 'glm-4-flash',
|
||||||
|
'simple_qa': 'glm-4-flash',
|
||||||
|
|
||||||
|
// Complex reasoning
|
||||||
|
'reasoning': 'glm-4-plus',
|
||||||
|
'analysis': 'glm-4-plus',
|
||||||
|
'planning': 'glm-4-plus',
|
||||||
|
|
||||||
|
// Long context
|
||||||
|
'codebase': 'glm-4-long',
|
||||||
|
'summarization': 'glm-4-long',
|
||||||
|
|
||||||
|
// Default
|
||||||
|
'default': 'glm-4-plus'
|
||||||
|
};
|
||||||
|
|
||||||
|
return modelMap[taskType] || modelMap.default;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fallback Logic
|
||||||
|
|
||||||
|
### When to Fallback from synthetic.new
|
||||||
|
```javascript
|
||||||
|
async function callWithFallback(systemPrompt, userPrompt, options = {}) {
|
||||||
|
const primaryResult = await callSyntheticAI(systemPrompt, userPrompt, options);
|
||||||
|
|
||||||
|
// Check for fallback conditions
|
||||||
|
if (primaryResult.error) {
|
||||||
|
const errorCode = primaryResult.error.code;
|
||||||
|
|
||||||
|
// Rate limit or server error - fallback to z.ai
|
||||||
|
if ([429, 500, 502, 503, 504].includes(errorCode)) {
|
||||||
|
console.log('Falling back to z.ai');
|
||||||
|
return await callZAI(systemPrompt, userPrompt, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return primaryResult;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GLM Superiority Conditions
|
||||||
|
```javascript
|
||||||
|
function shouldPreferGLM(task) {
|
||||||
|
const glmSuperiorTasks = [
|
||||||
|
'chinese_translation',
|
||||||
|
'chinese_content',
|
||||||
|
'million_token_context',
|
||||||
|
'cost_optimization',
|
||||||
|
'new_model_testing'
|
||||||
|
];
|
||||||
|
|
||||||
|
return glmSuperiorTasks.includes(task.type);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## n8n Integration
|
||||||
|
|
||||||
|
### HTTP Request Node Configuration
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "POST",
|
||||||
|
"url": "https://api.z.ai/v1/chat/completions",
|
||||||
|
"headers": {
|
||||||
|
"Authorization": "Bearer {{ $env.Z_AI_API_KEY }}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
|
"body": {
|
||||||
|
"model": "glm-4-plus",
|
||||||
|
"messages": [
|
||||||
|
{ "role": "system", "content": "{{ systemPrompt }}" },
|
||||||
|
{ "role": "user", "content": "{{ userPrompt }}" }
|
||||||
|
],
|
||||||
|
"max_tokens": 4000,
|
||||||
|
"temperature": 0.5
|
||||||
|
},
|
||||||
|
"timeout": 90000
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Code Node Helper
|
||||||
|
```javascript
|
||||||
|
// z.ai Request Helper for n8n Code Node
|
||||||
|
async function callZAI(systemPrompt, userPrompt, options = {}) {
|
||||||
|
const {
|
||||||
|
model = 'glm-4-plus',
|
||||||
|
maxTokens = 4000,
|
||||||
|
temperature = 0.5
|
||||||
|
} = options;
|
||||||
|
|
||||||
|
const response = await $http.request({
|
||||||
|
method: 'POST',
|
||||||
|
url: 'https://api.z.ai/v1/chat/completions',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${$env.Z_AI_API_KEY}`,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
model,
|
||||||
|
messages: [
|
||||||
|
{ role: 'system', content: systemPrompt },
|
||||||
|
{ role: 'user', content: userPrompt }
|
||||||
|
],
|
||||||
|
max_tokens: maxTokens,
|
||||||
|
temperature
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.choices[0].message.content;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Comparison: synthetic.new vs z.ai
|
||||||
|
|
||||||
|
| Feature | synthetic.new | z.ai |
|
||||||
|
|---------|---------------|------|
|
||||||
|
| Primary Use | All tasks | Fallback + GLM tasks |
|
||||||
|
| Best Model (Code) | DeepSeek-V3 | GLM-4-Flash |
|
||||||
|
| Best Model (Reasoning) | Kimi-K2-Thinking | GLM-4-Plus |
|
||||||
|
| Max Context | 200K | 1M (GLM-4-Long) |
|
||||||
|
| Chinese Support | Good | Excellent |
|
||||||
|
| Rate Limit | 100/min | 60/min |
|
||||||
|
| Cost | Standard | Lower (Flash) |
|
||||||
|
|
||||||
|
## Setup Instructions
|
||||||
|
|
||||||
|
### 1. Get API Key
|
||||||
|
1. Visit https://z.ai/dashboard
|
||||||
|
2. Create account or login
|
||||||
|
3. Navigate to API Keys
|
||||||
|
4. Generate new key
|
||||||
|
5. Store as `Z_AI_API_KEY` environment variable
|
||||||
|
|
||||||
|
### 2. Configure in Coolify
|
||||||
|
```bash
|
||||||
|
# Add to service environment variables
|
||||||
|
Z_AI_API_KEY=your_key_here
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Test Connection
|
||||||
|
```bash
|
||||||
|
curl -X POST https://api.z.ai/v1/chat/completions \
|
||||||
|
-H "Authorization: Bearer $Z_AI_API_KEY" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"model": "glm-4-flash",
|
||||||
|
"messages": [{"role": "user", "content": "Hello"}],
|
||||||
|
"max_tokens": 50
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
| Error Code | Cause | Action |
|
||||||
|
|------------|-------|--------|
|
||||||
|
| 401 | Invalid API key | Check Z_AI_API_KEY |
|
||||||
|
| 429 | Rate limit | Wait and retry |
|
||||||
|
| 400 | Invalid model | Check model name |
|
||||||
|
|
||||||
|
## Related Skills
|
||||||
|
- `ai-providers/synthetic-new.md` - Primary provider
|
||||||
|
- `code/implement.md` - Code generation
|
||||||
|
- `design-thinking/ideate.md` - Solution brainstorming
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 500 tokens
|
||||||
|
- Max output: 800 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: haiku (configuration lookup)
|
||||||
179
skills/design-thinking/define.md
Normal file
179
skills/design-thinking/define.md
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
# Skill: Design Thinking - Define
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Transform empathy insights into clear, actionable problem statements that guide solution development.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **empathy_data**: User research, pain points, personas from empathize phase (required)
|
||||||
|
- **business_context**: Business goals and constraints (optional)
|
||||||
|
- **success_metrics**: How to measure if problem is solved (optional)
|
||||||
|
|
||||||
|
## Problem Framing Techniques
|
||||||
|
|
||||||
|
### 1. How Might We (HMW) Questions
|
||||||
|
Transform insights into opportunity questions:
|
||||||
|
|
||||||
|
**Formula:**
|
||||||
|
```
|
||||||
|
How might we [ACTION] for [USER] so that [BENEFIT]?
|
||||||
|
```
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
- Too broad: "How might we improve the product?"
|
||||||
|
- Too narrow: "How might we add a red button?"
|
||||||
|
- Just right: "How might we reduce campaign setup time for marketing managers so they can focus on creative work?"
|
||||||
|
|
||||||
|
**Best Practices:**
|
||||||
|
- Start with user pain point
|
||||||
|
- Frame as opportunity, not solution
|
||||||
|
- Make it actionable and inspiring
|
||||||
|
- Generate 5-10 HMW variations
|
||||||
|
- Vote on most impactful
|
||||||
|
|
||||||
|
### 2. User Persona Creation
|
||||||
|
|
||||||
|
**Template:**
|
||||||
|
```markdown
|
||||||
|
## [Name] - [Role/Title]
|
||||||
|
|
||||||
|
**Demographics:**
|
||||||
|
- Role: [Job title/context]
|
||||||
|
- Experience: [Years/skill level]
|
||||||
|
- Tech savvy: [Low/Medium/High]
|
||||||
|
|
||||||
|
**Context:**
|
||||||
|
- Frequency: [How often they use product]
|
||||||
|
- Environment: [Where/when they work]
|
||||||
|
- Tools: [Current tools in workflow]
|
||||||
|
|
||||||
|
**Goals:**
|
||||||
|
1. [Primary goal]
|
||||||
|
2. [Secondary goal]
|
||||||
|
3. [Tertiary goal]
|
||||||
|
|
||||||
|
**Frustrations:**
|
||||||
|
1. [Critical pain point]
|
||||||
|
2. [High priority pain]
|
||||||
|
3. [Medium priority pain]
|
||||||
|
|
||||||
|
**Quote:**
|
||||||
|
"[Most revealing user quote]"
|
||||||
|
|
||||||
|
**Success looks like:**
|
||||||
|
- [Specific outcome 1]
|
||||||
|
- [Specific outcome 2]
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Journey Mapping
|
||||||
|
|
||||||
|
**5-Stage Journey:**
|
||||||
|
```
|
||||||
|
1. AWARENESS
|
||||||
|
Current: How do they discover the problem?
|
||||||
|
Pain: What friction exists?
|
||||||
|
|
||||||
|
2. CONSIDERATION
|
||||||
|
Current: How do they evaluate options?
|
||||||
|
Pain: What makes decision hard?
|
||||||
|
|
||||||
|
3. ONBOARDING
|
||||||
|
Current: First interaction with solution
|
||||||
|
Pain: Where do they get stuck?
|
||||||
|
|
||||||
|
4. USAGE
|
||||||
|
Current: Day-to-day interaction
|
||||||
|
Pain: What slows them down?
|
||||||
|
|
||||||
|
5. MASTERY
|
||||||
|
Current: Advanced use cases
|
||||||
|
Pain: What limitations hit them?
|
||||||
|
```
|
||||||
|
|
||||||
|
**For each stage identify:**
|
||||||
|
- User actions
|
||||||
|
- Pain points
|
||||||
|
- Emotions
|
||||||
|
- Opportunities
|
||||||
|
|
||||||
|
### 4. Insight Synthesis
|
||||||
|
|
||||||
|
**Pattern Recognition:**
|
||||||
|
- What do 3+ users complain about?
|
||||||
|
- What workarounds exist everywhere?
|
||||||
|
- What causes universal frustration?
|
||||||
|
- What do users wish for?
|
||||||
|
|
||||||
|
**Insight Template:**
|
||||||
|
```
|
||||||
|
[USER SEGMENT] needs a way to [USER NEED]
|
||||||
|
because [UNDERLYING CAUSE]
|
||||||
|
but currently [OBSTACLE/PAIN POINT]
|
||||||
|
which makes them feel [EMOTION].
|
||||||
|
|
||||||
|
This matters because [BUSINESS IMPACT].
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"problem_statement": {
|
||||||
|
"hmw": "How might we reduce campaign setup from 2 hours to 5 minutes for marketing managers so they can focus on creative work instead of manual data entry?",
|
||||||
|
"user_need": "Fast, error-free campaign creation",
|
||||||
|
"current_obstacle": "Manual multi-step process across 3 tools",
|
||||||
|
"why_it_matters": "6 users waste 12+ hours/week on repetitive setup"
|
||||||
|
},
|
||||||
|
"primary_persona": {
|
||||||
|
"name": "Sarah - Marketing Manager",
|
||||||
|
"role": "Creates 10+ campaigns/month",
|
||||||
|
"tech_level": "medium",
|
||||||
|
"goals": ["Speed", "Accuracy", "Consistency"],
|
||||||
|
"frustrations": ["2-hour manual setup", "Copy-paste errors", "No templates"],
|
||||||
|
"quote": "I spend more time on setup than on actual creative work",
|
||||||
|
"success_criteria": "Setup in <5 minutes with zero errors"
|
||||||
|
},
|
||||||
|
"journey_pain_points": {
|
||||||
|
"awareness": "Doesnt know better solution exists",
|
||||||
|
"consideration": "Afraid to change familiar workflow",
|
||||||
|
"onboarding": "Learning curve interrupts daily work",
|
||||||
|
"usage": "Repetitive steps feel wasteful",
|
||||||
|
"mastery": "No way to save or reuse configurations"
|
||||||
|
},
|
||||||
|
"key_insights": [
|
||||||
|
"Users value speed over features",
|
||||||
|
"Fear of errors drives defensive behavior",
|
||||||
|
"Templates would eliminate 80% of manual work"
|
||||||
|
],
|
||||||
|
"success_metrics": [
|
||||||
|
"Campaign setup time: 2 hours -> 5 minutes",
|
||||||
|
"Setup errors: 15% -> 0%",
|
||||||
|
"User satisfaction: 3/10 -> 9/10"
|
||||||
|
],
|
||||||
|
"next_step": "Generate solutions with /dt ideate"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] Problem statement is specific and measurable
|
||||||
|
- [ ] HMW question is actionable and inspiring
|
||||||
|
- [ ] Persona based on real user data
|
||||||
|
- [ ] Journey map identifies 3+ major pain points
|
||||||
|
- [ ] Success metrics are quantifiable
|
||||||
|
- [ ] Insights synthesized from patterns, not single users
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 1200 tokens
|
||||||
|
- Max output: 1800 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (synthesis and analysis)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "A problem well-stated is a problem half-solved."
|
||||||
|
> Clarity in definition prevents wasted effort in ideation.
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- One clear problem per HMW
|
||||||
|
- Personas grounded in research
|
||||||
|
- Measurable success criteria
|
||||||
|
- User language, not jargon
|
||||||
152
skills/design-thinking/empathize.md
Normal file
152
skills/design-thinking/empathize.md
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
# Skill: Design Thinking - Empathize
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Deeply understand users through research, interviews, and observation to identify real pain points and needs.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **context**: Product/feature context (required)
|
||||||
|
- **target_users**: User segments to research (required)
|
||||||
|
- **research_type**: interview|observation|survey|analytics (optional, default: interview)
|
||||||
|
- **existing_data**: Current user feedback/analytics (optional)
|
||||||
|
|
||||||
|
## Research Techniques
|
||||||
|
|
||||||
|
### 1. User Interviews
|
||||||
|
**Framework: TEDW**
|
||||||
|
- **Tell** me about the last time you...
|
||||||
|
- **Explain** your workflow for...
|
||||||
|
- **Describe** the biggest challenge with...
|
||||||
|
- **Walk** me through how you currently...
|
||||||
|
|
||||||
|
**Best Practices:**
|
||||||
|
- 5-7 users per segment minimum
|
||||||
|
- Open-ended questions only
|
||||||
|
- Listen 80%, talk 20%
|
||||||
|
- Ask "why" 5 times (5 Whys technique)
|
||||||
|
- Record exact quotes for later synthesis
|
||||||
|
|
||||||
|
### 2. Pain Point Identification
|
||||||
|
**Severity Matrix:**
|
||||||
|
- **Critical**: Blocks core workflow, happens daily
|
||||||
|
- **High**: Major frustration, weekly occurrence
|
||||||
|
- **Medium**: Annoying but workaround exists
|
||||||
|
- **Low**: Minor inconvenience, rare
|
||||||
|
|
||||||
|
**Indicators:**
|
||||||
|
- User workarounds/hacks
|
||||||
|
- Manual data entry
|
||||||
|
- Switching between tools
|
||||||
|
- Waiting/delays
|
||||||
|
- Errors/mistakes
|
||||||
|
- Emotional language ("frustrating", "annoying")
|
||||||
|
|
||||||
|
### 3. Empathy Mapping Template
|
||||||
|
|
||||||
|
```
|
||||||
|
SAYS (verbatim quotes)
|
||||||
|
"I waste 2 hours every week on..."
|
||||||
|
"Its so frustrating when..."
|
||||||
|
|
||||||
|
THINKS (unspoken concerns)
|
||||||
|
- Worried about making mistakes
|
||||||
|
- Unsure if doing it right
|
||||||
|
- Feels inefficient
|
||||||
|
|
||||||
|
DOES (observed behaviors)
|
||||||
|
- Opens 5 tabs to complete one task
|
||||||
|
- Double-checks every entry
|
||||||
|
- Asks colleagues for help
|
||||||
|
|
||||||
|
FEELS (emotions)
|
||||||
|
- Frustrated with repetitive work
|
||||||
|
- Anxious about errors
|
||||||
|
- Overwhelmed by complexity
|
||||||
|
|
||||||
|
PAIN POINTS
|
||||||
|
- [Critical pain identified]
|
||||||
|
- [High priority pain]
|
||||||
|
|
||||||
|
GAINS (what success looks like)
|
||||||
|
- Completes task in <5 minutes
|
||||||
|
- Confident in accuracy
|
||||||
|
- No context switching
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Observation Techniques
|
||||||
|
**Contextual Inquiry:**
|
||||||
|
- Shadow users in their environment
|
||||||
|
- Note workarounds and hacks
|
||||||
|
- Identify unstated needs
|
||||||
|
- Look for patterns across users
|
||||||
|
|
||||||
|
**What to Observe:**
|
||||||
|
- Where do they slow down?
|
||||||
|
- When do they switch tools?
|
||||||
|
- What causes confusion/errors?
|
||||||
|
- What do they complain about?
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"research_summary": {
|
||||||
|
"users_interviewed": 7,
|
||||||
|
"segments": ["power_users", "occasional_users"],
|
||||||
|
"methods": ["interview", "observation"]
|
||||||
|
},
|
||||||
|
"user_personas": [
|
||||||
|
{
|
||||||
|
"name": "Sarah - Marketing Manager",
|
||||||
|
"context": "Creates 10+ campaigns/month",
|
||||||
|
"goals": ["Speed", "Consistency", "Analytics"],
|
||||||
|
"frustrations": ["Manual data entry", "Lost context"],
|
||||||
|
"quote": "I spend more time copying data than creating campaigns"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pain_points": [
|
||||||
|
{
|
||||||
|
"description": "Manual campaign setup takes 2+ hours",
|
||||||
|
"severity": "critical",
|
||||||
|
"frequency": "daily",
|
||||||
|
"users_affected": 6,
|
||||||
|
"evidence": ["Quote 1", "Quote 2"],
|
||||||
|
"current_workaround": "Excel templates + copy-paste"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"empathy_insights": [
|
||||||
|
"Users prioritize speed over features",
|
||||||
|
"Fear of making mistakes drives behavior",
|
||||||
|
"Existing tools lack integration"
|
||||||
|
],
|
||||||
|
"key_quotes": [
|
||||||
|
"I waste 2 hours every week on manual setup",
|
||||||
|
"Im never confident I did it right"
|
||||||
|
],
|
||||||
|
"next_step": "Define problem with /dt define"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] At least 5 users per segment
|
||||||
|
- [ ] Mix of qualitative + quantitative data
|
||||||
|
- [ ] Clear pain points with severity ratings
|
||||||
|
- [ ] Verbatim user quotes captured
|
||||||
|
- [ ] Patterns identified across users
|
||||||
|
- [ ] Jobs-to-be-done understood
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 800 tokens
|
||||||
|
- Max output: 2000 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (deep analysis)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "People dont want a quarter-inch drill. They want a quarter-inch hole."
|
||||||
|
> Focus on the underlying need, not the stated solution.
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- Real users, real problems
|
||||||
|
- Evidence over assumptions
|
||||||
|
- Quality over quantity of feedback
|
||||||
|
- Deep understanding over surface-level
|
||||||
267
skills/design-thinking/loop.md
Normal file
267
skills/design-thinking/loop.md
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
# Skill: Design Thinking - Loop
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Connect all phases of design thinking into a continuous improvement cycle, with clear decision points for iteration vs shipping.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **phase_results**: Results from empathize, define, ideate, prototype, test phases (required)
|
||||||
|
- **iteration_number**: Which iteration is this (optional, default: 1)
|
||||||
|
- **time_constraint**: Timeline for shipping (optional)
|
||||||
|
- **quality_bar**: Minimum quality requirements (optional)
|
||||||
|
|
||||||
|
## The Continuous Loop
|
||||||
|
|
||||||
|
### Full Cycle Flow
|
||||||
|
```
|
||||||
|
EMPATHIZE → DEFINE → IDEATE → PROTOTYPE → TEST
|
||||||
|
↑ ↓
|
||||||
|
└──────────── LOOP BACK ───────────────┘
|
||||||
|
|
||||||
|
Decision Points:
|
||||||
|
1. After TEST: Ship, Iterate, or Pivot?
|
||||||
|
2. If Iterate: Which phase to revisit?
|
||||||
|
3. If Pivot: Back to Empathize or Define?
|
||||||
|
```
|
||||||
|
|
||||||
|
### Loop Decision Framework
|
||||||
|
|
||||||
|
**Decision Matrix:**
|
||||||
|
```
|
||||||
|
Test Results → Next Action
|
||||||
|
|
||||||
|
SHIP:
|
||||||
|
- Success rate: >80%
|
||||||
|
- User satisfaction: >4/5
|
||||||
|
- No critical issues
|
||||||
|
- Meets business goals
|
||||||
|
→ Action: Deploy to production
|
||||||
|
|
||||||
|
ITERATE (Minor):
|
||||||
|
- Success rate: 60-80%
|
||||||
|
- 2-3 moderate issues
|
||||||
|
- Core concept works
|
||||||
|
- Quick fixes available
|
||||||
|
→ Action: PROTOTYPE → TEST
|
||||||
|
|
||||||
|
ITERATE (Major):
|
||||||
|
- Success rate: 40-60%
|
||||||
|
- Multiple issues
|
||||||
|
- Concept solid but execution off
|
||||||
|
- Need design changes
|
||||||
|
→ Action: IDEATE → PROTOTYPE → TEST
|
||||||
|
|
||||||
|
PIVOT:
|
||||||
|
- Success rate: <40%
|
||||||
|
- Wrong problem solved
|
||||||
|
- Users prefer current solution
|
||||||
|
- Fundamental assumption wrong
|
||||||
|
→ Action: EMPATHIZE or DEFINE
|
||||||
|
```
|
||||||
|
|
||||||
|
### When to Loop Back to Each Phase
|
||||||
|
|
||||||
|
**Back to EMPATHIZE if:**
|
||||||
|
- Users dont have the problem you thought
|
||||||
|
- Your solution solves wrong pain point
|
||||||
|
- Missing key user segment
|
||||||
|
- Assumptions about users proven wrong
|
||||||
|
|
||||||
|
**Back to DEFINE if:**
|
||||||
|
- Problem statement too broad/narrow
|
||||||
|
- Wrong success metrics
|
||||||
|
- HMW question leads to wrong solutions
|
||||||
|
- Persona doesnt match real users
|
||||||
|
|
||||||
|
**Back to IDEATE if:**
|
||||||
|
- Solution works but not optimal
|
||||||
|
- Better ideas emerged during testing
|
||||||
|
- Technical constraints changed
|
||||||
|
- Simpler approach possible
|
||||||
|
|
||||||
|
**Back to PROTOTYPE if:**
|
||||||
|
- Concept good, execution poor
|
||||||
|
- Usability issues in UI/UX
|
||||||
|
- Need higher/lower fidelity
|
||||||
|
- Technical implementation issues
|
||||||
|
|
||||||
|
**Rerun TEST if:**
|
||||||
|
- Fixed critical issues
|
||||||
|
- Changed user segment
|
||||||
|
- Need more data
|
||||||
|
- A/B test needed
|
||||||
|
|
||||||
|
## Iteration Velocity
|
||||||
|
|
||||||
|
### Fast Iteration Cycles
|
||||||
|
```
|
||||||
|
Week 1:
|
||||||
|
- Mon: Empathize (existing data)
|
||||||
|
- Tue: Define + Ideate
|
||||||
|
- Wed: Prototype (lo-fi)
|
||||||
|
- Thu: Test (3-5 users)
|
||||||
|
- Fri: Loop decision
|
||||||
|
|
||||||
|
Week 2:
|
||||||
|
- Mon-Tue: Iterate prototype
|
||||||
|
- Wed: Test again
|
||||||
|
- Thu: Ship or continue
|
||||||
|
```
|
||||||
|
|
||||||
|
### Quality vs Speed Trade-offs
|
||||||
|
```
|
||||||
|
Speed Priority:
|
||||||
|
- Lo-fi prototypes
|
||||||
|
- 3-user tests
|
||||||
|
- Ship at 70% quality
|
||||||
|
- Fix in production
|
||||||
|
|
||||||
|
Quality Priority:
|
||||||
|
- Hi-fi prototypes
|
||||||
|
- 10+ user tests
|
||||||
|
- Ship at 95% quality
|
||||||
|
- Polish before launch
|
||||||
|
|
||||||
|
Balanced:
|
||||||
|
- Med-fi prototypes
|
||||||
|
- 5-user tests
|
||||||
|
- Ship at 80% quality
|
||||||
|
- Plan iteration post-launch
|
||||||
|
```
|
||||||
|
|
||||||
|
## Metrics That Matter
|
||||||
|
|
||||||
|
### Leading Indicators (Predict Success)
|
||||||
|
```
|
||||||
|
Empathize:
|
||||||
|
- Users interviewed per segment
|
||||||
|
- Pain points validated by 3+ users
|
||||||
|
- Quote-to-insight ratio
|
||||||
|
|
||||||
|
Define:
|
||||||
|
- HMW clarity score (1-5)
|
||||||
|
- Stakeholder alignment (%)
|
||||||
|
- Success metric specificity
|
||||||
|
|
||||||
|
Ideate:
|
||||||
|
- Ideas per session
|
||||||
|
- Effort/Impact scoring
|
||||||
|
- Idea diversity
|
||||||
|
|
||||||
|
Prototype:
|
||||||
|
- Build time vs plan
|
||||||
|
- Component reuse rate
|
||||||
|
- Fidelity appropriate for stage
|
||||||
|
|
||||||
|
Test:
|
||||||
|
- User completion rate
|
||||||
|
- Time on task vs target
|
||||||
|
- SUS score
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lagging Indicators (Measure Impact)
|
||||||
|
```
|
||||||
|
Post-Launch:
|
||||||
|
- User adoption rate
|
||||||
|
- Feature usage frequency
|
||||||
|
- Support tickets (fewer = better)
|
||||||
|
- User satisfaction (NPS)
|
||||||
|
- Business metrics (revenue, retention)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"iteration": 2,
|
||||||
|
"cycle_summary": {
|
||||||
|
"empathize": "5 users interviewed, 3 critical pains identified",
|
||||||
|
"define": "HMW: Reduce setup time from 2hr to 5min",
|
||||||
|
"ideate": "8 ideas generated, selected template-based approach",
|
||||||
|
"prototype": "Med-fi prototype, 6hrs build time",
|
||||||
|
"test": "80% success rate, SUS score 72"
|
||||||
|
},
|
||||||
|
"decision": {
|
||||||
|
"verdict": "iterate_minor",
|
||||||
|
"confidence": "high",
|
||||||
|
"reasoning": "Core flow works but 2 UX issues need fixing"
|
||||||
|
},
|
||||||
|
"loop_back_to": "prototype",
|
||||||
|
"changes_needed": [
|
||||||
|
"Add template preview on hover",
|
||||||
|
"Improve success confirmation message"
|
||||||
|
],
|
||||||
|
"estimated_effort": "4 hours",
|
||||||
|
"next_test_plan": {
|
||||||
|
"users": 3,
|
||||||
|
"focus": "Template selection UX",
|
||||||
|
"success_criteria": "90% success rate on template task"
|
||||||
|
},
|
||||||
|
"ship_criteria": {
|
||||||
|
"must_have": [
|
||||||
|
"90% task completion",
|
||||||
|
"SUS score > 75",
|
||||||
|
"Zero critical issues"
|
||||||
|
],
|
||||||
|
"nice_to_have": [
|
||||||
|
"Template customization",
|
||||||
|
"Saved templates"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timeline": {
|
||||||
|
"this_iteration": "3 days",
|
||||||
|
"total_so_far": "10 days",
|
||||||
|
"target_ship": "14 days"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] Clear decision made (ship/iterate/pivot)
|
||||||
|
- [ ] Loop target phase identified
|
||||||
|
- [ ] Specific changes documented
|
||||||
|
- [ ] Success criteria for next iteration defined
|
||||||
|
- [ ] Timeline realistic
|
||||||
|
- [ ] Learning captured for future iterations
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 1500 tokens
|
||||||
|
- Max output: 2000 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (strategic reasoning)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "Done is better than perfect. But learning is better than done."
|
||||||
|
> Ship fast, learn faster, improve continuously.
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- Small iterations beat big leaps
|
||||||
|
- Test assumptions early
|
||||||
|
- Fail fast, learn faster
|
||||||
|
- Perfect is the enemy of shipped
|
||||||
|
- User feedback > internal opinions
|
||||||
|
|
||||||
|
## Pivot vs Persevere
|
||||||
|
|
||||||
|
**Persevere if:**
|
||||||
|
- Core metrics trending up
|
||||||
|
- Users like the direction
|
||||||
|
- Issues are tactical, not strategic
|
||||||
|
- Learning compounds each iteration
|
||||||
|
|
||||||
|
**Pivot if:**
|
||||||
|
- 3+ iterations with no improvement
|
||||||
|
- Users consistently reject solution
|
||||||
|
- Wrong problem being solved
|
||||||
|
- Better opportunity identified
|
||||||
|
|
||||||
|
## Continuous Improvement Post-Launch
|
||||||
|
```
|
||||||
|
Post-Ship Loop:
|
||||||
|
1. Monitor usage analytics
|
||||||
|
2. Collect user feedback
|
||||||
|
3. Identify new pain points
|
||||||
|
4. Prioritize improvements
|
||||||
|
5. Small iterations weekly
|
||||||
|
6. Major updates monthly
|
||||||
|
```
|
||||||
223
skills/design-thinking/prototype.md
Normal file
223
skills/design-thinking/prototype.md
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
# Skill: Design Thinking - Prototype
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Build rapid, low-fidelity prototypes to test solutions quickly and cheaply before full implementation.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **solution_idea**: The idea to prototype from ideate phase (required)
|
||||||
|
- **fidelity_level**: low|medium|high (optional, default: low)
|
||||||
|
- **components_available**: Existing UI components/patterns (optional)
|
||||||
|
- **constraints**: Time/tech constraints (optional)
|
||||||
|
|
||||||
|
## Prototyping Approaches
|
||||||
|
|
||||||
|
### 1. Rapid MVP Patterns
|
||||||
|
|
||||||
|
**Lo-Fi (1-2 hours):**
|
||||||
|
- Paper sketches
|
||||||
|
- Wireframes in Figma/Excalidraw
|
||||||
|
- Clickable mockups
|
||||||
|
- No code, just flows
|
||||||
|
|
||||||
|
**Med-Fi (4-8 hours):**
|
||||||
|
- Static HTML/CSS
|
||||||
|
- Component prototypes
|
||||||
|
- Fake data, real UI
|
||||||
|
- Key interactions only
|
||||||
|
|
||||||
|
**Hi-Fi (1-2 days):**
|
||||||
|
- Working code prototype
|
||||||
|
- Real component library
|
||||||
|
- Actual data flow
|
||||||
|
- Limited features, polished
|
||||||
|
|
||||||
|
### 2. Lo-Fi to Hi-Fi Progression
|
||||||
|
|
||||||
|
**Stage 1: Sketch (30 mins)**
|
||||||
|
```
|
||||||
|
Purpose: Explore ideas fast
|
||||||
|
Tool: Paper, whiteboard, Excalidraw
|
||||||
|
Output: 3-5 rough layouts
|
||||||
|
Decision: Pick one to refine
|
||||||
|
```
|
||||||
|
|
||||||
|
**Stage 2: Wireframe (1-2 hours)**
|
||||||
|
```
|
||||||
|
Purpose: Define structure & flow
|
||||||
|
Tool: Figma, Balsamiq, HTML
|
||||||
|
Output: Clickable wireframe
|
||||||
|
Decision: Validate flow with users
|
||||||
|
```
|
||||||
|
|
||||||
|
**Stage 3: Visual Design (2-4 hours)**
|
||||||
|
```
|
||||||
|
Purpose: Define look & feel
|
||||||
|
Tool: Figma with design system
|
||||||
|
Output: High-fidelity mockups
|
||||||
|
Decision: Validate aesthetics
|
||||||
|
```
|
||||||
|
|
||||||
|
**Stage 4: Code Prototype (4-8 hours)**
|
||||||
|
```
|
||||||
|
Purpose: Test technical feasibility
|
||||||
|
Tool: React/Next.js components
|
||||||
|
Output: Working prototype
|
||||||
|
Decision: Ready for user testing
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Component-First Approach
|
||||||
|
|
||||||
|
**Build from existing:**
|
||||||
|
```typescript
|
||||||
|
// Start with proven components
|
||||||
|
import { Button, Input, Card } from '@/components/ui'
|
||||||
|
|
||||||
|
// Compose into new patterns
|
||||||
|
function CampaignQuickCreate() {
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<Input placeholder="Campaign name" />
|
||||||
|
<Button>Create in 5 seconds</Button>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Component Inventory:**
|
||||||
|
- List available UI components
|
||||||
|
- Identify reusable patterns
|
||||||
|
- Note what needs building
|
||||||
|
- Prioritize existing over new
|
||||||
|
|
||||||
|
### 4. "Good Enough" Quality Gates
|
||||||
|
|
||||||
|
**Lo-Fi Checklist:**
|
||||||
|
- [ ] User can see the flow
|
||||||
|
- [ ] Key interactions are clear
|
||||||
|
- [ ] No polish needed
|
||||||
|
- [ ] Can get feedback in <1 hour
|
||||||
|
|
||||||
|
**Med-Fi Checklist:**
|
||||||
|
- [ ] Looks like real product
|
||||||
|
- [ ] Core interactions work
|
||||||
|
- [ ] Uses design system
|
||||||
|
- [ ] Good enough for user testing
|
||||||
|
|
||||||
|
**Hi-Fi Checklist:**
|
||||||
|
- [ ] Production-quality code
|
||||||
|
- [ ] Accessible & responsive
|
||||||
|
- [ ] Error states handled
|
||||||
|
- [ ] Ready to ship (limited scope)
|
||||||
|
|
||||||
|
## Prototype Templates
|
||||||
|
|
||||||
|
### Quick Start Template
|
||||||
|
```typescript
|
||||||
|
// Minimal prototype structure
|
||||||
|
interface PrototypeProps {
|
||||||
|
mode: 'demo' | 'interactive'
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Prototype({ mode }: PrototypeProps) {
|
||||||
|
// 1. State (minimal)
|
||||||
|
const [step, setStep] = useState(1)
|
||||||
|
|
||||||
|
// 2. Key interactions only
|
||||||
|
const handleNext = () => setStep(s => s + 1)
|
||||||
|
|
||||||
|
// 3. Visual feedback
|
||||||
|
return (
|
||||||
|
<div className="max-w-2xl mx-auto p-8">
|
||||||
|
<ProgressBar step={step} total={3} />
|
||||||
|
|
||||||
|
{step === 1 && <Step1 onNext={handleNext} />}
|
||||||
|
{step === 2 && <Step2 onNext={handleNext} />}
|
||||||
|
{step === 3 && <Success />}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Paper Prototype Template
|
||||||
|
```
|
||||||
|
┌─────────────────────────┐
|
||||||
|
│ Campaign Quick Create │
|
||||||
|
├─────────────────────────┤
|
||||||
|
│ │
|
||||||
|
│ [Campaign Name____] │
|
||||||
|
│ │
|
||||||
|
│ [Template ▼] │
|
||||||
|
│ - Black Friday │
|
||||||
|
│ - Product Launch │
|
||||||
|
│ - Newsletter │
|
||||||
|
│ │
|
||||||
|
│ [Create Campaign] │
|
||||||
|
│ │
|
||||||
|
└─────────────────────────┘
|
||||||
|
|
||||||
|
Interactions:
|
||||||
|
1. Type name → enables template
|
||||||
|
2. Select template → preview
|
||||||
|
3. Click create → done (5 sec)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"prototype": {
|
||||||
|
"type": "medium_fidelity",
|
||||||
|
"time_spent": "6 hours",
|
||||||
|
"tools_used": ["Figma", "React", "Tailwind"],
|
||||||
|
"url": "https://prototype-link.com",
|
||||||
|
"components_reused": ["Button", "Input", "Card", "Select"],
|
||||||
|
"components_created": ["QuickCreateFlow"]
|
||||||
|
},
|
||||||
|
"key_features": [
|
||||||
|
"1-click template selection",
|
||||||
|
"Auto-filled campaign defaults",
|
||||||
|
"5-second creation flow",
|
||||||
|
"Inline preview"
|
||||||
|
],
|
||||||
|
"limitations": [
|
||||||
|
"Only 3 template types",
|
||||||
|
"No advanced customization",
|
||||||
|
"Fake data backend"
|
||||||
|
],
|
||||||
|
"testing_scenarios": [
|
||||||
|
{
|
||||||
|
"scenario": "Create campaign from template",
|
||||||
|
"steps": ["Select template", "Enter name", "Click create"],
|
||||||
|
"expected_time": "5 seconds",
|
||||||
|
"success_criteria": "Campaign created without errors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"next_step": "Test with users using /dt test"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] Built in <8 hours (for med-fi)
|
||||||
|
- [ ] Core flow works end-to-end
|
||||||
|
- [ ] Uses existing components where possible
|
||||||
|
- [ ] Good enough for user feedback
|
||||||
|
- [ ] Testing scenarios defined
|
||||||
|
- [ ] Known limitations documented
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 1000 tokens
|
||||||
|
- Max output: 1500 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (creative problem-solving)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "Perfect is the enemy of good. Ship the prototype."
|
||||||
|
> Fast feedback beats perfect implementation.
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- Build minimum to test hypothesis
|
||||||
|
- Reuse > rebuild
|
||||||
|
- Speed > polish
|
||||||
|
- Learn > perfect
|
||||||
|
- Fake it till you make it (use mock data)
|
||||||
228
skills/design-thinking/test.md
Normal file
228
skills/design-thinking/test.md
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
# Skill: Design Thinking - Test
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Validate prototypes with real users to gather feedback, measure success, and decide next steps.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **prototype**: Prototype to test (required)
|
||||||
|
- **test_type**: usability|ab_test|interview|analytics (optional, default: usability)
|
||||||
|
- **user_segments**: Which users to test with (required)
|
||||||
|
- **success_criteria**: What defines success (required)
|
||||||
|
|
||||||
|
## Testing Frameworks
|
||||||
|
|
||||||
|
### 1. Usability Testing
|
||||||
|
|
||||||
|
**5-User Rule:**
|
||||||
|
Test with 5 users to find 85% of usability issues.
|
||||||
|
|
||||||
|
**Test Script Template:**
|
||||||
|
```
|
||||||
|
INTRO (2 mins)
|
||||||
|
- Thanks for participating
|
||||||
|
- Testing product, not you
|
||||||
|
- Think aloud encouraged
|
||||||
|
- No wrong answers
|
||||||
|
|
||||||
|
CONTEXT (1 min)
|
||||||
|
- Scenario: "You need to create a new campaign..."
|
||||||
|
- Goal: "Complete the task as you normally would"
|
||||||
|
|
||||||
|
TASKS (10-15 mins)
|
||||||
|
Task 1: [Specific scenario]
|
||||||
|
- Observe: Where do they pause?
|
||||||
|
- Note: What do they say?
|
||||||
|
- Ask: "What are you thinking?"
|
||||||
|
|
||||||
|
Task 2: [Next scenario]
|
||||||
|
- Same observation process
|
||||||
|
|
||||||
|
DEBRIEF (5 mins)
|
||||||
|
- What was easy?
|
||||||
|
- What was confusing?
|
||||||
|
- What would you change?
|
||||||
|
- Would you use this?
|
||||||
|
```
|
||||||
|
|
||||||
|
**What to Observe:**
|
||||||
|
- Time to complete task
|
||||||
|
- Number of errors/retries
|
||||||
|
- Hesitation points
|
||||||
|
- Verbal confusion
|
||||||
|
- Emotional reactions
|
||||||
|
- Workarounds attempted
|
||||||
|
|
||||||
|
### 2. Feedback Collection Templates
|
||||||
|
|
||||||
|
**Quick Rating Scale:**
|
||||||
|
```
|
||||||
|
After each task:
|
||||||
|
"How easy was that? (1-5)"
|
||||||
|
1 = Very difficult
|
||||||
|
2 = Difficult
|
||||||
|
3 = Okay
|
||||||
|
4 = Easy
|
||||||
|
5 = Very easy
|
||||||
|
```
|
||||||
|
|
||||||
|
**System Usability Scale (SUS):**
|
||||||
|
```
|
||||||
|
Rate 1-5 (1=Strongly Disagree, 5=Strongly Agree):
|
||||||
|
1. I would use this frequently
|
||||||
|
2. I found it unnecessarily complex
|
||||||
|
3. I found it easy to use
|
||||||
|
4. I would need support to use this
|
||||||
|
5. Features were well integrated
|
||||||
|
6. There was too much inconsistency
|
||||||
|
7. Most people would learn quickly
|
||||||
|
8. I found it cumbersome
|
||||||
|
9. I felt confident using it
|
||||||
|
10. I needed to learn a lot first
|
||||||
|
|
||||||
|
Score: ((Sum odd items - 5) + (25 - sum even items)) * 2.5
|
||||||
|
> 68 = Above average
|
||||||
|
< 68 = Below average
|
||||||
|
```
|
||||||
|
|
||||||
|
**Post-Task Interview:**
|
||||||
|
```
|
||||||
|
1. What did you like most?
|
||||||
|
2. What frustrated you?
|
||||||
|
3. What would you change?
|
||||||
|
4. Would you use this over current solution?
|
||||||
|
5. What's missing?
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. A/B Testing Patterns
|
||||||
|
|
||||||
|
**Simple A/B Test:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"test_name": "Campaign Creation Flow",
|
||||||
|
"hypothesis": "1-step flow will increase completion by 30%",
|
||||||
|
"variant_a": {
|
||||||
|
"name": "Control (3-step)",
|
||||||
|
"users": 50,
|
||||||
|
"metric": "completion_rate"
|
||||||
|
},
|
||||||
|
"variant_b": {
|
||||||
|
"name": "Treatment (1-step)",
|
||||||
|
"users": 50,
|
||||||
|
"metric": "completion_rate"
|
||||||
|
},
|
||||||
|
"duration": "7 days",
|
||||||
|
"success_threshold": "30% improvement"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Metrics to Track:**
|
||||||
|
- Completion rate
|
||||||
|
- Time to complete
|
||||||
|
- Error rate
|
||||||
|
- Drop-off points
|
||||||
|
- User satisfaction
|
||||||
|
|
||||||
|
### 4. Iteration Decision Criteria
|
||||||
|
|
||||||
|
**Go/No-Go Framework:**
|
||||||
|
```
|
||||||
|
SHIP IT if:
|
||||||
|
- [ ] 80%+ users complete task successfully
|
||||||
|
- [ ] Average task time meets target
|
||||||
|
- [ ] SUS score > 68
|
||||||
|
- [ ] No critical usability issues
|
||||||
|
- [ ] Users prefer it to current solution
|
||||||
|
|
||||||
|
ITERATE if:
|
||||||
|
- [ ] 50-80% success rate
|
||||||
|
- [ ] Task time 2x target
|
||||||
|
- [ ] SUS score 50-68
|
||||||
|
- [ ] 2+ moderate issues
|
||||||
|
- [ ] Mixed user preference
|
||||||
|
|
||||||
|
PIVOT if:
|
||||||
|
- [ ] <50% success rate
|
||||||
|
- [ ] Task time >3x target
|
||||||
|
- [ ] SUS score <50
|
||||||
|
- [ ] Critical blocking issues
|
||||||
|
- [ ] Users prefer current solution
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"test_summary": {
|
||||||
|
"type": "usability_test",
|
||||||
|
"users_tested": 5,
|
||||||
|
"date": "2024-12-14",
|
||||||
|
"duration": "45 minutes total"
|
||||||
|
},
|
||||||
|
"results": {
|
||||||
|
"completion_rate": "80%",
|
||||||
|
"avg_time": "8 seconds",
|
||||||
|
"sus_score": 72,
|
||||||
|
"user_satisfaction": "4.2/5"
|
||||||
|
},
|
||||||
|
"key_findings": [
|
||||||
|
{
|
||||||
|
"issue": "Users confused by template dropdown",
|
||||||
|
"severity": "moderate",
|
||||||
|
"users_affected": 3,
|
||||||
|
"evidence": "Hesitated 5+ seconds, said 'not sure what to pick'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"issue": "Success message not clear",
|
||||||
|
"severity": "low",
|
||||||
|
"users_affected": 2,
|
||||||
|
"evidence": "Asked 'did it work?'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"positive_feedback": [
|
||||||
|
"Much faster than current process",
|
||||||
|
"Templates are helpful",
|
||||||
|
"Clean and simple interface"
|
||||||
|
],
|
||||||
|
"improvement_suggestions": [
|
||||||
|
"Add template preview on hover",
|
||||||
|
"Show success confirmation clearly",
|
||||||
|
"Save last-used template as default"
|
||||||
|
],
|
||||||
|
"decision": {
|
||||||
|
"verdict": "iterate",
|
||||||
|
"reasoning": "80% success rate is good but template confusion needs fix",
|
||||||
|
"next_actions": [
|
||||||
|
"Add template previews",
|
||||||
|
"Improve success feedback",
|
||||||
|
"Test again with 3 users"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"next_step": "Implement improvements and /dt loop back to testing"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] Tested with 5+ users per segment
|
||||||
|
- [ ] Clear success/failure criteria defined
|
||||||
|
- [ ] Quantitative data collected (time, completion, SUS)
|
||||||
|
- [ ] Qualitative feedback captured (quotes, observations)
|
||||||
|
- [ ] Decision made (ship/iterate/pivot)
|
||||||
|
- [ ] Next actions defined
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 800 tokens
|
||||||
|
- Max output: 1800 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (pattern analysis)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "In God we trust. All others must bring data."
|
||||||
|
> Test with users, not assumptions.
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- 5 users find 85% of issues
|
||||||
|
- Watch what they do, not what they say
|
||||||
|
- Quantify where possible
|
||||||
|
- Act on feedback fast
|
||||||
|
- Test early, test often
|
||||||
251
skills/lean/backlog.md
Normal file
251
skills/lean/backlog.md
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
# Skill: Lean - Backlog Management
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Manage and prioritize product backlog using WSJF (Weighted Shortest Job First) and lean principles for optimal value delivery.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **project_id**: Project identifier (required)
|
||||||
|
- **action**: list|add|prioritize|groom|estimate (required)
|
||||||
|
- **item**: Backlog item details for add/update (optional)
|
||||||
|
- **filters**: Status, phase, assignee filters (optional)
|
||||||
|
|
||||||
|
## Backlog Item Structure
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "BLI-042",
|
||||||
|
"title": "Add dark mode toggle",
|
||||||
|
"description": "Allow users to switch between light and dark themes",
|
||||||
|
"type": "feature|bug|tech_debt|spike",
|
||||||
|
"phase": "empathize|define|ideate|prototype|test",
|
||||||
|
"status": "idea|ready|in_progress|review|done|blocked",
|
||||||
|
"priority_score": 8.5,
|
||||||
|
"scoring": {
|
||||||
|
"user_value": 7,
|
||||||
|
"time_criticality": 3,
|
||||||
|
"risk_reduction": 2,
|
||||||
|
"effort": 3
|
||||||
|
},
|
||||||
|
"story_points": 5,
|
||||||
|
"assigned_agent": "frontend|backend|tester|devops|pm",
|
||||||
|
"dependencies": ["BLI-040", "BLI-041"],
|
||||||
|
"labels": ["ux", "settings", "mvp"],
|
||||||
|
"acceptance_criteria": [
|
||||||
|
"Toggle visible in settings page",
|
||||||
|
"Theme persists across sessions",
|
||||||
|
"Respects system preference by default"
|
||||||
|
],
|
||||||
|
"created_at": "2024-12-14T10:00:00Z",
|
||||||
|
"updated_at": "2024-12-14T15:30:00Z",
|
||||||
|
"sprint_id": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## WSJF Prioritization
|
||||||
|
|
||||||
|
### Formula
|
||||||
|
```
|
||||||
|
Priority Score = (User Value + Time Criticality + Risk Reduction) / Effort
|
||||||
|
|
||||||
|
Scale: 1-10 for each factor
|
||||||
|
Result: Higher score = Higher priority
|
||||||
|
```
|
||||||
|
|
||||||
|
### Scoring Guide
|
||||||
|
|
||||||
|
**User Value (1-10):**
|
||||||
|
- 10: Core feature, all users need
|
||||||
|
- 7-9: Important feature, most users benefit
|
||||||
|
- 4-6: Nice to have, some users want
|
||||||
|
- 1-3: Edge case, few users affected
|
||||||
|
|
||||||
|
**Time Criticality (1-10):**
|
||||||
|
- 10: Must ship this sprint, blocking release
|
||||||
|
- 7-9: Needed soon, customer commitment
|
||||||
|
- 4-6: Planned for quarter, flexible timing
|
||||||
|
- 1-3: Backlog, no deadline
|
||||||
|
|
||||||
|
**Risk Reduction (1-10):**
|
||||||
|
- 10: Eliminates critical security/stability risk
|
||||||
|
- 7-9: Reduces significant technical debt
|
||||||
|
- 4-6: Improves maintainability
|
||||||
|
- 1-3: Minor improvement
|
||||||
|
|
||||||
|
**Effort (1-10):**
|
||||||
|
- 1-2: Trivial, < 2 hours
|
||||||
|
- 3-4: Small, 2-8 hours
|
||||||
|
- 5-6: Medium, 1-2 days
|
||||||
|
- 7-8: Large, 3-5 days
|
||||||
|
- 9-10: Epic, > 1 week (should be split)
|
||||||
|
|
||||||
|
### Priority Buckets
|
||||||
|
```
|
||||||
|
Score > 10: 🔥 Critical - Do immediately
|
||||||
|
Score 7-10: ⚡ High - Sprint commitment
|
||||||
|
Score 4-7: 📌 Medium - Plan for next sprint
|
||||||
|
Score < 4: 💤 Low - Future backlog
|
||||||
|
```
|
||||||
|
|
||||||
|
## Backlog Actions
|
||||||
|
|
||||||
|
### List Backlog
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"action": "list",
|
||||||
|
"filters": {
|
||||||
|
"status": ["ready", "in_progress"],
|
||||||
|
"phase": "prototype",
|
||||||
|
"label": "mvp"
|
||||||
|
},
|
||||||
|
"sort": "priority_score",
|
||||||
|
"limit": 20
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Add Item
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"action": "add",
|
||||||
|
"item": {
|
||||||
|
"title": "Implement password reset flow",
|
||||||
|
"description": "Users need ability to reset forgotten passwords",
|
||||||
|
"type": "feature",
|
||||||
|
"phase": "prototype",
|
||||||
|
"labels": ["auth", "mvp"],
|
||||||
|
"acceptance_criteria": [
|
||||||
|
"Email sent with reset link",
|
||||||
|
"Link expires after 1 hour",
|
||||||
|
"Password requirements enforced"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prioritize Backlog
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"action": "prioritize",
|
||||||
|
"items": [
|
||||||
|
{ "id": "BLI-042", "user_value": 7, "time_criticality": 3, "risk_reduction": 2, "effort": 3 },
|
||||||
|
{ "id": "BLI-043", "user_value": 9, "time_criticality": 8, "risk_reduction": 5, "effort": 5 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Groom Items
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"action": "groom",
|
||||||
|
"item_id": "BLI-042",
|
||||||
|
"updates": {
|
||||||
|
"description": "Updated description with more detail",
|
||||||
|
"acceptance_criteria": ["New criteria"],
|
||||||
|
"story_points": 8,
|
||||||
|
"status": "ready"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"action": "list",
|
||||||
|
"backlog": {
|
||||||
|
"total_items": 45,
|
||||||
|
"ready_items": 12,
|
||||||
|
"in_progress": 5,
|
||||||
|
"blocked": 1
|
||||||
|
},
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"id": "BLI-043",
|
||||||
|
"title": "User authentication",
|
||||||
|
"priority_score": 7.33,
|
||||||
|
"status": "ready",
|
||||||
|
"story_points": 8,
|
||||||
|
"phase": "prototype"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"recommendations": [
|
||||||
|
{
|
||||||
|
"type": "split",
|
||||||
|
"item_id": "BLI-050",
|
||||||
|
"reason": "Effort score 9 - consider breaking into smaller items"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "prioritize",
|
||||||
|
"item_id": "BLI-043",
|
||||||
|
"reason": "High time criticality, move to top"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"next_step": "Plan sprint with /sprint plan"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## AI Advisory
|
||||||
|
|
||||||
|
### Recommendations Engine
|
||||||
|
```javascript
|
||||||
|
function generateRecommendations(backlog) {
|
||||||
|
const recommendations = [];
|
||||||
|
|
||||||
|
// Large items should be split
|
||||||
|
backlog.filter(i => i.scoring.effort >= 8).forEach(item => {
|
||||||
|
recommendations.push({
|
||||||
|
type: 'split',
|
||||||
|
item_id: item.id,
|
||||||
|
reason: `Effort ${item.scoring.effort} is too high. Split into 2-3 smaller items.`,
|
||||||
|
priority: 'high'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Blocked items need attention
|
||||||
|
backlog.filter(i => i.status === 'blocked').forEach(item => {
|
||||||
|
recommendations.push({
|
||||||
|
type: 'unblock',
|
||||||
|
item_id: item.id,
|
||||||
|
reason: `Item blocked. Check dependencies: ${item.dependencies.join(', ')}`,
|
||||||
|
priority: 'critical'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Old items in "idea" status
|
||||||
|
const oldIdeas = backlog.filter(i =>
|
||||||
|
i.status === 'idea' &&
|
||||||
|
daysSince(i.created_at) > 30
|
||||||
|
);
|
||||||
|
if (oldIdeas.length > 5) {
|
||||||
|
recommendations.push({
|
||||||
|
type: 'cleanup',
|
||||||
|
reason: `${oldIdeas.length} items in "idea" status for 30+ days. Review or remove.`,
|
||||||
|
priority: 'medium'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return recommendations;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] All items have clear titles
|
||||||
|
- [ ] Ready items have acceptance criteria
|
||||||
|
- [ ] WSJF scores calculated
|
||||||
|
- [ ] Dependencies documented
|
||||||
|
- [ ] Large items flagged for splitting
|
||||||
|
- [ ] Blocked items have resolution plan
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 800 tokens
|
||||||
|
- Max output: 1500 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (prioritization reasoning)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "Build less, ship faster. Priority is about saying no."
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- Small items > Large epics
|
||||||
|
- Done > Perfect
|
||||||
|
- User value > Technical elegance
|
||||||
|
- Weekly grooming beats quarterly planning
|
||||||
249
skills/lean/prioritization.md
Normal file
249
skills/lean/prioritization.md
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
# Skill: Lean - Prioritization
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Apply lean prioritization frameworks to make decisions about what to build next. Uses WSJF, MoSCoW, and effort/impact matrices.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
- **items**: List of items to prioritize (required)
|
||||||
|
- **framework**: wsjf|moscow|effort_impact|rice (optional, default: wsjf)
|
||||||
|
- **constraints**: Time, budget, capacity limits (optional)
|
||||||
|
- **weights**: Custom weights for scoring factors (optional)
|
||||||
|
|
||||||
|
## Prioritization Frameworks
|
||||||
|
|
||||||
|
### 1. WSJF (Weighted Shortest Job First)
|
||||||
|
**Best for:** Sprint planning, feature prioritization
|
||||||
|
|
||||||
|
```
|
||||||
|
Priority = (User Value + Time Criticality + Risk Reduction) / Job Size
|
||||||
|
|
||||||
|
Higher score = Do first
|
||||||
|
```
|
||||||
|
|
||||||
|
**Scoring Matrix:**
|
||||||
|
| Factor | 1-3 | 4-6 | 7-9 | 10 |
|
||||||
|
|--------|-----|-----|-----|-----|
|
||||||
|
| User Value | Few users | Some users | Most users | All users |
|
||||||
|
| Time Criticality | No deadline | Quarter | Month | This sprint |
|
||||||
|
| Risk Reduction | Minor | Moderate | Significant | Critical |
|
||||||
|
| Job Size (effort) | < 2 hours | 1-2 days | 3-5 days | > 1 week |
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"item": "Add password reset",
|
||||||
|
"user_value": 8,
|
||||||
|
"time_criticality": 7,
|
||||||
|
"risk_reduction": 6,
|
||||||
|
"job_size": 5,
|
||||||
|
"wsjf_score": 4.2
|
||||||
|
}
|
||||||
|
// Score = (8 + 7 + 6) / 5 = 4.2
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. MoSCoW Method
|
||||||
|
**Best for:** Release planning, MVP definition
|
||||||
|
|
||||||
|
| Category | Description | Guidance |
|
||||||
|
|----------|-------------|----------|
|
||||||
|
| **M**ust Have | Non-negotiable, core functionality | Release blocked without |
|
||||||
|
| **S**hould Have | Important but not critical | Include if time permits |
|
||||||
|
| **C**ould Have | Nice to have | Descope first if needed |
|
||||||
|
| **W**on't Have | Out of scope for this release | Document for future |
|
||||||
|
|
||||||
|
**Distribution Rule:**
|
||||||
|
- Must: 60% of effort
|
||||||
|
- Should: 20% of effort
|
||||||
|
- Could: 20% of effort
|
||||||
|
- Won't: 0% (explicitly excluded)
|
||||||
|
|
||||||
|
### 3. Effort/Impact Matrix
|
||||||
|
**Best for:** Quick prioritization, team discussions
|
||||||
|
|
||||||
|
```
|
||||||
|
High Impact
|
||||||
|
│
|
||||||
|
Quick Wins │ Major Projects
|
||||||
|
(Do Now) │ (Plan Carefully)
|
||||||
|
─────────────────┼─────────────────────
|
||||||
|
Fill-Ins │ Thankless Tasks
|
||||||
|
(If Time) │ (Avoid/Delegate)
|
||||||
|
│
|
||||||
|
Low Impact
|
||||||
|
|
||||||
|
Low Effort ─────────────── High Effort
|
||||||
|
```
|
||||||
|
|
||||||
|
**Quadrant Actions:**
|
||||||
|
1. **Quick Wins** (High Impact, Low Effort): Do immediately
|
||||||
|
2. **Major Projects** (High Impact, High Effort): Schedule, break down
|
||||||
|
3. **Fill-Ins** (Low Impact, Low Effort): Do when free
|
||||||
|
4. **Thankless Tasks** (Low Impact, High Effort): Eliminate or defer
|
||||||
|
|
||||||
|
### 4. RICE Framework
|
||||||
|
**Best for:** Product decisions with reach data
|
||||||
|
|
||||||
|
```
|
||||||
|
RICE Score = (Reach × Impact × Confidence) / Effort
|
||||||
|
|
||||||
|
Reach: Users affected per quarter
|
||||||
|
Impact: 0.25 (minimal) to 3 (massive)
|
||||||
|
Confidence: 0-100%
|
||||||
|
Effort: Person-months
|
||||||
|
```
|
||||||
|
|
||||||
|
## Scheduling & Parallelization
|
||||||
|
|
||||||
|
### Dependency Resolution
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"item_id": "BLI-050",
|
||||||
|
"depends_on": ["BLI-048", "BLI-049"],
|
||||||
|
"blocks": ["BLI-053", "BLI-054"],
|
||||||
|
"parallel_with": ["BLI-051", "BLI-052"],
|
||||||
|
"scheduling": {
|
||||||
|
"earliest_start": "After BLI-048 & BLI-049 complete",
|
||||||
|
"can_parallelize": true,
|
||||||
|
"parallelization_candidates": ["BLI-051", "BLI-052"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parallelization Rules
|
||||||
|
```javascript
|
||||||
|
function canParallelize(itemA, itemB) {
|
||||||
|
// No shared dependencies
|
||||||
|
const sharedDeps = itemA.depends_on.filter(d =>
|
||||||
|
itemB.depends_on.includes(d)
|
||||||
|
);
|
||||||
|
if (sharedDeps.length > 0) return false;
|
||||||
|
|
||||||
|
// Different agents
|
||||||
|
if (itemA.assigned_agent === itemB.assigned_agent) return false;
|
||||||
|
|
||||||
|
// No blocking relationship
|
||||||
|
if (itemA.blocks.includes(itemB.id)) return false;
|
||||||
|
if (itemB.blocks.includes(itemA.id)) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Optimal Schedule Generation
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"schedule": {
|
||||||
|
"week_1": {
|
||||||
|
"parallel_tracks": [
|
||||||
|
{ "agent": "frontend", "items": ["BLI-050", "BLI-051"] },
|
||||||
|
{ "agent": "backend", "items": ["BLI-048", "BLI-049"] }
|
||||||
|
],
|
||||||
|
"capacity_used": "85%"
|
||||||
|
},
|
||||||
|
"week_2": {
|
||||||
|
"parallel_tracks": [
|
||||||
|
{ "agent": "frontend", "items": ["BLI-053"] },
|
||||||
|
{ "agent": "backend", "items": ["BLI-052"] },
|
||||||
|
{ "agent": "tester", "items": ["BLI-050-test", "BLI-051-test"] }
|
||||||
|
],
|
||||||
|
"capacity_used": "90%"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"critical_path": ["BLI-048", "BLI-050", "BLI-053"],
|
||||||
|
"total_duration": "2 weeks",
|
||||||
|
"parallelization_savings": "40%"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"framework": "wsjf",
|
||||||
|
"prioritized_items": [
|
||||||
|
{
|
||||||
|
"rank": 1,
|
||||||
|
"id": "BLI-043",
|
||||||
|
"title": "User authentication",
|
||||||
|
"score": 7.33,
|
||||||
|
"category": "must_have",
|
||||||
|
"quadrant": "quick_win"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rank": 2,
|
||||||
|
"id": "BLI-050",
|
||||||
|
"title": "Password reset",
|
||||||
|
"score": 5.67,
|
||||||
|
"category": "must_have",
|
||||||
|
"quadrant": "major_project"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"schedule": {
|
||||||
|
"sprint_1": ["BLI-043", "BLI-045"],
|
||||||
|
"sprint_2": ["BLI-050", "BLI-047"],
|
||||||
|
"backlog": ["BLI-055", "BLI-060"]
|
||||||
|
},
|
||||||
|
"parallelization": {
|
||||||
|
"recommended_groups": [
|
||||||
|
["BLI-043", "BLI-044"],
|
||||||
|
["BLI-050", "BLI-051"]
|
||||||
|
],
|
||||||
|
"time_savings": "35%"
|
||||||
|
},
|
||||||
|
"recommendations": [
|
||||||
|
"BLI-050 has effort 9 - consider splitting",
|
||||||
|
"BLI-043 and BLI-044 can run in parallel",
|
||||||
|
"Remove BLI-060 - low impact, high effort"
|
||||||
|
],
|
||||||
|
"next_step": "Commit to sprint with /sprint plan"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Decision Matrix Template
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ PRIORITIZATION DECISION │
|
||||||
|
├─────────────────────────────────────────────────────────────────┤
|
||||||
|
│ │
|
||||||
|
│ Items Evaluated: 25 │
|
||||||
|
│ Framework: WSJF + Effort/Impact │
|
||||||
|
│ │
|
||||||
|
│ ┌───────────────────────────────────────────────────────┐ │
|
||||||
|
│ │ MUST DO (Score > 6) │ SHOULD DO (Score 4-6) │ │
|
||||||
|
│ │ • User auth (7.33) │ • Dark mode (5.20) │ │
|
||||||
|
│ │ • Password reset (6.67) │ • Notifications (4.80) │ │
|
||||||
|
│ │ • Profile page (6.40) │ • Search (4.50) │ │
|
||||||
|
│ ├───────────────────────────────────────────────────────┤ │
|
||||||
|
│ │ COULD DO (Score 2-4) │ WON'T DO (Score < 2) │ │
|
||||||
|
│ │ • Export CSV (3.50) │ • Social login (1.80) │ │
|
||||||
|
│ │ • Keyboard shortcuts (2.90)│ • Mobile app (1.20) │ │
|
||||||
|
│ └───────────────────────────────────────────────────────┘ │
|
||||||
|
│ │
|
||||||
|
│ Recommended: Focus on MUST DO items for next 2 sprints │
|
||||||
|
│ │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quality Gates
|
||||||
|
- [ ] All items have consistent scoring
|
||||||
|
- [ ] Dependencies documented
|
||||||
|
- [ ] Parallelization opportunities identified
|
||||||
|
- [ ] Schedule accounts for capacity
|
||||||
|
- [ ] Clear decision rationale
|
||||||
|
- [ ] Stakeholder alignment
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 1000 tokens
|
||||||
|
- Max output: 1500 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (decision reasoning)
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
> "If everything is important, nothing is."
|
||||||
|
|
||||||
|
**Keep it simple:**
|
||||||
|
- Prioritize ruthlessly
|
||||||
|
- Say no to low-impact work
|
||||||
|
- Parallelize aggressively
|
||||||
|
- Ship the most valuable thing first
|
||||||
331
skills/wws/overview.md
Normal file
331
skills/wws/overview.md
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
# Skill: WWS (Serverless Functions) Overview
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Architecture and implementation guide for WWS (Web Worker Services) - serverless functions for edge computing in the Mylder platform.
|
||||||
|
|
||||||
|
## What is WWS?
|
||||||
|
WWS is our serverless function layer that runs lightweight compute at the edge, reducing VPS load and improving response times. Similar to Cloudflare Workers but platform-agnostic.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ USER REQUEST │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ EDGE LAYER (WWS) │
|
||||||
|
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
||||||
|
│ │ Auth │ │ Rate │ │ Model │ │ Cache │ │
|
||||||
|
│ │ Guard │ │ Limiter │ │ Router │ │ Manager │ │
|
||||||
|
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
│
|
||||||
|
┌──────────────────┼──────────────────┐
|
||||||
|
│ │ │
|
||||||
|
▼ ▼ ▼
|
||||||
|
┌──────────┐ ┌──────────┐ ┌──────────┐
|
||||||
|
│synthetic │ │ z.ai │ │ Origin │
|
||||||
|
│ .new │ │(fallback)│ │ VPS │
|
||||||
|
└──────────┘ └──────────┘ └──────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Core Functions
|
||||||
|
|
||||||
|
### 1. Auth Guard
|
||||||
|
```javascript
|
||||||
|
// Edge authentication validation
|
||||||
|
export async function authGuard(request, env) {
|
||||||
|
const token = request.headers.get('Authorization')?.split('Bearer ')[1];
|
||||||
|
|
||||||
|
// Fast KV lookup
|
||||||
|
const session = await env.SESSIONS.get(token);
|
||||||
|
if (session) {
|
||||||
|
return { valid: true, user: JSON.parse(session), source: 'cache' };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to Supabase
|
||||||
|
const supabaseUser = await validateWithSupabase(token, env);
|
||||||
|
if (supabaseUser) {
|
||||||
|
await env.SESSIONS.put(token, JSON.stringify(supabaseUser), {
|
||||||
|
expirationTtl: 3600 // 1 hour
|
||||||
|
});
|
||||||
|
return { valid: true, user: supabaseUser, source: 'origin' };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { valid: false };
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Rate Limiter
|
||||||
|
```javascript
|
||||||
|
// Per-user, per-endpoint rate limiting
|
||||||
|
export async function rateLimiter(request, env) {
|
||||||
|
const userId = request.headers.get('X-User-ID') || 'anonymous';
|
||||||
|
const endpoint = new URL(request.url).pathname;
|
||||||
|
const key = `rate:${userId}:${endpoint}`;
|
||||||
|
|
||||||
|
const current = await env.RATE_LIMITS.get(key) || '0';
|
||||||
|
const count = parseInt(current, 10);
|
||||||
|
|
||||||
|
const limits = {
|
||||||
|
'/api/ai/chat': 60, // 60 requests per minute
|
||||||
|
'/api/ai/generate': 20, // 20 per minute
|
||||||
|
'default': 100 // 100 per minute
|
||||||
|
};
|
||||||
|
|
||||||
|
const limit = limits[endpoint] || limits.default;
|
||||||
|
|
||||||
|
if (count >= limit) {
|
||||||
|
return {
|
||||||
|
allowed: false,
|
||||||
|
retryAfter: 60,
|
||||||
|
remaining: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
await env.RATE_LIMITS.put(key, String(count + 1), {
|
||||||
|
expirationTtl: 60
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
allowed: true,
|
||||||
|
remaining: limit - count - 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Model Router
|
||||||
|
```javascript
|
||||||
|
// Intelligent AI model routing
|
||||||
|
export async function modelRouter(task, env) {
|
||||||
|
const { type, complexity, context_length } = task;
|
||||||
|
|
||||||
|
// Route based on task characteristics
|
||||||
|
const routing = {
|
||||||
|
// Primary: synthetic.new
|
||||||
|
primary: {
|
||||||
|
provider: 'synthetic.new',
|
||||||
|
base_url: 'https://api.synthetic.new/openai/v1',
|
||||||
|
models: {
|
||||||
|
code: 'hf:deepseek-ai/DeepSeek-V3',
|
||||||
|
reasoning: 'hf:moonshotai/Kimi-K2-Thinking'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Fallback: z.ai
|
||||||
|
fallback: {
|
||||||
|
provider: 'z.ai',
|
||||||
|
base_url: 'https://api.z.ai/v1',
|
||||||
|
models: {
|
||||||
|
code: 'glm-4-flash',
|
||||||
|
reasoning: 'glm-4-plus',
|
||||||
|
long_context: 'glm-4-long'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Special cases for z.ai
|
||||||
|
if (context_length > 128000) {
|
||||||
|
return {
|
||||||
|
...routing.fallback,
|
||||||
|
model: routing.fallback.models.long_context,
|
||||||
|
reason: 'Context exceeds 128K, using GLM-4-Long'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default: synthetic.new
|
||||||
|
const modelType = ['code', 'implementation', 'debugging'].includes(type)
|
||||||
|
? 'code'
|
||||||
|
: 'reasoning';
|
||||||
|
|
||||||
|
return {
|
||||||
|
...routing.primary,
|
||||||
|
model: routing.primary.models[modelType],
|
||||||
|
reason: `Standard ${modelType} task`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Cache Manager
|
||||||
|
```javascript
|
||||||
|
// Stale-while-revalidate caching
|
||||||
|
export async function cacheManager(request, env, handler) {
|
||||||
|
const cacheKey = new URL(request.url).pathname;
|
||||||
|
|
||||||
|
// Check cache
|
||||||
|
const cached = await env.RESPONSE_CACHE.get(cacheKey, { type: 'json' });
|
||||||
|
|
||||||
|
if (cached) {
|
||||||
|
const age = Date.now() - cached.timestamp;
|
||||||
|
const maxAge = 60000; // 1 minute
|
||||||
|
const staleAge = 300000; // 5 minutes
|
||||||
|
|
||||||
|
// Fresh cache
|
||||||
|
if (age < maxAge) {
|
||||||
|
return { data: cached.data, source: 'cache', age };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stale-while-revalidate
|
||||||
|
if (age < staleAge) {
|
||||||
|
// Return stale, revalidate in background
|
||||||
|
env.ctx.waitUntil(revalidate(cacheKey, handler, env));
|
||||||
|
return { data: cached.data, source: 'stale', age };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// No cache, fetch fresh
|
||||||
|
const fresh = await handler();
|
||||||
|
await env.RESPONSE_CACHE.put(cacheKey, JSON.stringify({
|
||||||
|
data: fresh,
|
||||||
|
timestamp: Date.now()
|
||||||
|
}));
|
||||||
|
|
||||||
|
return { data: fresh, source: 'origin', age: 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
async function revalidate(key, handler, env) {
|
||||||
|
const fresh = await handler();
|
||||||
|
await env.RESPONSE_CACHE.put(key, JSON.stringify({
|
||||||
|
data: fresh,
|
||||||
|
timestamp: Date.now()
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deployment Options
|
||||||
|
|
||||||
|
### Option 1: Cloudflare Workers
|
||||||
|
```yaml
|
||||||
|
# wrangler.toml
|
||||||
|
name = "mylder-wws"
|
||||||
|
main = "src/index.ts"
|
||||||
|
compatibility_date = "2024-12-01"
|
||||||
|
|
||||||
|
[[kv_namespaces]]
|
||||||
|
binding = "SESSIONS"
|
||||||
|
id = "xxx"
|
||||||
|
|
||||||
|
[[kv_namespaces]]
|
||||||
|
binding = "RATE_LIMITS"
|
||||||
|
id = "xxx"
|
||||||
|
|
||||||
|
[[kv_namespaces]]
|
||||||
|
binding = "RESPONSE_CACHE"
|
||||||
|
id = "xxx"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2: Deno Deploy
|
||||||
|
```typescript
|
||||||
|
// main.ts
|
||||||
|
import { serve } from "https://deno.land/std/http/server.ts";
|
||||||
|
|
||||||
|
serve(async (req) => {
|
||||||
|
const url = new URL(req.url);
|
||||||
|
|
||||||
|
if (url.pathname.startsWith('/api/ai/')) {
|
||||||
|
return handleAIRequest(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response('Not Found', { status: 404 });
|
||||||
|
}, { port: 8000 });
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 3: Self-Hosted (Docker)
|
||||||
|
```dockerfile
|
||||||
|
# Dockerfile.wws
|
||||||
|
FROM denoland/deno:1.38.0
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN deno cache main.ts
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
CMD ["deno", "run", "--allow-net", "--allow-env", "main.ts"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Integration Points
|
||||||
|
|
||||||
|
### n8n Workflow Integration
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "WWS Call",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"parameters": {
|
||||||
|
"method": "POST",
|
||||||
|
"url": "https://wws.mylder.io/api/ai/chat",
|
||||||
|
"headers": {
|
||||||
|
"Authorization": "Bearer {{ $env.WWS_API_KEY }}",
|
||||||
|
"X-Task-Type": "{{ $json.taskType }}"
|
||||||
|
},
|
||||||
|
"body": {
|
||||||
|
"messages": "{{ $json.messages }}",
|
||||||
|
"context": "{{ $json.context }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Frontend Integration
|
||||||
|
```typescript
|
||||||
|
// lib/wws.ts
|
||||||
|
export async function callWWS(endpoint: string, data: any) {
|
||||||
|
const response = await fetch(`${process.env.NEXT_PUBLIC_WWS_URL}${endpoint}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${getSession().token}`
|
||||||
|
},
|
||||||
|
body: JSON.stringify(data)
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
// Handle rate limiting
|
||||||
|
if (response.status === 429) {
|
||||||
|
const retryAfter = response.headers.get('Retry-After');
|
||||||
|
throw new RateLimitError(retryAfter);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Latency Targets
|
||||||
|
| Operation | Target | Fallback |
|
||||||
|
|-----------|--------|----------|
|
||||||
|
| Auth validation | < 10ms | < 300ms (origin) |
|
||||||
|
| Rate limit check | < 5ms | N/A |
|
||||||
|
| Model routing | < 2ms | N/A |
|
||||||
|
| Cache hit | < 10ms | N/A |
|
||||||
|
| AI request (primary) | < 5s | < 10s (fallback) |
|
||||||
|
|
||||||
|
## Cost Model
|
||||||
|
```
|
||||||
|
Cloudflare Workers:
|
||||||
|
- Free: 100K requests/day
|
||||||
|
- Paid: $5/month + $0.50/million requests
|
||||||
|
|
||||||
|
KV Storage:
|
||||||
|
- Free: 100K reads/day, 1K writes/day
|
||||||
|
- Paid: $0.50/million reads, $5/million writes
|
||||||
|
|
||||||
|
Estimated (1M users/month):
|
||||||
|
- Workers: ~$5/month
|
||||||
|
- KV: ~$25/month
|
||||||
|
- Total: ~$30/month
|
||||||
|
```
|
||||||
|
|
||||||
|
## Related Skills
|
||||||
|
- `wws/edge-auth.md` - Detailed auth implementation
|
||||||
|
- `wws/rate-limit.md` - Rate limiting patterns
|
||||||
|
- `wws/model-router.md` - AI model selection
|
||||||
|
- `ai-providers/synthetic-new.md` - Primary AI provider
|
||||||
|
- `ai-providers/z-ai.md` - Fallback provider
|
||||||
|
|
||||||
|
## Token Budget
|
||||||
|
- Max input: 500 tokens
|
||||||
|
- Max output: 1200 tokens
|
||||||
|
|
||||||
|
## Model
|
||||||
|
- Recommended: sonnet (architecture understanding)
|
||||||
34
templates/expo-supabase.md
Normal file
34
templates/expo-supabase.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Expo + Supabase Template (Mobile)
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
- Framework: Expo SDK 51+
|
||||||
|
- Database: Supabase (PostgreSQL)
|
||||||
|
- Auth: Supabase Auth
|
||||||
|
- Navigation: Expo Router
|
||||||
|
- Styling: NativeWind (Tailwind for RN)
|
||||||
|
- Language: TypeScript
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
```
|
||||||
|
/app
|
||||||
|
/(tabs) # Tab navigation
|
||||||
|
/(auth) # Auth screens
|
||||||
|
_layout.tsx
|
||||||
|
/components
|
||||||
|
/lib
|
||||||
|
supabase.ts
|
||||||
|
/hooks
|
||||||
|
```
|
||||||
|
|
||||||
|
## Initial Setup
|
||||||
|
```bash
|
||||||
|
npx create-expo-app@latest --template tabs
|
||||||
|
npm install @supabase/supabase-js
|
||||||
|
npm install nativewind
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
```
|
||||||
|
EXPO_PUBLIC_SUPABASE_URL=
|
||||||
|
EXPO_PUBLIC_SUPABASE_ANON_KEY=
|
||||||
|
```
|
||||||
38
templates/nextjs-supabase.md
Normal file
38
templates/nextjs-supabase.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Next.js + Supabase Template
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
- Framework: Next.js 15 (App Router)
|
||||||
|
- Database: Supabase (PostgreSQL)
|
||||||
|
- Auth: Supabase Auth
|
||||||
|
- Styling: Tailwind CSS + shadcn/ui
|
||||||
|
- Language: TypeScript
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
```
|
||||||
|
/app
|
||||||
|
/api # API routes
|
||||||
|
/(auth) # Auth pages
|
||||||
|
/(dashboard) # Protected routes
|
||||||
|
layout.tsx
|
||||||
|
page.tsx
|
||||||
|
/components
|
||||||
|
/ui # shadcn components
|
||||||
|
/lib
|
||||||
|
supabase.ts # Supabase client
|
||||||
|
utils.ts
|
||||||
|
/types
|
||||||
|
```
|
||||||
|
|
||||||
|
## Initial Setup Commands
|
||||||
|
```bash
|
||||||
|
npx create-next-app@latest --typescript --tailwind --eslint --app
|
||||||
|
npx shadcn-ui@latest init
|
||||||
|
npm install @supabase/supabase-js @supabase/ssr
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
```
|
||||||
|
NEXT_PUBLIC_SUPABASE_URL=
|
||||||
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=
|
||||||
|
SUPABASE_SERVICE_ROLE_KEY=
|
||||||
|
```
|
||||||
34
templates/tauri-react.md
Normal file
34
templates/tauri-react.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Tauri + React Template (Desktop)
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
- Framework: Tauri 2.0
|
||||||
|
- Frontend: React + Vite
|
||||||
|
- Styling: Tailwind CSS
|
||||||
|
- Language: TypeScript + Rust
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
```
|
||||||
|
/src
|
||||||
|
/components
|
||||||
|
/lib
|
||||||
|
App.tsx
|
||||||
|
main.tsx
|
||||||
|
/src-tauri
|
||||||
|
/src
|
||||||
|
main.rs
|
||||||
|
Cargo.toml
|
||||||
|
tauri.conf.json
|
||||||
|
```
|
||||||
|
|
||||||
|
## Initial Setup
|
||||||
|
```bash
|
||||||
|
npm create tauri-app@latest
|
||||||
|
cd project-name
|
||||||
|
npm install
|
||||||
|
npm run tauri dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build Commands
|
||||||
|
```bash
|
||||||
|
npm run tauri build # Creates installers for current OS
|
||||||
|
```
|
||||||
281
workflows/zulip-webhook-handler.json
Normal file
281
workflows/zulip-webhook-handler.json
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
{
|
||||||
|
"name": "Zulip Command Handler",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"httpMethod": "POST",
|
||||||
|
"path": "zulip-commands",
|
||||||
|
"responseMode": "responseNode",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "webhook-zulip",
|
||||||
|
"name": "Zulip Webhook",
|
||||||
|
"type": "n8n-nodes-base.webhook",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [240, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"jsCode": "// Parse Zulip webhook payload
|
||||||
|
const body = $input.first().json.body || $input.first().json;
|
||||||
|
|
||||||
|
// Extract message content
|
||||||
|
const message = body.message || {};
|
||||||
|
const content = message.content || body.data || \"\";
|
||||||
|
const senderEmail = message.sender_email || body.user_email || \"unknown\";
|
||||||
|
const stream = message.display_recipient || body.stream || \"general\";
|
||||||
|
const topic = message.subject || body.topic || \"general\";
|
||||||
|
|
||||||
|
// Parse command: /category action args
|
||||||
|
const match = content.match(/^\/(\w+)(?:\s+(\w+))?(?:\s+(.+))?$/);
|
||||||
|
|
||||||
|
if (\!match) {
|
||||||
|
return [{
|
||||||
|
json: {
|
||||||
|
isCommand: false,
|
||||||
|
rawContent: content,
|
||||||
|
sender: senderEmail,
|
||||||
|
stream: stream,
|
||||||
|
topic: topic,
|
||||||
|
error: \"Not a valid command format. Use /category action [args]\"
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [{
|
||||||
|
json: {
|
||||||
|
isCommand: true,
|
||||||
|
category: match[1],
|
||||||
|
action: match[2] || \"default\",
|
||||||
|
args: match[3] || \"\",
|
||||||
|
sender: senderEmail,
|
||||||
|
stream: stream,
|
||||||
|
topic: topic,
|
||||||
|
rawContent: content
|
||||||
|
}
|
||||||
|
}];"
|
||||||
|
},
|
||||||
|
"id": "parse-command",
|
||||||
|
"name": "Parse Zulip Command",
|
||||||
|
"type": "n8n-nodes-base.code",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [460, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"conditions": {
|
||||||
|
"boolean": [
|
||||||
|
{
|
||||||
|
"value1": "={{ $json.isCommand }}",
|
||||||
|
"value2": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "is-command",
|
||||||
|
"name": "Is Valid Command?",
|
||||||
|
"type": "n8n-nodes-base.if",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [680, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"rules": {
|
||||||
|
"values": [
|
||||||
|
{"value": "project", "output": 0},
|
||||||
|
{"value": "code", "output": 1},
|
||||||
|
{"value": "deploy", "output": 2},
|
||||||
|
{"value": "sprint", "output": 3},
|
||||||
|
{"value": "dt", "output": 4},
|
||||||
|
{"value": "design", "output": 5}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"fallbackOutput": 6,
|
||||||
|
"options": {},
|
||||||
|
"dataPropertyName": "={{ $json.category }}"
|
||||||
|
},
|
||||||
|
"id": "route-command",
|
||||||
|
"name": "Route by Category",
|
||||||
|
"type": "n8n-nodes-base.switch",
|
||||||
|
"typeVersion": 3,
|
||||||
|
"position": [900, 200]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"url": "https://gitea.mylder.io/admin/skills-library/raw/branch/main/skills/project/create.md",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "load-project-skill",
|
||||||
|
"name": "Load Project Skill",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4,
|
||||||
|
"position": [1120, 0]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"url": "https://gitea.mylder.io/admin/skills-library/raw/branch/main/skills/code/review.md",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "load-code-skill",
|
||||||
|
"name": "Load Code Skill",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4,
|
||||||
|
"position": [1120, 100]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"url": "https://gitea.mylder.io/admin/skills-library/raw/branch/main/skills/deploy/preview.md",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "load-deploy-skill",
|
||||||
|
"name": "Load Deploy Skill",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4,
|
||||||
|
"position": [1120, 200]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"url": "https://gitea.mylder.io/admin/skills-library/raw/branch/main/skills/sprint/plan.md",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "load-sprint-skill",
|
||||||
|
"name": "Load Sprint Skill",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4,
|
||||||
|
"position": [1120, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"url": "https://gitea.mylder.io/admin/skills-library/raw/branch/main/skills/design-thinking/ideate.md",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "load-dt-skill",
|
||||||
|
"name": "Load Design Thinking Skill",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4,
|
||||||
|
"position": [1120, 400]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"jsCode": "// Handle unknown command
|
||||||
|
return [{
|
||||||
|
json: {
|
||||||
|
response: \"Unknown command category. Available: /project, /code, /deploy, /sprint, /dt, /design\",
|
||||||
|
isError: true
|
||||||
|
}
|
||||||
|
}];"
|
||||||
|
},
|
||||||
|
"id": "unknown-command",
|
||||||
|
"name": "Unknown Command",
|
||||||
|
"type": "n8n-nodes-base.code",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [1120, 600]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"jsCode": "// Format response for Zulip
|
||||||
|
const data = $input.first().json;
|
||||||
|
|
||||||
|
let response = data.response || data.error || \"Command processed\";
|
||||||
|
|
||||||
|
// Zulip expects { content: \"message\" } format
|
||||||
|
return [{
|
||||||
|
json: {
|
||||||
|
content: response
|
||||||
|
}
|
||||||
|
}];"
|
||||||
|
},
|
||||||
|
"id": "format-response",
|
||||||
|
"name": "Format Zulip Response",
|
||||||
|
"type": "n8n-nodes-base.code",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [1540, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"respondWith": "json",
|
||||||
|
"responseBody": "={{ $json }}",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "respond-webhook",
|
||||||
|
"name": "Respond to Zulip",
|
||||||
|
"type": "n8n-nodes-base.respondToWebhook",
|
||||||
|
"typeVersion": 1,
|
||||||
|
"position": [1760, 300]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"jsCode": "// Error response for invalid command
|
||||||
|
const data = $input.first().json;
|
||||||
|
|
||||||
|
return [{
|
||||||
|
json: {
|
||||||
|
content: data.error || \"Invalid command format. Use: /category action [args]\"
|
||||||
|
}
|
||||||
|
}];"
|
||||||
|
},
|
||||||
|
"id": "error-response",
|
||||||
|
"name": "Error Response",
|
||||||
|
"type": "n8n-nodes-base.code",
|
||||||
|
"typeVersion": 2,
|
||||||
|
"position": [900, 460]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"connections": {
|
||||||
|
"Zulip Webhook": {
|
||||||
|
"main": [[{"node": "Parse Zulip Command", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Parse Zulip Command": {
|
||||||
|
"main": [[{"node": "Is Valid Command?", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Is Valid Command?": {
|
||||||
|
"main": [
|
||||||
|
[{"node": "Route by Category", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Error Response", "type": "main", "index": 0}]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Route by Category": {
|
||||||
|
"main": [
|
||||||
|
[{"node": "Load Project Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Load Code Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Load Deploy Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Load Sprint Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Load Design Thinking Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Load Design Thinking Skill", "type": "main", "index": 0}],
|
||||||
|
[{"node": "Unknown Command", "type": "main", "index": 0}]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Load Project Skill": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Load Code Skill": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Load Deploy Skill": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Load Sprint Skill": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Load Design Thinking Skill": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Unknown Command": {
|
||||||
|
"main": [[{"node": "Format Zulip Response", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Error Response": {
|
||||||
|
"main": [[{"node": "Respond to Zulip", "type": "main", "index": 0}]]
|
||||||
|
},
|
||||||
|
"Format Zulip Response": {
|
||||||
|
"main": [[{"node": "Respond to Zulip", "type": "main", "index": 0}]]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"executionOrder": "v1"
|
||||||
|
},
|
||||||
|
"staticData": null,
|
||||||
|
"tags": [],
|
||||||
|
"triggerCount": 1,
|
||||||
|
"updatedAt": "2025-12-11T20:30:00.000Z",
|
||||||
|
"versionId": "1"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user