agentleFS
yathamsriram243-blipyathamsriram243-blip/egm-universal-agent/skills/egm_drift_report/SKILL.md

egm-drift-report

Skill0 starsChanged 42 days agoApache-2.0View on GitHub

Detects divergence between authoritative design specifications and live codebase implementation. Produces an actionable, structured drift report with file and symbol evidence without mutating code.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When running in Codex or ChatGPT Work, first read Codex integration.

    line 12
  2. Distinctive:

    When specifications and codebase reality diverge, systems accumulate hidden debt and developer confusion.

    line 17
  3. Distinctive:

    Concrete Evidence Required: Every reported drift MUST cite the exact specification file and section alongside the concrete source code …

    line 26
  4. Distinctive:

    Avoid Trivia: Do not treat every minor internal implementation detail (e.g.

    line 30
  5. Very specific:

    Every finding MUST follow the 11-field Standard Review-Finding Contract (resources/finding_contract.md) and be classified by severity:

    line 62
  6. Very specific:

    Write the report to {YYYY-MM-DD}_DRIFT_REPORT.md (e.g., 2026-10-23_DRIFT_REPORT.md) in the working directory using your file-writing tool:

    line 71

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

EGM Drift Report: Specification-to-Code Drift Detector

When running in Codex or ChatGPT Work, first read Codex integration. In Claude Code or Cowork, read ${CLAUDE_PLUGIN_ROOT}/docs/claude.md first.

Overview

When specifications and codebase reality diverge, systems accumulate hidden debt and developer confusion. This skill systematically audits checked-in design specifications, architecture contracts, and READMEs against live source code to detect and report drift.

Execution Constraints & Safety Rules

  1. Read-Only Operations (STRICT): You are STRICTLY FORBIDDEN from modifying, patching, or refactoring code or documentation during drift detection. Report discrepancies only. Remediation is deferred to a separate, user-authorized /egm-resolve session.
  2. Concrete Evidence Required: Every reported drift MUST cite the exact specification file and section alongside the concrete source code file, class, function, or line range.
  3. Distinguish Confirmed Drift from Uncertainty: Distinguish between confirmed drift (explicit contract violation) and unconfirmed drift caused by incomplete context or dynamic dispatch.
  4. Avoid Trivia: Do not treat every minor internal implementation detail (e.g. local loop variables) as a design violation. Focus on architectural contracts, public APIs, models, data flows, and invariants.

Inputs

  • DesignPath: Path to a specific design document or directory of design docs/READMEs (e.g. docs/designs/). If omitted, prompt the user.
  • SourceRoot (Optional): Path to the codebase root (defaults to workspace root).

Execution Workflow

Step 1: Discover Authoritative Specifications

  1. Locate all design documents and contract files in DesignPath.
  2. For each document, identify authoritative statements:
    • Public APIs, endpoints, and method signatures.
    • Data structures, models, schemas, and fields.
    • Architectural component boundaries and interaction flows.
    • Invariants, error handling rules, and acceptance criteria.

Step 2: Source Code Verification

For each documented contract:

  1. Locate Source Files: Trace referenced files, classes, and symbols in the live repository using code search.
  2. Verify Fidelity:
    • Missing Features: Documented API endpoints, methods, or CLI commands absent from code.
    • Incomplete Data Models: Dataclasses, structs, or database models missing documented fields.
    • Logic Divergence: Hardcoded values or stub implementations where dynamic logic was specified.
    • Contract Conflicts: Parameter types, return types, or error conditions conflicting with the spec.
    • Undocumented Behavior: Critical public methods or side effects present in code but missing from docs.

Step 3: Classify & Structure Drift Findings

Every finding MUST follow the 11-field Standard Review-Finding Contract (resources/finding_contract.md) and be classified by severity:

  • Critical: Security breach, data corruption hazard, or completely broken public contract.
  • High: Documented core feature missing or unhandled error state.
  • Medium: Field name drift, type inconsistency, or outdated architectural diagram.
  • Low / Informational: Minor nomenclature discrepancy or formatting inconsistency.

Step 4: Generate Deliverable Drift Report

Write the report to {YYYY-MM-DD}_DRIFT_REPORT.md (e.g., 2026-10-23_DRIFT_REPORT.md) in the working directory using your file-writing tool:

# EGM Specification-to-Code Drift Report

**Audit Date:** [YYYY-MM-DD]
**Target Specifications:** `[DesignPath]`
**Codebase Root:** `[SourceRoot]`

## Executive Summary
* **Total Specifications Audited:** [N]
* **Confirmed Drifts:** [N] (Critical: [C], High: [H], Medium: [M], Low: [L])
* **Uncertain / Incomplete Evidence:** [N]

---

## Drift Findings by Affected Contract

### [[id]] [title]
* **Severity**: [critical | high | medium | low | informational]
* **Category**: correctness
* **Affected Specification**: `[spec_file.md#Lstart-Lend]`
* **Live Code Evidence**: `[src_file.py:Symbol#Lstart-Lend]`
* **Discrepancy Description**: [Factual divergence observed]
* **Reasoning**: [Why this drift causes operational, integration, or maintenance issues]
* **Impact**: [System defect, API breakage, developer confusion]
* **Recommended Correction**: [Update specification to reflect intentional change, or implement missing code]
* **Confidence**: [high | medium | low]
* **Status**: open

Notify the user in chat with the summary and report path.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.