Pre generation arch check

From baekenough/oh-my-customcode · View interactive version

Pre generation arch check is an AI agent skill from the GitHub repository baekenough/oh-my-customcode. Pre-generation architecture check — detect R006 separation-of-concerns and compilation metaphor violations before code generation begins

How to use this skill

Skill file

Pre-Generation Architecture Check

AASM-inspired pre-generation architecture guard. Detects design violations before code generation (the "pre-compile lint" phase), complementing adversarial-review and deep-verify which operate post-generation.

Overview

This skill fills the PRE-generation gap in the verification pipeline:

| Phase | Skill | When |

|-------|-------|------|

| Pre-generation | pre-generation-arch-check | Before code is written |

| Post-generation | adversarial-review | After code is written |

| Post-generation | deep-verify | After changes are committed |

Inspired by Contexty's AASM (AI Anti-pattern Severity Matrix) mechanism. Detects when a requested change might violate:

Input

Processing — Anti-Pattern Detection

Check for each of the following anti-patterns against the request summary and target paths:

1. Skill-in-Agent (WARN)

An agent file (.claude/agents/*.md) body contains detailed step-by-step instructions, scripts, or workflow logic that belongs in a skill file.

2. Agent-in-Skill (WARN)

A skill file contains agent configuration fields (model:, tools:, memory:, permissionMode:).

3. Guide-in-Skill (WARN)

A skill file contains reference documentation, best-practices tutorials, or conceptual explanations that belong in guides/.

4. Cross-Concern Write Without mgr-creator (BLOCK)

A single atomic change spans two or more of: .claude/agents/, .claude/skills/, guides/ — without routing through mgr-creator.

5. Direct Orchestrator Write (BLOCK)

An implementation step would have the orchestrator (main conversation) directly write or edit files, bypassing subagent delegation.

6. Spec-Build Confusion (WARN)

Rules (.claude/rules/) are being modified in the same atomic change as source code or agent/skill files.

Output Format

When no violations are detected:

[ARCH-CHECK] No violations detected — proceed with generation

When violations are detected:

[ARCH-WARNING] {count} potential violation(s) detected:
├── {pattern-name} ({severity}): {description}
│   └── Suggestion: {fix}
├── {pattern-name} ({severity}): {description}
│   └── Suggestion: {fix}

Severity Levels

| Severity | Action |

|----------|--------|

| WARN | Advisory — proceed with caution, note in generation plan |

| BLOCK | Halt — requires architectural redesign before proceeding |

BLOCK violations must be resolved before generation continues. WARN violations are logged and surfaced to the user but do not halt execution (consistent with R021 advisory-first enforcement model).

Integration

Auto-invoked at structured-dev-cycle Phase 1 (planning phase) before any file generation begins.

This skill is advisory only — it does NOT hard-block execution. This is consistent with R021's advisory-first enforcement model. Future promotion to a PreToolUse hook is possible if violation rates warrant escalation.

Invocation pattern:

[structured-dev-cycle Phase 1]
  → pre-generation-arch-check
    → returns [ARCH-CHECK] or [ARCH-WARNING]
  → continue to Phase 2 (generation) with findings surfaced

Cross-References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.