{"id":47329873,"url":"https://github.com/sbroenne/pytest-codingagents","last_synced_at":"2026-03-17T20:44:53.791Z","repository":{"id":337849631,"uuid":"1155522181","full_name":"sbroenne/pytest-codingagents","owner":"sbroenne","description":"Combatting cargo cult programming in Agent Instructions, Skills, and Custom Agents for GitHub Copilot and other coding agents since 2026.","archived":false,"fork":false,"pushed_at":"2026-02-19T11:37:54.000Z","size":913,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-19T13:45:35.333Z","etag":null,"topics":["agent","agent-skills","copilot-instructions","copilot-sdk","custom-agents","github-copilot","prompts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbroenne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/index.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-11T15:57:02.000Z","updated_at":"2026-02-19T11:37:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sbroenne/pytest-codingagents","commit_stats":null,"previous_names":["sbroenne/pytest-codingagents"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sbroenne/pytest-codingagents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbroenne%2Fpytest-codingagents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbroenne%2Fpytest-codingagents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbroenne%2Fpytest-codingagents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbroenne%2Fpytest-codingagents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbroenne","download_url":"https://codeload.github.com/sbroenne/pytest-codingagents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbroenne%2Fpytest-codingagents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30631410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agent-skills","copilot-instructions","copilot-sdk","custom-agents","github-copilot","prompts"],"created_at":"2026-03-17T20:44:53.104Z","updated_at":"2026-03-17T20:44:53.775Z","avatar_url":"https://github.com/sbroenne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytest-codingagents\n\n**Test-driven prompt engineering for GitHub Copilot.**\n\nEveryone copies instruction files from blog posts, adds \"you are a senior engineer\" to agent configs, and includes skills found on Reddit. But does any of it work? Are your instructions making your agent better — or just longer?\n\n**You don't know, because you're not testing it.**\n\npytest-codingagents gives you a complete **test→optimize→test loop** for GitHub Copilot configurations:\n\n1. **Write a test** — define what the agent *should* do\n2. **Run it** — see it fail (or pass)\n3. **Optimize** — call `optimize_instruction()` to get a concrete suggestion\n4. **A/B confirm** — use `ab_run` to prove the change actually helps\n5. **Ship it** — you now have evidence, not vibes\n\nCurrently supports **GitHub Copilot** via [copilot-sdk](https://www.npmjs.com/package/github-copilot-sdk) with **IDE personas** for VS Code, Claude Code, and Copilot CLI environments.\n\n```python\nfrom pytest_codingagents import CopilotAgent, optimize_instruction\nimport pytest\n\n\nasync def test_docstring_instruction_works(ab_run):\n    \"\"\"Prove the docstring instruction actually changes output, and get a fix if it doesn't.\"\"\"\n    baseline = CopilotAgent(instructions=\"Write Python code.\")\n    treatment = CopilotAgent(\n        instructions=\"Write Python code. Add Google-style docstrings to every function.\"\n    )\n\n    b, t = await ab_run(baseline, treatment, \"Create math.py with add(a, b) and subtract(a, b).\")\n\n    assert b.success and t.success\n\n    if '\"\"\"' not in t.file(\"math.py\"):\n        suggestion = await optimize_instruction(\n            treatment.instructions or \"\",\n            t,\n            \"Agent should add docstrings to every function.\",\n        )\n        pytest.fail(f\"Docstring instruction was ignored.\\n\\n{suggestion}\")\n\n    assert '\"\"\"' not in b.file(\"math.py\"), \"Baseline should not have docstrings\"\n```\n\n## Install\n\n```bash\nuv add pytest-codingagents\n```\n\nAuthenticate via `GITHUB_TOKEN` env var (CI) or `gh auth status` (local).\n\n## What You Can Test\n\n| Capability | What it proves | Guide |\n|---|---|---|\n| **A/B comparison** | Config B actually produces different (and better) output than Config A | [Getting Started](https://sbroenne.github.io/pytest-codingagents/getting-started/) |\n| **Instruction optimization** | Turn a failing test into a ready-to-use instruction fix | [Optimize Instructions](https://sbroenne.github.io/pytest-codingagents/how-to/optimize/) |\n| **Instructions** | Your custom instructions change agent behavior — not just vibes | [Getting Started](https://sbroenne.github.io/pytest-codingagents/getting-started/) |\n| **Skills** | That domain knowledge file is helping, not being ignored | [Skill Testing](https://sbroenne.github.io/pytest-codingagents/how-to/skills/) |\n| **Models** | Which model works best for your use case and budget | [Model Comparison](https://sbroenne.github.io/pytest-codingagents/getting-started/model-comparison/) |\n| **Custom Agents** | Your custom agent configurations actually work as intended | [Getting Started](https://sbroenne.github.io/pytest-codingagents/getting-started/) |\n| **MCP Servers** | The agent discovers and uses your custom tools | [MCP Server Testing](https://sbroenne.github.io/pytest-codingagents/how-to/mcp-servers/) |\n| **CLI Tools** | The agent operates command-line interfaces correctly | [CLI Tool Testing](https://sbroenne.github.io/pytest-codingagents/how-to/cli-tools/) |\n\n## AI Analysis\n\n\u003e **See it in action:** [Basic Report](https://sbroenne.github.io/pytest-codingagents/demo/basic-report.html) · [Model Comparison](https://sbroenne.github.io/pytest-codingagents/demo/model-comparison-report.html) · [Instruction Testing](https://sbroenne.github.io/pytest-codingagents/demo/instruction-testing-report.html)\n\nEvery test run produces an HTML report with AI-powered insights:\n\n- **Diagnoses failures** — root cause analysis with suggested fixes\n- **Compares models** — leaderboards ranked by pass rate and cost\n- **Evaluates instructions** — which instructions produce better results\n- **Recommends improvements** — actionable changes to tools, instructions, and skills\n\n```bash\nuv run pytest tests/ --aitest-html=report.html --aitest-summary-model=azure/gpt-5.2-chat\n```\n\n## Documentation\n\nFull docs at **[sbroenne.github.io/pytest-codingagents](https://sbroenne.github.io/pytest-codingagents/)** — API reference, how-to guides, and demo reports.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbroenne%2Fpytest-codingagents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbroenne%2Fpytest-codingagents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbroenne%2Fpytest-codingagents/lists"}