From harness-engineering
Set up and maintain an agent-first repository with progressive disclosure, architecture enforcement, and entropy management. Use when designing repository structure for AI agent development, creating CLAUDE.md as a table of contents, enforcing layer constraints with custom linters, or managing technical debt in agent-generated codebases.
npx claudepluginhub ririnto/sinon --plugin harness-engineeringThis skill uses the workspace's default tool permissions.
Design and maintain a repository optimized for AI agent throughput and coherence, where humans steer and agents execute.
Creates new Angular apps using Angular CLI with flags for routing, SSR, SCSS, prefixes, and AI config. Follows best practices for modern TypeScript/Angular development. Use when starting Angular projects.
Executes ctx7 CLI to fetch up-to-date library documentation, manage AI coding skills (install/search/generate/remove/suggest), and configure Context7 MCP. Useful for current API refs, skill handling, or agent setup.
Share bugs, ideas, or general feedback.
Design and maintain a repository optimized for AI agent throughput and coherence, where humans steer and agents execute.
references/ only for named blockers.The steps below assume a git repository with at least one commit and a working application scaffold. If the repository is empty, see references/bootstrap.md for the zero-to-one path (seeding CLAUDE.md, scaffolding docs/, generating the application skeleton, and wiring the first structural test and linters), then return here.
Create CLAUDE.md as a table of contents, not an encyclopedia. Keep it under 150 lines. It should point to deeper sources of truth in docs/. AGENTS.md is a symlink to CLAUDE.md; both names resolve to the same file.
A monolithic CLAUDE.md fails in predictable ways: it crowds out task context, makes everything "important" so nothing is, rots instantly, and resists mechanical verification. Treat it as the map, not the territory.
# CLAUDE.md
## Architecture
See `docs/ARCHITECTURE.md` for the top-level domain map and package layering.
## Active work
See `docs/exec-plans/active/` for in-progress execution plans.
## Product
See `docs/product-specs/index.md` for feature specifications.
## Design principles
See `docs/design-docs/core-beliefs.md` for agent-first operating principles.
## Quality
See `docs/QUALITY_SCORE.md` for per-domain quality grades.
Truncated; copy assets/claude-md-template.md for the full template.
Create a docs/ directory treated as the system of record.
docs/
├── ARCHITECTURE.md
├── DESIGN.md
├── FRONTEND.md
├── PLANS.md
├── PRODUCT_SENSE.md
├── QUALITY_SCORE.md
├── RELIABILITY.md
├── SECURITY.md
├── design-docs/
│ ├── index.md
│ ├── core-beliefs.md
│ └── ...
├── exec-plans/
│ ├── active/
│ ├── completed/
│ └── tech-debt-tracker.md
├── generated/
│ └── db-schema.md
├── product-specs/
│ ├── index.md
│ └── ...
└── references/
└── ...
Key invariants:
assets/execution-plan-template.md when writing plans.Copy assets/docs-directory-scaffold.md when scaffolding the full directory tree.
Open references/repository-knowledge-structure.md for detailed indexing patterns and progressive disclosure mechanics.
Within each business domain, restrict dependency direction through a fixed set of layers:
Types → Config → Repo → Service → Runtime → UI
Cross-cutting concerns (auth, connectors, telemetry, feature flags) enter through a single explicit interface: Providers. Any other cross-domain edge is disallowed.
Enforce with custom linters and structural tests:
"""
Structural test: assert no domain violates the forward-only layer rule.
Each domain directory MUST follow the fixed layer set. Imports that skip
or reverse layer direction MUST be rejected.
"""
def test_layer_dependencies(domain_path):
layers = ["types", "config", "repo", "service", "runtime", "ui"]
violations = scan_imports(domain_path, allowed_direction="forward")
assert not violations, (
f"Layer violations in {domain_path}: {violations}. "
"Imports must flow forward through: "
+ " → ".join(layers)
)
Enforcement rules:
Open references/architecture-enforcement.md for detailed linter patterns, taste invariant examples, and structural test templates. Open references/ci-integration.md for pipeline samples that run these checks on every push and on a schedule.
Write opinionated, mechanical rules that keep the codebase legible and consistent for future agent runs.
Core principles:
When a principle is violated, encode the fix in tooling, not in review comments. See references/architecture-enforcement.md for the taste invariants table mapping each principle to its enforcement mechanism.
Schedule recurring cleanup to prevent drift:
docs/QUALITY_SCORE.md.docs/exec-plans/tech-debt-tracker.md are reviewed and resolved in small increments.Technical debt is a high-interest loan: pay it down continuously rather than letting it compound. Most cleanup PRs should be reviewable in under one minute and eligible for auto-merge.
Agents replicate patterns that already exist in the repository, including suboptimal ones. Without continuous correction, drift is inevitable.
Open references/entropy-management.md for doc-gardening cadence, quality grading rubrics, and cleanup automation patterns.
Wire the runtime so agents can observe and validate behavior directly:
With this context, prompts like "ensure service startup completes in under 800 ms" or "no span in these four critical user journeys exceeds two seconds" become tractable.
Open references/agent-legibility.md for per-worktree isolation setup, DevTools integration, observability stack configuration, and the checkpoint protocol for long-running single runs.
In high-throughput agent environments:
This would be irresponsible in a low-throughput environment. In agent-first development, it is often the correct tradeoff.
Every pull request MUST pass a declared set of agent reviewers before merge. The author agent iterates until each reviewer returns approve.
Default reviewer set:
architecture-guard verifies the layer model, provider interface, and mechanical taste invariants.code-reviewer produces the merge verdict against the full diff, golden principles, and any referenced execution plan.doc-gardener runs when the change touches docs/ or when the referenced plan updates cross-links.Loop contract:
approve, request-changes, or needs-info.approve.Keep the list of declared reviewers in a committed file (for example docs/design-docs/review-policy.md) so the loop is reproducible and auditable. Encode auto-merge eligibility as a ruleset rather than as reviewer discretion; see references/ci-integration.md for the policy shape.
CLAUDE.md, refactor it into the table-of-contents pattern before adding new documentation.Return:
CLAUDE.md table of contentsdocs/ directory structure with index filesCLAUDE.md as the encyclopedia; it is the map, not the territory.references/bootstrap.md -- open when seeding an empty repository from zero, including the starter prompt and the first structural testreferences/repository-knowledge-structure.md -- open for detailed docs/ hierarchy design, indexing patterns, *-llms.txt packaging, and progressive disclosure mechanicsreferences/architecture-enforcement.md -- open for custom linter patterns, structural test templates, and taste invariant examplesreferences/ci-integration.md -- open for CI pipeline samples, scheduled doc-gardening, and the auto-merge policy shapereferences/entropy-management.md -- open for doc-gardening cadence, quality grading rubrics, and cleanup automation patternsreferences/agent-legibility.md -- open for per-worktree isolation setup, DevTools integration, observability stack configuration, and long-running checkpoint protocolassets/claude-md-template.md -- copy when creating CLAUDE.md from scratchassets/docs-directory-scaffold.md -- copy when scaffolding the docs/ directoryassets/execution-plan-template.md -- copy when writing execution plans