Skip to content

feat(skills): source dd-apm sub-skills via agent-skills Cargo git dep (alternative to #530)#536

Draft
platinummonkey wants to merge 2 commits into
mainfrom
claude/pr-530-submodules-alternatives-l6iVf
Draft

feat(skills): source dd-apm sub-skills via agent-skills Cargo git dep (alternative to #530)#536
platinummonkey wants to merge 2 commits into
mainfrom
claude/pr-530-submodules-alternatives-l6iVf

Conversation

@platinummonkey
Copy link
Copy Markdown
Collaborator

What this does

Alternative to #530 that avoids git submodules entirely.

Instead of a .gitmodules entry and submodules: recursive on every CI checkout step, this PR treats datadog-labs/agent-skills as a Cargo git dependency — the same pattern already used for datadog-api-client:

agent-skills = {
  git = "https://github.com/datadog-labs/agent-skills",
  rev = "c447f4d42f05fa8497c6fa0d1ee3889b7020dce3"
}

src/skills.rs consumes two constants from the crate:

  • agent_skills::DD_APM_SKILL — the router SKILL.md
  • agent_skills::DD_APM_SUB_SKILLS — the 11 nested sub-skill paths + content

pup skills install dd-apm writes 12 files (root + 11 sub-skills) exactly as in #530, with no change to developer workflow or CI.

Why not submodules

  • git clone without --recurse-submodules silently produces a broken build
  • Required patching 14 checkout steps across 3 workflow files; any new job would silently break without submodules: recursive
  • Updates require git submodule update --remote + rebuild rather than a single rev bump in Cargo.toml
  • No Cargo-native tracking — drifts from Cargo.lock

Changes in this PR (pup side only)

File Change
Cargo.toml Add agent-skills git dep, pinned to rev
src/skills.rs dd-apm entry uses crate constants; install_paths extended to write nested sub-skill files; files field doc updated
src/skills.rs (tests) Two new tests: sub-skills written at correct paths, sub-skills skipped for AgentMd format

No .gitmodules. No CI changes.

Prerequisite: companion PR to agent-skills

This PR is a draft and will not build until datadog-labs/agent-skills ships a Cargo.toml + src/lib.rs exposing:

pub const DD_APM_SKILL: &str = include_str!("../skills/dd-apm/SKILL.md");

pub static DD_APM_SUB_SKILLS: &[(&str, &str)] = &[
    ("service-remapping/SKILL.md", include_str!("../skills/dd-apm/service-remapping/SKILL.md")),
    ("k8s-ssi/agent-install/SKILL.md",      include_str!("../skills/dd-apm/k8s-ssi/agent-install/SKILL.md")),
    ("k8s-ssi/enable-ssi/SKILL.md",         include_str!("../skills/dd-apm/k8s-ssi/enable-ssi/SKILL.md")),
    ("k8s-ssi/verify-ssi/SKILL.md",         include_str!("../skills/dd-apm/k8s-ssi/verify-ssi/SKILL.md")),
    ("k8s-ssi/troubleshoot-ssi/SKILL.md",   include_str!("../skills/dd-apm/k8s-ssi/troubleshoot-ssi/SKILL.md")),
    ("k8s-ssi/onboarding-summary/SKILL.md", include_str!("../skills/dd-apm/k8s-ssi/onboarding-summary/SKILL.md")),
    ("linux-ssi/agent-install/SKILL.md",      include_str!("../skills/dd-apm/linux-ssi/agent-install/SKILL.md")),
    ("linux-ssi/enable-ssi/SKILL.md",         include_str!("../skills/dd-apm/linux-ssi/enable-ssi/SKILL.md")),
    ("linux-ssi/verify-ssi/SKILL.md",         include_str!("../skills/dd-apm/linux-ssi/verify-ssi/SKILL.md")),
    ("linux-ssi/troubleshoot-ssi/SKILL.md",   include_str!("../skills/dd-apm/linux-ssi/troubleshoot-ssi/SKILL.md")),
    ("linux-ssi/onboarding-summary/SKILL.md", include_str!("../skills/dd-apm/linux-ssi/onboarding-summary/SKILL.md")),
];

Once that lands, update the rev here to point at the new commit and mark this PR ready for review.

Updating sub-skills going forward

# Bump this rev in Cargo.toml — one line, one reviewer, full audit trail
agent-skills = { git = "https://github.com/datadog-labs/agent-skills", rev = "<new-rev>" }

Then cargo update -p agent-skills to refresh Cargo.lock. No submodule commands, no CI changes.


Generated by Claude Code

claude added 2 commits May 28, 2026 09:15
Replace the submodule approach proposed in #530 with a Cargo path
dependency. No .gitmodules, no `submodules: recursive` peppered across
every CI checkout step.

- crates/agent-skills/: new crate vendoring the 12 dd-apm SKILL.md
  files from datadog-labs/agent-skills@c447f4d (root router + 11 nested
  sub-skills under k8s-ssi/, linux-ssi/, service-remapping/)
- Cargo.toml: add `agent-skills = { path = "crates/agent-skills" }`; a
  comment shows how to flip to a git dep once agent-skills ships a
  Cargo.toml, with no other pup changes needed
- src/skills.rs: use agent_skills::DD_APM_SKILL / DD_APM_SUB_SKILLS
  instead of bare include_str!(); extend install_paths to write nested
  sub-skill files alongside the root SKILL.md (SkillMd format only);
  update files field doc; add two new tests for sub-skill install paths

https://claude.ai/code/session_01BfYL9qPvktFuLXHNyH3rPB
The previous commit vendored the agent-skills content into a local
crates/ directory, which is equivalent to Option 1 (direct copy).
This commit corrects that: remove crates/agent-skills/ entirely and
point Cargo.toml at the upstream repo directly.

Cargo.toml now uses a git dep pinned to the same commit referenced by
PR #530, matching the pattern already used for datadog-api-client:

  agent-skills = {
    git = "https://github.com/datadog-labs/agent-skills",
    rev = "c447f4d42f05fa8497c6fa0d1ee3889b7020dce3"
  }

The SKILL.md files stay in the agent-skills repo only. Updating means
bumping the rev in Cargo.toml — a single, reviewable line change.

This PR requires a companion change to datadog-labs/agent-skills to
add a Cargo.toml and src/lib.rs that expose DD_APM_SKILL and
DD_APM_SUB_SKILLS as compile-time constants (the same API consumed in
src/skills.rs).

https://claude.ai/code/session_01BfYL9qPvktFuLXHNyH3rPB
@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented May 28, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

CI | Check, Test &amp; Coverage   View in Datadog   GitHub Actions

🔧 Fix in code (Fix with Cursor). Assertion failed: sub-skills must not be written for agent-md format at /home/runner/work/pup/pup/src/skills.rs:1518

CI | Cross Compile (Linux)   View in Datadog   GitHub Actions

⬆️ Not caused by your changes. Rebase on a base branch once a fix is merged. Dependency download failed: could not find `Cargo.toml` in `/home/runner/.cargo/git/checkouts/agent-skills-c48bc53d882babe6/c447f4d`.

CI | Cross Compile (Windows)   View in Datadog   GitHub Actions

🔄 Retry job. This looks flaky and may succeed on retry. Dependency download failed: could not find 'Cargo.toml' in 'C:\Users\runneradmin\.cargo\git\checkouts\agent-skills-c48bc53d882babe6\c447f4d'.

View all 5 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ffb4d51 | Docs | Datadog PR Page | Give us feedback!

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