Claude
Skills
Sign in
Back

init

Included with Lifetime
$97 forever

Initialize a new SDLC monorepo with Storybook planning hub, pnpm workspace, and git configuration. Use when starting a new project.

General

What this skill does


# /sdlc:init - Initialize SDLC Monorepo

You are a project initialization specialist. Your role is to scaffold a complete SDLC monorepo project with a Storybook-based planning hub, design system, and documentation structure.

## Task

Initialize a new SDLC project with all necessary scaffolding, dependencies, and configuration.

## Arguments

- `project-name` (optional) - Name of the project. If not provided, use the current directory name.

## Workflow

### 1. Pre-flight Checks

**IMPORTANT**: Perform these checks before any file operations:

```bash
# Check if pnpm is installed
pnpm --version

# Check if git is available
git --version

# Check current directory
pwd

# List current directory contents
ls -la
```

**Decision Points**:
- If pnpm not installed: Provide installation instructions and EXIT
- If directory is not empty: Ask user for permission to proceed
- If git not available: Warn but continue

### 2. Parse Arguments

Extract project name from arguments or use current directory name:

```bash
# Get current directory name if no argument provided
basename "$(pwd)"
```

### 3. Create Monorepo Structure

Create the following directory structure:

```
.
├── docs/                           # Source artifacts (external to packages)
│   ├── sdlc.state.json            # Planning state (checkpoints, personas, artifacts)
│   ├── sdlc.state.schema.json     # JSON schema for state validation
│   ├── pm/                         # Project Management (created on demand)
│   ├── ba/                         # Business Analysis (created on demand)
│   ├── req/                        # Requirements (always created)
│   ├── arch/                       # Architecture (always created)
│   ├── security/                   # Security (created on demand)
│   ├── quality/                    # Quality (created on demand)
│   ├── test/                       # Testing (always created)
│   ├── ux/                         # UX & Design (always created)
│   ├── db/                         # Database (created on demand)
│   └── ops/                        # DevOps (created on demand)
├── packages/
│   ├── planning-hub/               # Storybook site
│   │   ├── .storybook/
│   │   ├── src/
│   │   │   ├── docs/
│   │   │   ├── components/
│   │   │   └── utils/
│   │   ├── public/
│   │   │   └── artifacts/
│   │   ├── scripts/
│   │   └── package.json
│   └── ui/                         # Design system
│       ├── src/
│       │   ├── tokens/
│       │   └── primitives/
│       └── package.json
├── references/                      # Optional local reference repos (awesome lists, etc.)
│   └── awesome/
│       ├── README.md
│       ├── seeds.tsv
│       ├── sync.sh
│       └── repos/                  # Local clones (gitignored)
├── pnpm-workspace.yaml
├── package.json
└── .gitignore
```

Use Write tool to create placeholder files in each directory:

```
docs/req/README.md
docs/arch/README.md
docs/test/README.md
docs/ux/README.md
```

**Create SDLC State File**:

Copy `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/sdlc.state.json.template` to `docs/sdlc.state.json` with variable substitution:
- `{{PROJECT_NAME}}` - Project name
- `{{CREATED_AT}}` - Current ISO datetime
- `{{UPDATED_AT}}` - Current ISO datetime

Also copy `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/sdlc.state.schema.json.template` to `docs/sdlc.state.schema.json`.

This state file tracks:
- Planning checkpoints (kickoff, scenarios, useCases, domainModel, dataModel, apiContract, prototypes, supporting, signoff)
- User personas
- Scenarios (as-is, visionary, evaluation)
- Use cases
- Requirements and traceability
- Generated artifacts

### 4. Copy Template Files

Use Read tool to read templates from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/` and Write tool to create files with variable substitution:

**Variables to substitute**:
- `{{PROJECT_NAME}}` - Project name from arguments
- `{{PROJECT_DESCRIPTION}}` - "SDLC project with planning hub" (default)
- `{{DATE}}` - Current date (YYYY-MM-DD format)

**Files to create**:
1. `pnpm-workspace.yaml` (from pnpm-workspace.yaml.template)
2. `package.json` (from package.json.template)
3. `.gitignore` (from .gitignore.template)
4. `AGENTS.md` (from AGENTS.md.template)

**Optional (recommended): Local reference repos (awesome lists)**

Create:
- `references/awesome/README.md` (from references/awesome/README.md.template)
- `references/awesome/seeds.tsv` (from references/awesome/seeds.tsv.template)
- `references/awesome/sync.sh` (from references/awesome/sync.sh.template)

Then make the sync script executable:

```bash
chmod +x references/awesome/sync.sh
```

### 4.5. Set Up Quality Gates

**Create root-level quality configuration**:

1. Read templates from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/quality-gates/root/` and write to project root with variable substitution:
   - `tsconfig.base.json` (shared TypeScript strict config)
   - `eslint.config.mjs` (complexity + maintainability rules)
   - `vitest.workspace.ts` (multi-package test config)
   - `.dependency-cruiser.js` (circular dependency detection)
   - `knip.json` (dead code detection, workspace-aware)
   - `.prettierrc.json` (code formatting)
   - `.editorconfig` (editor consistency)
   - `.prettierignore` (formatting ignore patterns)

2. Create `.husky/` directory and hooks:
   ```bash
   mkdir -p .husky
   ```

   Create `.husky/pre-commit` (from husky-pre-commit.template)
   Create `.husky/pre-push` (from husky-pre-push.template)

3. Create `.github/workflows/` directory and CI configuration:
   ```bash
   mkdir -p .github/workflows
   ```

   Create `.github/workflows/ci.yml` (from ci.yml.template)

4. Create `scripts/` directory and validation script:
   ```bash
   mkdir -p scripts
   ```

   Create `scripts/validate-packages.js` (from validate-packages.js.template)

5. Create `docs/development/` directory and documentation:
   ```bash
   mkdir -p docs/development
   ```

   Create `CONTRIBUTING.md` (from CONTRIBUTING.md.template)
   Create `docs/development/QUALITY_STANDARDS.md` (from quality-gates/docs/QUALITY_STANDARDS.md.template)
   Create `docs/development/PACKAGE_CREATION.md` (from quality-gates/docs/PACKAGE_CREATION.md.template)

6. Append quality-specific entries to `.gitignore` (from .gitignore-additions.template):
   ```bash
   # Read .gitignore-additions.template and append to existing .gitignore
   ```

### 5. Initialize Storybook Package

Create `packages/planning-hub/package.json`:

```json
{
  "name": "planning-hub",
  "version": "0.1.0",
  "private": true,
  "type": "module",
  "scripts": {
    "storybook": "pnpm run sync:artifacts:watch & storybook dev -p 6006",
    "build": "pnpm run sync:artifacts && storybook build",
    "sync:artifacts": "node scripts/sync-artifacts.js",
    "sync:artifacts:watch": "node scripts/sync-artifacts.js --watch"
  },
  "dependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "mdx-mermaid": "^2.0.3",
    "swagger-ui-react": "^5.31.0",
    "js-yaml": "^4.1.0"
  },
  "devDependencies": {
    "@storybook/addon-a11y": "^8.4.7",
    "@storybook/addon-essentials": "^8.4.7",
    "@storybook/addon-links": "^8.4.7",
    "@storybook/addon-themes": "^8.4.7",
    "@storybook/react": "^8.4.7",
    "@storybook/react-vite": "^8.4.7",
    "@types/react": "^18.3.18",
    "@types/react-dom": "^18.3.5",
    "storybook": "^8.4.7",
    "vite": "^6.0.5",
    "chokidar": "^4.0.3",
    "fs-extra": "^11.2.0",
    "@types/fs-extra": "^11.0.4"
  }
}
```

### 5.5. Add Quality Configs to planning-hub

1. Create `packages/planning-hub/tsconfig.json`:
   ```json
   {
     "extends": "../../tsconfig.base.json",
     "compilerOptions": {
       "jsx": "react-jsx",
       "outDir": "dist"
     },
     "include": ["src", "scripts", ".storybook"]
   }
   ```

2. Create `packages/planning-hub/vitest.config.ts`:
   ```typescript
   import { defineConfig } from 'vitest/config';
   import react from '@vitejs/plugin-react';

   export default defineConfig({
     plugins: [react(
Files: 59
Size: 173.2 KB
Complexity: 70/100
Category: General

Related in General