simplify

Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

npx skills add https://github.com/huggingface/openenv --skill simplify

/simplify

Refactor and clean up code after tests pass.

Usage

/simplify
/simplify src/openenv/core/client.py

When to Use

  • After /implement makes 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-tests first)
  • Code is already clean and simple

What It Does

  1. Runs tests to ensure they pass (baseline)
  2. Identifies opportunities for simplification
  3. Refactors while keeping tests green
  4. 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

  1. All tests still pass
  2. Code is cleaner/simpler than before
  3. No new functionality was added
  4. 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

Mehr Skills von huggingface

cpu-kernels
huggingface
Bietet Anleitung zum Schreiben, Optimieren und Benchmarken von C++ CPU-Kernels mit SIMD-Intrinsics (AVX2/AVX512) für das Hugging Face Kernels-Ökosystem. Enthält…
official
generate-openenv-env
huggingface
Generiere OpenEnv-Umgebungen aus einem konkreten Anwendungsfall (z. B. „generiere eine Umgebung für die Bibliothek textarena“). Verwende, wenn du aufgefordert wirst, eine neue zu entwerfen oder zu implementieren…
official
hf-mcp
huggingface
Nutze den Hugging Face Hub über MCP-Server-Tools. Durchsuche Modelle, Datensätze, Spaces, Papers. Rufe Repo-Details ab, rufe Dokumentationen ab, führe Compute-Jobs aus und nutze Gradio…
official
trl-training
huggingface
Trainieren und Feinabstimmen von Transformer-Sprachmodellen mit TRL (Transformers Reinforcement Learning). Unterstützt SFT, DPO, GRPO, KTO, RLOO und Reward-Modell-Training…
official
deploy-hf
huggingface
Stelle eine OpenEnv-Umgebung auf Hugging Face Spaces bereit. Verwende dies, wenn du aufgefordert wirst, etwas bereitzustellen, auf Hugging Face zu pushen oder einen Space zu aktualisieren.
official
hf-space-recovery
huggingface
Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…
official
pre-submit-pr
huggingface
Änderungen vor dem Einreichen eines Pull Requests validieren. Führen Sie umfassende Prüfungen durch, einschließlich Lint, Tests, Ausrichtungsüberprüfung und RFC-Analyse. Verwenden Sie vor dem Erstellen eines…
official
example-skill
huggingface
Beispiel-Fixture-Skill für Action-Smoke-Tests
official