Table of Contents
Overview
SDD (Spec-Driven Development) Plugin is a Claude Code plugin that helps you collaborate systematically with AI through a GitHub Issue-based 4-stage process (Analyze → Design → Implement → Test). In this post, I’ll step back and analyze what AI engineering principles were applied to this plugin.
The full structure and usage of SDD Plugin is covered in SDD Plugin: Full Structure and Usage, the background in The Pitfalls of AI Coding and a Path Forward, and the development journey in From Prototype to Completion.
For a detailed explanation of the 4 AI engineering paradigms, see 4 Paradigms of AI Engineering — Prompt, Context, Agentic, Harness.
Prompt Engineering — Constraining the Scope
The most important prompt engineering in SDD Plugin was separating What/Why from How.
AI tends to jump straight to technical implementation (How) when asked a question. But discussing How before What/Why is settled can lead to misaligned direction.
analyze.md explicitly blocks this:
Focus ONLY on What and Why. Do NOT discuss How (technical implementation).
This single line dramatically changes AI behavior. During the analysis stage, the focus stays on the essence of requirements, and technical discussions naturally flow into the design stage.
Output templates for each stage are also part of prompt engineering. Since templates pre-define the output format, the AI produces results in a consistent structure.
## Summary
- Request type:
- One-liner:
- Background:
## Feature List
| # | Feature | Description |
Context Engineering — Loading Only What’s Needed
Context Engineering is applied in two major areas of SDD Plugin.
Modularization of SKILL.md
As mentioned in the development process post, I initially put the entire process in a single SKILL.md. But this meant running /sdd analyze would load the contents of test.md into context too.
# Before: Everything in one file
SKILL.md (500 lines) → All loaded into context
# After: Router + individual command files
SKILL.md (router, ~60 lines) → Only commands/analyze.md loaded additionally
There are 11 commands, but only 1 enters the context at a time. Token usage decreases, and the AI is prevented from getting confused by irrelevant information.
Fetching Only Needed Outputs from GitHub
The design stage needs analysis results, and the implementation stage needs design results. Instead of fetching all Issue comments, markers are used to filter only the needed outputs.
# Instead of putting all comments in context
gh api .../comments --jq '.[].body'
# Fetch only comments containing the marker
gh api .../comments --jq '.[] | select(.body | contains("sdd:analyze:output")) | .body'
Even if an Issue has dozens of general conversation comments, only the ones with output markers can be precisely retrieved.
Agentic Engineering — Agents and Iterative Loops
The most prominent Agentic Engineering techniques in SDD Plugin are role-based agent separation and self-improvement loops.
Dedicated Exploration Agent
When analyzing the existing codebase during the design stage, the main agent doesn’t do it directly — it delegates to a dedicated exploration agent.
Explore the codebase using a dedicated Explore agent (model: "sonnet")
Since exploration tasks are well-served by a fast model (Sonnet), this optimizes both cost and speed. The main agent receives the exploration results and focuses on design.
AI Review Loop
All stage outputs go through an independent review loop defined in ai-review.md.
Execute the following loop (maximum 3 rounds):
1. Self-Review: Review own output
2. AI Review: Independent agent reviews separately
3. Evaluate: Determine pass/fail
→ Pass: exit loop, Fail: fix and continue to next round
The key is that the reviewing agent is independent from the working agent. When you review your own work, you might miss things, but a separate agent can find issues from a different perspective.
Review criteria also differ by stage:
| Stage | Review Criteria |
|---|---|
| analyze | Are features clearly defined? Is What/Why sufficient? Any missing requirements? |
| design | Does design match requirements? Is it feasible? Consistent with architecture? |
| implement | Code quality? Test coverage? Pattern consistency? Is PR description accurate? |
| test | Sufficient test coverage? Edge cases covered? Regression risks addressed? |
Harness Engineering — Designing the Execution Environment
The SDD Plugin itself can be seen as a Harness. It pre-defines the process, order, and constraints for AI’s work.
Declarative Process Control
Instead of controlling AI with code, the process is declared in Markdown. SKILL.md says “when this command comes in, read this file,” and each command file constrains “in this stage, do this and don’t do that.”
The advantage of this approach is that modifying the process is extremely easy. Just edit the Markdown file and the AI’s behavior changes. No need to modify code, build, or deploy.
GitHub-Based State Management
Managing progress with labels is also Harness Engineering. It prevents the AI from arbitrarily skipping stages or re-running completed stages through label checks.
sdd:analyze → sdd:design → sdd:implement → sdd:test → sdd:done
The rollback command works the same way. You can only go back to earlier stages, not skip ahead. The AI gets freedom, but the environment enforces the process order.
Permission Settings
AI permissions can also be restricted through Claude Code’s settings.json.
{
"permissions": {
"allow": [
"Bash(ls:*)", "Bash(wc:*)",
"Read(/path/to/sdd-plugin/skills/sdd/**)"
]
}
}
By allowing only read-only bash commands and restricting file reads to skill files, the plugin can be used safely.
Where the 4 Paradigms Meet
When analyzing SDD Plugin through the 4 paradigms, you can see that they don’t work independently — they interlock and operate together.
| Paradigm | Role in SDD Plugin |
|---|---|
| Prompt | Separating What/Why from How, controlling output format with templates |
| Context | SKILL.md modularization, marker-based output filtering |
| Agentic | Delegating to exploration agent, independent review loop (up to 3 rounds) |
| Harness | Declarative process, label-based state management, permission settings |
For example, when the analyze command runs:
- Harness: Checks labels to verify it’s the correct stage
- Context: Reads requirements from Issue body, loads only needed outputs into context
- Prompt: Constrains scope with “Analyze What/Why only, do not discuss How”
- Agentic: AI performs analysis, independent agent runs review loop
All 4 layers work simultaneously within a single command.
Conclusion
In this post, I analyzed the AI engineering techniques applied to SDD Plugin through the 4 paradigms.
The biggest lesson from building SDD Plugin was that writing good prompts alone isn’t enough to use AI well. You need to design how to manage information (Context), how to structure agents (Agentic), and what environment to run them in (Harness) — only then does AI reliably produce good results.
I hope this helps anyone thinking about development processes with AI.
Related Posts
- The Pitfalls of AI Coding and a Path Forward
- SDD Plugin: Full Structure and Usage
- Development Journey — From Prototype to Completion
- 4 Paradigms of AI Engineering — Prompt, Context, Agentic, Harness
Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!
App promotion
Deku.Deku created the applications with Flutter.If you have interested, please try to download them for free.