
coding-typescript
by simonheimlicher
Claude Code plugin marketplace: testing methodology, Python workflow, and productivity skills
SKILL.md
name: coding-typescript description: Write TypeScript code that's type-safe and tested. Use when coding TypeScript or implementing features. allowed-tools: Read, Write, Bash, Glob, Grep, Edit
<accessing_skill_files> When this skill is invoked, Claude Code provides the base directory in the loading message:
Base directory for this skill: {skill_dir}
Use this path to access skill files:
- References:
{skill_dir}/references/ - Workflows:
{skill_dir}/workflows/
IMPORTANT: Do NOT search the project directory for skill files. </accessing_skill_files>
<essential_principles> NO MOCKING. DEPENDENCY INJECTION. BEHAVIOR ONLY. TEST FIRST.
- Use dependency injection, NEVER mocking frameworks
- Test behavior (what the code does), not implementation (how it does it)
- Run all verification tools before declaring completion
- Type safety first:
strict: true, noanywithout justification
</essential_principles>
<testing_methodology>
For complete testing methodology, invoke /testing-typescript skill.
The /testing-typescript skill provides:
- Detailed test level selection criteria
- Dependency injection patterns (NO MOCKING)
- Behavior-only testing approach
- Test organization for debuggability
- Test graduation workflow
Quick Reference - Testing Levels:
| Level | Infrastructure | When to Use |
|---|---|---|
| 1 (Unit) | Node.js + Git + temp fixtures | Pure logic, FS ops, git operations |
| 2 (Integration) | Project-specific binaries/tools | Claude Code, Hugo, Caddy, TypeScript compiler |
| 3 (E2E) | External deps (GitHub, network, Chrome) | Full workflows with external services |
NO MOCKING — Use Dependency Injection Instead:
// ❌ FORBIDDEN: Mocking
vi.mock("execa", () => ({ execa: vi.fn() }));
// ✅ REQUIRED: Dependency Injection
interface CommandDeps {
execa: typeof execa;
}
it("GIVEN valid args WHEN running THEN returns success", async () => {
const deps: CommandDeps = {
execa: vi.fn().mockResolvedValue({ exitCode: 0 }),
};
const result = await runCommand(args, deps);
expect(result.success).toBe(true); // Tests behavior
});
</testing_levels>
<context_loading> BEFORE ANY IMPLEMENTATION: Load complete specification context.
If working on a specs-based work item (story/feature/capability):
- Invoke
specs:understanding-specsFIRST with the work item identifier - If context ingestion fails: ABORT - do not proceed until all required documents exist
- If context ingestion succeeds: Proceed with implementation using loaded context
The specs:understanding-specs skill ensures:
- All specification documents exist (capability/feature/story specs)
- All requirements documents exist (PRD/TRD at appropriate levels)
- All architectural decisions (ADRs) are read and understood
- Complete hierarchical context is loaded (Product → Capability → Feature → Story)
Example invocation:
# By work item path
specs:understanding-specs capability-10_cli/feature-20_commands/story-30_build
# By story name
specs:understanding-specs story-30_build
If specs:understanding-specs returns an error: The error message will specify which document is missing and how to create it. Create the missing document before proceeding with implementation.
If NOT working on specs-based work item: Proceed directly to implementation mode with provided spec. </context_loading>
<two_modes> You operate in one of two modes depending on your input:
| Input | Mode | Workflow |
|---|---|---|
| Spec (TRD, ADR, design doc) | Implementation | workflows/implementation.md |
| Rejection feedback from reviewer | Remediation | workflows/remediation.md |
Determine your mode from the input, then follow the appropriate workflow. </two_modes>
<core_principles>
-
Spec Is Law: The specification is your contract. Implement exactly what it says.
-
Test-Driven Development: Write tests first or alongside code. Tests prove correctness.
-
Type Safety First: Use strict TypeScript with
strict: true. Noanywithout justification. -
Self-Verification: Before declaring "done," run tsc, eslint, and vitest yourself.
-
Humility: Your code must pass review. Write code that will survive adversarial review.
-
Clean Architecture: Dependency injection, single responsibility, no circular imports, no deep relative imports.
</core_principles>
<reference_index>
| File | Purpose |
|---|---|
references/code-patterns.md | Subprocess, resource cleanup, config |
references/test-patterns.md | Debuggability-first test organization |
references/verification-checklist.md | Pre-submission verification |
</reference_index>
<workflows_index>
| Workflow | Purpose |
|---|---|
workflows/implementation.md | TDD phases, code standards |
workflows/remediation.md | Fix issues from review feedback |
</workflows_index>
<what_not_to_do> Never Self-Approve: Always submit for review.
Never Skip Tests: Write tests first. No exceptions.
Never Ignore Type Errors:
// WRONG
const result = someFunction(); // @ts-ignore
// RIGHT
const result: ExpectedType = someFunction();
Never Hardcode Secrets:
// WRONG
const API_KEY = "sk-1234567890abcdef";
// RIGHT
const API_KEY = process.env.API_KEY;
if (!API_KEY) throw new Error("API_KEY required");
Never Use Deep Relative Imports:
Before writing any import, ask: "Is this a module-internal file (same module, moves together) or infrastructure (lib/, tests/helpers/, shared/)?"
// WRONG: Deep relatives to stable locations — will REJECT in review
import { helper } from "../../../../../../tests/helpers/tree-builder";
import { Logger } from "../../../../lib/logging";
import { Config } from "../../../shared/config";
// RIGHT: Configure path aliases in tsconfig.json
import { Logger } from "@lib/logging";
import { Config } from "@shared/config";
import { helper } from "@test/helpers/tree-builder";
Depth Rules:
./sibling— ✅ OK (same directory, module-internal)../parent— ⚠️ Review (is it truly module-internal?)../../or deeper — ❌ REJECT (use path alias)
Configure tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@test/*": ["tests/*"],
"@lib/*": ["lib/*"]
}
}
}
</what_not_to_do>
<tool_invocation>
# Type checking
npx tsc --noEmit
# Linting
npx eslint src/ test/
npx eslint src/ test/ --fix
# Testing
npx vitest run --coverage
</tool_invocation>
<success_criteria> Your implementation is ready for review when:
- Spec fully implemented
- All functions have type annotations
- All public functions have JSDoc
- Tests exist for all public functions
- tsc passes with zero errors
- eslint passes with zero errors
- All tests pass
- Coverage ≥80% for new code
- No TODOs/FIXMEs unaddressed
- No console.log statements
- No hardcoded secrets
Your code will face an adversarial reviewer with zero tolerance. Write code that will survive that scrutiny. </success_criteria>
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon
