Skip to content
Skillpedia
Documentation41k · #4953

scan

Makes your agent generate project documentation. It's useful for keeping docs up-to-date, especially after code changes.

What it does

This agent analyzes your project's code to create automatic documentation. It generates two files: a technical summary of the project and a guide for other AI agents.

When to use it

  • ✓When starting a new project to document it.
  • ✓After making major changes to the code structure.
  • ✓To check if the code has changed since the last analysis.

Example of what to ask your AI

“Scan the code and generate the project documentation and AGENTS.md file.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/wshobson/agents/blob/main/plugins/ship-mate/skills/scan/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/ship-mate/skills/scan/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It checks for extra tools that help with analysis. Then, it decides whether to analyze everything (first time) or just what has changed. Finally, it writes the documentation files.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add wshobson/agents --skill scan

Or download just the file:

curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/ship-mate/skills/scan/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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):

# 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, including its security rules and human-confirmed update requirements.

…

FAQ

What are the generated files?

The `project-doc.md` is a technical summary of the project (language, dependencies, structure). The `AGENTS.md` is a guide for other AI agents to understand and use the project.

What happens if I don't have the extra tools?

The agent uses basic system tools for analysis, but the documentation might be less detailed.

What is a 'delta scan'?

It's an analysis that checks only the parts of the code that have been modified since the agent was last run, making the process faster.

Details

Original description by the author

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.m

repo: wshobson/agents

Popularity

GitHub stars
41k
Ranking position
#4953
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills