Skip to content

Commit a24ca59

Browse files
Merge pull request #94 from jparrill/CNTRLPLANE-1732
CNTRLPLANE-1732: feat(hcp): add HyperShift cluster command generator plugin
2 parents 2157c19 + f1fb091 commit a24ca59

File tree

12 files changed

+2616
-0
lines changed

12 files changed

+2616
-0
lines changed

.claude-plugin/marketplace.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
"name": "must-gather",
6969
"source": "./plugins/must-gather",
7070
"description": "A plugin to analyze and report on must-gather data"
71+
},
72+
{
73+
"name": "hcp",
74+
"source": "./plugins/hcp",
75+
"description": "Generate HyperShift cluster creation commands via hcp CLI from natural language descriptions"
7176
}
7277
]
7378
}

PLUGINS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This document lists all available Claude Code plugins and their commands in the
66
- [Ci](#ci-plugin)
77
- [Doc](#doc-plugin)
88
- [Git](#git-plugin)
9+
- [Hcp](#hcp-plugin)
910
- [Hello World](#hello-world-plugin)
1011
- [Jira](#jira-plugin)
1112
- [Must Gather](#must-gather-plugin)
@@ -61,6 +62,15 @@ Git workflow automation and utilities
6162

6263
See [plugins/git/README.md](plugins/git/README.md) for detailed documentation.
6364

65+
### Hcp Plugin
66+
67+
Generate HyperShift cluster creation commands via hcp CLI from natural language descriptions
68+
69+
**Commands:**
70+
- **`/hcp:generate` `<provider> <cluster-description>`** - Generate ready-to-execute hypershift cluster creation commands from natural language descriptions
71+
72+
See [plugins/hcp/README.md](plugins/hcp/README.md) for detailed documentation.
73+
6474
### Hello World Plugin
6575

6676
A hello world plugin

docs/data.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,52 @@
457457
}
458458
],
459459
"has_readme": true
460+
},
461+
{
462+
"name": "hcp",
463+
"description": "Generate HyperShift cluster creation commands via hcp CLI from natural language descriptions",
464+
"version": "0.0.1",
465+
"commands": [
466+
{
467+
"name": "generate",
468+
"description": "Generate ready-to-execute hypershift cluster creation commands from natural language descriptions",
469+
"synopsis": "/hcp:generate <provider> <cluster-description>",
470+
"argument_hint": "<provider> <cluster-description>"
471+
}
472+
],
473+
"skills": [
474+
{
475+
"name": "HyperShift Agent Provider",
476+
"id": "hcp-create-agent",
477+
"description": "Use this skill when you need to deploy HyperShift clusters on bare metal, edge environments, or disconnected infrastructures using pre-provisioned agents"
478+
},
479+
{
480+
"name": "HyperShift AWS Provider",
481+
"id": "hcp-create-aws",
482+
"description": "Use this skill when you need to deploy HyperShift clusters on AWS infrastructure with proper STS credentials, IAM roles, and VPC configuration"
483+
},
484+
{
485+
"name": "HyperShift Azure Provider",
486+
"id": "hcp-create-azure",
487+
"description": "Use this skill when you need to deploy HyperShift clusters on Microsoft Azure with proper identity configuration and resource management"
488+
},
489+
{
490+
"name": "HyperShift KubeVirt Provider",
491+
"id": "hcp-create-kubevirt",
492+
"description": "Use this skill when you need to deploy HyperShift clusters on existing Kubernetes clusters using KubeVirt virtualization"
493+
},
494+
{
495+
"name": "HyperShift OpenStack Provider",
496+
"id": "hcp-create-openstack",
497+
"description": "Use this skill when you need to deploy HyperShift clusters on OpenStack infrastructure with proper flavor selection and network configuration"
498+
},
499+
{
500+
"name": "HyperShift PowerVS Provider",
501+
"id": "hcp-create-powervs",
502+
"description": "Use this skill when you need to deploy HyperShift clusters on IBM Cloud PowerVS with proper processor configuration and resource management"
503+
}
504+
],
505+
"has_readme": true
460506
}
461507
]
462508
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "hcp",
3+
"description": "Generate HyperShift cluster creation commands via hcp CLI from natural language descriptions",
4+
"version": "0.0.1",
5+
"author": {
6+
"name": "github.com/openshift-eng"
7+
}
8+
}

plugins/hcp/README.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# HCP Plugin
2+
3+
The HCP plugin generates intelligent `hypershift create cluster` commands from natural language descriptions across multiple cloud providers and platforms.
4+
5+
## Overview
6+
7+
This plugin translates natural language descriptions into precise, ready-to-execute `hypershift create cluster` commands, applying provider-specific best practices and handling complex parameter validation automatically. The plugin **generates commands for you to run** - it does not provision clusters directly.
8+
9+
## Commands
10+
11+
### `/hcp:generate`
12+
13+
Generate ready-to-execute hypershift cluster creation commands from natural language descriptions.
14+
15+
**Usage:**
16+
```
17+
/hcp:generate <provider> <cluster-description>
18+
```
19+
20+
**Supported Providers:**
21+
- `aws` - Amazon Web Services
22+
- `azure` - Microsoft Azure (self-managed control plane)
23+
- `kubevirt` - KubeVirt on existing Kubernetes clusters
24+
- `openstack` - OpenStack clouds
25+
- `powervs` - IBM Cloud PowerVS
26+
- `agent` - Bare metal and edge deployments
27+
28+
**Examples:**
29+
```bash
30+
# AWS development cluster
31+
/hcp:generate aws "development cluster for testing new features"
32+
33+
# High-availability KubeVirt cluster
34+
/hcp:generate kubevirt "production cluster with high availability"
35+
36+
# Cost-optimized Azure cluster
37+
/hcp:generate azure "small cluster for dev work, minimize costs"
38+
39+
# Disconnected bare metal cluster
40+
/hcp:generate agent "airgapped cluster for secure environment"
41+
```
42+
43+
## Key Features
44+
45+
- **Multi-Provider Support**: Works with AWS, Azure, KubeVirt, OpenStack, PowerVS, and Agent providers
46+
- **Smart Analysis**: Extracts requirements from natural language descriptions
47+
- **Interactive Prompts**: Guides users through provider-specific configurations
48+
- **Best Practices**: Applies provider-specific defaults and optimizations
49+
- **Security Validation**: Ensures safe parameter handling and credential management
50+
- **Network Conflict Prevention**: Especially critical for KubeVirt deployments
51+
52+
## Provider-Specific Skills
53+
54+
The plugin uses specialized skills for each provider:
55+
56+
- **`hcp-create-aws`**: AWS-specific guidance including STS credentials, IAM roles, and VPC configuration
57+
- **`hcp-create-azure`**: Azure identity configuration, resource groups, and region management
58+
- **`hcp-create-kubevirt`**: Network conflict prevention, VM sizing, and storage class management
59+
- **`hcp-create-openstack`**: OpenStack credentials, external networks, and flavor selection
60+
- **`hcp-create-powervs`**: IBM Cloud integration, processor types, and resource group management
61+
- **`hcp-create-agent`**: Bare metal deployment, agent management, and disconnected environments
62+
63+
## Installation
64+
65+
### From AI Helpers Marketplace
66+
67+
```bash
68+
# Add the marketplace
69+
/plugin marketplace add openshift-eng/ai-helpers
70+
71+
# Install the HCP plugin
72+
/plugin install hcp@ai-helpers
73+
74+
# Use the command
75+
/hcp:generate aws "development cluster for API testing"
76+
```
77+
78+
### Manual Installation (Cursor)
79+
80+
```bash
81+
# Clone the repository
82+
mkdir -p ~/.cursor/commands
83+
git clone [email protected]:openshift-eng/ai-helpers.git
84+
ln -s ai-helpers ~/.cursor/commands/ai-helpers
85+
```
86+
87+
## Common Use Cases
88+
89+
### Development Environments
90+
- Quick cluster setup for testing
91+
- Cost-optimized configurations
92+
- Single replica control planes
93+
94+
### Production Deployments
95+
- High-availability configurations
96+
- Multi-zone deployments
97+
- Auto-repair and monitoring enabled
98+
99+
### Edge Computing
100+
- Minimal resource footprints
101+
- Disconnected/airgapped environments
102+
- Agent-based deployments
103+
104+
### Special Requirements
105+
- FIPS compliance configurations
106+
- IPv6 and dual-stack networking
107+
- Custom storage and compute requirements
108+
109+
## Architecture
110+
111+
The plugin follows a modular architecture with:
112+
113+
1. **Main Command**: `/hcp:generate` acts as an orchestrator
114+
2. **Provider Skills**: Specialized implementation guidance for each provider
115+
3. **Interactive Workflows**: Guided parameter collection and validation
116+
4. **Smart Defaults**: Environment-specific best practices
117+
118+
This design ensures:
119+
- **Single Source of Truth**: Each provider's knowledge lives in one place
120+
- **Extensibility**: Easy to add new providers or update existing ones
121+
- **Maintainability**: Clear separation of concerns between providers
122+
123+
## Contributing
124+
125+
To add support for a new provider:
126+
127+
1. Create a new skill directory: `plugins/hcp/skills/hcp-create-<provider>/`
128+
2. Implement the `SKILL.md` file following the established pattern
129+
3. Update the main command to invoke the new skill
130+
4. Test the implementation and add examples
131+
132+
See existing skills as reference implementations.
133+
134+
## Support
135+
136+
- **Issues**: [GitHub Issues](https://github.com/openshift-eng/ai-helpers/issues)
137+
- **Documentation**: [HyperShift Documentation](https://hypershift.openshift.io/)
138+
- **Skills**: View individual skill files in `plugins/hcp/skills/`
139+
140+
## License
141+
142+
This plugin is part of the AI Helpers project and follows the same licensing terms.

0 commit comments

Comments
 (0)