
Boost your AI agent's reliability from 60% to near-perfection with a data-driven testing framework.
Learn how Pinterest Engineering quantifies and improves the reliability of custom AI skills. This guide explores building a test harness, benchmarking Codex and Claude, and implementing proven optimization techniques for complex repositories.
Engineering teams using AI agents should prioritize building a quantitative test harness over qualitative feedback to ensure workflow reliability.
AI agents showed unreliability in invoking specific domain-specific skills, such as Pinterest's iOS architecture rules, hindering the automation of engineering workflows.
The team implemented a Bash-based test harness to track skill invocation rates across positive and negative cases and applied optimizations like frontmatter descriptions and AGENTS.md skill tables.
Baseline accuracy (73% for Codex, 62% for Claude) was significantly improved through contextual frontmatter descriptions, achieving consistent results when intent was clear.
Trade-off
Optimizing AGENTS.md increases token usage in the context window, and AI-driven self-improvement of prompts unexpectedly led to lower invocation rates in some cases.
The process where an AI agent recognizes and activates a specific set of pre-defined rules or domain knowledge to complete a task.
An automated testing framework composed of scripts and tools designed to run tests and collect performance metrics.
A metadata section at the beginning of a file used to provide instructions or context to an AI agent.








