I

Init Project Command

Initializes a new project with essential structure, configuration files, and tooling. Sets up linting, testing, TypeScript, git hooks, CI/CD, and Claude Code configuration in one command. Saves hours of boilerplate setup.

CommandCommunitydevelopmentv1.0.0MIT
0 views0 copies

Command

/init

Description

Bootstraps a new project with production-ready configuration. Creates the directory structure, sets up tooling (linting, testing, TypeScript, formatting), configures git hooks, and initializes Claude Code configuration. Adapts to the specified project type.

Behavior

Arguments

  • $ARGUMENTS -- Project type and options (e.g., "node api", "react app", "python fastapi")

What Gets Created

Core Structure

project/
  src/               # Source code
  tests/             # Test files
  scripts/           # Build/deploy scripts
  docs/              # Documentation
  .github/
    workflows/       # CI/CD pipelines
  .claude/
    settings.json    # Claude Code config
    commands/        # Custom commands
    CLAUDE.md        # Project instructions

Configuration Files

TypeScript (tsconfig.json):

{ "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "strict": true, "esModuleInterop": true, "outDir": "./dist", "rootDir": "./src", "declaration": true, "sourceMap": true, "skipLibCheck": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] }

ESLint (eslint.config.js):

import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; export default tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, { rules: { '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], '@typescript-eslint/explicit-function-return-type': 'warn' } } );

Git Hooks (via husky):

# .husky/pre-commit npx lint-staged # .husky/commit-msg npx commitlint --edit $1

Claude Code (.claude/CLAUDE.md):

# Project: {name} ## Build & Test - Build: `npm run build` - Test: `npm test` - Lint: `npm run lint` ## Conventions - Use TypeScript strict mode - Follow conventional commits - Write tests for all new features

CI Pipeline (.github/workflows/ci.yml):

name: CI on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: '20' } - run: npm ci - run: npm run lint - run: npm run build - run: npm test

Package Scripts

{ "scripts": { "build": "tsc", "dev": "tsx watch src/index.ts", "start": "node dist/index.js", "test": "vitest run", "test:watch": "vitest", "lint": "eslint src/", "lint:fix": "eslint src/ --fix", "format": "prettier --write 'src/**/*.ts'", "prepare": "husky" } }

Output Format

## Project Initialized: my-api ### Created - 12 files, 4 directories - TypeScript + ESLint + Prettier configured - Vitest test runner ready - GitHub Actions CI pipeline - Claude Code configuration ### Next Steps 1. `cd my-api && npm install` 2. Start coding in `src/index.ts` 3. Run `npm run dev` for development 4. Run `npm test` to verify setup

Examples

# Initialize a Node.js API project /init node api with express # Initialize a React app /init react app with vite # Initialize a Python project /init python fastapi
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates