| name | bugfix |
| description | Quality bug fixes (P1/P2). Full TDD cycle, branch from master via feature/, no production deploy. |
@bugfix
Quality bug fixes with full TDD cycle. Branch from master via feature/.
When to Use
- P1 (HIGH) or P2 (MEDIUM) issues
- Feature broken but not production
- Reproducible errors
Workflow
- Read issue —
bd show <id> or load from docs/issues/
- Branch —
git checkout master && git pull && git checkout -b fix/{id}-{slug}
- TDD — Red: failing test → Green: minimal fix → Refactor
- Quality gates — Run quality gates (see Quality Gates in AGENTS.md)
- Commit —
git commit -m "fix(scope): description"
- Push —
git push -u origin fix/{branch} then gh pr create --base master
Write Plan (F101)
Before modifying any file, emit a write plan:
- Enumerate — List every file the skill will CREATE / MODIFY / DELETE with a one-line reason (test files and fix files).
- Flags:
--dry-run — Emit write plan only. Do NOT create, modify, or delete any file.
--yes — Skip confirmation prompt. Execute immediately. Intended for CI/non-interactive.
- Confirm — Present the plan to the user and wait for explicit approval (unless
--yes).
- Log — Append write plan event to
.sdp/log/events.jsonl (sanitize file paths before logging: strip newlines, ensure valid JSON escaping):
{"spec_version":"v1.0","event_id":"<uuid>","timestamp":"<ISO-8601>","source":{"system":"sdp-lab","component":"bugfix"},"event_type":"decision.made","payload":{"decision_type":"write_plan","plan":[{"path":"...","action":"CREATE|MODIFY|DELETE","reason":"..."}]},"context":{"feature_id":"<F-id if known>","workstream_id":"<ws-id if applicable>"}}
Include context fields only when the ID is known at plan time. Omit unavailable fields rather than inventing placeholders.
Note: Phase 1 uses prompt-level write boundaries (CLI out of scope). Aligns with sdp/schema/contracts/orchestration-event.schema.json via event_type: "decision.made". Phase 2 CLI will emit natively.
Output format:
WRITE PLAN for @bugfix <target>:
CREATE: path/to/new/file — <reason>
MODIFY: path/to/existing/file — <reason>
DELETE: path/to/removed/file — <reason>
Proceed? [y/n]
Modes:
- No flag: Show plan → Confirm → Execute
--dry-run: Show plan → STOP
--yes: Show plan → Execute immediately (no prompt)
Output
Bug fixed, tests added, issue closed, changes pushed.
See Also
- @hotfix — P0 emergency
- @issue — Classification
- @debug — Root cause analysis