Skip to content

[Architecture Layer] Architecture Validation & Governance Service #17

@gloomcheng

Description

@gloomcheng

Problem

No enforcement of:

  • Layered architecture rules (no UI in business logic)
  • Module boundaries (no cross-domain imports)
  • Naming conventions
  • File organization patterns

Developer Pain Points

  • Architecture rules only documented, not enforced
  • Easy to violate layer boundaries
  • No automated governance
  • Manual code review catches violations late

Proposed Solution

Architecture Rules Service with:

  1. Define rules in .cortex/architecture.json
  2. Validate imports against layer rules
  3. Check file placement
  4. Enforce naming conventions

Example Rules

{
  "layers": {
    "ui": { "canImportFrom": ["core", "utils"], "cannotImport": ["database"] },
    "core": { "canImportFrom": ["utils"], "cannotImport": ["ui"] }
  },
  "naming": {
    "services": "*-service.ts",
    "handlers": "*-handler.ts"
  }
}

MCP Tools

  • arch-validate: Validate architecture rules
  • arch-check: Check file against rules
  • arch-suggest: Suggest correct placement

Priority

High - Architectural governance

Effort Estimate

2 days

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlayer:knowledgeKnowledge Layer - project-specific rulespriority:highHigh priority item

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions