ワンクリックで
component-docs
Create lean component documentation for OpenShift repositories
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Create lean component documentation for OpenShift repositories
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | component-docs |
| description | Create lean component documentation for OpenShift repositories |
| trigger | explicit |
Creates lean component agentic documentation for OpenShift component repositories.
Philosophy: Component docs contain ONLY component-specific knowledge. Generic platform patterns live in platform (openshift/enhancements/ai-docs/).
Contains: Operator patterns, testing practices, security guidelines, Kubernetes/OpenShift fundamentals, cross-repo ADRs
Contains: Component-specific APIs/types, component architecture, component ADRs, exec-plans
Decision Rule: "Would another repo need to duplicate this?"
component-repo/
├── AGENTS.md # Master entry point (80-100 lines)
└── ai-docs/
├── domain/ # Component APIs/types
├── architecture/ # Component internals
│ └── components.md
├── decisions/ # Component ADRs ONLY
│ ├── adr-0001-*.md
│ └── adr-template.md
├── exec-plans/
│ ├── active/ # Features being implemented
│ └── README.md # Pointer to Platform guidance
├── references/
│ ├── ecosystem.md # Links to Platform (CRITICAL)
│ └── enhancements.md # Enhancement proposals & design docs
├── [COMPONENT]_DEVELOPMENT.md
└── [COMPONENT]_TESTING.md
❌ 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)
SKILL_DIR=$(find ~/.claude/plugins/cache -path "*/component-docs" -type d | head -1)REPO_PATH="${provided_path:-$PWD}"bash "$SKILL_DIR/scripts/create-structure.sh" "$REPO_PATH"templates/AGENTS-template.mdwc -l AGENTS.md (target: 80-100)oc api-resources, or config/crd/# Replace <TypeName> with the actual type (e.g., MachineSet, Build, Route)
# If types live in openshift/api
[ ! -d "/tmp/openshift-api" ] && git clone --depth 1 https://github.com/openshift/api.git /tmp/openshift-api
find /tmp/openshift-api -name "types*.go" | xargs grep -A30 "type <TypeName>"
# OR in component repo
find . -name "types*.go" -o -name "types.go" | xargs grep -A30 "type <TypeName>"
Read actual source, document ONLY existing fields with correct typestemplates/domain-concept-template.md for structurehttps://github.com/openshift/enhancements/tree/master/enhancements/{component-area}/controller-runtime, library-go, operator-sdk, OLM bundle in bundle/, CRDs in config/crd/). If operator detected, follow the Operator-Specific Discovery checklist below in addition to the generic checklist.templates/ecosystem-template.md# 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
# Makefile targets
grep "^[a-zA-Z-]*:" Makefile | cut -d: -f1
# Directory structure
ls -d cmd pkg test manifests 2>/dev/null
bash "$SKILL_DIR/scripts/validate.sh" "$REPO_PATH" (includes link validation)grep -r "client.Apply\|r.Update\|resourceapply" pkg/controller/<name>/). Verify feature gate claims trace to actual runtime code. Verify image env var names match Makefile/CSV.Link Validation:
VERBOSE=true bash "$SKILL_DIR/scripts/validate.sh" "$REPO_PATH" to see all links including successful ones/review-docs to verify claims?"
/review-docs --path "$REPO_PATH"Skipping verification. Documentation may contain:
- Incorrect API field claims
- Wrong branch/version references
- Unverified pattern claims (SSA vs strategic merge, etc.)
Recommend running `/review-docs` before creating PRs to catch hallucinations.
Note: /review-docs verifies claims locally against the repo's source code (including vendored dependencies) first, then uses chai-bot MCP for cross-repo verification (enhancements, platform terminology, convention compliance). Local verification works without any setup. Chai-bot is needed for cross-functional checks and requires VPN + MCP configuration — see review-docs skill.
Use this checklist during Phase 5 when exploring the codebase. These patterns produce the most valuable documentation — the kind that prevents an agent from writing subtly incorrect code.
| Pattern | How to Discover | What to Document |
|---|---|---|
| Multiple paradigms | Do different packages use different frameworks or approaches for similar tasks? | Comparison table with "use X for Y, never Z for Y" guidance |
| Shared utilities | Is there a common/, shared/, utils/, or internal/ package used across components? | Exact exported symbols with one-line usage contract |
| Wiring/registration | How do new components get registered and started? How does work get dispatched to them? | Startup sequence, event/trigger flow, where to hook in new components |
| Resource management | How does code create/update external resources? (SSA, strategic merge, REST calls, etc.) | Actual method with code reference — verify in code, don't assume |
| Naming conventions | Grep for patterns in env vars, labels, file names, package names | Exact format with examples |
| Feature toggles | Are there feature gates, flags, or config-driven enablement? | Definition → runtime check → wiring chain |
| Anti-patterns | Search for "DO NOT", "NEVER", "MUST", "HACK" in code comments. Study 2-3 existing implementations to identify shared patterns and things they avoid | Numbered "DO NOT" list with brief explanation |
When the repo is a Kubernetes/OpenShift operator (detected via controller-runtime, library-go, OLM bundle, CRDs), also investigate these patterns. Skipping them produces docs that look correct but cause agents to write subtly wrong code.
| Pattern | How to Discover | What to Document |
|---|---|---|
| Controller framework split | Check imports in EACH controller package for library-go vs controller-runtime. Don't assume uniformity. | Per-controller table: framework, apply method (client.Apply vs resourceapply vs Create+Update), code ref. |
| Reconciliation apply method | For EACH controller: grep -r "client.Apply|r.Update|r.Create|resourceapply" pkg/controller/<name>/ | Actual method per controller. This is the #1 source of hallucinations — the cert-manager-operator review found docs claiming "all controllers use SSA" when only one of three did. |
| Feature gate runtime behavior | Read features.go end-to-end. Trace from definition → runtime check → startup wiring. | Full chain. For TechPreview: cluster-side gating (FeatureSet discovery, fail-closed). Don't just list gate names. |
| Image resolution & OLM bundle | grep -r RELATED_IMAGE Makefile bundle/. Check Makefile for *_VERSION vars. Check bundle/manifests/ for CSV. | Env var naming convention, version variables, how OLM injects images. CSV update checklist (env vars, RBAC, relatedImages). |
| Error classification | Check common/ for error wrapper types (IrrecoverableError, RetryRequiredError). | Which types exist, effect on requeue behavior. |
| Generated code & bindata pipeline | find . -name "zz_generated*" -o -name "bindata.go" -o -path "*/clientset/*". Check Makefile for generation targets. | Generated files/dirs with "NEVER hand-edit" + make target. For bindata: version var → hack script → output dir → Go loading. |
| Status conditions & OpenShift integrations | Check for library-go OperatorStatus vs custom conditions. Grep for proxy, trusted-CA, TLS profile, CCO references. | Which condition system, which integrations exist — only document what's present. |
pkg/controller/foo/deployments.go:40). If you can't point to source, you're inferring — flag it as unverified instead of stating it as factLength: 80-100 lines (strict limit)
Required Sections:
Format: Compressed, table-based, links not prose. Use templates/AGENTS-template.md.
✅ AGENTS.md: At repo root, 80-100 lines, compressed index, retrieval-first instruction, Platform links, critical pattern warnings
✅ No duplication: No generic framework explanations, no testing pyramid, no security frameworks
✅ References: ecosystem.md with Platform links, enhancements.md with design docs catalog
✅ Component-specific only: Domain concepts are component-specific, ADRs are component-specific, architecture is component internals
✅ Link validation: All external links return 200 OK, all internal links resolve
✅ Implementation patterns: Architecture doc has discovery checklist results, shared utilities listed with exact symbols, anti-patterns documented
✅ Operator accuracy (if operator repo): Apply method documented per-controller (not assumed uniform), feature gate runtime behavior traced, generated code inventory listed, image resolution mechanism documented
Wrong: 187-line TESTING.md where 60% is generic test pyramid explanation Right: 90-line COMPONENT_TESTING.md that's 100% component-specific, links to Platform
Wrong: Explaining framework internals in component docs Right: Link to Platform, document component-specific usage only
Wrong: ADR about shared infrastructure in component repo Right: That ADR belongs in Platform
Wrong: Type fields from memory, outdated conventions, pattern claims without code evidence Right: Verify in source code, check actual branch names, confirm patterns exist, link to sources
Wrong: "Add new controller: 1. Create controller.go 2. Implement Reconcile() 3. Register" Right: Repo-specific steps with exact file paths, shared utilities to use, registration wiring, and naming conventions
/component-docs [--path <repository-path>]
--path <repository-path>: Path to component repository (default: current directory)✅ Component Documentation Created
Component: [component-name]
Repository: [path]
Structure:
✅ AGENTS.md (root): XX lines (target: 80-100)
✅ Domain concepts: N files
✅ Architecture: components.md
✅ Component ADRs: N files
✅ References: ecosystem.md, enhancements.md
✅ Development: COMPONENT_DEVELOPMENT.md
✅ Testing: COMPONENT_TESTING.md
Next Steps:
1. Run `/review-docs` to verify claims locally + cross-repo via chai-bot (recommended)
2. Review generated documentation for accuracy
3. Create PR with documentation changes
/review-docs - Verify documentation claims locally and cross-repo via chai-bot (recommended after creation)/update-platform-docs - Update Platform documentationGenerate a comprehensive manual testing guide from a Jira issue, GitHub PR URLs, or both. Use when the user wants test steps, a QE test plan, or a testing guide for code changes.
Create Jira issues — story, bug, epic, feature, initiative, task, or feature-request — with CNTRLPLANE, OCPBUGS, GCP, HyperShift, ARO, ROSA conventions and type-specific templates
Generate triage reports and post findings to Jira and Slack
Query and deduplicate open CVE vulnerability issues from OCPBUGS for Node team components
Check whether a Jira issue is well-groomed and ready for /jira:solve
Analyze and compare disruption across one or more Prow CI job runs by examining interval data, audit logs, pod logs, and CPU metrics