Skip to main content
Turn your team’s style guide and architectural principles into enforceable policy. This scheduled automation scans your codebase for known anti-patterns (hard-coded credentials, SQL injection vectors, deprecated API usage, forbidden imports), files tickets, and — where safe — opens auto-fix PRs.

Use this template

Open Code Pattern Enforcer in Devin and create the automation with the default configuration. You can customize it before saving.

What this automation does

Where linters catch lexical issues, this automation catches semantic ones: misused APIs, deprecated modules, performance anti-patterns, and security smells that no off-the-shelf linter knows about. You describe the patterns in plain English, and Devin applies them repo-wide on a schedule.

How it works

Trigger: Schedule eventrecurring
  • Event: schedule:recurring
    • Conditions:
      • rrule matches FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0
What Devin does: Starts a session with full event context, executes the prompt below, and (optionally) notifies you on failure.

Prerequisites

Example prompt

The template ships with this prompt. You can edit it after clicking Use template, or leave it as-is.

Setting it up

  1. Open Automations → Templates in Devin.
  2. Click Code Pattern Enforcer. The create page opens with this template pre-filled.
  3. Connect any required integrations and install MCP servers if you haven’t already.
  4. Replace any placeholder values in the trigger conditions (for example, swap your-org/your-repo for your actual repo).
  5. Review the prompt and adjust it for your team’s language, conventions, and guardrails.
  6. Click Create automation.
Most automation templates include suggested ACU and invocation limits to bound cost during early rollout. Keep them as-is until you’re confident in the automation’s behavior, then raise them to fit your workload.

When to use this template

  • Enforcing team-specific architectural conventions across a large codebase
  • Migrating away from deprecated internal APIs
  • Proactive security hygiene beyond off-the-shelf SAST tools
  • Codifying tribal knowledge into enforceable patterns

Customization ideas

  • Describe patterns in plain English via Knowledge
  • Scope to specific repos, directories, or file types
  • Decide per-pattern whether to auto-fix or file a ticket
  • Combine with SonarQube Quality Gate Fix for broad coverage

See also