From restruct
Generate a minimal, research-backed CLAUDE.md for this project. Analyzes the codebase for non-obvious commands and conventions, interviews you for team knowledge, and produces a concise file that stays under 30 rules.
npx claudepluginhub thejustinwalsh/claude-plugins --plugin restructThis skill uses the workspace's default tool permissions.
You are generating a CLAUDE.md file for this project. Your goal is a **minimal,
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
You are generating a CLAUDE.md file for this project. Your goal is a minimal, high-signal file — not a comprehensive overview. Research shows:
The test for every line: "Would Claude make a mistake without this?" If Claude would figure it out from the code, don't include it.
The user may pass an initial message with this skill invocation: $ARGUMENTS
If $ARGUMENTS is non-empty, read it carefully before starting discovery. It may contain critical context like:
Incorporate this into your discovery — it should steer what you look for and what you prioritize in the final CLAUDE.md. Do not ask the user to repeat anything they already said here.
Execute these steps using tools. Do not ask the user anything yet.
Read the root directory for: package.json, go.mod, Cargo.toml,
pyproject.toml, pom.xml, build.gradle, Makefile, xmake.lua,
CMakeLists.txt, Gemfile, .csproj. Identify language(s), framework(s),
and package manager.
Search these locations:
package.json scriptsMakefile / xmake.lua / justfile targets.github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfilepyproject.toml [tool.pytest] or [scripts]Cargo.toml / build.rsVerify each command works by running it (use --dry-run or --help if
destructive). Only keep commands that Claude couldn't guess from the toolchain.
For example: npm test is obvious; pnpm test calling xmake which calls
go test is not.
Look for: .eslintrc*, .prettierrc*, biome.json, rustfmt.toml,
.editorconfig, golangci-lint config, .clang-format. Only note rules
that override language defaults. Skip if the config is standard/minimal.
Look for: ARCHITECTURE.md, docs/architecture*, ADR/, doc/design*.
If found, note them as @import references. Do NOT copy their contents.
Check: .env.example, docker-compose.yml, Dockerfile, required services
(databases, message queues), and any REQUIRED_* or *_URL env vars.
If a CLAUDE.md already exists, read it and evaluate each rule against the research criteria. Flag rules that are:
Present a summary of what you found and what you'd keep vs. cut.
Now ask the user questions to fill gaps that code analysis can't cover. Use AskUserQuestion for each. Ask 3-5 questions max, skipping any already answered by Phase 1.
Anti-patterns: "Are there patterns, libraries, or approaches that have caused problems in this project and should be avoided?"
Workflow conventions: "Any deployment, branching, PR, or commit conventions Claude should follow?"
Undocumented architecture decisions: "Any architectural constraints that aren't in the code but matter? (e.g., 'no ORMs', 'all state in Redux', 'never use library X')"
If a user response sounds over-specified (paragraph-length rules, overly detailed style guides), challenge once with:
"Would Claude actually make a mistake without this specific detail, or would it figure it out from the code?"
Accept their answer after one challenge. Don't belabor it.
Assemble the file using this template. Omit any section with no content. Hard limit: 50 lines maximum.
# {project name}
## Build & Test
- `{build command}` — {what it does, if non-obvious}
- `{test command}`
- `{single test command}` — prefer running single tests over the full suite
- `{lint/typecheck command}`
## Code Style
{only rules that diverge from language defaults — skip if standard}
## Architecture
{2-3 sentences max summarizing key decisions}
{@import references to detailed docs}
## Environment
{required env vars, services, setup steps that aren't in README}
## Workflow
- If you added new behavior, add or update tests to cover it
- {other process steps — e.g., "Prefer focused unit tests", "Add a regression test before fixing a bug"}
## Constraints
- {design/architectural constraints — e.g., "Performance is critical", "All operations must go through the CLI"}
## Do NOT
- {specific anti-pattern from user interview or codebase analysis}
- {another specific anti-pattern}
- {etc — 3-5 items max}
Important: Do NOT include build/test/lint verification commands (like
"run tests after every change") in any section. These are discovered and
enforced automatically by .restruct/verify.yaml.
Section semantics:
@import references for deep documentation instead of inliningPresent the draft CLAUDE.md to the user. Ask them to review it. Only write the file after they approve.
If a CLAUDE.md already exists, show a diff of what changed and why (citing the research principle behind each removal or addition).