spec-harness-rules

Generate, resolve, and validate per-directory RULES.md files for monorepo codebases.

28|2|Updated Oct 3, 2025
One-click install
npx skills add https://github.com/chohra-med/expo_boilerplate --skill spec-harness-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-harness-rules
Source: https://github.com/chohra-med/expo_boilerplate/tree/main/.claude/skills/spec-harness-rules
Command: npx skills add https://github.com/chohra-med/expo_boilerplate --skill spec-harness-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about spec-harness-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce per-directory coding standards for AI coding agents in a monorepo?

Per-directory coding standards for AI coding agents in a monorepo are enforced by automatically resolving the nearest RULES.md file using a deepest-wins cascade, ensuring agents apply the most specific context-aware rules for any given path.

How do I automatically generate rules for subdirectories with different tech stacks?

Rules for subdirectories with different tech stacks are generated by scanning the existing code in a directory to create a tailored RULES.md file with 5 concern sections, ensuring rules are never incorrectly copied across different technology stacks.

What is the best way to verify which merged rules apply to a specific project path?

To verify merged rules for a specific project path, you can print the full set of resolved rules that an AI coding agent would see, making it easy to validate that the correct context-specific standards are being applied.

Does spec-driven development work with an append-only rule system for mixed-stack codebases?

Spec-driven development integrates with an append-only, ratcheting rule system to manage mixed-stack codebases, preventing pattern hallucination by ensuring AI agents adhere to verifiable, context-specific rule compliance for all project paths.

Why does an AI coding agent hallucinate patterns when working across multiple monorepo subdirectories?

AI coding agents hallucinate patterns in monorepo subdirectories when they lack context-specific rule information, which is resolved by automatically generating and resolving per-directory RULES.md files to provide unique architecture and testing standards.

Can I use per-directory rule resolution for a project with separate frontend and backend directories?

Per-directory rule resolution supports projects with separate frontend, backend, and third-party package directories by ensuring every AI coding agent working in a subdirectory follows the correct, context-specific rules for its unique tech stack.