add-python-command — for Claude Code add-python-command, ishlib, community, for Claude Code, ide skills, cli.py, CLAUDE.md, ishfiles, isholate, register(subparsers)

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need add or update a python cli subcommand. 本地化技能摘要: # Add or update a Python CLI subcommand Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

Add or update a Python CLI subcommand
Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based
dispatch. This skill walks through the four-way update every new or changed
Before you start: read the relevant CLI's current cli.py and one
nearby subcommand implementation so the new one matches style. Also

# 核心主题

ishkamiel ishkamiel
[0]
[0]
更新于: 4/19/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
8/11
Quality Score
49
Canonical Locale
en
Detected Body Locale
en

适用场景: Ideal for AI agents that need add or update a python cli subcommand. 本地化技能摘要: # Add or update a Python CLI subcommand Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

推荐说明: add-python-command helps agents add or update a python cli subcommand. Add or update a Python CLI subcommand Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This AI agent skill

适用 Agent 类型

适用场景: Ideal for AI agents that need add or update a python cli subcommand.

赋予的主要能力 · add-python-command

适用任务: Applying Add or update a Python CLI subcommand
适用任务: Applying Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based
适用任务: Applying dispatch. This skill walks through the four-way update every new or changed

! 使用限制与门槛

  • 限制说明: Output goes through log = logging.getLogger( name ). Only a
  • 限制说明: add common args(p)). Do not attach them to the top-level parser
  • 限制说明: parents=[common] pattern has the same bug and must not be used for

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

add-python-command 是什么?

适用场景: Ideal for AI agents that need add or update a python cli subcommand. 本地化技能摘要: # Add or update a Python CLI subcommand Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 add-python-command?

运行命令:npx killer-skills add ishkamiel/ishlib/add-python-command。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

add-python-command 适用于哪些场景?

典型场景包括:适用任务: Applying Add or update a Python CLI subcommand、适用任务: Applying Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based、适用任务: Applying dispatch. This skill walks through the four-way update every new or changed。

add-python-command 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

add-python-command 有哪些限制?

限制说明: Output goes through log = logging.getLogger( name ). Only a;限制说明: add common args(p)). Do not attach them to the top-level parser;限制说明: parents=[common] pattern has the same bug and must not be used for。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add ishkamiel/ishlib/add-python-command。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    add-python-command 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

add-python-command

# Add or update a Python CLI subcommand Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This AI agent skill supports Claude

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Add or update a Python CLI subcommand

Every CLI in src/pyishlib/ uses argparse subcommands — never flag-based dispatch. This skill walks through the four-way update every new or changed subcommand needs.

Before you start: read the relevant CLI's current cli.py and one nearby subcommand implementation so the new one matches style. Also skim the "Python CLI Tools" section of CLAUDE.md.

Where each tool lives

ToolParserSubcommand implementations
ishfilesishfiles/cli.pyOne module per command in ishfiles/commands/<name>.py.
isholateisholate/cli.pyFunctions in isholate/container.py (or a sibling).

Other (future) Python CLIs follow the same split.

The four-way update

A subcommand is always four things kept in sync. Land them in the same commit.

1. Implementation

  • ishfiles: create src/pyishlib/ishfiles/commands/<name>.py with register(subparsers) and run(cfg) functions. register attaches the subparser; run takes the IshConfig object and returns int. Read paths/constants from cfg, never from module-level imports.
  • isholate: add a named function in container.py (or a sibling module if it's large). It takes explicit kwargs — not argparse.Namespace — so it's easy to unit-test.
  • Output goes through log = logging.getLogger(__name__). Only a command's product output (a diff, a table, a path) may use print(). See the Logging section in CLAUDE.md.

2. Parser wiring in cli.py

  • In build_parser(), add a subparser via sub.add_parser("<name>", help="...", description="...").
  • Attach the common -v/-q flags via the shared helper (e.g. _add_common_args(p)). Do not attach them to the top-level parser — argparse subparser defaults would clobber top-level values. The parents=[common] pattern has the same bug and must not be used for -v/-q.
  • Add subcommand-specific flags with full help=... text.
  • Use parser.add_mutually_exclusive_group() for mutex flag sets.
  • For passthrough command args, use nargs=argparse.REMAINDER as the last positional on the subparser (not the top-level parser).

3. Dispatch in main()

Match args.subcommand and call the implementation with explicit kwargs:

python
1if args.subcommand == "<name>": 2 return <implementation>( 3 username, 4 option=args.option, 5 ... 6 )

Don't pass the whole args namespace unless the implementation genuinely needs most of it (the run subcommand in isholate is the one exception — it forwards a lot of state to launch_and_exec).

4. Tests in pytest/python/test_<tool>.py

Hermetic environment. pytest/conftest.py replaces os.environ wholesale at session start, keeping only PATH/HOME/TMPDIR from the host and injecting fixed git identity and /dev/null git config vars. Subprocesses spawned without env= automatically inherit this clean environment — no per-test env setup needed. To override a var for a specific test, build env = os.environ.copy() and extend it. See CLAUDE.md §Hermetic subprocess environment.

At minimum:

  • Parser defaults — a test that parse_args(["<name>"]) sets the expected defaults.
  • Each flag — one test per non-trivial flag confirming it parses.
  • Mutex groups — a test that conflicting flags raise SystemExit.
  • Dispatch — a test that cli_main(["<name>", ...]) calls the implementation with the right kwargs (use unittest.mock.patch on the cli.py-level name, e.g. pyishlib.isholate.cli.<impl>).
  • Doesn't dispatch other things — when useful, assert that unrelated implementations (launch_and_exec, etc.) are NOT called.

Run just the affected test module while iterating:

bash
1pytest pytest/python/test_<tool>.py -q

Updating an existing subcommand

Same four-way update. Treat flag renames, removed flags, changed defaults, and changed dispatch kwargs as CLI-breaking: migrate the tests in the same commit. Don't leave dead --old-name aliases as compat shims unless the user asks for them explicitly.

Breaking CLI changes

Call out the break in the commit message so users who pull the change can update their invocations.

Quick checklist

  • Implementation module/function with docstring
  • Subparser in build_parser() with help= and description=
  • Common args via shared helper (NOT on top-level parser)
  • Dispatch branch in main()
  • Parser-shape tests (defaults + each flag)
  • Mutex-group tests (if any mutex flags)
  • Dispatch test with mocked implementation
  • README / docs swept for old invocation shapes (if renaming)
  • pytest pytest/python/test_<tool>.py passes
  • ruff check src/ and ruff format --check src/ clean

相关技能

寻找 add-python-command 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具