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/README.md at main · Lathezero/better-init

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
64 lines (44 loc) · 2.55 KB
/

README.md

Copy path

File metadata and controls

64 lines (44 loc) · 2.55 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

pi-init-lifecycle

/init is not a one-time scaffolding command — it's a CLAUDE.md lifecycle tool. 首次运行生成 CLAUDE.md,之后每次运行检测文档与代码的漂移并精准更新。

A prompt template for pi (coding agent) that keeps your CLAUDE.md in sync with the code as it actually is today.

The problem

Stock /init templates only help on day one. But codebases evolve:

  • the config system moved from .env to config.yaml
  • a tools/ directory appeared three months ago
  • the architecture section describes services that were since refactored away

The CLAUDE.md written at project birth quietly becomes a lie — and every future agent session starts by being misled by it.

What this template does

Run Mode Behavior
First run (no CLAUDE.md) Generate Commands (incl. single-test), big-picture architecture, project-specific pitfalls
Every run after Drift audit Extracts every factual claim in the existing file → verifies each against the code (commands exist? paths alive? config mechanism unchanged?) → hunts drift via git history → edits surgically instead of rewriting → reports what went stale and why

Optional hygiene checks when relevant: generated artifacts that shouldn't be git-tracked, missing docs indexes, stale cross-references between parent/sub-package docs.

Install

# global (all projects)
cp init.md ~/.pi/agent/prompts/

# or per-project (takes precedence, requires project trust)
cp init.md your-project/.pi/prompts/

Usage

/init                          # audit or generate
/init 重点关注计费相关文档        # with extra instructions

Example drift report (Mode B)

- STALE: "configure via LEONARDO_CREDENTIAL env var" — the project moved to
  config.yaml (multi-account) in 8f3a21c; rewritten to match server/config.js
- STALE: "docs/API.md is the only integration doc" — docs/ now has 6 files
  including pricing.md and SOP.md; added index reference
- VERIFIED OK: test commands, request flow description
- ADDED: tools/pricing.mjs subcommands (added last month, undocumented)

Design principles baked into the template

  • Verify, don't assume — claims that can't be verified cheaply are left out or marked unverified
  • Edit, don't rewrite — your hand-tuned sections survive the update
  • The report is the deliverable — you learn what drifted, not just get a new file
  • Short > complete — "a CLAUDE.md twice as long is half as useful"

License

MIT

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.