Skip to main content
aep apply runs before you start any substantial task. It loads your saved packs, scores each one against the current task and repo context, selects the top 1–3, and reports which constraints, preferences, and success checks are now active. The task then runs under those alignment rules.

When to apply

Apply packs at the start of any task that involves non-trivial decisions — refactors, migrations, feature work, infra changes. Trivial one-liners generally don’t need it.

Example user phrases

"Before starting, apply any high-strength AEPs relevant to TypeScript Next.js frontend work."
"Use Robi AEP v1.0-exp to pick the best packs for this backend refactor."

What the apply flow does

1

Resolve the install target

The agent detects the active agent directory for this repo and uses it as the AEP source root:
<agent-dir>/aep/
The same detection order as aep save applies: explicit reference → directory with existing aep/ files → currently running agent → ask.
2

Load pack candidates

The agent loads candidates in two passes:
  1. Read <agent-dir>/aep/index.json to get the list of known packs.
  2. For each index entry, load the referenced pack file.
Both "version": "0.1" and "version": "1.0-exp" packs are loaded. The index may contain mixed versions; the agent handles both.
3

Compute a base match score

For each pack, the agent computes a base match score by comparing the task description and repo context against three fields:
  • match.keywords — individual terms that signal relevance
  • match.patterns — natural-language phrases describing common task shapes
  • match.tags — category labels like "frontend" or "migration"
The raw overlap is normalized to a score in [0, 1].
4

Adjust with applies_to

For v1.0-exp packs, the base score is adjusted using the applies_to block:
  • If languages, frameworks, paths, or domains clearly align with the current context, the score is boosted.
  • If they clearly mismatch, the score is dampened.
This is a soft filter. A pack is never hard-disqualified on applies_to alone — it just ranks lower.
5

Combine with strength

The adjusted match score is blended with the pack’s strength value to produce a final combined score:
combined_score = 0.6 * match_score + 0.4 * strength
If a pack has no strength field (e.g. a v0.1 pack), strength is treated as neutral (0.5).

Scoring weights

ComponentWeightSource
match_score60%keyword/pattern/tag overlap + applies_to adjustment
strength40%Pack-level confidence scalar (01)
6

Rank and select active packs

Packs are sorted by three criteria in priority order:
  1. Scope — task packs rank above project packs, which rank above user packs
  2. combined_score — higher is better
  3. Recencymetrics.last_used_at (or index.updated_at for older packs) breaks ties
The top 1–3 packs are selected as active. If no pack has strong alignment, the agent prefers fewer active packs over including weak ones.
7

Update metrics

For each selected pack, the agent updates two fields:
  • metrics.times_applied — incremented by 1
  • metrics.last_used_at — set to the current timestamp
These updates feed back into future ranking via the recency tiebreaker and inform promotion decisions.
8

Report active packs

The agent tells you:
  • which packs are active (id, title, scope)
  • their combined scores and strength values
  • key constraints and preferences now in force
  • success checks you should verify at the end
The task then proceeds under these alignment rules. Task pack signals override project pack signals; project pack signals override user pack signals.

Scoring at a glance

StepInputOutput
Base matchmatch.keywords, match.patterns, match.tagsmatch_score ∈ [0, 1]
applies_to adjustmentapplies_to.languages, .frameworks, .paths, .domainsBoosted or dampened match_score
Strength blendpack.strengthcombined_score = 0.6 × match_score + 0.4 × strength
Scope sortscope fieldtask > project > user
Recency tiebreakmetrics.last_used_atMost recently used wins

aep save

Save a successful workflow as a pack

aep inspect

Surface active packs, scores, and metrics

Matching and scoring

Deep dive into the scoring algorithm

Schema reference

Full field definitions for v1.0-exp packs

Build docs developers (and LLMs) love