本文へ移動
cccskills
無料GitHub で公開

pre-generation-arch-check

Pre-generation architecture check — detect R006 separation-of-concerns and compilation metaphor violations before code generation begins

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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:

PhaseSkillWhen
Pre-generationpre-generation-arch-checkBefore code is written
Post-generationadversarial-reviewAfter code is written
Post-generationdeep-verifyAfter changes are committed

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

  • R006 separation of concerns (agents vs skills vs guides)
  • Compilation metaphor boundaries (source/build/spec/linker/stdlib)
  • R010 orchestrator delegation rules
  • Protected path rules (.claude/agents/, .claude/skills/, guides/)

Input

  • Request summary: What the user or pipeline is asking to generate
  • Target files/paths: Where changes will be made

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.

  • Signal: Agent body exceeds ~50 lines OR contains code blocks / numbered step sequences
  • Suggestion: Extract instructions into .claude/skills/{name}/SKILL.md, reference from agent skills: frontmatter

2. Agent-in-Skill (WARN)

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

  • Signal: Proposed skill SKILL.md frontmatter contains agent-only fields
  • Suggestion: Move agent configuration to .claude/agents/{name}.md; keep skill focused on instructions

3. Guide-in-Skill (WARN)

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

  • Signal: Proposed SKILL.md body contains "## Background", "## Concepts", or sections > 100 lines of prose
  • Suggestion: Move reference content to guides/{topic}/, link from skill

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.

  • Signal: Target paths include files in 2+ protected directories in the same request
  • Suggestion: Route the request through mgr-creator (R010 protected path rule)

5. Direct Orchestrator Write (BLOCK)

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

  • Signal: Request implies "I will write X" from orchestrator context rather than "delegate to specialist"
  • Suggestion: Delegate file writes to appropriate specialist agent per R010 delegation table

6. Spec-Build Confusion (WARN)

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

  • Signal: Target paths include both .claude/rules/*.md and any code or .claude/agents/ or .claude/skills/ files
  • Suggestion: Separate rule updates (spec changes) from agent/skill/code changes (build changes) into distinct commits

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

SeverityAction
WARNAdvisory — proceed with caution, note in generation plan
BLOCKHalt — 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

  • .claude/rules/MUST-agent-design.md (R006) — separation of concerns
  • .claude/rules/MUST-orchestrator-coordination.md (R010) — protected paths and delegation
  • .claude/skills/adversarial-review/ — post-generation security counterpart
  • .claude/skills/deep-verify/ — post-generation quality counterpart
  • Source concept: Contexty AASM (https://github.com/ttalkkak-lab/opencode-contexty)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Pre-action boundary checking — validates agent tool calls against declared capabilities and task contracts

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

Auto-detect project context and optimize harness — deactivate unused agents/skills, suggest missing experts, generate project profile

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

Adversarial code review using attacker mindset — trust boundary, attack surface, business logic, and defense evaluation

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

Apache Airflow best practices for DAG authoring, testing, and production deployment

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

Alembic migration patterns for naming conventions, safety checks, expand-contract, env.py configuration, and CI integration

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

Pre-routing ambiguity analysis — scores request clarity and asks clarifying questions when needed (inspired by ouroboros)

日本語の概要は準備中です。原文の説明を表示しています。

baekenough/second-brain152026年10月8日 更新

baekenough のスキルをすべて見る

このスキルの問題を報告する