{"data":{"slug":"discovered-93495f89d75f000fe58049ab9605ce3037feceda62a3a1a2","title":"Code Documenter","summary":"Generates, formats, and validates technical documentation, including docstrings, OpenAPI\/Swagger specs, JSDoc annotations, doc portals, and user guides. The skill produces a coverage report and ensures all public functions and classes are documented with parameter types, descriptions, and error handling.","url":"https:\/\/skillshunter.net\/skills\/discovered-93495f89d75f000fe58049ab9605ce3037feceda62a3a1a2","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-93495f89d75f000fe58049ab9605ce3037feceda62a3a1a2","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-93495f89d75f000fe58049ab9605ce3037feceda62a3a1a2.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-93495f89d75f000fe58049ab9605ce3037feceda62a3a1a2\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ask for the preferred documentation format and framework before starting. Validate the code examples in the documentation to ensure they compile and run correctly. Generate a coverage report to confirm documentation completeness.","instructions":"---\nname: code-documenter\ndescription: Generates, formats, and validates technical documentation \u2014 including docstrings, OpenAPI\/Swagger specs, JSDoc annotations, doc portals, and user guides. Use when adding docstrings to functions or classes, creating API documentation, building documentation sites, or writing tutorials and user guides. Invoke for OpenAPI\/Swagger specs, JSDoc, doc portals, getting started guides.\nlicense: MIT\nmetadata:\n  author: https:\/\/github.com\/Jeffallan\n  company: https:\/\/synergetic.solutions\n  version: \"1.1.0\"\n  domain: quality\n  triggers: documentation, docstrings, OpenAPI, Swagger, JSDoc, comments, API docs, tutorials, user guides, doc site\n  role: specialist\n  scope: implementation\n  output-format: code\n  related-skills: spec-miner, fullstack-guardian, code-reviewer\n---\n\n# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## When to Use This Skill\n\n- Adding docstrings to functions, classes, and modules\n- Writing OpenAPI\/Swagger specs or JSDoc annotations\n- Creating API documentation for REST or GraphQL endpoints\n- Building documentation sites or developer portals\n- Writing getting-started guides, tutorials, and user guides\n\n## Core Workflow\n\n1. **Discover** - Ask for format preference and exclusions\n2. **Detect** - Identify language and framework\n3. **Analyze** - Find undocumented code\n4. **Document** - Apply consistent format\n5. **Validate** - Test all code examples compile\/run:\n   - Python: `python -m doctest file.py` for doctest blocks; `pytest --doctest-modules` for module-wide checks\n   - TypeScript\/JavaScript: `tsc --noEmit` to confirm typed examples compile\n   - OpenAPI: validate spec with `npx @redocly\/cli lint openapi.yaml`\n   - If validation fails: fix examples and re-validate before proceeding to the Report step\n6. **Report** - Generate coverage summary\n\n## Quick-Reference Examples\n\n### Google-style Docstring (Python)\n```python\ndef fetch_user(user_id: int, active_only: bool = True) -> dict:\n    \"\"\"Fetch a single user record by ID.\n\n    Args:\n        user_id: Unique identifier for the user.\n        active_only: When True, raise an error for inactive users.\n\n    Returns:\n        A dict containing user fields (id, name, email, created_at).\n\n    Raises:\n        ValueError: If user_id is not a positive integer.\n        UserNotFoundError: If no matching user exists.\n    \"\"\"\n```\n\n### NumPy-style Docstring (Python)\n```python\ndef compute_similarity(vec_a: np.ndarray, vec_b: np.ndarray) -> float:\n    \"\"\"Compute cosine similarity between two vectors.\n\n    Parameters\n    ----------\n    vec_a : np.ndarray\n        First input vector, shape (n,).\n    vec_b : np.ndarray\n        Second input vector, shape (n,).\n\n    Returns\n    -------\n    float\n        Cosine similarity in the range [-1, 1].\n\n    Raises\n    ------\n    ValueError\n        If vectors have different lengths.\n    \"\"\"\n```\n\n### JSDoc (TypeScript)\n```typescript\n\/**\n * Fetches a paginated list of products from the catalog.\n *\n * @param {string} categoryId - The category to filter by.\n * @param {number} [page=1] - Page number (1-indexed).\n * @param {number} [limit=20] - Maximum items per page.\n * @returns {Promise<ProductPage>} Resolves to a page of product records.\n * @throws {NotFoundError} If the category does not exist.\n *\n * @example\n * const page = await fetchProducts('electronics', 2, 10);\n * console.log(page.items);\n *\/\nasync function fetchProducts(\n  categoryId: string,\n  page = 1,\n  limit = 20\n): Promise<ProductPage> { ... }\n```\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Python Docstrings | `references\/python-docstrings.md` | Google, NumPy, Sphinx styles |\n| TypeScript JSDoc | `references\/typescript-jsdoc.md` | JSDoc patterns, TypeScript |\n| FastAPI\/Django API | `references\/api-docs-fastapi-django.md` | Python API documentation |\n| NestJS\/Express API | `references\/api-docs-nestjs-express.md` | Node.js API documentation |\n| Coverage Reports | `references\/coverage-reports.md` | Generating documentation reports |\n| Documentation Systems | `references\/documentation-systems.md` | Doc sites, static generators, search, testing |\n| Interactive API Docs | `references\/interactive-api-docs.md` | OpenAPI 3.1, portals, GraphQL, WebSocket, gRPC, SDKs |\n| User Guides & Tutorials | `references\/user-guides-tutorials.md` | Getting started, tutorials, troubleshooting, FAQs |\n\n## Constraints\n\n### MUST DO\n- Ask for format preference before starting\n- Detect framework for correct API doc strategy\n- Document all public functions\/classes\n- Include parameter types and descriptions\n- Document exceptions\/errors\n- Test code examples in documentation\n- Generate coverage report\n\n### MUST NOT DO\n- Assume docstring format without asking\n- Apply wrong API doc strategy for framework\n- Write inaccurate or untested documentation\n- Skip error documentation\n- Document obvious getters\/setters verbosely\n- Create documentation that's hard to maintain\n\n## Output Formats\n\nDepending on the task, provide:\n1. **Code Documentation:** Documented files + coverage report\n2. **API Docs:** OpenAPI specs + portal configuration\n3. **Doc Sites:** Site configuration + content structure + build instructions\n4. **Guides\/Tutorials:** Structured markdown with examples + diagrams\n\n## Knowledge Reference\n\nGoogle\/NumPy\/Sphinx docstrings, JSDoc, OpenAPI 3.0\/3.1, AsyncAPI, gRPC\/protobuf, FastAPI, Django, NestJS, Express, GraphQL, Docusaurus, MkDocs, VitePress, Swagger UI, Redoc, Stoplight\n\nMaintained by [@jeffallan](https:\/\/github.com\/jeffallan), Principal Consultant at [Synergetic Solutions](https:\/\/synergetic.solutions)\n\n[Documentation](https:\/\/jeffallan.github.io\/claude-skills\/skills\/quality\/code-documenter\/)\n","use_cases":["Adding docstrings to functions and classes","Creating OpenAPI\/Swagger specs for REST or GraphQL endpoints","Building documentation sites or developer portals","Writing getting-started guides, tutorials, and user guides"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/Jeffallan\/claude-skills\/blob\/a8be463010e2ca23afe00ea00773aea7128e8971\/plugin\/skills\/code-documenter\/SKILL.md","source_commit":"a8be463010e2ca23afe00ea00773aea7128e8971","license":null,"version":null,"listing_approved_at":"2026-11-29","created_at":"2026-11-28T18:46:43.000000Z","updated_at":"2026-11-29T10:53:15.000000Z","seo_title":"Code Documenter - Generate and Validate Technical Documentation","seo_description":"Automatically generate and validate technical documentation for functions, classes, and APIs using docstrings, OpenAPI\/Swagger, JSDoc, and more. Includes coverage reports","seo_keywords":["code documentation","docstrings","OpenAPI","Swagger","JSDoc","API documentation","technical writing","documentation site"]}}