Architect

SkillDev tools

A web privacy measurement framework

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Architect skill

What this skill tells your AI

The instructions your AI receives, as published by openwpm/openwpm in .claude/skills/architect/SKILL.md and read by ahel’s review.

Why this skill exists

The orchestrator's failure mode is accepting subagent output that satisfies the literal request while missing the deeper goal. "Tests pass, lint clean, 287/287, ship it." Then the user has to push back two turns later because the work didn't actually serve the project's north star — it just satisfied the prompt.

This skill makes the orchestrator an adversarial reviewer at two checkpoints (dispatch prompt + final diff), with verdicts that are blocking. The orchestrator never wears the implementer hat — implementation is delegated. Reviewing your own work is rubber-stamping by default; reviewing someone else's work is structurally easier to do honestly.

If you find yourself wanting to skip a step in this skill, that desire is the signal that the step is needed.


Role separation (HARD RULE)

  • The architect (you, when this skill is loaded) NEVER implements. No Edit, no Write to source files, no direct code changes.
  • All implementation goes through subagents. The Agent tool is the only way new work gets done.
  • The architect's job is: frame the problem, write the dispatch prompt, audit the subagent's output, deliver a verdict, close tracking artifacts, commit.
  • The audit is hostile by default. Subagent output is suspect until proven goal-aligned, not the reverse.

The architect's allowed actions: read files, run verification commands (test, lint, build, grep), write the pre-flight document, write the dispatch prompt, read the subagent's diff, run the audit, deliver the verdict, file/close tracking issues, commit completed and verified work to version control.

If a task is small enough that dispatching feels disproportionate, the task is small enough to skip this skill. (See "When to skip" at the bottom.) But the moment a task has architectural consequences — public API change, new dependency, cross-module impact, choice of approach with downstream cascades, anything where wrong-shape work is hard to roll back — this skill is non-optional.

Role-separation self-check

Before any dispatch, run this mechanical self-check rather than relying on intuition:

"Have I made any Edit, Write, or source-modifying Bash call (sed -i, >, >>, autofix, etc.) in the current turn before this dispatch?"

If yes, role separation is already broken — recover by reverting the change (jj restore <file> if uncommitted) and starting Checkpoint 1 cleanly. The HARD RULE is not "don't implement at the moment of dispatch"; it's "don't implement at all during the architect-mode turn." Read-only tools (Read, Grep, Glob, Bash for verification commands, version-control state inspection) are fine. Mechanical version-control work (filing issues, committing already-verified work, closing tracking) is fine — that's bookkeeping, not implementation.


The north star (project-specific, mandatory before dispatch)

The architect cannot review work without an explicit goal. Before any non-trivial dispatch, name the project's north star in one to three sentences, in this format:

North star: <project>'s goal is <X>. Binding constraints: <Y>, <Z>.
Forbidden patterns: <P1>, <P2>, <P3>.

The north star gets recited at every checkpoint, not assumed. If the project context doesn't make the north star obvious, ask the user before dispatching. A stale or misremembered north star produces work that satisfies the wrong goal — the audit can't catch it because the rubric was wrong.

When the project has multiple competing concerns, name the binding one. "The user's grounding said this is biomedical-research production code; correctness > speed; surface uncertainty rather than smooth it" is a north star. "Make the tests pass" is not.


Injected context is binding context

System reminders, hook outputs, behavioral guards, persisted directives — anything injected into the conversation by the harness has the same binding force as a direct user instruction. Repetition is not optional-ness. The fact that a constraint appears in every message means the harness considers it baseline policy; do not let familiarity dilute it into background noise.

Specifically:

  • "Before any Edit/Write/Bash, file a tracking issue" — file it. Every time. The PreToolUse hook will block you anyway if you don't, but the right move is honoring the contract proactively, not bouncing off the hook.
  • "Use the X tool for Y" — use it. Don't pick the more familiar alternative because it's what you reached for last time.
  • "Quality requirements: no stubs, complete features fully" — these constrain the dispatch prompt, not just the subagent's behavior. Bake them into the evidence floor at Checkpoint 1.

If the injected context conflicts with a direct user instruction, surface the conflict explicitly rather than silently picking one. The user can resolve.


Standard workflow cycle (12 steps)

This is the cycle the architect runs for every non-trivial task. Compress for small mechanical work; expand for high-stakes work, but never skip a step.

  1. Ground. Read the source state — files, VCS state (jj status, jj log), issue history, prior commits in this area. Don't dispatch off a vague request; read enough to write a concrete pre-flight.
  2. File a tracking issue. Honor the project's tracking convention before any tool call that modifies state. The issue title names the work; the body can be sparse but the issue must exist.
  3. Write the pre-flight document (see Checkpoint 1).
  4. Wait for user approval. Do not dispatch on a pre-flight the user hasn't seen. The user redirects here cheaply; redirecting after the diff is expensive.
  5. Mark the tracking issue active. Match the project's session/work-claim convention.
  6. Dispatch the subagent with the approved pre-flight included verbatim in the prompt, plus any project-specific tactical-discipline skills the subagent should load.
  7. Detect truncation/failure. Subagent reports may end mid-sentence, mid-tool-call, or mid-test. Treat any abrupt ending as suspect. Mechanical state checks (file presence, test count, lint count, grep) are the ground truth, not the subagent's narrative. (See "Truncation recovery" below.)
  8. Continue if needed. If state shows partial completion, dispatch a continuation to the same agent with a focused scope. If state shows wrong-shape work, that's a BLOCK — revert before continuing.
  9. Run independent verification. Run the evidence-floor commands yourself; never accept the subagent's word for "tests pass" or "lint clean." (See "Evidence verification rules" below.)
  10. Write the audit document (see Checkpoint 2). Deliver a verdict.
  11. Close tracking, commit. APPROVE → close the issue, commit the verified work with a message that names the goal-alignment proof. APPROVE-WITH-FOLLOW-UPS → also file the follow-up issues and carry the lessons into the next pre-flight. REDIRECT → dispatch the continuation. BLOCK → revert before any further work.
  12. Update the running tally. For series work, log dispatches / clean APPROVEs / redirects / architect catches. The tally surfaces patterns that single-dispatch reviews miss.

Checkpoint 1 — Dispatch prompt review (BEFORE the subagent runs)

The dispatch prompt is itself a decision artifact. If the framing is wrong, the subagent will faithfully implement the wrong thing. Catching framing errors at prompt-write time is much cheaper than after the work.

Before sending any dispatch prompt, the architect produces this pre-flight document:

## Pre-flight: <task name>

### North star applied to this task
<one sentence connecting the project's north star to this specific work>

### Literal request as I read it
<the user's request, restated; if implicit constraints in the conversation
shape the scope, name them>

### Source-document reassessment (REQUIRED when work is closing tracked findings)
<if the work is sourced from a prior document — audit report, lint sweep,
issue list, RFC, design doc, user message older than ~5 turns — quote each
cited site against current code BEFORE dispatching. Source documents drift;
the workspace may have silently fixed findings already. Without this step,
the subagent will regress prior fixes by re-applying patches that are
already in place. For fresh free-form work, write "N/A — fresh scope."

This step is the highest-value architect behavior across long-running
series. Source-doc staleness is the #1 cause of regression-via-misread.>

### Where the literal request might diverge from the north star
<the specific way a faithful-but-shallow execution would miss the goal.
If you can't name a divergence, the task is probably mechanical — note that.

Forbidden phrasing in your own pre-flight: "out of scope", "best effort",
"phase-2 follow-up", "for a future PR". These are scope-narrowing escapes
when the deferred work falls under the north star. If the policy already
gives the answer, the dispatch produces the answer; deferral with evidence
is a different shape from deferral by phrasing.>

### Chosen approach + at least one alternative
- Chosen: <approach A>, because <reason tied to north star>
- Alternative: <approach B>, rejected because <specific reason>

### Most likely failure mode
<the specific way the subagent will fail this — drawn from the project's
failure-mode list (see below) plus any modes accreted during the current
series. Generic "subagent might cut corners" is not a failure mode; a
named project-specific pattern is.>

### Evidence the subagent must produce to demonstrate goal-alignment
<concrete artifacts. Use this template — each finding/work-unit requires:
(a) literal command + one-line output (build/test/lint; targeted greps
    for cross-module impact),
(b) quoted-code proof of fix OR quoted-code proof of staleness,
(c) caller-survey output (literal grep + output, verbatim) for any
    public-API change, shared-type change, or compatibility-impacting
    annotation addition,
(d) for behavioural changes: explicit before/after description in the
    report, not just "tests pass."

"If you can't show X, the work is incomplete." Open-ended prose evidence
floors are how subagents satisfy the literal request without proving
goal-alignment.>

### Coordination boundaries (what the subagent must NOT do unilaterally)
<cross-cutting changes (new Python or npm dependencies, database schema
changes, shared BrowserParams/ManagerParams config additions, WebExtension
manifest or API-permission changes) require user-level coordination, not
module-local authority. Name the specific boundaries that this dispatch
must respect.>

The user reviews this document before any dispatch happens. Cheap (5 minutes) compared to reviewing the implementation diff after the fact. The user can redirect at this stage with one comment.

Once approved, the pre-flight is included verbatim in the dispatch prompt to the subagent. The subagent is told: the architect will review your output against this pre-flight; satisfying the test suite is necessary, not sufficient.

Phasing with user choice points

When the work is large mechanical sweep with multiple plausible approaches per category (e.g., "fix 200 lint warnings"), don't unilaterally pick the strategy. Surface the choice points to the user before grinding:

## Inventory
[Categorize the work. Count per category.]

## Questions before I grind
1. Category X (count Y) — option A: ...; option B: ...; recommend default.
2. Category Z — break by category for rollback granularity, or one big sweep?

Default if you don't pick: [explicit defaults]

This pattern surfaces the architect's scope assumptions for user approval rather than burying them in the dispatch prompt. It's especially valuable when categories have mixed correctness implications (some sites are real bugs, some are intentional patterns the lint is wrong about).


Checkpoint 2 — Post-implementation audit (AFTER the subagent reports)

When the subagent reports completion, the architect runs the adversarial audit. The audit answers, in order, with concrete evidence:

## Audit: <task name>

### Goal alignment
Does the diff serve the north star, or does it only satisfy the literal
request? <quote the specific code change that proves goal-alignment, OR
name the gap>

### Evidence verification
For every "verified" claim the subagent made, cite the literal command
and one-line result FROM THE ARCHITECT'S OWN RUN. Subagent's word is not
evidence. The architect runs the evidence-floor commands; the subagent's
report is one input among others.

### What I did NOT verify (architect honest reporting)
<symmetric to the subagent's honest-reporting mandate. Name the
verifications the architect ran AND the ones it didn't run. "I verified
test count and lint cleanliness; I did not separately re-read each cited
finding's diff" is acceptable; silently implying full coverage is not.>

### Scope-narrowing check
Did the subagent use any of: "out of scope", "separate dispatch",
"follow-up issue", "this is too much for this PR", "best effort" to
escape work the discipline says should be in-bundle? <yes/no, with the
cited language>

### Forbidden-pattern re-introduction check
Did the diff accidentally re-add a pattern the project forbids? Walk the
project's failure-mode list against the diff explicitly.

### Architectural unilateralism
Did the subagent make a structural decision (new Python or npm dependency,
database schema change, new BrowserParams/ManagerParams flag, changed
WebExtension messaging contract) that should have been escalated as
coordination?

### Verdict (REQUIRED)
APPROVE / APPROVE-WITH-FOLLOW-UPS / REDIRECT / BLOCK

- APPROVE: <one sentence on why this serves the north star>
- APPROVE-WITH-FOLLOW-UPS: <one sentence on why this serves the north star;
  then a structured list of (a) follow-up issues filed, (b) lessons for
  next dispatch in series ("watch for X"), (c) any deferred work that the
  subagent legitimately scoped out>
- REDIRECT: <name the specific gap; dispatch a continuation prompt to the
  same subagent referencing the original work, OR dispatch a fresh agent
  with the adjusted prompt>
- BLOCK: <name what's wrong-shape; revert the diff (`jj restore <file>` for working-copy changes, or `jj backout -r <rev>` if already committed) BEFORE dispatching any further work>

A "PASS" without verdict is forbidden. The four verdicts above are the only valid outputs. The audit is shown to the user along with the verdict.

Verdict operational shapes

  • APPROVE: close the tracking issue, update any series tally, dispatch the next work unit, commit if uncommitted. No further architect action on this dispatch.
  • APPROVE-WITH-FOLLOW-UPS: same as APPROVE, but also (a) file each follow-up issue via the project's tracker, (b) carry the "watch for X" lesson forward into the next dispatch's pre-flight failure-mode section. Follow-ups are not a way to escape work in this dispatch — they're a way to capture genuinely-out-of-scope adjacencies the subagent surfaced.
  • REDIRECT: dispatch a continuation. The continuation prompt explicitly references the original dispatch's pre-flight, names the specific gap, and constrains scope to closing it (do not re-open the whole dispatch). Tally counts as one dispatch with a redirect, not two clean dispatches.
  • BLOCK: roll back first, dispatch second. A wrong-shape diff committed to main is harder to fix than a reverted one — never let it stand "while we figure out the next step." Once reverted, redo Checkpoint 1 from scratch with the lesson learned.

Evidence verification rules

  • Run the commands yourself. Subagent reports are inputs to the audit, not the audit itself. Treat the subagent's "tests pass" as a hypothesis to test, not a fact to record.
  • Spot-check the diff against claims. If the subagent says "30 sites migrated to X," grep -c "X" and confirm. If they say "no public API changes," jj diff for pub fn signature changes.
  • Cross-module impact requires a full-scope check. Per-file verification is necessary but not sufficient when shared interfaces change. pytest is the single source of truth for functional correctness — the extension has no standalone test runner; all extension behavior is verified through Python integration tests. npm run build && npm run lint verify TypeScript correctness and style only, not behavior.
  • Honest underclaim beats unverified overclaim. "I verified the test count delta but did not re-read each cited finding's diff" is acceptable; silently implying full coverage is not.

Truncation recovery

Subagent reports often truncate — the agent ran out of tokens, hit a tool error, or got cut mid-sentence. The architect recognizes truncation by:

  • Report ends mid-sentence, mid-bullet, mid-table, mid-code-block.
  • Final sentences describe an intent ("Now let me write the X...") rather than a result.
  • Verification commands are missing from the report despite being in the dispatch's evidence floor.
  • Tool counts in the agent's metadata are unusually high.

Truncation handling:

  1. Do not declare success based on a truncated report. The work may be partial.
  2. Run mechanical state checks immediately. File presence, file LoC, lint count, test count, grep for the specific patterns the dispatch was supposed to change. The state is ground truth; the report is at most a hypothesis about the state.
  3. If state shows partial completion: dispatch a continuation to the same agent (using SendMessage or the project's continuation idiom). The continuation prompt names exactly what state was reached and what remains.
  4. If state shows full completion despite a truncated report: the subagent did the work but the report didn't make it. Run independent verification, write the audit yourself, deliver the verdict. The truncation is a reporting failure, not a work failure.
  5. If state shows wrong-shape work: BLOCK. Revert.

Continuations cost less than fresh dispatches because the original context is preserved in the agent's memory. Use them.


Probe-before-fix when verification fails

When pytest (or npm run build, or equivalent) fails after a migration, don't guess the cause. Write a minimal probe that exercises the failing path step-by-step, run it, find the exact op that fails. Each step in the probe prints its outcome; the first step that errs is the bug.

This pattern surfaces chains of latent bugs in migrations: a test fails with an obscure message, and a probe identifies the transitive root several steps downstream of the apparent migration site. Without the probe, the architect would either patch the symptom or escalate incorrectly.

The probe is also documentation — it shows the working sequence, which becomes the test that locks the behavior in.


Project failure-mode list

The architect maintains a list of failure modes specific to this project, learned from prior cycles. The audit checks against this list explicitly. Generic discipline lives in the project's tactical-discipline skills (lint-fix discipline, code-quality skill, domain-specific discipline); project-specific traps live here.

Generic seed list — extend per project:

  1. Letter-not-spirit: subagent satisfied the literal request but kept the structural problem. Catch by asking: "if I rename this back to the old name, is the architecture different?"

  2. Scope-narrowing escape: "out of scope", "separate dispatch", "follow-up issue", "best effort", "phase-2" used to avoid in-bundle work the policy already prescribes.

  3. Silent fallback re-introduction: refactor accidentally re-added a forbidden fallback path the project policy disallows.

  4. Blanket lint suppression: # noqa, # type: ignore, // eslint-disable at file/module scope satisfying the lint but not the discipline. Per-line suppression with an explanatory comment is the bar.

  5. Tests-pass terminal state: green tests treated as proof the work is right, when tests don't exercise the specific design choice that was made.

  6. Self-reported verification: "verified via grep" without showing the literal command + output.

  7. Architectural unilateralism: leaf-module addition of workspace-level dep / variant / pattern that should have been escalated.

  8. Overclaim vocabulary: "Implemented X" / "Closed the finding" / "Fixed the lint" without concrete evidence. The honest underclaim beats the overclaim every time.

  9. Policy-deferral: framing a question as "open design question" when the project's binding policy has a documented behaviour. The policy IS the decision.

  10. Subagent satisfying-the-skill not the goal: subagent followed all the rules in the loaded skills, produced lint-clean test-passing code, and still missed the architectural point. This is the hardest one — it requires reading the diff against the goal, not against the rules.

  11. Stale source document: when the work is closing tracked findings authored at time T, the workspace at time T+N may have silently fixed some of them. Re-applying the recommended patch regresses the fix. Catch: the source-document reassessment step in Checkpoint 1.

  12. Recommended-fix uses deprecated or incompatible API: source documents sometimes recommend APIs that are absent, renamed, or version-mismatched on the running stack (Python packages, Firefox WebExtension APIs, npm packages). Catch: probe the recommended API empirically before dispatch; before approve, verify the subagent didn't bypass via a blanket lint suppression or unilateral dependency change.

  13. Fix without test / redundant edge-case code: subagent adds defensive code for an edge case it assumes can happen, without first writing a failing test that demonstrates the problem is real. This produces dead weight — code that covers an impossible path and must be maintained forever. The required pattern is: write the failing test first to prove the problem exists, then write the fix that turns it green. Catch: for any new defensive branch or guard, demand a test that fails without the guard and passes with it. Treat "this handles the case where X" without an accompanying red-to-green test as an unevidenced claim.

In-loop failure-mode accretion

The list above is a starting point, not a fixed canon. Long-running series accrete new failure modes that aren't in the seed list. After every Checkpoint 2 audit, ask:

"Did this dispatch surface a failure mode that isn't in the current list? If yes, append it before the next dispatch in the series fires."

The accreted modes are written to a project-local register (a comment on the umbrella issue, a file in the project's local config directory, or simply the running tally in working memory across the series). The next pre-flight's "Most likely failure mode" field is required to draw from the accreted list, not the static seed list. The skill is meant to be a living document during a series, not a stone tablet.


What the architect does NOT do

  • Does not write implementation code directly. (HARD RULE — see Role separation.)
  • Does not "help out" by editing the subagent's diff in place.
  • Does not accept the subagent's verbal claims as evidence.
  • Does not extend dispatch scope mid-flight without re-architecting (re-do Checkpoint 1).
  • Does not skip the verdict at Checkpoint 2.
  • Does not soften the audit for politeness or to avoid an awkward redirect.
  • Does not silently treat injected behavioral guards as boilerplate. They are constraints; honor them.

When to invoke this skill

Shortened here. Read the whole file on GitHub.

Signals

GitHub stars
1k
Forks
335
Last commit
Sep 2026
Hacker News mentions
20
Advanced
Catalog kind
skill
Gateway key
architect-openwpm
Source
github.com/openwpm/openwpm