simplify
/simplify
Refactor and clean up code after tests pass.
Usage
/simplify
/simplify src/openenv/core/client.py
When to Use
- After
/implementmakes tests pass - When code is correct but could be cleaner
- Before creating a PR (optional polish step)
When NOT to Use
- Tests are failing (fix tests first)
- You want to add new functionality (use
/write-testsfirst) - Code is already clean and simple
What It Does
- Runs tests to ensure they pass (baseline)
- Identifies opportunities for simplification
- Refactors while keeping tests green
- Runs tests after each change to verify nothing broke
Philosophy
This is TDD's third phase: Red → Green → Refactor.
The goal is NOT to add features or change behavior. The goal is to make the code:
- Easier to read
- Easier to maintain
- More consistent with project patterns
- Less duplicated
Guidelines
Good Simplifications
- Extract helper functions to reduce duplication
- Rename variables for clarity
- Remove dead code
- Simplify complex conditionals
- Use more Pythonic idioms
NOT Simplifications (Avoid)
- Adding new features
- Changing public APIs
- "Improving" code that works and is readable
- Adding abstractions for hypothetical future needs
Completion Criteria
- All tests still pass
- Code is cleaner/simpler than before
- No new functionality was added
- Changes follow project patterns (see PATTERNS.md)
Integration with TDD Workflow
/write-tests → create failing tests (Red)
↓
/implement → make tests pass (Green)
↓
/simplify → clean up code (Refactor)
↓
/pre-submit-pr → validate before PR
More from meta-pytorch/openenv
write-tests
Write failing tests from requirements. Invoke for each todo before /implement.
25alignment-review
Review code changes for bugs and alignment with OpenEnv principles and RFCs. Use when reviewing PRs, checking code before commit, or when asked to review changes. Implements two-tier review model.
20pre-submit-pr
Validate changes before submitting a pull request. Run comprehensive checks including lint, tests, alignment review, and RFC analysis. Use before creating a PR, when asked if code is ready for review, or before pushing for PR.
20rfc-check
Determine if proposed changes require an RFC. Use when planning significant changes, before starting major work, or when asked whether an RFC is needed.
19implement
Make tests pass. Invoke after /write-tests produces failing tests.
17work-on-issue
Start work on a GitHub issue. Extracts requirements, creates worktree, sets up TDD workflow.
17