cli-push-down

Moves deterministic prompt logic into tested CLI commands emitting JSON.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/nseng-ai/ns --skill cli-push-down-nseng-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-push-down
Source: https://github.com/nseng-ai/ns/tree/main/skills/internal/agent-engineering/cli-push-down
Command: npx skills add https://github.com/nseng-ai/ns --skill cli-push-down-nseng-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Long procedural prompts waste tokens, require many tool calls, and cannot be tested. This Skill guides refactoring that mechanical work out of prompts and into tested CLI commands, so the agent keeps semantic judgment while the CLI handles parsing, filtering, and data gathering. ## Core Features & Use Cases - Push-Down Target Identification: Criteria for spotting mechanical blocks worth extracting, such as structured data parsing, API/git data aggregation, retries, and pagination, with explicit size thresholds (20+ prompt lines or 3+ tool calls removed). - CLI Contract Definition: Enforces explicit flags, JSON to stdout, logs to stderr, and a status-keyed result envelope with error codes and exit semantics. - Markdown Parsing Ban: Hard rule against parsing markdown in pushed-down commands, since human-edited prose is not a schema. - Use Case: A skill that gathers PR state through five separate gh and git calls becomes one CLI command returning a compact JSON payload, cutting the prompt block by 50% or more and gaining edge-case tests. ## Quick Start Ask the agent to audit this skill's prompt for mechanical blocks and push the largest one down into a tested CLI command with a JSON contract.

Frequently Asked Questions about cli-push-down

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token usage in a long agent skill prompt?

Move mechanical blocks like parsing, filtering, and multi-call data gathering into a single CLI command that returns compact JSON. The prompt then keeps only the command invocation, expected fields, and decision rules, targeting a 50% or greater reduction for that block.

When should prompt logic be pushed down into a CLI command?

Push down when the change removes 20+ prompt lines or 3+ tool calls, eliminates step-by-step loops, is reused by multiple skills, or needs edge-case tests. Avoid it for wrappers around one obvious command or logic under 30 lines called once.

What output format should a push-down CLI command use?

Commands should emit JSON to stdout with logs on stderr, using the project framework's status-keyed result envelope when one exists. Without a framework, include a top-level success boolean and an error object with message and optional code on failure.

Can a CLI command parse markdown to extract structured data?

No. The skill hard-bans markdown parsing in push-down commands, including heading splits, checkbox counts, and regex over prose, because human-edited markdown is not a schema. Hand raw text to the agent or change the upstream source to structured data.

How should pushed-down CLI commands be tested?

Test the happy path, failures, and edge cases like malformed data, missing refs, pagination, and partial failure. Use the project testing skill's gateway fakes rather than module mocks such as vi.mock.