跳到正文
cccskills
免费在 GitHub 公开

simplify

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

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md1.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

/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 code

Guidelines

Good Simplifications

  • Inline needless helpers and indirection (see Simplicity in CLAUDE.md)
  • 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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

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.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

deploy-hf

免费

Deploy an OpenEnv environment to Hugging Face Spaces. Use when asked to deploy, push to Hugging Face, or update a space.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

Generate OpenEnv environments from a concrete use case (for example, "generate an env for the library textarena"). Use when asked to design or implement a new environment under envs/ by researching a target library/API, selecting matching OpenEnv examples, asking key implementation questions, and building models/client/server/openenv.yaml. Do not use for model training or evaluation tasks.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

hf-cli

免费

Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing repositories, models, datasets, and Spaces on the Hugging Face Hub. Replaces now deprecated `huggingface-cli` command.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv` namespace with version suffixes), when Spaces are in `BUILDING`/`APP_STARTING`/`RUNTIME_ERROR`, or when release collections need to be reconciled after targeted redeploys.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

implement

免费

Make tests pass. Invoke after /write-tests produces failing tests.

中文简介正在准备中。当前显示原文说明。

huggingface/OpenEnv27302026年10月19日 更新

查看 huggingface 的全部技能

报告此技能的问题