What problem does it solve?
In monorepos or projects with mixed tech stacks, different directories often have unique coding, architecture, and testing rules. Manually creating, tracking, and enforcing these per-directory rules is time-consuming, leads to inconsistent code, and causes AI coding agents to hallucinate patterns when they lack context-specific rule information.
Core Features & Use Cases
- Per-Directory Rule Resolution: Automatically finds the nearest RULES.md for any given project path, using a deepest-wins cascade to ensure the most specific, relevant rules are applied.
- Automatic Rule Generation: If a directory is missing its RULES.md, the skill scans the directory's actual code to generate a tailored RULES.md with 5 concern sections, never copying rules across different tech stacks.
- Rule Validation: Prints the full set of merged rules an agent would see for any path, making it easy to verify that correct rules are being applied.
- Use Case: For a monorepo with separate frontend, backend, and third-party package directories, each with their own tech stacks, this skill ensures every AI coding agent working in a subdirectory follows the correct, context-specific rules, eliminating inconsistent code and pattern hallucination.
Quick Start
Use the spec-harness-rules skill to generate a tailored RULES.md file for the packages/analytics directory based on its existing code and verify the merged rules that apply to that path.