Skip to main content
Detail’s Rules engine lets you create repo-specific rules. Describe a pattern in plain language, via an example bug, via an example commit SHA, and Detail generates a rule. You can use these rules

How rules work

Detail rules are enforced via an agent skill that’s stored in your repository, so you can use it flexibly: as a CI check, or to find existing violations and fix them in bulk. Rules work alongside Detail’s built-in bug scanning, so you can turn an individual bug into a guardrail that prevents the whole category of bug from happening. Rule creation is asynchronous and can take about an hour. Detail tests out the rule against your codebase and iterates on it until the results look correct.

Creating rules from the CLI

You can create a rule from three kinds of input, or combine them in a single request:
After submitting, Detail prints the request ID:

Proposing rules automatically

If you’re not sure where to start, let Detail analyze your bug history and propose rules for you:
Detail examines patterns in your existing bugs and generates rule proposals automatically. You receive a request ID and can review the proposed rules once they’re ready.

Checking rule creation status

Rule creation runs asynchronously. Use the requests subcommands to track progress:
The status field will show the current state of the request, and when it completes you’ll see the IDs of the rules that were created.

Viewing and using rules

Once rules are created, you can inspect and manage them with the following commands:
detail rules pull writes the rule files into .claude/skills/detail-rules/ in your current directory by default. You can specify a different output directory with --output:

Claude Code Skills integration

Rules pulled with detail rules pull are written as Claude Code skill files. This means the same patterns Detail uses in your cloud scans can guide your AI coding assistant when writing new code locally — closing the loop between detection and prevention.
Rule creation is asynchronous. After running detail rules create or detail rules propose, you receive a request ID (rcr_...). Poll progress with detail rules requests show <rcr_id> and retrieve the finished rule with detail rules show <rule_id> once the request completes.

Reference