mirror of
https://fastgit.cc/github.com/HKUDS/CLI-Anything
synced 2026-04-21 13:21:02 +08:00
4.2 KiB
4.2 KiB
description
| description |
|---|
| Validate a CLI harness against HARNESS.md standards and best practices |
cli-anything-validate Command
Validate a CLI harness against HARNESS.md standards and best practices.
Target software: $1
CRITICAL: Read HARNESS.md First
Before validating, read ./HARNESS.md (located alongside this command). It is the single source of truth for all validation checks below. Every check in this command maps to a requirement in HARNESS.md.
Arguments
-
$1is the software path or repo URL (required). Either:- A local path to the software source code (e.g.,
/home/user/gimp,./blender) - A GitHub repository URL (e.g.,
https://github.com/GNOME/gimp,github.com/blender/blender)
If a GitHub URL is provided, clone the repo locally first, then work on the local copy.
The software name is derived from the directory name. The agent locates the CLI harness at
/root/cli-anything/<software-name>/agent-harness/. - A local path to the software source code (e.g.,
What This Command Validates
1. Directory Structure
agent-harness/cli_anything/<software>/exists (namespace sub-package)cli_anything/has NO__init__.py(PEP 420 namespace package)<software>/HAS__init__.py(regular sub-package)core/,utils/,tests/subdirectories presentsetup.pyin agent-harness/ usesfind_namespace_packages
2. Required Files
README.md- Installation and usage guide<software>_cli.py- Main CLI entry pointcore/project.py- Project managementcore/session.py- Undo/redocore/export.py- Rendering/exporttests/TEST.md- Test plan and resultstests/test_core.py- Unit teststests/test_full_e2e.py- E2E tests../<SOFTWARE>.md- Software-specific SOP
3. CLI Implementation Standards
- Uses Click framework
- Has command groups (not flat commands)
- Implements
--jsonflag for machine-readable output - Implements
--projectflag for project file - Has
handle_errordecorator for consistent error handling - Has REPL mode
- Has global session state
4. Core Module Standards
project.pyhas: create, open, save, info, list_profilessession.pyhas: Session class with undo/redo/snapshotexport.pyhas: render function and EXPORT_PRESETS- All modules have proper docstrings
- All functions have type hints
5. Test Standards
TEST.mdhas both plan (Part 1) and results (Part 2)- Unit tests use synthetic data only
- E2E tests use real files
- Workflow tests simulate real-world scenarios
test_full_e2e.pyhas aTestCLISubprocessclassTestCLISubprocessuses_resolve_cli("cli-anything-<software>")(no hardcoded paths)_resolve_cliprints which backend is used and supportsCLI_ANYTHING_FORCE_INSTALLED- Subprocess
_rundoes NOT setcwd(installed commands work from any directory) - All tests pass (100% pass rate)
6. Documentation Standards
README.mdhas: installation, usage, command reference, examples<SOFTWARE>.mdhas: architecture analysis, command map, rendering gap assessment- No duplicate
HARNESS.md(should reference plugin's HARNESS.md) - All commands documented with examples
7. PyPI Packaging Standards
setup.pyusesfind_namespace_packages(include=["cli_anything.*"])- Package name follows
cli-anything-<software>convention - Entry point:
cli-anything-<software>=cli_anything.<software>.<software>_cli:main cli_anything/has NO__init__.py(namespace package rule)- All imports use
cli_anything.<software>.*prefix - Dependencies listed in install_requires
- Python version requirement specified (>=3.10)
8. Code Quality
- No syntax errors
- No import errors
- Follows PEP 8 style
- No hardcoded paths (uses relative paths or config)
- Proper error handling (no bare
except:)
Validation Report
The command generates a detailed report:
CLI Harness Validation Report
Software: gimp
Path: /root/cli-anything/gimp/agent-harness/cli_anything/gimp
Directory Structure (5/5 checks passed)
Required Files (9/9 files present)
CLI Implementation (7/7 standards met)
Core Modules (5/5 standards met)
Test Standards (10/10 standards met)
Documentation (4/4 standards met)
PyPI Packaging (7/7 standards met)
Code Quality (5/5 checks passed)
Overall: PASS (52/52 checks)