/major-ai-skills:inline-type-signaturesfrom major-ai-skills
Use native type annotations and avoid repeating the same type information in documentation comments.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A pervasive token inefficiency in AI-generated code is Type Duplication: the model writes native TypeScript or Python type annotations, and then immediately repeats the exact same information inside a verbose 10-line JSDoc or Sphinx docstring (@param {string} userId - The ID of the user, @returns {Promise<boolean>} Whether the operation succeeded).
Duplicating type signatures across both syntax and comments burns 50 to 100 redundant tokens per function. In a 500-line service file, type duplication accounts for 2,000+ wasted tokens that clutter the IDE and drift out of sync over time.
The Inline Type Signature Protocol establishes the compiler's type system as the single source of truth - using concise inline type hints and restricting docstrings strictly to non-obvious business rationale.
┌─────────────────────────────────────────────────────────────┐
│ Type Declaration Token Impact │
│ │
│ Duplicate JSDoc Redundancy (110 Tokens per Function): │
│ /** │
│ * Authenticates a user with email and password. │
│ * @param {string} email - The user email address. │
│ * @param {string} password - The raw plain text password.│
│ * @param {boolean} rememberMe - Whether to extend session│
│ * @returns {Promise<AuthSession>} The auth session object.│
│ */ │
│ async function authenticateUser( │
│ email: string, │
│ password: string, │
│ rememberMe: boolean = false │
│ ): Promise<AuthSession> { ... } │
│ │
│ Native Inline Type Signature (24 Tokens - 78.2% Cut): │
│ async function authenticateUser( │
│ email: string, │
│ password: string, │
│ rememberMe: boolean = false │
│ ): Promise<AuthSession> { ... } │
│ ↳ 24 clean tokens, 100% type safety in VS Code/LSP │
└─────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────────────────┐
│ 1. NEVER WRITE `@param` OR `@returns` TYPE TAGS IN TYPESCRIPT │
│ TypeScript's compiler and IDE language servers provide richer tooltips │
│ │
│ 2. USE PYTHON PEP 484 / 585 TYPE HINTS OVER SPHINX DOCSTRINGS │
│ `def send(to: str, retry: int = 3) -> bool:` │
│ │
│ 3. RESERVE COMMENTS STRICTLY FOR "WHY", NEVER "WHAT" │
│ Document non-obvious business rationale or security invariants only │
└───────────────────────────────────────────────────────────────────────────┘
export interface SessionConfig {
ttlSeconds: number;
allowRefresh: boolean;
ipLock?: string;
}
// Zero redundant JSDoc. Clean compiler-checked signature.
export async function createSession(
userUuid: string,
config: SessionConfig
): Promise<Result<SessionToken, AuthError>> {
// Business invariant: rate limit check
if (await isRateLimited(userUuid)) {
return [null, new AuthError("RATE_LIMIT_EXCEEDED")];
}
return [await db.sessions.insert({ userUuid, ...config }), null];
}
:type Docstrings)from typing import Optional, List
from dataclasses import dataclass
@dataclass(frozen=True)
class QueryFilter:
status: str
limit: int = 50
tags: Optional[List[str]] = None
def fetch_records(account_id: int, filters: QueryFilter) -> List[dict]:
# Single-line implementation with 100% MyPy / Pyright type coverage
return db.query(account_id=account_id, **filters.__dict__)
Evaluation across a 30-function API controller service:
| Metric | Verbose JSDoc / Sphinx Comments | Inline Native Type Signatures | Improvement |
|---|---|---|---|
| Total Service Tokens | 4,950 tokens | 2,100 tokens | 57.5% Token Savings |
| Type Safety & LSP Tooltips | 100% | 100% | Zero Loss of Tooling |
| Maintenance Drift Risk | High (Docstrings drift from types) | Zero (Compiler enforces types) | 100% Synchronized |
MANDATORY: Code generation agents must rely on native inline type annotations (TypeScript syntax, Python PEP 484/585). Never generate redundant JSDoc/Sphinx
@paramor@typeblocks that restate what the type signature already declares.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job