java/src/main/resources/targets/claude/skills/core/ops/x-doc-generate/SKILL.md
Documentation automation: detects documentation type needed (API, README, ADR, changelog) from code changes, delegates to specialized skills or generates inline. Single entry point for all documentation updates.
npx skillsauth add edercnj/ia-dev-environment x-doc-generateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Single entry point for generating and updating all project documentation for {{PROJECT_NAME}}. Detects the type of documentation needed from code changes, delegates to specialized skills (/x-release-changelog, /x-adr-generate, /x-arch-update), or generates API docs and README updates inline.
/x-doc-generate — auto-detect documentation type from git diff and update accordingly/x-doc-generate --type api — generate or update API documentation (OpenAPI/endpoint docs)/x-doc-generate --type readme — update project README.md with new features/skills/configuration/x-doc-generate --type adr — delegate to /x-adr-generate for ADR generation/x-doc-generate --type changelog — delegate to /x-release-changelog for changelog generation/x-doc-generate --type all — process all applicable documentation types/x-doc-generate --type all --force — regenerate all documentation regardless of change status| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| --type | Enum | No | Documentation type: api, readme, adr, changelog, all. Default: auto-detect from git diff. |
| --scope | String | No | Path to limit change analysis (e.g., src/main/java/com/example/api/) |
| --force | Flag | No | Regenerate documentation even if no changes detected |
1. PARSE -> Parse arguments (--type, --scope, --force)
2. DETECT -> Analyze git diff to determine documentation types needed
3. DISPATCH -> Delegate to specialized skills or generate inline
4. VERIFY -> Confirm documentation was updated (idempotency check)
5. REPORT -> Summary of documentation actions taken
Parse the invocation arguments:
--type is specified, use that type (skip auto-detection)--scope is specified, limit git diff to that path--force is specified, regenerate even if docs appear up-to-dateWhen --type is NOT specified, analyze changed files to infer documentation type:
# Get list of changed files (staged + unstaged + untracked)
git diff --name-only HEAD 2>/dev/null || git diff --name-only
git diff --name-only --cached
git ls-files --others --exclude-standard
Apply the auto-detection rules:
| File Pattern | Inferred Type |
|-------------|---------------|
| *Controller*, *Resource*, *Handler*, *Endpoint*, *Route* | api |
| *ADR*, *Decision*, architecture*, *adr* | adr |
| Any commits since last tag (Conventional Commits present) | changelog |
| SKILL.md, README*, config*, setup*, *.yaml (config) | readme |
| No matches found | No action needed |
When multiple types are detected, process ALL detected types (same as --type all but scoped).
If no changes are detected and --force is NOT set:
LOG: "No documentation updates needed"
--type changelog)Delegate entirely to the /x-release-changelog skill:
Invoke Skill: /x-release-changelog --unreleased
Do NOT generate changelog content inline. The /x-release-changelog skill handles all changelog logic.
--type adr)Delegate to /x-adr-generate:
plans/Invoke Skill: /x-adr-generate [architecture-plan-path] [story-id]
When architectural changes are detected (new components, new integrations, infrastructure changes), delegate to /x-arch-update:
Invoke Skill: /x-arch-update [story-id or plan-path]
This is triggered automatically when --type all is specified and architecture plans exist.
--type api)Generate or update API documentation inline:
Detect endpoints — scan changed files for controller/resource/handler classes:
# Find controller files with changes
git diff --name-only | grep -iE '(Controller|Resource|Handler|Endpoint|Route)\.'
Extract endpoint metadata — for each changed controller, extract:
@GET, @POST, @PUT, @DELETE, @PATCH)@Path, @RequestMapping, @GetMapping, etc.)Generate/update documentation:
docs/api/ directory exists, update endpoint documentation thereopenapi.yaml, openapi.json, swagger.yaml), update it## API Endpoints
| Method | Path | Description | Request Body | Response |
|--------|------|-------------|-------------|----------|
| GET | /api/v1/users | List users | — | UserListResponse |
| POST | /api/v1/users | Create user | CreateUserRequest | UserResponse |
Idempotency — before writing, compare generated content with existing. Skip if identical.
--type readme)Update the project README.md inline:
--type all)Process all documentation types in parallel where possible:
git diff analysis once (shared across all types)--force)After generation, verify:
Documentation update complete:
Types processed: {list of types}
Files updated:
- {file_path_1} ({type})
- {file_path_2} ({type})
Delegated to:
- /x-release-changelog (changelog)
- /x-adr-generate (adr)
Skipped: {types skipped and reason}
Duration: {time}
| Scenario | Action | |----------|--------| | No git repository found | Report error: "Not a git repository" | | No changes detected (no --force) | Log: "No documentation updates needed" | | Delegated skill not available | Log warning, skip that type, continue with others | | Target file is read-only | Report error for that file, continue with others | | OpenAPI spec has invalid format | Log warning, generate fresh documentation instead of updating | | README.md has unexpected structure | Append new sections at the end with warning |
| Skill | Relationship | Context |
|-------|-------------|---------|
| /x-release-changelog | delegates-to | Changelog generation is fully delegated |
| /x-adr-generate | delegates-to | ADR generation from architecture plans |
| /x-arch-update | delegates-to | Architecture document updates |
| /x-story-implement | called-by | Phase 3 (Documentation) of the lifecycle |
| /x-git-push | preceded-by | Run after code changes, before committing |
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
documentation
Incrementally updates the service or system architecture document; never regenerative.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.