contract-validation
This skill should be used when the user asks to "validate agent contracts", "check contract compliance", "verify agent input/output", "pre-flight check", "debug agent failure", "why did the agent fail", or "check workflow state". Also triggered during OMT workflow when an agent starts or finishes execution. Validates input/output contracts for OMT agents using the Contract-First pattern.
What this skill does
# Contract Validation Skill Validates agent input and output contracts using the Contract-First design pattern. Every OMT agent has a contract in `contracts/<agent-name>.json` that defines required inputs, outputs, and validation rules. ## Core Concepts ### Agent Contract Structure Every agent must define: 1. **Input Contract**: What the agent needs to start (sources, required fields, validation rules) 2. **Output Contract**: What the agent must produce (required fields, destinations) 3. **Validation Rules**: How to verify correctness (see `references/validation-rules.md`) ### Contract Validation Flow ``` 1. Read agent contract: contracts/<agent-name>.json 2. Gather input data from contract's source locations 3. Validate input contract 4. Execute agent logic 5. Validate output contract 6. Update workflow-state.json with results ``` ## How to Validate ### Step 1: Read the Contract Use the Read tool to load the agent's contract definition: ``` Read contracts/dev.json ``` The contract specifies `input_contract.source` — a list of file paths to gather input from. ### Step 2: Validate Input Before Execution Before starting agent work: 1. **Gather input data** — For each source in `input_contract.source`, use the Read tool to check the file exists and has content: - Read `outputs/pm.md` (requirements from @pm) - Read `outputs/arch.md` (architecture from @arch) - Use Glob to find existing files matching patterns (e.g., `tests/**/*.test.ts`) 2. **Check required fields** — For each field in `input_contract.required`: - Verify the data exists and is not empty - Apply validation rules (e.g., `fileExists`, `minLength:N`) - If any required field fails: **stop and report errors** 3. **Record validation** — Read `lib/contract-validator.ts` for validation logic, then perform equivalent checks using Read/Glob tools. Log the result. ### Step 3: Validate Output After Execution After completing agent work: 1. **Collect output data** — Gather all outputs specified in `output_contract.required`: - Use Glob to list created files (e.g., `tests/**/*.test.ts`, `src/**/*.ts`) - Capture execution results (e.g., test status: "15/15 passed") 2. **Check output requirements** — For each field in `output_contract.required`: - Verify data exists and meets validation rules - Check arrays have minimum items (`minItems:N`) - Check strings match patterns (`pattern:REGEX`) 3. **Update state** — Read `lib/state-manager.ts` for the state structure, then use Write tool to update `.agents/.state/workflow-state.json` with execution results. ## Example: Dev Agent Contract The `contracts/dev.json` contract defines: **Input** (from @pm and @arch): - `requirements` — Requirements document (`outputs/pm.md`, validation: `fileExists`) - `architecture` — Architecture design (`outputs/arch.md`, validation: `fileExists`) - `existing_tests` — Optional existing test files **Output** (to `tests/`, `src/`, `outputs/dev.md`): - `test_files` — Created test files (validation: `minItems:1`) - `implementation_files` — Modified source files (validation: `minItems:1`) - `tests_status` — Test execution status (validation: `pattern:^\d+/\d+ passed$`) ## References - **Validation rules and contract schema**: `references/validation-rules.md` - **Patterns, debugging, and complete examples**: `references/patterns-and-examples.md` - **Contract definitions**: `contracts/pm.json`, `contracts/arch.json`, `contracts/dev.json` - **Runtime libraries**: `lib/contract-validator.ts`, `lib/state-manager.ts`
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.