Skip to content

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

Closed
anirudhprasad-sap wants to merge 12 commits into
mainfrom
skill
Closed

[Feat] Implement 'add-cap-operator-skill' command to add CAP Operator agent skills#117
anirudhprasad-sap wants to merge 12 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 (https://sap.github.io/cap-operator/agentskills.tar.gz) 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:

  • Re-run safe: The existing cap-operator skill directory is wiped before extraction, pruning stale files, while other skills under .agents/ remain untouched.
  • Redirect support: The HTTP download helper follows up to 10 redirects.

Changes

  • bin/cap-op-plugin.js: Registered add-cap-operator-skill in the SUPPORTED command map; implemented httpGet() helper with redirect support; implemented addCapOperatorSkill() function; added the new command to CLI usage/help text; renamed internal parameter yamlPathoptionValue for consistency.
  • README.md: Updated minimum @sap/cds-dk version requirement from >=8.2.1 to >=9; added a new documentation section for add-cap-operator-skill including usage examples and Claude Code integration instructions.
  • test/cap-op-plugin.test.js: Added a test suite covering live tarball extraction, file overwrite on re-run, stale file pruning, preservation of unrelated skills, and rejection of unknown options; updated the usage help text snapshot.
  • CHANGELOG.md: Added entry for version 0.19.0 documenting the new command.
  • package.json / package-lock.json: Bumped version from 0.18.0 to 0.19.0.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.29.2

  • LLM: anthropic--claude-4.6-sonnet
  • Summary Prompt: Default Prompt
  • Correlation ID: df8915d0-899d-11f1-888a-0bdf84f9d67e
  • Event Trigger: pull_request.edited
  • File Content Strategy: Full file content
  • 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
…ion path and ensure proper extraction of agent skills
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