Skip to content

feat(vscode): add native SDD agents#708

Open
Snakeblack wants to merge 1 commit into
Gentleman-Programming:mainfrom
Snakeblack:feat/vscode-copilot-subagents-pr1
Open

feat(vscode): add native SDD agents#708
Snakeblack wants to merge 1 commit into
Gentleman-Programming:mainfrom
Snakeblack:feat/vscode-copilot-subagents-pr1

Conversation

@Snakeblack

@Snakeblack Snakeblack commented May 29, 2026

Copy link
Copy Markdown

🔗 Linked Issue

Closes #504

Related context: #677


🏷️ PR Type

What kind of change does this PR introduce?

  • type:bug — Bug fix (non-breaking change that fixes an issue)
  • type:feature — New feature (non-breaking change that adds functionality)
  • type:docs — Documentation only
  • type:refactor — Code refactoring (no functional changes)
  • type:chore — Build, CI, or tooling changes
  • type:breaking-change — Breaking change (fix or feature that changes existing behavior)

📝 Summary

PR 1 of the VS Code Copilot SDD subagents stack. This adds the backend/native-agent foundation only: VS Code now supports native SDD .agent.md files in ~/.copilot/agents, with embedded coordinator/phase assets, injection post-check support, idempotency coverage, and uninstall preservation for user-authored agents.

Follow-up PRs will add VS Code model assignment foundation and TUI/docs. Those are intentionally out of scope here.

This PR requests size:exception: it exceeds 400 changed lines because it ships substantive Markdown .agent.md assets, not because the code surface is large.


📂 Changes

File / Area What Changed
internal/agents/vscode Enabled native sub-agent support at ~/.copilot/agents and added path tests
internal/assets Embedded all:vscode and added VS Code SDD .agent.md assets
internal/components/sdd Accepted .agent.md in native sub-agent post-check and covered VS Code injection/idempotency
internal/components/uninstall Verified uninstall removes only managed VS Code SDD agents and preserves custom .agent.md files

🧪 Test Plan

Focused PR1 tests

go test ./internal/agents/vscode -run TestSubAgentSupportUsesCopilotUserAgentsDir
go test ./internal/assets -run TestVSCodeNativeAgentAssetsFrontmatter
go test ./internal/components/sdd -run 'TestInjectVSCodeWritesNativeAgentFiles|TestInjectNativeSubAgentExtensionsRemainAdapterSpecific'
go test ./internal/components/uninstall -run TestComponentOperationsSDD_VSCodeRemovesOnlyManagedAgentFiles

Package smoke

go test ./internal/agents/vscode ./internal/assets

Unit Tests

go test ./...

E2E Tests (Docker required)

cd e2e && ./docker-test.sh
  • Unit tests pass (go test ./...)
  • E2E tests pass (cd e2e && ./docker-test.sh)
  • Manually tested locally

Notes: focused PR1 tests passed locally. Full go test ./... was not claimed here due known local Windows/CRLF/symlink/environment failures unrelated to this PR.


🤖 Automated Checks

The following checks run automatically on this PR:

Check Status Description
Check PR Cognitive Load ⚠️ Requests size:exception; most added lines are .agent.md assets
Check Issue Reference PR body contains Closes #504
Check Issue Has status:approved #504 has status:approved
Check PR Has type:* Label type:feature requested (maintainer label needed)
Unit Tests CI should run go test ./...
E2E Tests CI should run Docker E2E if configured

✅ Contributor Checklist

  • PR is linked to an issue with status:approved
  • PR stays within 400 changed lines, or I have requested/obtained maintainer-applied size:exception with rationale documented — maintainer label needed (size:exception)
  • I have added the appropriate type:* label to this PR — maintainer label needed (type:feature)
  • Unit tests pass (go test ./...)
  • E2E tests pass (cd e2e && ./docker-test.sh)
  • I have updated documentation if necessary
  • My commits follow Conventional Commits format
  • My commits do not include Co-Authored-By trailers

💬 Notes for Reviewers

This is the backend/native-agent slice only. It deliberately does not include VS Code model assignment state, dynamic Copilot model catalog integration, TUI/profile UX, or final docs updates; those will come in follow-up PRs.

Summary by CodeRabbit

  • New Features
    • Enabled native sub-agent support for VS Code Copilot.
    • Added Spec-Driven Development (SDD) workflow agents for VS Code, including orchestration and phase-specific execution capabilities.
    • Managed agent file installation and removal for the VS Code environment.

@Snakeblack

Copy link
Copy Markdown
Author

Maintainer label request: please apply exactly one type label, type:feature, and size:exception for the Markdown-heavy VS Code .agent.md asset payload. Follow-up PRs will add model assignment foundation and TUI/docs.

@Snakeblack Snakeblack force-pushed the feat/vscode-copilot-subagents-pr1 branch from d043669 to 079c30b Compare June 14, 2026 23:04
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The VS Code Copilot adapter's sub-agent support is activated (SupportsSubAgents returns true, SubAgentsDir resolves to ~/.copilot/agents, EmbeddedSubAgentsDir returns vscode/agents). Ten .agent.md files are added to the embedded asset tree: one orchestrator that coordinates by delegation and nine self-contained SDD phase executors. Injection verification is updated to accept .agent.md as a valid extension, and tests cover adapter capability, asset frontmatter correctness, injection idempotency, and selective uninstall behavior.

Changes

VS Code Copilot SDD Native Sub-Agent Support

Layer / File(s) Summary
VS Code adapter sub-agent capability
internal/agents/vscode/adapter.go, internal/agents/vscode/adapter_test.go
SupportsSubAgents returns true, SubAgentsDir returns ~/.copilot/agents, and EmbeddedSubAgentsDir returns vscode/agents. A documentation comment clarifies the global install path. Tests assert the directory path, a negative check against the workspace .github/agents path, and the embedded dir value.
Orchestrator agent definition and embed registration
internal/assets/assets.go, internal/assets/vscode/agents/sdd-orchestrator.agent.md
assets.go embed directive is updated to include the vscode/agents directory. sdd-orchestrator.agent.md is added with full metadata, delegation rules, SDD workflow command surface, artifact store policy, skill resolution protocol, per-phase read/write contracts, TDD forwarding, apply-progress continuity, and recovery behavior across engram/openspec/none modes.
SDD phase agent definitions
internal/assets/vscode/agents/sdd-*.agent.md
Nine phase agent files are added (sdd-init, sdd-explore, sdd-propose, sdd-spec, sdd-design, sdd-tasks, sdd-apply, sdd-verify, sdd-archive, sdd-onboard). Each specifies target: vscode, no-delegation constraints, required mem_search/mem_save calls with deterministic topic keys, and a structured result contract.
Asset frontmatter validation tests
internal/assets/assets_test.go
TestVSCodeNativeAgentAssetsFrontmatter validates orchestrator frontmatter flags and coordinator allowlist membership. Per-phase subtests check target, user-invocable, absence of model/infer, rejection of deprecated tool aliases, required inline tools, and required body headings. Supporting helpers parse frontmatter blocks and assert line presence/absence.
Inject .agent.md extension support and inject tests
internal/components/sdd/inject.go, internal/components/sdd/inject_test.go
inject.go extends the post-injection critical-file check to accept .agent.md alongside .md and .yaml for sdd-apply and sdd-verify. TestInjectVSCodeWritesNativeAgentFiles validates that Inject writes all expected files with target: vscode content, is idempotent on a second call, and that the .agent.md file count matches the asset list.
Uninstall selective removal test
internal/components/uninstall/service_test.go
TestComponentOperationsSDD_VSCodeRemovesOnlyManagedAgentFiles creates managed and a custom agent file, runs componentOperations for ComponentSDD, applies only operations scoped to the VS Code agents directory, and asserts managed files are deleted while the custom file is preserved.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

type:feature, size:exception

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(vscode): add native SDD agents' clearly and directly summarizes the main change: enabling native SDD agent support for VS Code Copilot.
Linked Issues check ✅ Passed The PR fully implements all core backend objectives from issue #504: activates sub-agent support [#504], embeds 10 SDD phase templates [#504], extends injection pipeline [#504], implements uninstall cleanup [#504], and validates post-injection [#504].
Out of Scope Changes check ✅ Passed All changes are scoped to backend SDD multi-mode support as defined in #504; TUI integration, model assignment foundation, and documentation are explicitly deferred to follow-up PRs.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/assets/assets_test.go (1)

125-282: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

TestAllEmbeddedAssetsAreReadable() does not include the 10 new VSCode agent files; list is incomplete.

The TestAllEmbeddedAssetsAreReadable() function defines an expectedFiles slice that enumerates every embedded asset that should be readable. This is a safety net to catch missing/misnamed files at test time. The current list (lines 126-263) does NOT include any of the 10 new VSCode native agent files (vscode/agents/*.agent.md).

This test should be updated to include:

  • vscode/agents/sdd-orchestrator.agent.md
  • vscode/agents/sdd-init.agent.md
  • vscode/agents/sdd-explore.agent.md
  • vscode/agents/sdd-propose.agent.md
  • vscode/agents/sdd-spec.agent.md
  • vscode/agents/sdd-design.agent.md
  • vscode/agents/sdd-tasks.agent.md
  • vscode/agents/sdd-apply.agent.md
  • vscode/agents/sdd-verify.agent.md
  • vscode/agents/sdd-archive.agent.md
  • vscode/agents/sdd-onboard.agent.md

Without this update, accidental deletion or renaming of these files would not be caught by the test.

📝 Proposed addition to expectedFiles list
  expectedFiles := []string{
    // Claude agent files
    "claude/engram-protocol.md",
    ...existing entries...
    
+   // VSCode native agent files
+   "vscode/agents/sdd-orchestrator.agent.md",
+   "vscode/agents/sdd-init.agent.md",
+   "vscode/agents/sdd-explore.agent.md",
+   "vscode/agents/sdd-propose.agent.md",
+   "vscode/agents/sdd-spec.agent.md",
+   "vscode/agents/sdd-design.agent.md",
+   "vscode/agents/sdd-tasks.agent.md",
+   "vscode/agents/sdd-apply.agent.md",
+   "vscode/agents/sdd-verify.agent.md",
+   "vscode/agents/sdd-archive.agent.md",
+   "vscode/agents/sdd-onboard.agent.md",
+
    // Hermes agent files
    "hermes/sdd-orchestrator.md",
    ...rest of existing entries...
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assets/assets_test.go` around lines 125 - 282, The expectedFiles
slice in the TestAllEmbeddedAssetsAreReadable function is missing entries for 11
new VSCode agent files. Add the following file paths to the expectedFiles slice:
vscode/agents/sdd-orchestrator.agent.md, vscode/agents/sdd-init.agent.md,
vscode/agents/sdd-explore.agent.md, vscode/agents/sdd-propose.agent.md,
vscode/agents/sdd-spec.agent.md, vscode/agents/sdd-design.agent.md,
vscode/agents/sdd-tasks.agent.md, vscode/agents/sdd-apply.agent.md,
vscode/agents/sdd-verify.agent.md, vscode/agents/sdd-archive.agent.md, and
vscode/agents/sdd-onboard.agent.md. Insert these entries as a new commented
section after the cursor agent files section to maintain the organized structure
of the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@internal/assets/assets_test.go`:
- Around line 125-282: The expectedFiles slice in the
TestAllEmbeddedAssetsAreReadable function is missing entries for 11 new VSCode
agent files. Add the following file paths to the expectedFiles slice:
vscode/agents/sdd-orchestrator.agent.md, vscode/agents/sdd-init.agent.md,
vscode/agents/sdd-explore.agent.md, vscode/agents/sdd-propose.agent.md,
vscode/agents/sdd-spec.agent.md, vscode/agents/sdd-design.agent.md,
vscode/agents/sdd-tasks.agent.md, vscode/agents/sdd-apply.agent.md,
vscode/agents/sdd-verify.agent.md, vscode/agents/sdd-archive.agent.md, and
vscode/agents/sdd-onboard.agent.md. Insert these entries as a new commented
section after the cursor agent files section to maintain the organized structure
of the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3ed726b4-2df2-4115-ab97-24dc36ab103a

📥 Commits

Reviewing files that changed from the base of the PR and between bcd231f and 079c30b.

📒 Files selected for processing (18)
  • internal/agents/vscode/adapter.go
  • internal/agents/vscode/adapter_test.go
  • internal/assets/assets.go
  • internal/assets/assets_test.go
  • internal/assets/vscode/agents/sdd-apply.agent.md
  • internal/assets/vscode/agents/sdd-archive.agent.md
  • internal/assets/vscode/agents/sdd-design.agent.md
  • internal/assets/vscode/agents/sdd-explore.agent.md
  • internal/assets/vscode/agents/sdd-init.agent.md
  • internal/assets/vscode/agents/sdd-onboard.agent.md
  • internal/assets/vscode/agents/sdd-orchestrator.agent.md
  • internal/assets/vscode/agents/sdd-propose.agent.md
  • internal/assets/vscode/agents/sdd-spec.agent.md
  • internal/assets/vscode/agents/sdd-tasks.agent.md
  • internal/assets/vscode/agents/sdd-verify.agent.md
  • internal/components/sdd/inject.go
  • internal/components/sdd/inject_test.go
  • internal/components/uninstall/service_test.go

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.

feat(agents): add VS Code Copilot SDD multi-mode support (backend)

1 participant