Skip to main content
skill Claude Code CX Codex Cursor

scan — Claude Code skill: what it does, how to install

Scans the codebase to generate project-doc.md and AGENTS.md. It sets up repository context for downstream agents and tracks architectural changes on subsequent runs.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install ship-mate@claude-code-workflows
Open on GitHub

What scan does

The skill checks whether .claude/pipeline/project-doc.md already exists. The first run performs a full scan. It documents runtime versions, dependencies, folder structure, code style conventions, and test coverage. It saves the architectural snapshot to project-doc.md and drafts repository-level agent guidelines in AGENTS.md. For MERN applications, it appends specific rules on Express error handling and Mongoose middleware.

Later invocations run in delta mode using git diff HEAD~1 --name-only. The skill inspects only updated files and patches the relevant sections in project-doc.md. Whenever it spots architectural drift like new directories or library swaps, it halts and asks for manual confirmation before touching AGENTS.md.

It integrates with understand-anything and context-mode plugins when they are installed. If missing, it falls back to native shell tools like find, grep, and cat. This skill is worth running when setting up agentic workflows in mid-size or large repositories, though single-file utilities do not need it.

What it helps with

  • generate initial project architecture blueprints in project-doc.md
  • produce tailored agent operational rules in AGENTS.md
  • detect architectural drift across commits using git diff
  • inject MERN-specific security guidelines into agent instructions

Example prompts for the agent

  • Scan the codebase and generate initial documentation for agents
  • Run a delta scan to check for architectural drift
  • Update project-doc.md based on the latest git changes

How to install scan

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install ship-mate@claude-code-workflows

This installs the whole ship-mate plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill scan -a claude-code

3Manually: put the files in place

~/.claude/skills/scan/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scan/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

publish-to-pages official github Publishes presentations and HTML content to GitHub Pages by creating a repository and returning a live page address. Use it when files need to be shared as a web page. GitHub Copilot 1,800installs oo-component-documentation official github This skill creates or updates object-oriented component docs from code or an existing Markdown file. It helps keep new and revised documentation in one format. GitHub Copilot 1,800installs creating-oracle-to-postgres-migration-bug-report official github Creates structured bug reports for Oracle-to-PostgreSQL migration defects. Use it when a database behaviour difference needs a reproducible report with a cause and validation plan. GitHub Copilot 1,800installs solo official Anthropic Solves hard math problems in one session without sub-agents, logs each step in notes.md to survive message limits, and produces a standalone proof.md. Claude Code 657installs email-drafter official github This skill studies your email style and drafts messages for specific recipients. Use it when you need a reply or follow-up that sounds like your usual correspondence. GitHub Copilot 1,400installs roundup-setup official github Learns your communication style from answers and status examples, then configures personalized briefings. Use it before running roundup for draft updates. GitHub Copilot 1,300installs grill-with-docs Matt Pocock This skill interviews you about a plan or design and creates ADRs and a glossary along the way. Use it when decisions need sharper definition. Claude Code 1,219,756installs skill-creator official anthropics Creates and refines skills, then tests them with prompts, evaluations, and performance checks. Claude Code Claude.ai 414,180installs

Questions about scan

How do I install scan in Claude Code?

Run /plugin marketplace add wshobson/agents followed by /plugin install ship-mate@claude-code-workflows, or install via npx skills add wshobson/agents --skill scan -a claude-code.

What does the scan skill do?

It analyzes your codebase architecture, builds project-doc.md inside .claude/pipeline/, and generates AGENTS.md for downstream agent instructions.

Are the understand-anything and context-mode plugins required?

No, both plugins are strictly optional. When absent, scan falls back directly to native commands like find, grep, cat, and git.

Source text

SKILL.md · MIT
---
name: scan
description: Scans the codebase to generate project-doc.md and AGENTS.md. Use when bootstrapping a new agent-driven repo, refreshing project documentation after architectural changes, or running a delta scan to detect drift. Runs a full scan on first use and a smart delta scan on subsequent runs. Uses understand-anything + context-mode when available, falls back to native tools otherwise. Only updates AGENTS.md on detected architectural changes with human confirmation.
---

# Codebase Scanner

You are a technical analyst. Your job is to scan the project codebase and produce accurate, project-specific documentation used by all downstream agents.

## Step 1: Check Optional Plugin Dependencies

Check whether the two optional enhancement plugins are available:

```
understand-anything  →  /plugin list | grep understand-anything
context-mode         →  /plugin list | grep context-mode
```

These plugins are **optional**. They improve scan quality but are not required:

- **understand-anything** (Lum1104/Understand-Anything) — provides deeper semantic code analysis
- **context-mode** (mksglu/context-mode) — routes large outputs through a sandbox to protect the context window

If both are present, use them in Steps 3–4 as described below. If either or both are missing, proceed with the **native fallback** approach: use `find`, `grep`, `cat`, and `git` commands directly, routing large outputs through `ctx_execute` / `ctx_execute_file` if context-mode is available, otherwise summarise inline.

> **Note:** To install the optional plugins manually:
> ```
> /plugin marketplace add Lum1104/Understand-Anything && /plugin install understand-anything
> /plugin marketplace add mksglu/context-mode && /plugin install context-mode@context-mode
> ```

## Step 2: Determine Scan Mode

Check if `.claude/pipeline/project-doc.md` exists.

- **Does not exist** → FULL SCAN (first run)
- **Exists** → DELTA SCAN

## Step 3A: Full Scan

Use `understand-anything` to analyse the entire codebase. If **context-mode** is available (verified in Step 1), route ALL output through its tools (`ctx_batch_execute` / `ctx_execute_file`) — never dump raw file contents into the main context window. If context-mode is not available, summarise each file's findings inline and avoid printing raw file contents.

Produce `.claude/pipeline/project-doc.md` using the following structure (based on the architecture-blueprint-generator pattern):

```md
# Project Documentation
> Generated: [timestamp] | Mode: FULL

## Tech Stack
- Runtime: [e.g. Node.js 20, Python 3.11]
- Language: [e.g. TypeScript, Python]
- Framework: [e.g. Next.js 14 App Router, FastAPI]
- Database: [e.g. PostgreSQL via Prisma]
- Styling: [e.g. Tailwind CSS]
- State Management: [e.g. Zustand, Redux]

## Dependencies
[Key libraries with versions, grouped by: core / dev / testing]

## Architecture Pattern
[e.g. Feature-based, Layered MVC, Clean Architecture]
[Describe how the project is structured and why]

## Folder Structure
[Top-level directory map with purpose of each folder]

## Code Style Conventions
[Naming patterns, file naming, import ordering, export patterns]
[Inferred from actual code — not guessed]

## Modularity Practices
[How concerns are separated, shared module locations, service patterns]

## Data Architecture
[Entity relationships, data access patterns, ORM usage]

## Cross-Cutting Concerns
[Auth/authz approach, error handling patterns, logging, validation]

## Service Communication
[REST / GraphQL / event-driven — document what actually exists]

## Test Coverage
- Overall coverage: [X%]
- Testing framework: [e.g. Jest, Vitest, Pytest]
- Key untested areas: [list]
- Test patterns used: [unit / integration / e2e]

## Entry Points
[Main files, key config files, environment setup]

## Changed Files
[Only present in delta scans — list of files re-scanned]

## Last Scanned
[ISO timestamp]
```

After writing `project-doc.md`, proceed to **Step 4** to generate `AGENTS.md`.

## Step 3B: Delta Scan

1. Run `git diff HEAD~1 --name-only` to get changed files
2. If no changed files, report "No changes detected — project-doc.md is current" and exit
3. Use `understand-anything` to re-analyse only the changed files; route output through `ctx_execute_file` if context-mode is available, otherwise summarise inline
4. Patch only the affected sections of `.claude/pipeline/project-doc.md`
5. Update the `Last Scanned` and `Changed Files` fields
6. Proceed to **Step 4B** (architectural change detection)

## Step 4A: Generate AGENTS.md (First Run Only)

Write `AGENTS.md` to the repo root. This is NOT a copy of `project-doc.md` — it is rewritten as agent instructions, tailored to this specific project. Every agent reads this file first.

Before writing AGENTS.md, read and follow the complete [project-specific instruction template](references/agents-template.md), including its security rules and human-confirmed update requirements.

If the project is MERN stack (MongoDB + Express + React + Node.js — detected from package.json / requirements), append a `### MERN Stack Notes` section to AGENTS.md covering: use Mongoose middleware over raw queries, handle async errors in Express with a central error handler, avoid storing JWT tokens in localStorage (use httpOnly cookies), and never expose Mongoose error objects directly in API responses.

## Step 4B: Architectural Change Detection (Delta Runs Only)

After patching `project-doc.md`, compare the new version against the previous. Check for:
- New framework or major library added
- New architectural directory pattern created (e.g. new `/lib/hooks/`, `/services/`)
- Major dependency swap (e.g. axios → fetch, moment → dayjs)
- New auth or session handling pattern

If any detected, show:

```
⚠️  Architectural change detected in delta scan:
    [List specific changes found]

AGENTS.md may need updating. Review and confirm:
  [y] Update AGENTS.md — patch affected sections only
  [n] Skip — this is not an architectural change
```

Only on `[y]` confirmation: patch the relevant sections of `AGENTS.md`. Never rewrite the full file.

## Step 5: Report

Print a summary:

```
✅ Scan complete ([FULL/DELTA])
   project-doc.md → updated
   AGENTS.md      → [generated / patched / unchanged]
   Changed files  → [N files re-scanned / N/A for full scan]
   Coverage       → [X%]
```

Update `state.json` field `checkpoints.scan = "completed"`.

© Pranay Yadav · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor