GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — better-init/init.md at main · Lathezero/better-init

Expand file tree

/

init.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
55 lines (41 loc) · 3.62 KB
/

init.md

Copy path

File metadata and controls

55 lines (41 loc) · 3.62 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
description 创建或更新 CLAUDE.md — 首次生成,或跟随项目演进检测漂移并优化
argument-hint [附加说明]

Analyze this codebase and create or update CLAUDE.md, which will be given to future instances of pi to operate in this repository. The goal: the file must accurately describe the codebase as it is today.

Step 1 — Determine the mode

Check whether CLAUDE.md (or AGENTS.md) already exists in the repository root.

Mode A: Initial creation (no file exists)

Analyze the codebase and create CLAUDE.md with:

  1. Commands that will be commonly used — build, lint, test (including how to run a single test), dev servers, code generation.
  2. High-level architecture: the "big picture" that requires reading multiple files to understand — entry points, core services, data flow, key abstractions.
  3. Project-specific constraints and pitfalls (e.g. "errors return HTTP 200 with an error body", "multipart requests bypass X").

Mode B: Update an existing file (drift detection)

An existing CLAUDE.md may describe a codebase that no longer exists. Do NOT rewrite from scratch — audit it:

  1. Extract every factual claim in the current file: commands, file/directory paths, architecture descriptions, configuration mechanisms, env var names.
  2. Verify each claim against reality:
    • Commands actually exist (package.json scripts, Makefile, CLI entry points) — run --help if cheap
    • Referenced files/directories still exist
    • Architecture description matches the code (entry point, request flow, core services) — spot-check the imports and entry files
    • Configuration mechanism unchanged (e.g. .env vs config.yaml, renamed options)
  3. Hunt for drift since the doc was written:
    • git log --oneline recent feature/BREAKING commits; git log --diff-filter=A --name-only for added dirs/tools
    • New top-level directories, tools/, scripts, CI workflows, new CLI subcommands
    • Deleted or renamed modules the doc still references
  4. Edit surgically: keep what's still accurate, fix what's stale, add what's missing and high-value. Preserve the file's voice and structure where possible.
  5. Update cross-references: sub-package doc lists, docs/ indexes, pointers from a parent workspace CLAUDE.md — new docs must be discoverable.
  6. Report the diff in plain terms: list what was stale (and what the code actually does now), what was added, and what was verified unchanged. This report is the primary deliverable — the user wants to know what drifted.

Optional hygiene checks (do them when relevant, mention in the report):

  • Generated artifacts or large exported data files tracked in git that should be ignored (or vice versa: hand-maintained config that is accidentally untracked)
  • Missing index/README when a docs directory accumulates many files

Rules for both modes

  • Do not repeat yourself; do not include obvious instructions ("provide helpful error messages", "write unit tests", "never commit secrets").
  • Do not list every file or component — only what is not discoverable by ls or a quick grep.
  • No generic development practices.
  • If there is a README.md, distill its important parts rather than duplicating them.
  • Never invent content ("Common Development Tasks", "Tips", "Support") that you did not verify in the code or other files. If a claim cannot be verified cheaply, leave it out or mark it explicitly as unverified.
  • Keep it short. A CLAUDE.md that is twice as long is half as useful.
  • When creating the file, prefix it with:

CLAUDE.md

This file provides guidance to pi when working with code in this repository.

Additional instructions: $ARGUMENTS

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.