# Documentation Standards Config Examples

This directory contains example configurations for different project types using the `@akson/cortex-doc-standards` package.

## Available Examples

### 📋 [base-config.json](./base-config.json)
**Comprehensive base configuration** with all available rules and extensive documentation.

- **Use for**: Understanding all available options
- **Includes**: All 12 core rules with detailed variable examples
- **Features**: Custom sections, global variables, complete rule coverage

### ⚛️ [nextjs-config.json](./nextjs-config.json)
**Next.js application** configuration optimized for full-stack React development.

- **Tech Stack**: Next.js 14, TypeScript, Prisma, Tailwind CSS
- **Auth**: NextAuth.js
- **Testing**: Jest + Playwright
- **Database**: PostgreSQL with Prisma ORM

### 📦 [monorepo-config.json](./monorepo-config.json)
**Monorepo project** configuration for multi-package repositories.

- **Build System**: Turbo
- **Package Management**: Shared packages with namespace
- **Structure**: Apps + packages architecture
- **Features**: Shared UI, utilities, and configurations

### 📱 [flutter-config.json](./flutter-config.json)
**Flutter mobile app** configuration for cross-platform development.

- **Platforms**: iOS, Android, Web, Desktop
- **State Management**: Provider/Riverpod
- **Testing**: Flutter test + integration tests
- **Auth**: Firebase Auth

### 🔧 [backend-config.json](./backend-config.json)
**Backend API server** configuration for REST APIs.

- **Runtime**: Node.js with TypeScript
- **Database**: PostgreSQL with ORM
- **Auth**: JWT with refresh tokens
- **Deployment**: AWS ECS with auto-scaling

### 🛠️ [makerkit-monorepo-config.json](./makerkit-monorepo-config.json)
**MakerKit SaaS platform** configuration for full-featured SaaS applications.

- **Framework**: MakerKit with Next.js 14
- **UI**: 80+ components with shadcn/ui
- **Auth**: Supabase Auth with multi-tenant support
- **Database**: PostgreSQL with Row Level Security
- **Features**: Billing, analytics, admin dashboard, team management

### 📱 [makerkit-flutter-config.json](./makerkit-flutter-config.json)
**Cross-platform SaaS** configuration combining MakerKit web with Flutter mobile.

- **Web**: MakerKit framework for admin/management interface
- **Mobile**: Flutter app for customer-facing features
- **Backend**: Shared Supabase backend with real-time subscriptions
- **Auth**: Unified Supabase Auth across platforms
- **State**: TanStack Query (web) + Riverpod/Bloc (mobile)

## Using These Examples

### 1. Copy Base Configuration
```bash
# Copy the base example to your project
cp examples/base-config.json ./doc-standards.config.json

# Or use a project-specific example
cp examples/nextjs-config.json ./doc-standards.config.json
```

### 2. Customize for Your Project
```json
{
  "projectName": "Your Project Name",
  "projectType": "nextjs",
  "globalVariables": {
    "project.name": "Your Project Name",
    "project.description": "Your project description"
  }
}
```

### 3. Generate CLAUDE.md
```bash
npx @akson/cortex-doc-standards generate-claude generate
```

## Configuration Structure

### Essential Fields
```json
{
  "projectName": "string",     // Display name for your project
  "projectType": "string",     // nextjs|flutter|backend|monorepo
  "description": "string"      // Brief project description
}
```

### Rules Configuration
```json
{
  "rules": [
    {
      "id": "rule-name",
      "enabled": true,
      "description": "What this rule provides",
      "variables": {
        "variable.name": "custom value"
      }
    }
  ]
}
```

### Global Variables
```json
{
  "globalVariables": {
    "project.name": "MyApp",
    "project.type": "nextjs",
    "any.custom.variable": "value"
  }
}
```

### Custom Sections
```json
{
  "customSections": [
    {
      "id": "unique-id",
      "title": "📋 Section Title",
      "content": "Markdown content with {{variable}} interpolation",
      "order": 10
    }
  ]
}
```

## Available Rules

| Rule ID | Description | Key Variables |
|---------|-------------|---------------|
| `claude-prompting-fundamentals` | Core Claude AI interaction principles | `translation.function`, `package.file` |
| `claude-development-workflow` | Structured development workflow | `lint.command`, `test.command`, `ui.library` |
| `claude-communication-rules` | Communication style guidelines | None |
| `claude-codebase-mastery` | Codebase understanding best practices | `package.file`, commands |
| `shared-packages` | Shared package governance | `packages.namespace`, `packages.registry` |
| `github-projects` | GitHub Projects workflow | `project.owner`, `project.repo` |
| `security-standards` | Security and secret management | `secrets.manager`, `auth.method` |
| `testing-standards` | Testing requirements | `coverage.unit`, test commands |
| `component-patterns` | UI component design patterns | `component.library`, `styling.system` |
| `database-patterns` | Database and ORM patterns | `database.system`, `orm.library` |
| `no-mock-data` | Prohibits mock/fake data usage | None |
| `utility-management` | Utility function organization | `utils.directory`, `utils.library` |

## Project Type Recommendations

### Next.js Projects
- Enable: `claude-*`, `component-patterns`, `database-patterns`, `testing-standards`
- Variables: Set `ui.library` to your UI framework choice

### Monorepos
- Enable: `shared-packages`, `utility-management`, `component-patterns`
- Variables: Configure `packages.namespace` and `packages.location`

### Mobile (Flutter)
- Enable: `claude-*`, `testing-standards`, `security-standards`
- Variables: Set `package.file` to `pubspec.yaml`

### Backend APIs
- Enable: `database-patterns`, `security-standards`, `no-mock-data`
- Variables: Configure auth and database systems

## Tips

1. **Start with a project-specific example** rather than the comprehensive base
2. **Customize variables** to match your exact tech stack
3. **Add custom sections** for project-specific requirements
4. **Test generation** with `--dry-run` flag first
5. **Version control** your configuration for team consistency

## Validation

Validate your configuration before generation:

```bash
npx @akson/cortex-doc-standards rules validate --config ./doc-standards.config.json
```

## Support

For questions about configuration or rules, see the main [README.md](../README.md) or open an issue in the repository.