{"id":"code-documenter","name":"code-documenter","summary":"ドキュメントの生成、フォーマット、検証を行います。ドキュメント文字列、OpenAPI/Swagger仕様、JSDocの注釈、ドキュメントポータル、ユーザーガイドなどが含まれます。","body":"# Code Documenter\n\nDocumentation specialist for inline documentation, API specs, documentation sites, and developer guides.\n\n## When to Use This Skill\n\nApplies to any task involving code documentation, API specs, or developer-facing guides. See the reference table below for specific sub-topics.\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\n[Documentation](https://jeffallan.github.io/claude-skills/skills/quality/code-documenter/)","author":"@Jeffallan","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/Jeffallan/claude-skills/tree/main/skills/code-documenter","license":"MIT","category":"writing","lang":"en","tokens":1126,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/api-docs-fastapi-django.md","size":4148,"sha256":"5506708ca897d28169ea43be038f1e4346a518bf8194d4b5b13a3779b4946413"},{"path":"references/api-docs-nestjs-express.md","size":4950,"sha256":"fb1b07526b74edc5b3ba7e704a50a0f3aa5f542f97d80dffc90c95f585c4c9b5"},{"path":"references/coverage-reports.md","size":3032,"sha256":"8688b82cbc2963f2909194a229901e2aa75231ebfc86801542380ea85e9900a6"},{"path":"references/documentation-systems.md","size":6080,"sha256":"b12392c057147925974faa380e3a249013f9b608a14344ed268df20b15ccd3b8"},{"path":"references/interactive-api-docs.md","size":10190,"sha256":"c1b57eac676576644152d6293ad17c9ece51e39fdbc2966ef7b981061210dfaf"},{"path":"references/python-docstrings.md","size":2964,"sha256":"f852d307f2dfaa44b7ec27137933ae4ace086991454e832f59fdeaa6d0a40a25"},{"path":"references/typescript-jsdoc.md","size":3110,"sha256":"a100430b78e885b3c2070740491590578dcb3d35918755c1495e8c8b621a6b2d"},{"path":"references/user-guides-tutorials.md","size":11000,"sha256":"18c05418351ec3b362b8ee7a577c40e4417f3f624c53dd72a43fd7833ab52f3b"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":["api.example.com","cdn.jsdelivr.net","cdn.redoc.ly","community.example.com","docs.example.com","jeffallan.github.io","yourapp.com"]}}