agentleFS
aozyildirimaozyildirim/Agena/skills/agena/integration-rule-engine/SKILL.md

integration-rule-engine

Skill100 starsChanged 8 months agoMITView on GitHub

A declarative routing engine that turns ticket / error attributes (reporter, label, project, area path, error class, environment) into a tag + AI agent + priority assignment, so cross-source workflows ("security tickets always go to the OWASP reviewer") stay out of code and in user-editable rules.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a Sentry / NewRelic / Jira / Azure DevOps event lands, you want to auto-tag it, route it to the right AI reviewer agent, and bump …

    line 10
  2. Very specific:

    Declarative > imperative: Don't sprinkle if reporter == X branches across import code.

    line 79
  3. Distinctive:

    Audit the route: Every applied rule should leave a trail on the task: which rule fired, which fields matched.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Integration Rule Engine

When a Sentry / NewRelic / Jira / Azure DevOps event lands, you want to auto-tag it, route it to the right AI reviewer agent, and bump priority based on attributes — without rebuilding the routing logic in code per source. The Integration Rule Engine collapses all that into one rule table.

How to apply this pattern

  1. Single rule table with provider + match (JSON) + action (JSON) + priority (rule precedence) + is_active. Same shape across providers; the matcher just checks the appropriate attributes.
  2. Match clause — matches a single field with one operator. Common operators:

    OperatorUse
    equalsreporter is exactly security@yourco.com
    containstag list contains security
    inreporter in (security@yourco.com, secops@yourco.com)
    regexerror class matches ^TypeError|^IntegrityError$
    prefixarea path starts with Project\Backend\
  3. Action clause — what happens when the rule matches:
    • tag: add a tag string to the imported task (e.g. security_review)
    • preferred_agent_role: which reviewer agent to route through (e.g. security_developer)
    • priority: override priority (critical, high, etc.)
    • target_repo: override the default repo mapping for this task
  4. Evaluate at import time, not at agent run time. Stamp the action into the task's metadata so downstream agents and the UI see the same routing without re-evaluating.
  5. First-match-wins with explicit priority. A rule with higher priority gets evaluated first; a single rule wins per import.

Example rules

# Security tickets reported by the security team go to the
# OWASP-aware reviewer with critical priority
- provider: jira
  match: { field: reporter, op: in, values: [security@yourco.com] }
  action:
    tag: security_review
    preferred_agent_role: security_developer
    priority: critical

# Sentry errors in the payments project always route to a senior
# backend reviewer
- provider: sentry
  match: { field: project, op: equals, value: payments }
  action:
    tag: payments
    preferred_agent_role: senior_backend
    priority: high

# Azure DevOps work items in a specific area path
- provider: azure_devops
  match: { field: area_path, op: prefix, value: "Project\\Frontend" }
  action:
    tag: frontend
    preferred_agent_role: a11y_reviewer

Notes

  • Declarative > imperative. Don't sprinkle if reporter == X branches across import code. The whole point is letting non-engineers edit routes from a UI.
  • Same engine for every provider. Sentry, NewRelic, Jira, Azure DevOps imports all flow through the same rule evaluator. Adding a new provider becomes "expose its attributes to the matcher" instead of "rewrite routing".
  • Audit the route. Every applied rule should leave a trail on the task: which rule fired, which fields matched. Important when a reviewer asks "why did this end up with security_review?"
  • Preferred Agent Role stamped on description metadata is a clean hand-off to the review service. The reviewer-resolution code then honours that without needing to re-evaluate the rule.
  • Test rules before publishing: provide a "dry run" mode where the rule editor shows which past tickets / errors would have matched. Catches greedy regex disasters before they fire on real imports.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.