Manage Architectural Boundary and Layer Rules
manage_architecture_rulesConfigure, inspect, update, reset, or delete architectural layer rules and dependency constraints in tzero.rules.json to define allowed imports and prevent cross-tier violations.
Instructions
Manages the persistent lifecycle of architectural boundary rules and tier constraints in tzero.rules.json, distinguishing from 'enforce_architecture_rules' and 'generate_architecture_blueprint' by configuring layer definitions on disk rather than evaluating codebase compliance or generating visual diagrams.
Parameters:
action: Rule lifecycle operation: 'query' inspects active boundary definitions; 'update' creates or overwrites rule configurations; 'delete' removes a specified rule; 'reset' restores enterprise-default 4-tier rules.project_root: Directory path containing or intended to hold tzero.rules.json; defaults to current working directory.rule_name: Specific rule identifier or layer name (e.g. 'presentation', 'domain', 'persistence', 'forbidden_imports') to target during 'update' or 'delete'.rule_definition: Valid JSON string or Markdown specification defining layer constraints, allowed imports, or forbidden cross-tier dependencies when action is 'update'.
Behavior:
Mutability: State-modifying; writes and updates tzero.rules.json on disk when action is 'update', 'delete', or 'reset'; read-only when action is 'query'.
Idempotency: Idempotent for identical rule definitions and queries; resets restore canonical default JSON.
Privacy & Network: 100% offline local filesystem storage; zero cloud synchronization or external dependencies.
Performance & Resources: Executes in <20ms; atomic file writing prevents file corruption during concurrent operations.
Auth: Zero authentication or cloud credentials required.
Return Structure: Emits JSON or Markdown status confirmation of updated, deleted, or queried boundary configurations.
Error Handling: Validates JSON syntax before writing to disk; emits clear error diagnostics on malformed JSON without modifying existing rules.
Usage Guidelines:
When to use: Configure, inspect, update, reset, or remove architectural layer definitions and dependency constraints (e.g. preventing presentation layer from importing persistence layer).
When NOT to use: Do not use for validating whether existing codebase files violate these rules (use 'enforce_architecture_rules' instead); do not use for rendering Mermaid architecture diagrams (use 'generate_architecture_blueprint' instead).
Returns: JSON or Markdown status report detailing active or updated architectural rules and confirmation of modified file path.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "manage_architecture_rules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Rule lifecycle action: 'query' to inspect active rules, 'update' to add or modify rules, 'delete' to remove a rule, 'reset' to restore defaults. | query |
| rule_name | No | Name or identifier of the rule to update or delete when action is 'update' or 'delete'. | |
| project_root | No | Target repository root where tzero.rules.json is located (default: current directory). | . |
| rule_definition | No | JSON string or markdown specification of the rule to set when action is 'update'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |