Skip to content

[Feature] Add JSDoc documentation to TypeScript tool functions #20

@Ccindy0171

Description

@Ccindy0171

Is this related to a problem?
TypeScript tools in apps/web/src/lib/tools/ lack JSDoc comments. This makes it harder for contributors and API consumers to understand what each function does, what parameters it expects, and what it returns.

Describe the feature
Add comprehensive JSDoc comments to all exported functions in the TypeScript tools directory. Each function should document:

  • Purpose and behavior
  • Parameter types and descriptions
  • Return value structure
  • Brief usage example

Which module does this relate to?

  • M1: Stylus (contracts, tests, compilation)
  • M2: SDK (bridging, messaging)
  • M3: dApp Builder (backend, frontend, indexer, oracle)
  • M4: Orbit (chain config, deployment, validators)

Example usage
Before:

export async function generateStylusCode(prompt: string, env: Env) {

After:

/**
 * Generates a Stylus smart contract from a natural language prompt.
 * Uses RAG retrieval + LLM generation with compile verification.
 *
 * @param prompt - Natural language description of the contract to generate
 * @param env - Cloudflare Worker environment bindings
 * @returns Generated contract code with Cargo.toml, lib.rs, main.rs, and metadata
 */
export async function generateStylusCode(prompt: string, env: Env) {

Additional context

  • Files: apps/web/src/lib/tools/*.ts (all tool files)
  • Reference apps/web/src/lib/openrouter.ts for documentation style

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions