Agent skill

Incremental Analysis

by prime-radiant-inc in prime-radiant-inc/greenfield

Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed.

Apache-2.0Auto-check passedDevelopment

Install Incremental Analysis

skills CLI
$ npx skills add prime-radiant-inc/greenfield --skill incremental-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install prime-radiant-inc/greenfield incremental-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/prime-radiant-inc/greenfield.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/incremental-analysis .claude/skills/incremental-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
incremental-analysis
GitHub stars
292
Token cost
~2.2k tokens
SKILL.md length
809 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed.

  • Works in 6 steps: Fresh Discovery → Diff Against Existing Specs → Classify Specs → …
  • Development work in your project
  • SKILL.md covers When to Use, High Water Mark Metadata, Incremental Detection and Incremental Flow, plus 2 more sections
  • Calls git

What it does

Incremental Analysis is an agent skill from prime-radiant-inc/greenfield. Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed. Activates automatically when /analyze finds an existing workspace.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Git. The repository describes itself as: A Claude Code plugin that reverse-engineers clean behavioral specs, test vectors, and acceptance criteria from any codebase, producing a provenance trail so a fresh team can… The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “/incremental-analysis”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Fresh Discovery
  2. Diff Against Existing Specs
  3. Classify Specs
  4. Re-Analyze
  5. Re-Validate (Gates 1-2)
  6. Re-Sanitize and Audit (Layers 5-7)

What it can do on your machine

Read from SKILL.md and the folder at commit 6e6d4b4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Incremental Analysis loads about 2.2k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 809 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from prime-radiant-inc/greenfield at commit 6e6d4b4, republished under its Apache-2.0 licence (© prime-radiant-inc). 809 words, ~2,164 tokens.

Download SKILL.mdSave it as .claude/skills/incremental-analysis/SKILL.md (or your agent's skills folder).
name
incremental-analysis
description
Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed. Activates automatically when /analyze finds an existing workspace.

Incremental Analysis

When a workspace already exists for a target, avoid re-analyzing unchanged sources. Diff the current state against what was previously analyzed and re-analyze only what's stale.

When to Use

This skill activates automatically when /analyze is invoked and a workspace directory already exists at the target path. No --follow flag needed. If the workspace has a .git directory, this is an incremental run. Otherwise, it's a fresh analysis.

Note: --follow is for continuing an interrupted analysis within a single run. Incremental analysis is for subsequent runs against an evolved codebase.

High Water Mark Metadata

Each raw specs tracks the sources it was derived from in YAML frontmatter. This metadata is the basis for incremental diffing.

yaml
---
spec_id: SPEC-SESSION-001
derived_from:
  - path: workspace/raw/source/analysis/session-module.md
    source_ref: a1b2c3d  # git SHA of original source file, if available
    file_hash: sha256:deadbeef1234  # sha256 of source artifact at analysis time
  - path: workspace/public/docs/session-api.md
    fetched_at: 2026-04-13T10:00:00Z
    url: https://docs.example.com/sessions
  - path: workspace/raw/test-evidence/e2e-session-flow.md
    file_hash: sha256:cafebabe5678
analyzed_at: 2026-04-13T14:30:00Z
greenfield_version: "2.0"
---
Derived From Entry Types

Each entry in derived_from uses the fields appropriate to its source type:

Source TypeRequired FieldsOptional Fields
Source code artifactpath, file_hashsource_ref (git SHA)
Web-fetched docpath, url, fetched_atfile_hash
Runtime observationpath, file_hashtimestamp in fetched_at
Git historypath, source_reffile_hash
Test evidencepath, file_hash--
Writing High Water Marks

When writing or updating a raw spec, always include derived_from metadata:

  • For source code artifacts: include the git SHA of the original source file (if available) and the sha256 hash of the analysis artifact
  • For web-fetched docs: include the fetch timestamp and URL
  • For runtime observations: include the observation timestamp
  • For test evidence: include the file hash of the evidence artifact

Incremental Detection

When /analyze is invoked, before workspace initialization:

bash
WORKSPACE="${WORKSPACE_ARG:-./analysis-workspace}"

if [ -d "$WORKSPACE/.git" ]; then
  echo "Existing workspace detected at $WORKSPACE"
  echo "Running incremental analysis..."
  # Proceed with incremental flow (this skill)
else
  echo "No existing workspace. Running fresh analysis..."
  # Proceed with fresh workspace initialization (standard /analyze flow)
fi

To force a fresh analysis, delete the workspace directory.

Incremental Flow

Step 1: Fresh Discovery

Run the discovery/inventory phase to produce a new inventory manifest. This is always fresh -- the available sources may have changed since the last run. New files may exist, old files may have been deleted, documentation may have been updated.

The output is a complete inventory of what sources are available NOW, independent of what was analyzed before.

Step 2: Diff Against Existing Specs

For each existing raw specs, check its derived_from metadata against current state:

bash
# For each source with a git ref:
current_sha=$(git -C "$SOURCE_REPO" log -1 --format="%H" -- "$SOURCE_FILE")
# Compare against source_ref in derived_from

# For each source with a file hash:
current_hash=$(sha256sum "$ARTIFACT_PATH" | cut -d' ' -f1)
# Compare against file_hash in derived_from

# For web sources:
# Check if content has changed (HTTP ETag/Last-Modified, or re-fetch and diff)
Step 3: Classify Specs

Each existing spec gets exactly one classification:

ClassificationCriteriaAction
UnchangedAll derived_from sources match current state (same hash/SHA)Carry forward as-is
StaleOne or more derived_from sources have changedQueue for re-analysis
OrphanedA derived_from source no longer existsQueue for re-analysis (may result in spec removal)
NewDiscovery found sources with no corresponding specQueue for fresh analysis

Write the classification results to the workspace before proceeding:

workspace/raw/incremental/
    classification.md        # Summary: N unchanged, N stale, N orphaned, N new
    unchanged.txt            # List of spec IDs carried forward
    stale.txt                # List of spec IDs queued for re-analysis, with changed sources
    orphaned.txt             # List of spec IDs whose sources no longer exist
    new.txt                  # List of new sources needing analysis
Step 4: Re-Analyze

For stale specs: dispatch the appropriate Layer 1-3 agents. The analysis agents write updated specs that replace the stale versions. The derived_from metadata is updated with current hashes/SHAs.

For new sources: dispatch fresh Layer 1-3 analysis. Produces new spec files with derived_from metadata.

For orphaned specs: if the source was removed (feature deleted), remove the spec. If the source was renamed or moved, the discovery agent should detect the new location and classify it as "new" instead. When uncertain, flag for manual review rather than silently deleting.

For unchanged specs: no action. Carry forward as-is.

Show full SKILL.md (305 more words)Show less
Step 5: Re-Validate (Gates 1-2)

Run Gates 1-2 on the full set (carried forward + updated + new). Cross-module interactions may have changed even if a spec's direct sources didn't. A change in one module can create contradictions with an unchanged spec in another module.

Gate failures during incremental runs follow the same remediation loop as fresh runs (up to 3 attempts).

Step 6: Re-Sanitize and Audit (Layers 5-7)

Re-run Layers 5-7 on everything -- not just the changed specs. This is required because:

  • Layer 5 (Sanitization) is a rewrite pass. The sanitizer's understanding of the whole system may have changed with new/updated specs. A carried-forward spec that was properly sanitized last run may need different treatment now that adjacent specs have changed.
  • Layer 6 (Second-Pass Review) must see the complete output. Partial audits miss cross-file leakage.
  • Layer 7 (Fidelity Check) must validate the complete raw-to-clean mapping.

Sanitization is cheap relative to Layer 1-3 analysis. The sanitization discipline requires a fresh rewrite pass regardless.

Workspace Metadata Update

After incremental analysis completes, append to the run_history array in workspace.json:

json
{
  "run_history": [
    {
      "run_id": "001",
      "started_at": "2026-04-13T10:00:00Z",
      "completed_at": "2026-04-13T14:30:00Z",
      "type": "fresh",
      "specs_analyzed": 24,
      "specs_carried_forward": 0,
      "source_high_water": "a1b2c3d"
    },
    {
      "run_id": "002",
      "started_at": "2026-04-20T09:00:00Z",
      "completed_at": "2026-04-20T10:15:00Z",
      "type": "incremental",
      "specs_analyzed": 3,
      "specs_carried_forward": 21,
      "specs_orphaned": 0,
      "source_high_water": "d4e5f6a"
    }
  ]
}
Run History Fields
FieldTypeDescription
run_idstringSequential identifier (zero-padded)
started_atISO 8601When the run began
completed_atISO 8601When the run finished
typeenumfresh or incremental
specs_analyzedintegerSpecs that went through Layer 1-3 analysis
specs_carried_forwardintegerUnchanged specs carried forward (0 for fresh runs)
specs_orphanedintegerSpecs removed because sources no longer exist
source_high_waterstringGit SHA of the source repo HEAD at analysis time

Relationship to Other Skills

  • analysis-pipeline: Master methodology; incremental analysis modifies which specs enter the pipeline, not the pipeline itself
  • source-analysis: Layer 1 source analysis; dispatched for stale and new specs during incremental runs
  • validation-methodology: Gates 1-2 run on the full set regardless of incremental vs fresh
  • spec-sanitization: Layers 5-7 always run on everything; incremental savings come from Layers 1-3 only

© prime-radiant-inc, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/incremental-analysis of prime-radiant-inc/greenfield.

Open the folder on GitHubat commit 6e6d4b4

Compare with similar skills

Incremental Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Incremental Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Incremental Analysis this skillprime-radiant-inc/greenfield292—~2.2kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins11k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    11k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from prime-radiant-inc/greenfield

All 21 skills in this repo
  • Reverse Engineering Analysis Pipeline

    prime-radiant-inc/greenfield

    Master methodology for reverse-engineering a codebase into behavioral specs with cited evidence, reading every line across source, binaries, docs, runtime and git history.

    292 GitHub stars~3.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Community Intelligence Research

    prime-radiant-inc/greenfield

    Mines tutorials, forums, reviews, issues and changelogs for observed product behavior, using six search channels and consensus analysis.

    292 GitHub stars~4.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Containerized Target Execution

    prime-radiant-inc/greenfield

    Runs untrusted analysis targets inside Docker or Podman containers with memory, CPU and process limits, covering image builds, lifecycle, command execution and cleanup.

    292 GitHub stars~2.1k tokensUpdated 2 mo ago
    Auto-check passed
  • API Contract Detection

    prime-radiant-inc/greenfield

    Finds OpenAPI, GraphQL, Protobuf and JSON Schema files in a codebase and extracts behavioral claims from them as part of a reverse-engineering workflow.

    292 GitHub stars~4.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Documentation Research Methodology

    prime-radiant-inc/greenfield

    Method for extracting behavioral specifications from a product's public documentation: tiered search order, claim extraction rules, output structure, stop criteria and gap analysis.

    292 GitHub stars~4.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Ecosystem Analysis

    prime-radiant-inc/greenfield

    Layer 1 skill for SDK and ecosystem analysis. An agent skill from prime-radiant-inc/greenfield.

    292 GitHub stars~2.9k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Incremental Analysis

What does Incremental Analysis do?

Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed. Incremental Analysis is an agent skill from prime-radiant-inc/greenfield. Detect existing workspace, diff current sources against high water mark metadata, classify specs as unchanged/stale/orphaned/new, re-analyze only what changed.

When should I use Incremental Analysis?

Incremental Analysis fits situations like: development work in your project.

How do I install Incremental Analysis in Claude Code?

Run `npx skills add prime-radiant-inc/greenfield --skill incremental-analysis -a claude-code`. Or copy the skill folder (skills/incremental-analysis in prime-radiant-inc/greenfield) into .claude/skills/incremental-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Incremental Analysis in Codex?

Run `npx skills add prime-radiant-inc/greenfield --skill incremental-analysis -a codex`. Or copy the skill folder (skills/incremental-analysis in prime-radiant-inc/greenfield) into .agents/skills/incremental-analysis in your project. Codex loads it when a task matches its description.

Can I use Incremental Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add prime-radiant-inc/greenfield --skill incremental-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/incremental-analysis, .gemini/skills/incremental-analysis, .github/skills/incremental-analysis and .opencode/skills/incremental-analysis in your project.

What does Incremental Analysis need to run?

Going by SKILL.md and its folder, Incremental Analysis needs the command-line tools its instructions call (git).

Does Incremental Analysis access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Incremental Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Incremental Analysis use?

Incremental Analysis is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Incremental Analysis use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Incremental Analysis?

Skills that share tags, products or a category with Incremental Analysis: Finishing a Development Branch (obra/superpowers, 297k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Code Design Rationale Investigator (cursor/plugins, 11k stars) and Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Incremental Analysis?

prime-radiant-inc (a GitHub organization) maintains it in prime-radiant-inc/greenfield, which has 292 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on August 6, 2026.

Source: prime-radiant-inc/greenfield on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.