Skip to content

fix: include repo prefix in agent skill copy command#3441

Merged
leemthompo merged 1 commit into
mainfrom
fix-missing-repo-prefix
Jun 2, 2026
Merged

fix: include repo prefix in agent skill copy command#3441
leemthompo merged 1 commit into
mainfrom
fix-missing-repo-prefix

Conversation

@leemthompo
Copy link
Copy Markdown
Member

@leemthompo leemthompo commented Jun 2, 2026

Summary

  • The agent skill directive's copy command was missing the repository prefix, generating, for example, npx skills add @elasticsearch-esql instead of the correct npx skills add elastic/agent-skills@elasticsearch-esql
  • Extracts the owner/repo path from the URL alongside the skill name so the install command works out of the box

Closes #3439

Test plan

  • C# unit tests pass (25 AgentSkill tests)
  • F# authoring tests pass (8 agent skill tests)
  • Verify on preview site that the copy button produces the correct command

🤖 Generated with Claude Code

The copy command was missing the repo prefix, generating
`npx skills add @elasticsearch-esql` instead of
`npx skills add elastic/agent-skills@elasticsearch-esql`.

Closes #3439

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leemthompo leemthompo requested review from a team as code owners June 2, 2026 08:00
@leemthompo leemthompo requested a review from reakaleek June 2, 2026 08:00
@leemthompo leemthompo temporarily deployed to integration-tests June 2, 2026 08:00 — with GitHub Actions Inactive
@leemthompo leemthompo self-assigned this Jun 2, 2026
Comment thread docs/syntax/agent-skill.md
@reakaleek reakaleek added the fix label Jun 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: df8492c0-f160-4d7c-b815-bf60757c86e2

📥 Commits

Reviewing files that changed from the base of the PR and between 1b9c2ac and eac10fe.

📒 Files selected for processing (4)
  • docs/syntax/agent-skill.md
  • src/Elastic.Markdown/Myst/Directives/AgentSkill/AgentSkillBlock.cs
  • tests/Elastic.Markdown.Tests/Directives/AgentSkillTests.cs
  • tests/authoring/Blocks/AgentSkill.fs

📝 Walkthrough

Walkthrough

This PR adds the repository prefix to the agent-skill directive's copy install command. Previously, the generated command was npx skills add @skill-name``, which fails without the repo prefix. The change extracts both the repository owner/name and the skill name from the URL path, then combines them as npx skills add owner/repo@skill-name. The implementation adds a `RepoPrefix` property, updates the extraction logic to parse both segments from the URL, and updates all related tests to expect the full-qualified form.

Possibly related PRs

  • elastic/docs-builder#3392: Earlier PR that introduced the copy install command feature with @skill-name-only format; this PR completes the implementation by adding the required repo prefix.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the repository prefix to the agent skill copy command.
Description check ✅ Passed The description clearly explains the problem, the solution, and references the linked issue #3439.
Linked Issues check ✅ Passed The PR successfully addresses issue #3439 by extracting and including the repo prefix in the install command across code and tests.
Out of Scope Changes check ✅ Passed All changes are scoped to the agent skill directive feature: updating documentation, implementing the repo prefix extraction logic, and updating corresponding tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix-missing-repo-prefix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread src/Elastic.Markdown/Myst/Directives/AgentSkill/AgentSkillBlock.cs
@leemthompo leemthompo merged commit 18c21d4 into main Jun 2, 2026
25 of 26 checks passed
@leemthompo leemthompo deleted the fix-missing-repo-prefix branch June 2, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing repo prefix in copy command in agent skills directive

2 participants