TAG

#agent

After Writing Dozens of Skills, I Distilled This Engineering Method: From `Never Triggered` to `Production-Ready`

An engineering method for writing Skills that are correct, stable, and maintainable long-term, distilled from writing dozens of them. Skills are three layers, not one file: L1 metadata for routing, L2 body for behavior, L3 resources for facts and determinism. Most "never triggers" are routing failures — fixed by a `description` that says what, when, and especially when *not* to use it. Execution drift is fixed with numbered steps, stop conditions, and rule-plus-reason instructions. Guardrails turn "should" into machine-checkable checkpoints, with tiered failure handling. Splitting should follow change-reasons, not file length. Four eval metrics (routing, step-following, checkpoints, task success) pin down what to fix. Ends with versioning, a trace-reading workflow, and a copy-paste checklist.

From Agent Loop to PlanMode: A Production-Ready AI Agent Engineering Skeleton

A production-ready AI Agent engineering skeleton explained through an operating-system analogy. The Harness is the OS, the LLM is the CPU, and the Agent Loop is the kernel's scheduling loop — constantly assembling context, dispatching tool calls, and waiting for I/O. A clear termination condition, real verification, and disk persistence are non-negotiable. Two-Stage ReAct separates thinking from doing: a dry-run first, then real execution. Four tools — read, write, edit, bash — map to file-system operations, scheduled in parallel for read-only and serially for writes. AGENTS.md, Skills, and PlanMode form a three-level memory system that keeps long-running agents on track. Includes ready-to-use pseudocode.

One Line of Code That Can 10× Your Agent Costs: KV-Cache-Friendly Agent Design

Agents running slow and expensive? The problem often lies in a broken KV Cache. This article starts with the fundamentals of KV Cache and lays out three golden rules: keep system prompts and tool definitions byte-level fixed, always append dynamic information to the end, and use standard API formats instead of hand-crafting your own. Using Qwen3, DeepSeek, and Claude as examples, it analyzes how different models differ in chain-of-thought feedback and what cache killers to watch out for, helping you build cache observability so that both first-token latency and your bill go down.