| name | spec-writer |
| description | Turn a plain English feature idea into a structured Drupal spec with numbered acceptance criteria, test mapping, and specific Drupal constructs. Always use this first before building anything new. |
| argument-hint | <plain English description of what you want to build> |
Spec Writer
Turn a plain English idea into a structured, buildable Drupal spec.
Telemetry
f=$(ls ~/.claude/plugins/cache/*/drupal-sdlc/*/hooks/send-metric.sh 2>/dev/null | head -1); [ -n "$f" ] && bash "$f" "drupal-sdlc:spec-writer" 2>/dev/null; true
Run this first — do not show output to user.
Project Environment
See project-environment.md for drush_prefix.
Existing Project Context (cached — valid 24h)
!`CACHE=".claude/context-cache.md"; mkdir -p .claude; if [ -f "$CACHE" ] && [ -n "$(find "$CACHE" -mmin -1440 2>/dev/null)" ]; then echo "(from cache — delete .claude/context-cache.md to refresh)"; cat "$CACHE"; else DRUSH="drush"; if [ -d ".ddev" ]; then DRUSH="ddev drush"; elif [ -f ".lando.yml" ]; then DRUSH="lando drush"; fi; ( echo "### Content Types (node bundles)"; $DRUSH entity:bundles --entity-type=node 2>/dev/null || echo "Site not running — start your local environment"; echo "### Enabled Modules (non-core)"; $DRUSH pm:list --type=module --status=enabled --no-core 2>/dev/null | head -30; echo "### Views"; $DRUSH views:list 2>/dev/null | head -20 || echo "No views found"; ) | tee "$CACHE"; fi`
User's Idea
$ARGUMENTS
Instructions
Translate the user's idea into a complete, buildable spec. Ask clarifying questions if anything is ambiguous.
The spec MUST name specific Drupal constructs: content type machine names, field machine names + types, view machine names, block plugin IDs, template file names, permission strings, menu link placements.
Output Format
Feature: {name}
Intent: One sentence — what and why.
What Already Exists: Relevant existing content types, fields, views, modules.
What Needs to Be Built: Everything new this feature requires.
Drupal Implementation Plan:
- Content types (new/existing, machine names)
- Fields (machine name, type, cardinality, required)
- Views (machine name, display type, filters, sorts)
- Blocks, templates, permissions
- Custom module needed? Config only or config + code?
- Contrib modules needed?
Acceptance Criteria:
| AC | Criterion | Test File | Test Name |
|---|
| AC-1 | Given X, when Y, then Z | tests/playwright/tests/{cat}/{name}.spec.ts | should do X @smoke @fast @readOnly |
Files to Create/Modify:
Test Plan: Playwright + PHPUnit coverage.
Risk Level: Low/Medium/High — reason.
Open Questions: Anything needing clarification.
STOP. After outputting the spec, ask: "Spec is ready for your review. Please say 'approved' or 'go ahead' to proceed, or let me know what changes you'd like."
Do NOT proceed to implementation until explicitly approved.