openshift-eng/ai-helpers/component-docs
Claude Code and agent skill by openshift-eng/ai-helpers
- community
Checking that the SKILL.md file is still in the repository.
Create lean component documentation for OpenShift repositories
Install
npx vskill@latest install openshift-eng/ai-helpers/component-docsSKILL.md
The same SKILL.md was published earlier as openshift-eng/ai-helpers/component-docs.
Component Documentation Creator
Creates lean component agentic documentation for OpenShift component repositories.
Philosophy: Component docs contain ONLY component-specific knowledge. Generic platform patterns live in the openshift/enhancements repo (dev-guide/, guidelines/, CONVENTIONS.md). Code is the source of truth — read it, verify claims against it, but link to existing repo docs that explain the "why".
Two-Tier Architecture
Platform: openshift/enhancements
Contains: Development conventions (dev-guide/), coding standards (CONVENTIONS.md), enhancement guidelines (guidelines/), cross-repo architectural context
Component: Component Repos (LEAN)
Contains: Component-specific architecture, behavioral contracts, development guides, test patterns
Decision Rule: "Would another repo need to duplicate this?"
- YES → Platform (platform)
- NO → Component (component)
What Gets Created
What NOT to Include (lives in Platform)
❌ Generic framework patterns (controller-runtime, status conditions, common libraries) ❌ Testing practices (test pyramid, E2E framework) ❌ Security practices (STRIDE, RBAC guidelines) ❌ Reliability practices (SLO framework) ❌ Kubernetes fundamentals (Pod, Node, Service) ❌ Cross-repo ADRs (etcd, CVO orchestration, immutable nodes)
Hosted knowledge resources
If running inside the Chai Bot environment, use the documentation and other resources configured there, including Slack, Jira, and CodeRAG knowledge. Verify cross-repository facts against authoritative sources, such as upstream GitHub sources or Chai Bot's configured CodeRAG. See Phase 1 for specific query steps.
Execution Workflow
Phase 1: Setup
- [ ] Read existing CLAUDE.md / AGENTS.md before overwriting: If the repo already has either file, read it first and extract important points (build instructions, critical warnings, repo conventions, key patterns, retrieval priorities, documentation maps, and useful direct links) to incorporate into the generated docs. Existing content is prior work — preserve it, don't overwrite blindly.
- [ ] Back up prior agent docs before writing: Save any existing
CLAUDE.md/AGENTS.mdcontent underai-docs/_sources/. Use them as temporary source material for review and recovery during generation. - [ ] Discover existing repo docs: Scan
docs/,docs/enhancements/,design/,CONTRIBUTING.md, and any files with "design", "proposal", "enhancement" in the name. These will be linked from ENHANCEMENTS.md and ARCHITECTURE.md as appropriate. Also scan documentation files at the repository root and look elsewhere throughout the repository for relevant documentation, regardless of filename or location. - [ ] Record documentation sources used: As existing repository documents are
used as sources, record each repo-relative path in ai-docs/_sources/repository-docs-used.txt, one path per line.
- [ ] Resolve this skill directory from the location of the loaded
SKILL.md. Resolve allscripts/,templates/, andguides/paths relative to it. Do not search a plugin cache or assume the repository is the current directory. - [ ] Preflight required resources:
scripts/create-structure.sh,scripts/validate.sh,scripts/cleanup-sources.sh, all referenced templates, and any guide required by the selected execution path. Stop before writing if a required resource is unavailable. - [ ] Determine repo path:
REPO_PATH="${provided_path:-$PWD}" - [ ] Detect component name from repo (e.g., machine-config-operator → MCO)
- [ ] Run the resolved
scripts/create-structure.shwith"$REPO_PATH". - [ ] Gather tribal knowledge (Chai Bot / hosted environment): If knowledge tools (researcher, Slack, Jira) are available, query them for tribal knowledge about this repository:
- Search for
"<repo-name> convention OR pitfall OR mistake OR gotcha" - Search for
"<repo-name> review process OR reviewer expectations" - Search for
"<repo-name> common rejection OR frequently rejected" - Search for
"<repo-name> design decision OR historical context" - Save findings to
ai-docs/_sources/tribal-knowledge-notes.mdfor use in later phases - If no hosted knowledge tools are available, skip this step
Phase 2: Create AGENTS.md (40-60 lines)
- [ ] Create initial AGENTS.md at repo root using
templates/AGENTS-template.md - [ ] If existing AGENTS.md/CLAUDE.md was found in Phase 1, incorporate its critical warnings and conventions
- [ ] Treat
AGENTS.mdas the executive summary only. If the oldCLAUDE.mdcontains longer repo-specific operational detail (release/bundle commands, CI/Konflux notes, metrics/debugging guidance), move that detail intoDEVELOPMENT.mdorARCHITECTURE.mdinstead of dropping it. - [ ] Preserve valuable navigation from prior agent docs. Keep compact, frequently used direct links in
AGENTS.md. A detailed "need → start here" map may move toARCHITECTURE.mdorENHANCEMENTS.md, butAGENTS.mdmust link directly to that map. Do not replace useful deep links with only a bare directory name. - [ ] Include architecture-at-a-glance summary
- [ ] Revisit after Phase 4: Fill in the Critical Warnings section with 3-5 "never do X" rules discovered during architecture exploration
- [ ] Create CLAUDE.md symlink:
ln -sf AGENTS.md "$REPO_PATH/CLAUDE.md" - [ ] Validate line count:
wc -l AGENTS.md(target: 40-60)
Phase 3: ENHANCEMENTS.md (Optional)
- [ ] Search component repo for local design docs:
- Check docs/, design/, enhancements/ directories
- Check for files with "design", "proposal", "enhancement" in name
- [ ] Search openshift/enhancements repo for component-specific proposals:
- Check
https://github.com/openshift/enhancements/tree/master/enhancements/{component-area}/ - [ ] Search for related upstream KEPs (Kubernetes Enhancement Proposals)
- [ ] Only create ai-docs/ENHANCEMENTS.md if content exists — do not create an empty file
- [ ] Format: title, status (implemented/provisional/rejected), link only — keep concise
- [ ] Link to all found docs — these are authoritative sources, the enhancement is the source of truth
- [ ] Note: Enhancement proposals are feature designs (often cross-component). Key architectural decisions go inline in ARCHITECTURE.md "Design References" section, not here.
Phase 4: Component Architecture (ARCHITECTURE.md)
- [ ] Read one complete implementation first: Pick one controller/component package (preferably the most recently added). Read ALL files in it — not just controller.go, but constants, utils, every reconciler file, install sequence, and tests. This is your reference implementation. Document every pattern you observe: how it applies resources, what shared utilities it calls, what predicates it uses, what constants it defines, what env vars it reads. If the repo has 2+ similar components, compare them — divergences in approach are the most valuable thing to document ("use X pattern from component A, not Y pattern from component B").
- [ ] Detect repo type: Check for operator signals (
controller-runtime,library-go,operator-sdk, OLM bundle inbundle/, CRDs inconfig/crd/). If operator detected, follow the Operator-Specific Discovery checklist below in addition to the generic checklist. - [ ] Explore remaining codebase: Read entrypoints, key packages, dependencies. Follow the Implementation Pattern Discovery checklist below.
- [ ] Create
ai-docs/ARCHITECTURE.mdwith the following required sections:
ARCHITECTURE.md Required Sections (target: 200-400 lines):
- Repository Layout — annotated directory tree with actionable annotations ("DO NOT use X for Y")
- Key Domain Concepts — the core abstractions an agent must understand before touching this codebase. Not struct fields (agents read types.go), but the mental model: what are the primary resources, how do they relate, what are the key lifecycle flows. For operators: trace the primary end-to-end workflow (e.g., "user creates CR → controller renders config → daemon applies to node → node reboots"). For libraries: what are the key interfaces and their contracts. This section answers "what does this system DO" before the next sections explain "how is it BUILT"
- Component/Controller Details — framework, startup sequence, per-controller tables
- Resource Management — apply methods per controller (SSA, strategic merge, Create/Update), image resolution, deployment hooks
- Feature Gates — definition → runtime check → startup wiring chain
- Error Classification — error types, requeue behavior, status condition effects
- OpenShift Integration Points — upstream project dependencies, OpenShift component integrations (CNO, CCO, OLM, proxy, TLS, etc.) with integration tables
- Generated Code Inventory — generated files/dirs with "NEVER hand-edit" + make target
- API Behavioral Contracts — behavioral knowledge that agents can't get from reading types.go alone: singleton constraints, naming conventions, merging order, lifecycle flows, config drift detection, plugin behaviors, gotchas, "DO NOT" rules. Point agents to types.go / api/ for actual struct field definitions
- Form Factor Behavior (if applicable) — how the component behaves across deployment topologies: Standalone, SNO (replica adjustments, resource constraints), HCP/Hosted Control Planes (which cluster does it run in, cross-cluster communication), MicroShift (does it run, config alternatives). Only document form factors the code actually handles. Table format preferred
- Design References — 2-3 key architectural decisions inline (5-8 lines each: title, decision, rationale, consequences). Link to existing repo design docs (from docs/) where they provide deeper detail
- Platform Documentation — link to the openshift/enhancements repo for generic platform patterns. Reference stable paths:
dev-guide/for development conventions,guidelines/for enhancement process,CONVENTIONS.mdfor coding standards. Do NOT link to specific files underai-docs/— that structure is subject to change
- [ ] Document discovered patterns using the discovery checklist results
- [ ] Link to existing repo docs (from
docs/, design docs) where they provide deeper detail — ARCHITECTURE.md is a map, not a replacement for existing documentation - [ ] Keep lean but dense (every line should tell the reader something they can't infer from file names alone)
- [ ] Every pattern claim must include a file:line reference. If you can't point to source, flag as unverified
- [ ] Integrate tribal knowledge: If
ai-docs/_sources/tribal-knowledge-notes.mdexists from Phase 1, incorporate relevant findings: - Historical design decisions → "Design References" section
- Cross-repo interaction patterns → "OpenShift Integration Points" section
- Attribute integrated knowledge where it adds credibility (e.g. "Historically, the team has...")
Phase 5: Development & Testing Docs
- [ ] VERIFY FIRST:
```bash # Go version grep "^go " "$REPO_PATH/go.mod"
# Branch name (no clone needed) — uses first remote found _remote=$(git remote | head -1) git ls-remote --symref "$(git remote get-url "$_remote")" HEAD | grep 'ref:' | awk '{print $2}' | cut -d/ -f3
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 98 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/agentic-docs/skills/component-docs/SKILL.md
Popularity
- Repository stars
- 114
- Repository forks
- 307
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openshift-eng/ai-helpers/component-docs)