simplify

โดย huggingface

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

Skills เพิ่มเติมจาก huggingface

cpu-kernels
huggingface
ให้คำแนะนำในการเขียน ปรับแต่งประสิทธิภาพ และวัดประสิทธิภาพของ CPU kernels ในภาษา C++ ด้วย SIMD intrinsics (AVX2/AVX512) สำหรับระบบนิเวศของ Hugging Face kernels รวมถึง…
official
generate-openenv-env
huggingface
สร้างสภาพแวดล้อม OpenEnv จากกรณีการใช้งานที่เป็นรูปธรรม (เช่น "สร้างสภาพแวดล้อมสำหรับ library textarena") ใช้เมื่อถูกขอให้ออกแบบหรือนำไปใช้งานใหม่…
official
hf-mcp
huggingface
ใช้ Hugging Face Hub ผ่านเครื่องมือเซิร์ฟเวอร์ MCP ค้นหาโมเดล ชุดข้อมูล Spaces เอกสารวิจัย รับรายละเอียด repo ดึงเอกสารประกอบ เรียกใช้งาน compute และใช้ Gradio…
official
trl-training
huggingface
ฝึกและปรับแต่งโมเดลภาษาทรานส์ฟอร์มเมอร์โดยใช้ TRL (Transformers Reinforcement Learning) รองรับการฝึก SFT, DPO, GRPO, KTO, RLOO และ Reward Model…
official
deploy-hf
huggingface
ปรับใช้สภาพแวดล้อม OpenEnv ไปยัง Hugging Face Spaces ใช้เมื่อถูกขอให้ปรับใช้, ส่งไปยัง Hugging Face, หรืออัปเดตสเปซ
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
ตรวจสอบการเปลี่ยนแปลงก่อนส่ง pull request โดยรันการตรวจสอบที่ครอบคลุม เช่น lint, การทดสอบ, การตรวจสอบความสอดคล้อง และการวิเคราะห์ RFC ใช้ก่อนสร้าง…
official
example-skill
huggingface
สกิลฟิกซ์เจอร์ตัวอย่างสำหรับการทดสอบสโม้กของแอคชัน
official