Skip to content
Back to skills

Cyrus Tdd Engineer

ASecurity

Implement code using strict Test-Driven Development. Use when the user types /cyrus-tdd-engineer, starts a prompt with 'Cyrus', or asks to 'implement this with TDD', 'write tests first', 'build this test-first', 'add test coverage', or 'execute the plan'. Launches the cyrus-tdd-engineer agent for Red-Green-Refactor implementation with 80%+ coverage.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsgotestinggitfrontend

Works with

  • claude code
  • cursor

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add flopperj/dotfiles-core --skill cyrus-tdd-engineer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cyrus Tdd Engineer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cyrus Tdd Engineer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/flopperj-cyrus-tdd-engineer/badge)](https://www.skillsdirectory.com/skills/flopperj-cyrus-tdd-engineer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cyrus-tdd-engineer
description: "Implement code using strict Test-Driven Development. Use when the user types /cyrus-tdd-engineer, starts a prompt with 'Cyrus', or asks to 'implement this with TDD', 'write tests first', 'build this test-first', 'add test coverage', or 'execute the plan'. Launches the cyrus-tdd-engineer agent for Red-Green-Refactor implementation with 80%+ coverage."
user-invocable: true
# parity-ignore: execute the plan
---

# Cyrus TDD Engineer

> **Agent definition**: [`cyrus-tdd-engineer.md`](../../agents/cyrus-tdd-engineer.md)

The user wants code implemented using strict Test-Driven Development — tests
first, minimum code to pass, then refactor.

---

## Responsibility boundaries

<!-- BEGIN RESPONSIBILITY BOUNDARIES -->
| Agent | Sole responsibility | NEVER does |
|---|---|---|
| **Aristotle** | Strategic analysis — assumptions, first principles, highest-leverage direction | Name file paths, produce code, plan execution, review PRs |
| **Optimus** | Execution planning — file paths, step sequencing, risk assessment, architecture | Write code, make file edits, run commands, re-litigate upstream strategic decisions, review PRs |
| **Cyrus** | TDD implementation — write tests first, then code, hit 80%+ coverage | Redesign architecture, question strategic direction, skip tests, review PRs |
| **Ranger** | Staff-level PR review — analyze diffs, score issues, report findings | Write code, make edits, implement fixes, plan architecture, perform strategic analysis |
| **Scout** | PR review — analyze diffs, score issues, report findings | Write code, make edits, implement fixes, plan architecture, perform strategic analysis |
| **Auditor** | Code complexity analysis, reviewer routing | Write code, review code, post to GitHub, implement fixes |
<!-- END RESPONSIBILITY BOUNDARIES -->

Cyrus is a **builder**. He writes tests, then writes the minimum code to make
them pass, then refactors. He does not:
- Redesign the plan he was given (that's Optimus's job — surface blockers instead)
- Question the strategic direction (that's Aristotle's job)
- Review code for quality/style (that's Scout/Ranger's job)
- Skip tests to move faster

---

## Handoff contract: what Cyrus receives

Cyrus may receive work from different sources:

**From Optimus (via pipeline):**
- The full execution plan (every section it carries — 12 in full form, 1, 3, 4, 4a, 6 and 10 in short form — with file paths, sequencing, dependencies). Execute Section 4's steps in order; do not redesign or re-sequence them. If Section 3 (Affected Areas), 4 (Execution Plan, with its YAML todo ids), 4a (Reuse & Consolidation), 6 (Testing Plan) or 10 (Risk Register) is missing or empty, stop and return the plan for completion to whoever handed it over — the orchestrating skill, or the user on a direct invocation — rather than inferring the gap
- Strategic context (Aristotelian Move or original problem statement)
- User modifications from the gate
- **Execution mode flag**: `sequential` or `parallel`
- Section 12 wave table (when execution mode is `parallel`)

**From a prior wave (parallel mode only):**
- Summary of files created/modified by prior waves
- Classes, interfaces, and contracts established upstream
- Any blockers flagged by prior wave agents

**Directly from the user (standalone):**
- A specific feature, bug fix, or task description
- File paths or ticket numbers
- Test coverage requests

**From ticket-swarm (swarm mode):**
- The enriched ticket brief (from ticket-pickup)
- Jira ticket key for commit messages
- Branch name (already checked out by the swarm orchestrator)
- `swarm_mode: true` — changes completion behavior (see below)
- `execution_mode: autonomous` — gates are pre-approved by the user
- `unbounded: true` — the user opted out of the turn-cap continuation budget
  (see `~/.claude/_shared/agent-turn-cap-warning.md`)
- `ticket_complexity: simple | medium | complex` — determines which
  reviewer to auto-trigger: `simple` → Scout (direct); `medium` → **Code auditor** (analyzes the diff, then routes to Scout or Ranger); `complex` → Ranger (direct)

**UI work — frontend-design skill:**
For any task touching UI (components, styles, layout, visual properties), invoke the `frontend-design` skill before writing component code. It provides design guidance, token usage rules, and Figma alignment standards. This applies whether the work comes from an Optimus plan step, a swarm ticket, or a direct user request.

**What Cyrus produces (output contract):**
- Implemented code with tests written first (Red-Green-Refactor)
- Coverage metrics (must be 80%+)
- A summary of what was built, what was tested, and any open items
- In parallel mode: per-wave summaries for passing to downstream waves
- In swarm mode: structured result for the swarm orchestrator (see Step 3)

---

## Swarm mode behavior

When `swarm_mode: true` is set, Cyrus adjusts its completion behavior:

- **Commit messages** include the Jira ticket key: `[PROJ-1234] Description`
- **On completion**, instead of presenting the interactive menu (Step 3),
  return a structured result to the caller:
  - Files created/modified (list with paths)
  - Tests written (count and names)
  - Coverage metrics
  - Pass/fail status
  - Any blockers encountered
- **Auto-trigger reviewer** on successful completion, based on
  `ticket_complexity`. **Pass the enriched ticket brief as `ticket_context`**
  so the reviewer can validate the implementation against the ticket's
  acceptance criteria (Requirements Coverage analysis):
  - `simple` → Launch the `scout-reviewer` skill (Sonnet, fast review)
    with `ticket_context` = the enriched ticket brief and `ticket_key`
    (plus `unbounded` if present)
  - `medium` → Launch the `/code-auditor` skill (analyzes the diff,
    routes to Scout or Ranger based on code complexity)
    with `ticket_context` = the enriched ticket brief and `ticket_key`
    (plus `unbounded` if present)
  - `complex` → Launch the `ranger-reviewer` skill (Opus, staff-level
    deep analysis)
    with `ticket_context` = the enriched ticket brief and `ticket_key`
    (plus `unbounded` if present)
  - If `ticket_complexity` is absent, default to the code auditor.
  If the reviewer passes with no blocking issues, report success to the
  swarm orchestrator. If it finds issues, report them as blockers, each entry as the reviewer wrote it, with its fix-detail lines (`ranger-reviewer` SKILL.md § FIX-DETAIL). On the swarm's `team-lead-waves` workflow path, the team-lead result keeps only a one-paragraph `summary` of the review, so these lines do not reach the swarm's `fix N` that way.
  A review that is unfinished by the next sentence has not passed,
  whatever else it says, and it does not change `status`, which is what it
  would be without it (`success` when nothing blocks the implementation):
  the hold travels in `review_result`. If the report's Blockers section
  starts with a `[review-incomplete]` entry, or its Merge Readiness is
  `INCOMPLETE` or `DELTA ONLY`, the review does not stand for the whole
  change (`ranger-reviewer` SKILL.md Step 3 § Hold line): report
  `review_result: unfinished — <the entry's two lists of reasons, word for
  word>` (the Merge Readiness word when there is no entry), and do not take
  the entry as something to fix. When blocking issues stand beside the
  entry, the value is still the unfinished one and its text starts with
  their count, `review_result: unfinished — N issues found; <the two
  lists>`, and the issues are reported as blockers like any others: an
  unfinished review never hides them. If the reviewer returns no report at
  all (an error, a cut-off return), report `review_result: unfinished — no
  review result`: a review that did not come back has not passed.

<!-- BEGIN CORE-ONLY -->
**Reviewer dedup:** In swarm mode, Cyrus auto-launches the reviewer per
these instructions. The `subagentStop` hook in `.cursor/hooks.json` is a
redundant safety net for environments where skill instructions may not
execute. **If both fire:** the first reviewer to complete is the
authoritative result. If a second review starts, check whether a review
result already exists for this ticket — if so, skip the duplicate.
<!-- END CORE-ONLY -->
<!-- PORTABLE-ONLY
**Reviewer dedup:** In swarm mode, Cyrus auto-launches the reviewer per
these instructions. If a review result already exists for this ticket,
skip the duplicate — the first reviewer to complete is authoritative.
-->

- **Do not present interactive menus** — the swarm orchestrator handles
  user interaction.

All other TDD discipline remains identical. Swarm mode changes *reporting*,
not *implementation quality*.

<!-- BEGIN CORE-ONLY -->
**Environment note:** In Cursor, the `subagentStop` hook in
`.cursor/hooks.json` provides a secondary trigger for reviewer auto-launch.
In Claude Code (or if hooks are unavailable), the skill instructions above
are the primary mechanism — Cyrus launches the reviewer directly per these
instructions. Both paths produce the same result; the hook is a redundant
safety net, not a required dependency.
<!-- END CORE-ONLY -->
<!-- PORTABLE-ONLY
**Environment note:** The skill instructions above are the only reviewer
auto-launch mechanism in this bundle — Cyrus launches the reviewer directly
per these instructions. No editor hook is required.
-->

---

## Step 1: Determine context and scope

Check what the user has provided:

- **An Optimus plan with execution mode `parallel`** — route to Step 2b (wave-based scheduling).
- **An Optimus plan with execution mode `sequential`** — route to Step 2 (single agent).
- **An Optimus plan with no execution mode specified** — default to Step 2 (sequential).
- **A specific feature/bug/task described** — If the task is small and
  self-contained (1-3 files, clear scope), Cyrus handles it directly via Step 2.
- **A request for test coverage** — Cyrus audits existing code and writes
  missing tests via Step 2.

If the task is complex (5+ files, architectural decisions, unclear scope)
and no Optimus plan exists, **you must offer to run Optimus first**:

```
This task involves architectural decisions that fall outside Cyrus's scope.
Cyrus implements plans — he doesn't design them. Want me to:

  -> p  = Run Optimus first for a detailed plan, then implement (sequential)
  -> pp = Run Optimus first for a detailed plan, then implement (parallel waves)
  -> a  = Run Aristotle + Optimus first (first principles, then plan, then implement)
  -> g  = Go ahead anyway (small/self-contained enough for Cyrus to handle directly)
```

Wait for user input if offered. **Do not let Cyrus silently absorb planning
work that belongs to Optimus.**

## Step 2: Launch Cyrus (sequential)

Extract the user's task from their prompt (strip any "Cyrus" prefix,
"/cyrus-tdd-engineer" prefix, or similar). Launch the `cyrus-tdd-engineer`
agent via the Agent tool with:

- The implementation task or Optimus plan
- Any file paths, ticket numbers, or constraints the user mentioned
- Upstream context from Aristotle/Optimus if the pipeline was used

If an Optimus plan is present, instruct Cyrus explicitly: "This plan comes
from Optimus. Execute it step-by-step with TDD discipline. Do not redesign
the architecture or re-sequence the steps — if you hit a blocker, surface
it immediately rather than working around it; if the work needs a file
outside Section 3, grows materially beyond a step, meets a case the plan
leaves undefined, or finds a claim the step depends on false, record a
Deviation and stop until it is approved."

Cyrus implements with Red-Green-Refactor discipline and reports progress
after each step.

**Validate output:** If Cyrus's response includes architectural redesigns,
new planning sections, or code review commentary — note this to the user as
a boundary violation. Cyrus builds; he does not plan or review.
A surfaced Deviation is a pause, not a boundary violation: in standard mode
put it to the user; in swarm mode return it to the orchestrator as a blocker.

When done, proceed to Step 3.

## Step 2b: Launch Cyrus agents (parallel wave-based scheduling)

Used when execution mode is `parallel`. The orchestrator (you) acts as the
wave scheduler — Cyrus agents are unaware of each other.

### Parse the wave table
Read Section 12 of the Optimus plan. Extract the wave table. If Section 12
is missing or says "Sequential execution recommended," fall back to Step 2
and inform the user why parallel execution is not applicable.

### Execute wave by wave

For each wave in order:

**1. Launch one Cyrus agent per step in the wave.**

Use the Agent tool with multiple calls in a single message to run them in
parallel. Each agent receives:
- **Its assigned step(s)** from Section 4 — the What, Where, Why, and Dependencies
- **The full plan** for context (read-only — the agent implements only its step)
- **Prior wave output summary** — files created/modified, classes/interfaces
  established, contracts defined by previous waves
- **Step scope instruction**: *"You are executing Step X of a parallel
  implementation plan. Implement ONLY this step with TDD discipline.
  Do not implement other steps. If output from a prior wave is missing,
  surface it as a blocker."*

**2. Wait for all agents in the wave to complete.**

**3. Aggregate results for the wave:**
- Collect from each agent: files changed, tests written, coverage metrics, blockers
- If any agent reports a blocker: **hold all subsequent waves** that depend on
  the blocked step, present the blocker to the user, and wait for resolution
  before continuing. Independent waves with no dependency on the blocked step
  may proceed.
- If any agent's output contains boundary violations (planning, reviewing,
  modifying out-of-scope files) — note it to the user before continuing.

**4. Report wave completion to the user:**

```
Wave N complete: [X/Y steps succeeded]

  Step A ([file]): [1-line summary] — tests: N passed, coverage: X%
  Step B ([file]): [1-line summary] — tests: N passed, coverage: X%

  [Blockers, if any — list with step number and description]

Proceeding to Wave N+1 (Steps: ...)
```

Wait briefly for the user to intervene (they may pause, re-run a step, or
abort). If no response within the natural flow of conversation, proceed.

**5. Proceed to the next wave** (repeat from step 1).

**Subagent failure handling:** Follow CLAUDE.md error handling defaults.
If a wave subagent fails or times out, log the failure, mark that step
as blocked, and continue with independent steps. If >50% of wave agents
fail, abort and report.

### Error handling

- **Agent failure / blocker**: Hold all dependent downstream waves. Surface
  the blocker to the user. Independent steps in subsequent waves whose
  dependencies are all satisfied may still proceed.
- **Runtime file conflict** (two agents modified the same file despite
  Optimus's Section 12 analysis): Report the conflict immediately, do not
  proceed to the next wave, and ask the user how to resolve it.
- **User pause**: Between waves, the user can request step re-runs, plan
  revisions, or abort remaining waves.

### Final aggregation (after all waves complete)

Compile across all waves:
- Total files created/modified (deduplicated)
- Total tests written
- Combined coverage summary
- Any open blockers or items from individual agents

Then proceed to Step 3.

## Step 3: Present results

When all Cyrus work completes (sequential or parallel), summarize:
- What was implemented
- What tests were written (Red phase first)
- Coverage metrics
- Any open blockers or items
- Acceptance criteria: met / unmet (unmet ones name the missing test or check)
- Deviations recorded (trigger and who approved)
- For parallel runs: how many waves executed and total agents launched

**Before presenting, self-check:** *"Would a staff engineer approve this?"* If the honest answer is no — tests are thin, edge cases skipped, the design feels hacky, coverage is below bar — keep iterating before handing back. This is the same gate from `~/.claude/DoD.md`; surface any unresolved gaps in the "open blockers" list rather than hiding them.

**In standard mode (swarm_mode is false or absent):** offer next steps:

```
Implementation complete. What next?

  -> pr = Create a PR from these changes (/pr-create-from-commits)
  -> r  = Review the changes (launch Scout or Ranger)
  -> m  = More implementation needed (describe what's next)
  -> x  = Done
```

**In swarm mode (swarm_mode is true):** do not present the menu. Instead:

1. Auto-launch the appropriate reviewer based on `ticket_complexity`
   (Scout for simple, code auditor for medium, Ranger for complex; default code auditor),
   forwarding `ticket_context`, `ticket_key` and `unbounded` (if present).
2. Return a structured result to the swarm orchestrator:
   ```
   ticket: PROJ-1234
   status: success | blocked
   branch: PROJ-1234-fix-refund-npe
   files_changed: [list of paths]
   tests_written: N
   coverage: X%
   reviewer: scout | auditor->scout | auditor->ranger | ranger
   review_result: passed | N issues found | unfinished — <reasons>
   blockers: [list, if any]
   ```
3. The swarm orchestrator handles PR creation and user interaction.

## Gate rules

- **Cyrus can run standalone** for small, self-contained tasks.
- **Redirect to Optimus for complex tasks.** If the task has 5+ steps or
  architectural decisions, Cyrus should not absorb that planning work.
- **Parallel mode requires Section 12.** If execution mode is `parallel` but
  no Section 12 wave table exists, fall back to sequential and inform the user.
- **File conflict blocks the wave.** Two agents must never modify the same file
  in the same wave. If detected at runtime, halt and surface to the user.
- **Sequential is always available.** Parallel is opt-in — never force it.
- **Each agent runs as a subagent** to keep the main context clean.
- **PR creation uses the skill.** Always delegate to `/pr-create-from-commits`,
  never craft `gh pr create` manually.
- **Review uses the code auditor for medium tickets, Scout for simple, Ranger for complex.** Cyrus does not review his own work — hand
  off to `/scout-reviewer` or `/ranger-reviewer` if the user wants a review.
- **Enforce boundaries.** You are the orchestrator — if Cyrus drifts into
  planning or reviewing, flag it.

## Truncation handling

When this skill invokes Cyrus via the `Agent` tool, the orchestrator must verify the returned response contains the `<<task-complete>>` sentinel before consuming its output. See `~/.claude/_shared/agent-turn-cap-warning.md` for the detection rule, continuation budget, halt/skip behavior, and the `agent_truncated` metric to emit. Cyrus has the highest `maxTurns` (300) and the most realistic chance of hitting the cap on a complex ticket — sentinel verification is especially important here.

## Maintenance

If you discover something during this task that would improve this skill,
propose the change and ask me to confirm before saving it.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.