Orient

From nrdxp/predicate · View interactive version

Orient is an AI agent skill from the GitHub repository nrdxp/predicate. Project-orientation workflow (/orient): installs predicate's enforcement into a target project, maps its structure and goal, and authors the persistent conditioning layer (AGENTS.md goal-hierarchy) so every subsequent walk is anchored and gated. Trigger when: - Onboarding a new project into predicat

How to use this skill

Skill file

Orient: Project Orientation Workflow

Predicate is project-centric: /orient is its first contact with a

project. It engages this repository concretely — installs predicate's

enforcement, maps the repo, learns its goal, and authors the **persistent

conditioning layer** (the AGENTS.md goal-hierarchy) so every subsequent

walk is anchored and gated. Not an idealized formula imposed from outside;

a boundary fitted to the actual project.

Quickstart: install predicate into your harness → target a project →

run /orient.


Phases (state machine; halts at the two human seams)

The eight phases execute in order. Two are human seams — the walk

halts and awaits human input before continuing. The others are

mechanical or agent-automated.

Phase 0 — BOUND *(compose `/boundary` — do not rush)*

Before touching the repo, invoke CODE0 to

draft an IBC for the orientation work itself: what is this project, what

is known vs unknown going in, what is the desired end state of onboarding

it.

/boundary is also the authority for the AGENTS.md contract the

AUTHOR phase (phase 6) conforms to — composed here, not duplicated. The

required content (Goal, Requirements/Invariants/Constraints, Unknowns,

Operational entrypoint, Structure, Alignment-to-parent) and the soundness

invariants are defined in

CODE0.

Phase 1 — ESTABLISH *(mechanical, automated — no human input)*

Run bootstrap/install.sh init --project <dir>: install git hooks into .git/hooks (untracked,

auditable, removable), initialize the .ledger sub-repository, wire

project config. Idempotent — safe to re-run on an already-oriented

project.

Phase 2 — MAP *(domain — outward→structure; cheapest tier; hunt-to-dry)*

Fan out a multi-modal sweep over the repository:

architectural docs.

Scale to the repo: a small project needs one pass; a large one warrants

the full sweep. Stop when no new approach-relevant structure surfaces.

This phase carries no goal-fit judgment and routes to cheap agents.

Phase 3 — SURVEY *(arsenal — outward→environment; cheapest tier)*

Enumerate predicate's own skills plus the host harness's installed

skills, tools, and MCP servers available to this project. Project each

for relevance to the discovered structure; do not enumerate exhaustively

into context.

Phase 4 — ELICIT *(goal — HUMAN SEAM, halt)*

This phase halts. The walk does not proceed until the human confirms

the goal.

From the MAP, extract a candidate goal + requirements / invariants /

constraints / known-unknowns. Present the candidate to the human with:

Halt and await confirmation. Goal-fit is not self-attestable — an

agent is least calibrated exactly here; the human is the goal authority.

Do not proceed to NEST or AUTHOR until the goal is confirmed or corrected.

Phase 5 — NEST *(structure decision)*

Decide which directories have a goal *genuinely distinct from and in

service of* the root goal, and therefore warrant their own AGENTS.md.

Default: root only. Add a component AGENTS.md only when a real

sub-goal exists. Every additional file is a staleness surface: it must be

kept true, linked correctly, and synced at every refresh. The

alignment-to-parent requirement (from the AGENTS.md contract) is the

defeater substrate — a component whose goal does not serve the root is

a structural fault.

Phase 6 — AUTHOR *(draft against the contract — authority: `/boundary`)*

Draft the root AGENTS.md and any component files decided in NEST. Each

draft MUST conform to the AGENTS.md contract in

CODE0:

carries a URL. No assumed external knowledge.

the end state is not yet reached.

(rules.md, ambient.md, specs);

never copy their text.

cut it.

signpost.

brevity is anti-drift.

Component AGENTS.md files MUST include the alignment-to-parent section

(how this component serves the root goal).

AGENTS.md as R/I/U Hierarchy — the P-TRACK persistent anchor

Each AGENTS.md (root and component) MUST include a **Requirements /

Invariants / Unknowns** hierarchy for the construct it governs (P-TRACK

I-T1–I-T2, primitives-spec.md §P-TRACK §"The AGENTS.md fusion"). This

makes AGENTS.md the persistent anchor that every subsequent walk

hydrates its live tracker from, rather than reconstructing from scratch.

Required sections per construct AGENTS.md:

## Requirements
Each item: statement, grounding (source/evidence), signpost (what defeats it).
Pruned to the minimal bounding set — requirement bloat is drift surface.

## Invariants
Each item: statement, grounding, signpost (what would violate it).
Constraints that must hold throughout; distinguished from requirements by
"must hold" vs "must be satisfied."

## Unknowns
Each item: statement, grounding (why it is not yet resolved), signpost
(the observable that would resolve or invalidate it).
Treated first-class like requirements — filed with a signpost, never
merely noted.

## Spec Pointers
Pointers to full specification sources for this construct: doc paths,
ADR links, contract file paths. Kept minimal — one pointer per
authoritative source, never prose summaries of the specs themselves.

Authoring discipline:

context_map.ncl Item contract; last_validated is filled in by

the walk that hydrates, not the orient author).

a walk surfaces an unknown-unknown, it files it here (promoting

it to a known-unknown with a signpost) via the promotion combinator.

is durable; the prose diverges and must be cut.

Nest depth: add an R/I/U hierarchy to a component AGENTS.md only

when the component has a genuinely distinct sub-goal (Phase 5 NEST

criterion). A root-only project has one R/I/U hierarchy in its root

AGENTS.md covering all constructs.

Phase 7 — RECONCILE *(HUMAN SEAM — the sync gate)*

This phase halts. The persistent layer mutates only through this

reconciliation — never silently.

Present each draft AGENTS.md to the human. The human reconciles

(the volatile draft → persistent sync). On approval, land files at their

target paths (root /AGENTS.md; component <dir>/AGENTS.md).

Unanswered questions from the known-unknown registry that were not

resolved during ELICIT are re-presented here for prioritization, so a

topic-change does not lose them.


Re-run = Refresh (anti-rot)

On an already-oriented project, /orient is the sync/refresh pass.

Run it whenever the AGENTS.md hierarchy may have drifted from reality.

The refresh pass re-executes the same eight phases but MAP and SURVEY are

diff-scoped (what changed since the last orientation). ELICIT surfaces

drift candidates: stale claims, dead links, a parent goal a child no

longer serves (a defeater), requirements that became constraints or vice

versa.

RECONCILE on a refresh presents only the changed sections, not the full

file. **Surfaced-but-unanswered known-unknowns from prior orientations

are re-presented** so they are never silently dropped.


Hydration Protocol — live tracker hydrates from AGENTS.md

When a walk begins on an oriented project (AGENTS.md hierarchy

exists), it MUST hydrate its live context_map tracker from the

relevant construct's AGENTS.md, not from scratch. (P-TRACK I-T1–I-T2;

primitives-spec.md §P-TRACK §"The AGENTS.md fusion".)

Hydration steps:

  1. Locate the governing construct AGENTS.md. For a root-scoped task:

the root AGENTS.md. For a component-scoped task: the component

AGENTS.md (if it exists) plus the root for alignment.

  1. Read the R/I/U sections. Extract each item from the

Requirements, Invariants, and Unknowns sections.

  1. Populate the context-map items. For each extracted item, set:

pointer itself if none is recorded: "AGENTS.md#requirements")

— records that this item came from the persistent anchor

  1. Export and verify. The populated context-map MUST pass

nickel export against context_map.ncl (ContextMap contract)

before the walk proceeds.

  1. Start from scratch only when unoriented. An unoriented project

(no AGENTS.md) initializes an empty context-map and populates it

during the walk. This is the fallback, not the default.

Hydration is the first step of every walk on an oriented project,

before any task work. A walk that skips hydration and starts from scratch

on an oriented project violates I-T1 (absence = all-unknown-unknown). The

tracker_fresh.sh gate enforces this: a stale last_validated on a

hydration_source item signals the anchor has drifted.


Reorientation — ongoing disposition, triggered by staleness

**Reorientation is not a scheduled re-run; it is a disposition triggered

by staleness.** (P-TRACK I-T3; primitives-spec.md §P-TRACK §"reorientation

as an ONGOING disposition".)

A staleness trigger fires when:

(a last_validated is behind the HEAD commit date).

a requirement is now wrong, an invariant is now broken, or a

known-unknown has been resolved. This is premise-freshness lifted to

the persistent tracker.

an existing Requirement or Invariant in AGENTS.md.

On a staleness trigger:

  1. Run tracker_fresh.sh <context-map-instance.ncl> to identify stale

items and their hydration_source pointers.

  1. For each stale hydration_source: read the corresponding AGENTS.md

section and compare against the current state.

  1. If drift is tactical (the item's signpost has not fired; the

item is still valid, just needs its last_validated updated):

update last_validated in the context-map and continue.

  1. If drift is strategic (the item's signpost HAS fired — a

requirement is contradicted by reality, or an unknown is resolved):

this is a Strategic Escalation (ambient.md §Planning Invariants).

Emit an ESCALATION block, update the live tracker and the AGENTS.md

persistent anchor via /orient refresh, and halt for human review.

Reorientation scope. A tactical re-validation (step 3) does not

require re-running the full eight-phase workflow — it is a targeted

tracker update. A strategic reorientation (step 4) re-runs at minimum

MAP (diff-scoped) and ELICIT, and presents the corrected R/I/U sections

at RECONCILE for human confirmation before writing back to AGENTS.md.

Staleness is not an error. A stale item is a signal, not a failure.

The failure is ignoring the signal — carrying a stale, unverified

requirement forward into task work (rules.md §7: reconstruct, don't

recall).


Tier Economy

| Phase | Tier | Rationale |

| :--- | :--- | :--- |

| 0 BOUND | Architect | Bounding judgment; goal-fit stakes highest here |

| 1 ESTABLISH | Mechanical | Pure bootstrap execution; no judgment |

| 2 MAP | Cheap agents | Structure survey; no goal-fit judgment |

| 3 SURVEY | Cheap agents | Enumeration and relevance projection |

| 4 ELICIT | Architect + Human | Goal-fit is not self-attestable; human seam |

| 5 NEST | Architect | Structural coupling judgment |

| 6 AUTHOR | Architect | Contract-conformant draft |

| 7 RECONCILE | Human | Persistent layer mutates only here |


See Also

sufficiency conditions (phase 0) and the AGENTS.md contract (phase 6).

after orientation is complete.

AGENTS.md references.

AGENTS.md hierarchy anchors to.

the freshness gate; checks whether context-map last_validated fields

are current against HEAD. Fresh→0, Stale→1.

the live tracker carrier contract; hydration_source field records the

AGENTS.md anchor a hydrated item came from.

the Nickel functional core: is_fresh and stale_items predicates.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.