# Tdd Refactor

> |

- **Type:** Skill
- **Install:** `agentstack add skill-mrlarson2007-copilot-tdd-harness-tdd-refactor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mrlarson2007](https://agentstack.voostack.com/s/mrlarson2007)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [mrlarson2007](https://github.com/mrlarson2007)
- **Source:** https://github.com/mrlarson2007/copilot-tdd-harness/tree/master/.github/skills/tdd-refactor

## Install

```sh
agentstack add skill-mrlarson2007-copilot-tdd-harness-tdd-refactor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# TDD Refactor Phase Skill

## Purpose
- Improve code and test design after green
- Preserve all existing behavior
- Prioritize readability over forced deduplication
- Introduce helpers/builders when they improve future test authoring

## Inputs
- Commit details from commit stage (sha/message)
- Committed baseline
- Readability goals
- Project refactor patterns from `.github/instructions/tdd-patterns.instructions.md`
- Canonical REFACTOR style guide placeholder at `.github/skills/tdd-refactor/assets/project-refactor-patterns.md`

## Outputs
- Refactor diff
- Test pass evidence
- Helper/builder notes

## Steps
1. Load `.github/skills/tdd-refactor/assets/project-refactor-patterns.md` first, then load core asset files for refactor patterns, anti-patterns, and test readability
2. Inspect surrounding code around each in-scope change before refactoring
3. Refactor code and tests as needed
4. Use `tdd-test-run` with a `test_run_request` contract whose expected result is
  a passing validation for the touched slice, then the broader suite required
  by project policy
5. If the observed result does not match the expected REFACTOR outcome, revert
  only the scoped refactor changes and return to the pre-refactor baseline
6. Return contract output

## Completion Checks
- All behavior preserved
- Code and tests are more readable/maintainable
- Helpers/builders introduced only when justified

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mrlarson2007](https://github.com/mrlarson2007)
- **Source:** [mrlarson2007/copilot-tdd-harness](https://github.com/mrlarson2007/copilot-tdd-harness)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mrlarson2007-copilot-tdd-harness-tdd-refactor
- Seller: https://agentstack.voostack.com/s/mrlarson2007
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
