From harness-claude
Validates AGENTS.md quality and evolves it as codebase changes, ensuring AI agents have accurate project context. Use after file additions, renames, API changes, or periodically.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Validate AGENTS.md quality and evolve it as the codebase changes. Good context engineering means AI agents always have accurate, current knowledge about the project.
Scaffolds AGENTS.md, ARCHITECTURE.md, and docs/ structure to make codebases legible to AI agents. Analyzes structure with bash recon, generates progressive disclosure docs, audits existing artifacts for coherence.
Creates, refreshes, or validates repo AGENTS.md files using evidence from files, git history, CI to keep them concise and current. Use when missing, stale, or after refactors/tooling changes.
Generates and maintains AGENTS.md files for AI agent onboarding to projects. Detects stacks/scopes, extracts commands/CI rules/architecture, validates structure, verifies freshness/content/commands.
Share bugs, ideas, or general feedback.
Validate AGENTS.md quality and evolve it as the codebase changes. Good context engineering means AI agents always have accurate, current knowledge about the project.
on_context_check or on_pre_commit triggers fireRun harness validate to check overall project health. Review any context-related warnings or errors in the output.
Run harness check-docs to detect documentation gaps, broken links, and stale references. Capture the full output for analysis.
Review AGENTS.md manually. Automated tools catch structural issues but miss semantic drift. Read each section and ask: "Is this still true?"
When a knowledge graph exists at .harness/graph/, use graph queries for faster, more accurate auditing:
query_graph — find all undocumented code nodes (file nodes without documents edges), replacing manual cross-referencingsearch_similar — detect stale references in AGENTS.md by matching section text against current code entitiesWhen a graph is available, it IS the source of truth for documentation coverage. Drift = stale or missing edges between code and doc nodes. Fall back to file-based commands if no graph is available.
When invoked by harness-docs-pipeline, check for a pipeline field in .harness/handoff.json:
pipeline field exists: read DocPipelineContext from it
pipeline.exclusions to skip findings that were already addressed in the FIX phaseGapFinding[] results back to pipeline.gapFindings in handoff.jsonpipeline field does not exist: behave exactly as today (standalone mode)No changes to the skill's interface or output format — the pipeline field is purely additive.
Categorize findings into four types:
Undocumented files. New source files, modules, or packages that are not mentioned in AGENTS.md or any knowledge map section. These are the highest priority — an AI agent encountering these files has no context.
Broken links. References to files, functions, or URLs that no longer exist. These actively mislead agents.
Stale sections. Content that was accurate when written but no longer reflects reality. Examples: renamed functions still referenced by old name, removed features still described, changed conventions not updated.
Missing context. Sections that exist but lack critical information. A module is listed but its purpose, constraints, or relationships are not explained. An AI agent can find the file but does not understand why it exists or how to use it correctly.
For each gap, generate a specific suggestion:
Present all suggestions as a grouped list. Organize by section of AGENTS.md for easy review.
Apply approved changes. Update AGENTS.md with the approved suggestions. Preserve existing formatting and style.
Re-run harness check-docs to verify all fixes are clean. No new issues should be introduced.
Commit the update. Use a descriptive commit message that summarizes what was updated and why.
Good context engineering treats AGENTS.md as a dynamic knowledge base, not a static document.
harness validate — Full project health check. Reports context gaps as part of overall validation.harness check-docs — Focused documentation audit. Detects broken links, missing references, stale sections, and undocumented files.harness fix-drift — Auto-fix simple drift issues (broken links, renamed references). Use after manual review confirms the fixes are correct.harness check-docs passes with zero errors and zero warnings| Rationalization | Why It Is Wrong |
|---|---|
| "The automated checks passed, so AGENTS.md is accurate" | Phase 1 says automated tools catch structural issues but miss semantic drift. Manual review of each section is required. |
| "This module is small and internal -- it does not need an AGENTS.md entry" | Undocumented files are the highest priority finding. Even small internal modules need at least a purpose statement. |
| "AGENTS.md is severely outdated -- let me rewrite it from scratch" | Do not attempt to fix everything at once when there are >20 issues. Prioritize: broken links first, then undocumented public APIs. |
| "I will add the file paths and leave the descriptions for later" | Purpose-first descriptions, relationship mapping, and gotchas are what make context engineering useful. A file listing without context is marginally better than nothing. |
Audit output from harness check-docs:
WARNING: Undocumented file detected: src/services/notification-service.ts
- File contains 3 public exports: NotificationService, NotificationType, sendNotification
- File is imported by 4 other modules
- No AGENTS.md section references this file
Suggested update:
### Notification Service (`src/services/notification-service.ts`)
Handles all outbound notifications (email, Slack, webhook). All notification delivery
must go through `NotificationService` — direct use of transport libraries (nodemailer,
Slack SDK) outside this module is forbidden.
- `NotificationType` — enum of supported notification channels
- `sendNotification()` — primary entry point; routes to the correct transport
- Requires `NOTIFICATION_CONFIG` environment variables to be set
- Respects rate limits defined in `harness.config.json` under `notifications`
Apply: Add the section under the Services heading in AGENTS.md. Re-run harness check-docs to confirm the warning is resolved.
Audit output:
ERROR: Broken reference in AGENTS.md line 47: `calculateShipping()`
- Function was renamed to `computeShippingCost()` in commit abc123
- Located in src/services/shipping.ts
Fix: Replace calculateShipping() with computeShippingCost() in AGENTS.md. Verify no other references to the old name exist.