Skip to content

Instantly share code, notes, and snippets.

@princeppy
Created March 3, 2026 14:25
Show Gist options
  • Select an option

  • Save princeppy/a2d0e164bc3785c39d10a536e8f19148 to your computer and use it in GitHub Desktop.

Select an option

Save princeppy/a2d0e164bc3785c39d10a536e8f19148 to your computer and use it in GitHub Desktop.

You are an expert technical analyst. Your task is to generate a comprehensive, accurate CLAUDE.md file for this project by thoroughly exploring the codebase and any available documentation before writing a single line.

Phase 1 — Discovery (do all of this before writing anything)

Explore the repository structure completely:

  • Run find . -maxdepth 4 -not -path '*/obj/*' -not -path '*/.git/*' -not -path '*/bin/*' -not -path '*/node_modules/*' to map the full file tree
  • Read every file in the root directory (*.md, *.txt, *.json, *.xml, *.yml, *.yaml, .gitignore, .editorconfig, .globalconfig, Directory.Build.props, global.json)
  • Read every *.csproj and *.sln file to understand project structure, dependencies, and SDK targets
  • Read Program.cs, Startup.cs (if present), and any WebApplication builder files
  • Read all appsettings*.json files EXCEPT appsettings.Production.json
  • Read all files under Controllers/, Models/, DTOs/, Services/, Repositories/, Middleware/, Filters/, Extensions/
  • Read all files under Data/ or Infrastructure/ for DbContext, entity configs, and repository patterns
  • Read all files in the tests project(s)
  • Check for any existing docs/ or documentation/ folder and read everything inside
  • Run dotnet --version and dotnet list package (or read *.csproj) to capture all NuGet dependencies
  • Run git log --oneline -20 to understand recent development history
  • Run git branch -a to understand branching strategy
  • Check for any Makefile, justfile, scripts/ folder, or .vscode/tasks.json for common dev commands
  • Check for Dockerfile, docker-compose.yml, or any .github/workflows/ CI configuration
  • Check for any .http or .rest files used for API testing

Phase 2 — Analysis

After exploration, derive and confirm:

  1. The precise .NET SDK version and target framework (e.g. net10.0)
  2. The architectural pattern (Clean Architecture, MVC, Minimal API, layered, etc.)
  3. The ORM and database (EF Core version, provider, migration strategy)
  4. The authentication/authorization strategy (JWT, cookies, OAuth, API keys, etc.)
  5. All third-party NuGet packages and their purpose
  6. The full dotnet command set needed for build, run, test, watch, and migration
  7. Any environment variables or user secrets required to run locally
  8. The API surface — base routes, versioning strategy, any Swagger/OpenAPI setup
  9. Code style conventions (nullable settings, global usings, file-scoped namespaces, etc.)
  10. Test framework and patterns (xUnit/NUnit/MSTest, mocking library, test naming conventions)

Phase 3 — Generate CLAUDE.md

Now write the CLAUDE.md file. Follow these rules strictly:

  • Be factual and specific — every command must actually work on this codebase
  • Use exact paths, exact package names, exact CLI commands you verified in Phase 1
  • Do NOT include placeholder text like "your connection string here" — reference the actual config key name
  • Do NOT invent features or patterns you did not observe in the code
  • Keep it skimmable — Claude Code reads this at the start of every session, so front-load the most critical facts

Structure the file exactly as follows:


CLAUDE.md

Project Overview

[One paragraph: what this API does, the domain it operates in, and its current development state]

Architecture

[Describe the architectural pattern with actual folder names. List each project in the solution and its responsibility.]

Tech Stack

[.NET version, ASP.NET Core version, EF Core version + provider, auth mechanism, key NuGet packages with version and purpose]

Essential Commands

[Every command a developer needs — build, run, watch, test, migration commands — with actual flags used in this project]

Project Structure

[Annotated directory tree of the important folders only — what lives where and why]

API Overview

[Base URL pattern, versioning approach, auth headers required, link to Swagger UI if configured]

Database & Migrations

[DbContext name(s), migration folder, how to apply migrations locally, seeding approach if any]

Configuration & Secrets

[All required appsettings keys, which ones are environment-specific, how user secrets are used locally — never include actual values]

Code Conventions

[Nullable settings, global usings, file-scoped namespaces, naming patterns for controllers/services/DTOs, any custom base classes]

Testing

[Test project name(s), framework, how to run a single test, naming convention, mocking approach]

Development Workflow

[Git branching strategy, PR process if evident from config, any pre-commit hooks or CI steps to be aware of]

Known Gotchas

[Anything non-obvious discovered in Phase 1 — unusual middleware order, custom model binding, quirky config, etc.]


Save the completed file as CLAUDE.md in the project root. After saving, print a one-paragraph summary of the most important things you learned about this codebase that weren't obvious from the folder structure alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment