Rules & ADRs
rules
Unified rule and Architecture Decision Record (ADR) management.
Absorbs: upsert_rule, delete_rule, get_rule_candidates, upsert_adr, get_adrs.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | upsert, delete, candidates, upsert_adr, list_adrs. |
rule_id | string | action=upsert/delete | Rule ID. |
description | string | action=upsert | Rule description. |
severity | string | action=upsert | error or warning. |
edge_type | string | No | Edge type to forbid. action=upsert. |
from_file_pattern | string | No | Source file glob. action=upsert. |
to_file_pattern | string | No | Target file glob. action=upsert. |
to_name_pattern | string | No | Target entity name substring. action=upsert. |
path_pattern | string | No | Comma-separated edge sequence for multi-hop checks. action=upsert. |
context_source | string | No | Provenance. Rejects external/generated. action=upsert. |
id | string | action=upsert_adr | ADR ID (kebab-case). |
title | string | action=upsert_adr | ADR title. |
decision | string | action=upsert_adr | The decision made. |
status | string | No | proposed, accepted, deprecated, superseded. action=upsert_adr. |
context | string | No | Problem context. action=upsert_adr. |
consequences | string | No | Trade-offs. action=upsert_adr. |
linked_files | array | No | File patterns for ADR. action=upsert_adr. |
file | string | No | File path to filter ADRs. action=list_adrs. |
Action: upsert
Create or update an architectural rule.
{ "tool": "rules", "arguments": { "action": "upsert", "rule_id": "no-direct-db", "description": "Handlers must not import database packages directly", "severity": "error", "from_file_pattern": "internal/mcp/*", "to_file_pattern": "internal/store/*", "edge_type": "IMPORTS" }}Action: delete
Remove a rule by ID.
{ "tool": "rules", "arguments": { "action": "delete", "rule_id": "no-direct-db" }}Action: candidates
List failure episodes not yet promoted to rules.
{ "tool": "rules", "arguments": { "action": "candidates" }}Action: upsert_adr
Create or update an Architecture Decision Record.
{ "tool": "rules", "arguments": { "action": "upsert_adr", "id": "use-sqlite", "title": "Use SQLite for local storage", "decision": "SQLite for all persistent state", "status": "accepted", "context": "Need embedded DB with zero config", "consequences": "Single-writer limitation accepted" }}Action: list_adrs
Query ADRs, optionally filtered by file.
{ "tool": "rules", "arguments": { "action": "list_adrs", "file": "internal/store/store.go" }}