The flow
Every AEP interaction follows the same six-step cycle:- Apply flow
- Save flow
When you tell your agent to apply packs before a task:
Resolve the install target
The agent detects which agent-specific directory is active in this repo (
.claude/aep/, .opencode/aep/, .cursor/aep/, etc.) and reads packs from that location.Load candidates from the index
The agent reads
index.json to get a list of all packs, then loads each referenced pack file. Both "0.1" and "1.0-exp" packs are included — the apply flow is backwards compatible.Compute a base match score
For each pack, the agent scores keyword and tag overlap against the current task description and repo context:
match.keywordsmatch.patternsmatch.tags
Adjust with applies_to
For v1.0-exp packs, the agent checks whether the pack’s
applies_to metadata aligns with the current context:languagesandframeworksin use- file
pathsbeing touched domains(frontend, backend, infra, data)
applies_to fields boost the score. Mismatching fields dampen it. These are soft filters — a pack is never hard-disqualified by applies_to alone.Combine with strength
The final score blends the task-specific match score with the pack’s general reliability:If
strength is absent (v0.1 packs), the agent treats it as neutral (0.5).Rank and select packs
Packs are ranked by:
- Scope — task > project > user (always)
- combined_score — higher is better
- Recency —
metrics.last_used_atorindex.updated_atas a tiebreaker
Activate and explain
The agent merges signals from the selected packs — task-scope signals override project-scope, which override user-scope. It reports which packs are active, their scores, and the key constraints and success checks now in effect.
Pack scopes
Every pack belongs to one of three scopes. Scope determines priority: higher-scope signals always override lower-scope ones when packs conflict.| Scope | File location | Purpose | Priority |
|---|---|---|---|
| Task | tasks/<id>.aep.json | Patterns for a specific kind of task (e.g., HTML to Next.js migration) | Highest |
| Project | project.aep.json | Defaults that apply to every task in this repo (e.g., never redesign the layout) | Middle |
| User | user.aep.json | Your personal collaboration style and preferences across all projects | Lowest |
Matching and scoring
Matching works in two layers. Layer 1 — keyword and tag overlap (works for all pack versions): The agent compares the current task description against each pack’smatch block:
match.keywords— individual termsmatch.patterns— short natural-language phrasesmatch.tags— categorical labels
applies_to context (v1.0-exp only):
The agent checks the pack’s structured context hints:
app/, this pack gets a boost. If you’re working on a Python backend service, it gets dampened. These are soft adjustments — not hard filters.
The scoring formula:
strength: 0.9) will consistently rank above a similar pack with strength: 0.5 when match scores are close.
strength interpretation:
| Value | Meaning |
|---|---|
0.3 | Weak or tentative pattern |
0.7 | Solid pattern that has worked multiple times |
0.9+ | Very strong, highly trusted pattern |
Metrics tracking
Each time a pack is applied, AEP updates its usage metrics:| Field | Type | Description |
|---|---|---|
times_applied | integer | How many times this pack has been actively applied |
first_used_at | ISO 8601 | Timestamp of first use |
last_used_at | ISO 8601 | Timestamp of most recent use |
avg_turns_saved | number | Rough estimate of back-and-forth messages saved on average |
Pack evolution
Packs are not static. They improve as you use them.History events
Every meaningful change to a pack is recorded in thehistory array:
created, updated, promoted, and merged.
Promotion
A task pack that proves itself across multiple tasks can be promoted to project scope — broadening its reach. A project pack that reflects your personal style across many repos can be promoted to user scope. Promotion addshistory entries to both the source and target packs, creating an audit trail of how your patterns evolved.
Merge suggestions
When two packs have heavily overlapping intent and constraints, AEP can flag them for potential consolidation:aep inspect to surface any active merge suggestions.
Save a pack
Full guide to saving signals and initializing pack fields.
Apply packs
Step-by-step guide to the apply and scoring flow.
Matching and scoring
Deep dive into the scoring formula and applies_to behavior.
Schema reference
Complete field reference for v1.0-exp packs.