executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
lov-cli-creator把本地项目或当前目录转换为可安装、可测试、支持 JSON 的真实后端 CLI;当用户说“给这个项目做 CLI”“把应用变成命令行”或 “build a CLI for this project” 时使用。
Independent GitHub snapshot · Automated classification · Original documentation governs
Turn a real local project into an installable command-line interface that both people and agents can operate. The generated CLI exposes the project's actual backend, emits stable JSON, documents its contract, and carries executable tests.
Read skill.yaml on every invocation. Resolve values in this order: the current
request, project context, skills.lov-cli-creator.records, shared preferences,
the shared user/workspace Profile, then safe defaults. Project path defaults to
the directory in which the Skill is invoked; output defaults to
agent-harness/ inside that project.
Persist only a directly stated durable preference, such as a user's long-term command prefix or output-directory convention:
python3 "$SKILL_DIR/scripts/profile_store.py" record \
--skill-id lov-cli-creator \
--path records.command_prefix \
--value '"lov-cli"' \
--confirm
Report the saved Profile path. Never persist inferred paths, credentials, or tokens. See the Profile contract.
Read the composition record before invoking
an adjacent Skill. lov-cli-creator owns the finished CLI; other Skills are
optional artifact-level handoffs and never hidden runtime dependencies.
Follow these steps in order. Do not report a scaffold as a completed CLI.
SKILL_DIR from the active Skill context.AGENTS.md, CLAUDE.md, repository instructions, and dirty-worktree state.Manual helper invocation:
python3 "$SKILL_DIR/scripts/inspect_project.py" . --format markdown
Run the inspector and then verify its signals against source code:
python3 "$SKILL_DIR/scripts/inspect_project.py" PROJECT \
--format json --output PROJECT_ANALYSIS.json
Identify the product domains, existing commands, public APIs, native data model, state lifecycle, export/render path, and external runtime dependencies. Map user actions to real callable functions or executables. Prefer, in order:
Do not rebuild the product in the harness. For GUI/media applications, rendering must use the real engine. For services, use the real local service/API boundary. For libraries, call the public API rather than copying implementation logic. Read project analysis rules.
Define command groups around user tasks, not source filenames. Every CLI must
include doctor, info, and capabilities, plus at least one project-specific
command. Every command must work in human-readable mode and with global --json.
Write a lov-cli-plan/v1 JSON plan. For existing executables, declare fixed
argv prefixes and typed parameters so the generated bridge can be complete
without shell evaluation. For an in-process library or protocol, use the plan to
scaffold the command contract, then implement the adapter in generated source.
Read the plan schema and the CLI contract. Include:
Generate into PROJECT/agent-harness unless the request or Profile supplies a
different output directory:
python3 "$SKILL_DIR/scripts/scaffold_cli.py" PROJECT \
--plan CLI_PLAN.json
The helper creates a Python package, console entry point, JSON contract, backend
bridge, README, test plan, and tests. It rejects occupied output paths. Use
--output only when a separate location is required. The default console command
is lov-cli-PROJECT_SLUG, unless the plan declares another safe kebab-case name.
If an existing generated harness is present, inspect and refine it in place. Never discard working commands merely to rerun the scaffold.
The generated subprocess bridge is production-usable when the plan fully maps an
existing executable. Otherwise implement the missing adapter in
src/PACKAGE/backend.py and register its typed command handler in cli.py.
Requirements:
shell=False; never concatenate untrusted shell text;--dry-run is set;For stateful tools, support both one-shot commands and a REPL only when a REPL adds genuine value. Do not force statefulness onto a stateless project.
Complete TEST.md as a plan before adding test code. Keep fast unit tests and
real end-to-end tests. The E2E suite must invoke the installed console command
from outside the harness directory, exercise at least one project-specific
workflow, and verify resulting state or artifacts programmatically.
Install into an isolated environment or the project-approved environment:
python3 -m pip install -e PROJECT/agent-harness
python3 -m unittest discover -s PROJECT/agent-harness/tests -v
When a Python 3.9 venv bundles pip older than 21.3, install the generated
requirements.txt and run python3 setup.py develop from the harness as the
local editable-install fallback. Do not require a network-only pip upgrade.
If the backend dependency is unavailable, the real-backend E2E test fails with installation guidance; it must not silently skip or replace the backend. Read the testing requirements.
Set status in lov-cli.json to ready only after the domain commands and E2E
tests pass. Then run:
python3 "$SKILL_DIR/scripts/validate_cli.py" PROJECT/agent-harness \
--run-tests --require-installed
Validation must confirm the package entry point, source/module invocation, JSON envelopes, built-in introspection, at least one domain command, unit/E2E tests, and the installed command from a neutral working directory.
Report the target project, harness path, installed command, command groups, backend used, tests and validation results, and any verified limitation. Clearly separate local readiness from package publication; publication is outside scope.
scripts/validate_skill.py.This workflow adapts the CLI-Anything agent-harness methodology while broadening it from GUI applications to local projects and replacing legacy packaging rules with a small PEP 621 harness. See upstream research for the source, license, and deliberate differences.
运行前读取本 Skill 包的 skill.yaml。只使用 Manifest 声明的字段;Profile
保存用户和工作区长期偏好,skills.lov-cli-creator.records 保存本 Skill 的持久
记录。报错提供可复制的 context_id、字段路径与来源,诊断不得泄露秘密。