| name | update-platform-docs |
| description | Update existing platform documentation with automatic gap detection in openshift/enhancements |
| trigger | explicit |
Platform Documentation Updater
Incrementally update existing AI-optimized platform documentation in openshift/enhancements/ai-docs/ without regenerating everything.
Features:
- Automatic gap detection - Scans ai-docs/ and reports missing files
- Targeted updates - Add specific content without full regeneration
- Smart navigation - Auto-updates index files and AGENTS.md
- Validation - Ensures quality and conventions
Use when:
- Discovering what's missing from documentation
- Adding new content to existing documentation
- Adding new sections (e.g., workflows/exec-plans/)
- Updating AGENTS.md with new links
- Adding new domain concepts, patterns, or ADRs
- Fixing or enhancing existing files
Don't use when:
- You want to completely regenerate all docs from scratch
Execution Workflow
Phase 1: Discovery & Gap Detection
Phase 2: Perform Updates
Based on user request, perform ONE OR MORE of:
Add New Platform Pattern
Add New Domain Concept
Add New Practice
Add New ADR
Add New Workflow Section
Update AGENTS.md
Update Existing Files
Phase 3: Validation & Verification
Phase 4: Report
Update Scenarios
Scenario 1: Add New Operator Pattern
User request: "Add RBAC patterns to operator patterns"
Actions:
- Create
platform/operator-patterns/rbac.md using pattern template
- Add entry to
platform/operator-patterns/index.md
- Add link to
AGENTS.md under "Standard Operator Patterns"
- Validate
Scenario 2: Add New Workflow Section
User request: "Add exec-plans guidance to workflows"
Actions:
- Create
workflows/exec-plans/ directory
- Create
workflows/exec-plans/README.md from template
- Create
workflows/exec-plans/template.md from template
- Update
workflows/index.md with new section
- Add link to
AGENTS.md under "Workflows"
- Validate
Scenario 3: Update AGENTS.md
User request: "Add link to new ADR in AGENTS.md"
Actions:
- Read current
AGENTS.md
- Find "Cross-Repo Architectural Decisions" section
- Add new ADR link in table format
- Verify line count ≤200
- Validate
Scenario 4: Add Multiple Related Files
User request: "Add security practices section with STRIDE and secrets handling"
Actions:
- Create
practices/security/threat-modeling.md
- Create
practices/security/secrets.md
- Update
practices/security/index.md
- Add links to
AGENTS.md under "Engineering Practices"
- Validate
File Naming Conventions
MUST follow these conventions:
- Index files: Use
index.md NOT README.md (exception: exec-plans/README.md)
- ADR naming: Use
adr-NNNN- prefix (4 digits with leading zeros)
- Short file names: Match production conventions
- Separate distinct concepts: Don't combine multiple topics
Update Guidelines
Adding Content
- Use appropriate template from
templates/
- Follow existing file structure and style
- Maintain reference/terse style (tables, checklists)
- Keep files within length targets (100-400 lines)
Verification Requirements: API/CRD claims link to github.com/openshift/api or kubernetes/apimachinery; pattern claims link to implementations; version/convention claims verified in actual repos (3+ samples); architectural claims link to enhancements/ADRs
Updating AGENTS.md
- Always read current content first
- Add new links in appropriate sections
- Use table format for consistency
- Keep compressed (navigation, not prose)
- Verify line count ≤200 after update
Updating Index Files
- Add one-line description per new file
- Maintain alphabetical or logical order
- Use consistent format:
- [filename.md](filename.md) - Brief description
Preserving Structure
- Don't reorganize existing content unless explicitly requested
- Match existing conventions and patterns
- Maintain consistency with existing files
Validation
After updates, verify:
✅ New files use correct naming conventions
✅ Index files updated with new entries
✅ AGENTS.md updated if needed (and 100-200 lines)
✅ Internal links work
✅ Files follow reference style (tables, checklists)
✅ No duplication of dev-guide/guidelines content
Gap Detection Mode
Automatic workflow:
- Scan existing ai-docs/ structure
- Compare against expected files checklist
- Report what's missing (by category)
- Ask user which gaps to fill
Gap categories scanned:
- Platform Patterns (controller-runtime, status-conditions, webhooks, etc.)
- Domain Concepts - Kubernetes (pod, service, crds)
- Domain Concepts - OpenShift (clusteroperator, clusterversion)
- Practices (testing, security, reliability, development)
- Workflows (enhancement-process, implementing-features, exec-plans)
- Decisions (adr-template, index)
- References (repo-index, glossary, api-reference)
- Core Files (DESIGN_PHILOSOPHY, KNOWLEDGE_GRAPH)
- Navigation (AGENTS.md)
User chooses:
- Fill all detected gaps
- Fill specific gaps (select from list)
- Skip gaps, specify custom addition
Examples
Example 1: Gap Detection Workflow
/update-platform-docs
🔍 Scanning ai-docs/ for gaps...
Missing:
- platform/operator-patterns/webhooks.md
- platform/operator-patterns/finalizers.md
Missing:
- workflows/exec-plans/README.md
- workflows/exec-plans/template.md
📊 Summary: 4 missing files detected
"Fill all gaps" OR "Fill exec-plans only" OR "Custom: add observability practices"
Example 2: Add Exec-Plans Workflow
/update-platform-docs
mkdir -p ai-docs/workflows/exec-plans
Example 2: Add New Platform Pattern
/update-platform-docs
Example 3: Update Existing File
/update-platform-docs
Arguments
/update-platform-docs [--path <repository-path>]
Arguments:
--path <repository-path>: Path to enhancements repository (default: current directory)
- No args: Update documentation in current directory
Prerequisites
Before running:
- ✅ ai-docs/ already exists in openshift/enhancements
- ✅ You're in openshift/enhancements repository
- ✅ You know what you want to add/update
Success Output
✅ Platform Documentation Updated
Repository: /path/to/enhancements
Changes:
✅ Created: ai-docs/workflows/exec-plans/README.md
✅ Created: ai-docs/workflows/exec-plans/template.md
✅ Updated: ai-docs/workflows/index.md
✅ Updated: AGENTS.md (added exec-plans link)
Validation:
✅ File naming conventions correct
✅ Index files updated
✅ AGENTS.md: 192 lines (target: ≤200)
✅ Internal links valid
✅ Reference style maintained
Next Steps:
1. Review changes
2. Run: git add ai-docs/ AGENTS.md
3. Run: git commit -m "Add exec-plans workflow guidance"
Common Mistakes to Avoid
❌ Mistake 1: Making AGENTS.md Too Long
Wrong: Adding verbose descriptions to AGENTS.md
Right: Keep compressed, table-based navigation only
❌ Mistake 2: Not Updating Index Files
Wrong: Creating new file without updating parent index.md
Right: Always update corresponding index.md
❌ Mistake 3: Inconsistent Naming
Wrong: Creating README.md (except in exec-plans/) or adr-1-topic.md
Right: Use index.md (or exec-plans/README.md as exception) and adr-0001-topic.md
❌ Mistake 4: Duplicating Content
Wrong: Copying content from dev-guide/guidelines
Right: Link to authoritative source or reformat for AI agents
❌ Mistake 5: Documenting Without Verification
Wrong: Patterns from memory, API fields without checking github.com/openshift/api, unverified conventions
Right: Verify in actual code, link to type definitions (k8s/apimachinery, openshift/api), check multiple repos for patterns
See Also
- Platform Documentation (openshift/enhancements/ai-docs/) - Existing platform docs
/component-docs - Create component documentation