flyee 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/bin/install.js +9 -0
- package/core/skills/cost-tracking/SKILL.md +68 -0
- package/core/skills/doctor/SKILL.md +171 -0
- package/core/skills/hallucination-guard/SKILL.md +110 -0
- package/core/skills/knowledge-persistence/SKILL.md +123 -0
- package/core/skills/quality-gates/SKILL.md +109 -0
- package/core/skills/roadmap-reassessment/SKILL.md +134 -0
- package/core/skills/skill-discovery/SKILL.md +152 -0
- package/core/skills/sprint-validation/SKILL.md +125 -0
- package/core/skills/stuck-detection/SKILL.md +176 -0
- package/core/skills/token-profiles/SKILL.md +150 -0
- package/core/skills/unique-ids/SKILL.md +112 -0
- package/core/templates/RUNTIME.template.md +41 -0
- package/package.json +2 -2
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: token-profiles
|
|
3
|
+
description: Token optimization profiles that coordinate model selection, context compression, and phase skipping. Three modes — budget (40-60% savings), balanced (10-20%), quality (full power). Complexity-based routing automatically classifies tasks and selects appropriate models.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Token Profiles
|
|
7
|
+
|
|
8
|
+
> Coordinate token optimization across the entire workflow.
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
Not every task needs the most expensive model. Documentation tasks don't need Opus. Simple bug fixes don't need 200K context. Token profiles let you trade quality for cost (or vice versa) with a single setting.
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
In `.flyee/config.json`:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"token_profile": "balanced"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Profiles
|
|
25
|
+
|
|
26
|
+
| Profile | Token Savings | When to Use |
|
|
27
|
+
|---------|--------------|-------------|
|
|
28
|
+
| `budget` | 40-60% | Personal projects, prototyping, learning |
|
|
29
|
+
| `balanced` | 10-20% | Normal development (default) |
|
|
30
|
+
| `quality` | 0% | Production features, complex architecture |
|
|
31
|
+
|
|
32
|
+
### Budget Profile
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
token_profile: budget
|
|
36
|
+
behavior:
|
|
37
|
+
model_tier: cheap # Use cheapest available model
|
|
38
|
+
context_loading: minimal # Load only essential files
|
|
39
|
+
skip_phases:
|
|
40
|
+
- research # Skip research phase
|
|
41
|
+
- reassessment # Skip roadmap reassessment
|
|
42
|
+
verification: advisory # Log warnings, don't block
|
|
43
|
+
knowledge_injection: rules_only # Only inject rules, not patterns
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Balanced Profile (Default)
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
token_profile: balanced
|
|
50
|
+
behavior:
|
|
51
|
+
model_tier: standard # Use standard model
|
|
52
|
+
context_loading: standard # Load relevant files
|
|
53
|
+
skip_phases:
|
|
54
|
+
- slice_research # Skip per-slice research (project research still runs)
|
|
55
|
+
verification: enforced # Block on failures
|
|
56
|
+
knowledge_injection: full # Inject rules + patterns + recent lessons
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Quality Profile
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
token_profile: quality
|
|
63
|
+
behavior:
|
|
64
|
+
model_tier: premium # Use best available model
|
|
65
|
+
context_loading: comprehensive # Load all related files
|
|
66
|
+
skip_phases: [] # No phase skipping
|
|
67
|
+
verification: strict # All checks + manual review suggestions
|
|
68
|
+
knowledge_injection: full # Everything
|
|
69
|
+
extra:
|
|
70
|
+
- dual_review # Review own output before committing
|
|
71
|
+
- extended_planning # Longer planning phase
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Complexity-Based Model Routing
|
|
75
|
+
|
|
76
|
+
Automatically classify tasks by complexity and route to appropriate models:
|
|
77
|
+
|
|
78
|
+
### Classification Heuristics
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
SIMPLE (use cheap model):
|
|
82
|
+
- Documentation updates
|
|
83
|
+
- Config file changes
|
|
84
|
+
- Single-file edits < 50 lines
|
|
85
|
+
- Adding comments or logs
|
|
86
|
+
- Rename/move operations
|
|
87
|
+
|
|
88
|
+
STANDARD (use standard model):
|
|
89
|
+
- Multi-file feature implementation
|
|
90
|
+
- Bug fixes requiring investigation
|
|
91
|
+
- Test writing
|
|
92
|
+
- Refactoring within a module
|
|
93
|
+
|
|
94
|
+
COMPLEX (use premium model):
|
|
95
|
+
- Architectural changes
|
|
96
|
+
- Cross-module refactoring
|
|
97
|
+
- Security-sensitive code
|
|
98
|
+
- Performance optimization
|
|
99
|
+
- Database schema changes
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Classification Signals
|
|
103
|
+
|
|
104
|
+
| Signal | Weight | Example |
|
|
105
|
+
|--------|--------|---------|
|
|
106
|
+
| File count | 0.3 | 1 file = simple, 5+ = complex |
|
|
107
|
+
| Keyword analysis | 0.3 | "refactor architecture" = complex |
|
|
108
|
+
| Test requirements | 0.2 | No tests = simple, integration tests = complex |
|
|
109
|
+
| Domain sensitivity | 0.2 | Auth/payment = complex, docs = simple |
|
|
110
|
+
|
|
111
|
+
### Model Tier Mapping
|
|
112
|
+
|
|
113
|
+
| Tier | Gemini | Claude | OpenAI | OpenRouter |
|
|
114
|
+
|------|--------|--------|--------|------------|
|
|
115
|
+
| `cheap` | Flash | Haiku | GPT-4o-mini | DeepSeek |
|
|
116
|
+
| `standard` | Pro | Sonnet | GPT-4o | Sonnet via OR |
|
|
117
|
+
| `premium` | Ultra | Opus | o1 | Opus via OR |
|
|
118
|
+
|
|
119
|
+
> **Note:** Actual model names depend on the runtime. This maps concepts, not specific model IDs.
|
|
120
|
+
|
|
121
|
+
## Budget Pressure
|
|
122
|
+
|
|
123
|
+
As costs approach the budget ceiling, progressively downgrade:
|
|
124
|
+
|
|
125
|
+
| Budget Used | Action |
|
|
126
|
+
|-------------|--------|
|
|
127
|
+
| < 50% | Normal operation per profile |
|
|
128
|
+
| 50-75% | Suggest cheaper model for simple tasks |
|
|
129
|
+
| 75-90% | Force cheap model for non-critical tasks |
|
|
130
|
+
| > 90% | Force cheap model for ALL tasks + warn user |
|
|
131
|
+
|
|
132
|
+
### Pressure Event
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
bridge.emit_event("cost.budget_pressure", {
|
|
136
|
+
"sprint": "S09",
|
|
137
|
+
"budget_used_pct": 78,
|
|
138
|
+
"pressure_level": "medium",
|
|
139
|
+
"action": "force_cheap_for_simple",
|
|
140
|
+
"current_profile": "balanced"
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Integration
|
|
145
|
+
|
|
146
|
+
- **cost-tracking**: Uses budget data to trigger pressure
|
|
147
|
+
- **skill-discovery**: Profiles affect which skills are loaded (budget = fewer)
|
|
148
|
+
- **context-budget**: Profiles set the effective context window size
|
|
149
|
+
- **quality-gates**: Quality profile enables stricter gates
|
|
150
|
+
- **Flyee SaaS**: Profile selection and model routing visible in cost dashboard
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unique-ids
|
|
3
|
+
description: Unique ID generation for sprints, phases, tasks, and decisions. Avoids collision in team environments. Format uses short prefixes + random suffix for human-readability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unique IDs
|
|
7
|
+
|
|
8
|
+
> Collision-free identifiers for team environments.
|
|
9
|
+
|
|
10
|
+
## Problem
|
|
11
|
+
|
|
12
|
+
Sequential IDs (`S01`, `T03`) collide when multiple developers work on the same project. Developer A creates `S01`, Developer B creates `S01` — merge conflict.
|
|
13
|
+
|
|
14
|
+
## ID Format
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
{prefix}-{short-hash}
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
S-a3f8 → Sprint
|
|
21
|
+
P-7c2e → Phase
|
|
22
|
+
T-b4d1 → Task
|
|
23
|
+
D-9e5f → Decision
|
|
24
|
+
E-1a2b → Event
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Format Details
|
|
28
|
+
|
|
29
|
+
| Component | Description |
|
|
30
|
+
|-----------|-------------|
|
|
31
|
+
| Prefix | `S` (Sprint), `P` (Phase), `T` (Task), `D` (Decision), `E` (Event) |
|
|
32
|
+
| Hash | 4 hex characters from `crypto.randomBytes(2).toString('hex')` |
|
|
33
|
+
|
|
34
|
+
4 hex chars = 65,536 combinations per prefix. Collision probability:
|
|
35
|
+
- 10 items: ~0.07%
|
|
36
|
+
- 100 items: ~7%
|
|
37
|
+
- 1000 items: ~100% (would need longer hashes)
|
|
38
|
+
|
|
39
|
+
For projects with >500 items of same type, extend to 6 hex chars (16M combinations).
|
|
40
|
+
|
|
41
|
+
## Generation
|
|
42
|
+
|
|
43
|
+
### In Python (bridge/local_tracker.py)
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import secrets
|
|
47
|
+
|
|
48
|
+
def generate_id(prefix: str) -> str:
|
|
49
|
+
"""Generate a unique short ID with prefix."""
|
|
50
|
+
suffix = secrets.token_hex(2)
|
|
51
|
+
return f"{prefix}-{suffix}"
|
|
52
|
+
|
|
53
|
+
# Usage
|
|
54
|
+
task_id = generate_id("T") # "T-b4d1"
|
|
55
|
+
sprint_id = generate_id("S") # "S-a3f8"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### In JavaScript (installer/scripts)
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
import { randomBytes } from 'crypto';
|
|
62
|
+
|
|
63
|
+
function generateId(prefix) {
|
|
64
|
+
const suffix = randomBytes(2).toString('hex');
|
|
65
|
+
return `${prefix}-${suffix}`;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## When to Generate
|
|
70
|
+
|
|
71
|
+
| Entity | Generator | Storage |
|
|
72
|
+
|--------|-----------|---------|
|
|
73
|
+
| Sprint | Agent (during `/plan`) | `.flyee/STATE.md` |
|
|
74
|
+
| Phase | Agent (during planning) | `.flyee/STATE.md` |
|
|
75
|
+
| Task | `bridge.create_task()` | `.flyee/tasks.json` |
|
|
76
|
+
| Decision | `bridge.create_decision()` | `.flyee/DECISIONS.md` |
|
|
77
|
+
| Event | `bridge.emit_event()` | `.flyee/events.jsonl` |
|
|
78
|
+
|
|
79
|
+
## Collision Handling
|
|
80
|
+
|
|
81
|
+
If a generated ID already exists in the local store:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
def generate_unique_id(prefix: str, existing_ids: set) -> str:
|
|
85
|
+
"""Generate a unique ID, retrying on collision."""
|
|
86
|
+
for _ in range(10):
|
|
87
|
+
new_id = generate_id(prefix)
|
|
88
|
+
if new_id not in existing_ids:
|
|
89
|
+
return new_id
|
|
90
|
+
# Fallback: use 6 chars
|
|
91
|
+
return f"{prefix}-{secrets.token_hex(3)}"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Backward Compatibility
|
|
95
|
+
|
|
96
|
+
Old sequential IDs (`S01`, `T03`) remain valid. The system accepts both formats:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
def normalize_id(raw_id: str) -> str:
|
|
100
|
+
"""Accept both old (S01) and new (S-a3f8) formats."""
|
|
101
|
+
if '-' in raw_id:
|
|
102
|
+
return raw_id # New format
|
|
103
|
+
return raw_id # Old format (passthrough)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Integration
|
|
107
|
+
|
|
108
|
+
- **state-machine**: Uses unique IDs for sprint/phase hierarchy
|
|
109
|
+
- **cost-tracking**: Logs reference task IDs
|
|
110
|
+
- **session-resilience**: Session lock includes unique session ID
|
|
111
|
+
- **bridge**: `create_task()` auto-generates unique ID
|
|
112
|
+
- **Flyee SaaS**: Maps local IDs to Notion page IDs during sync
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# RUNTIME
|
|
2
|
+
|
|
3
|
+
> Auto-maintained by flyee. Documents the runtime context of this project.
|
|
4
|
+
> Updated when services, endpoints, or environment variables change.
|
|
5
|
+
|
|
6
|
+
## Environment Variables
|
|
7
|
+
|
|
8
|
+
| Variable | Purpose | Required | Default |
|
|
9
|
+
|----------|---------|----------|---------|
|
|
10
|
+
| `DATABASE_URL` | Database connection string | Yes | - |
|
|
11
|
+
| `API_BASE_URL` | Backend API base URL | Yes | `http://localhost:3001` |
|
|
12
|
+
| `NODE_ENV` | Runtime environment | No | `development` |
|
|
13
|
+
|
|
14
|
+
## Services
|
|
15
|
+
|
|
16
|
+
| Service | URL | Port | Health Check |
|
|
17
|
+
|---------|-----|------|-------------|
|
|
18
|
+
| Frontend | `http://localhost:3000` | 3000 | `GET /` |
|
|
19
|
+
| Backend API | `http://localhost:3001` | 3001 | `GET /health` |
|
|
20
|
+
| Database | `localhost:5432` | 5432 | `pg_isready` |
|
|
21
|
+
|
|
22
|
+
## External APIs
|
|
23
|
+
|
|
24
|
+
| API | Base URL | Auth | Docs |
|
|
25
|
+
|-----|----------|------|------|
|
|
26
|
+
| - | - | - | - |
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
| Action | Command |
|
|
31
|
+
|--------|---------|
|
|
32
|
+
| Dev server | `npm run dev` |
|
|
33
|
+
| Build | `npm run build` |
|
|
34
|
+
| Test | `npm run test` |
|
|
35
|
+
| Lint | `npm run lint` |
|
|
36
|
+
| Database migrate | `npm run db:migrate` |
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Add project-specific runtime context here
|
|
41
|
+
- This file is read by the agent at session start to understand the deployment context
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flyee",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "AI Agent Framework —
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "AI Agent Framework — 22 specialist agents, 81 skills, 44 workflows. All runtimes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bruno Santana <bruno@flyee.dev>",
|
|
7
7
|
"repository": {
|