Skip to content

Instantly share code, notes, and snippets.

Opinionated CLIs as the Backbone of Agentic Capability

AI agents usually learn a new ability from a skill, which is a Markdown file of instructions the agent reads before it starts work. When written instructions are the wrong tool for a task, I prefer to build an opinionated command-line interface (CLI): a tool that accepts only well-formed input and says exactly what is wrong with anything else. The agent's skill then just points to that tool. This document covers when this approach fits, why it works, and how I build and improve the CLI over time.

When a CLI fits, and when prose does

Build a CLI when one wrong call is a failure. This usually means the agent acts on something outside itself, such as querying a database, calling an API, or deploying code. A single unescaped quote breaks the request, even in a toy project, so code should own correctness.

Write a skill made only of instructions when the result is judged on quality. Examples include rewriting in a style, reviewing a draft, or guiding a

@chrisdavidmiles
chrisdavidmiles / 403-reload-workaround.php
Last active May 12, 2026 21:19
WordPress MU plugin: auto-reloads when CSS/JS files 403 due to Apache inode cache lag
<?php
/**
* Plugin Name: 403 Reload Workaround
* Description: Auto-reloads when CSS/JS files 403 due to Apache inode cache lag.
* Plugin URI: https://gist.github.com/chrisdavidmiles/aeb6b4cfe4246c3c95c45f9a40d9c74b
* Version: 0.1
* Author: Chris Miles
*/
add_action('init', function() {
@chrisdavidmiles
chrisdavidmiles / test-suite-audit.md
Created April 17, 2026 03:57
Verbatim Test Suite Quality Audit

Verbatim Test Suite Quality Audit

Phase 1 — System Map

What it is: A CLI tool (teams) that extracts Microsoft Teams conversations as markdown/JSON. Single-file Python script (~2000 lines) using Playwright to drive a headless Chromium browser against the Teams web app.

Entry points: One CLI command (teams) with mutually exclusive modes:

  1. teams <url> — Extract a specific conversation
  2. teams --find <query> — Global search across Teams
  3. teams --recent — List sidebar conversations
@chrisdavidmiles
chrisdavidmiles / plugin-update-notifications.php
Created June 13, 2025 00:21
WordPress Plugin: Plugin Update Notifications
<?php
/**
* Plugin Name: Plugin Update Notifications
* Description: Sends notifications when plugin updates are available via Email, Discord webhook, or ntfy.sh webhook.
* Version: 1.0
* Update URI: false
*/
defined('ABSPATH') || exit; // Exit if accessed directly
@chrisdavidmiles
chrisdavidmiles / disallow-file-edit.php
Created June 13, 2025 00:02
WordPress Plugin: Disallow File Edit
<?php
/*
Plugin Name: Disallow File Edit
Description: Disallows file editing from the WordPress admin panel.
Version: 1.0
Update URI: false
*/
defined('DISALLOW_FILE_EDIT') || define('DISALLOW_FILE_EDIT', true);
@chrisdavidmiles
chrisdavidmiles / password-policy-enforcement.php
Created June 12, 2025 23:58
WordPress Plugin: Password Policy Enforcement
<?php
/**
* Plugin Name: Password Policy Enforcement
* Description: Enforces strong passwords, provides detailed error messages, and checks passwords against HaveIBeenPwned on creation and reset.
* Version: 1.0
* Update URI: false
*/
defined('ABSPATH') || exit; // Exit if accessed directly
@chrisdavidmiles
chrisdavidmiles / security-headers.php
Created June 12, 2025 23:57
WordPress Plugin: Security Headers
<?php
/*
Plugin Name: Security Headers
Description: Adds security-related HTTP headers to your WordPress site.
Version: 1.0
Update URI: false
*/
defined('ABSPATH') || exit; // Exit if accessed directly
@chrisdavidmiles
chrisdavidmiles / disable-xmlrpc.php
Created June 12, 2025 23:51
WordPress Plugin: Disable XML-RPC
<?php
/*
Plugin Name: Disable XML-RPC
Description: Completely disables XML-RPC functionality in WordPress.
Version: 1.0
Update URI: false
*/
add_filter('xmlrpc_enabled', '__return_false');
@chrisdavidmiles
chrisdavidmiles / enforce-auto-update.php
Created June 12, 2025 23:48
WordPress Plugin: Enforce Auto Update
<?php
/**
* Plugin Name: Enforce Auto Update
* Description: Enables automatic updates for WordPress core (minor and major stable releases), plugins, and themes.
* Version: 1.0
* Update URI: false
*/
// Enable automatic updates for WordPress core (minor and major stable releases, excluding development releases)
add_filter( 'allow_dev_auto_core_updates', '__return_false' );
@chrisdavidmiles
chrisdavidmiles / wp-login.php.html
Created May 14, 2023 01:55
Rick roll wp-login.php page
<!--------------------------------------------------------+
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣶⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⠿⠟⠛⠻⣿⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣆⣀⣀⠀⣿⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠻⣿⣿⣿⠅⠛⠋⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢼⣿⣿⣿⣃⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣟⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣛⣛⣫⡄⠀⢸⣦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|
|⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⡆⠸⣿⣿⣿⡷⠂⠨⣿⣿⣿⣿⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀|