home / skills / arjenschwarz / agentic-coding / project-init

project-init skill

/claude/skills/project-init

This skill initializes a Claude Code project with standard hooks and language-specific permissions for seamless setup.

npx playbooks add skill arjenschwarz/agentic-coding --skill project-init

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.9 KB
---
name: project-init
description: Initialize Claude Code project settings with standard hooks and language-specific permissions. Use when setting up a new project for Claude Code or adding standard configuration to an existing project.
---

# Project Init

Initialize a project with standard Claude Code configuration.

## What It Does

1. Adds a SessionStart hook to `.claude/settings.json` for remote environment setup
2. Detects project languages and adds appropriate tool permissions

## Language Detection

The script detects languages based on project files and adds permissions:

| Detection File | Language | Permissions Added |
|----------------|----------|-------------------|
| `go.mod` | Go | `go`, `golangci-lint`, `staticcheck`, `govulncheck` |
| `Package.swift`, `*.xcodeproj` | Swift | `swift`, `xcodebuild`, `swiftlint`, `xcrun` |
| `package.json` | Node.js | `npm`, `npx`, `node`, plus `yarn`/`pnpm`/`bun` if lockfiles present |
| `pyproject.toml`, `requirements.txt` | Python | `python`, `pip`, `uv`, `pytest`, `ruff`, `mypy` |
| `Cargo.toml` | Rust | `cargo`, `rustc` |
| `Gemfile` | Ruby | `ruby`, `bundle`, `rake`, `rspec` |
| `pom.xml` | Java (Maven) | `mvn`, `java` |
| `build.gradle` | Java (Gradle) | `gradle`, `./gradlew`, `java` |
| `Dockerfile` | Docker | `docker`, `docker-compose` |
| `*.tf` | Terraform | `terraform`, `tofu` |
| `Makefile` | Make | `make` |

`git` is always included.

## Usage

Run the setup script from your project directory:

```bash
~/.claude/skills/project-init/scripts/setup-project.sh
```

The script:
- Creates `.claude/settings.json` if it doesn't exist
- Merges hooks and permissions into existing settings without overwriting
- Is idempotent (safe to run multiple times)
- Requires `jq` for JSON manipulation

## Batch Setup

To initialize multiple projects:

```bash
for dir in ~/projects/*; do
  (cd "$dir" && ~/.claude/skills/project-init/scripts/setup-project.sh)
done
```

Overview

This skill initializes Claude Code project settings with a standard SessionStart hook and language-specific tool permissions. It creates or merges into .claude/settings.json, adding remote-environment setup and minimal required tools without overwriting existing settings. The setup is idempotent and safe to run repeatedly.

How this skill works

The setup script scans the project tree for language indicator files (for example: package.json, pyproject.toml, go.mod, Cargo.toml, Dockerfile, etc.). It ensures git permission is present and adds a tailored list of tool permissions for each detected language. It then inserts or merges a SessionStart hook into .claude/settings.json using jq, preserving any existing configuration.

When to use it

  • Creating a new Claude Code project and you want standard remote setup steps and permissions.
  • Adding Claude Code configuration to an existing repo to enable environment hooks.
  • Onboarding multiple repositories with consistent tooling permissions and a SessionStart hook.
  • After adding a new language to a project so the correct tool permissions are granted.
  • Automating bulk initialization across many project directories.

Best practices

  • Run the script from the project root so language-detection files are found.
  • Install jq beforehand; the script relies on jq for safe JSON merges.
  • Review the merged .claude/settings.json after running to confirm hooks and permissions.
  • Re-run the script whenever new language ecosystems are added to keep permissions current.
  • Use the batch loop for consistent setup across many projects, and run it in CI or a setup job if needed.

Example use cases

  • Initialize a fresh Python web service: detects pyproject.toml and requirements.txt and adds python, pip, pytest, ruff, mypy permissions plus git.
  • Add Docker and Terraform permissions when your repo contains a Dockerfile and .tf files so container and infra tools are enabled.
  • Bootstrap a monorepo with Node and Rust components: package.json and Cargo.toml detection adds node/npm and cargo permissions together.
  • Bulk-enable SessionStart hooks across ~/projects/* using the provided batch loop to standardize remote environment setup.

FAQ

Will the script overwrite my existing .claude/settings.json?

No. The script merges hooks and permissions into the existing file and is designed to avoid overwriting user settings.

Is it safe to run the script multiple times?

Yes. The setup is idempotent; running it repeatedly will not duplicate entries or corrupt settings.

What dependency is required to run the script?

jq is required for JSON manipulation. Ensure jq is installed and on your PATH before running the setup.