@ooneex/cli 1.33.0 → 1.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6533,7 +6533,7 @@ var package_json_default = `{
6533
6533
  `;
6534
6534
 
6535
6535
  // src/templates/app/README.md.txt
6536
- var README_md_default = "# {{NAME}}\n\nA modular, enterprise-grade backend framework built with TypeScript and Bun, powered by the **@ooneex** ecosystem.\n\n## Prerequisites\n\n- [Bun](https://bun.sh) (latest)\n- [Docker](https://www.docker.com/) & Docker Compose\n\n## Getting Started\n\n### Install Dependencies\n\n```bash\nbun install\n```\n\n### Environment Configuration\n\nCopy the environment template and fill in the required values:\n\n```bash\ncp modules/app/.env.example modules/app/.env\n```\n\n| Variable | Description | Required |\n|---|---|---|\n| `APP_ENV` | Application environment (`local`, `development`, `staging`, `testing`, `production`, \u2026) | Yes |\n| `PORT` | Server port number (default: `3000`) | Yes |\n| `HOST_NAME` | Server hostname (default: `0.0.0.0`) | Yes |\n| `CSRF_SECRET` | Secret key for CSRF token generation and verification | Yes |\n| `LOGS_DATABASE_URL` | Database URL for storing application logs | No |\n| `BETTERSTACK_LOGGER_SOURCE_TOKEN` | Logtail source token for Better Stack logging | No |\n| `BETTERSTACK_EXCEPTION_LOGGER_APPLICATION_TOKEN` | Better Stack token for exception tracking | No |\n| `ANALYTICS_POSTHOG_PROJECT_TOKEN` | PostHog API key for event tracking | No |\n| `CACHE_REDIS_URL` | Redis connection URL for caching | No |\n| `CACHE_UPSTASH_REDIS_REST_URL` | Upstash Redis REST URL for serverless caching | No |\n| `PUBSUB_REDIS_URL` | Redis connection URL for pub/sub messaging | No |\n| `RATE_LIMIT_REDIS_URL` | Redis connection URL for rate limiting | No |\n| `CORS_ORIGINS` | Comma-separated allowed origins or `*` (default: `*`) | No |\n| `CORS_METHODS` | Comma-separated HTTP methods | No |\n| `CORS_HEADERS` | Comma-separated allowed request headers | No |\n| `CORS_CREDENTIALS` | Allow credentials: `true` or `false` | No |\n| `DATABASE_URL` | PostgreSQL connection URL | No |\n| `DATABASE_REDIS_URL` | Redis connection URL for Redis-based database operations | No |\n| `SQLITE_DATABASE_PATH` | SQLite database file path | No |\n| `STORAGE_CLOUDFLARE_ACCESS_KEY` | Cloudflare R2 access key ID | No |\n| `STORAGE_CLOUDFLARE_SECRET_KEY` | Cloudflare R2 secret access key | No |\n| `STORAGE_CLOUDFLARE_ENDPOINT` | Cloudflare R2 endpoint URL | No |\n| `STORAGE_BUNNY_ACCESS_KEY` | BunnyCDN access key | No |\n| `STORAGE_BUNNY_STORAGE_ZONE` | BunnyCDN storage zone name | No |\n| `FILESYSTEM_STORAGE_PATH` | Base directory path for local file storage | No |\n| `MAILER_SENDER_NAME` | Display name for email sender | No |\n| `MAILER_SENDER_ADDRESS` | Email address for sender | No |\n| `RESEND_API_KEY` | Resend email service API key | No |\n| `JWT_SECRET` | Secret key for HS256 JWT signing and verification | No |\n| `OPENROUTER_API_KEY` | OpenRouter API key for accessing 300+ AI models | No |\n| `OPENAI_API_KEY` | OpenAI API key | No |\n| `ANTHROPIC_API_KEY` | Anthropic API key for Claude models | No |\n| `GEMINI_API_KEY` | Google Gemini API key | No |\n| `GROQ_API_KEY` | Groq API key for LLM inference | No |\n| `POLAR_ACCESS_TOKEN` | Polar payment platform access token | No |\n| `CLERK_SECRET_KEY` | Clerk authentication secret key | No |\n\n### Start the App\n\nStarts Docker services (if a `docker-compose.yml` is present) and launches the application with hot reload:\n\n```bash\noo app:start\n```\n\n### Stop the App\n\nStops all Docker services:\n\n```bash\noo app:stop\n```\n\n### Build the App\n\nCompiles the application for production. Output is written to the `dist` directory:\n\n```bash\noo app:build\n```\n\n---\n\n## Modules\n\nModules are the core organizational unit. Each module lives under `modules/<name>/` and contains its own controllers, services, repositories, entities, migrations, and seeds.\n\n### Why Modules?\n\nA flat codebase quickly becomes hard to navigate and reason about as an application grows. Modules address this by enforcing **vertical slicing**: all code related to a single business domain (e.g. `user`, `order`, `billing`) lives together rather than being scattered across generic `controllers/`, `services/`, and `repositories/` folders.\n\n**Benefits:**\n\n- **Domain isolation** \u2014 changes to one feature cannot accidentally break another; each module is a self-contained unit with explicit boundaries.\n- **Parallel development** \u2014 teams can work on separate modules without stepping on each other's code or creating merge conflicts in shared directories.\n- **Independent deployment** \u2014 a module can be extracted into a standalone service later with minimal refactoring because its code is already co-located.\n- **Simpler onboarding** \u2014 a new developer understands the scope of a feature by exploring a single directory instead of tracing imports across the whole project.\n- **Scoped migrations & seeds** \u2014 database changes stay close to the entities they affect, making rollbacks and reviews straightforward.\n\n**Good practices:**\n\n- Name modules after business domains (`user`, `product`, `payment`), not technical layers (`controllers`, `helpers`).\n- Keep modules small and focused. If a module grows beyond ~10 controllers or services, consider splitting it by sub-domain.\n- Never import from another module's internal files directly \u2014 expose only what is needed through the module's public index.\n- Register all entities in `SharedModule` (done automatically by `oo make:entity`) so the ORM has a single source of truth.\n- Run `oo module:lock` after every migration or seed change to protect file integrity in CI.\n- Prefix route names with the module name (e.g. `api.user.create`) to avoid collisions across modules.\n\n### Create a Module\n\nScaffolds a new module with all required structure, registers it in `AppModule`, adds its entities to `SharedModule`, and updates `tsconfig.json` path aliases and commitlint config:\n\n```bash\noo module:create\noo module:create --name user\n```\n\n### Lock a Module\n\nHashes migration and seed files into a module manifest (`.yml`) for integrity verification. Run this after adding or modifying migrations/seeds:\n\n```bash\noo module:lock --module user\noo module:lock --module user --override # force update existing hashes\n```\n\n### Delete a Module\n\nRemoves a module and cleans up all references from `AppModule`, `SharedModule`, `tsconfig.json`, and commitlint config. The `app` and `shared` core modules cannot be removed:\n\n```bash\noo module:remove\noo module:remove --name user\noo module:remove --name user --silent # skip confirmation prompt\n```\n\n---\n\n## Migrations\n\nMigrations are versioned, incremental SQL scripts that evolve your database schema over time. Each migration lives in `modules/<name>/src/migrations/` and is executed in order, making every schema change reproducible, reviewable, and reversible.\n\n### Why Migrations?\n\nManually altering a database in production is error-prone and leaves no audit trail. Migrations solve this by treating schema changes as code: they are committed to git, reviewed in pull requests, and applied the same way in every environment \u2014 local, staging, and production.\n\n**Benefits:**\n\n- **Reproducibility** \u2014 any developer can recreate the exact database state by running `oo migration:up` from scratch.\n- **History & auditability** \u2014 every schema change is tied to a commit, a date, and an author, making it easy to understand when and why a column or table was added.\n- **Safe deployments** \u2014 CI runs migrations before the application boots, catching schema errors before they reach production.\n- **Rollback capability** \u2014 because changes are incremental and versioned, you can reason about what to undo if a deployment goes wrong.\n- **Team coordination** \u2014 concurrent feature branches each generate their own migration file; the timestamp ordering ensures they are applied in the correct sequence when merged.\n\n**Good practices:**\n\n- One migration per logical change (e.g. add a table, add a column, add an index). Avoid bundling unrelated schema changes in a single file.\n- Never edit a migration that has already been applied in any shared environment \u2014 create a new migration to amend it instead.\n- Always write both `up` and `down` logic so migrations can be rolled back cleanly.\n- Keep migrations idempotent where possible (e.g. `CREATE TABLE IF NOT EXISTS`) to prevent failures on re-runs.\n- Run `oo module:lock` after every new migration to hash the file into the module manifest and enable integrity checks in CI.\n- Test migrations against a real database in CI \u2014 schema errors are invisible to TypeScript's type checker.\n- Avoid putting business logic or data transformations in migrations; keep them strictly structural (DDL) or use a dedicated seed for data.\n\n### Create a Migration\n\nGenerates a timestamped migration file in `modules/<name>/src/migrations/` along with a test file and a `bin/migration/up.ts` runner (if not already present):\n\n```bash\noo migration:create --module user\n```\n\n### Run Migrations\n\nExecutes migrations across all modules sequentially:\n\n```bash\noo migration:up\noo migration:up --drop # drop database before migrating\n```\n\n---\n\n## Seeds\n\nSeeds populate your database with initial or reference data \u2014 default roles, configuration values, demo content, or test fixtures. Each seed lives in `modules/<name>/src/seeds/` as a YAML file and is executed in order via the seed runner.\n\n### Why Seeds?\n\nHardcoding initial data in migration files mixes structural changes with data concerns, making both harder to maintain. Seeds keep data separate from schema, so they can be re-run independently, updated without touching migrations, and disabled in environments where they are not needed.\n\n**Benefits:**\n\n- **Consistent starting state** \u2014 every developer and every environment boots with the same baseline data, eliminating \"works on my machine\" data discrepancies.\n- **Readable data definitions** \u2014 YAML files are easy to read, diff, and review in pull requests without understanding SQL or TypeScript.\n- **Repeatable setup** \u2014 onboarding a new developer or spinning up a fresh staging environment requires only `oo seed:run` instead of manual database operations.\n- **Separation of concerns** \u2014 schema structure (migrations) and data content (seeds) evolve independently, reducing noise in both histories.\n- **Safe resets** \u2014 `oo seed:run --drop` wipes and repopulates data without touching the schema, useful for resetting demo or test environments.\n\n**Good practices:**\n\n- Use seeds for **reference data** (roles, permissions, countries, currencies) and **development fixtures** (demo users, sample products). Avoid using them for production user data.\n- Keep each seed file focused on a single entity or dataset \u2014 one file per table is a reasonable default.\n- Write seeds so they are idempotent: inserting with `ON CONFLICT DO NOTHING` or checking for existence before inserting prevents errors on re-runs.\n- Never depend on data inserted by another module's seed unless you control the execution order explicitly.\n- Run `oo module:lock` after adding or modifying a seed to update the module manifest and protect file integrity in CI.\n- Mirror your migration order: seed data for a table only after the migration that creates it has been applied.\n- Avoid generating seeds with random or time-dependent values \u2014 deterministic data makes debugging and comparison across environments reliable.\n\n### Create a Seed\n\nGenerates a YAML seed file in `modules/<name>/src/seeds/` along with a test file and a `bin/seed/run.ts` runner (if not already present):\n\n```bash\noo seed:create --module user\noo seed:create --name initial-roles --module user\n```\n\n### Run Seeds\n\nExecutes seeds across all modules sequentially:\n\n```bash\noo seed:run\noo seed:run --drop # drop data before seeding\n```\n\n---\n\n## Generators\n\n### AI\n\nGenerates an AI integration class in `modules/<name>/src/ai/<Name>Ai.ts`. Automatically installs `@ooneex/ai`:\n\n```bash\noo make:ai --name Chat --module user\n```\n\n**Why:** Calling LLM APIs directly from controllers or services mixes infrastructure concerns with business logic and makes it hard to swap providers. A dedicated AI class encapsulates the model, prompt strategy, and configuration in one place.\n\n**Benefits:** Provider-agnostic abstraction, centralised prompt management, easy to mock in tests, swap or upgrade models without touching business logic.\n\n**Good practices:**\n- One class per distinct AI capability (e.g. `ChatAi`, `SummarizeAi`, `ModerationAi`) \u2014 avoid a single god class.\n- Keep system prompts and model configuration inside the class, not scattered across callers.\n- Always handle rate-limit and timeout errors gracefully; never let an AI failure crash the request.\n- Log both the prompt and the response at `debug` level to simplify troubleshooting.\n\n---\n\n### Analytics\n\nGenerates an analytics handler class in `modules/<name>/src/analytics/<Name>Analytics.ts`. Automatically installs `@ooneex/analytics`:\n\n```bash\noo make:analytics --name User --module user\n```\n\n**Why:** Sprinkling raw analytics calls (PostHog, Segment, etc.) throughout controllers couples business logic to a third-party SDK. A dedicated analytics class centralises event definitions and makes it trivial to change or disable the provider.\n\n**Benefits:** Single source of truth for event names and properties, easy to stub in tests, provider can be swapped without touching controllers, events are discoverable by name.\n\n**Good practices:**\n- Name events after business actions, not UI interactions (e.g. `user.subscribed`, not `button.clicked`).\n- Define event property shapes as TypeScript types inside the class.\n- Always fire analytics asynchronously \u2014 never `await` a tracking call on the critical path.\n- Keep one analytics class per domain concept so event ownership is clear.\n\n---\n\n### Cache\n\nGenerates a cache handler class in `modules/<name>/src/cache/<Name>Cache.ts`. Automatically installs `@ooneex/cache`:\n\n```bash\noo make:cache --name User --module user\n```\n\n**Why:** Inline cache calls scattered through services create duplicated TTL values, inconsistent key formats, and make it hard to invalidate related entries. A dedicated cache class owns the key scheme and TTL policy for a given domain object.\n\n**Benefits:** Consistent key naming, single place to update TTLs, easy to add cache warming or invalidation logic, simple to disable caching during tests.\n\n**Good practices:**\n- Prefix keys with the module and entity name to avoid collisions (e.g. `user:profile:{id}`).\n- Define TTLs as named constants, not magic numbers.\n- Always invalidate or update the cache when the underlying data changes \u2014 stale reads are harder to debug than cache misses.\n- Use the cache for reads only; never store the primary copy of data in a cache.\n\n---\n\n### Controller\n\nGenerates an HTTP or WebSocket controller registered in the target module. Prompts for route name, path, and HTTP method if not provided. Automatically installs `@ooneex/controller`:\n\n```bash\noo make:controller --name UserCreate --module user\noo make:controller --name UserCreate --module user --route.name api.user.create --route.path /api/users --route.method POST\noo make:controller --name UserSocket --module user --isSocket\n```\n\n**Why:** Controllers are the entry point for all HTTP and WebSocket interactions. Generating them with a consistent structure ensures route registration, validation, and error handling are set up correctly from the start.\n\n**Benefits:** Automatic route registration in the module, consistent request/response patterns, clear separation between routing and business logic, WebSocket support out of the box.\n\n**Good practices:**\n- One controller per HTTP action (e.g. `UserCreateController`, `UserListController`) \u2014 avoid multi-action controllers.\n- Controllers should be thin: validate input, call a service, return a response. No business logic inside.\n- Prefix route names with the module (e.g. `api.user.create`) to avoid cross-module collisions.\n- Use the generated route name constant everywhere instead of hardcoding URL strings.\n\n---\n\n### Cron\n\nGenerates a cron job class in `modules/<name>/src/crons/<Name>Cron.ts` and registers it in the module. Automatically installs `@ooneex/cron`:\n\n```bash\noo make:cron --name Cleanup --module user\n```\n\n**Why:** Ad-hoc scheduled scripts outside the application are fragile, hard to monitor, and disconnected from the codebase. Cron classes live inside the module that owns the task, are registered with the DI container, and benefit from the same logging and error handling as the rest of the application.\n\n**Benefits:** Centralised schedule management, full access to injected services and repositories, observable via the application logger, easy to disable per environment.\n\n**Good practices:**\n- Name cron classes after the task, not the schedule (e.g. `ExpiredTokenCleanupCron`, not `DailyCron`).\n- Keep the cron class small \u2014 delegate actual work to a service method so the logic is testable independently.\n- Always log the start, end, and outcome of each run.\n- Make cron jobs idempotent: running the same job twice should not corrupt data.\n- Disable background jobs in the `testing` environment to keep tests fast and deterministic.\n\n---\n\n### Database\n\nGenerates a database adapter class in `modules/<name>/src/databases/<Name>Database.ts`. Automatically installs `@ooneex/database`:\n\n```bash\noo make:database --name User --module user\n```\n\n**Why:** Direct use of the ORM or raw query builder in services tightly couples business logic to the database layer. A database adapter wraps the connection and query interface, making it straightforward to configure per-module connections, switch drivers, or mock the database in tests.\n\n**Benefits:** Consistent connection configuration per module, single place to add query logging or instrumentation, easier to test services in isolation by injecting a mock adapter.\n\n**Good practices:**\n- Use the database adapter for raw queries or bulk operations that fall outside the repository pattern.\n- Never expose the raw ORM connection object outside the adapter class.\n- Configure connection pool sizes and timeouts in one place inside the adapter.\n- Prefer the repository pattern for standard CRUD; reach for the database adapter only when you need full query control.\n\n---\n\n### Docker\n\nAdds a Docker service to `modules/app/docker-compose.yml`. Creates the file if it does not exist. Available services: `postgres`, `mysql`, `mongodb`, `redis`, `rabbitmq`, `nats`, `elasticsearch`, `clickhouse`, `minio`, `memcached`, `prometheus`, `grafana`, `jaeger`, `keycloak`, `vault`, `temporal`, `libretranslate`, `maildev`, `ooneex-jade`:\n\n```bash\noo make:docker\noo make:docker --name postgres\noo make:docker --name redis\n```\n\n**Why:** Manually writing Docker Compose service definitions is repetitive, error-prone, and inconsistent across projects. The generator adds a pre-configured, production-ready service block so local infrastructure matches what the application expects.\n\n**Benefits:** Consistent port mappings and environment variables across the team, generated health-check and volume definitions, no need to memorise image names or versions.\n\n**Good practices:**\n- Commit `docker-compose.yml` to source control so every developer uses identical service versions.\n- Use named volumes for persistent data (databases) and anonymous volumes for ephemeral services (caches).\n- Never use Docker Compose in production \u2014 it is a local development tool only.\n- Pin image versions (e.g. `postgres:16`) rather than using `latest` to keep environments stable.\n- Add service dependencies (`depends_on`) so the application container only starts after its databases are healthy.\n\n---\n\n### Entity\n\nGenerates a TypeORM entity class in `modules/<name>/src/entities/<Name>Entity.ts` and registers it in `SharedModule`. Automatically installs `@ooneex/entity`:\n\n```bash\noo make:entity --name User --module user\noo make:entity --name User --module user --tableName users\n```\n\n**Why:** Entities are the single source of truth for your database schema. Generating them with consistent decorators and base class inheritance ensures that timestamps, soft deletes, and other cross-cutting concerns are applied uniformly across every table.\n\n**Benefits:** Automatic registration in `SharedModule`, consistent column conventions (snake_case table names, `created_at`/`updated_at` timestamps), TypeScript types aligned with the database schema.\n\n**Good practices:**\n- Always specify the table name explicitly to avoid surprises from TypeORM's pluralisation logic.\n- Keep entities as pure data structures \u2014 no business logic, no service calls inside entity methods.\n- Add database indexes to columns used in frequent `WHERE` or `ORDER BY` clauses.\n- Use enums for columns with a fixed set of values to enforce data integrity at the database level.\n- Create a migration immediately after adding or modifying an entity so schema and code stay in sync.\n\n---\n\n### Logger\n\nGenerates a logger class in `modules/<name>/src/loggers/<Name>Logger.ts`. Automatically installs `@ooneex/logger`:\n\n```bash\noo make:logger --name Audit --module user\n```\n\n**Why:** Using a global logger everywhere produces undifferentiated log output that is hard to filter by feature or severity. A dedicated logger class per domain adds a consistent context (module name, logger name) to every log entry, making logs actionable in production.\n\n**Benefits:** Structured log entries with automatic context tags, easy to route specific loggers to different backends (file, Better Stack, etc.), no need to repeat context strings across every log call.\n\n**Good practices:**\n- Use the `Audit` logger for security-sensitive actions (login, permission changes) and the default app logger for operational events.\n- Always log at the correct level: `debug` for internal state, `info` for significant business events, `warn` for recoverable problems, `error` for failures that need attention.\n- Include relevant IDs (user ID, request ID) in every log entry to enable correlation across services.\n- Never log sensitive data such as passwords, tokens, or payment details.\n\n---\n\n### Mailer\n\nGenerates a mailer class (`<Name>Mailer.ts`) and its JSX template (`<Name>MailerTemplate.tsx`) in `modules/<name>/src/mailers/`. Automatically installs `@ooneex/mailer`:\n\n```bash\noo make:mailer --name Welcome --module user\n```\n\n**Why:** Composing email HTML inline or with raw string templates is brittle and hard to preview. The generator creates a typed mailer class paired with a JSX template, keeping email logic and presentation cleanly separated and type-safe.\n\n**Benefits:** JSX template enables component reuse and design-system consistency across emails, typed mailer class prevents missing required variables, easy to test rendering without sending real emails.\n\n**Good practices:**\n- One mailer per transactional email type (e.g. `WelcomeMailer`, `PasswordResetMailer`).\n- Never send emails synchronously on the request path \u2014 enqueue them via a job or pub/sub event.\n- Always provide a plain-text fallback alongside the HTML template for clients that block images.\n- Test email rendering in multiple clients (Gmail, Outlook, Apple Mail) before deploying \u2014 CSS support varies widely.\n- Use the `testing` environment mailer backend to capture sent emails without delivering them.\n\n---\n\n### Middleware\n\nGenerates an HTTP or WebSocket middleware class registered in the target module. Automatically installs `@ooneex/middleware`:\n\n```bash\noo make:middleware --name Auth --module user\noo make:middleware --name Auth --module user --isSocket\n```\n\n**Why:** Cross-cutting concerns like authentication, CORS, request logging, and input sanitisation should not live inside controllers. Middleware classes intercept requests before they reach a controller, keeping that logic reusable and independently testable.\n\n**Benefits:** Reusable across multiple controllers within the module, auto-registered in the middleware pipeline, full access to injected services via DI, works identically for HTTP and WebSocket routes.\n\n**Good practices:**\n- Keep middleware single-purpose (e.g. `AuthMiddleware` only handles authentication, not rate limiting).\n- Always call `next()` explicitly or return a response \u2014 never leave the pipeline hanging.\n- Order matters: authentication middleware must run before authorisation middleware.\n- Avoid heavy computation in middleware; defer expensive work to the service layer.\n- Write unit tests that verify the middleware passes, blocks, and modifies requests as expected.\n\n---\n\n### Permission\n\nGenerates a permission class in `modules/<name>/src/permissions/<Name>Permission.ts`. Automatically installs `@ooneex/permission`:\n\n```bash\noo make:permission --name User --module user\n```\n\n**Why:** Scattering permission checks across controllers and services leads to inconsistency and makes auditing access control difficult. A dedicated permission class per domain centralises all access rules for that domain in one reviewable place.\n\n**Benefits:** All permissions for a domain are discoverable in a single file, easy to audit who can do what, permissions can be reused across multiple controllers without duplication, changes to access rules require touching only one class.\n\n**Good practices:**\n- Name permissions after the action and resource (e.g. `UserPermission` checks `canCreate`, `canUpdate`, `canDelete`).\n- Always check permissions in middleware or the service layer \u2014 never in the entity or repository.\n- Combine with roles (RBAC) for coarse-grained access and permissions for fine-grained control.\n- Write tests that assert both allowed and denied cases for every permission rule.\n- Never hardcode user IDs or emails inside permission logic; use roles and attributes instead.\n\n---\n\n### PubSub\n\nGenerates a pub/sub event class in `modules/<name>/src/events/<Name>Event.ts` and registers it in the module. Automatically installs `@ooneex/pub-sub`:\n\n```bash\noo make:pubsub --name UserCreated --module user\noo make:pubsub --name UserCreated --module user --channel user-created\n```\n\n**Why:** Direct calls between modules create tight coupling that makes the codebase fragile and hard to extend. Pub/sub events decouple the publisher from the subscriber: the `user` module emits `UserCreated` without knowing or caring which other modules react to it.\n\n**Benefits:** Loose coupling between modules, multiple subscribers can react to the same event independently, easy to add new reactions without modifying the publisher, events are named and typed so their contracts are explicit.\n\n**Good practices:**\n- Name events in the past tense (e.g. `UserCreated`, `OrderShipped`) to make clear they describe something that already happened.\n- Keep event payloads small and serialisable \u2014 include IDs rather than full entity objects where possible.\n- Subscribe in the module that owns the reaction, not in the module that owns the event.\n- Make event handlers idempotent: the same event may be delivered more than once in failure scenarios.\n- Log every event published and consumed to simplify debugging distributed flows.\n\n---\n\n### Repository\n\nGenerates a repository class for data access in `modules/<name>/src/repositories/<Name>Repository.ts`. Automatically installs `@ooneex/repository`:\n\n```bash\noo make:repository --name User --module user\n```\n\n**Why:** Putting database queries directly in services mixes business logic with persistence concerns and makes services impossible to test without a database. The repository pattern isolates all data-access code behind a typed interface that can be mocked in tests.\n\n**Benefits:** Services remain database-agnostic, all queries for an entity are discoverable in one class, easy to swap the underlying ORM or database without touching business logic, clean boundary for unit testing.\n\n**Good practices:**\n- One repository per entity (e.g. `UserRepository` owns all queries against the `users` table).\n- Repositories should only contain query logic \u2014 no business rules, no validation, no event publishing.\n- Use descriptive method names that reflect intent (e.g. `findActiveByEmail`, `findExpiredTokens`) rather than generic `find` with complex filter objects.\n- Return domain objects or plain data \u2014 never expose raw ORM query builders to callers.\n- Add pagination to any method that can return an unbounded number of rows.\n\n---\n\n### Service\n\nGenerates a service class in `modules/<name>/src/services/<Name>Service.ts`. Automatically installs `@ooneex/service`:\n\n```bash\noo make:service --name User --module user\n```\n\n**Why:** Business logic scattered across controllers is impossible to test, reuse, or reason about. Services are the home of all business rules, orchestrating repositories, events, and other services in a single, testable unit.\n\n**Benefits:** Business logic is testable without HTTP, reusable across multiple controllers or cron jobs, dependencies are explicit via constructor injection, easy to mock at the service boundary in integration tests.\n\n**Good practices:**\n- One service per aggregate or major business capability (e.g. `UserService` for user lifecycle, `BillingService` for payment flows).\n- Services should call repositories for data, never query the database directly.\n- Keep services stateless \u2014 all required data should come from method arguments or injected dependencies.\n- Raise typed exceptions (e.g. `UserNotFoundException`) rather than returning `null` or error codes.\n- A service method should do one thing; if a method grows beyond ~20 lines, consider extracting a helper or sub-service.\n\n---\n\n### Storage\n\nGenerates a file storage class in `modules/<name>/src/storage/<Name>Storage.ts`. Automatically installs `@ooneex/storage`:\n\n```bash\noo make:storage --name Avatar --module user\n```\n\n**Why:** Coupling file upload logic directly to a specific provider (S3, Cloudflare R2, local filesystem) makes it painful to change backends and duplicates configuration across the codebase. A storage class abstracts the provider behind a consistent interface scoped to a specific asset type.\n\n**Benefits:** Provider-agnostic uploads and reads, all storage configuration for an asset type in one class, easy to switch between local filesystem (development) and cloud storage (production) via environment variables, consistent file-naming and path conventions.\n\n**Good practices:**\n- Name storage classes after the asset they manage (e.g. `AvatarStorage`, `InvoiceStorage`).\n- Always validate file type and size before passing to the storage class \u2014 never trust client-supplied content types.\n- Generate deterministic, collision-resistant file names (e.g. `{userId}/{uuid}.{ext}`) rather than using the original filename.\n- Never store the full URL in the database \u2014 store only the path or key and derive the URL at read time so it works across environments.\n- Delete orphaned files when the associated entity is deleted to avoid unbounded storage growth.\n\n---\n\n### Vector Database\n\nGenerates a vector database class in `modules/<name>/src/databases/<Name>VectorDatabase.ts`. Automatically installs `@ooneex/rag`:\n\n```bash\noo make:vector-database --name Knowledge --module user\n```\n\n**Why:** Semantic search and Retrieval-Augmented Generation (RAG) require storing and querying high-dimensional embeddings, which relational databases are not designed for. A dedicated vector database class encapsulates the embedding model, index configuration, and similarity-search logic in one place.\n\n**Benefits:** Centralised embedding and retrieval strategy per knowledge domain, easy to swap vector backends (pgvector, Qdrant, etc.), consistent chunking and metadata conventions, decoupled from the LLM layer so both can evolve independently.\n\n**Good practices:**\n- One vector database class per knowledge domain (e.g. `KnowledgeVectorDatabase`, `ProductCatalogVectorDatabase`).\n- Always store the source document ID alongside each embedding so retrieved chunks can be traced back to their origin.\n- Use a consistent chunking strategy (fixed-size or sentence-boundary) within a class \u2014 mixing strategies pollutes the index.\n- Re-index when the embedding model changes; embeddings from different models are not comparable.\n- Cache frequently retrieved embeddings to avoid redundant model calls on hot queries.\n\n---\n\n## Claude\n\nThis project ships with a set of **Claude Code skills** \u2014 pre-built instruction sets that tell Claude exactly how to scaffold, implement, and test each type of artefact in this codebase. Skills eliminate the gap between \"generate the files\" and \"ship working code\": each skill runs the CLI generator, reads the output, completes the implementation, writes tests, and lints \u2014 all in one `/command`.\n\n### Why Skills?\n\nRunning `oo make:service` creates a skeleton. A Claude skill does that *and* completes the business logic, writes a meaningful test suite, applies coding conventions, and formats the result \u2014 turning a 10-step workflow into a single prompt.\n\n**Benefits:**\n- Consistent code quality across every artefact, regardless of who wrote it\n- Conventions (visibility modifiers, naming suffixes, DI patterns) are enforced automatically\n- Tests are generated alongside implementation, not as an afterthought\n- Skills chain together \u2014 `make:controller` automatically triggers `make:service` and `make:pubsub`\n\n### How to Use\n\nOpen Claude Code in the project root and type `/skill-name`. Claude will execute the full workflow described in the skill. You can pass arguments inline:\n\n```\n/make:service --name=UserCreate --module=user\n/make:controller --name=UserCreate --module=user --route.path=/users --route.method=POST\n/commit\n```\n\nIf you omit arguments, Claude will prompt you for the required values.\n\n> **Important:** Always run skills from the project root, not from inside a module directory.\n\n### Available Skills\n\n#### Code Quality\n\n| Skill | Description |\n|---|---|\n| `/optimize` | Enforce naming conventions, remove duplication, improve performance, and restructure tests across a module |\n| `/commit` | Analyze staged changes, group them by module, and create properly scoped conventional commits |\n\n#### Generators\n\n| Skill | Description |\n|---|---|\n| `/make:ai` | Generate an AI integration class with `run` and `runStream` methods, wired to `@ooneex/ai` |\n| `/make:analytics` | Generate an analytics handler class for tracking domain events via `@ooneex/analytics` |\n| `/make:cache` | Generate a cache handler class with key and TTL management via `@ooneex/cache` |\n| `/make:command` | Generate a CLI command class implementing `ICommand` via `@ooneex/cli` |\n| `/make:controller` | Generate an HTTP or WebSocket controller with route type, validation, roles, service, and pub/sub event |\n| `/make:cron` | Generate a cron job class registered in its module via `@ooneex/cron` |\n| `/make:database` | Generate a database adapter class for raw queries via `@ooneex/database` |\n| `/make:entity` | Generate a TypeORM entity class registered in `SharedModule` via `@ooneex/entity` |\n| `/make:logger` | Generate a structured logger class with domain context via `@ooneex/logger` |\n| `/make:mailer` | Generate a mailer class and its JSX email template via `@ooneex/mailer` |\n| `/make:middleware` | Generate an HTTP or WebSocket middleware class registered in the module via `@ooneex/middleware` |\n| `/make:permission` | Generate a permission class centralising access rules for a domain via `@ooneex/permission` |\n| `/make:pubsub` | Generate a pub/sub event class registered in the module via `@ooneex/pub-sub` |\n| `/make:repository` | Generate a repository class for typed data access via `@ooneex/repository` |\n| `/make:service` | Generate a service class implementing `IService` with business logic and tests |\n| `/make:storage` | Generate a file storage class for asset management via `@ooneex/storage` |\n| `/make:vector-database` | Generate a vector database class for semantic search and RAG via `@ooneex/rag` |\n\n#### Database\n\n| Skill | Description |\n|---|---|\n| `/migration:create` | Generate a migration file with `up`/`down` methods, index guidance, and structural tests |\n| `/seed:create` | Generate a seed class and its YAML data file with idempotent insertion logic |\n\n### Coding Conventions Enforced by Skills\n\nAll generator skills automatically apply the conventions defined in `/optimize`:\n\n- **Visibility modifiers** \u2014 every class method and property has explicit `public`, `private`, or `protected`\n- **Naming suffixes** \u2014 types end with `Type`, interfaces start with `I`\n- **Arrow functions** \u2014 used everywhere except class methods\n- **No non-null assertions** \u2014 use default values or optional types instead\n- **Dependency injection** \u2014 constructor injection via `@inject()` from `@ooneex/container`\n- **Code hygiene** \u2014 no unused imports, no dead code, no bare `TODO` comments\n\n---\n\n## Release\n\n```bash\noo make:release\n```\n\nScans every `packages/` and `modules/` directory for unreleased conventional commits and, for each one that has them, performs a full release cycle automatically:\n\n1. **Detects unreleased work** \u2014 finds the last git tag matching `<package-name>@*` and lists all conventional commits that have landed since then in that directory. Packages with no new commits are skipped.\n2. **Bumps the version** in `package.json`:\n - `minor` (e.g. `1.2.0 \u2192 1.3.0`) when any commit is of type `feat`\n - `patch` (e.g. `1.2.0 \u2192 1.2.1`) for all other types (`fix`, `refactor`, `perf`, `docs`, `chore`, \u2026)\n3. **Updates `CHANGELOG.md`** with a dated version section. Commits are grouped into standard Keep-a-Changelog categories and linked to their SHA on the remote:\n\n | Commit type | Changelog category |\n |---|---|\n | `feat` | Added |\n | `fix` | Fixed |\n | `refactor`, `perf`, `style`, `docs`, `build`, `ci`, `chore` | Changed |\n | `revert` | Removed |\n\n4. **Creates a release commit** \u2014 stages `package.json` and `CHANGELOG.md` then commits with the message `chore(release): <name>@<version>`.\n5. **Creates an annotated git tag** \u2014 `<name>@<version>` (e.g. `@acme/user@1.3.0`).\n6. **Prompts to push** \u2014 after all packages are processed, asks whether to push commits and tags to the remote. If confirmed, it also runs `bun install`, commits the updated `bun.lock`, and pushes everything.\n\n> **Note:** This command requires conventional commits (`type(scope): Subject`). Non-conventional commits are silently ignored when building the changelog.\n\n---\n\n## Scripts\n\n| Command | Description |\n|---|---|\n| `bun run fmt` | Format all source files with Biome |\n| `bun run lint` | Lint all modules with Biome and TypeScript |\n| `bun run test` | Run tests across all modules |\n| `bun run commit` | Interactive conventional commit prompt |\n";
6536
+ var README_md_default = "# {{NAME}}\n\nA modular, enterprise-grade backend framework built with TypeScript and Bun, powered by the **@ooneex** ecosystem.\n\n## Prerequisites\n\n- [Bun](https://bun.sh) (latest)\n- [Docker](https://www.docker.com/) & Docker Compose\n\n## Getting Started\n\n### Install Dependencies\n\n```bash\nbun install\n```\n\n### Environment Configuration\n\nCopy the environment template and fill in the required values:\n\n```bash\ncp modules/app/.env.example modules/app/.env\n```\n\n| Variable | Description | Required |\n|---|---|---|\n| `APP_ENV` | Application environment (`local`, `development`, `staging`, `testing`, `production`, \u2026) | Yes |\n| `PORT` | Server port number (default: `3000`) | Yes |\n| `HOST_NAME` | Server hostname (default: `0.0.0.0`) | Yes |\n| `CSRF_SECRET` | Secret key for CSRF token generation and verification | Yes |\n| `LOGS_DATABASE_URL` | Database URL for storing application logs | No |\n| `BETTERSTACK_LOGGER_SOURCE_TOKEN` | Logtail source token for Better Stack logging | No |\n| `BETTERSTACK_EXCEPTION_LOGGER_APPLICATION_TOKEN` | Better Stack token for exception tracking | No |\n| `ANALYTICS_POSTHOG_PROJECT_TOKEN` | PostHog API key for event tracking | No |\n| `CACHE_REDIS_URL` | Redis connection URL for caching | No |\n| `CACHE_UPSTASH_REDIS_REST_URL` | Upstash Redis REST URL for serverless caching | No |\n| `PUBSUB_REDIS_URL` | Redis connection URL for pub/sub messaging | No |\n| `RATE_LIMIT_REDIS_URL` | Redis connection URL for rate limiting | No |\n| `CORS_ORIGINS` | Comma-separated allowed origins or `*` (default: `*`) | No |\n| `CORS_METHODS` | Comma-separated HTTP methods | No |\n| `CORS_HEADERS` | Comma-separated allowed request headers | No |\n| `CORS_CREDENTIALS` | Allow credentials: `true` or `false` | No |\n| `DATABASE_URL` | PostgreSQL connection URL | No |\n| `DATABASE_REDIS_URL` | Redis connection URL for Redis-based database operations | No |\n| `SQLITE_DATABASE_PATH` | SQLite database file path | No |\n| `STORAGE_CLOUDFLARE_ACCESS_KEY` | Cloudflare R2 access key ID | No |\n| `STORAGE_CLOUDFLARE_SECRET_KEY` | Cloudflare R2 secret access key | No |\n| `STORAGE_CLOUDFLARE_ENDPOINT` | Cloudflare R2 endpoint URL | No |\n| `STORAGE_BUNNY_ACCESS_KEY` | BunnyCDN access key | No |\n| `STORAGE_BUNNY_STORAGE_ZONE` | BunnyCDN storage zone name | No |\n| `FILESYSTEM_STORAGE_PATH` | Base directory path for local file storage | No |\n| `MAILER_SENDER_NAME` | Display name for email sender | No |\n| `MAILER_SENDER_ADDRESS` | Email address for sender | No |\n| `RESEND_API_KEY` | Resend email service API key | No |\n| `JWT_SECRET` | Secret key for HS256 JWT signing and verification | No |\n| `OPENROUTER_API_KEY` | OpenRouter API key for accessing 300+ AI models | No |\n| `OPENAI_API_KEY` | OpenAI API key | No |\n| `ANTHROPIC_API_KEY` | Anthropic API key for Claude models | No |\n| `GEMINI_API_KEY` | Google Gemini API key | No |\n| `GROQ_API_KEY` | Groq API key for LLM inference | No |\n| `POLAR_ACCESS_TOKEN` | Polar payment platform access token | No |\n| `CLERK_SECRET_KEY` | Clerk authentication secret key | No |\n\n### Start the App\n\nStarts Docker services (if a `docker-compose.yml` is present) and launches the application with hot reload:\n\n```bash\noo app:start\n```\n\n### Stop the App\n\nStops all Docker services:\n\n```bash\noo app:stop\n```\n\n### Build the App\n\nCompiles the application for production. Output is written to the `dist` directory:\n\n```bash\noo app:build\n```\n\n---\n\n## Modules\n\nModules are the core organizational unit. Each module lives under `modules/<name>/` and contains its own controllers, services, repositories, entities, migrations, and seeds.\n\n### Why Modules?\n\nA flat codebase quickly becomes hard to navigate and reason about as an application grows. Modules address this by enforcing **vertical slicing**: all code related to a single business domain (e.g. `user`, `order`, `billing`) lives together rather than being scattered across generic `controllers/`, `services/`, and `repositories/` folders.\n\n**Benefits:**\n\n- **Domain isolation** \u2014 changes to one feature cannot accidentally break another; each module is a self-contained unit with explicit boundaries.\n- **Parallel development** \u2014 teams can work on separate modules without stepping on each other's code or creating merge conflicts in shared directories.\n- **Independent deployment** \u2014 a module can be extracted into a standalone service later with minimal refactoring because its code is already co-located.\n- **Simpler onboarding** \u2014 a new developer understands the scope of a feature by exploring a single directory instead of tracing imports across the whole project.\n- **Scoped migrations & seeds** \u2014 database changes stay close to the entities they affect, making rollbacks and reviews straightforward.\n\n**Good practices:**\n\n- Name modules after business domains (`user`, `product`, `payment`), not technical layers (`controllers`, `helpers`).\n- Keep modules small and focused. If a module grows beyond ~10 controllers or services, consider splitting it by sub-domain.\n- Never import from another module's internal files directly \u2014 expose only what is needed through the module's public index.\n- Register all entities in `SharedModule` (done automatically by `oo make:entity`) so the ORM has a single source of truth.\n- Run `oo module:lock` after every migration or seed change to protect file integrity in CI.\n- Prefix route names with the module name (e.g. `api.user.create`) to avoid collisions across modules.\n\n### Create a Module\n\nScaffolds a new module with all required structure, registers it in `AppModule`, adds its entities to `SharedModule`, and updates `tsconfig.json` path aliases and commitlint config:\n\n```bash\noo module:create\noo module:create --name user\n```\n\n### Lock a Module\n\nHashes migration and seed files into a module manifest (`.yml`) for integrity verification. Run this after adding or modifying migrations/seeds:\n\n```bash\noo module:lock --module user\noo module:lock --module user --override # force update existing hashes\n```\n\n### Delete a Module\n\nRemoves a module and cleans up all references from `AppModule`, `SharedModule`, `tsconfig.json`, and commitlint config. The `app` and `shared` core modules cannot be removed:\n\n```bash\noo module:remove\noo module:remove --name user\noo module:remove --name user --silent # skip confirmation prompt\n```\n\n---\n\n## Migrations\n\nMigrations are versioned, incremental SQL scripts that evolve your database schema over time. Each migration lives in `modules/<name>/src/migrations/` and is executed in order, making every schema change reproducible, reviewable, and reversible.\n\n### Why Migrations?\n\nManually altering a database in production is error-prone and leaves no audit trail. Migrations solve this by treating schema changes as code: they are committed to git, reviewed in pull requests, and applied the same way in every environment \u2014 local, staging, and production.\n\n**Benefits:**\n\n- **Reproducibility** \u2014 any developer can recreate the exact database state by running `oo migration:up` from scratch.\n- **History & auditability** \u2014 every schema change is tied to a commit, a date, and an author, making it easy to understand when and why a column or table was added.\n- **Safe deployments** \u2014 CI runs migrations before the application boots, catching schema errors before they reach production.\n- **Rollback capability** \u2014 because changes are incremental and versioned, you can reason about what to undo if a deployment goes wrong.\n- **Team coordination** \u2014 concurrent feature branches each generate their own migration file; the timestamp ordering ensures they are applied in the correct sequence when merged.\n\n**Good practices:**\n\n- One migration per logical change (e.g. add a table, add a column, add an index). Avoid bundling unrelated schema changes in a single file.\n- Never edit a migration that has already been applied in any shared environment \u2014 create a new migration to amend it instead.\n- Always write both `up` and `down` logic so migrations can be rolled back cleanly.\n- Keep migrations idempotent where possible (e.g. `CREATE TABLE IF NOT EXISTS`) to prevent failures on re-runs.\n- Run `oo module:lock` after every new migration to hash the file into the module manifest and enable integrity checks in CI.\n- Test migrations against a real database in CI \u2014 schema errors are invisible to TypeScript's type checker.\n- Avoid putting business logic or data transformations in migrations; keep them strictly structural (DDL) or use a dedicated seed for data.\n\n### Create a Migration\n\nGenerates a timestamped migration file in `modules/<name>/src/migrations/` along with a test file and a `bin/migration/up.ts` runner (if not already present):\n\n```bash\noo migration:create --module user\n```\n\n### Run Migrations\n\nExecutes migrations across all modules sequentially:\n\n```bash\noo migration:up\noo migration:up --drop # drop database before migrating\n```\n\n---\n\n## Seeds\n\nSeeds populate your database with initial or reference data \u2014 default roles, configuration values, demo content, or test fixtures. Each seed lives in `modules/<name>/src/seeds/` as a YAML file and is executed in order via the seed runner.\n\n### Why Seeds?\n\nHardcoding initial data in migration files mixes structural changes with data concerns, making both harder to maintain. Seeds keep data separate from schema, so they can be re-run independently, updated without touching migrations, and disabled in environments where they are not needed.\n\n**Benefits:**\n\n- **Consistent starting state** \u2014 every developer and every environment boots with the same baseline data, eliminating \"works on my machine\" data discrepancies.\n- **Readable data definitions** \u2014 YAML files are easy to read, diff, and review in pull requests without understanding SQL or TypeScript.\n- **Repeatable setup** \u2014 onboarding a new developer or spinning up a fresh staging environment requires only `oo seed:run` instead of manual database operations.\n- **Separation of concerns** \u2014 schema structure (migrations) and data content (seeds) evolve independently, reducing noise in both histories.\n- **Safe resets** \u2014 `oo seed:run --drop` wipes and repopulates data without touching the schema, useful for resetting demo or test environments.\n\n**Good practices:**\n\n- Use seeds for **reference data** (roles, permissions, countries, currencies) and **development fixtures** (demo users, sample products). Avoid using them for production user data.\n- Keep each seed file focused on a single entity or dataset \u2014 one file per table is a reasonable default.\n- Write seeds so they are idempotent: inserting with `ON CONFLICT DO NOTHING` or checking for existence before inserting prevents errors on re-runs.\n- Never depend on data inserted by another module's seed unless you control the execution order explicitly.\n- Run `oo module:lock` after adding or modifying a seed to update the module manifest and protect file integrity in CI.\n- Mirror your migration order: seed data for a table only after the migration that creates it has been applied.\n- Avoid generating seeds with random or time-dependent values \u2014 deterministic data makes debugging and comparison across environments reliable.\n\n### Create a Seed\n\nGenerates a YAML seed file in `modules/<name>/src/seeds/` along with a test file and a `bin/seed/run.ts` runner (if not already present):\n\n```bash\noo seed:create --module user\noo seed:create --name initial-roles --module user\n```\n\n### Run Seeds\n\nExecutes seeds across all modules sequentially:\n\n```bash\noo seed:run\noo seed:run --drop # drop data before seeding\n```\n\n---\n\n## Issues\n\nPull Linear issues as local YAML files for offline reference or as input to `/spec:plan`.\n\n### Pull an Issue\n\nFetches a Linear issue by ID and saves it as `issues/<identifier>.yml` (or `modules/<name>/issues/<identifier>.yml` when a module is specified):\n\n```bash\noo issue:pull # Prompt for issue ID\noo issue:pull --id OON-123 # Pull a specific issue by ID\noo issue:pull --id OON-123 --module user # Save into modules/user/issues/\n```\n\n**Requirements:** `LINEAR_API_KEY` must be set in the environment.\n\n**Good practices:**\n- Pass the saved issue YAML to `/spec:plan` to generate spec files from the issue description.\n- Commit issue files alongside the implementation work so there is a local record of the planned scope.\n- Add `LINEAR_API_KEY` to your local `.env` \u2014 never hardcode it in source.\n\n---\n\n## Generators\n\n### AI\n\nGenerates an AI integration class in `modules/<name>/src/ai/<Name>Ai.ts`. Automatically installs `@ooneex/ai`:\n\n```bash\noo make:ai --name Chat --module user\n```\n\n**Why:** Calling LLM APIs directly from controllers or services mixes infrastructure concerns with business logic and makes it hard to swap providers. A dedicated AI class encapsulates the model, prompt strategy, and configuration in one place.\n\n**Benefits:** Provider-agnostic abstraction, centralised prompt management, easy to mock in tests, swap or upgrade models without touching business logic.\n\n**Good practices:**\n- One class per distinct AI capability (e.g. `ChatAi`, `SummarizeAi`, `ModerationAi`) \u2014 avoid a single god class.\n- Keep system prompts and model configuration inside the class, not scattered across callers.\n- Always handle rate-limit and timeout errors gracefully; never let an AI failure crash the request.\n- Log both the prompt and the response at `debug` level to simplify troubleshooting.\n\n---\n\n### Analytics\n\nGenerates an analytics handler class in `modules/<name>/src/analytics/<Name>Analytics.ts`. Automatically installs `@ooneex/analytics`:\n\n```bash\noo make:analytics --name User --module user\n```\n\n**Why:** Sprinkling raw analytics calls (PostHog, Segment, etc.) throughout controllers couples business logic to a third-party SDK. A dedicated analytics class centralises event definitions and makes it trivial to change or disable the provider.\n\n**Benefits:** Single source of truth for event names and properties, easy to stub in tests, provider can be swapped without touching controllers, events are discoverable by name.\n\n**Good practices:**\n- Name events after business actions, not UI interactions (e.g. `user.subscribed`, not `button.clicked`).\n- Define event property shapes as TypeScript types inside the class.\n- Always fire analytics asynchronously \u2014 never `await` a tracking call on the critical path.\n- Keep one analytics class per domain concept so event ownership is clear.\n\n---\n\n### Cache\n\nGenerates a cache handler class in `modules/<name>/src/cache/<Name>Cache.ts`. Automatically installs `@ooneex/cache`:\n\n```bash\noo make:cache --name User --module user\n```\n\n**Why:** Inline cache calls scattered through services create duplicated TTL values, inconsistent key formats, and make it hard to invalidate related entries. A dedicated cache class owns the key scheme and TTL policy for a given domain object.\n\n**Benefits:** Consistent key naming, single place to update TTLs, easy to add cache warming or invalidation logic, simple to disable caching during tests.\n\n**Good practices:**\n- Prefix keys with the module and entity name to avoid collisions (e.g. `user:profile:{id}`).\n- Define TTLs as named constants, not magic numbers.\n- Always invalidate or update the cache when the underlying data changes \u2014 stale reads are harder to debug than cache misses.\n- Use the cache for reads only; never store the primary copy of data in a cache.\n\n---\n\n### Controller\n\nGenerates an HTTP or WebSocket controller registered in the target module. Prompts for route name, path, and HTTP method if not provided. Automatically installs `@ooneex/controller`:\n\n```bash\noo make:controller --name UserCreate --module user\noo make:controller --name UserCreate --module user --route.name api.user.create --route.path /api/users --route.method POST\noo make:controller --name UserSocket --module user --isSocket\n```\n\n**Why:** Controllers are the entry point for all HTTP and WebSocket interactions. Generating them with a consistent structure ensures route registration, validation, and error handling are set up correctly from the start.\n\n**Benefits:** Automatic route registration in the module, consistent request/response patterns, clear separation between routing and business logic, WebSocket support out of the box.\n\n**Good practices:**\n- One controller per HTTP action (e.g. `UserCreateController`, `UserListController`) \u2014 avoid multi-action controllers.\n- Controllers should be thin: validate input, call a service, return a response. No business logic inside.\n- Prefix route names with the module (e.g. `api.user.create`) to avoid cross-module collisions.\n- Use the generated route name constant everywhere instead of hardcoding URL strings.\n\n---\n\n### Cron\n\nGenerates a cron job class in `modules/<name>/src/crons/<Name>Cron.ts` and registers it in the module. Automatically installs `@ooneex/cron`:\n\n```bash\noo make:cron --name Cleanup --module user\n```\n\n**Why:** Ad-hoc scheduled scripts outside the application are fragile, hard to monitor, and disconnected from the codebase. Cron classes live inside the module that owns the task, are registered with the DI container, and benefit from the same logging and error handling as the rest of the application.\n\n**Benefits:** Centralised schedule management, full access to injected services and repositories, observable via the application logger, easy to disable per environment.\n\n**Good practices:**\n- Name cron classes after the task, not the schedule (e.g. `ExpiredTokenCleanupCron`, not `DailyCron`).\n- Keep the cron class small \u2014 delegate actual work to a service method so the logic is testable independently.\n- Always log the start, end, and outcome of each run.\n- Make cron jobs idempotent: running the same job twice should not corrupt data.\n- Disable background jobs in the `testing` environment to keep tests fast and deterministic.\n\n---\n\n### Database\n\nGenerates a database adapter class in `modules/<name>/src/databases/<Name>Database.ts`. Automatically installs `@ooneex/database`:\n\n```bash\noo make:database --name User --module user\n```\n\n**Why:** Direct use of the ORM or raw query builder in services tightly couples business logic to the database layer. A database adapter wraps the connection and query interface, making it straightforward to configure per-module connections, switch drivers, or mock the database in tests.\n\n**Benefits:** Consistent connection configuration per module, single place to add query logging or instrumentation, easier to test services in isolation by injecting a mock adapter.\n\n**Good practices:**\n- Use the database adapter for raw queries or bulk operations that fall outside the repository pattern.\n- Never expose the raw ORM connection object outside the adapter class.\n- Configure connection pool sizes and timeouts in one place inside the adapter.\n- Prefer the repository pattern for standard CRUD; reach for the database adapter only when you need full query control.\n\n---\n\n### Docker\n\nAdds a Docker service to `modules/app/docker-compose.yml`. Creates the file if it does not exist. Available services: `postgres`, `mysql`, `mongodb`, `redis`, `rabbitmq`, `nats`, `elasticsearch`, `clickhouse`, `minio`, `memcached`, `prometheus`, `grafana`, `jaeger`, `keycloak`, `vault`, `temporal`, `libretranslate`, `maildev`, `ooneex-jade`:\n\n```bash\noo make:docker\noo make:docker --name postgres\noo make:docker --name redis\n```\n\n**Why:** Manually writing Docker Compose service definitions is repetitive, error-prone, and inconsistent across projects. The generator adds a pre-configured, production-ready service block so local infrastructure matches what the application expects.\n\n**Benefits:** Consistent port mappings and environment variables across the team, generated health-check and volume definitions, no need to memorise image names or versions.\n\n**Good practices:**\n- Commit `docker-compose.yml` to source control so every developer uses identical service versions.\n- Use named volumes for persistent data (databases) and anonymous volumes for ephemeral services (caches).\n- Never use Docker Compose in production \u2014 it is a local development tool only.\n- Pin image versions (e.g. `postgres:16`) rather than using `latest` to keep environments stable.\n- Add service dependencies (`depends_on`) so the application container only starts after its databases are healthy.\n\n---\n\n### Entity\n\nGenerates a TypeORM entity class in `modules/<name>/src/entities/<Name>Entity.ts` and registers it in `SharedModule`. Automatically installs `@ooneex/entity`:\n\n```bash\noo make:entity --name User --module user\noo make:entity --name User --module user --tableName users\n```\n\n**Why:** Entities are the single source of truth for your database schema. Generating them with consistent decorators and base class inheritance ensures that timestamps, soft deletes, and other cross-cutting concerns are applied uniformly across every table.\n\n**Benefits:** Automatic registration in `SharedModule`, consistent column conventions (snake_case table names, `created_at`/`updated_at` timestamps), TypeScript types aligned with the database schema.\n\n**Good practices:**\n- Always specify the table name explicitly to avoid surprises from TypeORM's pluralisation logic.\n- Keep entities as pure data structures \u2014 no business logic, no service calls inside entity methods.\n- Add database indexes to columns used in frequent `WHERE` or `ORDER BY` clauses.\n- Use enums for columns with a fixed set of values to enforce data integrity at the database level.\n- Create a migration immediately after adding or modifying an entity so schema and code stay in sync.\n\n---\n\n### Logger\n\nGenerates a logger class in `modules/<name>/src/loggers/<Name>Logger.ts`. Automatically installs `@ooneex/logger`:\n\n```bash\noo make:logger --name Audit --module user\n```\n\n**Why:** Using a global logger everywhere produces undifferentiated log output that is hard to filter by feature or severity. A dedicated logger class per domain adds a consistent context (module name, logger name) to every log entry, making logs actionable in production.\n\n**Benefits:** Structured log entries with automatic context tags, easy to route specific loggers to different backends (file, Better Stack, etc.), no need to repeat context strings across every log call.\n\n**Good practices:**\n- Use the `Audit` logger for security-sensitive actions (login, permission changes) and the default app logger for operational events.\n- Always log at the correct level: `debug` for internal state, `info` for significant business events, `warn` for recoverable problems, `error` for failures that need attention.\n- Include relevant IDs (user ID, request ID) in every log entry to enable correlation across services.\n- Never log sensitive data such as passwords, tokens, or payment details.\n\n---\n\n### Mailer\n\nGenerates a mailer class (`<Name>Mailer.ts`) and its JSX template (`<Name>MailerTemplate.tsx`) in `modules/<name>/src/mailers/`. Automatically installs `@ooneex/mailer`:\n\n```bash\noo make:mailer --name Welcome --module user\n```\n\n**Why:** Composing email HTML inline or with raw string templates is brittle and hard to preview. The generator creates a typed mailer class paired with a JSX template, keeping email logic and presentation cleanly separated and type-safe.\n\n**Benefits:** JSX template enables component reuse and design-system consistency across emails, typed mailer class prevents missing required variables, easy to test rendering without sending real emails.\n\n**Good practices:**\n- One mailer per transactional email type (e.g. `WelcomeMailer`, `PasswordResetMailer`).\n- Never send emails synchronously on the request path \u2014 enqueue them via a job or pub/sub event.\n- Always provide a plain-text fallback alongside the HTML template for clients that block images.\n- Test email rendering in multiple clients (Gmail, Outlook, Apple Mail) before deploying \u2014 CSS support varies widely.\n- Use the `testing` environment mailer backend to capture sent emails without delivering them.\n\n---\n\n### Middleware\n\nGenerates an HTTP or WebSocket middleware class registered in the target module. Automatically installs `@ooneex/middleware`:\n\n```bash\noo make:middleware --name Auth --module user\noo make:middleware --name Auth --module user --isSocket\n```\n\n**Why:** Cross-cutting concerns like authentication, CORS, request logging, and input sanitisation should not live inside controllers. Middleware classes intercept requests before they reach a controller, keeping that logic reusable and independently testable.\n\n**Benefits:** Reusable across multiple controllers within the module, auto-registered in the middleware pipeline, full access to injected services via DI, works identically for HTTP and WebSocket routes.\n\n**Good practices:**\n- Keep middleware single-purpose (e.g. `AuthMiddleware` only handles authentication, not rate limiting).\n- Always call `next()` explicitly or return a response \u2014 never leave the pipeline hanging.\n- Order matters: authentication middleware must run before authorisation middleware.\n- Avoid heavy computation in middleware; defer expensive work to the service layer.\n- Write unit tests that verify the middleware passes, blocks, and modifies requests as expected.\n\n---\n\n### Permission\n\nGenerates a permission class in `modules/<name>/src/permissions/<Name>Permission.ts`. Automatically installs `@ooneex/permission`:\n\n```bash\noo make:permission --name User --module user\n```\n\n**Why:** Scattering permission checks across controllers and services leads to inconsistency and makes auditing access control difficult. A dedicated permission class per domain centralises all access rules for that domain in one reviewable place.\n\n**Benefits:** All permissions for a domain are discoverable in a single file, easy to audit who can do what, permissions can be reused across multiple controllers without duplication, changes to access rules require touching only one class.\n\n**Good practices:**\n- Name permissions after the action and resource (e.g. `UserPermission` checks `canCreate`, `canUpdate`, `canDelete`).\n- Always check permissions in middleware or the service layer \u2014 never in the entity or repository.\n- Combine with roles (RBAC) for coarse-grained access and permissions for fine-grained control.\n- Write tests that assert both allowed and denied cases for every permission rule.\n- Never hardcode user IDs or emails inside permission logic; use roles and attributes instead.\n\n---\n\n### PubSub\n\nGenerates a pub/sub event class in `modules/<name>/src/events/<Name>Event.ts` and registers it in the module. Automatically installs `@ooneex/pub-sub`:\n\n```bash\noo make:pubsub --name UserCreated --module user\noo make:pubsub --name UserCreated --module user --channel user-created\n```\n\n**Why:** Direct calls between modules create tight coupling that makes the codebase fragile and hard to extend. Pub/sub events decouple the publisher from the subscriber: the `user` module emits `UserCreated` without knowing or caring which other modules react to it.\n\n**Benefits:** Loose coupling between modules, multiple subscribers can react to the same event independently, easy to add new reactions without modifying the publisher, events are named and typed so their contracts are explicit.\n\n**Good practices:**\n- Name events in the past tense (e.g. `UserCreated`, `OrderShipped`) to make clear they describe something that already happened.\n- Keep event payloads small and serialisable \u2014 include IDs rather than full entity objects where possible.\n- Subscribe in the module that owns the reaction, not in the module that owns the event.\n- Make event handlers idempotent: the same event may be delivered more than once in failure scenarios.\n- Log every event published and consumed to simplify debugging distributed flows.\n\n---\n\n### Repository\n\nGenerates a repository class for data access in `modules/<name>/src/repositories/<Name>Repository.ts`. Automatically installs `@ooneex/repository`:\n\n```bash\noo make:repository --name User --module user\n```\n\n**Why:** Putting database queries directly in services mixes business logic with persistence concerns and makes services impossible to test without a database. The repository pattern isolates all data-access code behind a typed interface that can be mocked in tests.\n\n**Benefits:** Services remain database-agnostic, all queries for an entity are discoverable in one class, easy to swap the underlying ORM or database without touching business logic, clean boundary for unit testing.\n\n**Good practices:**\n- One repository per entity (e.g. `UserRepository` owns all queries against the `users` table).\n- Repositories should only contain query logic \u2014 no business rules, no validation, no event publishing.\n- Use descriptive method names that reflect intent (e.g. `findActiveByEmail`, `findExpiredTokens`) rather than generic `find` with complex filter objects.\n- Return domain objects or plain data \u2014 never expose raw ORM query builders to callers.\n- Add pagination to any method that can return an unbounded number of rows.\n\n---\n\n### Service\n\nGenerates a service class in `modules/<name>/src/services/<Name>Service.ts`. Automatically installs `@ooneex/service`:\n\n```bash\noo make:service --name User --module user\n```\n\n**Why:** Business logic scattered across controllers is impossible to test, reuse, or reason about. Services are the home of all business rules, orchestrating repositories, events, and other services in a single, testable unit.\n\n**Benefits:** Business logic is testable without HTTP, reusable across multiple controllers or cron jobs, dependencies are explicit via constructor injection, easy to mock at the service boundary in integration tests.\n\n**Good practices:**\n- One service per aggregate or major business capability (e.g. `UserService` for user lifecycle, `BillingService` for payment flows).\n- Services should call repositories for data, never query the database directly.\n- Keep services stateless \u2014 all required data should come from method arguments or injected dependencies.\n- Raise typed exceptions (e.g. `UserNotFoundException`) rather than returning `null` or error codes.\n- A service method should do one thing; if a method grows beyond ~20 lines, consider extracting a helper or sub-service.\n\n---\n\n### Storage\n\nGenerates a file storage class in `modules/<name>/src/storage/<Name>Storage.ts`. Automatically installs `@ooneex/storage`:\n\n```bash\noo make:storage --name Avatar --module user\n```\n\n**Why:** Coupling file upload logic directly to a specific provider (S3, Cloudflare R2, local filesystem) makes it painful to change backends and duplicates configuration across the codebase. A storage class abstracts the provider behind a consistent interface scoped to a specific asset type.\n\n**Benefits:** Provider-agnostic uploads and reads, all storage configuration for an asset type in one class, easy to switch between local filesystem (development) and cloud storage (production) via environment variables, consistent file-naming and path conventions.\n\n**Good practices:**\n- Name storage classes after the asset they manage (e.g. `AvatarStorage`, `InvoiceStorage`).\n- Always validate file type and size before passing to the storage class \u2014 never trust client-supplied content types.\n- Generate deterministic, collision-resistant file names (e.g. `{userId}/{uuid}.{ext}`) rather than using the original filename.\n- Never store the full URL in the database \u2014 store only the path or key and derive the URL at read time so it works across environments.\n- Delete orphaned files when the associated entity is deleted to avoid unbounded storage growth.\n\n---\n\n### Vector Database\n\nGenerates a vector database class in `modules/<name>/src/databases/<Name>VectorDatabase.ts`. Automatically installs `@ooneex/rag`:\n\n```bash\noo make:vector-database --name Knowledge --module user\n```\n\n**Why:** Semantic search and Retrieval-Augmented Generation (RAG) require storing and querying high-dimensional embeddings, which relational databases are not designed for. A dedicated vector database class encapsulates the embedding model, index configuration, and similarity-search logic in one place.\n\n**Benefits:** Centralised embedding and retrieval strategy per knowledge domain, easy to swap vector backends (pgvector, Qdrant, etc.), consistent chunking and metadata conventions, decoupled from the LLM layer so both can evolve independently.\n\n**Good practices:**\n- One vector database class per knowledge domain (e.g. `KnowledgeVectorDatabase`, `ProductCatalogVectorDatabase`).\n- Always store the source document ID alongside each embedding so retrieved chunks can be traced back to their origin.\n- Use a consistent chunking strategy (fixed-size or sentence-boundary) within a class \u2014 mixing strategies pollutes the index.\n- Re-index when the embedding model changes; embeddings from different models are not comparable.\n- Cache frequently retrieved embeddings to avoid redundant model calls on hot queries.\n\n---\n\n## Claude\n\nThis project ships with a set of **Claude Code skills** \u2014 pre-built instruction sets that tell Claude exactly how to scaffold, implement, and test each type of artefact in this codebase. Skills eliminate the gap between \"generate the files\" and \"ship working code\": each skill runs the CLI generator, reads the output, completes the implementation, writes tests, and lints \u2014 all in one `/command`.\n\n### Why Skills?\n\nRunning `oo make:service` creates a skeleton. A Claude skill does that *and* completes the business logic, writes a meaningful test suite, applies coding conventions, and formats the result \u2014 turning a 10-step workflow into a single prompt.\n\n**Benefits:**\n- Consistent code quality across every artefact, regardless of who wrote it\n- Conventions (visibility modifiers, naming suffixes, DI patterns) are enforced automatically\n- Tests are generated alongside implementation, not as an afterthought\n- Skills chain together \u2014 `make:controller` automatically triggers `make:service` and `make:pubsub`\n\n### How to Use\n\nOpen Claude Code in the project root and type `/skill-name`. Claude will execute the full workflow described in the skill. You can pass arguments inline:\n\n```\n/make:service --name=UserCreate --module=user\n/make:controller --name=UserCreate --module=user --route.path=/users --route.method=POST\n/commit\n```\n\nIf you omit arguments, Claude will prompt you for the required values.\n\n> **Important:** Always run skills from the project root, not from inside a module directory.\n\n### Available Skills\n\n#### Code Quality\n\n| Skill | Description |\n|---|---|\n| `/optimize` | Enforce naming conventions, remove duplication, improve performance, and restructure tests across a module |\n| `/commit` | Analyze staged changes, group them by module, and create properly scoped conventional commits |\n\n#### Generators\n\n| Skill | Description |\n|---|---|\n| `/make:ai` | Generate an AI integration class with `run` and `runStream` methods, wired to `@ooneex/ai` |\n| `/make:analytics` | Generate an analytics handler class for tracking domain events via `@ooneex/analytics` |\n| `/make:cache` | Generate a cache handler class with key and TTL management via `@ooneex/cache` |\n| `/make:command` | Generate a CLI command class implementing `ICommand` via `@ooneex/cli` |\n| `/make:controller` | Generate an HTTP or WebSocket controller with route type, validation, roles, service, and pub/sub event |\n| `/make:cron` | Generate a cron job class registered in its module via `@ooneex/cron` |\n| `/make:database` | Generate a database adapter class for raw queries via `@ooneex/database` |\n| `/make:entity` | Generate a TypeORM entity class registered in `SharedModule` via `@ooneex/entity` |\n| `/make:logger` | Generate a structured logger class with domain context via `@ooneex/logger` |\n| `/make:mailer` | Generate a mailer class and its JSX email template via `@ooneex/mailer` |\n| `/make:middleware` | Generate an HTTP or WebSocket middleware class registered in the module via `@ooneex/middleware` |\n| `/make:permission` | Generate a permission class centralising access rules for a domain via `@ooneex/permission` |\n| `/make:pubsub` | Generate a pub/sub event class registered in the module via `@ooneex/pub-sub` |\n| `/make:repository` | Generate a repository class for typed data access via `@ooneex/repository` |\n| `/make:service` | Generate a service class implementing `IService` with business logic and tests |\n| `/make:storage` | Generate a file storage class for asset management via `@ooneex/storage` |\n| `/make:vector-database` | Generate a vector database class for semantic search and RAG via `@ooneex/rag` |\n\n#### Database\n\n| Skill | Description |\n|---|---|\n| `/migration:create` | Generate a migration file with `up`/`down` methods, index guidance, and structural tests |\n| `/seed:create` | Generate a seed class and its YAML data file with idempotent insertion logic |\n\n#### Spec\n\n| Skill | Description |\n|---|---|\n| `/spec:plan` | Parse user-provided content and produce one `specs/<spec-name>.spec.yml` file per entity/action pair |\n| `/spec:implement` | Read a single spec YML entry and implement entity, repository, service, controller/command, and optional resources |\n\n### Coding Conventions Enforced by Skills\n\nAll generator skills automatically apply the conventions defined in `/optimize`:\n\n- **Visibility modifiers** \u2014 every class method and property has explicit `public`, `private`, or `protected`\n- **Naming suffixes** \u2014 types end with `Type`, interfaces start with `I`\n- **Arrow functions** \u2014 used everywhere except class methods\n- **No non-null assertions** \u2014 use default values or optional types instead\n- **Dependency injection** \u2014 constructor injection via `@inject()` from `@ooneex/container`\n- **Code hygiene** \u2014 no unused imports, no dead code, no bare `TODO` comments\n\n---\n\n## Release\n\n```bash\noo make:release\n```\n\nScans every `packages/` and `modules/` directory for unreleased conventional commits and, for each one that has them, performs a full release cycle automatically:\n\n1. **Detects unreleased work** \u2014 finds the last git tag matching `<package-name>@*` and lists all conventional commits that have landed since then in that directory. Packages with no new commits are skipped.\n2. **Bumps the version** in `package.json`:\n - `minor` (e.g. `1.2.0 \u2192 1.3.0`) when any commit is of type `feat`\n - `patch` (e.g. `1.2.0 \u2192 1.2.1`) for all other types (`fix`, `refactor`, `perf`, `docs`, `chore`, \u2026)\n3. **Updates `CHANGELOG.md`** with a dated version section. Commits are grouped into standard Keep-a-Changelog categories and linked to their SHA on the remote:\n\n | Commit type | Changelog category |\n |---|---|\n | `feat` | Added |\n | `fix` | Fixed |\n | `refactor`, `perf`, `style`, `docs`, `build`, `ci`, `chore` | Changed |\n | `revert` | Removed |\n\n4. **Creates a release commit** \u2014 stages `package.json` and `CHANGELOG.md` then commits with the message `chore(release): <name>@<version>`.\n5. **Creates an annotated git tag** \u2014 `<name>@<version>` (e.g. `@acme/user@1.3.0`).\n6. **Prompts to push** \u2014 after all packages are processed, asks whether to push commits and tags to the remote. If confirmed, it also runs `bun install`, commits the updated `bun.lock`, and pushes everything.\n\n> **Note:** This command requires conventional commits (`type(scope): Subject`). Non-conventional commits are silently ignored when building the changelog.\n\n---\n\n## Scripts\n\n| Command | Description |\n|---|---|\n| `bun run fmt` | Format all source files with Biome |\n| `bun run lint` | Lint all modules with Biome and TypeScript |\n| `bun run test` | Run tests across all modules |\n| `bun run commit` | Interactive conventional commit prompt |\n";
6537
6537
 
6538
6538
  // src/templates/app/tsconfig.json.txt
6539
6539
  var tsconfig_json_default = `{
@@ -6708,6 +6708,9 @@ oo app:build # Compile for production (output: dist/)
6708
6708
  oo module:create --name <name> # Scaffold a new module
6709
6709
  oo module:lock --module <name> # Hash migrations/seeds into manifest
6710
6710
  oo module:remove --name <name> # Remove a module and all references
6711
+ oo issue:pull # Pull a Linear issue and save as YAML
6712
+ oo issue:pull --id <id> # Pull a specific issue by ID
6713
+ oo issue:pull --id <id> --module <name> # Save issue into a module's issues/ directory
6711
6714
  oo make:ai --name <Name> --module <name> # AI integration class
6712
6715
  oo make:analytics --name <Name> --module <name> # Analytics handler class
6713
6716
  oo make:cache --name <Name> --module <name> # Cache handler class
@@ -6881,8 +6884,8 @@ This project ships with Claude Code skills that scaffold, implement, and test ar
6881
6884
 
6882
6885
  | Skill | Description |
6883
6886
  |---|---|
6884
- | \`/spec:plan\` | Parse user-provided text and add one or more specs (entity, roles, permissions) to the module YML file |
6885
- | \`/spec:implement\` | Read all specs from the module YML file and implement each one: entity, migration, repository, service, controller/command, seeds, and optional resources |
6887
+ | \`/spec:plan\` | Parse user-provided content and produce one \`specs/<spec-name>.spec.yml\` file per entity/action pair |
6888
+ | \`/spec:implement\` | Read a single spec YML entry and implement entity, repository, service, controller/command, and optional resources |
6886
6889
 
6887
6890
  ### Coding Conventions Enforced by Skills
6888
6891
 
@@ -9967,83 +9970,244 @@ Apply all coding conventions from the \`optimize\` skill.
9967
9970
  `;
9968
9971
 
9969
9972
  // src/templates/claude/skills/spec.implement.md.txt
9970
- var spec_implement_md_default = '---\nname: spec:implement\ndescription: Implement all specs from a module YML file. Use when executing the planned specs for a module, creating or updating entities, migrations, repositories, services, controllers/commands, seeds, and optional resources.\n---\n\n# Spec Implement\n\nRead the module YML file and implement every spec entry found inside it.\n\n## Steps\n\n### 1. Locate and read the module YML file\n\nFind and read `modules/<module>/<module>.yml`.\n\nIf no `spec:` section exists or the file is missing, stop and ask the user to run `/spec:plan` first.\n\n### 2. Analyse the specs\n\nFor each spec entry, extract:\n\n- `name` \u2014 dot-notation identifier (e.g. `"user.create"`)\n- `entity` \u2014 the resource being acted on (e.g. `"user"`)\n- `description` \u2014 what the spec does\n- `roles` \u2014 list of roles with access\n- `permissions` \u2014 list of permission strings in `"entity:action"` format\n\nDerive the PascalCase name from `entity` (e.g. `"user"` \u2192 `"User"`, `"blog_post"` \u2192 `"BlogPost"`).\n\nDerive the HTTP method from the action part of `name`:\n- `.create` \u2192 `post`\n- `.read` / `.list` / `.search` \u2192 `get`\n- `.update` \u2192 `put` or `patch`\n- `.delete` \u2192 `delete`\n\nDetermine whether a controller (HTTP) or command (CLI) is needed from the spec context. Default to controller unless the spec explicitly implies a CLI operation.\n\n### 3. Create or update the entity\n\nFor each unique `entity` across all specs, run:\n\n```\n/make:entity --name=<PascalEntity> --module=<module>\n```\n\nAdd or update columns to reflect the data implied by the spec descriptions.\n\n### 4. Create or update migrations\n\nFor each entity created or modified in step 3, run:\n\n```\n/migration:create --module=<module>\n```\n\nImplement `up()` with the table/column changes derived from the entity and `down()` with the reverse operations.\n\n### 5. Create or update the repository\n\nFor each unique entity, run:\n\n```\n/make:repository --name=<PascalEntity> --module=<module>\n```\n\nRetain only the CRUD methods that are needed by the specs (e.g. if no `.list` spec exists, remove `find`; if no `.delete` spec exists, remove `delete`).\n\n### 6. Create or update the service\n\nFor each spec entry, run:\n\n```\n/make:service --name=<PascalSpec> --module=<module>\n```\n\nWhere `<PascalSpec>` is derived from the spec `name` (e.g. `"user.create"` \u2192 `"UserCreate"`).\n\nInject the repository into the service via the constructor and implement `execute()` with the business logic described by the spec.\n\n### 7. Create or update the controller or command\n\n**Controller** (default \u2014 HTTP endpoint):\n\n```\n/make:controller --name=<PascalSpec> --module=<module> --route-name=<spec.name> --route-path=<derived-path> --route-method=<derived-method>\n```\n\nDerive the route path from the entity and action (e.g. `"user.create"` \u2192 `/users`, `"user.read"` \u2192 `/users/:id`).\n\nInject the service into the controller. Set `roles` in the `@Route` decorator from `spec.roles` mapped to `ERole` values. Apply the `permissions` from the spec to the route decorator when a `permissions` field is available on `@Route`.\n\n**Command** (CLI operation):\n\n```\n/make:command --name=<PascalSpec> --module=<module>\n```\n\nInject the service into the command. Set `getName()` to `"<entity>:<action>"` format.\n\n### 8. Create or update seeds\n\nIf the module YML file has a `seeds:` section, or if the spec implies initial data (e.g. `role.seed`, `permission.seed`, `*.seed`), run:\n\n```\n/seed:create --name=<PascalEntity> --module=<module>\n```\n\nPopulate `modules/<module>/src/seeds/<name-seed>.yml` with realistic sample data using nanoid values for IDs.\n\n### 9. Create or update optional resources\n\nInspect the spec descriptions and entity context. Apply each applicable skill:\n\n| Resource | Trigger condition | Skill |\n|-----------------|----------------------------------------------------------------|------------------------|\n| `permission` | Spec has `roles` or `permissions` defined | `/make:permission` |\n| `middleware` | Spec implies auth, rate-limiting, or request transformation | `/make:middleware` |\n| `cache` | Spec implies read-heavy or list endpoints | `/make:cache` |\n| `pubsub` | Spec mutates state (`post`, `put`, `patch`, `delete` routes) | `/make:pubsub` |\n| `mailer` | Spec description mentions email, notification, or invitation | `/make:mailer` |\n| `logger` | Spec description mentions audit, log, or traceability | `/make:logger` |\n| `analytics` | Spec description mentions tracking, metrics, or reporting | `/make:analytics` |\n| `storage` | Spec description mentions file, upload, or attachment | `/make:storage` |\n| `cron` | Spec description mentions scheduled, periodic, or background | `/make:cron` |\n| `ai` | Spec description mentions AI, embedding, or generation | `/make:ai` |\n| `database` | Spec implies a new database connection or datasource | `/make:database` |\n| `vector-database` | Spec description mentions vector search or similarity | `/make:vector-database` |\n\n### 10. Lint and format\n\n```bash\nbun run fmt\nbun run lint\n```\n\n### 11. Confirm\n\nReport:\n\n- Module name and YML file path\n- Specs implemented (list each `name`)\n- Resources created or updated per spec (entity, migration, repository, service, controller/command, seed)\n- Optional resources created (if any)\n- Any spec that was skipped and why\n\n## Notes\n\n- If a resource already exists, update it rather than overwrite it \u2014 add new methods, columns, or routes without removing existing ones unless they conflict.\n- Derive all names, paths, and methods from the spec entries; never ask the user for values that can be inferred.\n- Apply all coding conventions from the `optimize` skill to every generated file.\n';
9973
+ var spec_implement_md_default = `---
9974
+ name: spec:implement
9975
+ description: Implement a single spec from a YML entry. Use when executing a planned spec, creating or updating an entity, repository, service, controller/command, and optional resources.
9976
+ ---
9977
+
9978
+ # Spec Implement
9979
+
9980
+ Use the single spec YML entry provided by the user and implement it.
9981
+
9982
+ ## Steps
9983
+
9984
+ ### 1. Read the spec YML
9985
+
9986
+ Use the YML content provided by the user. Do not search for or locate a file on your own.
9987
+
9988
+ If no YML content was provided, stop and ask the user to supply the spec YML or run \`/spec:plan\` first.
9989
+
9990
+ A spec YML looks like:
9991
+
9992
+ \`\`\`yaml
9993
+ name: "organization.create"
9994
+ entity: "organization"
9995
+ description: "Admin creates a new organization"
9996
+ fields:
9997
+ name: ""
9998
+ type: "b2b|school|internal"
9999
+ roles:
10000
+ - super_admin
10001
+ - admin
10002
+ permissions:
10003
+ - name: "organization:create"
10004
+ description: ""
10005
+ \`\`\`
10006
+
10007
+ ### 2. Analyse the spec
10008
+
10009
+ Extract:
10010
+
10011
+ - \`name\` \u2014 dot-notation identifier (e.g. \`"user.create"\`)
10012
+ - \`entity\` \u2014 the resource being acted on (e.g. \`"user"\`)
10013
+ - \`description\` \u2014 what the spec does
10014
+ - \`fields\` \u2014 map of field names to default values or pipe-separated enum variants
10015
+ - \`roles\` \u2014 list of roles with access
10016
+ - \`permissions\` \u2014 list of objects with \`name\` (\`"entity:action"\` format) and optional \`description\`
10017
+
10018
+ Derive the PascalCase name from \`entity\` (e.g. \`"user"\` \u2192 \`"User"\`, \`"blog_post"\` \u2192 \`"BlogPost"\`).
10019
+
10020
+ Derive \`<PascalSpec>\` from \`name\` (e.g. \`"user.create"\` \u2192 \`"UserCreate"\`).
10021
+
10022
+ Derive the HTTP method from the action part of \`name\`:
10023
+ - \`.create\` \u2192 \`post\`
10024
+ - \`.read\` / \`.list\` / \`.search\` \u2192 \`get\`
10025
+ - \`.update\` \u2192 \`put\` or \`patch\`
10026
+ - \`.delete\` \u2192 \`delete\`
10027
+
10028
+ Determine whether a controller (HTTP) or command (CLI) is needed from the spec context. Default to controller unless the spec explicitly implies a CLI operation.
10029
+
10030
+ ### 3. Create or update the entity
10031
+
10032
+ \`\`\`
10033
+ /make:entity --name=<PascalEntity> --module=<module>
10034
+ \`\`\`
10035
+
10036
+ Map each key in \`fields\` to a typed column:
10037
+ - A pipe-separated value (e.g. \`"b2b|school|internal"\`) \u2192 enum column with those variants.
10038
+ - An empty string \u2192 \`string\` column.
10039
+ - A numeric value \u2192 \`number\` column.
10040
+ - A boolean value \u2192 \`boolean\` column.
10041
+
10042
+ ### 4. Create or update the repository
10043
+
10044
+ \`\`\`
10045
+ /make:repository --name=<PascalEntity> --module=<module>
10046
+ \`\`\`
10047
+
10048
+ Retain only the CRUD methods that are needed by this spec (e.g. \`.create\` spec needs \`save\`; \`.read\` needs \`findById\`; \`.list\` needs \`find\`; \`.delete\` needs \`delete\`).
10049
+
10050
+ ### 5. Create or update the service
10051
+
10052
+ \`\`\`
10053
+ /make:service --name=<PascalSpec> --module=<module>
10054
+ \`\`\`
10055
+
10056
+ Inject the repository into the service via the constructor and implement \`execute()\` with the business logic described by the spec.
10057
+
10058
+ ### 6. Create or update the controller or command
10059
+
10060
+ **Controller** (default \u2014 HTTP endpoint):
10061
+
10062
+ \`\`\`
10063
+ /make:controller --name=<PascalSpec> --module=<module> --route-name=<spec.name> --route-path=<derived-path> --route-method=<derived-method>
10064
+ \`\`\`
10065
+
10066
+ Derive the route path from the entity and action (e.g. \`"user.create"\` \u2192 \`/users\`, \`"user.read"\` \u2192 \`/users/:id\`).
10067
+
10068
+ Inject the service into the controller. Set \`roles\` in the \`@Route\` decorator from \`spec.roles\` mapped to \`ERole\` values. Apply each permission \`name\` from \`spec.permissions\` to the route decorator when a \`permissions\` field is available on \`@Route\`.
10069
+
10070
+ **Command** (CLI operation):
10071
+
10072
+ \`\`\`
10073
+ /make:command --name=<PascalSpec> --module=<module>
10074
+ \`\`\`
10075
+
10076
+ Inject the service into the command. Set \`getName()\` to \`"<entity>:<action>"\` format.
10077
+
10078
+ ### 7. Create or update optional resources
10079
+
10080
+ Inspect the spec description, fields, and entity context. Apply each applicable skill:
10081
+
10082
+ | Resource | Trigger condition | Skill |
10083
+ |-------------------|----------------------------------------------------------------|-------------------------|
10084
+ | \`permission\` | Spec has \`roles\` or \`permissions\` defined | \`/make:permission\` |
10085
+ | \`middleware\` | Spec implies auth, rate-limiting, or request transformation | \`/make:middleware\` |
10086
+ | \`cache\` | Spec implies read-heavy or list endpoints | \`/make:cache\` |
10087
+ | \`pubsub\` | Spec mutates state (\`post\`, \`put\`, \`patch\`, \`delete\` routes) | \`/make:pubsub\` |
10088
+ | \`mailer\` | Spec description mentions email, notification, or invitation | \`/make:mailer\` |
10089
+ | \`logger\` | Spec description mentions audit, log, or traceability | \`/make:logger\` |
10090
+ | \`analytics\` | Spec description mentions tracking, metrics, or reporting | \`/make:analytics\` |
10091
+ | \`storage\` | Spec description mentions file, upload, or attachment | \`/make:storage\` |
10092
+ | \`cron\` | Spec description mentions scheduled, periodic, or background | \`/make:cron\` |
10093
+ | \`ai\` | Spec description mentions AI, embedding, or generation | \`/make:ai\` |
10094
+ | \`database\` | Spec implies a new database connection or datasource | \`/make:database\` |
10095
+ | \`vector-database\` | Spec description mentions vector search or similarity | \`/make:vector-database\` |
10096
+
10097
+ ### 8. Lint and format
10098
+
10099
+ \`\`\`bash
10100
+ bun run fmt
10101
+ bun run lint
10102
+ \`\`\`
10103
+
10104
+ ### 9. Confirm
10105
+
10106
+ Report:
10107
+
10108
+ - Spec \`name\` implemented
10109
+ - Resources created or updated (entity, repository, service, controller/command)
10110
+ - Optional resources created (if any)
10111
+ - Any step that was skipped and why
10112
+
10113
+ ## Notes
10114
+
10115
+ - If a resource already exists, update it rather than overwrite it \u2014 add new methods, columns, or routes without removing existing ones unless they conflict.
10116
+ - Derive all names, paths, and methods from the spec; never ask the user for values that can be inferred.
10117
+ - Apply all coding conventions from the \`optimize\` skill to every generated file.
10118
+ `;
9971
10119
 
9972
10120
  // src/templates/claude/skills/spec.plan.md.txt
9973
10121
  var spec_plan_md_default = `---
9974
10122
  name: spec:plan
9975
- description: Add one or more specs to the module YML file from user-provided text. Use when planning module specifications for permissions, roles, and entities.
10123
+ description: Analyse user-provided content and produce one spec YML file per operation under specs/. Use before /spec:implement to plan entities, CRUD actions, roles, and permissions.
9976
10124
  ---
9977
10125
 
9978
10126
  # Spec Plan
9979
10127
 
9980
- Parse the user-provided text and add one or more specs to the module YML file.
10128
+ Read the user-provided content (feature description, requirements, user stories, or raw notes) and produce one \`specs/<spec-name>.spec.yml\` file per operation.
9981
10129
 
9982
10130
  ## Steps
9983
10131
 
9984
- ### 1. Locate the module YML file
10132
+ ### 1. Read the user content
9985
10133
 
9986
- Find the module YML file at \`modules/<module>/<module>.yml\`.
10134
+ Use only the content provided by the user in the current message. Do not search files or infer context from the repository.
9987
10135
 
9988
- ### 2. Parse the user input
10136
+ If no content was provided, stop and ask the user to describe the feature, entity, or workflow they want to plan.
9989
10137
 
9990
- Extract spec entries from the user-provided text. Each spec must have:
10138
+ ### 2. Identify entities and operations
9991
10139
 
9992
- - \`name\`: dot-notation identifier, e.g. \`"entity.action"\`
9993
- - \`entity\`: the resource being acted on, e.g. \`"user"\`
9994
- - \`description\`: short description of what the spec allows (may be empty string)
9995
- - \`roles\`: list of roles that apply, e.g. \`super_admin\`, \`admin\`, \`user\`
9996
- - \`permissions\`: list of permission strings in \`"entity:action"\` format
10140
+ Extract every distinct entity mentioned or implied. For each entity determine which CRUD operations are required:
9997
10141
 
9998
- ### 3. Read the current YML file
10142
+ | Action keyword in content | Spec action suffix |
10143
+ |---------------------------------------|--------------------|
10144
+ | create, add, register, submit, invite | \`.create\` |
10145
+ | get, fetch, view, read, show, detail | \`.read\` |
10146
+ | list, search, browse, filter, query | \`.list\` |
10147
+ | update, edit, modify, change, patch | \`.update\` |
10148
+ | delete, remove, archive, deactivate | \`.delete\` |
9999
10149
 
10000
- Read \`modules/<module>/<module>.yml\` to get the current content.
10150
+ Produce one spec per \`<entity>.<action>\` pair.
10001
10151
 
10002
- ### 4. Update the YML file
10152
+ ### 3. Build each spec
10003
10153
 
10004
- - If the file has a commented-out \`spec:\` block, replace it with the uncommented spec.
10005
- - If a \`spec:\` section already exists, append the new entries under it.
10006
- - Preserve \`migrations:\` and \`seeds:\` sections if present.
10007
- - Use 2-space indentation for the YAML.
10154
+ For each spec, populate the following fields:
10008
10155
 
10009
- **Spec format:**
10156
+ **\`name\`** \u2014 dot-notation identifier: \`"<entity>.<action>"\` (snake_case entity, e.g. \`"blog_post.create"\`).
10010
10157
 
10011
- \`\`\`yaml
10012
- spec:
10013
- - name: "entity.action"
10014
- entity: "entity"
10015
- description: ""
10016
- roles:
10017
- - super_admin
10018
- permissions:
10019
- - "entity:action"
10020
- \`\`\`
10158
+ **\`entity\`** \u2014 the resource name in snake_case (e.g. \`"blog_post"\`).
10159
+
10160
+ **\`description\`** \u2014 one sentence describing what the operation does, derived from the user content.
10161
+
10162
+ **\`fields\`** \u2014 map of field names to their default value or pipe-separated enum variants:
10163
+ - Free text / unknown type \u2192 \`""\`
10164
+ - Numeric \u2192 \`0\`
10165
+ - Boolean \u2192 \`false\`
10166
+ - Enum choices \u2192 \`"choice_a|choice_b|choice_c"\`
10167
+ - Omit fields that are not relevant to this specific action (e.g. no \`password\` field on a \`.read\` spec).
10021
10168
 
10022
- **Full file example after update:**
10169
+ **\`roles\`** \u2014 list of role identifiers that may perform this operation. Derive from the user content; default to \`["user"]\` when not specified.
10170
+
10171
+ **\`permissions\`** \u2014 list of objects with:
10172
+ - \`name\`: \`"<entity>:<action>"\` format (e.g. \`"blog_post:create"\`)
10173
+ - \`description\`: short sentence (may be empty string when obvious)
10174
+
10175
+ ### 4. Write spec files
10176
+
10177
+ For each spec, create the file \`specs/<spec-name>.spec.yml\` where \`<spec-name>\` equals the \`name\` field with dots replaced by hyphens (e.g. \`specs/blog-post-create.spec.yml\`).
10178
+
10179
+ Write one YAML block per file using the structure below. Do **not** combine multiple specs into a single file.
10023
10180
 
10024
10181
  \`\`\`yaml
10025
- name: user
10026
- spec:
10027
- - name: "user.create"
10028
- entity: "user"
10029
- description: "Create a new user account"
10030
- roles:
10031
- - super_admin
10032
- permissions:
10033
- - "user:create"
10034
- - name: "user.read"
10035
- entity: "user"
10036
- description: "Read user details"
10037
- roles:
10038
- - super_admin
10039
- - admin
10040
- permissions:
10041
- - "user:read"
10182
+ name: "<entity>.<action>"
10183
+ entity: "<entity>"
10184
+ description: "<one-sentence description>"
10185
+ fields:
10186
+ <field_name>: <description>
10187
+ roles:
10188
+ - <role>
10189
+ permissions:
10190
+ - name: "<entity>:<action>"
10191
+ description: "<optional description>"
10042
10192
  \`\`\`
10043
10193
 
10194
+ Create the \`specs/\` directory if it does not exist.
10195
+
10044
10196
  ### 5. Confirm
10045
10197
 
10046
- Report the module name, the file path updated, and the list of spec names added.
10198
+ After all files are written, report:
10199
+
10200
+ - Total number of specs created
10201
+ - List of file paths written (one per line)
10202
+ - Any entity or action that was ambiguous and how it was resolved
10203
+
10204
+ ## Notes
10205
+
10206
+ - One file per spec \u2014 never merge multiple specs into one file.
10207
+ - Derive everything from the user content; never ask for values that can be inferred.
10208
+ - Keep \`fields\` minimal and action-appropriate: a \`.delete\` spec typically has no fields; a \`.list\` spec may have filter fields only.
10209
+ - If the user content implies a CLI operation rather than an HTTP endpoint, add \`kind: command\` at the top level of the spec.
10210
+ - Specs are consumed by \`/spec:implement\` \u2014 keep field names and values precise so that skill can infer types without ambiguity.
10047
10211
  `;
10048
10212
 
10049
10213
  // src/commands/ClaudeSkillCreateCommand.ts
@@ -10253,14 +10417,6 @@ var tsconfig_default = `{
10253
10417
 
10254
10418
  // src/templates/module/yml.txt
10255
10419
  var yml_default = `name: {{name}}
10256
- # spec:
10257
- # - name: "user.create"
10258
- # entity: "user"
10259
- # description: "Create a new user account"
10260
- # roles:
10261
- # - super_admin
10262
- # permissions:
10263
- # - "user:create"
10264
10420
  `;
10265
10421
 
10266
10422
  // src/commands/ModuleCreateCommand.ts
@@ -10787,7 +10943,7 @@ _oo() {
10787
10943
  'help:Show available commands'
10788
10944
  'make\\:ai:Generate a new AI class'
10789
10945
  'make\\:analytics:Generate a new analytics class'
10790
- 'make\\:app:Generate a new application'
10946
+ 'app\\:create:Generate a new application'
10791
10947
  'make\\:cache:Generate a new cache class'
10792
10948
  'claude\\:skill\\:create:Generate Claude skills from templates'
10793
10949
  'make\\:command:Generate a new command class'
@@ -10799,11 +10955,11 @@ _oo() {
10799
10955
  'make\\:logger:Generate a new logger class'
10800
10956
  'make\\:mailer:Generate a new mailer class'
10801
10957
  'make\\:middleware:Generate a new middleware class'
10802
- 'make\\:migration:Generate a new migration file'
10958
+ 'migration\\:create:Generate a new migration file'
10803
10959
  'migration\\:up:Run migrations for all modules'
10804
- 'make\\:module:Generate a new module'
10960
+ 'module\\:create:Generate a new module'
10805
10961
  'module\\:lock:Lock module migrations by hashing their content into a yml file'
10806
- 'remove\\:module:Remove an existing module'
10962
+ 'module\\:remove:Remove an existing module'
10807
10963
  'make\\:permission:Generate a new permission class'
10808
10964
  'make\\:pubsub:Generate a new PubSub event class'
10809
10965
  'make\\:release:Release packages with version bump, changelog, and git tag'
@@ -10823,7 +10979,7 @@ _oo() {
10823
10979
  'make\\:resource\\:user:Generate user resource (entity, migration, repository)'
10824
10980
  'make\\:resource\\:video:Generate video resource (entity, migration, repository)'
10825
10981
  'issue\\:pull:Pull an issue from Linear and save it as a YAML file'
10826
- 'make\\:seed:Generate a new seed file'
10982
+ 'seed\\:create:Generate a new seed file'
10827
10983
  'seed\\:run:Run seeds for all modules'
10828
10984
  'make\\:service:Generate a new service class'
10829
10985
  'make\\:storage:Generate a new storage class'
@@ -10909,7 +11065,7 @@ _oo() {
10909
11065
  '--name=[Name of the resource]:name' \\
10910
11066
  '--destination=[Destination path]:destination:_files -/'
10911
11067
  ;;
10912
- make:ai|make:analytics|make:cache|make:command|make:cron|make:database|make:logger|make:mailer|make:permission|make:repository|make:service|make:storage|make:vector:database)
11068
+ make:ai|make:analytics|make:cache|make:command|make:cron|make:database|make:logger|make:mailer|make:permission|make:repository|make:service|make:storage|make:vector-database)
10913
11069
  _arguments -s \\
10914
11070
  '--name=[Name of the resource]:name' \\
10915
11071
  '--module=[Module name]:module:_oo_modules'
@@ -10964,7 +11120,7 @@ _ooneex() {
10964
11120
  'help:Show available commands'
10965
11121
  'make\\:ai:Generate a new AI class'
10966
11122
  'make\\:analytics:Generate a new analytics class'
10967
- 'make\\:app:Generate a new application'
11123
+ 'app\\:create:Generate a new application'
10968
11124
  'make\\:cache:Generate a new cache class'
10969
11125
  'claude\\:skill\\:create:Generate Claude skills from templates'
10970
11126
  'make\\:command:Generate a new command class'
@@ -10976,11 +11132,11 @@ _ooneex() {
10976
11132
  'make\\:logger:Generate a new logger class'
10977
11133
  'make\\:mailer:Generate a new mailer class'
10978
11134
  'make\\:middleware:Generate a new middleware class'
10979
- 'make\\:migration:Generate a new migration file'
11135
+ 'migration\\:create:Generate a new migration file'
10980
11136
  'migration\\:up:Run migrations for all modules'
10981
- 'make\\:module:Generate a new module'
11137
+ 'module\\:create:Generate a new module'
10982
11138
  'module\\:lock:Lock module migrations by hashing their content into a yml file'
10983
- 'remove\\:module:Remove an existing module'
11139
+ 'module\\:remove:Remove an existing module'
10984
11140
  'make\\:permission:Generate a new permission class'
10985
11141
  'make\\:pubsub:Generate a new PubSub event class'
10986
11142
  'make\\:release:Release packages with version bump, changelog, and git tag'
@@ -11000,7 +11156,7 @@ _ooneex() {
11000
11156
  'make\\:resource\\:user:Generate user resource (entity, migration, repository)'
11001
11157
  'make\\:resource\\:video:Generate video resource (entity, migration, repository)'
11002
11158
  'issue\\:pull:Pull an issue from Linear and save it as a YAML file'
11003
- 'make\\:seed:Generate a new seed file'
11159
+ 'seed\\:create:Generate a new seed file'
11004
11160
  'seed\\:run:Run seeds for all modules'
11005
11161
  'make\\:service:Generate a new service class'
11006
11162
  'make\\:storage:Generate a new storage class'
@@ -11086,7 +11242,7 @@ _ooneex() {
11086
11242
  '--name=[Name of the resource]:name' \\
11087
11243
  '--destination=[Destination path]:destination:_files -/'
11088
11244
  ;;
11089
- make:ai|make:analytics|make:cache|make:command|make:cron|make:database|make:logger|make:mailer|make:permission|make:repository|make:service|make:storage|make:vector:database)
11245
+ make:ai|make:analytics|make:cache|make:command|make:cron|make:database|make:logger|make:mailer|make:permission|make:repository|make:service|make:storage|make:vector-database)
11090
11246
  _arguments -s \\
11091
11247
  '--name=[Name of the resource]:name' \\
11092
11248
  '--module=[Module name]:module:_ooneex_modules'
@@ -11179,7 +11335,6 @@ HelpCommand = __legacyDecorateClassTS([
11179
11335
  ], HelpCommand);
11180
11336
  // src/commands/IssuePullCommand.ts
11181
11337
  import { join as join11 } from "path";
11182
- import { decorator as decorator11 } from "@ooneex/command";
11183
11338
 
11184
11339
  // ../../node_modules/.bun/@inversifyjs+common@1.5.2/node_modules/@inversifyjs/common/lib/esm/index.js
11185
11340
  function e(e2) {
@@ -14056,6 +14211,9 @@ var Environment;
14056
14211
  Environment2["PRODUCTION"] = "production";
14057
14212
  })(Environment ||= {});
14058
14213
 
14214
+ // src/commands/IssuePullCommand.ts
14215
+ import { decorator as decorator11 } from "@ooneex/command";
14216
+
14059
14217
  // ../../node_modules/.bun/@linear+sdk@84.0.0+618aff23f8790294/node_modules/@linear/sdk/dist/chunk-DPPnyiuk.mjs
14060
14218
  var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
14061
14219
 
@@ -93759,73 +93917,16 @@ IssuePullCommand = __legacyDecorateClassTS([
93759
93917
  var q3 = (v2) => v2 == null ? "null" : JSON.stringify(v2);
93760
93918
  var issueToYaml = (issue) => {
93761
93919
  const lines = [];
93762
- if (issue.id !== undefined)
93763
- lines.push(`id: ${q3(issue.id)}`);
93764
93920
  if (issue.identifier !== undefined)
93765
93921
  lines.push(`identifier: ${q3(issue.identifier)}`);
93766
93922
  if (issue.title !== undefined)
93767
93923
  lines.push(`title: ${q3(issue.title)}`);
93768
93924
  if (issue.description !== undefined)
93769
93925
  lines.push(`description: ${q3(issue.description)}`);
93770
- if (issue.priority !== undefined)
93771
- lines.push(`priority: ${issue.priority}`);
93772
- if (issue.url !== undefined)
93773
- lines.push(`url: ${q3(issue.url)}`);
93774
- if (issue.createdAt !== undefined)
93775
- lines.push(`createdAt: ${issue.createdAt.toISOString()}`);
93776
- if (issue.updatedAt !== undefined)
93777
- lines.push(`updatedAt: ${issue.updatedAt.toISOString()}`);
93778
- if (issue.team) {
93779
- lines.push("team:");
93780
- lines.push(` id: ${q3(issue.team.id)}`);
93781
- lines.push(` name: ${q3(issue.team.name)}`);
93782
- lines.push(` key: ${q3(issue.team.key)}`);
93783
- }
93784
- if (issue.state) {
93785
- lines.push("state:");
93786
- lines.push(` id: ${q3(issue.state.id)}`);
93787
- lines.push(` name: ${q3(issue.state.name)}`);
93788
- lines.push(` color: ${q3(issue.state.color)}`);
93789
- if (issue.state.type !== undefined)
93790
- lines.push(` type: ${q3(issue.state.type)}`);
93791
- }
93792
- if (issue.assignee) {
93793
- lines.push("assignee:");
93794
- lines.push(` id: ${q3(issue.assignee.id)}`);
93795
- lines.push(` name: ${q3(issue.assignee.name)}`);
93796
- lines.push(` email: ${q3(issue.assignee.email)}`);
93797
- lines.push(` displayName: ${q3(issue.assignee.displayName)}`);
93798
- }
93799
- if (issue.project) {
93800
- lines.push("project:");
93801
- lines.push(` id: ${q3(issue.project.id)}`);
93802
- lines.push(` name: ${q3(issue.project.name)}`);
93803
- if (issue.project.description !== undefined)
93804
- lines.push(` description: ${q3(issue.project.description)}`);
93805
- lines.push(` url: ${q3(issue.project.url)}`);
93806
- }
93807
- if (issue.labels && issue.labels.length > 0) {
93808
- lines.push("labels:");
93809
- for (const label of issue.labels) {
93810
- lines.push(` - id: ${q3(label.id)}`);
93811
- lines.push(` name: ${q3(label.name)}`);
93812
- if (label.color !== undefined)
93813
- lines.push(` color: ${q3(label.color)}`);
93814
- }
93815
- }
93816
93926
  if (issue.comments && issue.comments.length > 0) {
93817
93927
  lines.push("comments:");
93818
93928
  for (const comment of issue.comments) {
93819
- lines.push(` - id: ${q3(comment.id)}`);
93820
- lines.push(` createdAt: ${comment.createdAt.toISOString()}`);
93821
- lines.push(` body: ${q3(comment.body)}`);
93822
- if (comment.user) {
93823
- lines.push(" user:");
93824
- lines.push(` id: ${q3(comment.user.id)}`);
93825
- lines.push(` name: ${q3(comment.user.name)}`);
93826
- lines.push(` email: ${q3(comment.user.email)}`);
93827
- lines.push(` displayName: ${q3(comment.user.displayName)}`);
93828
- }
93929
+ lines.push(` - body: ${q3(comment.body)}`);
93829
93930
  }
93830
93931
  }
93831
93932
  return `${lines.join(`
@@ -108532,4 +108633,4 @@ SeedRunCommand = __legacyDecorateClassTS([
108532
108633
  // src/index.ts
108533
108634
  await run();
108534
108635
 
108535
- //# debugId=A7E6BE87D41B9A3E64756E2164756E21
108636
+ //# debugId=7FD9E57E31842BBE64756E2164756E21