Skip to main content
Detail’s Rules engine lets you create project-specific analysis rules. Describe a pattern in plain language, point to example bug IDs from past scans, or share commit SHAs where a problem was introduced — Detail’s AI generates a reusable rule that gets applied to every future scan on top of the baseline analysis. Over time, your rules encode your team’s standards so Detail catches the same classes of issues automatically.

How rules work

When you create a rule, Detail’s AI analyzes the context you provide and generates a rule file that captures the pattern. That rule is stored against your repository and applied as an additional lens on every subsequent scan. Rules work alongside Detail’s built-in analysis — they don’t replace it. Rule creation is asynchronous. When you submit a request you receive a request ID (formatted rcr_...) that you can use to check progress. When the rule is ready, it appears in your rule list with a stable rule ID (rule_...).

Creating rules from the CLI

You can create a rule from three kinds of input, or combine them in a single request:
# From a plain-language description
detail rules create --description "Flag any use of console.log in production code"

# From existing bug IDs — Detail uses these as examples of the pattern to detect
detail rules create --bug-ids bug_abc123,bug_def456

# From commit SHAs — Detail examines the commits to extract the underlying pattern
detail rules create --commit-shas abc1234,def5678

# Combine all three for richer context
detail rules create \
  --description "Avoid raw SQL string concatenation" \
  --bug-ids bug_abc123 \
  --commit-shas abc1234
After submitting, Detail prints the request ID:
✓ Rule creation started.
  Request ID: rcr_01j9x...
  Use 'detail rules requests show <id>' to check progress.

Proposing rules automatically

If you’re not sure where to start, let Detail analyze your bug history and propose rules for you:
detail rules propose
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:
# List all rule creation requests for the current repo
detail rules requests list

# Check the status of a specific request
detail rules requests show rcr_01j9x...
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:
# List all rules for the current repository
detail rules list

# Read the full content of a specific rule
detail rules show rule_01j9x...

# Download rule files to your local machine
detail rules pull rule_01j9x...
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:
detail rules pull rule_01j9x... --output ./my-skills/

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

CommandDescription
detail rules createSubmit a rule creation request using a description, bug IDs, or commit SHAs
detail rules proposeAsk Detail to propose rules based on your bug history
detail rules listList all completed rules for the current repository
detail rules show <rule_id>Display the content of a specific rule
detail rules pull <rule_id>Download rule files locally into .claude/skills/detail-rules/
detail rules requests listList all rule creation requests for the current repository
detail rules requests show <rcr_id>Check the status of a specific rule creation request