Back to Engineering
2025

Drift

Python · AI · automation · CLI
View repository

Drift is a validation framework for AI context. You define rules in YAML, Drift checks your project against them, and you iterate until everything passes. Think of it like a linter for the configuration and context files that make AI coding tools work well.

Why I built it

I built Drift when I was focused on customizing context files for specific projects. Getting AI agents to perform well meant having the right files in place, structured correctly, with working links and complete definitions. But there was no way to verify any of that automatically. You'd set things up, the agent would misbehave, and you'd spend time figuring out what was missing.

Drift gave me a way to codify what a well-configured project looks like and catch problems before they caused issues. Rules check file structure, missing definitions, line counts, broken links, frontmatter structure, dependency health. It runs fast with no API calls and fits into a pre-commit hook or CI step. It also supports optional LLM-based rules through the Anthropic API or AWS Bedrock for deeper checks.

The `draft` command can generate AI prompts directly from your rules, so you can feed validation failures back into an agent to fix them. Define standards, validate, fix, re-validate.

I've mostly moved on to using Dex and pre-defined packages in a Dex registry, which addresses the broader problem. My thinking evolved from project-specific context to reusable, portable context that works across projects and tools. But Drift was where a lot of that thinking started.