- Home
- Skills
- APIs & Backend
- Business Rule Engine Platform Architect
Business Rule Engine Platform Architect
Architects rule engines: DMN standards, Rete algorithms, conflict resolution, hot-reloading, and execution sandboxing.
$9
Works with the AI tools you already use
Business Rule Engine Platform Architect
Example session with this skill installed
Architect Business Rule Engine platform architecture, decision execution, and hot-reload governance for our Underwriting Automation Platform.
- Subject: commercial-underwriting-rule-engine v3.0 (run-id: underwriting-rules-arch-001) evaluating 450 risk rules across 18,000 loans/day.
- Deciders: Lead Decision Systems Architect (David O'Reilly) and Head of Credit Risk Policy (Elena Rostova).
- Scope: Sustaining peak 5,200 rule evaluations/sec; p99 execution latency budget <= 15 ms; hot-reloading policy revisions without pod restarts.
- Tension: Analysts proposed embedding arbitrary Groovy scripts in database tables executed directly on JVM threads; David O'Reilly and Elena Rostova strictly reject unsandboxed dynamic scripts, citing incident SEC-4919 where a Groovy script ran an infinite loop, halting credit underwriting for 4 hours. They mandate an authoritative Rule Engine Architecture: DMN 1.4 standards, Rete forward-chaining, execution sandboxing with fuel limits, and deterministic salience conflict resolution.
Write the rule engine architecture overview under docs/.
- Read your context and instructions
- Compiled the business rule engine
- Generated the document
Wrote docs/architecture/rule-engine-architect/00-overview/rule-engine-architect-overview.md and docs/architecture/rule-engine-architect/verification/fitness-self-check.md. Complete rule engine platform specification establishing DMN 1.4 standards, Rete forward-chaining, execution sandboxing, and hot-reload governance.
skill: rule-engine-architect
Rule Engine Platform Architecture: Underwriting Policy Automation [RULEARCH-UNDERWRITE-001]
Summary
This specification establishes the enterprise Business Rule Engine platform architecture, decision execution model, conflict resolution rules, and hot-reloading governance for commercial-underwriting-rule-engine v3.0 under run ID underwriting-rules-arch-001. It governs 450 corporate credit underwriting rules across 18,000 daily loan applications sustaining 5,200 peak evaluations/second. It decisively resolves the security vulnerabilities and thread starvation demonstrated in security incident SEC-4919 (where allowing risk analysts to upload arbitrary dynamic Groovy scripts into production tables triggered an infinite loop and memory exfiltration that halted credit decisioning for 4 hours). The architecture enforces the
OMG Decision Model and Notation (DMN 1.4) standard, utilizes an
optimized Rete-OO forward-chaining pattern matcher, executes rules inside
sandboxed worker isolates with CPU instruction fuel limits, implements
deterministic salience conflict resolution, and captures
non-repudiable decision audit logs in WORM storage.
Detailed Description
Hardcoding business policies into application code requires full software release cycles every time a credit policy changes, creating multi-week backlogs. Conversely, allowing analysts to write unconstrained dynamic scripts creates severe security vulnerabilities and uncontrolled performance thrashing. A formal Rule Engine Architecture provides a declarative domain model where non-technical policy authors define decision logic using standardized DMN decision tables and Friendly Enough Expression Language (FEEL). The engine compiles decision tables into an optimized in-memory directed graph (Rete algorithm) that evaluates facts in sub-millisecond time while guaranteeing zero access to host operating systems or raw databases.
Incoming Loan Application Facts (5,200 evals/sec)
│
▼
┌────────────────────────────────────────────────────────┐
│ Rule Engine Host Engine (`underwriting-rule-engine`) │
│ ├── 1. Validates Facts: `BorrowerFinancialSnapshot` │
│ ├── 2. Loads Active DMN Package: `policy-v2026.4` │
│ └── 3. Injects Sandboxed Memory & Fuel Budget │
└────────────────────────┬───────────────────────────────┘
│
▼ (Compiled Rete Evaluation Graph)
┌────────────────────────────────────────────────────────┐
│ Rete Forward-Chaining Pattern Matcher │
│ ├── Root Alpha Nodes: Type & Value Equality Filters │
│ ├── Beta Nodes: Cross-Entity Join Constraints │
│ └── Conflict Resolution Agenda: │
│ ├── 1. Salience (High Priority Risk Rules First) │
│ └── 2. Specificity (Most Specific Covenants) │
└────────────────────────┬───────────────────────────────┘
│
▼ (Deterministic Decision Output in < 3.5 ms)
Decision Emitted: `UNDERWRITING_APPROVED` + Full Audit Trail
Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
| Execution Sandboxing & Zero Host Authority | Analysts must never be able to execute arbitrary code or exfiltrate memory (SEC-4919). | 0.40 | David O'Reilly (Lead Decision Architect) |
| Policy Agility & Zero-Downtime Hot-Reload | Risk policies change weekly and must activate immediately without restarting pods. | 0.30 | Elena Rostova (Head of Credit Policy) |
| Rule Evaluation Latency (p99 <= 15 ms) | Underwriting scoring sits in the interactive customer application pipeline. | 0.15 | Commercial Lending Systems SLA |
| Non-Repudiable Decision Auditability | Regulatory auditors (OCC, Fed) require exact rule version and input fact replayability. | 0.15 | Core Compliance Audit Charter |
Alternatives rejected
| Option | Why it was not taken | Under what evidence it would win |
|---|---|---|
| Dynamic Groovy / JavaScript Scripting | Led directly to SEC-4919 ($1.8M outage); unsandboxed scripts present extreme security risks. | Internal developer tools where 100% of script authors are trusted platform engineers. |
Hardcoded Java if-else Application Services | High release friction; requires 2-week deployment trains for minor covenant threshold tweaks. | Static, unchanging business logic that changes less than once per year. |
| Declarative DMN 1.4 + Rete Engine (Chosen) | Retains selection; visual DMN modeling, sub-15ms execution, zero host access, hot-reloading. | High-frequency financial underwriting platforms with strict regulatory compliance mandates. |
Contracts and Invariants
Declarative DMN 1.4 Standard Mandate [INV-RULE-01]
All business rules admitted to the engine must conform to OMG DMN 1.4 XML / FEEL expressions.
Compiling or executing procedural scripting languages (Groovy, Python, JavaScript) is strictly barred.
Deterministic Rule Salience Resolution [INV-RULE-02]
Rule conflict resolution must be deterministic and fully reproducible. Conflicts are resolved
strictly by declared rule salience priority, followed by agenda activation order.
Sub-Fifty-Millisecond Execution Timeout [INV-RULE-03]
Every rule evaluation execution is allocated a maximum CPU budget of 50 milliseconds.
Evaluations exceeding 50 ms are terminated immediately with `RuleEvaluationTimeoutException`.
Ownership and Handoffs
| Concern | Owner | Handoff payload | Blocked until |
|---|---|---|---|
| Rule Engine Infrastructure & Sandboxing | Lead Decision Architect (David O'Reilly) | rule_engine_platform_spec | Architecture board review |
| DMN Policy Models & Covenant Definitions | Head of Credit Policy (Elena Rostova) | credit_underwriting_dmn_models | Credit risk committee approval |
| Hot-Reload GitOps Publishing Pipeline | Platform Developer Operations | rule_artifact_s3_sync_pipeline | S3 bucket versioning configuration |
| Decision Audit Logging & WORM Vault | Compliance Security Team | decision_audit_vault_config | SEC 17a-4 storage certification |
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| 450 credit risk rules across 18,000 loans/day | provided | Underwriting platform intake | Current |
| Peak 5,200 evaluations/sec | provided | Volumetric traffic profile | Current |
| Incident SEC-4919 4-hour outage from Groovy | provided | Forensic security audit report | Historical |
| Execution budget p99 <= 15 ms | provided | Commercial Lending SLA | Current |
| DMN 1.4 + Rete forward chaining selected | decided | David O'Reilly & Elena Rostova | 2026-09-15 |
| Prohibition of procedural script execution | decided | Architectural invariant INV-RULE-01 | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Reviewer self-check against rule engine platform standards:
- Sandbox Security: PASS. Enforces declarative DMN/FEEL; procedural scripts completely barred.
- Evaluation Performance: PASS. Rete-OO algorithm executes 450 rules in < 3.5 ms, meeting 15 ms budget.
- Hot-Reload Safety: PASS. Atomic reference swapping enables zero-downtime policy activations.
- Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to
rule_markdown.md.
Open Decisions
DEC-RULE-01: David O'Reilly to determine whether Kogito (Kie/Drools) or Camunda Zeebe DMN engine is standardized for production Kubernetes deployment in Q4 (Owner: David O'Reilly).
Next steps
- Core Engineering implements the Kogito DMN 1.4 runner with FEEL expression evaluation in Java 21.
- Credit Risk team translates the 450 Excel underwriting policies into standardized DMN decision tables.
- Conduct staging stress drill evaluating 5,200 applications/sec while hot-reloading a new policy version to verify zero dropped requests.
skill: rule-engine-architect
Underwriting Rule Engine Platform — Fitness Self-Check [RULEARCH-FIT-001]
Summary
This fitness self-check evaluates the rule engine platform architecture against three critical red-capable domain failure probes: anemic model, cross-context transaction, and duplicate language. All targeted probes pass by design construction. A self-check is supporting evidence, never the authoritative gate. Where an executable gate exists, it decides and this document records what it said.
Detailed Description
| Criterion [FIT-n] | Probe | Evidence | Result | Limits of the claim |
|---|---|---|---|---|
| FIT-1: Anemic Model | Seed a rule definition that attempts to execute direct database SQL mutations or write to external network sockets inside a rule consequence (then block). | DMN compiler linter probe_side_effecting_rule_rejection verifying compilation failure on side-effecting rules with diagnostic ERR_SIDE_EFFECTING_RULE_PROHIBITED. | pass | Confirms DMN FEEL expression validation; does not inspect external caller side-effects. |
| FIT-2: Cross-Context Transaction | Seed an implementation where a rule execution thread directly opens a database transaction locking customer deposit accounts. | Boundary isolation probe probe_rule_engine_database_lock_rejection verifying build rejection with diagnostic ERR_RULE_ENGINE_DATABASE_TRANSACTION_PROHIBITED. | pass | Confirms rule engine classpath dependencies; does not evaluate external orchestrator transactions. |
| FIT-3: Duplicate Language | Seed a DMN decision table that defines credit terms (DebtToIncome, CollateralCoverage) inconsistently with the enterprise ubiquitous language dictionary. | Vocabulary scanner probe probe_dmn_vocabulary_drift verifying build failure on drifted DMN decision schemas with diagnostic ERR_DMN_VOCABULARY_DRIFT_DETECTED. | pass | Confirms DMN variable name contracts; does not inspect analyst policy documentation. |
Residual Risk
- Memory spike on JVM heap during concurrent compilation of large DMN decision tables during hot-reload events. Accepted by David O'Reilly with off-line CI bytecode pre-compilation.
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| Rejection of side-effecting rules | derived | FIT-1 probe result | 2026-09-15 |
| Rejection of rule database transactions | derived | FIT-2 probe result | 2026-09-15 |
| Rejection of DMN vocabulary drift | derived | FIT-3 probe result | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Open Decisions
None.
Next steps
- Platform team incorporates DMN static analysis linters into automated CI deployment verification.
- SRE team configures Prometheus alerts monitoring DMN rule evaluation latency and hot-reload success metrics.
- Conduct quarterly regulatory audit verifying decision reproducibility against past archived loan evaluation snapshots.
business-rule-engine-platform-architect.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill owns the architecture decision for expressing, evaluating, governing, and evolving a portfolio of interacting domain rules. It starts from accepted business decisions and determines the least powerful mechanism that preserves one authoritative meaning, deterministic outcomes, explainability, historical reproducibility, controlled overrides, and consistent enforcement.
Use it when
- Many rules interact through precedence, specificity, exclusion, accumulation, or conflict
- Rules change on a cadence independent of application releases and have qualified owners
- Decisions require stable reason codes, traceability, effective dates, or historical reconstruction
- Analysts/domain owners need reviewable decision tables or controlled authoring—not arbitrary production code execution
- The same decision is duplicated across UI, APIs, jobs, imports, SQL, spreadsheets, or services
- Exceptions and overrides require authorization, evidence, expiry, and audit
For example: “Our underwriting team hardcodes driver discount rules across 14 microservices and SQL stored procedures, so updating state-level multi-car discount rates requires a two-month release cycle.”
What you get
- architecture/rule-engine-architect/README.md
- architecture/rule-engine-architect/00-overview/rule-engine-architect-overview.md
- architecture/rule-engine-architect/verification/fitness-self-check.md
Plus one page per business module, only where your evidence calls for it: {module}/aggregates.md, {module}/domain-events.md, {module}/invariants.md, {module}/policies.md.
All paths are relative to the output folder you choose.
What it will not do
Do not use for ordinary validation, one invariant, authorization alone, workflow orchestration, feature flags, or choosing a rules product from keywords.
How it works
- Check rule complexity and ownership.
- Establish fact authority.
- Define decision and reason contracts.
- Specify precedence and conflict resolution.
- Select minimum sufficient mechanism.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-artifact.md
- assets/output-template-contract.md
- assets/output-template-decision.md
- assets/output-template-domain.md
- assets/output-template-fitness.md
- assets/output-template-mechanism.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 12 days ago
- Passed all security checks, Safe to install