-
Notifications
You must be signed in to change notification settings - Fork 23
Add AI skills for ramenctl commands #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nirs
wants to merge
20
commits into
RamenDR:main
Choose a base branch
from
nirs:init-skills
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bed5098
rules: Do not add Co-authored-by trailer to commits
nirs 908988b
skills: Add ramenctl-init skill template
nirs 04abffe
skills: Add ramenctl-validate-clusters skill template
nirs 96538bc
skills: Add ramenctl-validate-application skill template
nirs f8790ac
skills: Add ramenctl-gather-application skill template
nirs 5d4ab37
skills: Add ramenctl-test-{run,clean} skills templates
nirs 35284ed
skills: Add agent context templates
nirs 1ff2021
console: Add Warn and StepHint functions
nirs 4d2efcf
skills: Add Install API for agent skills and context files
nirs e74cc64
init: Install AI skills and improve init workflow
nirs 1b30cfe
docs: Add AI skills documentation and update command docs
nirs 52d7685
docs: Add init skills test cases to test plan
nirs de0a6d1
README: Add agentic usage section
nirs e3f2537
skills: Improve bob instructions
nirs 168597b
fixup markdown formatting
nirs 76f0c17
skills: ask user for output directory before running commands
nirs ff01f0e
skills: prevent agent from retrying timed-out commands
nirs 87b1488
skills: prevent agent from using timeouts and retrying commands
nirs ae4c810
skills: show config path for hub kubeconfig
nirs 7b6a31f
skills: use stronger timeout rules for bob agent
nirs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| <!-- SPDX-FileCopyrightText: The RamenDR authors --> | ||
|
|
||
| <!-- SPDX-License-Identifier: Apache-2.0 --> | ||
|
|
||
| # Using ramenctl with AI agents | ||
|
|
||
| *ramenctl* is agentic-ready out of the box. Running `ramenctl init` installs AI | ||
| skills that teach your coding assistant how to drive *ramenctl* for disaster | ||
| recovery on your clusters — no extra setup needed. | ||
|
|
||
| Start with the example session below to see what this feels like in practice. | ||
| After that you'll find the list of available skills, where they are installed, | ||
| and how to add support for a new agent. | ||
|
|
||
| ## Example session | ||
|
|
||
| The following is a short screenplay-style scene: a human and an agent use the | ||
| ramenctl skills. (Monospace block so it reads like a script and renders with a | ||
| distinct background on GitHub and most viewers.) | ||
|
|
||
| ```text | ||
| INT. CURSOR CHAT — DAY | ||
|
|
||
| USER | ||
| I ran ramenctl init --agent cursor. Help me configure ramenctl | ||
| for my clusters. My kubeconfigs are in ocp/: hub.yaml is the | ||
| hub, c1.yaml and c2.yaml are the managed clusters. | ||
|
|
||
| AGENT | ||
| (Edits config.yaml: fills kubeconfigs, reads ClusterClaims on c1 | ||
| and c2, matches names on the hub, sets clusterSet.) | ||
| Your config is ready. | ||
|
|
||
| USER | ||
| Can you check the clusters? | ||
|
|
||
| AGENT | ||
| (Runs ramenctl validate clusters -o ocp/clusters.) | ||
| Validation completed (91 ok, 0 warning, 0 problem). | ||
| (Opens validate-clusters.html in the browser.) | ||
|
|
||
| USER | ||
| Validate an application too. | ||
|
|
||
| AGENT | ||
| (Lists DRPCs on the hub.) | ||
| I found two applications: | ||
| 1. rbd4 (openshift-dr-ops) — FailedOver | ||
| 2. appset-deploy-rbd (openshift-gitops) — Deployed | ||
| Which one should I validate? | ||
|
|
||
| USER | ||
| rbd4. | ||
|
|
||
| AGENT | ||
| (Runs ramenctl validate application --name rbd4 --namespace | ||
| openshift-dr-ops -o ocp/rbd4.) | ||
| All clear. Opening validate-application.html. | ||
|
|
||
| USER | ||
| You are a very skillful agent! | ||
|
|
||
| AGENT | ||
| Glad it helped. | ||
| ``` | ||
|
|
||
| ## Available skills | ||
|
|
||
| | Skill | Description | | ||
| | ------------------------------- | -------------------------------------------------- | | ||
| | `ramenctl-init` | Create a configuration file for your clusters | | ||
| | `ramenctl-validate-clusters` | Validate disaster recovery cluster configuration | | ||
| | `ramenctl-validate-application` | Validate a DR-protected application | | ||
| | `ramenctl-gather-application` | Gather diagnostic data for a protected application | | ||
| | `ramenctl-test-run` | Run disaster recovery flow tests | | ||
| | `ramenctl-test-clean` | Clean up after test runs | | ||
|
|
||
| ## Where skills are installed | ||
|
|
||
| `ramenctl init` installs skills automatically. Use the `--agent` (`-a`) flag to | ||
| install in the format expected by your AI tool: | ||
|
|
||
| ```console | ||
| $ ramenctl init -a cursor | ||
| ``` | ||
|
|
||
| Supported agents: | ||
|
|
||
| | Agent | Flag | Skills directory | Context file | | ||
| | ----------- | ----------- | ----------------- | ---------------------------- | | ||
| | Bob | `-a bob` | `.bob/skills/` | `AGENTS.md` | | ||
| | Claude Code | `-a claude` | `.claude/skills/` | `CLAUDE.md` | | ||
| | Codex | `-a codex` | `.agents/skills/` | `AGENTS.md` | | ||
| | Cursor | `-a cursor` | `.cursor/skills/` | `.cursor/rules/ramenctl.mdc` | | ||
| | Generic | *(default)* | `.agents/skills/` | `AGENTS.md` | | ||
|
|
||
| > [!TIP] | ||
| > - When using the generic format, instruct your AI agent to read `AGENTS.md` | ||
| > for project context and skill discovery. | ||
| > - Bob requires advanced mode to discover skills. Use `/mode advanced` in the | ||
| > Bob chat before starting. | ||
|
|
||
| See [init](init.md) for more on creating the configuration file. | ||
|
|
||
| ## Adding a new agent | ||
|
|
||
| To add support for a new AI agent: | ||
|
|
||
| 1. Add a constant (e.g. `AgentMyTool = "my-agent"`) in `pkg/skills/agent.go`. | ||
| 1. Add an entry to the `agents` map in `pkg/skills/agent.go` with the tool's | ||
| display name, native skills directory, and context file path. | ||
| 1. Create a context file template `pkg/skills/templates/agents/my-agent.tmpl`. | ||
| The template receives the command name and skill list. Look at existing | ||
| templates for examples. | ||
| 1. Update the agent table in `docs/skills.md`. | ||
| 1. Add test cases in `pkg/skills/skills_test.go` for the new agent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.