Skip to content

[Feat] Implement 'add-cap-operator-skill' command to add CAP Operator agent skills#117

Open
anirudhprasad-sap wants to merge 9 commits into
mainfrom
skill
Open

[Feat] Implement 'add-cap-operator-skill' command to add CAP Operator agent skills#117
anirudhprasad-sap wants to merge 9 commits into
mainfrom
skill

Conversation

@anirudhprasad-sap

@anirudhprasad-sap anirudhprasad-sap commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Add add-cap-operator-skill Command for AI Coding Assistant Integration

New Feature

✨ Introduces a new add-cap-operator-skill command to the cap-op-plugin CLI. This command downloads the CAP Operator agent skill from a published tarball and installs it into the project's .agents/skills/cap-operator/ folder, enabling AI coding assistants (e.g., Claude Code) to understand and manage CAP Operator Kubernetes resources.

Key behaviors:

  • Default: Downloads skill files from https://sap.github.io/cap-operator/agent.tar.gz.
  • Re-run safe: The existing cap-operator skill directory is wiped before extraction, pruning stale files, while other skills under .agents/ remain untouched.

Changes

  • bin/cap-op-plugin.js:

    • Registered add-cap-operator-skill as a supported command in the SUPPORTED map.
    • Implemented httpGet() helper for HTTPS requests with redirect support.
    • Implemented addCapOperatorSkill() function that downloads the tarball from the published URL, prunes the existing skill directory, and extracts new skill files to .agents/skills/cap-operator/.
    • Added the new command to the CLI usage/help text with an example.
    • Renamed internal parameter yamlPathoptionValue for generality across all commands.
  • README.md:

    • Updated minimum @sap/cds-dk version requirement from >=8.2.1 to >=9.
    • Added a new documentation section for the add-cap-operator-skill command, including usage examples and instructions for integrating the skill with Claude Code.
  • test/cap-op-plugin.test.js:

    • Added a comprehensive test suite for the new command covering: live tarball extraction, file overwrite on re-run, stale file pruning, preservation of unrelated skills, and rejection of unknown options.
    • Updated usage help text snapshot test to include the new command.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.29.2

  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Summary Prompt: Default Prompt
  • Correlation ID: ca1b4df0-8770-11f1-8e60-bf27d5a0828c
  • Event Trigger: pull_request.edited
  • Output Template: Default Template

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR implements the add-cap-operator-skill command with reasonable test coverage, but has several issues worth addressing: a path-traversal vulnerability when writing tarball contents to disk, an uncaught JSON.parse exception in the HTTP response handler, an infinite redirect loop risk, and some test hygiene problems (dead helper function, mid-suite afterEach registration). The security concern around path traversal is the most important to resolve before merging.

PR Bot Information

Version: 1.29.2

  • Event Trigger: pull_request.opened
  • Experiment Variant: control
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: d1845160-8688-11f1-9a7a-e5bff9f4ce87

Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread test/cap-op-plugin.test.js Outdated
Comment thread test/cap-op-plugin.test.js Outdated

@Pavan-SAP Pavan-SAP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but not sure if we should keep it as is!

As mentioned inline - let's check we should instead do this via users machine relying on curl/tar etc to be present at consumers side and using node exec for e.g.

Like we do while generating runtime yaml (kubectl)
We just document that we rely on these parts.

Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Comment thread bin/cap-op-plugin.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants