Skip to content

feat(vscode): add native SDD agents#708

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

feat(vscode): add native SDD agents#708
Snakeblack wants to merge 4 commits 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 the VS Code Copilot adapter and installs native agent files to the user-level directory (~/.copilot/agents).
    • Added a VS Code Spec-Driven Development (SDD) agent suite: orchestrator plus phase-specific agents (init, explore, propose, spec, design, tasks, apply, verify, archive, onboard).
  • Bug Fixes

    • Updated post-injection validation to accept native .agent.md files.
  • Tests

    • Expanded asset/frontmatter validation, adapter sub-agent directory checks, injection assertions (including idempotency), and uninstall coverage to remove only managed agent files.

@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.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

VS Code Copilot sub-agent support is enabled, embedded .agent.md agents are added, asset validation expands for the new files, and injection/uninstall logic now handles VS Code agent files and cleanup.

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, and tests assert the directory resolution and embedded dir value.
Orchestrator agent definition and embed registration
internal/assets/assets.go, internal/assets/vscode/agents/sdd-orchestrator.agent.md
The embedded asset set is updated, and sdd-orchestrator.agent.md adds the coordinator metadata, delegation rules, command surface, artifact store policy, skill resolution flow, phase read/write contracts, TDD forwarding, apply-progress continuity, and recovery behavior.
SDD phase agent definitions
internal/assets/vscode/agents/sdd-*.agent.md
Ten phase agent files are added for sdd-init, sdd-explore, sdd-propose, sdd-spec, sdd-design, sdd-tasks, sdd-apply, sdd-verify, sdd-archive, and sdd-onboard, each defining vscode targeting, execution constraints, required mem_search/mem_save steps, and a structured result contract.
Asset frontmatter validation tests
internal/assets/assets_test.go
TestAllEmbeddedAssetsAreReadable extends its expected file list with VS Code native agent assets. TestVSCodeNativeAgentAssetsFrontmatter validates orchestrator frontmatter flags, coordinator allowlist membership, per-phase frontmatter, inline tool requirements, deprecated tool rejection, and body heading presence. Supporting helpers parse frontmatter blocks and assert required lines and substrings.
Inject .agent.md extension support and cleanup tests
internal/components/sdd/inject.go, internal/components/sdd/inject_test.go, internal/components/uninstall/service_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. Tests cover VS Code agent file generation, idempotency, adapter-specific native agent extensions, and removal of only managed agent files.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: type:feature, size:exception

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Adapter support and embedded .agent.md assets are added, but the profile-specific generation/writing and cleanup objectives from #504 are not evidenced here. Add the VS Code profile-file generator, hook named-profile writes into injection, and implement profile cleanup for managed suffix files with tests.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: adding native SDD agents for VS Code.
Out of Scope Changes check ✅ Passed All changes stay within VS Code Copilot SDD native-agent support and related tests/assets.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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

@Snakeblack Snakeblack force-pushed the feat/vscode-copilot-subagents-pr1 branch from 459c6b8 to adab8d3 Compare June 30, 2026 06:29

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@internal/components/uninstall/service_test.go`:
- Around line 342-349: The uninstall service test currently applies every
operation under the agents directory, which is too broad; update the loop in the
test around op.apply so it only runs when the operation is opRemoveFile,
matching the stricter behavior used by the Claude counterpart. Keep the existing
path-scope check, but add an op.typeID filter before applying to ensure only
file-removal operations are executed and no other operation types can be applied
accidentally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 192db985-9691-4868-a69b-4373e2b7a669

📥 Commits

Reviewing files that changed from the base of the PR and between 459c6b8 and adab8d3.

📒 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

Comment thread internal/components/uninstall/service_test.go
@Snakeblack Snakeblack force-pushed the feat/vscode-copilot-subagents-pr1 branch from c7fffc5 to f7ed70b Compare July 1, 2026 08:26

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@internal/assets/vscode/agents/sdd-orchestrator.agent.md`:
- Around line 177-182: The fenced dependency-graph block in the agent markdown
is missing a language identifier, triggering markdownlint MD040. Update the
fenced block around the dependency graph in the orchestrator agent doc to use a
language tag such as text so the block remains readable while satisfying lint
rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 55668796-4287-4447-b615-1678adf0ff45

📥 Commits

Reviewing files that changed from the base of the PR and between c7fffc5 and f7ed70b.

📒 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

Comment thread internal/assets/vscode/agents/sdd-orchestrator.agent.md Outdated
@Alan-TheGentleman

Copy link
Copy Markdown
Contributor

The #504 chain (this one, #731, #738, #740) is all conflicting with main. Rebase the chain starting here and I'll review it in order.

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)

2 participants