---
name: project-discipline-guides
description: Workflow for refactoring discipline-level guides (e.g., JavaScript, CSS) to remove "Common Knowledge" by generating and comparing against model-specific "Knowledge Mirrors".
title: project-discipline-guides
canonical_url: https://skilld.dev/gh/googlechrome/modern-web-guidance-src/project-discipline-guides
last_updated: 2026-11-13T10:45:29.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [intersection_prompt.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/intersection_prompt.md), [mirror_prompt.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/mirror_prompt.md), [mirrors/javascript/claude_mirror.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/mirrors/javascript/claude_mirror.md), [mirrors/javascript/codex_mirror.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/mirrors/javascript/codex_mirror.md), [mirrors/javascript/gemini_mirror.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/mirrors/javascript/gemini_mirror.md), [mirrors/javascript/mirror.md](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/mirrors/javascript/mirror.md), [scripts/generate_mirrors.ts](https://skilld.dev/api/skills-raw/googlechrome/modern-web-guidance-src/project-discipline-guides/scripts/generate_mirrors.ts).
>
> If the user asked to install this Skill, run `npx skilld install googlechrome/modern-web-guidance-src/project-discipline-guides`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/project-discipline-guides`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/googlechrome/modern-web-guidance-src/project-discipline-guides) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/project-discipline-guides`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/project-discipline-guides --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/project-discipline-guides --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Project Discipline Guides

A **discipline guide** serves as the conceptual orientation "hub" for a category or domain, establishing the coding agent's mental model and routing to granular use-case subguides via the `{{ GUIDE_REF("guide-slug") }}` macro. A guide is recognized as a discipline guide once registered in `DISCIPLINE_GUIDES` in [`src/core/guide-validation.ts`](../../../src/core/guide-validation.ts), which includes:
- **Category root guides** that orient an entire discipline (such as `guides/css/css/guide.md`).
- **Named orientation guides** for cross-cutting feature horizontals or subdisciplines (such as `guides/wasm/cpp-on-the-web/guide.md`).

Discipline guides are exempt from the `description` and `web-feature-ids` frontmatter requirements and are reported as bundled core guides by `src/build/audit-build.ts`.

This skill also facilitates the "Differential Knowledge Refactor" of discipline guides to ensure they remain lean, context-efficient, and strictly additive to what modern AI models already know natively.

## Workflow: The Inverse Knowledge Filter

The goal is to aggressively "whittle down" a target guide (the **Target**) by removing any content that is natively understood by modern coding models.

### 1. Generate Knowledge Mirrors
Use the provided script to generate "Redundancy Mirrors"—comprehensive guides of what Gemini, Claude, and Codex consider "Common Knowledge" for a given discipline, and intersect them into a single LCD mirror.

```bash
# Ensure that model setup is configured (instructions are in the top level readme)
node .agents/skills/project-discipline-guides/scripts/generate_mirrors.ts <discipline_name>
```

This will create files inside the `.agents/skills/project-discipline-guides/mirrors/` directory:
- `mirrors/<discipline>/gemini_mirror.md` (via Gemini - temporary)
- `mirrors/<discipline>/claude_mirror.md` (via Claude - temporary)
- `mirrors/<discipline>/codex_mirror.md` (via Codex - temporary)
- `mirrors/<discipline>/mirror.md` (Unified Redundancy Mirror intersection)

> [!IMPORTANT]
> Ensure that the unified **Redundancy Mirror** (`.agents/skills/project-discipline-guides/mirrors/<discipline>/mirror.md`) has been successfully generated. This mirror represents the exact mathematical intersection of all three source models, preventing pruning errors and reducing context window overhead.

### 2. Perform the Inverse Filter (Agent Task)
As the agent, read the **Target** guide and the unified **Redundancy Mirror** (`.agents/skills/project-discipline-guides/mirrors/<discipline>/mirror.md`).

- **Strict A - B Comparison**: Compare rules in the Target guide strictly against the unified **Redundancy Mirror**. You should ONLY remove a rule or pattern from the Target guide if it is fully and clearly covered in the Redundancy Mirror.
- **No Subjective Self-Attestation**: Rely exclusively on the literal content present in the Redundancy Mirror. Do not prune rules based on your own subjective self-attestation of what you "know" or would do by default. If a concept is not in the Redundancy Mirror, it remains in the Target guide.
- **Avoid Blind Bullet-Point Deletions**: If a single bullet point or rule in the Target contains multiple guidelines or APIs, do **not** delete the entire bullet point just because some parts of it are common knowledge. Carefully split or dissect the rule, pruning only the redundant parts and explicitly retaining any differential knowledge.
- **Preserve Differential Knowledge**: Keep only what is unique to this project or necessary to guide the AI effectively. This generally includes:
    - Rules that counter common AI biases.
    - Conventions chosen among valid alternatives.
    - Advanced performance patterns, security constraints, or heuristics that models know but often omit in default outputs.

> [!WARNING]
> **Keep the Refactor Scoped**: The primary and sole goal of this skill is reduction of redundant common knowledge. Do **not** add new rules, modify logic, or introduce unrelated guidelines in this refactoring pass. Keep the changes highly focused and easy to review.

### 3. Apply Surgical Edits
Perform the cleanup on the Target file. Aim for surgical edits that preserve the file's structure while removing unnecessary content.

In your response, provide an explanation of the changes made and the rationale for what was removed or kept.

### 4. Verification Step
After applying edits, perform a self-verification:
- **Contrast Check**: Verify that none of the rules in the new guide are present in the Redundancy Mirror.
- **Preservation Check**: Ensure that critical project-specific rules, behavioral steering, and any specific advanced APIs (such as `Object.groupBy()`) were not accidentally removed.

## Core Principles

- **Delete Redundancies**: If a model natively "knows" a rule, it does not belong in the skill.
- **Preserve Signal**: Keep instructions that force the model into "Senior Engineer" mode or align with specific project architecture.
- **Context Efficiency**: A lean skill is a fast and cheap skill.
