sdd-apply

sdd-apply is a command for coding agents from Gentleman-Programming/gentle-ai. It costs 11 tokens per session (696 once invoked), scanned A, original, MIT.

A command for implementing the remaining work in a specification-driven development change. When test-driven development, or TDD, is enabled, it writes a failing test, makes it pass, and then cleans up the code.

In plain words
What is it for?
Use it to apply an active SDD change, provided its specifications, design, tasks, and status allow implementation.
Why use it?
It provides a defined process for turning approved specifications and design tasks into code while checking the required status before editing.

Command

About the project

Gentle-AI configures an existing AI coding agent into an engineering environment with persistent memory, planning workflows, skills, tool servers, model routing, and optional review. Developers and teams use it to make coding agents follow project conventions and retain decisions across sessions. The catalogue entries are its skills, commands, agents, and instruction.

Gentleman-Programming/gentle-ai · 6,255 stars · on GitHub

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 commands/gentleman-programming/gentle-ai/sdd-apply
Clone the repo
git clone --depth 1 https://github.com/Gentleman-Programming/gentle-ai

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sdd-apply

README.md
[![agentmods](https://agentmods.dev/badge/commands/gentleman-programming/gentle-ai/sdd-apply.svg)](https://agentmods.dev/commands/gentleman-programming/gentle-ai/sdd-apply)
Your own site
<a href="https://agentmods.dev/commands/gentleman-programming/gentle-ai/sdd-apply"><img src="https://agentmods.dev/badge/commands/gentleman-programming/gentle-ai/sdd-apply.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 696 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.00011 $0.00696
Opus 5 $0.00005 $0.00348
Sonnet 5 $0.00002 $0.00139
Haiku 4.5 $0.00001 $0.00070

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

Security

Grade A, and why

sdd-apply 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 3d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

internal/assets/opencode/commands/sdd-apply.md · 45 lines

What it actually says

You are the gentle-orchestrator, not an SDD executor. This command is allowed to launch the hidden sdd-apply sub-agent only after the orchestration gates below pass.

CONTEXT:

  • Working directory: before doing anything else, run git rev-parse --show-toplevel 2>/dev/null || pwd with your bash tool and use the returned path as the authoritative workspace. In OpenCode Desktop (Electron) the parse-time interpolation resolves to the app data directory, not the project.
  • Current project: the basename of the detected workspace above.

HARD GATES:

  1. SDD Session Preflight must already be complete for this session. It must include execution mode, artifact store, chained PR strategy, and review budget. If missing, ask the exact orchestrator preflight prompt and STOP. Do not run apply in the same turn.
  2. sdd-init must already exist or be run after preflight, per the orchestrator init guard.
  3. Resolve the active change using the status contract. If $ARGUMENTS is missing or ambiguous, ask the user to choose and STOP. Do not guess.
  4. Produce structured status before acting and use it to confirm the active change has spec, design, and tasks artifacts in the selected artifact store.
  5. Review workload guard must have passed. If task forecast exceeds the session review budget or needs a chained-PR decision, ASK and STOP unless the preflight strategy already resolves it.
  6. actionContext must allow implementation edits. If status reports workspace-planning with no allowed edit roots, STOP before launching apply.

DEPENDENCY CHECK:

  • If spec, design, or tasks are missing, do NOT implement.
  • Tell the user this is not ready for apply and suggest /sdd-new <change> or /sdd-ff <change>.

TASK: If all gates pass, launch the hidden sdd-apply sub-agent with:

  • The resolved artifact store from session preflight; do not hardcode Engram.
  • The structured status: schemaName, planningHome/changeRoot, artifactPaths/contextFiles, task progress, applyState, dependency states, and actionContext.
  • References to the spec, design, tasks, and any apply-progress artifacts.
  • The resolved delivery/chained PR strategy and review budget.
  • Strict TDD instructions if sdd-init detected strict TDD.

Return a structured orchestration result with: status, executive_summary, artifacts, next_recommended, risks, and skill_resolution.

REVIEW ROUTING (post-verify, not post-apply): After apply returns, its own next_recommended proceeds toward verify — apply itself never routes to review. If the parent later observes a fresh reviewOffer block, it may present and run only its exact invocation. SDD does not retain, read, or persist review lineage, receipt, binding, successor, gate, transaction, or prior authority; the apply executor never launches review.

{{GENTLE_AI_AUTHORITY_FIRST_TERMINAL_PROCEDURE}}

Approval returns one exact pending acknowledgement continuation. Re-run STATUS to recover the same operation, token, and revision; only that invocation burns authority. Gates are informational only; commit, push, and PR remain explicit human decisions.

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. 3d ago Changed · -11 lines 54d72d8f3b61
  2. 5d ago First seen · 56 lines · 11 tokens per session scan A 8d419458df51

Subscribe to this mod's changes

sdd-apply is a command published in the GitHub repository Gentleman-Programming/gentle-ai (6,255 stars, last pushed today), licensed MIT. It adds 11 tokens to every session and 696 once invoked, about $0.0001 per session on Opus 5. 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.