Files
yunyingk 4b75132b43 feat(agents): add .agents modular rules with manual trigger (keep .agents, omit .agent) (#80)
- Match seal-use repository layout with .agents/rules and skills.json
- Ensure no .agent singular directory or symlink exists
- Set trigger: 'manual' on all rules to prevent automatic prompt injection
- Track .agents/ in git by updating .gitignore
2026-09-17 10:20:10 +08:00

1.5 KiB

description, globs, trigger
description globs trigger
TypeScript and ESM coding conventions for hose-use codebase src/**/*.ts manual

TypeScript & ESM Conventions

When modifying or adding TypeScript files in src/:

  1. Module System & Import Extensions:

    • Use ES modules exclusively ("type": "module" in package.json).
    • Local file imports MUST include explicit .js extensions (e.g. import { getGlobalDb } from "../db/connection.js").
    • Do NOT omit the .js extension, or runtime Node/Bun ESM resolution will fail.
  2. Validation & Typing:

    • Validate external inputs, environment variables, and external HTTP/JSON responses using Zod schemas or strictly typed models.
    • Avoid any. Prefer precise domain types defined in src/domains/*/types.ts or src/types.ts.
    • Never suppress type errors with // @ts-ignore; resolve type discrepancies cleanly.
  3. Code Style & Formatting:

    • 2-space indentation.
    • Double quotes (").
    • camelCase for functions and variables, PascalCase for classes, types, and interfaces.
    • Kebab-case filenames (e.g. query-options.ts, task-service.ts).
  4. Architecture & Separation of Concerns:

    • src/core/: Database (SQLite), HTTP client factory, encryption, global configuration, logger.
    • src/domains/: Domain services, models, and business logic (e.g. bill, corps, task, workflow, key-center).
    • src/cli/: Command-line definitions, option parsing, user feedback, table rendering, exit handling.
    • Keep domain services independent of CLI formatting.