Common verification first

From macalbert/envilder · View interactive version

Common verification first is an AI agent skill from the GitHub repository macalbert/envilder. Normative verification-first policy for all change intents. Defines independent verification contracts, strategy selection, evidence rules, role ownership, and final evaluation without prescribing microscopic implementation steps.

How to use this skill

Skill file

Verification-First Engineering

This is the normative policy for planning, implementing, reviewing, and

verifying repository changes across every Envilder stack.

Core Principle

The implementation must not define its own success criteria.

Expected results derive from approved requirements, invariants, acceptance

criteria, architecture constraints, and stable external contracts. Control the

correctness of the result without prescribing the microscopic process used to

produce it.

A passing command is evidence. It is not proof that the requirement was

interpreted correctly.

Distinct Concepts

Refactor. An Implementer may use that loop when useful, but this workflow does

not require it.

separate expected behavior from solution generation, but physical ordering

alone does not guarantee independence.

implementation-independent oracle before solution edits when meaningful. The

oracle may be a test, compiler, type checker, schema validator, policy check,

contract check, generated-artifact check, or direct workflow.

The goal is reliable evidence of correctness, not the maximum number of tests.

Two Independent Dimensions

Classify every task by both intent and verification strategy. Neither dimension

mechanically determines the other.

Intent

Choose exactly one:

| Intent | Meaning |

| --- | --- |

| NEW_BEHAVIOR | Introduces an observable capability or system property |

| BEHAVIOR_CHANGE | Intentionally changes an existing observable contract |

| BUG_FIX | Restores expected behavior by correcting a confirmed defect |

| PURE_REFACTOR | Changes structure while preserving observable behavior |

| NON_BEHAVIORAL_CHANGE | Changes artifacts without changing system behavior |

Infrastructure, configuration, migrations, generated artifacts, and test

infrastructure are subjects of work, not extra intents. Classify what the change

means, not which directory it touches.

Verification Strategy

Select one or more strategies justified by the requirement:

| Strategy | Typical use |

| --- | --- |

| New, updated, or reused behavioral tests | Observable behavior and regressions |

| Existing-suite baseline | Pure refactors and already protected behavior |

| Consumer or direct-workflow evidence | Test infrastructure and operational workflows |

| Compiler, type, or static validation | API shape, type safety, architecture, lint, generated consistency |

| Schema, policy, migration, or contract validation | Configuration, data evolution, and external contracts |

| Explicit limitation | No meaningful executable oracle is available |

Prefer the fastest deterministic strategy that directly exercises the important

boundary. Add broader gates when a narrow oracle cannot expose integration risk.

Role Ownership

Change Orchestrator

judgment.

limitations.

Contract Verifier, and semantic changes to human approval.

Contract Verifier

implementation.

Final Verifier

and independent contract in a fresh context.

the read-only profile cannot perform.

Implementer

documentation, migrations, refactors, and test infrastructure.

Reviewer

history.

change-set-review for a staged, unstaged, branch, commit-range, or

pull-request diff.

factored.

Artifact Ownership

Verification-contract artifacts encode success criteria: behavioral,

regression, contract, architecture, or acceptance tests; expectation snapshots;

and dedicated validation scripts or specifications created to express the

approved contract.

Solution artifacts include production code, configuration, documentation,

migrations, refactors, fixtures, builders, seeders, mocks, containers, data

loaders, runner setup, and other test infrastructure.

The Contract Verifier may edit only verification-contract artifacts while

establishing a contract. The Implementer may edit only solution artifacts. The

Reviewer and Final Verifier edit nothing.

Capability Exposure and Inheritance

On filtering hosts, a descendant's effective tools are limited by its own

profile and every ancestor's exposed tools. Change Orchestrator, Content

Designer, and PR Resolver therefore each declare the explicit inheritance

envelope [read, search, edit, execute, agent]. Every ancestor must expose all

required descendant tools, including agent for nested delegation.

Exposure does not grant semantic authority: coordinators never edit artifacts,

and Change Orchestrator never executes repository commands. Contract Verifier

owns verification-contract edits; Implementer owns solution edits. Host

approval gates remain in force; never use wildcard tool grants or bypass

approvals to repair propagation.

Workers retain their own limits: Contract Verifier and Implementer use

[read, search, edit, execute], Reviewer uses [read, search, execute], and

Final Verifier uses [read, search]. None delegates. A broader ancestor

envelope must not expand a worker's effective boundary.

These common aliases are portability defaults, not universal host tool names

or support guarantees. Preflight actual tool exposure, nested delegation, and

worker boundaries; return BLOCKED with the missing capability when required

support cannot be established. Implementer diagnoses missing read/edit/execute

and may use execute-based search when no dedicated search tool is exposed.

Semantic Handoffs

Fresh contexts provide separation of responsibilities and independent

evaluation. Fresh does not mean starved of context.

Every worker receives the approved semantic inputs it needs:

FinalVerificationResult.

Do not propagate transcripts, raw command logs, failed attempts, temporary

hypotheses, private reasoning, or obsolete result histories. Communicate

semantic results, not full working trajectories.

Verification-First Workflow

  1. Approve the requirement, observable outcome, invariants, scope, and

constraints.

  1. Classify intent and choose the verification strategy independently.
  2. Delegate a fresh Contract Verifier.
  3. Confirm the VerificationContract derives from approved semantics and uses

the narrowest credible oracle.

  1. Delegate a fresh Implementer to produce the coherent solution.
  2. Run a fresh read-only Reviewer in candidate-review mode unless the strict

omission rule applies.

  1. Route findings to their owner and repeat only the affected downstream

stages.

  1. Delegate a new fresh Final Verifier.
  2. Only an explicit Final result: PASS in FinalVerificationResult for the

exact current reviewed candidate permits Change Orchestrator completion

judgment. PASS is necessary, not sufficient: all existing acceptance

conditions still apply.

If any candidate artifact changes after review or final verification, invalidate

the affected results and rerun the necessary review and final verification

against the new candidate.

Final Result Gate and Recovery

Implementer and contract defects to a fresh Contract Verifier, then repeat

affected downstream stages. Changes to approved semantics, invariants, scope,

or requirements require human approval.

BLOCKED; callers must not claim successful completion, publish PR replies,

or resolve threads. Unavailable required evidence alone is not an instruction

to edit the solution.

BLOCKED. A legitimately approved limitation strategy can still receive

PASS when the approved contract is actually satisfied and assessable.

requires reassessment of the corrected contract/candidate, appropriate review,

and fresh final verification. Only a fresh explicit PASS reopens judgment.

another role's success nor passing commands establish final PASS.

Callers must require this qualifying final PASS for each artifact-changing

action, even if its ChangeResult nominally claims success. All approved actions

must succeed before batch publication; prepared but held replies are not

published success. Aggregate validation and remote availability are additional

gates, not substitutes for final PASS. Direct no-artifact answers and approved

skips retain their existing workflow and applicable exemptions.

Review Omission

Candidate review may be omitted only when every condition is true:

artifact, or test infrastructure; and

Record the rationale, evidence, and residual risk. Any uncertainty requires

review. A lifecycle-level or complete change-set review may still be required by

the caller.

Rules by Intent

`NEW_BEHAVIOR`

do so.

the risk.

`BEHAVIOR_CHANGE`

exists.

`BUG_FIX`

coverage.

failing boundary.

than a compilation, setup, dependency, or environment failure.

`PURE_REFACTOR`

invariants.

`NON_BEHAVIORAL_CHANGE`

checks.

Infrastructure and Configuration

Classify by intent first, then choose the natural oracle. Appropriate evidence

can include workflow or configuration schema validation, policy validation,

migration checks, API or event contract validation, compiler checks, type

checking, lint, and generated-code consistency.

Do not force infrastructure behavior into a shallow unit test when policy,

contract, plan, or migration evidence expresses the real system property more

directly.

Test Infrastructure

Fixtures, builders, mocks, stubs, seeders, containers, data loaders, and

test-runner configuration are solution artifacts.

Use this order:

  1. Run a production-behavior consumer test that uses the support artifact.
  2. Reproduce the affected test workflow directly when needed.
  3. Add the smallest focused test of a stable support contract only when the

first two paths cannot localize the defect with enough diagnostic precision.

The focused support test is diagnostic instrumentation, not a coverage target.

Record why consumer or workflow evidence was insufficient.

Oracle Effectiveness

Physical test-first ordering is only a proxy for independence. The stronger

question is:

Can the verification meaningfully reject an incorrect or previous behavior?

Useful effectiveness evidence may include:

A failing signal counts only when its observed reason matches the expected

absent, previous, or defective behavior. Compilation, setup, dependency, and

environment failures are limitations to resolve or report, not evidence that

the behavioral oracle is effective.

Do not require visible Red merely as ritual. For critical behavior, consider

stronger techniques such as property-based testing, mutation testing, boundary

analysis, concurrency scenarios, contract validation, and independent review.

Behavioral Test Strategy

Inside-out and outside-in are both valid ways to discover behavioral

verification. Neither dictates how the Implementer must construct the solution.

Use the lowest test level that can prove the requirement without mocking away

the risk:

| Level | Select when |

| --- | --- |

| Unit | Pure behavior has no I/O and a small stable boundary |

| Integration | Behavior crosses layers, persistence, HTTP, queues, or framework wiring |

| Acceptance | A stakeholder use case needs full application-path evidence |

| E2E | A small number of critical flows require real user and deployed-style boundaries |

Behavioral verification should be isolated, order-independent, deterministic,

readable as a requirement, specific enough to localize failure, insensitive to

private structure, and maintainable in proportion to the protected risk.

Coverage and test count are diagnostics, not goals. Prefer observable results

and required side effects over private methods, trivial storage, framework

registration in isolation, or mock interactions as ends in themselves.

Compact Result Shapes

These are the canonical workflow envelopes. Role agents may add task-specific

detail but must not rename, remove, or contradict these fields.

VerificationContract

Intent and strategy:
Behaviors and invariants:
Verification artifacts:
Targeted commands:
Pre-state effectiveness evidence:
Broader gates:
Assumptions:
Result:
Risks or limitations:
ImplementationResult

Intent and strategy:
VerificationContract received:
Solution artifacts changed:
Candidate paths:
Design decisions:
Targeted command and result:
Broader gates and results:
Contract status: SATISFIED | UNSATISFIED | BLOCKED
Unresolved concerns or risks:
ReviewResult

Mode and scope:
Summary:
Prioritized findings:
No-finding rationale:
Verification observations and commands:
Contract assessment: <assessment | NOT_PROVIDED>
Verdict: APPROVE | COMMENT | REQUEST_CHANGES | BLOCKED
Remaining risks:
FinalVerificationResult

Candidate paths assessed:
Approved semantics assessed:
Review disposition assessment:
Behaviors and invariants assessed:
Targeted command results:
Broader gate results:
Contract assessment:
Final result: PASS | FAIL | BLOCKED
Risks or limitations:
ChangeResult

Approved specification:
Intent and strategy:
VerificationContract:
Changed paths and candidate scope:
Latest ImplementationResult:
Latest ReviewResult or ReviewOmission:
FinalVerificationResult:
Final judgment:
Limitations and residual risks:

What Remains Strict

implementation.

implementation.

What Remains Flexible

Never require a new test, a failing test, or a separate cleanup phase merely to

satisfy a ritual. Require independent criteria, appropriate evidence, sound

architecture, and a credible final judgment.

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.