draft-code

Generates TypeScript code skeletons with typed stubs and canonical TODO(implementation) placeholders.

4|1|Updated Jul 31, 2025
One-click install
npx skills add https://github.com/alvis/.agents --skill draft-code-alvis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: draft-code
Source: https://github.com/alvis/.agents/tree/main/plugins/coding/skills/draft-code
Command: npx skills add https://github.com/alvis/.agents --skill draft-code-alvis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Starting a specified implementation from scratch often produces inconsistent structure, vague TODO comments, and untyped stubs that later contributors cannot safely claim. This Skill creates TypeScript-compliant production skeletons with explicit type definitions, function signatures, and canonical TODO(implementation): markers so downstream completion steps know exactly what to implement. ## Core Features & Use Cases - Typed skeleton generation: Creates interfaces, type aliases, enums, and function stubs with JSDoc, marking every incomplete body with TODO(implementation): comments and an IMPLEMENTATION: sentinel throw. - Test scaffolding: Drafts pending runtime tests with describe.todo()/it.todo() and compiler-semantic type tests through the project's configured type-test mechanism. - Standards enforcement: Applies naming, file-structure, function, testing, and TypeScript standards, then verifies with tsc --noEmit, lint, and repository-native test commands. - Use Case: Given an instruction like "Create user authentication service with login, logout, and token refresh", it produces types.ts, auth.service.ts stubs, and auth.spec.ts scaffolds ready for coding:complete-code and coding:complete-test. ## Quick Start Ask the agent to draft a TypeScript skeleton for a specific feature, for example: draft a REST endpoint skeleton for product CRUD operations with typed stubs and test scaffolds.

Frequently Asked Questions about draft-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a TypeScript code skeleton from a specification?

Provide a specific instruction naming the feature or module, such as a service with its methods. The skill derives interfaces, function signatures, and file structure, then writes stubs marked with TODO(implementation) comments and verifies they compile with tsc --noEmit.

What placeholder format should TypeScript stubs use for later completion?

Use `// TODO(implementation): <explicit behavior>` comments plus a thrown `IMPLEMENTATION:` sentinel error wherever a value is expected. Plain TODO markers are rejected because downstream completion skills only claim the canonical forms.

Does the skeleton include tests, or only production stubs?

It drafts test scaffolds too: describe.todo()/it.todo() while no runtime entrypoint is callable, minimal failing assertions once one is, and type tests via the project's configured mechanism for compiler-observable behavior. Declaration shape alone receives no test scaffold.

When should I not use skeleton drafting for TypeScript code?

Avoid it when the instruction is too vague to derive types, when you need actual business logic implemented, or when modifying existing code. Those cases belong to implementation, refactoring, or fix workflows instead.

Why does skeleton generation fail or get rejected?

Rejection happens when the instruction lacks enough detail to derive meaningful types, the target directory does not exist, or the skeleton would conflict with existing code structure. Verification failures from tsc or lint are fixed and re-run before reporting.