hierarchical-context-architecture

Design and audit layered repository context with CONTEXT.md nodes and validation rules.

1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/oozoofrog/codex-skills --skill hierarchical-context-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hierarchical-context-architecture
Source: https://github.com/oozoofrog/codex-skills/tree/main/hierarchical-context-architecture
Command: npx skills add https://github.com/oozoofrog/codex-skills --skill hierarchical-context-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill helps teams design, bootstrap, and audit layered repository context to reduce context rot and improve alignment across CLAUDE.md, CONTEXT.md, and AGENTS.md.

Core Features & Use Cases

  • Defines a three-tier context model (global CLAUDE.md, local CONTEXT.md, and portable AGENTS.md) to decompose large prompts.
  • Provides validation scripts and templates to ensure link integrity, structure, and override semantics.
  • Supports automated auditing with a configurable .context-audit.yml to enforce policy and guardrails.

Quick Start

Create or update the root CLAUDE.md and its CONTEXT.md/AGENTS.md, then run the audit to verify the context tree.

Frequently Asked Questions about hierarchical-context-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure CLAUDE.md and CONTEXT.md files for a large codebase?

A layered context architecture uses a global CLAUDE.md, local CONTEXT.md files in subdirectories, and portable AGENTS.md to decompose prompts. This three-tier model establishes explicit links and override semantics to minimize context rot across large repositories.

When do I need layered repository context for my project?

You need layered repository context when managing large codebases where single prompt files cause context rot. Implementing local CONTEXT.md nodes with explicit links and validation rules ensures local overrides and policy enforcement remain aligned as the project scales.

How do I audit context links and overrides across repository directories?

Audit context links and overrides by running the automated validation script configured through .context-audit.yml. This script verifies link integrity, validates structural rules, and enforces override semantics to guard against context rot across the repository tree.

What is the difference between CLAUDE.md, CONTEXT.md, and AGENTS.md?

CLAUDE.md serves as the global root context, CONTEXT.md defines local directory-specific nodes, and AGENTS.md provides portable context. This three-tier architecture separates global rules, local overrides, and shareable instructions to minimize context rot.

Can I enforce context structure rules automatically in a large repository?

Yes, you can enforce context structure rules automatically using a configurable .context-audit.yml file. This configuration drives an automated audit script to verify link integrity, validate structure, and apply guardrails across the repository.