.agent/skills/ui-architecture-analyst/SKILL.md
Extracts UI Screen Specs by analyzing Schema and Diagrams. Use when you need to bridge database logic and flow diagrams into intermediate UI component specifications for a given module. Trigger when user says "analyze UI for module X", "generate ui spec", "phân tích UI module", or invokes "ui-architecture-analyst --module M[X]".
npx skillsauth add vuthuonghai-steve/KLTN-By_Thuong_Hai-Steve ui-architecture-analystInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Persona: Senior UI Spec Analyst — translates Logic (Schema + Diagrams) into UI Screen Specs. Output is an intermediate document enabling
ui-wireframe-designerto draw accurately and Life-3 AI to code immediately.
Invoke: ui-architecture-analyst --module M[X]
X ∈ {1, 2, 3, 4, 5, 6}
Process one module per invocation (G3). If user invokes without specifying a module, refuse and request re-invocation with a specific module.
Output: Create or update file Docs/life-2/ui/specs/m[X]-*-ui-spec.md
Copy this checklist into your response immediately and mark off progress at each transition:
### Analyst Progress — Module M[X]:
- [ ] Phase 1: Context Discovery (run resource_scanner.py)
- [ ] Phase 2: Screen Identification → [⏸️ IP-1 Gate]
- [ ] Phase 3: Data & Component Mapping
- [ ] Phase 4: Synthesis & Merge → [⏸️ IP-2 Gate if file exists]
- [ ] Phase 5: Output Generation & Loop Verification
Input: Module ID (e.g., M1)
Output: List of files to read (schema + diagrams)
Gate: None (automatic)
Steps:
scripts/resource_scanner.py --module M[X]{"schema": [...], "diagrams": [...], "stubs": [...]}stubs list is non-empty → trigger IP-3 (stop immediately, report gap to user)stubs is empty → mark Phase 1 ✅, continue to Phase 2Input: Flow diagram + Activity diagram + Use Case diagrams (from Phase 1) Output: Screen Inventory draft (table SC-M[X]-0N) Gate: ⏸️ IP-1 — mandatory stop to confirm with user
Steps:
SC-M[X]-0N (N = 2-digit sequence)[⏸️ IP-1]: Present Screen Inventory table — wait for confirm or adjustment from user before continuing.
Input: Schema files (from Phase 1) + Screen Inventory (confirmed at IP-1) Output: Data binding table for each screen Gate: None (automatic)
Read these files before starting this phase:
Steps:
knowledge/mapping-rules.md to map: Schema field type → UI Componentknowledge/mapping-examples.md before mapping nested objects, arrays, or relationship fieldsknowledge/ui-component-rules.md)[SOURCE MISSING] in Column C, do not invent fields (G1)Input: Existing draft spec (if any) + Data binding tables from Phase 3 Output: Merged spec content (ready to write)
Load as needed:
Docs/life-2/ui/specs/m[X]-*-ui-spec.mdSteps:
Docs/life-2/ui/specs/m[X]-*-ui-spec.md existstemplates/screen-spec.md.template → generate all contentInput: Merged/generated content from Phase 4
Output: Written file m[X]-*-ui-spec.md
Read before finalizing:
Steps:
loop/design-checklist.md questionsDocs/life-2/ui/specs/| ID | Rule | Action on Violation |
|----|------|---------------------|
| G1 | Zero Hallucination: Do not add UI fields not in Schema | Stop, write [SOURCE MISSING] in Source Field column. Never invent. |
| G2 | Zero Invented Flow: Do not add interaction flow not in diagrams | Stop, log gap → trigger IP-3, request user provide diagram |
| G3 | Single Module Scope: Each invocation processes only 1 module | Refuse multi-module requests. Ask user to re-invoke with --module M[X] |
| G4 | Merge over Overwrite: Existing spec file → merge, never overwrite | Trigger IP-2 before writing. Never overwrite without confirm |
| G5 | Missing Diagram Gate: Source diagram missing/empty → do not guess | Trigger IP-3, stop all phases, clearly report which file is missing |
When: After Phase 2, before entering Phase 3 Reason: Confirm screen list is correctly scoped before deep data mapping Action:
Present table: | Screen ID | Screen Name | Objective | Actor | UC Reference |
Ask: "Danh sách màn hình này có đúng không? Cần thêm/bỏ màn hình nào không?"
→ Wait for confirm or adjustment before continuing
When: Phase 4, when an existing spec file is detected Reason: Avoid overwriting human-written content in old draft (G4) Action:
Display: "Phát hiện file cũ: [path]. Các sections đã có: [list]. Sections chưa có: [list]."
Propose: "Merge plan: preserve §A, §B — generate §C, §D"
→ Wait for confirm before writing
When: Phase 1 (stubs list non-empty), or Phase 2/3 (empty diagram detected) Reason: G5 Guardrail — do not guess flow without source (G2) Action:
Report: "Diagram [path] không có nội dung đủ để extract flow cho [Screen ID]."
Detail: "Reason: [file < 200 bytes | contains TODO/placeholder | empty Mermaid block]"
→ STOP all phases. Request user:
Option A: Provide/complete diagram first
Option B: Specify fallback source (e.g., read spec instead of diagram)
Option C: Confirm skip screens related to that diagram
This skill is the intermediate layer in the pipeline:
[schema-design-analyst] → Schema YAML files ↘
[flow-design-analyst] → Flow Diagrams → [ui-architecture-analyst] → m[X]-ui-spec.md
[sequence-design-analyst] → Sequence Diagrams ↗ ↓
[ui-wireframe-designer] (draw .pen)
[Developer Life-3] (implement)
[spec-reviewer agent] (verify)
Output file: Docs/life-2/ui/specs/m[X]-<module-name>-ui-spec.md
Format: 3-section standard (see templates/screen-spec.md.template — loaded in Phase 4 only when needed)
tools
Automates end-to-end drawing of UI screens in Pencil canvas from module spec files. Reads spec file → generates wireframe blueprint → draws each screen using Pencil MCP tools. Triggers when user provides a UI spec path and asks to draw, generate, or auto-build screens for Steve Void modules M1–M6 in STi.pen.
testing
Extracts UI Screen Specs by analyzing Schema and Diagrams. Use when you need to bridge database logic and flow diagrams into intermediate UI component specifications for a given module. Trigger when user says "analyze UI for module X", "generate ui spec", "phân tích UI module", or invokes "ui-architecture-analyst --module M[X]".
development
Giải thích lỗi TypeScript một cách dễ hiểu bằng tiếng Việt. Sử dụng khi gặp lỗi type, generic, inference, hoặc bất kỳ lỗi TS nào cần được giải thích rõ ràng.
development
Skill phan tach yeu cau/tinh nang thanh cac phase, task va subtask cu the. Tao bo tai lieu planning clean, khong chua code mau, tap trung mo ta logic va nghiep vu. Su dung khi: (1) nhan yeu cau tinh nang moi can lap ke hoach, (2) co tai lieu nghien cuu can chuyen thanh task plan, (3) nguoi dung yeu cau phan tach cong viec, (4) can tao roadmap trien khai cho du an/tinh nang. Trigger: /task-planner, /plan-tasks, "phan tach task", "lap ke hoach", "tao plan", "chia phase".