Repo Contracts And Boundaries
Overview
Convert architectural and structural-quality intent into checks that prevent new drift instead of relying on repeated prose warnings.
This skill owns both repository contracts and quality gardening because both use the same mechanism: collectible rules, diff gates, audit reports, baselines, and gradual debt reduction. For shared harness terms, see ../../references/harness-patterns.md; when contract files are absent, use references/build-when-missing.md; for schema, fixture, and golden-payload contracts, see references/schema-fixture-contracts.md; for metrics and generated snapshots, see references/quality-policy.md.
When To Use
- The user asks to define, protect, audit, or encode architecture boundaries, directory ownership, choke points, allowlists, baselines, or contracts.
- The repository has layering rules, but agents still add bypass calls or wrong dependencies.
- The user asks for structural metrics, quality reports, debt thresholds, regression budgets, or a gradual cleanup loop.
- You need to distinguish diff checks from full audit checks.
Inputs Needed
- Architecture docs or expected layering.
- Current directory structure and known historical debt.
- Rules to protect: dependency direction, file size, public entrypoints, data access, interface boundaries, or similar constraints.
- Existing quality reports, generated snapshots, and CI or scheduled-run policy.
Execution Order
- First: Read architecture docs, current code, existing checks, reports, and baselines to identify real boundaries and debt.
- Then: Design mechanical rules, collectible metrics, diff checks, audit reports, baselines, and allowlists.
- Finally: Output executable contracts, generated evidence, and a gradual convergence strategy.
Step-by-Step Process
- Search for
ARCHITECTURE.md, contract docs, lint scripts, baseline files, and allowlists.
- List protected rules; each rule must be checkable by script or review.
- If architecture or contract surfaces are missing, bootstrap the minimum files and checker shape from
references/build-when-missing.md.
- Separate new drift from historical debt: new drift should fail, historical debt should enter a baseline.
- Add only metrics tied to a concrete structural risk; keep them automatically collectible and avoid aggregate quality scores.
- Design
--mode diff for changed files and --mode audit for full-repository reports.
- For each violation, output path, rule or metric, current value, threshold, reason, and suggested direction.
- Define when baselines or allowlists may change, who owns generated snapshots, and what repayment note is required.
Checks
- Mechanical: each rule can be checked by AST, regex, import graph, path scan, or report script.
- Baseline: historical debt is explicit and not hidden by a fake green state.
- Diff: new changes can be blocked cheaply.
- Exception: allowlist entries have owner, reason, and convergence plan.
- Metrics: every quality metric is repeatable and represents a real structural risk.
- Snapshots: generated reports name their source command and cannot silently become stale.
- Incentives: no aggregate score hides a critical finding.
- Overbuild: do not use a complex platform when a clear script is enough.
Output Format
# Repo Contracts And Boundaries
## Detected Mapping
- architecture:
- contracts:
- quality:
- validation:
## Protected Boundaries
-
## Diff Checks
-
## Audit Checks
-
## Baseline / Allowlist Policy
-
## Generated Reports / Snapshots
-
## Garden Loop
-
## Failure Message Shape
-
## Rollout Plan
-
Common Mistakes
- Skipping baselines, which makes checks permanently red because of historical debt.
- Running audit only, which still lets agents introduce new drift.
- Treating architecture advice as a rule when it cannot be mechanically checked.
- Tracking metrics that cannot be collected repeatably.
- Publishing a polished total score that hides critical risk.
- Writing failure messages that do not tell an agent how to fix the violation.
Example Prompts
- "Turn this project's architecture boundaries into checks."
- "Design a diff/audit contract checker for this repo."
- "How should we freeze new dependencies on these historical choke points?"
- "Track structural debt without inventing a fake quality score."
Source: hashgraph-online/awesome-codex-plugins → plugins/yfge/agent-harness-skills/skills/repo-contracts-and-boundaries/SKILL.md
1---2name: repo-contracts-and-boundaries3description: Use when turning architecture, layering, ownership, dependency direction, schemas, structural metrics, quality thresholds, baselines, allowlists, or generated quality snapshots into repository checks.4---5
6
7# Repo Contracts And Boundaries
8
9## Overview
10
11Convert architectural and structural-quality intent into checks that prevent new drift instead of relying on repeated prose warnings.
12
13This skill owns both repository contracts and quality gardening because both use the same mechanism: collectible rules, diff gates, audit reports, baselines, and gradual debt reduction. For shared harness terms, see `../../references/harness-patterns.md`; when contract files are absent, use `references/build-when-missing.md`; for schema, fixture, and golden-payload contracts, see `references/schema-fixture-contracts.md`; for metrics and generated snapshots, see `references/quality-policy.md`.
14
15## When To Use
16
17- The user asks to define, protect, audit, or encode architecture boundaries, directory ownership, choke points, allowlists, baselines, or contracts.
18- The repository has layering rules, but agents still add bypass calls or wrong dependencies.
19- The user asks for structural metrics, quality reports, debt thresholds, regression budgets, or a gradual cleanup loop.
20- You need to distinguish diff checks from full audit checks.
21
22## Inputs Needed
23
24- Architecture docs or expected layering.
25- Current directory structure and known historical debt.
26- Rules to protect: dependency direction, file size, public entrypoints, data access, interface boundaries, or similar constraints.
27- Existing quality reports, generated snapshots, and CI or scheduled-run policy.
28
29## Execution Order
30
31- First: Read architecture docs, current code, existing checks, reports, and baselines to identify real boundaries and debt.
32- Then: Design mechanical rules, collectible metrics, diff checks, audit reports, baselines, and allowlists.
33- Finally: Output executable contracts, generated evidence, and a gradual convergence strategy.
34
35## Step-by-Step Process
36
371. Search for `ARCHITECTURE.md`, contract docs, lint scripts, baseline files, and allowlists.
382. List protected rules; each rule must be checkable by script or review.
393. If architecture or contract surfaces are missing, bootstrap the minimum files and checker shape from `references/build-when-missing.md`.
404. Separate new drift from historical debt: new drift should fail, historical debt should enter a baseline.
415. Add only metrics tied to a concrete structural risk; keep them automatically collectible and avoid aggregate quality scores.
426. Design `--mode diff` for changed files and `--mode audit` for full-repository reports.
437. For each violation, output path, rule or metric, current value, threshold, reason, and suggested direction.
448. Define when baselines or allowlists may change, who owns generated snapshots, and what repayment note is required.
45
46## Checks
47
48- Mechanical: each rule can be checked by AST, regex, import graph, path scan, or report script.
49- Baseline: historical debt is explicit and not hidden by a fake green state.
50- Diff: new changes can be blocked cheaply.
51- Exception: allowlist entries have owner, reason, and convergence plan.
52- Metrics: every quality metric is repeatable and represents a real structural risk.
53- Snapshots: generated reports name their source command and cannot silently become stale.
54- Incentives: no aggregate score hides a critical finding.
55- Overbuild: do not use a complex platform when a clear script is enough.
56
57## Output Format
58
59```markdown
60# Repo Contracts And Boundaries
61
62## Detected Mapping
63- architecture:
64- contracts:
65- quality:
66- validation:
67
68## Protected Boundaries
69-
70
71## Diff Checks
72-
73
74## Audit Checks
75-
76
77## Baseline / Allowlist Policy
78-
79
80## Generated Reports / Snapshots
81-
82
83## Garden Loop
84-
85
86## Failure Message Shape
87-
88
89## Rollout Plan
90-
91```
92
93## Common Mistakes
94
95- Skipping baselines, which makes checks permanently red because of historical debt.
96- Running audit only, which still lets agents introduce new drift.
97- Treating architecture advice as a rule when it cannot be mechanically checked.
98- Tracking metrics that cannot be collected repeatably.
99- Publishing a polished total score that hides critical risk.
100- Writing failure messages that do not tell an agent how to fix the violation.
101
102## Example Prompts
103
104- "Turn this project's architecture boundaries into checks."
105- "Design a diff/audit contract checker for this repo."
106- "How should we freeze new dependencies on these historical choke points?"
107- "Track structural debt without inventing a fake quality score."
108
109---
110
111**Source:** [`hashgraph-online/awesome-codex-plugins`](https://github.com/hashgraph-online/awesome-codex-plugins) → `plugins/yfge/agent-harness-skills/skills/repo-contracts-and-boundaries/SKILL.md`