Artifact contract

From rohitg00/agentbrain · View interactive version

Artifact contract is an AI agent skill from the GitHub repository rohitg00/agentbrain. Use when an output artifact, template, schema, example, or handoff field must stay aligned across commands, skills, docs, and validators.

How to use this skill

Skill file

artifact-contract

Lifecycle stage: VERIFY

Trigger

Use when a command, skill, adapter, template, schema, eval case, or handoff depends on a structured artifact contract that another runtime or maintainer must be able to produce and validate.

This skill keeps artifact boundaries explicit so agents do not invent fields, skip schemas, or hand off prose that cannot be resumed.

When not to use

Do not use when the work only changes free-form explanatory copy and no output artifact, schema, template, example, command output, or handoff field changes.

Inputs

Procedure

  1. Identify the producer and consumer of the artifact before editing fields.
  2. Check whether the command output, skill output artifact, template, schema, example JSON, docs, and eval case all name the same artifact.
  3. Add or remove fields in the smallest compatible slice; avoid renaming fields unless the consumer contract is updated at the same time.
  4. For structured JSON artifacts, validate the schema semantics and keep additionalProperties strict unless the artifact is intentionally extensible.
  5. For markdown templates, list every required schema field with backticks so humans and validators can inspect the contract.
  6. Record how a future agent should resume from the artifact: decision or status, evidence checked, fresh validation proof, blockers, risks, artifact path, and next action.
  7. Run the targeted validator or eval case before claiming the artifact can be trusted.

Anti-Rationalization

| Shortcut | Rebuttal |

|---|---|

| "The template is only documentation." | Templates are runtime contracts; adapters and future agents use them to resume work. |

| "The schema is enough." | Humans need the template and examples to match the schema, not just parse it. |

| "One missing field is harmless." | Missing decision, evidence, blockers, artifact path, or next action breaks handoff reliability. |

| "The command says what to output." | Commands, skills, templates, schemas, examples, and validators must agree. |

Verification

Output Artifact

Produce an artifact contract review with status, artifact name, producer, consumers, template path, schema path, example path, field changes, compatibility risks, evidence, blockers, artifact path, and next action.

Failure Modes

Example

Trigger: a verification command adds a new required evidence field to a handoff artifact. Action: compare command output, skill output artifact, template field list, schema required fields, example JSON, and validator coverage before accepting the change. Output artifact: artifact contract review with blockers and next action. Verification: cite templates/handoff-report.md, schemas/handoff-report.schema.json, the example artifact path, the validator command, the artifact path, and fresh validation proof.

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.