Skip to content
Open
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
6 changes: 3 additions & 3 deletions .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": "3.8.1",
"version": "3.9.1",
"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 Expand Up @@ -55,7 +55,7 @@
{
"name": "sadd",
"description": "Introduces skills for subagent-driven development, dispatches fresh subagent for each task with code review between tasks, enabling fast iteration with quality gates.",
"version": "3.3.1",
"version": "3.4.0",
"author": {
"name": "Vlad Goncharov",
"email": "vlad.goncharov@neolab.finance"
Expand All @@ -77,7 +77,7 @@
{
"name": "sdd",
"description": "Specification Driven Development workflow commands and agents, based on Github Spec Kit and OpenSpec. Uses specialized agents for effective context management and quality review.",
"version": "3.4.1",
"version": "3.5.0",
"author": {
"name": "Vlad Goncharov",
"email": "vlad.goncharov@neolab.finance"
Expand Down
53 changes: 53 additions & 0 deletions .claude/rules/dispatch-site-sweep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Update Every Dispatch Site When a Dispatched Procedure's Output Contract Changes
impact: HIGH
paths:
- "plugins/**/*.md"
- ".claude/agents/**/*.md"
- ".claude/skills/**/*.md"
---

# Update Every Dispatch Site When a Dispatched Procedure's Output Contract Changes

Deleting a stage at its source is only half the refactor. Grep the repository for the procedure's
filename and update every prompt that dispatches it, because a dispatch that still says "execute it
exactly as is" plus "update the task file" against a procedure that now writes only a scratchpad
leaves two contradicting orders and the agent silently produces nothing.

## Incorrect

The stage was correctly deleted at the source, but the dispatching prompt still commands the removed
behaviour.

```markdown
<!-- analyse-business-requirements.md — STAGE 6 "Update Task File" deleted -->
**Write NOTHING to the task file here.** The dispatching agent owns the task file.
```

```markdown
<!-- plan-task/SKILL.md — NOT swept -->
Read ${CLAUDE_PLUGIN_ROOT}/skills/plan-task/analyse-business-requirements.md
and execute it exactly as is!

CRITICAL: ONLY CREATE THE SCRATCHPAD AND UPDATE THE TASK FILE.
```

## Correct

After the deletion, run `grep -rn "analyse-business-requirements" .` and re-anchor every hit to the
new contract.

```markdown
<!-- plan-task/SKILL.md — swept -->
Execute your own Core Process (STAGES 1-10). It dispatches
${CLAUDE_PLUGIN_ROOT}/skills/plan-task/analyse-business-requirements.md
STAGES 2-5, which write only to the scratchpad.

CRITICAL: DO NOT OUTPUT YOUR ANALYSIS. Write the scratchpad, then the task file's
`# Description` and `## Acceptance Criteria`.
```

## Reference

- `.claude/rules/supersede-at-the-source.md` — delete the stage in the source file; this rule is the
caller-side follow-up.
55 changes: 55 additions & 0 deletions .claude/rules/dogfood-new-rules-in-own-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Apply a Newly Added Rule to the File's Own Worked Examples
impact: HIGH
paths:
- "plugins/**/agents/*.md"
- "plugins/**/skills/**/*.md"
- ".claude/agents/*.md"
---

# Apply a Newly Added Rule to the File's Own Worked Examples

After adding a constraint to a prompt or agent file, re-audit every worked example already in that
file against the new constraint and fix the ones that violate it. A model imitates the demonstration
far more reliably than it obeys the prose, so one self-contradicting example silently repeals the
rule it sits beside.

## Incorrect

A new rule demands the two anchors differ on exactly one thing, but the worked example further down
the same file was carried over unchanged and differs on two — status-code precision *and* body
assertion.

```yaml
# Rule added at the top of the file:
# "The two anchors MUST differ on exactly ONE thing."

- name: "Assertion Quality"
anchors:
score_2: |
expect(r.status).toBeLessThan(300);
score_4: |
expect(res.status).toBe(200);
expect(res.body).toEqual([{ id: expect.any(String) }]);
contrast: "score_4 asserts the exact status code and the exact response body; score_2 asserts only a status range."
```

## Correct

Hold one attribute fixed so the pair isolates the single difference the dimension names.

```yaml
- name: "Assertion Quality"
anchors:
score_2: |
expect(res.status).toBe(200);
score_4: |
expect(res.status).toBe(200);
expect(res.body).toEqual([{ id: expect.any(String) }]);
contrast: "score_4 asserts the response body as well; score_2 asserts only the status."
```

## Reference

- `.claude/rules/refactor-cross-references.md` — the companion sweep for derived references that go
stale rather than contradict.
21 changes: 11 additions & 10 deletions .claude/rules/grounded-instruction-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@ assumptions about what the input contains.

## Incorrect

A fallback clause invents a config source by symmetry with a neighbouring one. The `#### Verification`
block is produced by `plugins/sdd/agents/qa-engineer.md` and emits only Level, Artifact, Threshold and
Checklist — it has no Model field, so the no-override path resolves to nothing.
A fallback clause invents a config source by symmetry with a neighbouring one. Sub-task files are
produced by `plugins/sdd/agents/tech-lead.md`, whose template emits `#### Expected Output`,
`#### Success Criteria`, `#### Subtasks` and `#### Blockers & Risks` — there is no
`#### Verification` block at all, so the no-override path resolves to nothing.

```markdown
- **Model**: `MODEL_OVERRIDE` if set — otherwise as specified in step or `opus` by default
- **Model**: `MODEL_OVERRIDE` if set — otherwise the step's `Model` column — otherwise `sonnet`

**Reviewer 1 & 2** — dispatch each with **Model**: `MODEL_OVERRIDE` if set
**Reviewer** — dispatch with **Model**: `MODEL_OVERRIDE` if set
— otherwise as specified in the step's `#### Verification`
```

## Correct

Grep the producer first (`grep -n 'Model' plugins/sdd/agents/qa-engineer.md` → no hits), then
terminate the chain with a literal default that always resolves.
Grep the producer first (`grep -n '#### Verification' plugins/sdd/agents/tech-lead.md` → no hits),
then terminate the chain with a source that always resolves.

```markdown
- **Model**: `MODEL_OVERRIDE` if set — otherwise as specified in step or `opus` by default
- **Model**: `MODEL_OVERRIDE` if set — otherwise the step's `Model` column — otherwise `sonnet`

**Reviewer 1 & 2** — dispatch each with **Model**: `MODEL_OVERRIDE` if set
— otherwise `opus`
**Reviewer** — dispatch with **Model**: `MODEL_OVERRIDE` if set
— otherwise the phase's `Reviewer model` from the Phase Overview
```

## Reference
Expand Down
46 changes: 46 additions & 0 deletions .claude/rules/reground-transplanted-doc-claims.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Re-Ground Every Claim Copied Between Sibling Documentation Pages
impact: HIGH
paths:
- "docs/**/*.md"
- "**/README.md"
---

# Re-Ground Every Claim Copied Between Sibling Documentation Pages

When documenting a second command, agent, or module by mirroring the structure of its sibling's
page, re-verify each transplanted sentence against the NEW target's own source file before keeping
it. A claim that is true for the sibling reads as authoritative on the target's page and is
indistinguishable from a verified fact, so a false transplant is worse than an omission.

## Incorrect

The `/plan-task` page correctly says the command stages its output. The sentence is carried over to
the `/implement-task` page, whose skill only runs `git mv` on the task file — it never stages
changed files.

```markdown
<!-- docs/plugins/sdd/implement-task.md -->
### Workflow Phase 4: Complete
1. Move task from `in-progress/` to `done/`
4. Stage all changed files with Git

Staging at the end allows you to make manual edits on top and use `--refine`.
```

## Correct

Grep the target's own source for the behaviour (`grep -n 'git add\|stage' plugins/sdd/skills/implement-task/SKILL.md`
→ no staging step) and drop or correct the claim. Keep only what that file backs.

```markdown
<!-- docs/plugins/sdd/implement-task.md -->
### Workflow Phase 4: Complete
1. Move task from `in-progress/` to `done/` (via `git mv`)
2. Generate a final implementation report
```

## Reference

- `.claude/rules/grounded-instruction-references.md` — the companion check for references pointing
at a source that produces nothing.
41 changes: 41 additions & 0 deletions .claude/rules/rename-identifiers-in-link-targets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Rename Identifiers in Link Targets, Not Just Link Text
impact: MEDIUM
paths:
- "**/*.md"
---

# Rename Identifiers in Link Targets, Not Just Link Text

When renaming a command, page, section or anchor in documentation, update the identifier inside
every link **target** (`](...)`) as well as inside the visible link text. Markdown puts two copies of
the same identifier on one line, so a rename that edits only the rendered token leaves a link that
still points at the old, now non-existent, destination — and it reads as correct because the visible
label is right.

## Incorrect

`/plan` was renamed to `/plan-task`. The label was updated; the URL slug was not, and it now
disagrees with the same file's other links to that page.

```markdown
- [/plan-task](https://neolab.gitbook.io/cek/plugins/sdd/plan) - Refine the task specification
- [/implement-task](https://neolab.gitbook.io/cek/plugins/sdd/implement) - Implement and verify

<!-- ...elsewhere in the same file, already correct: -->
<a href="https://neolab.gitbook.io/cek/plugins/sdd/plan-task">/plan-task</a>
```

## Correct

Grep for the bare identifier including its path/anchor forms
(`grep -nE '\]\([^)]*/plan[^-a-z]|#plan[^-a-z]' README.md`) and fix both halves of every link.

```markdown
- [/plan-task](https://neolab.gitbook.io/cek/plugins/sdd/plan-task) - Refine the task specification
- [/implement-task](https://neolab.gitbook.io/cek/plugins/sdd/implement-task) - Implement and verify
```

## Reference

- `.claude/rules/refactor-cross-references.md` — the companion sweep for derived counts and ranges.
52 changes: 52 additions & 0 deletions .claude/rules/schema-slots-match-obligation-cardinality.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Give an Output-Schema Field One Slot Per Case the Obligation Covers
impact: HIGH
paths:
- "plugins/**/agents/*.md"
- "plugins/**/skills/**/*.md"
- ".claude/agents/*.md"
---

# Give an Output-Schema Field One Slot Per Case the Obligation Covers

When prose in a prompt mandates evidence for N cases (both directions of a comparison, every
listed item, each phase), the emitted-YAML template must provide N slots. A single slot for a
two-sided obligation does not make the second side optional — it makes it unrecordable, so the
agent silently satisfies half the rule while the output still looks well-formed. Count the cases
in the sentence, then count the keys in the template, and make the two numbers agree.

## Incorrect

The procedure demands the closer-to AND further-from anchors both be quoted, but the template
offers one `anchor_quoted` / `artifact_quoted` pair, so the further-from side degrades to a bare
label with no place for its evidence.

```yaml
# prose: "quote the anchor text and the artifact text, for the anchor it is closer to
# and for the anchor it is further from"
anchor_comparison:
closer_to: "score_2 | score_4"
further_from: "score_4 | score_2"
anchor_quoted: "[exact excerpt of the anchor text compared against]"
artifact_quoted: "[exact excerpt of the artifact text compared, with file:line]"
```

## Correct

One quoted pair per side, so the template cannot be filled in without producing both.

```yaml
anchor_comparison:
closer_to:
anchor: "score_4 | [exact excerpt of the anchor text]"
artifact: "[exact excerpt, with file:line]"
further_from:
anchor: "score_2 | [exact excerpt of the anchor text]"
artifact: "[what the artifact does instead, or 'artifact lacks: ...']"
```

## Reference

- `.claude/rules/scope-criteria-per-item-not-per-block.md` — the companion check for admitting a
block wholesale instead of item by item.
</content>
44 changes: 44 additions & 0 deletions .claude/rules/scope-bounded-token-budget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Pay a Token Budget Inside the Change's Scope, Never by Deleting Untouched Content
impact: HIGH
---

# Pay a Token Budget Inside the Change's Scope, Never by Deleting Untouched Content

When a change adds lines to a prompt or agent file and the project's token-minimalism rule presses
back, compress the text you were asked to change — never sections the task never mentioned. Trimming
untouched content silently destroys guidance nobody reviewed, and it hides inside a diff that looks
like a net-neutral refactor. If the budget still does not close, report the growth; do not fund it
from elsewhere.

## Incorrect

The task was to replace `score_definitions` with `anchors`. To offset +43 added lines, the agent
also gutted an unrelated Stage 4 example list — dropping four statements outright — even though the
file was nowhere near any size limit.

```markdown
<!-- Stage 4, NOT part of the task -->
- The response must incorporate a quote from a recent news article or study. [Hard Rule]
- The response must mention the publication date of the referenced source. [Hard Rule]
- The response must concisely summarize the quoted source. [Hard Rule] <!-- deleted -->
- The response must discuss economic implications based on the source. [Hard Rule] <!-- deleted -->
- The response employs sensory details to enhance the reader's mental image. [Principle]
- The response demonstrates originality to avoid clichés. [Principle]
```

## Correct

Touch only the sections the task names. Absorb the growth, and state it in the report so a reviewer
can decide whether a separate cleanup is warranted.

```markdown
<!-- Stage 4 left exactly as found; only the score_definitions sites changed -->
<!-- Report: file grew 766 -> 856 lines (+11.7%), all of it the new Step 5.1 stage and
the anchors blocks. No unrelated sections were compressed. -->
```

## Reference

- `CLAUDE.md` — "Minimal tokens" is a design rule for what you write, not a licence to delete what
you did not touch.
Loading