Generate AsciiDoc documentation modules from gathered context. Reads context package and gap report, generates content, then self-validates with iterative correction (up to 3 retries). Produces generated files and workspace/generation-report.json.
Generate modular AsciiDoc documentation from gathered context, with built-in validation and iterative correction.
workspace/context-package.json must exist (produced by doc-gather)workspace/gap-report.json should exist (produced by doc-gap); if missing, proceed with generation but note the absence$ARGUMENTS optionally contains:
--type <type>: restrict generation to a specific module type (concept, procedure, reference, assembly)--topic <topic>: focus generation on a specific topic within the featureIf no arguments, generate all appropriate module types based on the feature.
workspace/context-package.jsonworkspace/gap-report.json (if exists)${CLAUDE_SKILL_DIR}/prompts/generate-docs.md${CLAUDE_SKILL_DIR}/scripts/product-config.sh and ${CLAUDE_SKILL_DIR}/scripts/asciidoc-conventions.sh for module templatesCheck gap report recommendation:
stop: halt and report to caller that context is insufficientgather-more: warn but proceed with available contextproceed: continue normallyBased on the ticket metadata and context, determine which module types to generate:
If --type was specified, restrict to that type.
Read the product conventions from the context package:
For each module to generate:
${CLAUDE_SKILL_DIR}/prompts/generate-docs.md template${CLAUDE_SKILL_DIR}/scripts/asciidoc-conventions.shFor each generated module, run validation:
Write generated content to a temporary file
Run deterministic validation:
bash ${CLAUDE_SKILL_DIR}/scripts/validate-artifacts.sh <temp-file>
Check structural requirements:
If validation finds issues:
Track iteration count and findings per iteration
Write generated modules to workspace/generated-docs/:
workspace/generated-docs/
├── con_feature-name.adoc
├── proc_feature-name.adoc
├── ref_feature-name-parameters.adoc
└── assembly_feature-name.adoc
Write workspace/generation-report.json:
{
"generated_at": "2026-04-14T10:45:00Z",
"ticket_key": "RHOAIENG-55490",
"gap_report_recommendation": "proceed",
"modules": [
{
"filename": "con_feature-name.adoc",
"type": "concept",
"title": "Understanding feature name",
"confidence": 0.85,
"iterations": 1,
"validation_status": "pass",
"validation_findings_initial": 2,
"validation_findings_final": 0,
"context_sources_used": [
"modules/existing/con_related.adoc",
"api/types/feature_types.go"
],
"notes": "SME review recommended for accuracy of step 3"
}
],
"assembly": {
"filename": "assembly_feature-name.adoc",
"includes": ["con_feature-name.adoc", "proc_feature-name.adoc"]
},
"summary": {
"total_modules": 3,
"average_confidence": 0.82,
"total_iterations": 5,
"modules_with_remaining_issues": 0
}
}
Primary: Generated AsciiDoc files in workspace/generated-docs/
Secondary: workspace/generation-report.json
Report to caller: number of modules generated, average confidence, iteration summary.
stop