agentleFS
weiyvshanweiyvshan/claude-skills/skills/init-project/SKILL.md

init-project

Skill0 starsChanged 10 months agoUnlicenseView on GitHub

Initialize project AI context by generating/updating root-level and module-level CLAUDE.md documentation. This skill performs adaptive 3-phase scanning (inventory → module scan → deep supplementary) to understand project structure and auto-generate documentation with Mermaid structure diagrams and navigation breadcrumbs.

56 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use addskill, apply-firmware and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ryanportfolioSkill

    addskill

    Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.

    Also in 6 projects that use this

  • ryanportfolioSkill

    apply-firmware

    Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.

    Also in 6 projects that use this

  • +10 more from ryanportfolio

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 5

    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. Distinctive:

    Use this skill when user wants to initialize or update AI context documentation for a codebase, such as:

    line 11
  2. Very specific:

    Use Glob to batch-list files (avoid limits)

    line 27
  3. Distinctive:

    When invoked, this skill performs the following steps:

    line 55
  4. Distinctive:

    Generate documentation: - Create/update:

    line 65
  5. Distinctive:

    After each run, calculate and report:

    line 120
  6. Very specific:

    Write gaps to index.json - next run prioritizes filling gaps (checkpoint resume).

    line 125
  7. Very specific:

    Do NOT modify source code - only generate/update documentation and .claude/index.json

    line 129
  8. Distinctive:

    If incomplete: explain why and list recommended next paths

    line 142

“Common” is measured: kept by at least 6 in 10 of the 47 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

Project Initialization Skill

Use this skill when user wants to initialize or update AI context documentation for a codebase, such as:

  • "Initialize this project for AI context"
  • "Generate CLAUDE.md documentation"
  • "Scan project structure and create documentation"
  • "Index this codebase for AI understanding"

Usage

/init-project <project-summary-or-name>

Execution Strategy (Auto-Adaptive)

The skill automatically selects scanning intensity based on project characteristics:

Phase A: Full Repository Inventory (Lightweight)

  • Use Glob to batch-list files (avoid limits)
  • Count files, calculate language distribution, map directory topology
  • Identify module candidates (package.json, pyproject.toml, go.mod, apps/, packages/, services/, cmd/)
  • Generate module candidate list with: language, entry guess, test dir, config files

Phase B: Module-Priority Scan (Medium)

For each module, read in order:

  1. Entry points: main.ts, index.ts, cmd/*/main.go, app.py, src/main.rs
  2. External interfaces: routes, controllers, APIs, proto/openapi
  3. Dependencies: package.json scripts, pyproject.toml, go.mod, Cargo.toml, config dirs
  4. Data layer: schema.sql, prisma/schema.prisma, ORM models, migrations
  5. Tests: tests/**, __tests__/**, *_test.go, *.spec.ts
  6. Quality tools: eslint, ruff, golangci configs

Extract only high-signal snippets and paths - do not paste large code blocks.

Phase C: Deep Supplementary (On-Demand)

Trigger when:

  • Repository is small OR single module is small
  • Phase B insufficient to determine key interfaces/data models/test strategy
  • Root or module CLAUDE.md missing required info items

Action: Batch-read additional directories to fill gaps.

If hitting tool/time limits, write partial results with "stopped here" explanation and list recommended next paths.

Workflow

When invoked, this skill performs the following steps:

  1. Get current timestamp - Execute the timestamp script. The path depends on installation type:

    • Project-local (in .claude/skills/): bash .claude/skills/init-project/scripts/get_timestamp.sh
    • Global (~/.claude/skills/): bash ~/.claude/skills/init-project/scripts/get_timestamp.sh
    • From skill directory: bash scripts/get_timestamp.sh

    Tip: If you don't know the installation type, try the project-local path first. If it fails with "No such file or directory", use the global path.

  2. Scan project structure - Execute the adaptive 3-phase scanning described above
  3. Generate documentation - Create/update:
    • Root-level CLAUDE.md with Mermaid structure diagram
    • Module-level CLAUDE.md files with navigation breadcrumbs
    • .claude/index.json with scan results

Bundled Scripts

ScriptPurposeUsage
scripts/get_timestamp.shGet current datetimeSee Workflow step 1 for path resolution

Timestamp Format Options

  • Default: %Y-%m-%d %H:%M:%S
  • Filename-safe: %Y-%m-%d_%H%M%S
  • Readable with timezone: %Y-%m-%d %H:%M:%S %Z
  • ISO 8601: %Y-%m-%dT%H:%M:%S%z

Output Artifacts

This skill generates the following artifacts:

Root CLAUDE.md

  • Project vision
  • Architecture overview
  • Mermaid structure graph - Generate a graph TD diagram showing module hierarchy with clickable links to module CLAUDE.md files
  • Module index table
  • Running & development instructions
  • Testing strategy
  • Coding conventions
  • AI usage guidelines
  • Changelog (insert/update at top if existing)

Module CLAUDE.md (per module)

  • Breadcrumb navigation at top: [Root](../../CLAUDE.md) > [packages](../) > **auth**
  • Module responsibilities
  • Entry points and startup
  • External interfaces
  • Key dependencies and configuration
  • Data models
  • Testing and quality
  • FAQ
  • Related file list
  • Changelog

.claude/index.json

  • Timestamp (ISO-8601 format)
  • Root and module lists
  • Entry/interface/test/important paths per module
  • Scan coverage statistics
  • Ignored patterns (merged from .gitignore + defaults)
  • Truncation status

Coverage and Resume

After each run, calculate and report:

  • Files scanned / estimated total, coverage percentage
  • Per-module coverage summary and gaps (missing interfaces, tests, data models)
  • Top ignored directories and reasons

Write gaps to index.json - next run prioritizes filling gaps (checkpoint resume).

Security and Boundaries

  • Do NOT modify source code - only generate/update documentation and .claude/index.json
  • Default ignore patterns:
    • From .gitignore if present
    • Plus defaults: node_modules/**, .git/**, .github/**, dist/**, build/**, .next/**
    • __pycache__/**, *.lock, *.log, *.bin, *.pdf, *.png, *.jpg, *.jpeg, *.gif, *.mp4, *.zip, *.tar, *.gz
  • For large files/binary: record path only, do not read content

Result Summary (Print to Main Conversation)

  • Root CLAUDE.md create/update status
  • Module list (path + one-line responsibility)
  • Coverage and main gaps
  • "Generated Mermaid structure diagram" and "Added navigation breadcrumbs to N modules"
  • If incomplete: explain why and list recommended next paths

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.