Imported from chdalski/claude_orchestration (
blueprints/autonomous/.claude/skills/project-init/SKILL.md). Install upstream withnpx skills add chdalski/claude_orchestration --skill project-init. Copyright stays with the author.
/project-init
Generate CLAUDE.md files by scanning the project and
synthesizing context that agents cannot infer from code
alone. The output format is defined in
.claude/skills/project-init/project-context.md.
For projects with git-repository subdirectories (e.g., git
submodules), also generate a CLAUDE.md in each
subdirectory that has its own .git/. Each sub-project is
scanned independently so agents working there get context
specific to that sub-project.
Detection Tables
Language Detection
Detect languages from manifest files at the project root and one level of subdirectories. A project may use multiple languages.
| Manifest File | Condition | Language |
|---|---|---|
package.json + tsconfig.json |
Both present | TypeScript |
package.json (no tsconfig.json) |
tsconfig absent | JavaScript |
Cargo.toml |
Present | Rust |
pyproject.toml |
Present | Python |
setup.py |
Present | Python |
requirements.txt |
Present | Python |
go.mod |
Present | Go |
Test Framework Detection
| Indicator | Test Framework |
|---|---|
jest.config.* or jest in package.json |
Jest |
vitest.config.* or vitest in package.json |
Vitest |
conftest.py or pytest.ini or [tool.pytest] in pyproject.toml |
pytest |
_test.go files |
Go testing |
[dev-dependencies] with test crates in Cargo.toml |
Rust test crates |
#[cfg(test)] in .rs files |
Rust built-in tests |
Code Intelligence Plugins
Official language-server plugins for detected languages.
A plugin only activates when its server binary is on
PATH.
| Language | Plugin | Server binary |
|---|---|---|
| TypeScript | typescript-lsp@claude-plugins-official |
typescript-language-server |
| Rust | rust-analyzer-lsp@claude-plugins-official |
rust-analyzer |
| Python | pyright-lsp@claude-plugins-official |
pyright-langserver |
| Go | gopls-lsp@claude-plugins-official |
gopls |
Mono-Repo Detection
A project is a mono-repo if any of these are true:
package.jsonhas aworkspacesfieldCargo.tomlhas a[workspace]sectionpnpm-workspace.yamlexists- Multiple subdirectories contain their own manifest files
- Subdirectories contain
.git/(git submodules)
Convention Detection
Scan for files that indicate non-obvious project conventions — things agents need to know but cannot infer from code structure alone.
| Signal | Convention |
|---|---|
Root Cargo.toml with [workspace.lints] |
Workspace lint inheritance — crates use lints.workspace = true |
Root tsconfig.json extending @tsconfig/strictest |
Maximum TypeScript compiler strictness |
Root eslint.config.* with strictTypeChecked |
Strict type-aware linting |
.pre-commit-config.yaml or .husky/ |
Pre-commit hooks enforce checks before commit |
release-plz.toml, .goreleaser.yml, or semantic-release config |
Automated release pipeline |
cliff.toml or commitlint.config.* |
Conventional commits required |
renovate.json or dependabot.yml |
Automated dependency updates |
turbo.json or nx.json |
Monorepo task orchestration |
Makefile, justfile, or Taskfile.yml |
Custom task runner with project-specific commands |
.editorconfig |
Editor config enforced across contributors |
This table is not exhaustive — also look for patterns in CI configs, README badges, and manifest scripts that reveal conventions not listed here.
Reference Detection
Scan these locations for authoritative URLs:
- README.md — links in the first few sections
docs/directory — links in documentation files- Manifest files —
repository,homepagefields - Configuration comments — URLs referencing specs
Filter for authoritative sources: specifications, API docs, RFCs, design documents. Skip generic links (GitHub homepages, npm/crates.io package pages).
Steps
-
Read output format — read
.claude/skills/project-init/project-context.mdfor the output structure. -
Check for existing CLAUDE.md — if
CLAUDE.mdexists at the project root, read it. If it has Conventions or References sections, extract their entries for preservation. Ask the user whether to regenerate (refreshes Overview, Build and Test, Components while preserving Conventions and References) or skip. -
Scan for manifests — search the project root and one level of subdirectories for manifest files (package.json, tsconfig.json, Cargo.toml, pyproject.toml, setup.py, requirements.txt, go.mod, pnpm-workspace.yaml).
-
Read manifests — extract build, test, lint, format, and clean commands. Also extract project descriptions and dependency information.
-
Apply Cargo lints (Rust only) — if Rust was detected, read
.claude/skills/project-init/rust-init.mdand follow its instructions to update allCargo.tomlfiles in the project. -
Apply TypeScript strictness (TypeScript only) — if TypeScript was detected, read
.claude/skills/project-init/typescript-init.mdand follow its instructions to updatetsconfig.json,eslint.config.mjs, andpackage.jsonin each TypeScript project root. -
Enable code intelligence plugins — for each detected language listed in the Code Intelligence Plugins table, add its plugin to
enabledPluginsin.claude/settings.jsonwith the valuetrue. Merge into the existing file: keep every other key and entry, and leave an entry already set tofalseunchanged — it records a deliberate opt-out. Then check each plugin's server binary withcommand -v <binary>. Do not install missing binaries — that changes the machine, not the project — but report them, because the plugin stays inactive without its binary. -
Detect mono-repo — check for workspace fields, multiple manifest directories, or git submodules. If detected, catalog components with their paths and purposes (from component README.md or manifest descriptions).
-
Synthesize overview — read README.md (first few paragraphs) and manifest
descriptionfields. Write 2-4 sentences: what the project is, who it serves, why it exists. If no README exists, infer from code structure and manifest metadata. -
Detect conventions — scan for convention signals using the Convention Detection table. Note each finding as a one-line entry.
-
Detect references — scan for authoritative URLs using the Reference Detection guidance. Note each finding.
-
Confirm with user — present detected conventions and references to the user via
AskUserQuestion:- "I detected these conventions — are they correct? Anything to add or remove?" (list detected conventions plus any preserved from existing CLAUDE.md)
- "These look like authoritative references — should I include them? Any to add?" (list detected references plus any preserved)
Merge user feedback with preserved entries. If the user adds new entries, include them.
-
Write CLAUDE.md — assemble the output following the format in
.claude/skills/project-init/project-context.md. Write to the project root. Then check for subdirectories with their own.git/— for each one, scan it independently (repeat steps 3-12 scoped to that subdirectory) and write its ownCLAUDE.md. Check for existingCLAUDE.mdin each location before writing. -
Present summary — report to the caller:
- Overview synthesized (brief description of what was written)
- Build and test commands detected
- Whether mono-repo structure was found
- Conventions and references included
- Which
Cargo.tomlfiles were updated with lints (Rust projects only) - Which TypeScript config files were updated (TypeScript projects only)
- Which code intelligence plugins were enabled and
which server binaries are missing. Plugins enabled
here load only after the user runs
/reload-pluginsor starts a new session. - Whether any files beyond
CLAUDE.mdwere modified