بنقرة واحدة
design-protocol
Design First, Code Second - explore options before implementation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Design First, Code Second - explore options before implementation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Read files BEFORE asking questions. Inspect to assist, not just to plan [reading, inspection, context, workflow, collaborative editing]
Assist with interactive git rebase [git, rebase, history, cleanup, squash, reorder]
Always read Makefile before proposing commands [Makefile, build, test, docker, workflow]
Session retrospective following desk/retro.md [feedback, session review, improvement, workflow, validation]
Write semantic git commits following conventional format
Task closing protocol - documentation updates and completion tracking
| name | design-protocol |
| description | Design First, Code Second - explore options before implementation |
| license | MIT |
| compatibility | opencode |
| metadata | {"related":["project documentation (README.md, ARCHITECTURE.md, desk/*.md)","skill:workflow-protocol","skill:semantic-commit"]} |
I enforce the "Design First, Code Second" principle: explore design options with tradeoffs BEFORE writing any code.
Before implementing ANY feature or change:
Present max 3 alternatives with concise tradeoffs:
## Design Options
### Option A: [Simple but limited]
**Pros:** [list]
**Cons:** [list]
### Option B: [Flexible but complex]
**Pros:** [list]
**Cons:** [list]
### Option C: [User's suggestion]
**Pros:** [list]
**Cons:** [list]
## Recommendation
I recommend [Option X] because [reason].
Which approach do you prefer?
Do NOT write code until:
Example confirmation:
✅ Approach validated: Option B (Context + localStorage)
Proceeding to implementation.
Checklist:
J'ai analysé [composant]. Sa philosophie est : [X].
J'ai relu : [docs, commentaires, git history].
Je propose : [changement aligné].
⚠️ Point d'attention : [déviation éventuelle].
// ❌ Code already written without discussing design
func NewFeature() {
// ...
}
1. Read existing code to understand patterns
2. Present 2-3 design options with tradeoffs (including user's idea)
3. Wait for user choice
4. Confirm approach is clear
5. Implement the validated design
→ If you discover a problem with the plan:
❌ Bad: Change code alone on unplanned parts
✅ Good: Stop, explain the issue, suggest switching to Plan mode
6. Run tests, report results
→ If tests reveal the plan is not feasible:
❌ Bad: Iterate alone to fix (write→test→fix→test→...)
✅ Good: Stop, present the issue, go back to Plan step 2
7. Ask for validation before commit
Suggest switching to Plan mode if:
Example:
⚠️ Problem discovered: The current approach won't work because [reason].
Should I:
1. Switch to Plan mode to explore alternatives?
2. Proceed with [modified approach]?
User: "Add dark mode toggle"
Me (Plan mode):
## Design Options
### Option A: CSS variables only
**Pros:** Simple, no JavaScript, fast
**Cons:** No persistence across sessions, limited customization
### Option B: Context + localStorage
**Pros:** Persistent, flexible, supports system preference
**Cons:** More complex, requires JavaScript
### Option C: Your idea - Theme provider
**Pros:** Centralized, reusable across components
**Cons:** Over-engineered for single toggle, adds dependency
## Recommendation
Option B balances simplicity and features. It persists user choice and detects system preference automatically.
Which approach do you prefer?
User: "Refactor converter to handle edge cases"
Me (Plan mode):
J'ai analysé `converter.go`. Sa philosophie est : single-pass conversion with minimal allocations.
J'ai relu :
- `desk/DEVELOPMENT.md` - Conversion patterns
- `src/converter_test.go` - Test cases
Je propose : Two-pass approach (collect → process) to avoid iteration issues during node movement.
⚠️ Point d'attention : This deviates from current single-pass pattern because it requires additional memory.
Alternative options:
- Option A: Keep single-pass with node copying (more memory, safer)
- Option B: Two-pass approach (cleaner, requires refactoring)
Which approach?