Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions scripts/validate-skill-templates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1164,17 +1164,27 @@ Add-ValidationResult -Results $results -Name 'dotnet-benchmark enforces valid, p
Add-ValidationResult -Results $results -Name 'Agent Smith protects informational and multi-target EditorConfig remediation' -Action {
$skill = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/SKILL.md' -GitRef $Ref
$reference = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/references/dotnet-editorconfig-conformance.md' -GitRef $Ref
$skillAuthoring = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/references/skill-authoring.md' -GitRef $Ref
$evals = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/evals/evals.json' -GitRef $Ref
$repair = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/scripts/repair-roslyn-multiproject-artifacts.ps1' -GitRef $Ref
$repairTests = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/agent-smith/scripts/test-repair-roslyn-multiproject-artifacts.ps1' -GitRef $Ref

Assert-Contains -Name 'agent-smith/SKILL.md' -Content $skill -Needle 'every discovery, investigation, retry, and final `dotnet format` command must include both `--severity info` and `--verify-no-changes`'
Assert-Contains -Name 'agent-smith/SKILL.md' -Content $skill -Needle 'scripts/repair-roslyn-multiproject-artifacts.ps1'
Assert-Contains -Name 'agent-smith/SKILL.md' -Content $skill -Needle 'Always analyze the task graph for safe parallelism and concurrency.'
Assert-Contains -Name 'agent-smith/SKILL.md' -Content $skill -Needle '**Be concise. Sacrifice grammar for the sake of concision.**'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle 'Batch independent retrieval through one multi-call request where the tool supports it.'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle 'Choose C# and .NET by default for non-trivial reusable scripts'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle '## Required authoring feedback'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle 'Microsoft''s official .NET support policy'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle 'Optimizing skill descriptions'
Assert-Contains -Name 'skill-authoring.md' -Content $skillAuthoring -Needle 'Evaluating skill output quality'
Assert-Contains -Name 'dotnet-editorconfig-conformance.md' -Content $reference -Needle 'dotnet format style "<solution-or-project>"'
Assert-Contains -Name 'dotnet-editorconfig-conformance.md' -Content $reference -Needle '`dotnet format` defaults to severity `warn`'
Assert-Contains -Name 'dotnet-editorconfig-conformance.md' -Content $reference -Needle 'Directory application is all-or-nothing at preflight'
Assert-Contains -Name 'dotnet-editorconfig-conformance.md' -Content $reference -Needle "git grep -n -F 'Unmerged change from project'"
Assert-Contains -Name 'agent-smith/evals/evals.json' -Content $evals -Needle 'finish fixing all IDE0161 findings in MultiTargeted.sln'
Assert-Contains -Name 'agent-smith/evals/evals.json' -Content $evals -Needle 'fetches twelve independent service endpoints sequentially'
Assert-Contains -Name 'repair-roslyn-multiproject-artifacts.ps1' -Content $repair -Needle 'function Test-LinePrefix'
Assert-Contains -Name 'repair-roslyn-multiproject-artifacts.ps1' -Content $repair -Needle "pattern = 'whole-document-namespace-conversion'"
Assert-Contains -Name 'repair-roslyn-multiproject-artifacts.ps1' -Content $repair -Needle "pattern = 'unrecognized'"
Expand Down Expand Up @@ -1203,6 +1213,7 @@ Add-ValidationResult -Results $results -Name 'Git visual commits skill enforces
$commitLanguage = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/git-visual-commits/references/commit-language.md' -GitRef $Ref
$subjectValidator = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/git-visual-commits/scripts/validate-commit-subject.ps1' -GitRef $Ref
$subjectTests = Get-FileText -RepoRoot $repoRoot -RelativePath 'skills/git-visual-commits/scripts/test-commit-subject.ps1' -GitRef $Ref
$readme = Get-FileText -RepoRoot $repoRoot -RelativePath 'README.md' -GitRef $Ref

Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'automatic trigger for this skill, not as a casual hint.'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '### Full-Skill Read and Subject Lock'
Expand Down Expand Up @@ -1257,6 +1268,12 @@ Add-ValidationResult -Results $results -Name 'Git visual commits skill enforces
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '**Documentation publishing**'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '**Community health/release communication**'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Temporal proximity is not a grouping signal.'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '#### Single-category context quality gate'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Exactly one changed file is the only fast-path exception; skip this gate for that case.'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Did I actually read the whole `git-visual-commits` skill through EOF in this session before classifying this change?'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Then re-check the complete `git status`, `git diff`, and applicable staged diff; enumerate every changed path'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Put a visible line in the commit plan such as `Quality gate:'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '`yolo` and `auto` do not bypass this gate.'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle '#### Release-adjacent splitting rule'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Concrete example: if one diff updates `Directory.Build.targets`, `Directory.Packages.props`, or `testenvironments.json`,'
Assert-Contains -Name 'git-visual-commits/SKILL.md' -Content $skill -Needle 'Keep `.nuget/*/PackageReleaseNotes.txt` with the'
Expand Down Expand Up @@ -1307,6 +1324,10 @@ Add-ValidationResult -Results $results -Name 'Git visual commits skill enforces
Assert-Contains -Name 'git-visual-commits/evals/evals.json' -Content $evals -Needle 'Reads SKILL.md completely through EOF before any staging or commit command'
Assert-Contains -Name 'git-visual-commits/evals/evals.json' -Content $evals -Needle 'Rejects the proposed subject because 📋 is absent from the approved commit-language table'
Assert-Contains -Name 'git-visual-commits/evals/evals.json' -Content $evals -Needle 'Runs scripts/validate-commit-subject.ps1 before showing the corrected subject and again immediately before passing it to Git'
Assert-Contains -Name 'git-visual-commits/evals/evals.json' -Content $evals -Needle 'Triggers the single-category context quality gate because more than one file is being placed in one category'
Assert-Contains -Name 'git-visual-commits/evals/evals.json' -Content $evals -Needle 'Recognizes exactly one changed file as the explicit exception and skips the single-category context quality gate'
Assert-Contains -Name 'README.md' -Content $readme -Needle '**Single-category context gate**'
Assert-Contains -Name 'README.md' -Content $readme -Needle 'Multi-file plans that initially collapse to one category also require a visible full-context quality gate'
}

Add-ValidationResult -Results $results -Name 'Git visual squash summary skill stays self-contained and shares commit language rules' -Action {
Expand Down
15 changes: 12 additions & 3 deletions skills/agent-smith/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: agent-smith
description: >
Apply a rigorous, consistent, evidence-driven software-craftsmanship standard across a whole engineering task. Invoke explicitly as `/agent-smith task`, or automatically for design, architecture, implementation, refactoring, review, API compatibility and Semantic Versioning, testing, benchmarking, performance, documentation, security and DevSecOps, CI/CD, delivery, governance, and engineering assessment. For .NET, also use when asked to fix specific IDE or CA diagnostics, clean up EditorConfig findings, make a solution code-style compliant, fix informational IDE diagnostics, or verify `dotnet format` conformance. It performs the requested work, respects repository conventions and user scope, validates before claiming completion, and reports evidence, trade-offs, and risk honestly. Technology-neutral at its core, with optional specialist guidance. Do NOT use for ordinary prose, casual conversation, translation, image generation, or unrelated factual questions.
Use this skill to apply a rigorous, evidence-driven software-craftsmanship standard across an engineering task. Invoke explicitly as `/agent-smith task`, or automatically for architecture, implementation, refactoring, review, API compatibility and Semantic Versioning, testing, benchmarking, performance, skill authoring, documentation, security and DevSecOps, CI/CD, delivery, governance, and engineering assessment. For .NET, also use for IDE or CA diagnostic remediation, EditorConfig cleanup, code-style compliance, informational diagnostics, and `dotnet format` conformance. Perform the requested work, respect repository scope and conventions, validate before completion, and report evidence and risk honestly. Technology-neutral core; specialist guidance loads on demand. Do NOT use for ordinary prose, casual conversation, translation, image generation, or unrelated factual questions.
---

# Agent Smith
Expand All @@ -16,6 +16,12 @@ Apply **one coherent engineering standard** across design, implementation, valid

The standard is technology-neutral. Specialist guidance (including .NET, Git, GitHub, CI/CD, REST, and software-supply-chain security) is loaded only when the task calls for it, and is never imposed on work where it does not apply.

## Critical skill-authoring lock

When creating, modifying, reviewing, or evaluating a skill, read `references/skill-authoring.md` before editing. Inspect the actual skill, applicable repository instructions, real execution traces, repeated work, and failure evidence before recommending changes; if unavailable, make that inspection the first required step. Always analyze the task graph for safe parallelism and concurrency. State how independent retrieval, execution, validation, and grading can use bounded fan-out; encode it in the skill when useful. Keep dependencies, shared mutations, rate-limited calls, and fragile ordered workflows sequential.

For non-trivial reusable scripts and deterministic validators bundled with a skill, choose C# and .NET by default in this .NET-first skill collection. Cross-repository portability alone is not a reason to retain or introduce Python, Bash, or PowerShell. Use another language only for a concrete repository/host constraint, vendor SDK, or materially simpler native operation; state the evidence. Resolve the latest supported .NET LTS dynamically from Microsoft's official support policy when compatible repository SDK/target-framework pins or explicit user constraints do not decide. Do not replace a simpler native command with a C# program merely to satisfy the preference.

## Critical .NET conformance lock

When the task selects .NET EditorConfig conformance mode, read both `references/dotnet.md` and `references/dotnet-editorconfig-conformance.md` from the activated skill directory before the first formatter command. Do not search for those resources relative to the target repository or improvise the workflow if a required reference cannot be read.
Expand Down Expand Up @@ -77,6 +83,7 @@ A task may select **multiple** modes. Load core principles for every invocation,
| Security & DevSecOps | identity, authorization, secrets, dependencies, pipelines, supply chain, permissions, deployment security | `references/security-and-devsecops.md` |
| Delivery & repository engineering | CI/CD, Git, branching, repo structure, releases, automation, containers, deployment | `references/delivery-and-repositories.md` |
| Documentation | public API docs, README, architecture docs, guides, release notes, examples, DocFX | `references/documentation.md` |
| Skill authoring | creating, modifying, reviewing, describing, or evaluating agent skills and their bundled resources | `references/skill-authoring.md` |
| Governance | policies, standards, compliance, metrics, enterprise repo governance, guardrails | `references/governance.md` |

**Load .NET guidance only when .NET or C# is actually relevant.** For non-.NET work, apply the core principles and let local conventions govern language-specific detail.
Expand All @@ -87,6 +94,7 @@ A task may select **multiple** modes. Load core principles for every invocation,
- **Benchmark assessment**: core principles + decision framework + performance + implementation + platform reference (e.g. `dotnet.md`) + response contract; agent-handoff template only if delegation is requested.
- **Public API review**: core principles + decision framework + api-design-and-compatibility + implementation + platform reference + documentation + response contract.
- **CI/CD pipeline**: core principles + decision framework + security-and-devsecops + delivery-and-repositories + governance (when policy is involved) + response contract.
- **Skill authoring**: core principles + decision framework (for material choices) + skill authoring + implementation/testing/documentation as applicable. Make concurrency and script-runtime choices explicit.
- **Scoped .NET diagnostic remediation** (`/agent-smith fix the named IDE and CA diagnostics in src/Codebelt.Core`): core principles + implementation + .NET + .NET EditorConfig conformance + testing. Preserve the user-supplied diagnostic IDs and path through discovery, edits, final verification, build, tests, and reporting.

## Repository precedence
Expand Down Expand Up @@ -122,7 +130,7 @@ For each material finding: Issue → Why it matters → Evidence or reasoning

## Response behaviour

Be direct, respectful, and technically defensible. Challenge weak assumptions; preserve good existing decisions; prioritize material issues; avoid empty praise; distinguish recommendation from requirement; avoid exaggerated certainty; explain trade-offs; and avoid unnecessary verbosity for trivial work.
**Be concise. Sacrifice grammar for the sake of concision.** Prefer clear fragments when they shorten feedback. Remain respectful and technically defensible. Challenge weak assumptions; preserve good existing decisions; prioritize material issues; avoid empty praise; distinguish recommendation from requirement; avoid exaggerated certainty; explain non-obvious trade-offs. Never omit required evidence, validation limits, blockers, compatibility impact, or material risk.

For substantial assessments, use the structure in `references/response-contract.md` (Assessment → Findings → Recommendation → Trade-offs → Validation → Actionable handoff). Do not force that structure onto every response. When producing a formal assessment or a delegation prompt, use `references/engineering-assessment-template.md` or `references/agent-handoff-template.md`.

Expand Down Expand Up @@ -154,7 +162,7 @@ This skill must not:
- turn every small task into an architecture exercise;
- produce advice without completing the requested work when implementation is possible;
- fabricate evidence or claim unperformed validation;
- optimize solely for terseness;
- sacrifice correctness, required evidence, or material context for terseness;
- broaden the task without justification;
- introduce dependencies or abstractions without demonstrating value.

Expand All @@ -174,6 +182,7 @@ Load on demand, per the routing table:
- `references/security-and-devsecops.md` — identity, secrets, dependencies, pipelines, supply chain.
- `references/delivery-and-repositories.md` — CI/CD, Git, releases, repository engineering.
- `references/documentation.md` — documentation as part of the product.
- `references/skill-authoring.md` — skill design, parallelism, .NET-first scripts, descriptions, and eval loops.
- `references/governance.md` — policies, standards, and metrics (Intent → Drivers → Metrics → Actions).
- `references/response-contract.md` — review severity, finding shape, and assessment structure.
- `references/engineering-assessment-template.md` — fill-in template for a formal assessment.
Expand Down
16 changes: 16 additions & 0 deletions skills/agent-smith/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@
"After deliberate recovery, the response requires the artifact tool to report clean and reruns broad dotnet format against MultiTargeted.sln with --severity info and --verify-no-changes",
"The response does not proceed to build or tests or claim completion while any artifact remains unsafe or detected"
]
},
{
"id": 14,
"prompt": "/agent-smith improve our incident-research skill in this .NET-first repository family. It fetches twelve independent service endpoints sequentially, includes a reusable Python validator, has a long implementation-focused description, and has never been compared with a baseline. Keep the guidance reusable across our repositories and tell future agents how to validate the change.",
"expected_output": "A concise, evidence-driven skill-authoring workflow grounded in real traces and repository constraints. It explicitly maps safe bounded concurrency for independent fetches and eval work, preserves ordered or rate-limited operations, favors a C#/.NET validator using a dynamically resolved supported LTS when local pins do not decide, improves and tests the description as an activation contract, and requires clean-context candidate-versus-baseline evals with objective grading, timing, aggregation, and human review.",
"expectations": [
"The response requires inspecting the existing skill, repository conventions, real execution traces, and failure evidence before rewriting generic guidance",
"The response identifies the twelve independent endpoint calls as concurrency candidates and recommends batching or bounded fan-out instead of sequential fetching",
"The response preserves sequential execution for real dependencies, shared mutations, rate limits, or fragile ordering and requires deterministic result ordering and attributable failures",
"The response recommends measuring elapsed time, cost or tokens, error rate, and output quality rather than assuming concurrency is faster",
"The response favors replacing the reusable Python validator with C# and .NET unless repository or host constraints justify another language",
"The response resolves the latest supported .NET LTS dynamically from Microsoft's official support policy when no compatible repository SDK or target-framework pin decides the version, rather than hardcoding a drifting release",
"The response treats the description as the activation contract, uses concise imperative user-intent wording, respects the 1,024-character limit, and tests realistic positive and near-miss triggers with repeated runs and a fixed train/validation split",
"The response requires realistic clean-context candidate-versus-original baseline evals, objective assertions with deterministic grading where possible, timing capture, benchmark aggregation, and human review",
"The feedback is concise and permits compact fragments without omitting validation limits, blockers, compatibility impact, or material risk"
]
}
]
}
Loading
Loading