vibecodeagent 0.0.0-stage → 0.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/THIRD-PARTY-NOTICES.txt +1427 -0
  4. package/dist/agen.js +138895 -0
  5. package/dist/bin.js +1245 -0
  6. package/dist/daemon.js +163664 -0
  7. package/dist/node_modules/node-ensure/index.js +10 -0
  8. package/dist/node_modules/node-ensure/package.json +31 -0
  9. package/dist/node_modules/pdf-parse/lib/pdf-parse.js +102 -0
  10. package/dist/node_modules/pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js +18538 -0
  11. package/dist/node_modules/pdf-parse/lib/pdf.js/v1.10.100/build/pdf.worker.js +45507 -0
  12. package/dist/node_modules/pdf-parse/package.json +49 -0
  13. package/dist/node_modules/sql.js/dist/sql-wasm.js +186 -0
  14. package/dist/node_modules/sql.js/dist/sql-wasm.wasm +0 -0
  15. package/dist/node_modules/sql.js/package.json +58 -0
  16. package/dist/resources/skills/builtin/.gitkeep +0 -0
  17. package/dist/resources/skills/builtin/NOTICE.md +35 -0
  18. package/dist/resources/skills/builtin/README.md +74 -0
  19. package/dist/resources/skills/builtin/backend-engineering/SKILL.md +102 -0
  20. package/dist/resources/skills/builtin/backend-engineering/references/api-contracts.md +320 -0
  21. package/dist/resources/skills/builtin/backend-engineering/references/auth-and-secrets.md +268 -0
  22. package/dist/resources/skills/builtin/backend-engineering/references/concurrency-and-jobs.md +386 -0
  23. package/dist/resources/skills/builtin/backend-engineering/references/data-modelling.md +367 -0
  24. package/dist/resources/skills/builtin/backend-engineering/references/deploy-and-config.md +228 -0
  25. package/dist/resources/skills/builtin/backend-engineering/references/migrations.md +320 -0
  26. package/dist/resources/skills/builtin/backend-engineering/references/observability.md +301 -0
  27. package/dist/resources/skills/builtin/backend-engineering/references/plan-template.md +152 -0
  28. package/dist/resources/skills/builtin/backend-engineering/references/review-audit.md +213 -0
  29. package/dist/resources/skills/builtin/backend-engineering/references/security.md +251 -0
  30. package/dist/resources/skills/builtin/backend-engineering/references/stack-go.md +238 -0
  31. package/dist/resources/skills/builtin/backend-engineering/references/stack-node.md +274 -0
  32. package/dist/resources/skills/builtin/backend-engineering/references/stack-python.md +296 -0
  33. package/dist/resources/skills/builtin/backend-engineering/references/testing-and-perf.md +298 -0
  34. package/dist/resources/skills/builtin/backend-engineering/references/validation-and-errors.md +266 -0
  35. package/dist/resources/skills/builtin/dasar-vibecode/SKILL.md +312 -0
  36. package/dist/resources/skills/builtin/excel-maker/SKILL.md +71 -0
  37. package/dist/resources/skills/builtin/frontend-design/SKILL.md +131 -0
  38. package/dist/resources/skills/builtin/frontend-design/data/app-interface.csv +33 -0
  39. package/dist/resources/skills/builtin/frontend-design/data/catalog-summary.json +78 -0
  40. package/dist/resources/skills/builtin/frontend-design/data/charts.csv +26 -0
  41. package/dist/resources/skills/builtin/frontend-design/data/colors.csv +193 -0
  42. package/dist/resources/skills/builtin/frontend-design/data/data-provenance.json +1348 -0
  43. package/dist/resources/skills/builtin/frontend-design/data/google-font-licenses.json +20185 -0
  44. package/dist/resources/skills/builtin/frontend-design/data/google-fonts.csv +1935 -0
  45. package/dist/resources/skills/builtin/frontend-design/data/icons.csv +106 -0
  46. package/dist/resources/skills/builtin/frontend-design/data/landing.csv +35 -0
  47. package/dist/resources/skills/builtin/frontend-design/data/motion.csv +18 -0
  48. package/dist/resources/skills/builtin/frontend-design/data/phosphor-icons-upstream.json +32582 -0
  49. package/dist/resources/skills/builtin/frontend-design/data/products.csv +193 -0
  50. package/dist/resources/skills/builtin/frontend-design/data/react-performance.csv +45 -0
  51. package/dist/resources/skills/builtin/frontend-design/data/stacks/angular.csv +51 -0
  52. package/dist/resources/skills/builtin/frontend-design/data/stacks/astro.csv +54 -0
  53. package/dist/resources/skills/builtin/frontend-design/data/stacks/avalonia.csv +57 -0
  54. package/dist/resources/skills/builtin/frontend-design/data/stacks/flutter.csv +53 -0
  55. package/dist/resources/skills/builtin/frontend-design/data/stacks/html-tailwind.csv +60 -0
  56. package/dist/resources/skills/builtin/frontend-design/data/stacks/javafx.csv +76 -0
  57. package/dist/resources/skills/builtin/frontend-design/data/stacks/jetpack-compose.csv +53 -0
  58. package/dist/resources/skills/builtin/frontend-design/data/stacks/laravel.csv +51 -0
  59. package/dist/resources/skills/builtin/frontend-design/data/stacks/nextjs.csv +62 -0
  60. package/dist/resources/skills/builtin/frontend-design/data/stacks/nuxt-ui.csv +71 -0
  61. package/dist/resources/skills/builtin/frontend-design/data/stacks/nuxtjs.csv +68 -0
  62. package/dist/resources/skills/builtin/frontend-design/data/stacks/react-native.csv +52 -0
  63. package/dist/resources/skills/builtin/frontend-design/data/stacks/react.csv +62 -0
  64. package/dist/resources/skills/builtin/frontend-design/data/stacks/shadcn.csv +69 -0
  65. package/dist/resources/skills/builtin/frontend-design/data/stacks/svelte.csv +56 -0
  66. package/dist/resources/skills/builtin/frontend-design/data/stacks/swiftui.csv +51 -0
  67. package/dist/resources/skills/builtin/frontend-design/data/stacks/threejs.csv +54 -0
  68. package/dist/resources/skills/builtin/frontend-design/data/stacks/uno.csv +60 -0
  69. package/dist/resources/skills/builtin/frontend-design/data/stacks/uwp.csv +56 -0
  70. package/dist/resources/skills/builtin/frontend-design/data/stacks/vue.csv +50 -0
  71. package/dist/resources/skills/builtin/frontend-design/data/stacks/winui.csv +60 -0
  72. package/dist/resources/skills/builtin/frontend-design/data/stacks/wpf.csv +57 -0
  73. package/dist/resources/skills/builtin/frontend-design/data/styles.csv +89 -0
  74. package/dist/resources/skills/builtin/frontend-design/data/typography.csv +75 -0
  75. package/dist/resources/skills/builtin/frontend-design/data/ui-reasoning.csv +193 -0
  76. package/dist/resources/skills/builtin/frontend-design/data/ux-guidelines.csv +120 -0
  77. package/dist/resources/skills/builtin/frontend-design/references/animation-patterns.md +705 -0
  78. package/dist/resources/skills/builtin/frontend-design/references/app-polish.md +117 -0
  79. package/dist/resources/skills/builtin/frontend-design/references/apple-fluid.md +278 -0
  80. package/dist/resources/skills/builtin/frontend-design/references/art-direction.md +280 -0
  81. package/dist/resources/skills/builtin/frontend-design/references/case-studies.md +599 -0
  82. package/dist/resources/skills/builtin/frontend-design/references/craft.md +128 -0
  83. package/dist/resources/skills/builtin/frontend-design/references/expo.md +251 -0
  84. package/dist/resources/skills/builtin/frontend-design/references/layout-systems.md +533 -0
  85. package/dist/resources/skills/builtin/frontend-design/references/libraries.md +72 -0
  86. package/dist/resources/skills/builtin/frontend-design/references/motion.md +222 -0
  87. package/dist/resources/skills/builtin/frontend-design/references/picker.md +197 -0
  88. package/dist/resources/skills/builtin/frontend-design/references/plan-template.md +73 -0
  89. package/dist/resources/skills/builtin/frontend-design/references/prototype.md +85 -0
  90. package/dist/resources/skills/builtin/frontend-design/references/recipes-expo.md +385 -0
  91. package/dist/resources/skills/builtin/frontend-design/references/recipes-web.md +421 -0
  92. package/dist/resources/skills/builtin/frontend-design/references/review-audit.md +107 -0
  93. package/dist/resources/skills/builtin/frontend-design/references/sonner.md +143 -0
  94. package/dist/resources/skills/builtin/frontend-design/references/technical-stack.md +543 -0
  95. package/dist/resources/skills/builtin/frontend-design/references/theming.md +60 -0
  96. package/dist/resources/skills/builtin/frontend-design/references/typography.md +393 -0
  97. package/dist/resources/skills/builtin/frontend-design/references/ux-rules.md +256 -0
  98. package/dist/resources/skills/builtin/frontend-design/references/vocabulary.md +169 -0
  99. package/dist/resources/skills/builtin/frontend-design/scripts/core.py +993 -0
  100. package/dist/resources/skills/builtin/frontend-design/scripts/design_system.py +1643 -0
  101. package/dist/resources/skills/builtin/frontend-design/scripts/reasoning_contract.py +123 -0
  102. package/dist/resources/skills/builtin/frontend-design/scripts/search.py +171 -0
  103. package/dist/resources/skills/builtin/frontend-design/scripts/validate_data.py +1091 -0
  104. package/dist/resources/skills/builtin/kerja-agentik/SKILL.md +117 -0
  105. package/dist/resources/skills/builtin/pdf-maker/SKILL.md +51 -0
  106. package/dist/resources/skills/builtin/tinjau-keamanan/SKILL.md +53 -0
  107. package/dist/resources/skills/builtin/word-maker/SKILL.md +58 -0
  108. package/dist/resources/skills/builtin/write-swift/SKILL.md +388 -0
  109. package/package.json +35 -4
@@ -0,0 +1,123 @@
1
+ #!/usr/bin/env python3
2
+ """Closed, non-executable grammar for design-system decision rules."""
3
+
4
+ import json
5
+ import re
6
+
7
+ CONDITION_SIGNALS = {
8
+ "if_booking": ("booking", "appointment", "calendar"),
9
+ "if_boutique": ("boutique",),
10
+ "if_casual": ("casual", "playful"),
11
+ "if_checkout": ("checkout", "payment", "purchase"),
12
+ "if_children": ("child", "children", "kids"),
13
+ "if_collaboration": ("collaboration", "multiplayer", "co-edit"),
14
+ "if_competitive": ("competitive", "leaderboard"),
15
+ "if_content_focused": ("content", "article", "reading", "documentation"),
16
+ "if_conversion_focused": ("conversion", "sales", "signup", "purchase"),
17
+ "if_creative_field": ("creative", "artist", "portfolio"),
18
+ "if_crop_focused": ("crop", "farm", "agriculture"),
19
+ "if_dashboard": ("dashboard", "operations", "monitoring"),
20
+ "if_data_heavy": ("data heavy", "data-heavy", "analytics", "large dataset"),
21
+ "if_delivery": ("delivery", "courier", "shipping"),
22
+ "if_discovery_focused": ("discover", "discovery", "browse", "directory"),
23
+ "if_engagement_metric": ("engagement", "retention", "contribution"),
24
+ "if_experience_focused": ("experience", "immersive", "journey"),
25
+ "if_gamification": ("gamification", "badges", "streak"),
26
+ "if_health": ("health", "medical", "patient"),
27
+ "if_hero_needed": ("hero", "showcase", "launch"),
28
+ "if_large_dataset": ("large dataset", "thousands", "millions"),
29
+ "if_light_mode_needed": ("light mode", "light theme"),
30
+ "if_low_performance": ("low performance", "low-end", "slow device"),
31
+ "if_luxury": ("luxury", "premium", "high-end"),
32
+ "if_medication": ("medication", "medicine", "prescription"),
33
+ "if_meditation": ("meditation", "breathing", "mindfulness"),
34
+ "if_minimal_portfolio": ("minimal portfolio", "simple portfolio"),
35
+ "if_mobile": ("mobile", "phone", "tablet", "ios", "android"),
36
+ "if_personalized": ("personalized", "personalised", "recommendation"),
37
+ "if_pre_launch": ("pre-launch", "prelaunch", "coming soon", "waitlist"),
38
+ "if_salary_focused": ("salary", "compensation", "pay range"),
39
+ "if_team_collaboration": ("team collaboration", "team workspace"),
40
+ "if_trust_needed": ("trust", "secure", "verified", "authority"),
41
+ "if_ux_focused": ("ux", "usability", "accessibility", "accessible"),
42
+ "if_video_ready": ("video ready", "product video", "demo video"),
43
+ }
44
+
45
+ ALLOWED_CONDITIONS = {"must_have", *CONDITION_SIGNALS}
46
+ ACTION_PREFIXES = {"constraint", "style", "pattern", "mode"}
47
+ TOKEN_ACTION_PREFIXES = {"constraint", "style"}
48
+ TOKEN_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
49
+ CONDITION_PATTERNS = {
50
+ condition: tuple(
51
+ re.compile(r"(?<!\w)" + re.escape(signal) + r"(?!\w)")
52
+ for signal in signals
53
+ )
54
+ for condition, signals in CONDITION_SIGNALS.items()
55
+ }
56
+
57
+
58
+ def _object_without_duplicates(pairs):
59
+ result = {}
60
+ for key, value in pairs:
61
+ if key in result:
62
+ raise ValueError("duplicate decision-rule key: {}".format(key))
63
+ result[key] = value
64
+ return result
65
+
66
+
67
+ def parse_decision_rules(raw):
68
+ """Parse the canonical condition -> action-array representation."""
69
+ try:
70
+ rules = json.loads(raw or "{}", object_pairs_hook=_object_without_duplicates)
71
+ except json.JSONDecodeError as error:
72
+ raise ValueError("invalid decision-rule JSON: {}".format(error)) from error
73
+ if not isinstance(rules, dict):
74
+ raise ValueError("decision rules must be a JSON object")
75
+ for condition, actions in rules.items():
76
+ if condition not in ALLOWED_CONDITIONS:
77
+ raise ValueError("unknown decision-rule condition: {}".format(condition))
78
+ if not isinstance(actions, list) or not actions:
79
+ raise ValueError("{} must map to a non-empty action array".format(condition))
80
+ for action in actions:
81
+ _validate_action(action)
82
+ if len(actions) != len(set(actions)):
83
+ raise ValueError("{} contains duplicate actions".format(condition))
84
+ return rules
85
+
86
+
87
+ def _validate_action(action):
88
+ if not isinstance(action, str) or ":" not in action:
89
+ raise ValueError("action must use a known prefix: {}".format(action))
90
+ prefix, value = action.split(":", 1)
91
+ if prefix not in ACTION_PREFIXES:
92
+ raise ValueError("unknown decision-rule action: {}".format(action))
93
+ if prefix in TOKEN_ACTION_PREFIXES and not TOKEN_RE.fullmatch(value):
94
+ raise ValueError("invalid {} action value: {}".format(prefix, value))
95
+ if prefix == "pattern" and not value.strip():
96
+ raise ValueError("pattern action must name a pattern")
97
+ if prefix == "mode" and value not in {"dark", "light"}:
98
+ raise ValueError("mode action must be dark or light")
99
+
100
+
101
+ def apply_decision_rules(rules, query):
102
+ """Return deterministic mutations and an audit trail; never execute data."""
103
+ normalized = str(query or "").casefold()
104
+ result = {"activated": [], "style_ids": [], "constraints": [],
105
+ "pattern": None, "mode": None}
106
+ for condition, actions in rules.items():
107
+ active = condition == "must_have" or any(
108
+ pattern.search(normalized)
109
+ for pattern in CONDITION_PATTERNS.get(condition, ()))
110
+ if not active:
111
+ continue
112
+ result["activated"].append({"condition": condition, "actions": list(actions)})
113
+ for action in actions:
114
+ prefix, value = action.split(":", 1)
115
+ if prefix == "style" and value not in result["style_ids"]:
116
+ result["style_ids"].append(value)
117
+ elif prefix == "constraint" and value not in result["constraints"]:
118
+ result["constraints"].append(value)
119
+ elif prefix == "pattern":
120
+ result["pattern"] = value
121
+ elif prefix == "mode":
122
+ result["mode"] = value
123
+ return result
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ UI/UX Pro Max Search - BM25 search engine for UI/UX style guides
5
+ Usage: python search.py "<query>" [--domain <domain>] [--stack <stack>] [--max-results 3]
6
+ python search.py "<query>" --design-system [-p "Project Name"]
7
+ python search.py "<query>" --design-system --persist [-p "Project Name"] --output-dir "<project-root>" [--page "dashboard"]
8
+ python search.py "<query>" --design-system --variance 8 --motion 9 --density 7
9
+
10
+ Domains: style, color, chart, landing, product, ux, typography, google-fonts, icons, gsap, react, web
11
+ Stacks: react, nextjs, vue, svelte, astro, swiftui, react-native, flutter, nuxtjs, nuxt-ui,
12
+ html-tailwind, shadcn, jetpack-compose, threejs, angular, laravel
13
+
14
+ Design dials (1-10, only with --design-system):
15
+ --variance DESIGN_VARIANCE: 1=centered/minimal, 10=bold/asymmetric
16
+ --motion MOTION_INTENSITY: 1=subtle, 10=complex; attaches a GSAP snippet from motion.csv
17
+ --density VISUAL_DENSITY: 1=spacious, 10=dense/dashboard; overrides the spacing scale
18
+
19
+ Persistence (Master + Overrides pattern):
20
+ --persist Save design system to design-system/<project-slug>/MASTER.md
21
+ --output-dir Directory the design-system/ folder is created under (defaults to cwd --
22
+ always pass this explicitly, pointed at the project root)
23
+ --page Also create a page-specific override file in design-system/<project-slug>/pages/
24
+ --force Overwrite an existing MASTER.md (without this, persistence is skipped
25
+ if MASTER.md already exists, so prior design decisions aren't lost)
26
+ """
27
+
28
+ import argparse
29
+ import json as json_module
30
+ import sys
31
+ import io
32
+ from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, UNTRUNCATED_COLS, search, search_stack
33
+ from design_system import generate_design_system
34
+
35
+ # Force UTF-8 for stdout/stderr to handle emojis on Windows (cp1252 default)
36
+ if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
37
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
38
+ if sys.stderr.encoding and sys.stderr.encoding.lower() != 'utf-8':
39
+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
40
+
41
+ TRUNCATE_AT = 300
42
+
43
+
44
+ def format_output(result, full=False):
45
+ """Format results for Claude consumption (token-optimized)"""
46
+ if "error" in result:
47
+ return f"Error: {result['error']}"
48
+
49
+ output = []
50
+ if result.get("stack"):
51
+ output.append("## UI Pro Max Stack Guidelines")
52
+ output.append(f"**Stack:** {result['stack']} | **Query:** {result['query']}")
53
+ else:
54
+ output.append("## UI Pro Max Search Results")
55
+ domain_note = result['domain']
56
+ if result.get("auto_detected"):
57
+ domain_note += " (auto-detected"
58
+ if result.get("runner_up_domain"):
59
+ domain_note += f", runner-up: {result['runner_up_domain']}"
60
+ domain_note += ")"
61
+ output.append(f"**Domain:** {domain_note} | **Query:** {result['query']}")
62
+ output.append(f"**Source:** {result['file']} | **Found:** {result['count']} results\n")
63
+
64
+ if result['count'] == 0:
65
+ redirect = result.get("redirect")
66
+ if redirect:
67
+ output.append(
68
+ "This legacy style label is now modeled in the "
69
+ f"`{redirect['domain']}` domain as `{redirect['id']}`. "
70
+ "Search that domain instead of treating a page composition as a visual style."
71
+ )
72
+ return "\n".join(output)
73
+ output.append(
74
+ "No matches. This is not a match with an empty value -- the query "
75
+ "did not hit the database. Retry with broader/different keywords "
76
+ "before falling back to general defaults, and say explicitly that "
77
+ "no database match was found if you do fall back."
78
+ )
79
+ suggestions = result.get("suggestions") or []
80
+ if suggestions:
81
+ output.append(f"**Closest known terms:** {', '.join(suggestions)}")
82
+ return "\n".join(output)
83
+
84
+ for i, row in enumerate(result['results'], 1):
85
+ output.append(f"### Result {i}")
86
+ for key, value in row.items():
87
+ value_str = str(value)
88
+ if not full and key not in UNTRUNCATED_COLS and len(value_str) > TRUNCATE_AT:
89
+ value_str = value_str[:TRUNCATE_AT] + "..."
90
+ output.append(f"- **{key}:** {value_str}")
91
+ output.append("")
92
+
93
+ return "\n".join(output)
94
+
95
+
96
+ if __name__ == "__main__":
97
+ parser = argparse.ArgumentParser(description="UI Pro Max Search")
98
+ parser.add_argument("query", help="Search query")
99
+ parser.add_argument("--domain", "-d", choices=list(CSV_CONFIG.keys()), help="Search domain")
100
+ parser.add_argument("--stack", "-s", choices=AVAILABLE_STACKS, help=f"Stack-specific search. Available: {', '.join(AVAILABLE_STACKS)}")
101
+ parser.add_argument("--max-results", "-n", type=int, choices=range(1, 21), default=MAX_RESULTS,
102
+ metavar="1-20", help="Max results (default: 3)")
103
+ parser.add_argument("--json", action="store_true", help="Output as JSON")
104
+ parser.add_argument("--full", action="store_true", help="Do not truncate long field values in text output")
105
+ # Design system generation
106
+ parser.add_argument("--design-system", "-ds", action="store_true", help="Generate complete design system recommendation")
107
+ parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name for design system output")
108
+ parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format for design system (ignored if --json)")
109
+ # Persistence (Master + Overrides pattern)
110
+ parser.add_argument("--persist", action="store_true", help="Save design system to design-system/<project-slug>/MASTER.md (creates hierarchical structure)")
111
+ parser.add_argument("--page", type=str, default=None, help="Create page-specific override file in design-system/<project-slug>/pages/")
112
+ parser.add_argument("--output-dir", "-o", type=str, default=None, help="Output directory for persisted files (default: current directory -- pass this explicitly, pointed at the project root)")
113
+ parser.add_argument("--force", action="store_true", help="Overwrite an existing MASTER.md when persisting (default: skip if it already exists)")
114
+ # Design dials (1-10), only applied with --design-system
115
+ parser.add_argument("--variance", type=int, choices=range(1, 11), metavar="1-10", help="DESIGN_VARIANCE dial: 1=centered/minimal, 10=bold/asymmetric (only with --design-system)")
116
+ parser.add_argument("--motion", type=int, choices=range(1, 11), metavar="1-10", help="MOTION_INTENSITY dial: 1=subtle, 10=complex; pulls a matching GSAP snippet from motion.csv (only with --design-system)")
117
+ parser.add_argument("--density", type=int, choices=range(1, 11), metavar="1-10", help="VISUAL_DENSITY dial: 1=spacious, 10=dense/dashboard; overrides the spacing scale (only with --design-system)")
118
+
119
+ args = parser.parse_args()
120
+
121
+ # Design system takes priority
122
+ if args.design_system:
123
+ result = generate_design_system(
124
+ args.query,
125
+ args.project_name,
126
+ args.format,
127
+ persist=args.persist,
128
+ page=args.page,
129
+ output_dir=args.output_dir,
130
+ variance=args.variance,
131
+ motion=args.motion,
132
+ density=args.density,
133
+ force=args.force,
134
+ )
135
+
136
+ if args.json:
137
+ print(json_module.dumps(
138
+ {"design_system": result["design_system"], "persistence": result["persistence"]},
139
+ indent=2, ensure_ascii=False,
140
+ ))
141
+ else:
142
+ print(result["text"])
143
+
144
+ if args.persist:
145
+ persistence = result["persistence"] or {}
146
+ print("\n" + "=" * 60)
147
+ if persistence.get("status") == "skipped_exists":
148
+ print(f"⚠️ {persistence.get('message', 'MASTER.md already exists; not overwritten.')}")
149
+ else:
150
+ ds_dir = persistence.get("design_system_dir", "design-system/<project>")
151
+ print(f"✅ Design system persisted to {ds_dir}/")
152
+ for f in persistence.get("created_files", []):
153
+ print(f" 📄 {f}")
154
+ print("")
155
+ print(f"📖 Usage: When building a page, check {ds_dir}/pages/[page].md first.")
156
+ print(" If it exists, its rules override MASTER.md. Otherwise, use MASTER.md.")
157
+ print("=" * 60)
158
+ # Stack search
159
+ elif args.stack:
160
+ result = search_stack(args.query, args.stack, args.max_results)
161
+ if args.json:
162
+ print(json_module.dumps(result, indent=2, ensure_ascii=False))
163
+ else:
164
+ print(format_output(result, full=args.full))
165
+ # Domain search
166
+ else:
167
+ result = search(args.query, args.domain, args.max_results)
168
+ if args.json:
169
+ print(json_module.dumps(result, indent=2, ensure_ascii=False))
170
+ else:
171
+ print(format_output(result, full=args.full))