Claude
Skills
Sign in
Back

init

Included with Lifetime
$97 forever

Use when setting up a project to follow fyrsmithlabs standards. Works for new or existing repos - detects state automatically. Validates against git-repo-standards, generates missing artifacts, bootstraps CLAUDE.md based on project type. Includes interactive configuration wizard for project setup.

General

What this skill does


# Init

Set up any project to follow fyrsmithlabs standards. Detects whether repo is new or existing and handles accordingly.

## Command

```
/init                 # Full interactive setup wizard
/init --check         # Audit only, no modifications
/init --quick         # Skip wizard, use auto-detection
/init --validate      # Validate existing setup, check for staleness
```

## Contextd Integration (Optional)

If contextd MCP is available:
- `memory_search` for past init patterns
- `semantic_search` for project configuration
- `remediation_search` for common setup errors
- `memory_record` for init outcomes

If contextd is NOT available:
- Use Glob/Grep for project exploration
- Init still works fully (file-based fallback)
- No cross-session pattern learning

---

## Phase 1: Pre-Flight & Detection

### Step 1.1: Contextd Context Gathering (if available)

```
1. memory_search for past init patterns
2. semantic_search for project configuration
3. remediation_search for setup errors
```

**If NOT available:** Proceed with file-based detection.

### Step 1.2: Project Type Auto-Detection

Scan for language/framework indicators in priority order:

| Indicator File | Project Type | Language | Framework |
|---------------|--------------|----------|-----------|
| `go.mod` | Go Module | Go | - |
| `package.json` + `next.config.*` | Web App | TypeScript/JavaScript | Next.js |
| `package.json` + `nuxt.config.*` | Web App | TypeScript/JavaScript | Nuxt.js |
| `package.json` + `svelte.config.*` | Web App | TypeScript/JavaScript | SvelteKit |
| `package.json` + `vite.config.*` | Web App | TypeScript/JavaScript | Vite |
| `package.json` + `bin` field | CLI | JavaScript/TypeScript | Node.js |
| `package.json` (no framework) | Library | JavaScript/TypeScript | Node.js |
| `pyproject.toml` | Python | Python | - |
| `requirements.txt` (no pyproject) | Python (legacy) | Python | - |
| `Cargo.toml` | Rust | Rust | - |
| `pom.xml` | Java | Java | Maven |
| `build.gradle*` | Java/Kotlin | Java/Kotlin | Gradle |
| `*.csproj` | .NET | C# | .NET |
| `Gemfile` | Ruby | Ruby | - |
| `mix.exs` | Elixir | Elixir | - |
| Multiple language files | Monorepo | Mixed | - |
| None | Unknown | - | - |

### Step 1.3: Project Category Detection

| Category | Indicators |
|----------|------------|
| **API/Service** | `cmd/`, `main.go`, `server.ts`, `app.py`, Dockerfile, `internal/`, presence of HTTP/gRPC handlers |
| **CLI** | `cmd/`, `cobra`, `urfave/cli`, `package.json.bin`, `argparse`, `click` |
| **Library** | `pkg/` only, `exports` in package.json, `-lib` suffix, no entrypoint |
| **Web App** | Frontend framework detected, `pages/`, `src/app/`, `public/` |
| **Monorepo** | `pnpm-workspace.yaml`, `lerna.json`, `nx.json`, `turbo.json`, multiple `go.mod` |

---

## Phase 2: Interactive Configuration Wizard

**Skip if `--quick` flag is provided.** Use auto-detected values instead.

### Step 2.1: Project Type Confirmation

```
AskUserQuestion(
  questions: [{
    question: "Detected: <auto-detected-type>. Is this correct?",
    header: "Project Type",
    options: [
      { label: "Yes, <detected-type>", description: "<detected indicators>" },
      { label: "Web Application", description: "Frontend app with UI" },
      { label: "API/Service", description: "Backend service or API" },
      { label: "CLI Tool", description: "Command-line application" },
      { label: "Library", description: "Reusable package/module" },
      { label: "Monorepo", description: "Multiple projects in one repo" }
    ],
    multiSelect: false
  }]
)
```

### Step 2.2: Language/Framework Confirmation

```
AskUserQuestion(
  questions: [{
    question: "Detected language: <language>. Framework: <framework|none>. Confirm or change:",
    header: "Tech Stack",
    options: [
      { label: "Correct as detected", description: "<language> + <framework>" },
      { label: "Go", description: "Standard library or common Go patterns" },
      { label: "TypeScript/JavaScript", description: "Node.js ecosystem" },
      { label: "Python", description: "Python 3.x" },
      { label: "Rust", description: "Cargo-based project" },
      { label: "Other", description: "Specify manually" }
    ],
    multiSelect: false
  }]
)
```

### Step 2.3: Project Configuration

```
AskUserQuestion(
  questions: [{
    question: "What additional tooling should be configured?",
    header: "Tooling Setup",
    options: [
      { label: "Linting & Formatting", description: "Auto-detect and configure linter/formatter" },
      { label: "Testing Framework", description: "Set up test infrastructure" },
      { label: "CI/CD Pipeline", description: "GitHub Actions workflow" },
      { label: "Pre-commit Hooks", description: "husky, pre-commit, or similar" },
      { label: "Docker", description: "Dockerfile and .dockerignore" },
      { label: "All of the above", description: "Full project setup" }
    ],
    multiSelect: true
  }]
)
```

### Step 2.4: CLAUDE.md Customization

```
AskUserQuestion(
  questions: [{
    question: "What should be emphasized in CLAUDE.md?",
    header: "Project Focus",
    options: [
      { label: "Standard", description: "Balanced coverage of all areas" },
      { label: "Security-focused", description: "Extra emphasis on security patterns" },
      { label: "Performance-critical", description: "Performance patterns and benchmarking" },
      { label: "API-first", description: "API design, contracts, versioning" },
      { label: "TDD/Testing", description: "Test patterns and coverage requirements" }
    ],
    multiSelect: false
  }]
)
```

---

## Phase 3: Language-Specific Bootstrap

### Go Projects

**Detection Files:** `go.mod`

**Extract Configuration:**
```
1. Parse go.mod for module path and Go version
2. Check for golangci-lint config (.golangci.yml, .golangci.yaml)
3. Check for Makefile with standard targets
4. Detect cmd/ structure for entry points
5. Check for internal/ vs pkg/ organization
```

**Generate/Validate:**
| Item | Source | Action |
|------|--------|--------|
| `.golangci.yml` | If missing, generate standard config | Create |
| `Makefile` | If missing, generate with lint/test/build | Create |
| `.gitignore` | Use `gitignore-go.tmpl` | Merge |

**CLAUDE.md Go Section:**
```markdown
## Commands

| Command | Purpose |
|---------|---------|
| `make lint` | Run golangci-lint |
| `make test` | Run tests with coverage |
| `make build` | Build binary |
| `go generate ./...` | Run code generation |

## Code Style

- Follow Effective Go and Go Code Review Comments
- Use `internal/` for private packages
- Entry points in `cmd/<app-name>/main.go`
```

### Node.js/TypeScript Projects

**Detection Files:** `package.json`, `tsconfig.json`

**Extract Configuration:**
```
1. Parse package.json for:
   - name, version, type (module/commonjs)
   - scripts (build, test, lint, format)
   - dependencies (detect frameworks)
   - devDependencies (detect tooling)
2. Check for TypeScript (tsconfig.json)
3. Detect linter: eslint (.eslintrc*), biome (biome.json)
4. Detect formatter: prettier (.prettierrc*), biome
5. Detect test framework: jest, vitest, mocha, playwright
```

**Generate/Validate:**
| Item | Source | Action |
|------|--------|--------|
| `tsconfig.json` | If TS detected but missing | Create strict config |
| `.eslintrc.*` | If missing and eslint in deps | Create |
| `.prettierrc` | If missing and prettier in deps | Create |
| `.gitignore` | Merge with `gitignore-generic.tmpl` | Merge |

**CLAUDE.md Node Section:**
```markdown
## Commands

| Command | Purpose |
|---------|---------|
| `npm run dev` | Start development server |
| `npm run build` | Build for production |
| `npm run test` | Run tests |
| `npm run lint` | Run ESLint |
| `npm run format` | Run Prettier |

## Code Style

- Use TypeScript strict mode
- Prefer named exports over default exports
- Use path aliases from tsconfig.json
```

### Python Projects

**Detection Files:** `pyproject.toml`, `requirements.txt`, `setup.py`

**Extract Config

Related in General