analysis-pipeline
Reverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis agents.
Validates that all user-facing surfaces discovered in source code are captured in the behavioral specs. Catches coverage gaps where the analysis pipeline missed features, tools, env vars, CLI flags, or other behavioral interfaces. Run AFTER Layer 3 specs are written, BEFORE
$ npx -y skills add prime-radiant-inc/greenfield --skill source-completeness --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/source-completenessContext preview
The summary Claude sees to decide when to auto-load this skill.
Validates that all user-facing surfaces discovered in source code are captured in the behavioral specs. Catches coverage gaps where the analysis pipeline missed features, tools, env vars, CLI flags, or other behavioral interfaces. Run AFTER Layer 3 specs are written, BEFORE
name: source-completeness description: Validates that all user-facing surfaces discovered in source code are captured in the behavioral specs. Catches coverage gaps where the analysis pipeline missed features, tools, env vars, CLI flags, or other behavioral interfaces. Run AFTER Layer 3 specs are written, BEFORE sanitization.
The analysis pipeline (Layers 1-3) reads source code and produces behavioral specs. But it can miss things:
The fidelity validation (Layer 7) only checks raw→clean. This skill checks **source→raw** — it goes back to the actual source code and verifies that every discoverable user-facing surface was captured in the specs.
Run AFTER Layer 3 deep documentation is complete, ideally as part of Gate 1 or as a pre-Gate-1 completeness check. If gaps are found, dispatch deep-dive agents to cover the missing areas before proceeding.
Also run AFTER Layer 7 fidelity validation to catch anything the fidelity check couldn't find (because it was never in the raw specs).
Search patterns depend on target shape. For a single-file bundle, grep the bundle directly. For a source tree, grep recursively across the source root. Patterns also depend on the target language's idioms for registering each surface — the examples below give common patterns for several languages; adjust to the actual target.
Applies to targets that expose a registered command, tool, or handler surface (CLIs with subcommands, plugin hosts, RPC servers with method registration).
**Source extraction:** grep for the registration pattern used by the target. Examples:
# Named-object pattern (common in JS/TS/Go handler registration)
grep -roE 'name:\s*"[A-Z][a-zA-Z]+"' <source-root> | sort -u
# Decorator-based registration (Python)
grep -roE '@(command|tool|handler|register)\(' <source-root>
# Macro-based registration (Rust)
grep -roE '#\[(command|tool|handler)' <source-root>
# Assigned-constant pattern (JS/TS)
grep -roE 'var [a-zA-Z0-9_]+="[A-Z][a-zA-Z]+"' <source-root> | grep -v 'Exception\|Error\|Element'**Spec extraction:** every registered name in the tool/command catalog section of the spec.
**Diff:** every registered name in source must appear in the spec. Missing names are P0-CRITICAL gaps.
**Source extraction:** patterns by language:
# Node/TypeScript
grep -roE 'process\.env\.[A-Z_][A-Z0-9_]*' <source-root> | sed 's/.*process\.env\.//' | sort -u
# Python
grep -roE 'os\.environ(\.get)?\(?"[A-Z_][A-Z0-9_]*"' <source-root> | grep -oE '[A-Z_][A-Z0-9_]+' | sort -u
# Go
grep -roE 'os\.Getenv\("[A-Z_][A-Z0-9_]*"\)' <source-root> | grep -oE '[A-Z_][A-Z0-9_]+' | sort -u
# Rust
grep -roE 'env::var\("[A-Z_][A-Z0-9_]*"\)' <source-root> | grep -oE '[A-Z_][A-Z0-9_]+' | sort -u**Spec extraction:** all env var names from the environment contract spec.
**Diff:** categorize missing env vars:
**Source extraction:**
# Quoted flag strings — works across most CLI frameworks
grep -roE '"--[a-z][a-z0-9-]+"' <source-root> | sort -u
# Framework-specific definitions:
# Rust/clap: .arg("--flag-name")
# Python/argparse: add_argument("--flag-name")
# Go/flag: flag.StringVar(&v, "--flag-name", ...)
grep -roE '\.arg\("--[a-z-]+"|add_argument\("--[a-z-]+"|flag\.\w+Var\([^,]+,\s*"--[a-z-]+"' <source-root>**Spec extraction:** every `--flag` name in the CLI contract spec.
**Diff:** every flag must appear. Hidden flags should be documented as hidden.
Applies to CLIs or REPLs with a subcommand surface.
**Source extraction:** target-dependent. For subcommand CLIs, grep for the subcommand registration or dispatch table (clap subcommands, Cobra, argparse subparsers). For REPL-style interfaces, grep for the command-prefix pattern (e.g., `/help`, `:quit`).
**Spec extraction:** every subcommand from the CLI interface spec.
**Diff:** every registered subcommand must appear.
Applies to targets that dispatch named events — common shapes include observer patterns, signals, message buses, and webhook emission.
**Source extraction:** grep for event dispatch calls and event-type string constants. Common shapes: `emit("event-name", ...)`, `dispatch(EventType.X)`, `pubsub.publish("...", ...)`, signal/slot registrations, `raise EventName(...)`.
**Spec extraction:** every event type documented in the extensibility or eventing spec.
**Diff:** every dispatched event type must be documented.
**Source extraction:** Search for settings property accesses and config key strings.
**Spec extraction:** Extract all config keys from the configuration spec.
**Diff:** User-configurable keys must appear. Internal state keys are P2.
**Source extraction:** Search for error class definitions, error type enums, and error message constants.
**Spec extraction:** Extract all documented error categories.
**Diff:** User-visible errors must be documented.
# Source-to-Spec Completeness Report ## Summary | Check | Source Count | Spec Count | Missing | Extra | |-------|------
Reverse engineer clean behavioral specs from any codebase. Greenfield reads source code, documentation, SDKs, runtime behavior, and binaries, then produces behavioral specifications, test vectors, acceptance criteria, and a full provenance trail.
Repo: prime-radiant-inc/greenfield
Reverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis agents.
Layer 1 intelligence source discovery - auto-detect available sources, search for public information, negotiate with user, produce inventory manifest
Layer 3 deep documentation methodology. Per-module behavioral specifications, external and behavioral integration contracts, behavior documentation, end-to-end…
Layer 1 methodology for extracting behavioral intelligence from compiled binaries, bytecode archives, managed assemblies, and bundled applications. Covers…
Layer 1 skill for community intelligence gathering. Search channels, extraction methodology, consensus analysis, version-aware behavioral changes, structural…
Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.