04-cli-development

Development rules for changing a command-line interface or adding stack templates, including where prompts, services, configuration, and architecture-specific files belong.

In plain words
What is it for?
Use them to modify CLI prompts and services, add technology-stack templates, configure supported versions and architectures, and update related helper scripts.
Why use it?
They reduce the chance that new commands or templates are placed in the wrong files or miss required configuration updates.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/tecnomanu/agent-rules-kit/04-cli-development
Clone the repo
git clone --depth 1 https://github.com/tecnomanu/agent-rules-kit

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 714 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00714
Opus 5 $0.00000 $0.00357
Sonnet 5 $0.00000 $0.00143
Haiku 4.5 $0.00000 $0.00071

Measured 2d ago against content hash e553838ba19e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

04-cli-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/04-cli-development.mdc · 82 lines

What it actually says

CLI development & Rule generation

When you modify the CLI or add new stack templates:

  1. CLI

    • Update prompts in cli/index.js.
    • Organize services in appropriate files in cli/services/:
      • base-service.js - Base functionality shared across all services
      • file-service.js - File operations and template processing
      • config-service.js - Configuration and constants management
      • stack-service.js - Common stack functionality
      • mcp/mcp-service.js - MCP tools integration (v2.0+)
      • Stack-specific services in stack/ directory (e.g., stack/nextjs-service.js, stack/laravel-service.js)
    • Respect templates/kit-config.json for configuration.
    • Add/adjust helper scripts in version-detector.js.
  2. New stacks or architectures

    • Create templates/stacks/<stack>/base/ with generic rules.
    • Create templates/stacks/<stack>/architectures/<arch_name>/ with architecture-specific rules.
    • Add overlay folders v<major>/ for breaking changes only.
    • Update kit-config.json:
      • globs
      • version_ranges
      • default_architecture
      • architectures for stack-specific architectures
      • pattern_rules if needed.
  3. MCP Tools (v2.0+)

    • Create templates/mcp-tools/<tool>/ with tool-specific rules.
    • Add tool usage patterns and best practices.
    • Update kit-config.json in mcp_tools section:
      • name - Display name for the tool
      • description - Detailed description of functionality
    • Test multi-select functionality in CLI.
  4. Template variables

    • Use placeholders like {projectPath}, {detectedVersion}, {versionRange}, {stack} in templates.
    • These will be automatically replaced when generating rules.
  5. Docs

    • Document new behaviour in README.md & /docs/cli.md.
    • Update /docs/mcp-tools-guide.md for MCP tools changes.
    • Change Implementation Status block with percent progress of current implementations and add new if is a new implementation.
  6. CLI Testing

    • Always use --auto or --auto-install when testing CLI commands to avoid interactive prompts

    • Test different IDEs with specific flags:

      # Test with auto-install (no prompts)
      node cli/index.js --stack=laravel --version=12 --global --auto
      
      # Test different IDEs
      node cli/index.js --stack=react --version=18 --ide=claude --auto
      node cli/index.js --stack=nextjs --version=14 --ide=vscode --auto
      
    • Verify file generation in correct directories:

      • Cursor: .cursor/rules/rules-kit/
      • Claude: CLAUDE.md
      • VS Code: .github/copilot-instructions.md
    • Test backup functionality for existing files

After changes, run:

pnpm run lint
pnpm run test
pnpx agent-rules-kit --update
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 82 lines · 0 tokens per session scan A e553838ba19e

Subscribe to this mod's changes

04-cli-development is a cursor rule published in the GitHub repository tecnomanu/agent-rules-kit (35 stars, last pushed 11mo ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 714 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.