Skip to content

feat: add 'docker agent debug skills' command#2881

Open
dgageot wants to merge 1 commit into
docker:mainfrom
dgageot:board/8ff1e256e9427f01
Open

feat: add 'docker agent debug skills' command#2881
dgageot wants to merge 1 commit into
docker:mainfrom
dgageot:board/8ff1e256e9427f01

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented May 22, 2026

This adds a mirror of the existing docker agent debug toolsets command, providing introspection into the skills wired into each agent. Users can now run docker agent debug skills to see which skills are available to an agent, including their descriptions and whether they run in a forked context.

The implementation adds a skills subcommand to the debug command that looks up the *skillstool.ToolSet among each agent's toolsets and prints the skill name, a [forked] marker for context: fork skills, and the skill description. When an agent has no skills, it emits a clear empty message.

New tests cover both agents with no skills and agents with locally-discovered skills (both plain and forked variants), ensuring the feature works across different configurations.

@dgageot dgageot requested a review from a team as a code owner May 22, 2026 17:03
Copy link
Copy Markdown

@docker-agent docker-agent left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The docker agent debug skills command is a clean, well-structured addition that mirrors the existing debug toolsets command. The implementation correctly:

  • Walks agent toolsets and type-asserts to *skillstool.ToolSet using tools.As
  • Handles the nil/empty case with a clear "No skills" message
  • Annotates fork-context skills with the [forked] marker
  • Properly tracks telemetry with TrackCommand/TrackCommandError following the established pattern
  • Defers stopToolSets for cleanup, consistent with other debug subcommands

Tests cover both the empty-skills path (no_tools.yaml) and the local-discovery path (plain + forked skills), and the new skills_local.yaml fixture follows the same structure as existing fixtures.

No bugs found in the changed code.

@aheritier aheritier added area/cli CLI commands, flags, output formatting area/skills Skills system and custom slash commands kind/feat PR adds a new feature (maps to feat: commit prefix) labels May 22, 2026
Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test - single comment on debug.go

Comment thread cmd/root/debug.go

if skillsToolset == nil || len(skillsToolset.Skills()) == 0 {
out.Printf("No skills for %s\n", agent.Name())
continue
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.

Test comment on Skills() guard line

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 1

@@ -0,0 +1,7 @@
agents:
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 2

@@ -0,0 +1,7 @@
agents:
root:
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 3

@@ -0,0 +1,7 @@
agents:
root:
model: openai/gpt-3.5-turbo
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 4

agents:
root:
model: openai/gpt-3.5-turbo
description: A helpful AI assistant
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 5

root:
model: openai/gpt-3.5-turbo
description: A helpful AI assistant
instruction: |
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 6

model: openai/gpt-3.5-turbo
description: A helpful AI assistant
instruction: |
You are a knowledgeable assistant.
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test pos 7

description: A helpful AI assistant
instruction: |
You are a knowledgeable assistant.
skills: true
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.

test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test line-based comment

description: A helpful AI assistant
instruction: |
You are a knowledgeable assistant.
skills: true
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.

Test comment on line 7

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test line 180

Comment thread cmd/root/debug.go
}
}

if skillsToolset == nil || len(skillsToolset.Skills()) == 0 {
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.

Test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Test line 185

Comment thread cmd/root/debug.go
continue
}

loadedSkills := skillsToolset.Skills()
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.

Test

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

The implementation is correct, idiomatic, and follows existing conventions closely. tools.As[T] correctly handles wrapped toolsets, telemetry hooks match every other debug subcommand exactly, and t.Setenv is correctly used without t.Parallel() in the local-skills test. Two minor suggestions worth addressing before merge:

1. Skills() called twice — see inline comment on runDebugSkillsCommand.

2. skills_local.yaml missing version: field — see inline comment on the new fixture.

No blocking issues. Everything else (alphabetical ordering, stopToolSets defer, variable rename toolsagentTools) is well done.

Comment thread cmd/root/debug.go
continue
}

loadedSkills := skillsToolset.Skills()
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.

Skills() is called twice: once in the nil || len(...) guard on the line above, and again here to bind loadedSkills. The method returns the struct's internal slice so both calls are safe, but it's redundant. Capturing the result once makes intent clearer and removes the double call:

var loadedSkills []skills.Skill
if skillsToolset != nil {
    loadedSkills = skillsToolset.Skills()
}
if len(loadedSkills) == 0 {
    out.Printf("No skills for %s\n", agent.Name())
    continue
}

description: A helpful AI assistant
instruction: |
You are a knowledgeable assistant.
skills: true
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.

Every other fixture in e2e/testdata/ includes a version: field (e.g. version: "2"). The loader defaults gracefully via cmp.Or, so this works, but the omission is inconsistent and may surprise future contributors. Consider adding version: "9" (current latest) to match the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI commands, flags, output formatting area/skills Skills system and custom slash commands kind/feat PR adds a new feature (maps to feat: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants