beifeng724/personal-workbench-skills / skills/personal-workbench-builder
personal-workbench-builder
VerifiedBuild a durable personal or professional workbench as a runnable application, or produce a six-stage generic prompt pack for building it. Use when the user wants to turn a recurring workflow into a dashboard, management system, workspace, personal operating system, or long-lived website with multiple connected modules and persistent state. Trigger for project, CRM, creator, learning, family, finance, travel, teaching, legal, or team workbenches. Do not trigger for marketing sites, one-off scripts, ordinary coding tasks, or informational questions.
scripts/ui_design_intelligence/workbench_design.py
View on GitHub#!/usr/bin/env python3
"""Generate a requirement-driven workbench design system with UI UX Pro Max data."""
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
from core import AVAILABLE_STACKS, search, search_stack
DOMAINS = ("product", "style", "color", "typography", "ux", "icons", "chart")
EXCLUDED_FIELDS = re.compile(r"landing[ _-]*page|hero|aida|cta|marketing", re.I)
DOMAIN_HINTS = (
(r"律师|案件|法律|律所|legal|case", "legal case management client document deadline compliance"),
(r"学习|课程|学生|教师|考研|知识|learning|education", "education learning management course knowledge study planner"),
(r"团队|运营|人员|员工|公司|业务|team|operations", "team operations management tasks analytics workflow"),
(r"项目|任务|会议|product|project", "project task meeting product management workflow"),
(r"客户|销售|成交|crm|sales", "CRM sales pipeline customer follow-up reminders"),
(r"财务|收入|支出|资产|finance|cash", "financial dashboard income expense cash flow analytics"),
(r"家庭|育儿|习惯|生活|family|habit", "family life habit planning calendar tracker"),
(r"内容|自媒体|选题|素材|creator|content", "content creator editorial workflow asset planning analytics"),
(r"旅行|酒店|路线|travel", "travel itinerary budget document planning"),
)
COMPONENT_HINTS = (
(r"案件|客户|销售|人员|项目|case|crm|project", ("record table", "status pipeline", "detail drawer")),
(r"日程|会议|课程|计划|提醒|calendar|schedule", ("calendar", "timeline", "reminder queue")),
(r"笔记|知识|阅读|素材|note|knowledge|content", ("split-pane library", "editor", "tag filter")),
(r"财务|指标|分析|进度|analytics|finance", ("metric summary", "comparison chart", "auditable data table")),
)
GENERIC_FALLBACK = "productivity task management dashboard workflow responsive accessible"
def compact(rows: list[dict]) -> list[dict]:
return [
{key: value for key, value in row.items() if value not in (None, "") and not EXCLUDED_FIELDS.search(key)}
for row in rows
if not row.get("_error")
]
def expand_query(query: str) -> str:
hints = [hint for pattern, hint in DOMAIN_HINTS if re.search(pattern, query, re.I)]
if not hints:
hints.append(GENERIC_FALLBACK)
return " ".join((query, *hints, "dashboard workspace operational application"))
def domain_query(domain: str, expanded: str, tone: str) -> str:
suffixes = {
"product": "workflow management repeated tasks",
"style": f"application interface {tone} hierarchy",
"color": f"application semantic colors {tone} accessible contrast",
"typography": f"interface readable multilingual data {tone}",
"ux": "navigation forms feedback error empty loading accessibility responsive",
"icons": "navigation actions status outline icon system",
"chart": "progress comparison trend status operational data",
}
return f"{expanded} {suffixes[domain]}"
def find_results(domain: str, query: str, tone: str, count: int = 3) -> list[dict]:
rows = compact(search(domain_query(domain, query, tone), domain, count).get("results", []))
if rows:
return rows
return compact(search(domain_query(domain, GENERIC_FALLBACK, tone), domain, count).get("results", []))
def choose_components(query: str) -> list[str]:
components: list[str] = []
for pattern, matches in COMPONENT_HINTS:
if re.search(pattern, query, re.I):
components.extend(matches)
if not components:
components.extend(("task queue", "filterable records", "activity summary"))
return list(dict.fromkeys(components))
def build(args: argparse.Namespace) -> dict:
expanded = expand_query(args.query)
domains = {domain: find_results(domain, expanded, args.tone) for domain in DOMAINS}
stack_rows = compact(search_stack(
"layout responsive accessibility performance forms navigation empty error state", args.stack, 8
).get("results", []))
references = list(dict.fromkeys(args.reference or []))
architecture = {
"composition": "Center the repeated workflow and its next decision, not promotional content.",
"desktop_navigation": "compact sidebar" if args.density >= 7 else "task-oriented top navigation or sidebar",
"mobile_navigation": (
"bottom navigation or compact top navigation"
if args.mobile_priority == "high" else "drawer or compact top navigation"
),
"primary_components": choose_components(args.query),
"mobile_transformation": "Recompose priority actions and records for phone use; do not compress the desktop layout.",
}
return {
"design_method": "generated",
"brief": {
"project": args.project,
"product": args.query,
"audience": args.audience,
"technical_level": args.technical_level,
"tone": args.tone,
"formality": args.formality,
"mobile_priority": args.mobile_priority,
"stack": args.stack,
"expression": args.expression,
"motion": args.motion,
"density": args.density,
},
"reference_sources": references,
"reference_policy": "Explicit user references are authoritative; UI UX Pro Max recommendations fill only unspecified gaps.",
"fidelity_target": (
"Preserve the approved reference fingerprint while adapting it to the repeated workflow."
if references else "Create an original, domain-specific workbench composition from the confirmed brief."
),
"information_architecture": architecture,
"design_recommendations": domains,
"stack_guidance": stack_rows,
"interaction_states": ["empty", "loading", "error", "success", "permission-denied", "offline"],
"quality_contract": {
"themes": ["light", "dark", "system"],
"contrast": "4.5:1 normal text; 3:1 large text",
"touch_target": "44px minimum",
"focus": "Visible keyboard focus on every interactive control",
"motion": "Respect prefers-reduced-motion and use motion only for feedback",
"controls": "Every visible control must work; omit unavailable actions",
},
"excluded_patterns": [
"marketing hero sections",
"AIDA or CTA funnels",
"generic card grids without workflow meaning",
"decorative gradients, blobs, or dead controls",
],
"ui_confirmation_status": "awaiting-confirmation",
}
def summarize_row(row: dict) -> str:
return "; ".join(f"{key}: {value}" for key, value in list(row.items())[:6])
def render_markdown(system: dict) -> str:
brief = system["brief"]
architecture = system["information_architecture"]
lines = [
f"# {brief['project']} Design System", "", "## Confirmed Brief", "",
f"- Design method: {system['design_method']}",
f"- Product: {brief['product']}",
f"- Audience: {brief['audience']}",
f"- Communication level: {brief['technical_level']}",
f"- Tone / formality: {brief['tone']} / {brief['formality']}",
f"- Stack: {brief['stack']}",
f"- Mobile priority: {brief['mobile_priority']}",
f"- Expression / motion / density: {brief['expression']} / {brief['motion']} / {brief['density']}",
"", "## Reference Priority", "",
f"- Policy: {system['reference_policy']}",
f"- Fidelity target: {system['fidelity_target']}",
]
if system["reference_sources"]:
lines.extend(f"- Reference: {source}" for source in system["reference_sources"])
else:
lines.append("- References: none provided")
lines.extend([
"", "## Information Architecture", "",
f"- Composition: {architecture['composition']}",
f"- Desktop navigation: {architecture['desktop_navigation']}",
f"- Mobile navigation: {architecture['mobile_navigation']}",
f"- Primary components: {', '.join(architecture['primary_components'])}",
f"- Mobile transformation: {architecture['mobile_transformation']}",
])
for domain, rows in system["design_recommendations"].items():
lines.extend(["", f"## UI UX Pro Max: {domain.title()}", ""])
if rows:
lines.extend(f"- {summarize_row(row)}" for row in rows)
else:
lines.append("- No direct dataset match; use the confirmed brief and quality contract.")
lines.extend(["", "## Stack Guidance", ""])
lines.extend(f"- {summarize_row(row)}" for row in system["stack_guidance"])
lines.extend(["", "## Interaction And Quality", "", f"- Required states: {', '.join(system['interaction_states'])}"])
lines.extend(f"- {key}: {value}" for key, value in system["quality_contract"].items())
lines.extend(["", "## Excluded Patterns", ""])
lines.extend(f"- {value}" for value in system["excluded_patterns"])
lines.extend(["", "## Confirmation", "", f"- UI confirmation status: {system['ui_confirmation_status']}"])
return "\n".join(lines) + "\n"
def slugify(value: str, index: int) -> str:
slug = re.sub(r"[^a-z0-9]+", "-", value.lower()).strip("-")
return slug or f"page-{index}"
def write_page_overrides(target: Path, pages: list[str]) -> None:
for index, value in enumerate(pages, start=1):
name, separator, focus = value.partition(":")
if not separator:
focus = "Inherit MASTER.md and adapt the composition to this page's repeated task."
content = "\n".join((
f"# {name.strip()} UI Override", "", "- Inherits: ../MASTER.md",
f"- Page focus: {focus.strip()}",
"- Keep the shared tokens, interaction states, accessibility contract, and reference priority.",
"- Record only genuine page-level differences; do not create a disconnected visual language.", "",
))
(target / "pages" / f"{slugify(name, index)}.md").write_text(content, encoding="utf-8")
def main() -> None:
parser = argparse.ArgumentParser(description="Generate a workbench-focused UI UX Pro Max design system")
parser.add_argument("query")
parser.add_argument("--project", "-p", default="Personal Workbench")
parser.add_argument("--audience", default="Primary workbench user")
parser.add_argument("--technical-level", choices=("plain", "guided", "technical"), default="guided")
parser.add_argument("--tone", default="clear, calm, task-focused")
parser.add_argument("--formality", choices=("casual", "balanced", "formal"), default="balanced")
parser.add_argument("--mobile-priority", choices=("low", "medium", "high"), default="medium")
parser.add_argument("--reference", action="append", default=[])
parser.add_argument("--page", action="append", default=[])
parser.add_argument("--stack", choices=tuple(AVAILABLE_STACKS), default="html-tailwind")
parser.add_argument("--expression", type=int, choices=range(1, 11), default=6)
parser.add_argument("--motion", type=int, choices=range(1, 11), default=3)
parser.add_argument("--density", type=int, choices=range(1, 11), default=6)
parser.add_argument("--json", action="store_true")
parser.add_argument("--persist", action="store_true")
parser.add_argument("--output-dir")
args = parser.parse_args()
system = build(args)
markdown = render_markdown(system)
if args.persist:
if not args.output_dir:
parser.error("--output-dir is required with --persist")
target = Path(args.output_dir).resolve() / "design-system"
(target / "pages").mkdir(parents=True, exist_ok=True)
(target / "MASTER.md").write_text(markdown, encoding="utf-8")
(target / "system.json").write_text(
json.dumps(system, ensure_ascii=False, indent=2) + "\n", encoding="utf-8"
)
write_page_overrides(target, args.page)
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
print(json.dumps(system, ensure_ascii=False, indent=2) if args.json else markdown)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |