skills/project-structure-validator/SKILL.md
Validate and fix project structure against architecture rules
npx skillsauth add alchemishty/agent-harness project-structure-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the project structure validator. Your job is to compare the actual file and directory structure of this project against the documented architecture and report any violations.
Run one of these commands to see the current state of the project:
tree -I 'node_modules|.git|build|dist|.dart_tool|__pycache__|.venv|target|vendor' -L 3
If tree is not available, fall back to:
find . -type f -not -path '*/.git/*' -not -path '*/node_modules/*' -not -path '*/build/*' -not -path '*/dist/*' -not -path '*/__pycache__/*' -not -path '*/.venv/*' -not -path '*/target/*' -not -path '*/vendor/*' | head -200
Read harness.yaml for:
stack.language and stack.framework -- determines expected file patternsplatforms -- determines expected entry points and target directoriesenforcement.import_direction.layers -- determines expected layer directoriesenforcement.custom_rules -- determines enforcement directory locationdocs -- determines expected documentation structureRead docs/architecture.md (or the path specified in harness.yaml → docs.architecture) for:
Check each of the following:
Directory presence:
["models", "repositories", "services", "api"], do all four directories exist?)docs/, docs/plans/active/, docs/plans/completed/, docs/decisions/)enforcement/ directory present with run-all.sh?File placement:
api/ layer directory)Barrel/index files:
models.dart re-exporting all models, TypeScript index.ts), do they exist?Test directory mirroring:
Entry points:
harness.yaml → platforms exist?Configuration files:
harness.yaml exist?.claude/settings.json exist with hook configuration?AGENTS.md exist?For each violation found, report:
VIOLATION: [category]
[what's wrong]
EXPECTED: [what should be there]
ACTUAL: [what is there instead, or "missing"]
FIX: [what to do about it]
Categories:
missing-directory -- expected directory does not existmissing-file -- expected file (barrel, entry point, config) does not existmisplaced-file -- file is in the wrong directory for its layermissing-tests -- source directory has no corresponding test directorystale-docs -- documented structure does not match actual structuremissing-barrel -- barrel/index file missing or incompleteIf the user asks you to fix violations:
docs/architecture.md to reflect reality rather than forcing the code to match outdated docs.After any fixes, run the project's analyze command to verify nothing broke:
# Read the actual command from harness.yaml → commands.analyze
harness.yaml and docs/. Never hardcode paths, layer names, or conventions. Every project is different.*.g.dart, *.gen.ts, node_modules/, build/).harness.yaml or docs/architecture.md is missing, report that as the primary finding and stop. There is no baseline to validate against without these files.documentation
Post-implementation retrospective that captures learnings to memory and proposes doc improvements
tools
Migrate project scaffolding to match the latest harness version. Adds new directories (memory/, scratch/), new harness.yaml fields, and suggests AGENTS.md updates. For plugin users this handles what a plugin update cannot — project-level structure changes. For git-clone users this also updates copied skill files.
data-ai
Install the agent harness into a target project. Detects project type (greenfield vs existing), copies skills, and delegates to the appropriate bootstrap command.
tools
Autonomous feature implementation orchestrator