TypeScript Production Starter Template
A comprehensive development workflow for building production-ready TypeScript applications with automated quality checks, conventional commits, and strict coding standards.
What This Skill Does
This skill configures Aider to enforce production-level TypeScript development practices including:
Strict TypeScript mode with no `any` typesAutomated linting and formattingConventional commit messagesComprehensive error handlingTest-driven development patternsSecurity best practicesPerformance optimization guidelinesInstructions
Model Configuration
Use GPT-4 Turbo for primary coding tasks and GPT-3.5 Turbo for quick edits and refactoring. Use whole file edit format for clarity.
Git Integration
1. **Auto-commit all changes** with conventional commit format
2. **Commit message format:** `<type>(<scope>): <subject>`
- Types: feat, fix, docs, style, refactor, perf, test, chore
- Keep subject under 50 characters
- Use imperative mood (add, not added)
- No period at end
3. **Attribute co-authors** in commits
File Handling
**Exclude from context:**
node_modules, dist, build, coverage, .pnpm-store, .git*.log, *.lock, .env, .env.***Read-only files (context only):**
LICENSE, package-lock.json, pnpm-lock.yaml, bun.lockbCode Standards
**TypeScript Requirements:**
Use strict mode - all code must type checkNo `any` types - use `unknown` with type guardsExplicit return types for all exported functionsPrefer async/await over raw promisesFollow AAA pattern for tests (Arrange, Act, Assert)**Naming Conventions:**
Files: kebab-case (user-service.ts)Functions/Variables: camelCase (getUserById)Classes/Types: PascalCase (UserService)Constants: UPPER_SNAKE_CASE (MAX_RETRY_COUNT)Test files: *.test.ts**File Organization:**
```
src/
├── index.ts # main entry point
├── types/ # TypeScript type definitions
├── utils/ # utility functions
├── services/ # business logic
└── config/ # configuration
tests/ # test files
```
**Import Order:**
1. External packages (node_modules)
2. Internal modules (relative imports)
3. Type imports
4. Constants and config
**Error Handling:**
Use custom error classes for domain errorsAlways handle errors in async code with try-catchProvide meaningful error messages with contextNever swallow errors silently**Testing:**
Write tests for all new functionalityUse descriptive test names: "should do X when Y"Mock external dependenciesAim for 80%+ coverage on critical paths**Security:**
Never hardcode secrets or API keysValidate all external inputUse parameterized queries for databasesKeep dependencies updated**Documentation:**
Add JSDoc comments for public APIsInclude @param, @returns, @throws tagsProvide usage examplesKeep README.md updated**Performance:**
Use Promise.all() for parallel async operationsImplement caching where appropriateUse streaming for large data setsConsider memory usage for large datasetsPre-Commit Workflow
Before committing, automatically run:
1. `pnpm run typecheck` - Ensure no type errors
2. `pnpm run lint:fix` - Auto-fix linting issues
3. `pnpm run test` - Run test suite (manual trigger)
Linting & Testing
**Auto-lint:** Enabled - runs `pnpm run lint:fix` after changes**Auto-test:** Disabled by default (run manually: `pnpm run test`)**Show diffs:** Enabled after editsAI Behavior
Use whole message format for clarityStream AI responses for faster feedbackCache prompts to speed up similar requestsProvide 1024 tokens of repository map contextMaximum 4096 tokens of chat history300 second timeout with 3 retriesExample Usage
**Adding a new feature:**
```
/add src/services/user-service.ts
Create a new getUserById function with proper error handling and tests
```
**Refactoring code:**
```
/add src/utils/validation.ts
Refactor validation logic to remove duplicate code and add JSDoc comments
```
**Fixing a bug:**
```
/add src/api/user-endpoint.ts
Fix null pointer exception when user is not found
```
All changes will be automatically linted, type-checked, and committed with conventional commit messages.
Constraints
All code must pass TypeScript strict mode checksNo `any` types allowed - use proper type definitionsAll exported functions must have explicit return typesAll changes must pass linting before commitCommit messages must follow conventional commits formatNo hardcoded secrets or credentialsExternal input must be validatedTest coverage required for new functionalityNotes
Configuration uses `pnpm` as package manager (adjust commands if using npm/yarn)MCP servers available: filesystem, fetch, github, database, search, memory, puppeteerAnalytics disabled for privacyDark mode enabled for terminal outputVim configured as default editor for commit messages