Load relevant design documents and project context before working on any task. Use when user asks about features, requests implementation, discusses functionality, analyzes architecture, updates...
Core Principle: Understand the design intent before taking action.
Project Detection: Automatically identifies project root via git repository location.
This skill should activate for ANY task involving project features or functionality:
Extract feature keywords from the user's request. Common domains:
ALWAYS check these locations in this order:
docs/design/ - Primary design documents (most important!)
core-user-experience-v2.md - Main UX design (most features described here)architecture.md - System architecture and component designprd.md - Product requirements and feature listwhite-paper.md - Project vision and philosophydocs/implementation/ - Technical implementation plans
docs/research/ - Background research and analysis
docs/verification/ - Test scenarios and acceptance criteria
Search Strategy:
Use Grep to search for keywords across documentation:
# Search by feature keyword in design docs
grep -r "oauth\|authentication\|logto" docs/design/
grep -r "sync\|synchronization\|happy.*server" docs/design/
grep -r "messaging\|chat\|conversation" docs/design/
grep -r "terminal\|command\|shell" docs/design/
grep -r "zen\|boxes\|workspace" docs/design/
# If design docs don't have it, search implementation
grep -r "keyword" docs/implementation/
# Search across all docs as fallback
grep -r "keyword" docs/
Priority loading order:
docs/design/*.md first (especially core-user-experience-v2.md)docs/implementation/*.md for technical detailsdocs/research/*.md for background context if neededImportant: Use the Read tool to actually read the documents. Don't assume you know the content.
Before proceeding, present the loaded context to the user:
Template:
🔍 Context Loaded
I found and read these design documents:
- docs/design/core-user-experience-v2.md (Section: [relevant section])
- docs/implementation/[relevant-file].md
📋 Key Design Decisions:
- [Decision 1]
- [Decision 2]
- [Constraint or principle]
✅ Ready to proceed with this context in mind.
Only AFTER loading and summarizing the design context, proceed with the actual task.
Use this mapping to quickly identify which documents to read:
| User Mentions | Primary Documents to Load |
|---|---|
| OAuth, authentication, login, Logto, 登录, 认证 | design/core-user-experience-v2.md (Authentication section)implementation/logto-web-oauth-setup.mdresearch/authentication-system-analysis.md |
| Sync, synchronization, Happy Server, upstream, 同步 | design/architecture.md (Sync section)design/core-user-experience-v2.md (Sync section)research/authentication-system-analysis.md |
| Message, messaging, chat, conversation, inbox, 消息 | design/core-user-experience-v2.md (Messaging section)design/prd.md |
| Terminal, command, shell, CLI, 终端 | design/core-user-experience-v2.md (Terminal section)design/prd.md |
| Zen mode, boxes, workspace, session, 工作区 | design/core-user-experience-v2.md (Workspace section)design/prd.md |
| Architecture, system, components, modules, 架构 | design/architecture.mddesign/core-user-experience-v2.md |
| Product, features, requirements, vision, 产品 | design/prd.mddesign/white-paper.mddesign/core-user-experience-v2.md |
Tip: When in doubt, core-user-experience-v2.md is usually the best starting point as it covers most features.
If you cannot find relevant design documentation:
⚠️ Alert the user clearly:
⚠️ Design Context Missing
I couldn't find design documentation for [feature/topic].
This means:
- No documented design decisions exist yet
- Risk of misalignment with project vision
- May need to create design doc first
Options:
1. Create design document first (recommended) - use three-doc-method skill
2. Proceed with general project principles from CLAUDE.md
3. Ask you for design guidance
What would you like to do?
Do NOT proceed with implementation without explicit user approval
Suggest creating documentation first if this is a new feature
User: "实现 OAuth 登录的'记住我'功能"
Skill Response:
🔍 Context-First: Loading OAuth design context...
Found relevant documents:
- docs/design/core-user-experience-v2.md
- docs/implementation/logto-web-oauth-setup.md
Let me read these to understand the current OAuth design...
[After reading]
📋 Key Context:
- Current OAuth flow uses Logto with full-page redirect (not popup)
- Authentication state managed via Logto SDK hooks
- Design principle: "Zero Modification" - prefer Logto's built-in features
- User tokens stored in localStorage via Logto SDK
For "记住我" functionality, I should:
- Check if Logto SDK has built-in "remember me" support
- Maintain the full-page redirect flow
- Not modify upstream Logto code
Ready to proceed with implementation following these constraints.
User: "Happy Server 的同步机制是怎么设计的?"
Skill Response:
🔍 Context-First: Loading sync architecture context...
Reading:
- docs/design/architecture.md
- docs/design/core-user-experience-v2.md (Sync section)
[After reading]
📋 Sync Architecture Summary:
[Provides detailed summary from the design docs]
Does this answer your question? Would you like me to dive deeper into any aspect?
User: "添加语音通话功能"
Skill Response:
🔍 Context-First: Searching for voice call design...
⚠️ Design Context Missing
I searched docs/design/ and couldn't find design documentation for voice call functionality.
This is a significant new feature that needs design documentation first.
Recommendation: Use the `three-doc-method` skill to create:
- Design document (why voice calls, what's the UX)
- Implementation plan (how to build it)
- Verification document (how to test it)
Should I help you create these documents first?
Q: Skill activates too often / too rarely? A: Check the description triggers in the YAML frontmatter. Adjust keywords as needed.
Q: Can't find relevant documents?
A: Use find-docs.sh script or search more broadly with grep -r "keyword" docs/
Q: Found too many documents?
A: Prioritize docs/design/ and specifically core-user-experience-v2.md first.
Q: Documents are outdated? A: Alert the user and suggest updating docs before proceeding with the task.