Created
January 2, 2026 22:04
-
-
Save jorgeucano/38888190f00890cccf1f4705e6f662b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Claude Code Setup Prompt | |
| Copy and paste this in Claude Code at the root of your project: | |
| --- | |
| ``` | |
| I need you to analyze this project and generate the complete infrastructure to work efficiently with Claude Code following best practices. Do the following: | |
| ## 1. CLAUDE.md (project root) | |
| Analyze the code, structure, dependencies, and patterns of this project. Generate a CLAUDE.md that includes: | |
| - Project description and business purpose | |
| - Tech stack and main versions | |
| - Directory structure with explanation of each important folder | |
| - Code conventions (naming, patterns, architecture) | |
| - Essential commands (build, test, lint, deploy) | |
| - Team workflow (branches, PRs, CI/CD) | |
| - Common mistakes to avoid (based on what you see in the code) | |
| - Relevant business context to understand technical decisions | |
| ## 2. .claude/commands/ | |
| Create slash commands for common workflows. At minimum these files: | |
| - `pr.md` - Create a PR with description, tests, and changelog | |
| - `review.md` - Review code looking for bugs, security issues, and improvements | |
| - `test.md` - Generate tests for a specific file or function | |
| - `refactor.md` - Refactor code while maintaining functionality | |
| - `docs.md` - Generate/update documentation | |
| - `debug.md` - Investigate and fix a bug | |
| - `feature.md` - Implement a feature from plan to PR | |
| Each command should include clear instructions, expected output format, and verification steps. | |
| ## 3. .claude/settings.json | |
| Configure safe pre-approved permissions based on the project's tools: | |
| - Read commands (cat, ls, find, grep, etc.) | |
| - Detected package manager commands (npm, yarn, pnpm, pip, etc.) | |
| - Safe git commands (status, diff, log, branch) | |
| - Project linters and formatters | |
| - Test commands | |
| - Any specific CLI you detect (kubectl, docker, mongosh, etc.) | |
| DO NOT include destructive commands or those with dangerous side-effects. | |
| ## 4. .claude/agents/ | |
| Create specialized subagents: | |
| - `code-simplifier.md` - Simplify and clean code without changing functionality | |
| - `security-check.md` - Security audit of the code | |
| - `verify.md` - Verify that changes work correctly | |
| ## 5. .claude/hooks/ (documentation) | |
| Create a `hooks-setup.md` file explaining how to configure: | |
| - PostToolUse hook for automatic formatting with the project's formatter | |
| - Stop hook for automatic verification on long-running tasks | |
| ## 6. .mcp.json (if applicable) | |
| If you detect integrations that could benefit from MCP servers (Slack, databases, APIs), create a template .mcp.json with commented structure. | |
| ## 7. .claude/ README | |
| Create `.claude/README.md` explaining the entire generated structure and how the team can contribute/modify it. | |
| --- | |
| IMPORTANT: | |
| - Adapt everything to the REAL context of this project, don't use generic placeholders | |
| - Use the style and conventions that already exist in the code | |
| - If you find existing documentation, integrate it | |
| - Verify that the commands you pre-approve actually exist in the project | |
| - Include concrete examples based on the actual code | |
| Start by analyzing the project and then generate each file. Show the plan before executing. | |
| ``` | |
| --- | |
| ## Usage Tips | |
| 1. **Run this in Plan mode first** (shift+tab x2) to review what it will do | |
| 2. **After generation**, review the CLAUDE.md and adjust what's not right | |
| 3. **Commit everything** so the team has it | |
| 4. **Iterate**: every time Claude does something wrong, add it to CLAUDE.md | |
| ## Quick Command for Later | |
| Once you have the setup, you can add this alias to your shell: | |
| ```bash | |
| alias cc="claude --profile work" | |
| ``` | |
| And create the profile at `~/.claude/profiles/work.json` with specific settings for your org. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pro tip: add prompt as an skill