Skill: Deepen Context
Load task-specific context after the target issue is known. The caller
provides focus hints; this skill reads only what is relevant.
Inputs
The calling skill passes one or more focus hints describing what area of
the codebase or design the task touches. Examples:
"wire layer"— AS2 parsing, extraction, activity patterns"BT integration"— behavior tree nodes, blackboard, py_trees"embargo lifecycle"— EM state machine, PEC transitions"case state model"— RM/CS/EM state machines, CaseStatus"adapter layer"— FastAPI inbox, SQLite data layer, emitters"testing"— pytest fixtures, test data quality, integration tests
The caller also passes the spec floor: every spec ID or group ID cited
in the issue, plan, or PR (for example, the issue's Governing specs:
line). Pass an empty floor explicitly when none are cited.
Procedure
Step 1 — Read relevant glossary sections and notes
Glossary. The term index from orient-agent gives each section of
docs/reference/glossary.md a line range. Read the sections matching the
focus hints (read by offset/limit, not the whole file). Also read
Flagged Ambiguities when the task names, renames, or introduces a domain
term.
Notes. notes/README.md is the index of active design notes, with a
Load when line per file. It is ~1000 lines — larger than most notes it
indexes — so grep it for the focus-hint terms, or read its Load when
lines, rather than reading it whole. Then read the notes/*.md files it
points at. Most tasks need 1–3.
Always-relevant notes for implementation work:
notes/architecture-hexagonal.md— layer rules and import constraintsnotes/codebase-structure.md— common pitfalls and file organizationnotes/triggers-test-coverage.md— **always read when the task adds or
touches any SvcXxxUseCase class**; documents which trigger use-cases
require a dedicated test file under test/core/use_cases/triggers/
Read additional notes files based on focus hints. When in doubt, read
rather than skip — missing context causes incorrect implementation.
Step 2 — Route through decision records by title and edge
A decision record (ADR) is history: what was decided and why, as of its date
(ADR-0127). Specs and notes carry the current rule. Route through records by
their titles and the adr: edges that requirements carry, and leave the bodies
closed:
- Titles. Grep the generated sections of
docs/adr/index.md, from
## Accepted ADRs down, for the focus-hint terms. Each line gives a
record's number and title, and its section gives the status. The preamble
above those sections is authoring guidance, so skip it.
- Edges. Load the requirements that each in-scope record generated:
```bash
PYTHONPATH= uv run spec-dump --adr ADR-NNNN,ADR-MMMM --text
```
Carry their groups into Step 3 as selected groups. A requirement that
cites a proposed or accepted-provisional record rests on an unvalidated
decision, so say that to the caller.
- Prose-only records. Some live records have no
adr:edge, and are
reached only by a citation in specs/ or notes/. For each one,
spec-dump prints note: no requirement names ADR-NNNN in adr:. Run
grep -rn ADR-NNNN specs/ notes/ and read the files it names in Step 1
or Step 3. They state the rule in full (MS-11-011). A record with no
citation at all is in RECORD_ONLY_EXEMPTIONS
(vultron/metadata/adr/back_edges.py). Those records are about how
decision records are kept, and routine work needs nothing from them.
Step 2 is done when every in-scope record is routed. Each one goes to
requirements via its edges, to the specs or notes that cite it, or is
confirmed record-only. If the task turns on whether an alternative was already
weighed and rejected, or a requirement and its record seem to disagree, hand
it to the caller or to decision-audit. Those are questions about the record
itself.
Skills that read record bodies
The routing above is for routine task context. The skills below make the
record their object of work, so they keep full access and read bodies in
full. Each one weighs what it reads by
.agents/skills/shared/weighing-decision-records.md:
| Skill | Why it reads bodies |
|---|---|
| decision-audit | It re-derives a record's premise adversarially, so the reasoning and the rejected options are the thing under audit. |
| create-architectural-decision-record | It writes and revises records, and it must read the neighbouring records to avoid duplicates and to set supersedes: links. It lives outside this repository, in the user's skills. |
| domain-modeling | It records and edits ADRs while sharpening the domain model, for the same reasons as record authoring. It lives outside this repository, in the user's skills. |
| learn | It writes the "Generated spec requirements" line of a record's More Information section (MS-11-010), and decides whether a lesson is a spec or a record. |
| plan-issue | It decides whether a plan needs a new record, and drafts one. It must read an existing record's considered options before it re-proposes a choice that was already settled. |
| pr-triage | Its ADR check fails a change that contradicts a record without an amendment. That verdict needs the record's decision outcome. |
If this list grows until most work falls under it, bodies are routine context
again under another name. ADR-0127 names that as its revisit trigger.
Step 3 — Load governing specs (REQUIRED)
This step runs after notes and the record routing because they cite spec IDs
and sharpen the focus hints; it runs before the code scan so requirements shape what
the scan looks for. Do not skip it, even for small tasks.
Always pass --text. Without it every load is a single line of JSON, so
printing one shows a truncated prefix of one unreadable token.
- Cross-cutting (always):
```bash
PYTHONPATH= uv run spec-dump --cross-cutting --text
```
- Floor (always): load every spec ID the caller passed, plus their
dependencies.
```bash
PYTHONPATH= uv run spec-dump --ids <ID>,<ID> --deps --text
```
Group IDs in the floor (e.g. CS-02) go to --group instead of --ids.
The floor is every spec or group ID cited anywhere in the issue, plan,
or PR — a Governing specs: line, a References: line, or body prose all
count. An issue with no such line has an empty floor, not a missing step:
record none — <reason> and carry on. Do not treat an absent line as
licence to skip selection; on a measured run the floor was empty and the
two requirements that most constrained the change were found only by the
backstop.
- Selected: from the spec map loaded by
orient-agent, choose the
topics and groups that match the focus hints and the issue text.
When in doubt, include the group — a missed requirement costs more
than extra context.
```bash
PYTHONPATH= uv run spec-dump --topic <A>,<B> --text
PYTHONPATH= uv run spec-dump --group <ARCH-01>,<CS-02> --text
```
--text gives id, priority, and statement. Drop it for a specific group
when you need rationale, dependencies, tags, or verification to interpret
it — that form is JSON, so read it with jq rather than printing it.
- Emit a Spec manifest to the caller in exactly this format:
```text
Spec manifest
Loaded (floor): <ids from issue/plan/PR, or "none — <reason>">
Loaded (cross-cutting): <the topic IDs --cross-cutting returned>
Loaded (selected): <topic/group id> — <one-line reason>; ...
Considered, skipped: <group id> — <one-line reason>; ...
```
List every group ID in full: RMB-01 RMB-02 RMB-03, never a range like
RMB-01..03, which nothing parses.
The manifest makes spec selection auditable: reviewers can see what was
loaded and what was deliberately skipped. Callers carry the manifest into
the PR body, and check it against the code with spec-backstop (below).
Backstop — resolving the manifest against the changed files. Selection is
judgment; spec-backstop derives the same question from the code
independently. Save the manifest to a per-issue path so concurrent agents do
not overwrite each other, then run it:
# Before any code exists — the files the work will touch:
PYTHONPATH= uv run spec-backstop --manifest /tmp/spec-manifest-<issue>.txt \
--paths <file> <file>
# Once a diff exists, drop --paths; the branch diff is the default:
PYTHONPATH= uv run spec-backstop --manifest /tmp/spec-manifest-<issue>.txt
Run it here with --paths, before writing code — that is where a missed
requirement is still cheap to act on. build and bugfix re-run it against
the real diff before they finish.
It derives the spec groups governing the code (tests that import a changed
symbol, mirror-path tests, statements naming a changed module or symbol,
markers in changed tests) and exits 1 listing every MUST group the
manifest neither loaded nor skipped. For each one, load it
(spec-dump --group <G> --text), check the change against it, then add it to
Loaded (selected) or Considered, skipped with a reason. Re-run until exit
- INFO groups are advisory: incidental importers, hub symbols, catch-all
suites, and SHOULD/MAY-only groups. Skim them; you are not required to resolve
them.
What a pass does and does not mean. It is a floor, not a ceiling. The
backstop only sees what the code already says, so it is silent on a
requirement no changed file or test names yet — on a measured run it missed
the two groups most central to the change while flagging fourteen peripheral
ones. Exit 0 means nothing derivable was missed; it never means the selection
is complete. Two notes weaken it further, and both are printed:
no deterministic signal for: <file> (that file's selection rests on your
judgment alone) and no Python source in the diff (a docs-only or
YAML-only change, where the tool derives nothing at all).
Do not run spec-dump with no filters, and do not read raw
specs/*.yaml files directly.
Step 4 — Read relevant codebase reference files
Read from docs/reference/codebase/ based on task scope:
| File | Read when |
|---|---|
| ARCHITECTURE.md | Always for implementation tasks |
| STRUCTURE.md | When navigating unfamiliar modules |
| CONVENTIONS.md | When writing new code |
| STACK.md | When adding or evaluating dependencies |
| TESTING.md | When writing or reviewing tests |
| CONCERNS.md | When assessing risk or technical debt |
| INTEGRATIONS.md | When working on external integrations |
Step 5 — Scan the codebase
Compose-before-create (blocking pre-coding step — all domain types):
Load .agents/skills/shared/compose-before-create.md and apply the
per-subsystem search targets for every subsystem the task touches. Use the
focus hints to determine which subsystems are in scope, then run the
corresponding searches before reading any target implementation file:
| Focus hint keyword | Subsystem to search |
|---|---|
| use cases, handler, trigger | vultron/core/use_cases/ |
| wire layer, AS2, pattern, activity | vultron/wire/as2/ |
| adapter, FastAPI, delivery, emitter | vultron/adapters/ |
| BT, behavior tree, node, blackboard | vultron/core/behaviors/ |
| demo, scenario, helper | vultron/demo/helpers/ |
Do not read any target implementation file until this search is complete. If
an existing artifact covers the requirement, compose or subclass it — do not
re-implement.
BT integration (BTC-01-001, BTND-07-005): After the compose-before-create
scan, also apply the base-class and AC-1 compliance checks from
vultron/core/behaviors/AGENTS.md § "Compose Before Create: Node Discovery
Gate".
Search vultron/ and test/ directly (grep, code search) — this is the
default. Do not assert missing functionality without evidence from code
search.
Graphify (optional seam-tracing aid). When the task spans a seam (e.g.
wire layer → BT integration), the graph can trace the connection. Check it
first — the graph is gitignored, per-worktree, and often stale:
bash .agents/skills/shared/graph-freshness.sh
Only on exit 0, use graphify path "<ConceptA>" "<ConceptB>" or
graphify explain "<ClassName>", then verify against source. Do not rely on
community names (they degrade as the graph is updated) or on graphify query
output (it truncates on this graph's size), and verify any count with grep.
Notes
- Focus hints come from the calling skill after it has selected and read
the target issue. For build and bugfix, the issue body describes
what is needed; use that as the basis for hints, and pass its
Governing specs: line as the spec floor.
- For
plan-issue, this skill runs at Phase 3, before the grill-me
interview at Phase 4, so the first pass has only the issue text to work
from. Re-invoke it after the interview with the areas grill-me surfaced as
additional hints, carrying the same floor.
- Planning and docs-only work still needs a manifest. Step 3 is not
conditional on writing code: the Task bodies plan-issue creates draw
their Governing specs: lines from the manifest, so skipping it leaves
every downstream build with an empty floor. Run the backstop with
--paths naming the files the plan or fix will touch. For a docs-only
change it will report that it derived nothing — that is expected, and it
means your selection is the only check.