Token导航 LogoToken导航

Agent Skill · 研究检索

refac-cli-push-down(refac CLI push down 搜索)

refac-cli-push-down 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

refac-cli-push-down 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 72,083。

总安装 190周安装 8GitHub Stars 81下载 67核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:refac-cli-push-down(refac CLI push down 搜索)
来源仓库:https://github.com/dagster-io/erk
仓库路径:skills/refac-cli-push-down
安装命令:
npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找和筛选与代码重构相关的信息。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。适合在 CI/CD 流水线或自动化重构场景中定位方案。需结合具体编程语言和项目结构进行适配。使用前请确认是否会触发代码修改或提交操作。

refac-cli-push-down 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/refac-cli-push-down

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

refac-cli-push-down 怎么安装?

在终端执行 npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

refac-cli-push-down 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

refac-cli-push-down 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

refac-cli-push-down 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

refac-cli-push-down 用的人多吗?

公开数据是累计安装 190 次,近一周安装 8 次,下载 67 次,GitHub 81 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

refac-cli-push-down 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
refac-cli-push-down

refac CLI push down 搜索 · 本页

19081执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

You are an expert at identifying mechanical computation embedded in agent prompts and pushing it down into tested CLI commands. This skill documents a proven pattern for reducing prompt complexity, improving reliability, and making agent workflows testable.

The Pattern

If it requires understanding meaning, keep it in the agent. If it's mechanical transformation, push it to a CLI command.

Like database query optimizers that "push down" predicates closer to the data layer for efficiency, this pattern moves computation from LLM prompts to tested code where it belongs.

Push to CLI CommandKeep in Agent
Parsing/validation (URLs, formats, paths)Semantic analysis (summarizing, naming)
Data extraction (JSON/YAML, filtering)Content generation (docs, code, messages)
Deterministic operations (file queries, transforms)Complex reasoning (trade-offs, ambiguity)
Token reduction (compressing, pre-filtering)Decision-making (planning, interpretation)

Why It Matters

Token reduction. Every line of bash, parsing logic, and error handling in a markdown prompt consumes context tokens. Pushing mechanical work to code shrinks prompts by 50-70%, leaving the agent focused on decisions that require judgment.

Testability. You cannot unit test bash embedded in markdown. A CLI command is a regular function with pytest coverage, mocked dependencies, and edge case validation. Bugs get caught in CI, not during agent runs.

Reliability. Embedded bash varies between shells, lacks type safety, and fails silently on typos. A proper language provides a real execution environment with proper error handling, structured JSON output, and deterministic behavior.

Composability. Once logic lives in a CLI command, multiple skills and commands can invoke it. Changes to the logic propagate to all callers without updating markdown files.

Recognizing Opportunities

A prompt is a candidate for push-down when you spot any of these smells:

  • Inline bash blocks parsing JSON, extracting fields, or constructing commands
  • Multi-step shell pipelines (e.g., gh api... | jq... | sed...)
  • Conditional logic in markdown with nested if/else decision trees
  • String manipulation (regex matching, URL parsing, slug generation)
  • Data transformation (YAML to JSON, filtering lists, merging objects)
  • Repeated mechanical sequences duplicated across multiple commands/skills
  • Agent instructions for deterministic work ("extract the plan number from the URL", "parse the config and find matching entries")
  • Prompt exceeding ~100 lines of procedural steps (not counting context/explanation)

The Push-Down Checklist

  1. Identify the mechanical segment. Find the block of deterministic logic in the prompt. Ask: "Does an LLM add value here, or is it just executing instructions mechanically?"
  2. Define the JSON contract. Design the input (CLI flags/args) and output (JSON schema) before writing code. The agent will read this JSON, so make it agent-friendly:

- Include success: bool at the top level - On failure, include error with human-readable message - Include all data the agent needs for subsequent steps

  1. Create the CLI command. Write a subcommand in your project's CLI framework (Click, argparse, Typer, or similar). Place it in a dedicated directory for helper commands — e.g., src/myproject/cli/commands/helpers/. The command should accept structured input via flags/args and emit JSON to stdout. # Example with Click @click.command() @click.option("--repo", required=True) @click.option("--json", "as_json", is_flag=True) def check_pr_status(*, repo: str, as_json: bool) -> None: result = _fetch_and_validate(repo) if as_json: click.echo(json.dumps(result))
  2. Write tests first. Create a test file alongside or in a parallel test directory. Test the happy path, error cases, and edge cases. Mock external dependencies (API calls, file system, subprocess). def test_check_pr_status_returns_open_prs(fake_github: FakeLocalGitHub) -> None: fake_github.add_pr(number=42, state="open", title="Add feature") result = invoke_cli(["check-pr-status", "--repo", "myorg/myrepo", "--json"]) data = json.loads(result.output) assert data["success"] is True assert len(data["prs"]) == 1
  3. Register the command. Add it to the appropriate CLI group so it's discoverable: # In your CLI group file helpers_group.add_command(check_pr_status)
  4. Update the prompt. Replace the mechanical block with a single CLI invocation. The prompt should now focus on interpreting the JSON output and making decisions.
  5. Verify token reduction. Compare before/after line counts. A well-executed push-down reduces the prompt section by 50-70%.

Examples

Example A: PR Workflow Simplification

Before — a slash command with inline bash to gather PR context:

## Step 1: Gather PR Information

Run these commands and parse the output:

1. Get open PRs: `gh pr list --repo {{repo}} --json number,title,state,headRefName`
2. For each PR, check CI status: `gh pr checks {{number}} --repo {{repo}}`
3. Filter to PRs where all checks pass: parse the JSON, extract status fields,
   compare against "pass"/"success", collect matching PR numbers
4. Get review status: `gh api repos/{{owner}}/{{repo}}/pulls/{{number}}/reviews | jq '[.[] | {user: .user.login, state: .state}]'`
5. Combine results into a summary with PR number, title, CI status, and review state

After — one CLI command returning structured JSON:

## Step 1: Gather PR Information

Run: `mytool pr-triage --repo {{repo}} --json`

This returns JSON with `success`, `prs` (each with `number`, `title`, `ci_status`, `reviews`), and `summary`.

The 15 lines of bash parsing and jq pipelines became a tested Python command. The agent focuses on deciding which PR to prioritize — the part that actually requires judgment.

Example B: Config Validation

Before — inline YAML parsing and conditional logic in the prompt:

## Validate Configuration

1. Read the config file at `config/settings.yaml`
2. Parse the YAML content
3. Check that `database.host` exists and is a valid hostname
4. Check that `database.port` is between 1024 and 65535
5. Check that `auth.provider` is one of: "oauth2", "saml", "local"
6. If `auth.provider` is "oauth2", verify `auth.client_id` and `auth.redirect_uri` exist
7. If any check fails, list all failures with field paths
8. If all checks pass, output the resolved configuration with defaults applied

After — a single CLI call with a JSON contract:

## Validate Configuration

Run: `mytool config validate --file config/settings.yaml --json`

The command returns:

- On success: `{"success": true, "config": {<resolved config with defaults>}}`
- On failure: `{"success": false, "errors": [{"field": "database.port", "message": "..."}]}`

If validation fails, report the errors to the user. If it succeeds, proceed with the resolved config.

Eight steps of deterministic validation collapsed into one call. The agent only handles the response — reporting errors or proceeding.

Example C: Multi-Step Data Pipeline

Before — an agent executing sequential shell commands:

## Gather Release Notes

1. Fetch commits since last tag: `git log $(git describe --tags --abbrev=0)..HEAD --oneline`
2. Filter to conventional commits: parse each line, match against `feat:`, `fix:`, `docs:` patterns
3. Group by type (features, fixes, docs)
4. For each commit, extract the PR number from the message if present
5. Fetch PR details for each: `gh pr view {{number}} --json title,labels,author`
6. Format as markdown with sections per type, PR links, and author attribution

After — one command that handles the entire pipeline:

## Gather Release Notes

Run: `mytool release-notes --since-last-tag --json`

Returns `{"success": true, "sections": {"features": [...], "fixes": [...], "docs": [...]}, "contributors": [...]}`.

Review the generated sections. Add or edit descriptions where the commit messages are unclear, then format for the changelog.

Anti-pattern to avoid here: Don't split this into mytool list-commits, mytool classify-commits, mytool fetch-pr-details, mytool format-notes. Four commands with intermediate JSON passed between them recreates the same sequential complexity in the prompt. One command that does the full pipeline is simpler for the agent.

Anti-Patterns

Over-pushing into scattered commands

Push-down can go too far. When each small task becomes its own CLI command, you get a proliferation of tiny commands that are hard to discover and maintain.

Rule of thumb: If the command is under ~30 lines of logic and only called from one place, consider whether it belongs as part of a larger command instead.

Under-composing outputs

A push-down command that returns minimal JSON forces the agent to make additional calls for related data. Design the output to include everything the agent needs for the next decision.

Bad: {"pr_number": 42} — agent must now fetch plan details separately. Good: {"pr_number": 42, "title": "...", "phases": [...], "related_docs": {...}} — agent can proceed immediately.

Pushing semantic work

Not everything belongs in code. If the agent needs to understand meaning, summarize, name things, or make judgment calls, that work should stay in the prompt. Push-down is for mechanical transformation, not reasoning.

Ignoring the JSON contract

CLI commands must return structured JSON with success: bool. Without a consistent contract, agents resort to text parsing, which defeats the purpose of push-down.

Adapting to Your Project

This pattern works with any CLI framework. The key elements are:

  • A dedicated command directory for helper subcommands (keeps them organized and discoverable)
  • Structured JSON output with a consistent contract (success, error, payload fields)
  • Test coverage for each command, mocking external dependencies
  • Registration in a CLI group so commands are invocable by name

Whether you use Click, argparse, Typer, or a shell script wrapper, the push-down principle is the same: move mechanical computation out of prompts and into tested, deterministic code.

平台分布

Codex

37%
按下载量换算25

Claude

26.76%
按下载量换算18

Cursor

17.94%
按下载量换算12

Gemini CLI

9.7%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dagster-io/erk --skill refac-cli-push-down 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills