Pre-action boundary checking — validates agent tool calls against declared capabilities and task contracts
日本語の概要は準備中です。原文の説明を表示しています。
Type-safe TypeScript patterns from industry standards
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Apply type-safe TypeScript patterns and best practices from industry standards.
Type safety over convenience
Explicit over implicit
Prefer strict mode
Use inference wisely
type_inference:
rely_on: trivially inferred types (primitives, literals)
annotate: complex expressions, return types, public APIs
any_vs_unknown:
prefer: unknown (requires type narrowing)
avoid: any (disables type checking)
if_any_needed: add suppressing comment
nullable:
prefer: "field?: Type"
avoid: "field: Type | undefined"
compare_enums: explicitly, not boolean coercion
patterns: |
// Good: unknown with narrowing
function process(data: unknown): void {
if (typeof data === 'string') {
console.log(data.toUpperCase());
}
}
// Avoid: any
function process(data: any): void {
console.log(data.toUpperCase()); // No type checking!
}
prefer_interfaces:
- Object type definitions
- Public API contracts
- Extendable types
use_types_for:
- Union types
- Intersection types
- Mapped types
- Utility types
patterns: |
// Interface for objects
interface User {
id: string;
name: string;
email: string;
}
// Type for unions/utilities
type Status = 'pending' | 'active' | 'completed';
type ReadonlyUser = Readonly<User>;
array_syntax:
simple_types: "T[]"
complex_types: "Array<T>"
generics:
naming: single uppercase (T, K, V) or descriptive (TItem, TResult)
constraints: use extends for type bounds
defaults: provide when appropriate
patterns: |
// Array syntax
const numbers: number[] = [1, 2, 3];
const items: Array<{ id: string; value: number }> = [];
// Generic constraints
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
declarations:
prefer: const
when_needed: let
never: var
one_per_statement: true
patterns: |
// Good
const name = 'TypeScript';
const version = 5.0;
// Avoid
var name = 'TypeScript', version = 5.0;
function_declarations:
named_functions: function declaration
callbacks: arrow functions
methods: shorthand syntax
parameters:
prefer_rest: "...args: T[]"
avoid: arguments object
this_handling:
prefer: arrow functions or explicit parameter
avoid: rebinding with bind/call/apply
patterns: |
// Function declaration
function processData(data: Data): Result {
return transform(data);
}
// Arrow function for callbacks
items.map((item) => item.value);
// Rest parameters
function concat(...strings: string[]): string {
return strings.join('');
}
visibility:
prefer: explicit modifiers (public, private, protected)
avoid: private fields (#)
initialization:
prefer: at declaration site
use: parameter properties in constructors
readonly:
apply_to: non-reassigned properties
patterns: |
class User {
readonly id: string;
private email: string;
constructor(
public name: string,
email: string,
) {
this.id = generateId();
this.email = email;
}
}
UpperCamelCase:
- Classes
- Interfaces
- Type aliases
- Enums
- Type parameters
lowerCamelCase:
- Variables
- Parameters
- Functions
- Methods
- Properties
CONSTANT_CASE:
- Global constants
- Enum values
- Static readonly fields
rules:
- No leading/trailing underscores
- No abbreviations (except universal: URL, ID, DNS)
- Acronyms as whole words: loadHttpUrl, not loadHTTPURL
- Single-letter names only in 10-line scopes
braces:
always: use braces for all control statements
equality:
always: "=== and !=="
never: "== and !="
loops:
arrays: for...of
objects: for...in with hasOwnProperty check
patterns: |
// Always braced
if (condition) {
doSomething();
}
// for...of for arrays
for (const item of items) {
process(item);
}
// for...in with check
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
process(obj[key]);
}
}
throwing:
only: Error instances
with_message: descriptive error messages
catching:
type: unknown
validate: before use
empty_catch:
require: rationale comment
patterns: |
// Throw Error instances
throw new Error('Invalid input');
// Catch with unknown
try {
riskyOperation();
} catch (error: unknown) {
if (error instanceof Error) {
console.error(error.message);
}
throw error;
}
imports:
prefer: named imports
use_namespace: for large APIs
prefer_relative: within project
exports:
prefer: named exports
avoid: default exports
patterns: |
// Named imports
import { User, UserService } from './user';
// Namespace import for large APIs
import * as fs from 'fs';
// Named exports
export interface User { }
export function createUser() { }
never_use:
- eval() or dynamic code evaluation
- with statements
- const enum (use plain enum)
- debugger statements in production
- Modifying built-in prototypes
- Wrapper objects (new String(), new Boolean())
- Automatic semicolon insertion reliance
When writing or reviewing TypeScript code:
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Pre-action boundary checking — validates agent tool calls against declared capabilities and task contracts
日本語の概要は準備中です。原文の説明を表示しています。
Auto-detect project context and optimize harness — deactivate unused agents/skills, suggest missing experts, generate project profile
日本語の概要は準備中です。原文の説明を表示しています。
Adversarial code review using attacker mindset — trust boundary, attack surface, business logic, and defense evaluation
日本語の概要は準備中です。原文の説明を表示しています。
Apache Airflow best practices for DAG authoring, testing, and production deployment
日本語の概要は準備中です。原文の説明を表示しています。
Alembic migration patterns for naming conventions, safety checks, expand-contract, env.py configuration, and CI integration
日本語の概要は準備中です。原文の説明を表示しています。
Pre-routing ambiguity analysis — scores request clarity and asks clarifying questions when needed (inspired by ouroboros)
日本語の概要は準備中です。原文の説明を表示しています。