From alfred-agent
Guided design document creation for new services, features, or integrations. Use when the user says "let's build X", "design this", "plan for X", or when you're about to implement something involving multiple components, a new service, or unfamiliar technology. Also trigger when the user asks to scaffold, bootstrap, or create a new project. This skill prevents common failures: missing UI, wrong target environment, missing deployment setup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/alfred-agent:designThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Structured design workflow before implementation. Do not write code until this process completes.
Structured design workflow before implementation. Do not write code until this process completes.
Ask these three questions. Do not proceed until answered.
Before continuing, search the codebase for related work:
docs/baseline/ for similar servicesPresent what you found: "I found these existing patterns: [X]. Should we follow the same approach?"
Work through each section. State "N/A" with a reason if one doesn't apply — don't skip silently.
If humans use it (from Step 1), a UI is required. Ask:
If agents-only, state: "No UI — agents interact via API."
Fill in every row:
| Question | Answer |
|---|---|
| Where is it developed? | |
| Where does it run (dev)? | |
| Where does it run (prod)? | |
| How is it deployed? | |
| What gitops entries are needed? | |
| What secrets are needed? | |
| What domain/DNS? | |
| Prerequisites to create first? |
Create docs/design.md in the project repo. Use this structure:
# {Name} Design Document
**Status:** Draft — pending review
**Date:** {today}
## Overview
## Tech Stack
## Architecture
## API Design
## Frontend
## Target Environment
## Security
## Implementation Phases
## Open Questions
## Decision Log
Every significant design choice gets an entry in the Decision Log. This is the project's ADR (Architecture Decision Record). Format:
## Decision Log
| # | Decision | Rationale | Alternatives considered |
|---|----------|-----------|----------------------|
| 1 | Node.js + Express | Consistent with existing platform services | Python FastAPI, Go |
| 2 | Per-project PostgreSQL | Isolation, simple teardown | Shared instance, operator |
When an ECR is run, add the ECR verdict and model consensus to the rationale. Decisions made during implementation also go here — not just design-time choices.
Scaffold all sections first with placeholders, then fill from Step 2 answers. Ask the user to review: "Please read through this. What should change?"
If there are open questions or significant design decisions, ask: "Want to run an ECR on this?"
Recommend ECR when multiple valid approaches exist or the technology is unfamiliar. Skip if the design follows an established pattern exactly.
Before declaring the design complete, count how many ADRs (Decision Log entries) were produced in this session.
Single-ADR bypass: If the Decision Log contains exactly one entry, skip this gate entirely — no review pass required, proceed directly to Step 5.
When ≥2 ADRs are present, check for coupling before proceeding:
Two ADRs are coupled if either condition holds:
If no coupling is detected among the ≥2 ADRs, document that finding ("ADRs are independent — gate skipped") and proceed to Step 5.
If coupling is detected, the following mandatory review pass is required before the design is marked complete.
a. file_refs_verified lint
Collect every file path referenced anywhere in the ADRs (and in the design document). For each path run:
ls <path> # or: find . -path "<path>" -maxdepth 5
Produce a table:
| Referenced path | Exists? |
|---|---|
docs/baseline/foo.md | yes / NO |
Any missing path is a blocking finding that must be resolved or explicitly deferred before the design is marked complete.
b. Critical-review agent pass
Dispatch a reviewer using the Agent tool. The reviewer must evaluate the coupled ADRs across three angles:
Suggested Agent prompt:
You are a critical reviewer. Review the following coupled ADRs:
[paste ADR entries]
Evaluate across three angles: architecture consistency, security/correctness, operability.
For each finding, state:
- Angle (architecture | security | operability)
- Severity (blocking | advisory)
- Finding (one sentence)
- Suggested resolution (one sentence)
Return a structured findings list only. No preamble.
c. Structured findings list and dispositions
Collect all findings (from the file_refs_verified lint and the Agent reviewer) into a single list:
| # | Source | Angle | Severity | Finding | Disposition |
|---|---|---|---|---|---|
| 1 | file_refs_verified | — | blocking | docs/baseline/foo.md does not exist | addressed / deferred-to-PR |
| 2 | critical-review | architecture | advisory | ADR-1 and ADR-3 both own the API contract with no clear precedence | addressed / deferred-to-PR |
Each finding requires an explicit disposition of "addressed" (fix applied now) or "deferred-to-PR" (tracked as a GitHub Issue or PR comment) before the design may be marked complete. A finding may not remain blank.
Only after all findings have dispositions is the design considered complete.
Before any implementation, present this checklist and complete each item:
Do not start coding until all prerequisites are done.
npx claudepluginhub screenfields/alfred-cc-tools --plugin alfred-agentGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.