An Agent Skill that answers one recurring engineering question: for this one task, should I write deterministic code or call an LLM? It gives the agent a single decision axis — is the property being checked structural or semantic — plus a false-positive test and worked examples of both failure directions.
# Copy into your global skills directory
cp -r skills/when-code-when-llm ~/.claude/skills/when-code-when-llm/skills add shimo4228/when-code-when-llm- Name the property — what exactly is being detected or decided?
- Classify it — structural (decidable from bytes: format, presence, count, schema) or semantic (requires meaning: intent, quality, similarity)?
- Apply the false-positive test — if a regex keeps producing false positives/negatives, the property is semantic; if an LLM is being asked something a three-line check answers, it is structural
- Split when the axis cuts through the task — detection can be structural (code enumerates, deterministically) while resolution is semantic (LLM or human decides); never let one tool do both halves
- You catch yourself writing a regex that keeps misfiring on edge cases
- You are about to call an LLM for something a trivial code check would handle
- A single task mixes exact detection with judgment-based resolution
| Property | Tool | Example |
|---|---|---|
| Structural — decidable from bytes | Code | schema validation, dedup by ID, format check |
| Semantic — requires meaning | LLM | classification, quality judgment, intent |
| Detection structural, resolution semantic | Split | linter enumerates label drift; review conversation decides the canonical label |
The canonical copy of this skill lives in the author's live Claude Code harness. This repository is a one-way publication mirror:
scripts/sync-from-local.sh --dry-run # report differences only
scripts/sync-from-local.sh # apply to working tree (never commits)code-and-llm-collaboration applies the same structural-vs-semantic axis at the next level up: not "which tool for this one task" but "how do code layers and LLM layers compose in one pipeline."
This skill is a design-pattern skill from the Agent Knowledge Cycle (AKC) research line — a Zenodo-citable six-phase bidirectional growth loop (DOI 10.5281/zenodo.19200726) for sustaining intent alignment between an AI agent and its operator over time. It is the "how" counterpart to AKC ADR-0008. AKC is one of three research lines by @shimo4228, alongside Contemplative Agent (DOI 10.5281/zenodo.19212118) — autonomous agents grounded in four contemplative axioms — and Agent Attribution Practice (AAP) (DOI 10.5281/zenodo.19652013) — harness-neutral ADRs on accountability distribution.
MIT