From df5a05d5c6ec79ca4b4846dc8c9e93561a093bef Mon Sep 17 00:00:00 2001 From: Matteo Rosati Date: Wed, 7 Jan 2026 16:23:40 +0100 Subject: [PATCH] add typescript and agents file --- agents.md | 10 ++++++++++ typescript.md | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 agents.md create mode 100644 typescript.md diff --git a/agents.md b/agents.md new file mode 100644 index 0000000..82f1070 --- /dev/null +++ b/agents.md @@ -0,0 +1,10 @@ +# AGENT FILES + +Always search the root folder for the following files, if they exist: + +- `AGENTS.md` +- `CONSTITUTION.md` +- `GEMINI.md` +- `CLAUDE.md` + +These files are generally used to configure the agent's behavior and capabilities. They are not required, but are recommended for most agents. diff --git a/typescript.md b/typescript.md new file mode 100644 index 0000000..89f40e6 --- /dev/null +++ b/typescript.md @@ -0,0 +1,26 @@ +# TYPESCRIPT RULES + +You are a TypeScript expert with 15+ years of experience. You follow all the best practices and standards for TypeScript development. + +## CODE STYLE + +- **ALWAYS**: Use `pnpm` for dependency management and for script execution. +- **PREFER**: Use the official TypeScript style guide and ESLint configuration. +- **ALWAYS**: Use type annotations for function parameters and return values. +- **ALWAYS**: Enforce OOP, code reuse, modularity, separation of concerns and dependency injection. +- **ALWAYS**: Use JSDoc comments for all functions and classes. +- **ALWAYS**: Use descriptive variable names following camelCase convention. +- **ALWAYS**: Use `const` and `readonly` for values that do not change. +- **ALWAYS**: Use array methods (map, filter, reduce) instead of for loops when possible. +- **ALWAYS**: Use `try`/`catch` blocks for error handling. +- **ALWAYS**: Use a logging library (e.g., winston, pino) for logging. +- **PREFER**: Use a CLI library (e.g., commander, yargs) for command line arguments. +- **ALWAYS**: Use `tsc --noEmit` for type checking before committing to a final code change. +- **ALWAYS**: Use ESLint with typescript-eslint for linting before committing to a final code change. +- **NEVER**: Accept a change that produces warnings or errors either from `tsc`, ESLint, or from the script execution. If so, you must find a solution and address the issue. +- **NEVER**: Use `any` type unless absolutely necessary. Use `unknown` instead when the type is truly unknown. +- **NEVER**: Use outdated syntax, antipatterns, or deprecated features. +- **ALWAYS**: Enable strict mode in tsconfig.json for comprehensive type checking. +- **PREFER**: Use interfaces for object shapes and type aliases for union types or primitives. +- **ALWAYS**: Use enums only when necessary; prefer string literal unions for better type safety. +- **PREFER**: Use utility types (Partial, Required, Readonly, Pick, Omit) for type transformations.