This skill provides patterns for designing command-line tools that agents can use effectively. Use when designing new CLIs, reviewing existing CLIs for agent compatibility, or adding agent-friendly features. Covers minimal ceremony, JSON output, context injection, batch operations, and error handling.
Generates patterns for designing command-line tools optimized for AI agent usage and integration.
npx claudepluginhub rbergman/dark-matter-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/checklist.mdA pattern language for designing command-line tools that agents can use effectively.
One command for the common case.
Bad:
mytool init --config ./config.yaml
mytool start
mytool create entry --type log
mytool entry set-field --field title --value "Fixed bug"
mytool entry commit
Good:
mytool log "Fixed bug" --body "Details..."
Guidelines:
Tell agents what to do next.
Bad:
$ mytool status
Repository initialized.
3 items tracked.
Good:
$ mytool status
Repository initialized.
3 items tracked.
Run: mytool pending # See what needs attention
Run: mytool process # Handle pending items
Patterns:
pending / ready commands that surface worknext_action or suggested_commands fieldsProvide a prime command that outputs workflow state AND guidance for session bootstrapping.
Prime = State + Workflow Guidance, not just State.
$ mytool prime
MyTool workflow context
=======================
Repo: my-project
Branch: main
Pending: 5 items need attention
## Session Protocol
- At session end: run `mytool pending` to check for undocumented work
- Never skip: always log completed work before ending
## Core Rules
- Use CLI commands, not internal files
- Trust --json output over manual parsing
## Quick Commands
mytool pending # See pending items
mytool show --last # View last action
Patterns:
--export flag to dump default prime content for customization.mytool/PRIME.md replaces default)Why this matters:
/clear and compaction wipe working memoryprime restores workflow state AND behavioral guidance in one callEvery command supports --json for structured output.
{
"status": "created",
"id": "tb_2026-01-15_abc123",
"anchor": "abc1234def5678...",
"commits": 3
}
Guidelines:
--json flag on every command, no exceptions{"error": "message", "code": 1}Commands work without flags for the common case.
mytool log "Message"
# Anchor defaults to HEAD
# Range defaults to since-last-entry
# Format defaults to human-readable
Instead of:
mytool process item1
mytool process item2
mytool process item3
# 3 tool calls, 3 permission prompts
Provide:
mytool process --batch
# 1 tool call, processes all pending
Patterns:
--batch flag for processing multiple itemsmytool query --last 5 --oneline # Compact for scanning
mytool query --last 5 --ids-only # IDs only for scripting
Design commands that can be pre-approved:
mytool delete --confirm--dry-run for write operationsConsistent temporal queries across commands.
mytool query --since 7d # Human-readable duration
mytool export --since 24h # Hours
mytool query --since 2w # Weeks
mytool export --since 2026-01-15 # Date string
mytool query --range main..HEAD # Commit range
Patterns:
--since for duration-based filtering (24h, 7d, 2w)--range for commit ranges{
"error": "Missing required flag: --why",
"code": 1,
"hint": "Use --minor for trivial changes"
}
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | User error (bad args, not found) |
| 2 | System error (git failed, network) |
| 3 | Conflict (already exists) |
Bad:
Error: Entry already exists.
Good:
Error: Entry already exists for anchor abc1234.
Use --replace to overwrite, or --anchor <sha> to target another commit.
Group commands by purpose in help output.
$ mytool --help
A development ledger for capturing what/why/how.
Core Commands:
log Record work with what/why/how
pending Show items needing attention
status Show repository state
Query Commands:
export Export entries in various formats
query Search and filter entries
show Display entry details
Agent Commands:
prime Output workflow context for agents
skill Output skill documentation
Admin Commands:
clean Remove artifacts from scope
init Initialize repository
All commands support --json for structured output.
Patterns:
Provide a command that outputs content for agent skills:
mytool skill
mytool skill --format json
Include in CLI documentation:
Provide workflow snippets for CLAUDE.md:
## Workflow
At session start:
mytool prime
After completing work:
mytool log "what" --why "why" --how "how"
At session end:
mytool pending # Check for undocumented work
Provide a clean command to remove tool artifacts from a given scope.
mytool clean # Remove artifacts from current project
mytool clean --global # Remove user-level artifacts
mytool clean --dry-run # Preview what would be removed
mytool clean --force # Skip confirmation
Patterns:
--dry-run to preview what would be removed--force to skip confirmation promptsThis helps agents understand cleanup options and manage tool state across projects.
Commands should compose with standard Unix tools.
# Pipe to other CLIs
mytool export --json | jq '.entries[]'
mytool export --json | claude "Summarize this work"
# Use in scripts
for id in $(mytool query --ids-only); do
mytool show "$id" --json
done
Guidelines:
--json specifiedSeparate stdout behavior from file output.
# To stdout (for piping)
mytool export --json
# To files (for persistence)
mytool export --json --out ./exports/
Don't conflate these—agents need both patterns.
| Anti-Pattern | Problem |
|---|---|
| Configuration-First | Agents struggle with multi-step setup |
| Interactive-Only | Agents can't use TUI/curses interfaces |
| Implicit State | Agents need to query state |
| Verbose-Only Output | Token budgets matter |
| Undocumented Errors | Agents need structured feedback |
| Broad Permissions | Allowlist-friendly commands can be pre-approved |
See references/checklist.md for the full design checklist.
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.