Skip to content

Commit cda54c9

Browse files
committed
Refine add-enhancement command
Add refinement to stop breaking lines if it turns them invalid (URL, code), to support OKE, and some other refinements on how the enhancement should be generated
1 parent 69ca07c commit cda54c9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.claude/commands/add-enhancement.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ You are tasked with creating a new OpenShift Enhancement Proposal based on the t
2424

2525
Act as an experienced software architect to create a comprehensive enhancement proposal. Follow these steps:
2626

27+
**Important**: Reference the guidance in `dev-guide/feature-zero-to-hero.md`, particularly the section "Writing an OpenShift Enhancement", when creating enhancement proposals. This guide provides essential context on the OpenShift Enhancement Proposal process, feature gates, API design conventions, testing requirements, and promotion criteria.
28+
2729
1. **Parse the Description**: Extract the following from the description:
2830
- **What**: What is this enhancement about
2931
- **Why**: Why this change is required (motivation)
@@ -33,8 +35,9 @@ Act as an experienced software architect to create a comprehensive enhancement p
3335
- Specific user stories or motivations if not clear from the description
3436
- Explicit Goals or Non-Goals the user wants included
3537
- Any specific technical constraints or requirements
36-
- Topology considerations (Hypershift, SNO, MicroShift relevance)
37-
- Whether this proposal adds/changes CRDs, admission and conversion webhooks, aggregated API servers, or finalizers (needed for API Extensions section)
38+
- Topology considerations (Hypershift, SNO, MicroShift, OKE relevance)
39+
- Whether this proposal adds/changes CRDs, admission and conversion webhooks, ValidatingAdmissionPlugin, MutatingAdmissionPlugin, aggregated API servers, or finalizers (needed for API Extensions section)
40+
- Feature gate information: According to dev-guide/feature-zero-to-hero.md, ALL new OpenShift features must start disabled by default using feature gates. Ask about the proposed feature gate name and initial feature set (DevPreviewNoUpgrade or TechPreviewNoUpgrade).
3841
- Ask clarifying questions about telemetry, security, upgrade and downgrade process, rollbacks, dependencies, in case it is not possible to assert these fields.
3942

4043
3. **Generate the Enhancement File**:
@@ -45,14 +48,18 @@ Act as an experienced software architect to create a comprehensive enhancement p
4548
- **Motivation**: Explain why this change is required based on the description
4649
- **User Stories**: Generate 2-4 user stories based on the "who" information using the format:
4750
> "As a _role_, I want to _take some action_ so that I can _accomplish a goal_."
48-
- **Goals**: List specific, measurable goals (3-5 items)
51+
Include a story on how the proposal will be operationalized: life-cycled, monitored and remediated at scale.
52+
- **Goals**: List specific, measurable goals (3-5 items). Goals should describe what users want from their perspective, not implementation details.
4953
- **Non-Goals**: List what is explicitly out of scope (2-3 items)
5054
- **Proposal**: High-level description of the proposed solution
5155
- **Workflow Description**: Detailed workflow with actors and steps
52-
- **Mermaid Diagram**: Add a sequence diagram when applicable to visualize the workflow
53-
- **API Extensions**: Only fill this section if the user confirms the proposal adds/changes CRDs, admission and conversion webhooks, aggregated API servers, or finalizers. Otherwise, add a TODO comment asking the user to complete this section if applicable.
54-
- **Implementation Details/Notes/Constraints**: Provide a high-level overview of the code changes required. Follow the guidance from the template: "While it is useful to go into the details of the code changes required, it is not necessary to show how the code will be rewritten in the enhancement." Keep it as an overview; the developer should fill in the specific implementation details.
55-
- **Metadata**: Fill in creation-date with today's date, tracking-link with the provided JIRA ticket URL, set other fields to TBD
56+
- **Mermaid Diagram**: Add a sequence diagram when the workflow involves multiple actors or complex interactions between components (e.g., user -> API server -> controller -> operator). Simple single-actor workflows may not need a diagram.
57+
- **API Extensions**: Only fill this section if the user confirms the proposal adds/changes CRDs, admission and conversion webhooks, ValidatingAdmissionPlugin, MutatingAdmissionPlugin, aggregated API servers, or finalizers. Per the template, name the API extensions and describe if this enhancement modifies the behaviour of existing resources. Otherwise, add a TODO comment asking the user to complete this section if applicable.
58+
- **Topology Considerations**: Include subsections for Hypershift/Hosted Control Planes, Standalone Clusters, Single-node Deployments or MicroShift, and OKE (OpenShift Kubernetes Engine). Address how the proposal affects each topology.
59+
- **Implementation Details/Notes/Constraints**: Provide a high-level overview of the code changes required. Follow the guidance from the template: "While it is useful to go into the details of the code changes required, it is not necessary to show how the code will be rewritten in the enhancement." Keep it as an overview; the developer should fill in the specific implementation details. Include a reminder about creating a feature gate: Per dev-guide/feature-zero-to-hero.md, all new features must be gated behind a feature gate in https://github.com/openshift/api/blob/master/features/features.go with the appropriate feature set (DevPreviewNoUpgrade or TechPreviewNoUpgrade initially).
60+
- **Test Plan**: Add a TODO comment with guidance on required test labels per dev-guide/feature-zero-to-hero.md: Tests must include `[OCPFeatureGate:FeatureName]` label for the feature gate, `[Jira:"Component Name"]` for the component, and appropriate test type labels like `[Suite:...]`, `[Serial]`, `[Slow]`, or `[Disruptive]` as needed. Reference dev-guide/test-conventions.md for details.
61+
- **Graduation Criteria**: Add a TODO comment referencing the specific promotion requirements from dev-guide/feature-zero-to-hero.md: minimum 5 tests, 7 runs per week, 14 runs per supported platform, 95% pass rate, and tests running on all supported platforms (AWS, Azure, GCP, vSphere, Baremetal with various network stacks).
62+
- **Metadata**: Fill in creation-date with today's date, tracking-link with the provided JIRA ticket URL, set other fields to TBD. For api-approvers: use "None" if there are no API changes (no new/modified CRDs, webhooks, aggregated API servers, or finalizers); otherwise use "TBD" as a placeholder (the enhancement author will request an API reviewer from the #forum-api-review Slack channel later).
5663

5764
4. **Handle Unfilled Sections**: For sections that cannot be filled based on the input:
5865
- Add a clear comment like `<!-- TODO: This section needs to be filled in -->`
@@ -63,7 +70,11 @@ Act as an experienced software architect to create a comprehensive enhancement p
6370
- Focus on the essential information
6471
- Use bullet points and structured formatting
6572
- Avoid unnecessary verbosity
66-
- **Line Length**: Keep lines in the generated enhancement at a maximum of 80 characters. It is acceptable to exceed by 10-15 characters when necessary (e.g., for URLs or code examples), but not more than that.
73+
- **Line Length**: Keep lines in the generated enhancement at a maximum of 80 characters, but prioritize validity over line length limits. Only break lines at 80 characters if doing so will NOT create:
74+
- Invalid or broken URLs (URLs themselves should never be split, but the line CAN and SHOULD be broken before or after the URL)
75+
- Invalid markdown syntax (e.g., breaking markdown links, code blocks, or formatting)
76+
- Invalid code examples (e.g., breaking code in the middle of statements)
77+
If breaking at 80 characters would split a URL, code, or markdown syntax, find the nearest valid break point such as: after a sentence, before a URL starts, after a URL ends, or at a natural paragraph break. For regular prose, it is acceptable to exceed 80 characters by 10-15 characters to avoid breaking words mid-word. Only allow lines >95 characters when the line contains a single unbreakable element (like a standalone URL with no surrounding text, or a single line of code).
6778

6879
6. **Validate**:
6980
- Ensure the area directory exists under `enhancements/`

0 commit comments

Comments
 (0)