writing-stubs-and-docs

Generate typed function stubs with docstrings and typecheck gate integration.

Updated May 7, 2026
One-click install
npx skills add https://github.com/TK-Evans01/tk-harness --skill writing-stubs-and-docs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-stubs-and-docs
Source: https://github.com/TK-Evans01/tk-harness/tree/main/plugins/tk-rpie/skills/writing-stubs-and-docs
Command: npx skills add https://github.com/TK-Evans01/tk-harness --skill writing-stubs-and-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of writing typed function stubs and contract docstrings, ensuring adherence to a robust RPSTIE workflow and typechecked contracts.

Core Features & Use Cases

  • Typed Stubs Creation: Generates typed function stubs for signatures, branded primitives, error shapes, smart constructors, and unimplemented markers.
  • Typechecked Gate: Ensures stubs pass through a typecheck gate before commit, catching errors early.
  • Documentation Support: Provides templates for detailed docstrings with purpose, input, output, errors, and examples.
  • Use Case: Perfect for developers who need to write clear and concise stubs before writing tests and bodies, adhering to functional programming principles.

Quick Start

Execute 'tk-rpie:writing-stubs-and-docs' to initiate the stub authoring process for a new function.

Frequently Asked Questions about writing-stubs-and-docs

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

FAQPage Schema
How do I generate typed stubs for function signatures before writing the implementation?

To generate typed stubs for function signatures, you can use a stub generation workflow that creates branded primitives, smart constructors, and detailed contract docstrings before passing through a typecheck gate. This ensures proper type definitions are validated early.

What is the RPSTIE workflow for writing typechecked stubs?

The RPSTIE workflow is a functional programming practice that emphasizes writing clear, typed function stubs and contract docstrings before writing tests and bodies. It integrates a typecheck gate to catch errors early before committing code changes.

How do I enforce a typecheck gate before committing functional programming code?

You can enforce a typecheck gate before commit by authoring typed stubs that must pass type validation first. This approach catches errors early by requiring proper type definitions and branded primitives before any code changes are committed.

Does stub generation work with branded primitives and smart constructors?

Yes, stub generation works with branded primitives and smart constructors. It creates typed function stubs for these specific functional programming structures, ensuring they are properly typed and documented with purpose, input, output, errors, and examples.

What is the best way to write docstrings for unimplemented function markers?

The best way to write docstrings for unimplemented markers is to use templates that detail purpose, input, output, errors, and examples. This provides clear documentation for typed stubs before the actual function body is written.

When do I need to write typed stubs instead of directly implementing function bodies?

You need to write typed stubs when adhering to functional programming principles that require defining clear type contracts and docstrings first. This approach ensures proper type definitions are established before writing tests and bodies.