C9PG
Claude Code Docs

Build the Full Project Setup

This tutorial is the bridge into Project Setup. It assumes you have already worked through the command tutorials, Daily Workflow, Using Skills, and Your First Hook.

1. Start from the team account

Prompt:

text
Before we set up this repo, confirm that we should use the team account rather than a personal account and explain why that matters for shared setup.

What you should see: Claude tells you to use the team account for this team’s standard workflow and shared environment.

2. Choose the bootstrap path deliberately

Use one of these:

text
/init

or

bash
CLAUDE_CODE_NEW_INIT=1 claude

What you should see: either a fast baseline or the broader guided bootstrap flow.

Rule of thumb:

  • use /init when you want the quicker baseline
  • use CLAUDE_CODE_NEW_INIT=1 claude when you want the more guided walkthrough

3. Tighten CLAUDE.md

Prompt:

text
Take the generated CLAUDE.md and trim it to the smallest useful project contract:
workflow, verification commands, and the repo facts Claude truly needs.

What you should see: a shorter, clearer CLAUDE.md instead of a giant wish list.

4. Add shared settings

Prompt:

text
Create or tighten .claude/settings.json with shared permissions and sensible defaults.
Do not add heavy hook automation yet.

What you should see: a modest shared settings file the team can actually explain.

5. Add one shared skill

Prompt:

text
Add one shared skill only if it captures a workflow the team already repeats successfully.
Explain why this skill belongs in the repo.

What you should see: either one focused shared skill or a clear explanation that the repo is not ready for one yet.

6. Add one optional hook

Prompt:

text
Add either one small safety hook or one small feedback hook.
Keep the setup narrow and explain why this is the first hook worth standardizing.

What you should see: a single intentional hook, not a copied hook matrix.

7. Review plugins through the manager

Run:

text
/plugin

What you should see: the current plugin state. Check what is already present before adding anything.

8. Decide what not to standardize yet

Prompt:

text
List the pieces of configuration we are intentionally leaving out for now and explain why delaying them is healthy.

What you should see: a short list of deferred complexity, such as extra hooks, custom agents, or plugins the team has not earned yet.

Advanced: Match the Starter Files

The shipped starter project has a concrete end state. The advanced sections across the tutorials should now add up to this exact baseline:

text
CLAUDE.md
.claude/settings.json
.claude/hooks/require-test-first.sh
.claude/hooks/block-dangerous.sh
.claude/hooks/auto-format.sh
.claude/hooks/run-related-tests.sh
.claude/rules/frontend-testing.md
.claude/rules/backend-testing.md
.claude/skills/test-forward/SKILL.md
.claude/agents/code-reviewer.md
.claude/state/.gitkeep
.gitignore additions

Starter CLAUDE.md

Starter CLAUDE.md.template
md
# Project Working Rules

## Default workflow
- For features, bug fixes, and behavior changes: explore → plan → RED → GREEN → review.
- Use Plan Mode (Shift+Tab or /plan) for multi-file or ambiguous work.
- No production behavior change until a failing verification artifact exists.
- After every production code change, run the smallest relevant verification.
- Before stopping, run the full repo gate.

## Verification policy
- Backend/domain logic: failing automated test first.
- UI work: failing E2E, screenshot expectation, or repro script first.
- Migrations/ops/config: failing smoke/repro command first.
- After implementation: run /simplify before opening a PR.

## Scope discipline
- No opportunistic refactors outside the task unless explicitly asked.
- Keep diffs small. Explain any unavoidable architectural fallout.
- One logical change per commit.

## Project commands
- Test (targeted):  pnpm test -- <target>
- Lint:             pnpm lint
- Typecheck:        pnpm typecheck
- Fast gate:        pnpm lint && pnpm typecheck
- Full gate:        pnpm test && pnpm lint && pnpm typecheck

## Architecture notes
<!-- Add 2-3 sentences about key architectural decisions -->
<!-- Add test framework, ORM, router, state management specifics -->
<!-- Add naming conventions or file organization rules -->

Starter .claude/settings.json

Starter settings.json
json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "model": "opusplan",
  "plansDirectory": ".claude/plans",
  "permissions": {
    "allow": [
      "Bash(pnpm test *)",
      "Bash(pnpm lint)",
      "Bash(pnpm typecheck)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git add *)",
      "Bash(git commit *)",
      "Bash(git push *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)"
    ]
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "bash .claude/hooks/require-test-first.sh",
            "timeout": 5
          }
        ]
      },
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "bash .claude/hooks/block-dangerous.sh",
            "timeout": 5
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "bash .claude/hooks/auto-format.sh",
            "timeout": 10
          },
          {
            "type": "command",
            "command": "bash .claude/hooks/run-related-tests.sh",
            "async": true,
            "timeout": 180
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "agent",
            "prompt": "Verify that all required tests for this task pass. Run the project's full gate command. If verification is incomplete or failing, respond with decision: block and explain exactly what remains.",
            "timeout": 180
          }
        ]
      }
    ]
  }
}

Starter hook scripts

Use the exact four scripts shown in Your First Hook:

  • require-test-first.sh
  • block-dangerous.sh
  • auto-format.sh
  • run-related-tests.sh

That tutorial now contains the full starter code and the operational consequence of every hook.

Starter shared rules

Use the exact rule files shown in The Six-Step Loop:

  • frontend-testing.md
  • backend-testing.md

Those rules are part of the starter baseline because the repo should teach different verification expectations for different code surfaces.

Starter shared skill

Use the exact test-forward skill shown in Using Skills.

That file is what turns “verification first” from a slogan into a reusable repo workflow.

Starter reviewer agent

Use the exact code-reviewer.md shown in Review and Debug Commands.

That gives the starter baseline a reusable second review surface beyond /simplify.

Starter .gitignore and state directory

Starter gitignore.append
gitignore
# Claude Code personal overrides
.claude/settings.local.json

# Claude Code worktrees (used by /batch)
.claude/worktrees/

# Claude Code state (ephemeral)
.claude/state/

The starter files also include .claude/state/.gitkeep so the state directory exists before the test-forward skill writes the RED token.

Starter baseline checklist

  • CLAUDE.md matches the starter template
  • .claude/settings.json matches the starter config
  • all four hook scripts are present
  • both scoped rules are present
  • skills/test-forward/SKILL.md is present
  • agents/code-reviewer.md is present
  • .claude/state/ exists
  • .gitignore includes the starter additions

Next step

Use Project Setup as the durable reference, then move into Team Leader Setup when you are ready to roll the baseline out across the team.