skills / tests
AGENTS.md3.1k starsChanged 9 months agoMITView on GitHub
This folder contains a test harness for evaluating AI-generated code against acceptance criteria for skills. What we're testing: Skills in .github/skills/ that provide domain knowledge for Azure SDKs. How it works: Run pnpm harness --list from the tests/ directory to see all skills with criteria. Location: tests/scenarios/<skill-name>/acceptance-criteria.md Source materials (in order of priority): Critical: Document import distinctions carefully. Many Azure SDKs have models in different locations (e.g., azure.ai.agents.models vs azure.ai.projects.models). Location: tests/scenarios/<skill-name>/scenarios.yaml Scenario design principles: Success criteria:
- Installs packages
Trending
Quiet since July.thin dataabout the whole repository
Who's talking about microsoft/skills
- @yug1224.com“AIコーディングエージェントがAzure開発を最適化するためのスキルやMCP設定集らしい 現場でAIの精度を高めて開発を効率化したいときに試したい yug1224 starred microsoft/skills…”Bluesky · Jul 4, 2026 · 2 likes
- A Hacker News story“Microsoft Skills”Hacker News · Feb 10, 2026 · 2 points
The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository211 other files it gives its agents.
- Agents.mdAGENTS.md
- .github/plugins/azure-sdk-python/skills/azure-ai-projects-py/references/agents.mdAGENTS.md
- .github/plugins/deep-wiki/commands/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- cost-analysisSkill
- cost-estimationSkill
- cost-governanceSkill
- cost-optimizationSkill
- azure-kusto-graphSkill
- azure-kusto-irql-graphSkill
- azure-kusto-irqlSkill
- azure-local-multi-rackSkill
- azure-localSkill
- azure-ai-agents-persistent-dotnetSkill
- azure-ai-document-intelligence-dotnetSkill
- azure-ai-openai-dotnetSkill
- azure-ai-projects-dotnetSkill
- azure-ai-voicelive-dotnetSkill
- azure-eventgrid-dotnetSkill
- azure-eventhub-dotnetSkill
- azure-identity-dotnetSkill
- azure-maps-search-dotnetSkill
- azure-mgmt-apicenter-dotnetSkill
- azure-mgmt-apimanagement-dotnetSkill
- azure-mgmt-applicationinsights-dotnetSkill
- azure-mgmt-arizeaiobservabilityeval-dotnetSkill
- azure-mgmt-botservice-dotnetSkill
- azure-mgmt-fabric-dotnetSkill
- azure-mgmt-mongodbatlas-dotnetSkill
- azure-mgmt-weightsandbiases-dotnetSkill
- azure-resource-manager-cosmosdb-dotnetSkill
- azure-resource-manager-durabletask-dotnetSkill
- azure-resource-manager-mysql-dotnetSkill
- azure-resource-manager-playwright-dotnetSkill
- azure-resource-manager-postgresql-dotnetSkill
- azure-resource-manager-redis-dotnetSkill
- azure-resource-manager-sql-dotnetSkill
- azure-search-documents-dotnetSkill
- azure-security-keyvault-keys-dotnetSkill
- azure-servicebus-dotnetSkill
- m365-agents-dotnetSkill
- microsoft-azure-webjobs-extensions-authentication-events-dotnetSkill
- azure-ai-agents-persistent-javaSkill
- azure-ai-anomalydetector-javaSkill
- azure-ai-contentsafety-javaSkill
- azure-ai-formrecognizer-javaSkill
- azure-ai-projects-javaSkill
- azure-ai-vision-imageanalysis-javaSkill
- azure-ai-voicelive-javaSkill
- azure-appconfiguration-javaSkill
- azure-communication-callautomation-javaSkill
- azure-communication-callingserver-javaSkill
- azure-communication-chat-javaSkill
- azure-communication-common-javaSkill
- azure-communication-sms-javaSkill
- azure-compute-batch-javaSkill
- azure-cosmos-javaSkill
- azure-data-tables-javaSkill
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Test scenarios prompt code generation and validate the output
- Very specific: line 21
Run pnpm harness --list from the tests/ directory to see all skills with criteria.
- Very specific: line 57
Critical: Document import distinctions carefully.
- Distinctive: line 117
All scenarios pass (100% pass rate)
- Distinctive: line 118
No false positives (mock responses should always pass)
- Very specific: line 184
All commands should be run from the tests/ directory after pnpm install.
- Distinctive: line 290
No improvement between iterations
- Distinctive: line 297
Look at these files for patterns:
- Distinctive: line 305
Create tests alongside implementation:
- Distinctive: line 365
Matching: If ALL imports in the pattern are present, it's flagged as incorrect.
- Distinctive: line 382
Only the misuse context makes it incorrect
- Distinctive: line 412
Use when the import path itself is wrong:
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Test Harness Agent Instructions
This folder contains a test harness for evaluating AI-generated code against acceptance criteria for skills.
Quick Context
What we're testing: Skills in .github/skills/ that provide domain knowledge for Azure SDKs.
How it works:
- Each skill has acceptance criteria (correct/incorrect code patterns)
- Test scenarios prompt code generation and validate the output
- The harness runs scenarios using the GitHub Copilot SDK and scores generated code against criteria
Current State
| Skill | Criteria | Scenarios | Status |
azure-ai-projects-py | Complete | Complete | Passing |
Run pnpm harness --list from the tests/ directory to see all skills with criteria.
Task: Add Test Coverage for a New Skill
Step 1: Create Acceptance Criteria
Location: tests/scenarios/<skill-name>/acceptance-criteria.md
Source materials (in order of priority):
.github/skills/<skill-name>/references/*.md— existing reference docs- Official Microsoft Learn docs via
microsoft-docsMCP - SDK source code patterns
Format:
# Acceptance Criteria: <skill-name>
## Section Name
### Correct
\`\`\`python
# Working pattern
from azure.module import Client
\`\`\`
### Incorrect
\`\`\`python
# Anti-pattern with explanation
from wrong.module import Client # Wrong import path
\`\`\`Critical: Document import distinctions carefully. Many Azure SDKs have models in different locations (e.g., azure.ai.agents.models vs azure.ai.projects.models).
Step 2: Create Test Scenarios
Location: tests/scenarios/<skill-name>/scenarios.yaml
Template:
config:
model: gpt-4
max_tokens: 2000
temperature: 0.3
scenarios:
- name: scenario_name
prompt: |
Clear instruction for what code to generate.
Include specific requirements.
expected_patterns:
- "Pattern that MUST appear"
- "Another required pattern"
forbidden_patterns:
- "Pattern that must NOT appear"
tags:
- category
mock_response: |
# Complete working code example
# This is used in mock modeScenario design principles:
- Each scenario tests ONE specific pattern or feature
expected_patterns— patterns that MUST appear in generated codeforbidden_patterns— common mistakes that must NOT appearmock_response— complete, working code that passes all checkstags— for filtering (basic,async,streaming,tools, etc.)
Step 3: Verify
# Install dependencies (from tests directory)
cd tests && pnpm install
# Check skill is discovered
pnpm harness --list
# Run in mock mode (fast, deterministic)
pnpm harness <skill-name> --mock --verbose
# Run specific scenario
pnpm harness <skill-name> --mock --filter scenario_name
# Run tests
pnpm testSuccess criteria:
- All scenarios pass (100% pass rate)
- No false positives (mock responses should always pass)
- Patterns catch real mistakes (forbidden patterns are meaningful)
File Structure
tests/
├── harness/
│ ├── types.ts # Type definitions
│ ├── criteria-loader.ts # Parses acceptance-criteria.md
│ ├── evaluator.ts # Validates code against patterns
│ ├── copilot-client.ts # Code generation (mock/real)
│ ├── runner.ts # CLI: pnpm harness
│ ├── ralph-loop.ts # Iterative improvement controller
│ ├── feedback-builder.ts # LLM-actionable feedback generator
│ ├── index.ts # Package exports
│ └── reporters/ # Output formatters
│ ├── console.ts # Console output
│ └── markdown.ts # Markdown reports
│
├── scenarios/
│ ├── azure-ai-projects-py/
│ │ └── scenarios.yaml # 12 scenarios
│
├── package.json # Dependencies (pnpm)
├── tsconfig.json # TypeScript config
└── README.md # Detailed documentationAcceptance criteria location:
tests/scenarios/<skill-name>/acceptance-criteria.mdCommon Patterns to Test
For Azure SDK Skills
| Pattern | What to Check |
| Imports | Correct module paths (e.g., azure.ai.agents vs azure.ai.projects) |
| Authentication | DefaultAzureCredential, not hardcoded credentials |
| Client creation | Context managers (with client:) for resource cleanup |
| Async variants | Correct .aio imports for async code |
| Models | Import from correct module (varies by SDK) |
Example: Import Distinctions
# azure-ai-projects-py scenarios.yaml excerpt
- name: agent_with_code_interpreter
expected_patterns:
- "from azure.ai.agents.models import CodeInterpreterTool" # LOW-LEVEL
forbidden_patterns:
- "from azure.ai.projects.models import CodeInterpreterTool" # WRONGCommands Reference
All commands should be run from the tests/ directory after pnpm install.
# List available skills
pnpm harness --list
# Run all scenarios for a skill (mock mode)
pnpm harness <skill> --mock --verbose
# Run filtered scenarios
pnpm harness <skill> --mock --filter <name-or-tag>
# Run with Ralph Loop (iterative improvement)
pnpm harness <skill> --ralph --mock --max-iterations 5 --threshold 85
# Run tests (all tests)
pnpm test
# Run specific test file
pnpm test:run harness/ralph-loop.test.ts
# Run typecheck
pnpm typecheckTroubleshooting
| Issue | Fix | |
| Skill not discovered | Check acceptance-criteria.md exists in tests/scenarios/<skill-name>/ | |
| Scenario fails | Check mock_response actually contains expected patterns | |
| Pattern not matching | Escape regex special chars, use raw strings | |
| YAML parse error | Check indentation, use ` | ` for multiline strings |
Next Skills to Add Coverage
Priority skills without test coverage (check with --list):
azure-cosmos-db-py— Cosmos DB patternsazure-search-documents-py— Vector search, hybrid searchazure-identity-py— Authentication patternsazure-ai-voicelive-py— Real-time voice AI
For each, follow the 3-step process above.
Ralph Loop Development
Task Plan:
.sisyphus/plans/ralph-loop-quality-tasks.md
The Ralph Loop is an iterative code generation and improvement system that re-generates code until quality thresholds are met.
What is Ralph Loop?
┌─────────────────────────────────────────────────────────────────┐
│ Ralph Loop Controller │
│ (Orchestrates iterations, tracks progress, manages state) │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Generate │──>│ Evaluate │──>│ Analyze Failures │ │
│ │ Code │ │ (Score) │ │ (Build Feedback) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ ^ │ │
│ └──────────────────────────────────────┘ │
│ (Loop until threshold met) │
└─────────────────────────────────────────────────────────────────┘Core flow:
- Generate code for a given skill/scenario
- Evaluate against acceptance criteria (score 0-100)
- Analyze failures and determine corrective actions
- Re-generate with feedback until quality threshold is met (or max iterations)
- Report on quality improvements across iterations
Implementation Status
| Component | File | Status |
| Ralph Loop Controller | harness/ralph-loop.ts | Complete |
| Feedback Builder | harness/feedback-builder.ts | Complete |
| CLI Integration | harness/runner.ts | Complete |
| Unit Tests | harness/*.test.ts | Complete (45 tests) |
Using Ralph Loop
# Basic usage
pnpm harness azure-ai-projects-py --ralph --mock
# With custom settings
pnpm harness azure-ai-projects-py --ralph --max-iterations 5 --threshold 85 --mock --verboseStop conditions:
- Quality threshold met (default: 80)
- Perfect score (100)
- Max iterations reached (default: 5)
- No improvement between iterations
- Score regression
Key Patterns
Match Existing Style
Look at these files for patterns:
harness/evaluator.ts— Scoring logic,EvaluationResultstructureharness/criteria-loader.ts— File loading, parsingharness/runner.ts— CLI integration,SkillEvaluationRunner
Test-Driven Development
Create tests alongside implementation:
# Example test file structure
tests/
├── harness/
│ ├── ralph-loop.ts # Implementation
│ └── ralph-loop.test.ts # TestsRun tests:
cd tests
pnpm install
pnpm test:run harness/ralph-loop.test.ts -vSuccess Criteria
Phase 1 is complete when:
--ralphflag runs iterative loop on any skill- Feedback mechanism improves scores across iterations
- All new code has test coverage (45 tests passing)
Full implementation success:
- 127 skills can run through Ralph Loop
- Average convergence in <5 iterations
- Quality scores improve by >20% from iteration 1 to final
Pattern Matching: How the Evaluator Works
The evaluator validates generated code against acceptance criteria patterns. Understanding how it works helps you write effective criteria and debug failing tests.
Pattern Types
| Pattern Type | Purpose | Matching Strategy |
| Correct patterns | Document expected usage | FLEXIBLE matching (allows variations) |
| Incorrect patterns | Document anti-patterns | EXACT matching (catches specific errors) |
| Import-only patterns | Wrong import paths | ALL imports must match |
| Mixed patterns | Import + misuse context | ALL parts must match |
How Incorrect Patterns Are Evaluated
The evaluator distinguishes between two types of incorrect patterns:
1. Import-Only Patterns (Pure Import Errors)
These show wrong import paths where the import itself is the error:
# WRONG - clients are in azure.ai.contentsafety, not models
from azure.ai.contentsafety.models import ContentSafetyClientMatching: If ALL imports in the pattern are present, it's flagged as incorrect.
2. Mixed Patterns (Import + Misuse)
These show a valid import being misused:
# WRONG - AnalyzeTextOptions is for text analysis only
from azure.ai.contentsafety.models import AnalyzeTextOptions
request = AnalyzeTextOptions(text="image.jpg")
response = client.analyze_image(request) # <-- The actual errorMatching: BOTH the imports AND the non-import code (the misuse) must be present. This prevents false positives when:
- The import is valid for its intended use
- Only the misuse context makes it incorrect
Why This Matters
Bad behavior (before fix):
Code: from azure.ai.contentsafety.models import AnalyzeTextOptions
request = AnalyzeTextOptions(text="Hello")
response = client.analyze_text(request) # CORRECT usage!
Result: ❌ FALSE POSITIVE - flagged as incorrect because the import appears
in an incorrect pattern, even though the misuse isn't presentGood behavior (after fix):
Code: from azure.ai.contentsafety.models import AnalyzeTextOptions
request = AnalyzeTextOptions(text="Hello")
response = client.analyze_text(request) # CORRECT usage!
Result: ✅ PASSES - the import is only flagged when used incorrectly
(e.g., with analyze_image instead of analyze_text)Writing Effective Acceptance Criteria
For Import-Only Errors
Use when the import path itself is wrong:
### ❌ Incorrect: Wrong import path
\`\`\`python
# WRONG - clients are not in models submodule
from azure.ai.contentsafety.models import ContentSafetyClient
\`\`\`For Misuse Errors
Show the FULL context - both the import and how it's being misused:
### ❌ Incorrect: Using text models for image analysis
\`\`\`python
# WRONG - AnalyzeTextOptions is for text, not images
from azure.ai.contentsafety.models import AnalyzeTextOptions
request = AnalyzeTextOptions(text="image.jpg")
response = client.analyze_image(request)
\`\`\`Key principle: The incorrect pattern should be the COMPLETE anti-pattern. Don't just show the import if the error is in how it's used.
Debugging Failing Tests
| Symptom | Likely Cause | Fix |
| False positive (valid code flagged) | Mixed pattern only checking imports | Ensure non-import lines show the actual error |
| False negative (bad code passes) | Pattern too specific | Relax exact matching or add more pattern variations |
| Score lower than expected | Multiple patterns matching | Check for overlapping incorrect patterns |
Debug command:
pnpm harness <skill> --mock --verboseThis shows which patterns matched and why each scenario passed/failed.
Key Files
| File | Purpose |
harness/evaluator.ts | Pattern matching logic (patternMatches, checkImports) |
harness/criteria-loader.ts | Parses acceptance-criteria.md into structured patterns |
harness/types.ts | CodePattern, EvaluationResult types |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

