بنقرة واحدة
cli-testing
CLI testing guidance and patterns. Loaded by /ops/test/cli command or subagents for comprehensive testing.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
CLI testing guidance and patterns. Loaded by /ops/test/cli command or subagents for comprehensive testing.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
This skill should be used when the user asks about "wm command", "waymark cli", "wm find", "wm add", "wm edit", "wm rm", "wm fmt", "wm lint", or needs to use waymark tooling. Requires `using-waymarks` skill for syntax fundamentals. Provides comprehensive CLI command reference and workflows.
This skill should be used when the user asks about "waymark syntax", "writing waymarks", "::: sigil", "tldr waymarks", "about waymarks", searching waymarks with ripgrep, or mentions waymark grammar, signals, markers, or properties. Provides comprehensive guidance for authoring and searching waymarks without requiring CLI tools.
Places and maintains waymarks across a codebase, focusing on TLDR coverage and accuracy. Delegates to the waymarker agent for systematic auditing and placement. Use when adding TLDRs to files, auditing waymark coverage, updating stale waymarks, or when "add waymarks", "TLDR coverage", "waymark audit" is mentioned.
استنادا إلى تصنيف SOC المهني
| name | cli-testing |
| description | CLI testing guidance and patterns. Loaded by /ops/test/cli command or subagents for comprehensive testing. |
| compatibility | Requires Bun runtime and wm CLI installed (bun install && bun install:bin) |
| allowed-tools | Read Glob Grep Skill TodoWrite Bash(./.claude/scripts/run-tests.sh *) Bash(wm *) Bash(wm-dev *) |
| metadata | {"author":"outfitter-dev","version":"1.0"} |
This skill provides guidance for running and extending the Waymark CLI integration test suite.
# Ensure CLI is installed
bun install && bun install:bin
# Run all tests
./.claude/scripts/run-tests.sh --all
# Run specific category
./.claude/scripts/run-tests.sh parse
./.claude/scripts/run-tests.sh lint
Or use the Claude command:
/ops/test/cli --all
/ops/test/cli parse
| Category | Command | What It Tests |
|---|---|---|
parse | wm lint - | Grammar parsing via stdin, signals, properties |
scan | wm find | File scanning, type/tag filtering, JSON output |
format | wm fmt | Formatting detection, --write flag, idempotency |
lint | wm lint | Lint rules: multiple-tldr, unknown-marker, codetag |
cli | wm --help | Help text, version, argument validation, exit codes |
integration | Multiple | End-to-end workflows combining commands |
config | wm config | Config printing, JSON output, --print requirement |
check | wm doctor | Health diagnostics, JSON output, path filtering |
Test results are written to .scratch/testing/:
.scratch/testing/
20260116-1705432800-parse.md # Markdown report
20260116-1705432800-parse-debug.log # Full command output
20260116-1705432800-scan.md
20260116-1705432800-scan-debug.log
...
# Waymark CLI Test Report
**Category**: parse
**Run ID**: 1705432800
**Date**: 2026-01-16T15:00:00Z
**Debug Log**: 20260116-1705432800-parse-debug.log
---
## Results
| # | Test | Status | Details |
|---|------|--------|---------|
| 1 | Parse valid waymark syntax | PASS | Output matched expected pattern |
| 2 | Parse waymark with properties | PASS | Output matched expected pattern |
...
## Summary
| Metric | Count |
|--------|-------|
| Total | 5 |
| Passed | 5 |
| Warnings | 0 |
| Failed | 0 |
run_parse_tests()run_scan_tests()run_format_tests()run_lint_tests()run_cli_tests()run_integration_tests()run_config_tests()run_check_tests()run_test Functionrun_test NUM "Test name" "command" "expected_pattern" [expect_fail]
Parameters:
NUM: Test number (increment from existing tests)"Test name": Human-readable description"command": Command to execute (use $TEMP_DIR for fixtures)"expected_pattern": Regex pattern to match in outputexpect_fail: Optional, set to "true" if expecting non-zero exitAdd fixtures to setup_temp_fixtures():
setup_temp_fixtures() {
# ... existing fixtures ...
# Add your fixture
cat > "$TEMP_DIR/my-fixture.ts" << 'EOF'
// tldr ::: fixture for testing XYZ
// todo ::: test waymark
export const x = 1;
EOF
}
run_parse_tests() {
# ... existing tests ...
# Add new test
run_test 6 "Parse waymark with multiple tags" \
"echo '// todo ::: implement #perf #security' | wm lint -" \
"no issues|0 issues" \
false
}
run_lint_tests() {
# ... existing tests ...
# Test that detects a specific error
run_test 6 "Detect duplicate property" \
"wm lint '$TEMP_DIR/duplicate-prop.ts'" \
"duplicate.*property|same key" \
true # Expect non-zero exit
}
| Code | Meaning | When |
|---|---|---|
| 0 | Success | All tests passed |
| 1 | Failure | One or more tests failed |
| 2 | Setup Error | CLI not found, invalid category |
Check the debug log: Full command output is captured in the -debug.log file
Run command manually: Copy the command from the debug log and run it directly
Check fixtures: Ensure test fixtures are created correctly in setup_temp_fixtures()
Verify pattern: The expected_pattern is a regex - test it with grep -E
"wm not found":
bun install && bun install:bin
# Or for development:
bun dev:cli
Pattern not matching:
| for alternatives: "pattern1|pattern2"\. \[ \]Fixture file issues:
$TEMP_DIR path in debug logAdd to package.json:
{
"scripts": {
"test:cli": "./.claude/scripts/run-tests.sh --all"
}
}
Run in CI:
bun install
bun install:bin
bun test:cli
run_test 1 "Description" "wm command" "expected.*output" false
run_test 2 "Description" "wm invalid-command" "error|invalid" true
run_test 3 "Workflow" "wm fmt file.ts --write && wm lint file.ts" "no issues" false
&&eval internally to handle complex commands