Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
"name": "context-engineering-kit",
"version": "2.0.1",
"version": "2.0.2",
"description": "Hand-crafted collection of advanced context engineering techniques and patterns with minimal token footprint focused on improving agent result quality.",
"owner": {
"name": "NeoLabHQ",
Expand Down
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
* [implement](plugins/sdd/implement.md)
* [brainstorm](plugins/sdd/brainstorm.md)
* [create-ideas](plugins/sdd/create-ideas.md)
* [Refining Specifications and Code](plugins/sdd/refine.md)
* [customization](plugins/sdd/customization.md)
* [Usage Examples](plugins/sdd/usage-examples.md)
* [Test-Driven Development](plugins/tdd/README.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/spec-driven-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ It will perform the following refinement process to update the task file with a

It will output the updated task file to `.specs/tasks/todo/design-implement-authentication-middleware-with-jwt-support.feature.md` and create new skills if needed. It also produces scratchpads and verification reports along the way to properly evaluate each step of the process. You can safely ignore all of them.

At this point you can verify and adjust the specification, then run the `/plan --refine` command again for agents to update the rest of the specification where it doesn't align with your changes. It uses a top-to-bottom approach, meaning all sections below your changes will be rethought and updated accordingly.
At this point you can verify and adjust the specification, then run the `/plan --refine` command again for agents to update the rest of the specification where it doesn't align with your changes. It uses a top-to-bottom approach, meaning all sections below your changes will be rethought and updated accordingly. See the [Refining Specifications and Code](../plugins/sdd/refine.md) guide for details.

### Code Generation

Once you are happy with the specification, you can run the implementation process:
Once you are happy with the specification, run `/clear` (or re-open Claude Code) to clear context. Then you can start the implementation process:

```bash
/implement
Expand Down
17 changes: 16 additions & 1 deletion docs/plugins/sdd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then run the following commands:
# Moves the task to the .specs/tasks/todo/ folder
```

Restart the Claude Code session to clear context and start fresh. Then run the following command:
Run `/clear` (or re-open Claude Code) to clear context and start fresh. Then run the following command:

```bash
# Implement the task
Expand All @@ -47,6 +47,7 @@ Restart the Claude Code session to clear context and start fresh. Then run the f
```

- [Detailed guide](../../guides/spec-driven-development.md)
- [Refining specifications and code](refine.md)
- [Usage Examples](usage-examples.md)

## Overall Flow
Expand Down Expand Up @@ -127,6 +128,20 @@ Even if you prefer a less hands-on approach, you can still use the plugin for co

Learn more about available customization options in [Customization](customization.md).

## FAQ

**Do I need to re-run `/plan` or `/implement` after context compaction (`/compact`)?**

After compaction, close the terminal and resume with `/plan --continue` or `/implement --continue`. This produces more predictable results than continuing in a compacted context. Using `/model sonnet[1m]` reduces compaction frequency.

**Do I need to prefix every prompt with `/plan` or `/implement`?**

No. Run these commands once to start the workflow. The only time to invoke them again is when you change the specification or code and want agents to update misaligned sections — use `/plan --refine` or `/implement --refine`.

**Should I clear context between `/plan` and `/implement`?**

Yes. Run `/clear` (or re-open Claude Code) after `/plan` completes and before running `/implement`. The planning phase fills the context with analysis artifacts; a clean context gives implementation agents better results.

## Theoretical Foundation

The SDD plugin is based on established software engineering methodologies and research:
Expand Down
12 changes: 10 additions & 2 deletions docs/plugins/sdd/implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Execute task implementation steps using automated LLM-as-Judge quality verificat
| `--continue` | flag | None | Resume from the last completed step |
| `--refine` | flag | `false` | Detect changed project files and re-verify from the earliest affected step |

## Context Management

If you ran `/plan` in the same session, run `/clear` (or re-open Claude Code) before `/implement`. The planning phase fills the context window with analysis artifacts; starting fresh gives the implementation agents a clean context for better results.


## Workflow Diagram

```
Expand Down Expand Up @@ -146,7 +151,10 @@ After all steps complete:
1. Move task from `in-progress/` to `done/`
2. All step titles are marked `[DONE]`, and subtasks are marked `[X]`
3. All DoD items are marked `[X]`
4. Generate a final implementation report
4. Stage all changed files with Git
5. Generate a final implementation report

Staging at the end allows you to make manual edits on top and use `--refine`, so the agent can diff your changes against the staged state.

## Verification Levels

Expand All @@ -170,7 +178,7 @@ Resumes implementation from the last completed step:

Detects changes to **project files** (not the task file) and re-verifies from the earliest affected step:

1. Detects changed files via `git diff`
1. Compares local (unstaged) changes against staged changes by default. To compare against the last commit instead, specify it explicitly (e.g., `/implement --refine compare with last commit`).
2. Maps changed files to implementation steps using "Expected Output" and artifact paths
3. Determines the earliest affected step
4. Launches a judge for each affected step — if it passes, the user's fix is accepted; if it fails, the implementation agent aligns the rest of the code with the user's changes
Expand Down
6 changes: 4 additions & 2 deletions docs/plugins/sdd/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Each sub-phase is validated by a judge agent. All three must pass before proceed

### Phase 7: Promote Task

Moves the refined task file from `draft/` to `todo/` and stages all generated artifacts with Git.
Moves the refined task file from `draft/` to `todo/` and stages all generated artifacts with Git. Staging at the end allows you to make manual edits on top and use `--refine`, so the agent can diff your changes against the staged state.

## Quality Gates

Expand All @@ -151,12 +151,14 @@ Every phase includes a judge validation step using LLM-as-Judge:

After reviewing the generated specification, you can edit it directly and re-run the planning process with `--refine`:

1. Detects changes via `git diff HEAD -- <TASK_FILE>`
1. Compares local (unstaged) changes against staged changes by default. To compare against the last commit instead, specify it explicitly (e.g., `/plan --refine compare with last commit`).
2. Identifies the earliest modified section
3. Re-runs only stages from that point onward (top-to-bottom propagation)
4. Preserves earlier stages that are unaffected
5. Supports `//` comment markers for inline feedback

You can also pass a requirement change directly: `/plan --refine <requirement change>`. The agent incorporates your change and re-runs affected stages.

| Modified Section | Re-run From Stage |
|------------------|-------------------|
| Description / Acceptance Criteria | `business analysis` (Phase 2c) |
Expand Down
143 changes: 143 additions & 0 deletions docs/plugins/sdd/refine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Refining Specifications and Code

Guide for handling requirement changes at different stages of the SDD workflow.

## During Planning

When the specification needs adjustment after `/plan` completes:

### Option A: Pass the change directly

```bash
/plan --refine <requirement change>
```

The agent incorporates your change and re-runs affected stages.

**Examples:**

```bash
# Change authentication strategy
/plan --refine Use session-based auth instead of JWT

# Add a constraint the agent missed
/plan --refine The API must support pagination with cursor-based navigation, not offset

# Narrow the scope
/plan --refine Remove the admin dashboard from this task, we will handle it separately
```

### Option B: Edit the spec, then refine

1. Edit the task file in `.specs/tasks/todo/`
2. Add `//` comments to lines that need clarification
3. Run `/plan --refine`

The agent detects your edits, identifies the earliest modified section, and re-runs all stages from that point onward. Earlier sections remain unchanged.

**Example:** The agent planned a REST API, but you need GraphQL. Open the task file and edit:

```markdown
## Architecture Overview

// Change this to use GraphQL with Apollo Server instead of REST
- REST API with Express routes for CRUD operations
- PostgreSQL with Prisma ORM
```

Then run `/plan --refine`. The agent re-runs from architecture synthesis onward, producing new implementation steps for GraphQL while preserving the research and business analysis stages.

### What `--refine` compares

By default, `--refine` diffs local (unstaged) changes against staged changes. Both `/plan` and `/implement` stage their output at the end, so any manual edits you make afterward appear as unstaged changes.

To compare against the last commit instead, specify it: `/plan --refine compare with last commit`.

## After Implementation

When requirements change after `/implement` completes, choose based on the scope of the change:

### Small code adjustments

Edit the code directly, then run:

```bash
/implement --refine
```

The agent detects your changes, maps them to implementation steps, and aligns the rest of the codebase. If the judge passes your fix, it is accepted as-is. If it fails, the agent adjusts surrounding code to match your intent.

**Examples:**

```bash
# You fixed a validation bug in the controller — agent updates related tests and error messages
vi src/controllers/users.ts
/implement --refine

# You replaced bcrypt with argon2 in the auth service — agent aligns password checks elsewhere
vi src/services/auth.ts
/implement --refine

# You changed the database column name from `userName` to `username` — agent propagates across migrations, models, and queries
vi src/models/user.ts
/implement --refine
```

### Minor tweaks and polish

If the implementation is done and you need small refinements — renaming, formatting, minor behavior changes — run `/clear` (or re-open Claude Code) and work with agent as usual. No need to re-enter the SDD workflow.

**Examples:**

- Adjusting log messages or error text
- Renaming a local variable for clarity
- Tweaking CSS spacing or colors
- Adding a missing `console.log` for debugging

### Major requirement changes

If requirements changed substantially, create a new task:

```bash
/sdd:add-task "Refactor authentication implementation"
/sdd:plan
# /clear (or re-open Claude Code)
/sdd:implement
```

Re-running `/implement --refine` on large changes is less reliable than a fresh planning cycle. A new task produces a clean specification, proper architecture analysis, and accurate implementation steps.

**Examples of changes that warrant a new task:**

- Switching from a monolith to microservices
- Replacing the database engine (e.g., PostgreSQL to MongoDB)
- Changing the authentication model from API keys to OAuth2 with SSO
- Adding a real-time collaboration feature that was never in scope

## Walkthrough: Iterating on an Authentication Feature

A realistic sequence showing how refinement fits into the workflow:

```bash
# 1. Create and plan the task
/sdd:add-task "Add JWT authentication middleware"
/sdd:plan

# 2. Review the spec — agent chose HS256, but you need RS256
/plan --refine Use RS256 with rotating key pairs instead of HS256

# 3. Clear context, then implement
/clear
/sdd:implement

# 4. Review the code — token expiry is 1 hour, you want 15 minutes
vi src/config/auth.ts # change TOKEN_EXPIRY to 900
/implement --refine # agent updates tests and documentation to match

# 5. Product feedback: "Add refresh tokens"
# This is a significant scope addition — create a new task
/sdd:add-task "Add refresh token rotation for JWT auth"
/sdd:plan
/clear
/sdd:implement
```
1 change: 1 addition & 0 deletions plugins/code-review/skills/review-local-changes/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: code-review:review-local-changes
description: Comprehensive review of local uncommitted changes using specialized agents with code improvement suggestions
allowed-tools: ["Bash", "Glob", "Grep", "Read", "Task"]
disable-model-invocation: false
Expand Down
1 change: 1 addition & 0 deletions plugins/code-review/skills/review-pr/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: code-review:review-pr
description: Comprehensive pull request review using specialized agents
argument-hint: "[review-aspects]"
---
Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/agent-evaluation/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:agent-evaluation
description: Evaluate and improve Claude Code commands, skills, and agents. Use when testing prompt effectiveness, validating context engineering choices, or measuring improvement quality.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:apply-anthropic-skill-best-practices
description: Comprehensive guide for skill development based on Anthropic's official best practices - use for complex skills requiring detailed structure
argument-hint: Optional skill name or path to skill being reviewed
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:context-engineering
description: Understand the components, mechanics, and constraints of context in agent systems. Use when writing, editing, or optimizing commands, skills, or sub-agents prompts.
---

Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/create-agent/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:create-agent
description: Comprehensive guide for creating Claude Code agents with proper structure, triggering conditions, system prompts, and validation - combines official Anthropic best practices with proven patterns
argument-hint: [agent-name] [optional description of agent purpose]
allowed-tools: Read, Write, Glob, Grep, Bash(mkdir:*), Task
Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/create-command/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:create-command
description: Interactive assistant for creating new Claude commands with proper structure, patterns, and MCP tool integration
argument-hint: Optional command name or description of command purpose
---
Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/create-hook/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:create-hook
description: Create and configure git hooks with intelligent project analysis, suggestions, and automated testing
argument-hint: Optional hook type or description of desired behavior
---
Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/create-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:create-skill
description: Guide for creating effective skills. This command should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations. Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:create-workflow-command
description: Create a workflow command that orchestrates multi-step execution through sub-agents with file-based task prompts
argument-hint: [workflow-name] [description]
allowed-tools: Read, Write, Glob, Grep, Bash(mkdir:*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:prompt-engineering
description: Use this skill when you writing commands, hooks, skills for Agent, or prompts for sub agents or any other LLM interaction, including optimizing prompts, improving LLM outputs, or designing production prompt templates.
---

Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/test-prompt/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:test-prompt
description: Use when creating or editing any prompt (commands, hooks, skills, subagent instructions) to verify it produces desired behavior - applies RED-GREEN-REFACTOR cycle to prompt engineering using subagents for isolated testing
---

Expand Down
1 change: 1 addition & 0 deletions plugins/customaize-agent/skills/test-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:test-skill
description: Use when creating or editing skills, before deployment, to verify they work under pressure and resist rationalization - applies RED-GREEN-REFACTOR cycle to process documentation by running baseline without skill, writing to address failures, iterating to close loopholes
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: customaize-agent:thought-based-reasoning
description: Use when tackling complex reasoning tasks requiring step-by-step logic, multi-step arithmetic, commonsense reasoning, symbolic manipulation, or problems where simple prompting fails - provides comprehensive guide to Chain-of-Thought and related prompting techniques (Zero-shot CoT, Self-Consistency, Tree of Thoughts, Least-to-Most, ReAct, PAL, Reflexion) with templates, decision matrices, and research-backed patterns
---

Expand Down
1 change: 1 addition & 0 deletions plugins/ddd/skills/setup-code-formating/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: ddd:setup-code-formating
description: Sets up code formatting rules and style guidelines in CLAUDE.md
argument-hint: None required - creates standard formatting configuration
---
Expand Down
1 change: 1 addition & 0 deletions plugins/ddd/skills/software-architecture/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: ddd:software-architecture
description: Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
---

Expand Down
1 change: 1 addition & 0 deletions plugins/docs/skills/update-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: docs:update-docs
description: Update and maintain project documentation for local code changes using multi-agent workflow with tech-writer agents. Covers docs/, READMEs, JSDoc, and API documentation.
argument-hint: Optional target directory, documentation type (api, guides, readme, jsdoc), or specific focus area
---
Expand Down
1 change: 1 addition & 0 deletions plugins/docs/skills/write-concisely/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: docs:write-concisely
description: Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: fpf:actualize
description: "Reconcile the project's FPF state with recent repository changes"
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: fpf:decay
description: "Manage evidence freshness by identifying stale decisions and providing governance actions"
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: fpf:propose-hypotheses
description: Execute complete FPF cycle from hypothesis generation to decision
argument-hint: "[problem-statement]"
allowed-tools: Task, Read, Write, Bash, AskUserQuestion
Expand Down
Loading