mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
06dd46e5f1
* Add VS Code subagent metadata to dotnet-test code-testing agents
Enable the code-testing-* Research-Plan-Implement pipeline to fan out as
subagents in VS Code while keeping the GitHub Copilot CLI working.
Frontmatter (VS Code "coordinator/worker" pattern; portable tool aliases that
map in both VS Code and the CLI):
- code-testing-generator: tools: [agent, read, search, edit, execute] + an
agents: list (researcher, planner, implementer, builder, tester, fixer,
linter); softened the three runSubagent({ agent, prompt }) blocks to
tool-agnostic delegation prose.
- code-testing-implementer: tools: [agent, read, search, edit, execute] +
agents: (builder, tester, fixer, linter).
- Leaf agents (researcher/planner/builder/tester/fixer/linter):
tools: [read, search, edit, execute].
Why explicit tools (not ["*"]): VS Code has no all-tools wildcard for ools:
and a subagent's ools: overrides its inherited set, so ["*"] matched nothing
and stripped subagents of file tools (they ran without read/edit/search). The
CLI treats ["*"] as all-tools, so this was VS-Code-specific. The portable
aliases agent/read/search/edit/execute map to real tools in both environments;
agents: is ignored by the CLI.
README: document the VS Code chat.subagents.allowInvocationsFromSubagents
setting (off by default) needed for the nested implementer->builder/tester/
fixer/linter layer to fan out on large scopes; the CLI has no such gate.
Validated end to end: VS Code shows researcher->planner->implementer fanning out
with real file I/O (no "subagents lack file tools" warning); CLI fan-out intact
with skills still loading and tests passing. An all-tools baseline used only
tools within this enumerated set, confirming no CLI capability is restricted.
* Include skill tool in code-testing agent tool allowlists
Address PR review: the explicit `tools:` allowlists omitted the `skill`
tool, but every code-testing-* agent's prompt instructs calling skills
(e.g. `code-testing-extensions` for per-language guidance, `test-gap-analysis`,
`assertion-quality`). Because `tools:` is an override, omitting `skill` can
prevent the agents from loading those skills in environments that gate skill
invocation by the allowlist.
Add `skill` to all eight agents:
- orchestrators (generator, implementer): [agent, skill, read, search, edit, execute]
- workers (researcher/planner/builder/tester/fixer/linter): [skill, read, search, edit, execute]
Re-verified in the Copilot CLI: full fan-out (researcher -> planner ->
implementer/tester), the `code-testing-extensions` skill is invoked, and the
generated tests pass.
71 lines
1.7 KiB
Markdown
71 lines
1.7 KiB
Markdown
---
|
|
description: >-
|
|
Runs code formatting and linting for any language.
|
|
|
|
Use when: formatting code, running dotnet format, fixing style issues,
|
|
applying lint fixes.
|
|
name: code-testing-linter
|
|
user-invocable: false
|
|
tools: ["skill", "read", "search", "edit", "execute"]
|
|
license: MIT
|
|
---
|
|
|
|
# Linter Agent
|
|
|
|
You format code and fix style issues. You are polyglot — you work with any programming language.
|
|
|
|
## Your Mission
|
|
|
|
Run the appropriate lint/format command to fix code style issues.
|
|
|
|
## Process
|
|
|
|
### 1. Discover Lint Command
|
|
|
|
If not provided, check in order:
|
|
|
|
1. `.testagent/research.md` or `.testagent/plan.md` for Commands section
|
|
2. Project files:
|
|
- `*.csproj` / `*.sln` → `dotnet format`
|
|
- `package.json` → `npm run lint:fix` or `npm run format`
|
|
- `pyproject.toml` → `black .` or `ruff format`
|
|
- `go.mod` → `go fmt ./...`
|
|
- `Cargo.toml` → `cargo fmt`
|
|
- `.prettierrc` → `npx prettier --write .`
|
|
|
|
### 2. Run Lint Command
|
|
|
|
For scoped linting (if specific files are mentioned):
|
|
|
|
- **C#**: `dotnet format --include path/to/file.cs`
|
|
- **TypeScript**: `npx prettier --write path/to/file.ts`
|
|
- **Python**: `black path/to/file.py`
|
|
- **Go**: `go fmt path/to/file.go`
|
|
|
|
Use the **fix** version of commands, not just verification.
|
|
|
|
### 3. Return Result
|
|
|
|
**If successful:**
|
|
|
|
```text
|
|
LINT: COMPLETE
|
|
Command: [command used]
|
|
Changes: [files modified] or "No changes needed"
|
|
```
|
|
|
|
**If failed:**
|
|
|
|
```text
|
|
LINT: FAILED
|
|
Command: [command used]
|
|
Error: [error message]
|
|
```
|
|
|
|
## Important
|
|
|
|
- Use the **fix** version of commands, not just verification
|
|
- `dotnet format` fixes, `dotnet format --verify-no-changes` only checks
|
|
- `npm run lint:fix` fixes, `npm run lint` only checks
|
|
- Only report actual errors, not successful formatting changes
|