@colin4k1024/tsp 2.4.1 → 2.4.3

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 (216) hide show
  1. package/README.md +13 -6
  2. package/docs/.vitepress/config.mts +199 -0
  3. package/docs/adr/ADR-001-doc-architecture-integration.md +33 -0
  4. package/docs/guides/README.md +5 -0
  5. package/docs/guides/installation.md +33 -0
  6. package/docs/guides/user-guide.md +36 -0
  7. package/docs/index.md +65 -0
  8. package/docs/memory/backlog.md +10 -0
  9. package/docs/memory/decisions.md +43 -0
  10. package/docs/memory/lessons-learned.md +87 -0
  11. package/docs/plans/2026-04-03-python-remnants-audit.md +265 -0
  12. package/docs/plans/2026-04-03-scripts-python-to-js-migration.md +372 -0
  13. package/docs/plans/2026-04-03-solo-delivery-execution-checklist.md +413 -0
  14. package/docs/plans/2026-04-03-solo-delivery-gap-plan.md +377 -0
  15. package/docs/plans/2026-04-03-team-skills-workflow-gates.md +548 -0
  16. package/docs/plans/2026-04-21-open-source-readiness-gap-plan.md +217 -0
  17. package/docs/plans/llm-surface-reduction-audit.md +147 -0
  18. package/docs/plans/llm-surface-reduction-execution-checklist.md +217 -0
  19. package/docs/plans/llm-surface-reduction-execution-history.md +124 -0
  20. package/docs/plans/team-skills-platform-migration.md +54 -0
  21. package/docs/presentation/README.md +42 -0
  22. package/docs/presentation/audience-presentation-route-map.md +84 -0
  23. package/docs/presentation/executive-briefing-talk-track.md +50 -0
  24. package/docs/presentation/generate_capability_matrix.py +396 -0
  25. package/docs/presentation/generate_ppt.py +354 -0
  26. package/docs/presentation/implementation-onboarding-brief.md +38 -0
  27. package/docs/presentation/presentation-talk-track.md +97 -0
  28. package/docs/presentation/vertical-scenario-route-map.md +99 -0
  29. package/docs/presentation/workshop-facilitator-guide.md +47 -0
  30. package/docs/runbooks/actionlint-workflow-gates.md +80 -0
  31. package/docs/runbooks/agent-governance.md +131 -0
  32. package/docs/runbooks/ai-eval-platform-demo-execution-log.md +147 -0
  33. package/docs/runbooks/ai-eval-platform-demo-script.md +136 -0
  34. package/docs/runbooks/ai-eval-platform-walkthrough.md +113 -0
  35. package/docs/runbooks/ai-pr-review-automation.md +56 -0
  36. package/docs/runbooks/api-breaking-change-gates.md +58 -0
  37. package/docs/runbooks/api-design-evolution-walkthrough.md +42 -0
  38. package/docs/runbooks/api-lint-gates.md +57 -0
  39. package/docs/runbooks/api-mocking-strategy-and-lifecycle-guide.md +47 -0
  40. package/docs/runbooks/architect-daily-operations.md +63 -0
  41. package/docs/runbooks/architect-design-conversation-example.md +83 -0
  42. package/docs/runbooks/artifact-attestation-gates.md +75 -0
  43. package/docs/runbooks/artifact-persistence.md +257 -0
  44. package/docs/runbooks/backend-engineer-daily-operations.md +63 -0
  45. package/docs/runbooks/batch-optimization-completion-checklist.md +104 -0
  46. package/docs/runbooks/biz-service-designer-end-to-end-conversation-example.md +5 -0
  47. package/docs/runbooks/biz-service-designer-toolkit.md +5 -0
  48. package/docs/runbooks/bug-fix-complete-walkthrough.md +60 -0
  49. package/docs/runbooks/build-failure-recovery-walkthrough.md +40 -0
  50. package/docs/runbooks/canary-decision-matrix.md +41 -0
  51. package/docs/runbooks/canary-staging-release-walkthrough.md +46 -0
  52. package/docs/runbooks/checkov-iac-gates.md +104 -0
  53. package/docs/runbooks/claude-code-review-workflow.md +72 -0
  54. package/docs/runbooks/claude-conversation-prompt-recipes.md +132 -0
  55. package/docs/runbooks/claude-end-to-end-conversation-example.md +198 -0
  56. package/docs/runbooks/claude-feature-development-guide.md +112 -0
  57. package/docs/runbooks/claude-quick-start.md +227 -0
  58. package/docs/runbooks/claude-usage-scenarios.md +176 -0
  59. package/docs/runbooks/code-review-collaboration-walkthrough.md +65 -0
  60. package/docs/runbooks/codeql-pr-security-gates.md +64 -0
  61. package/docs/runbooks/codex-end-to-end-conversation-example.md +166 -0
  62. package/docs/runbooks/codex-multi-agent-orchestration.md +65 -0
  63. package/docs/runbooks/codex-parallel-prompt-recipes.md +131 -0
  64. package/docs/runbooks/codex-quick-start.md +223 -0
  65. package/docs/runbooks/codex-usage-scenarios.md +168 -0
  66. package/docs/runbooks/codex-workflow-essentials.md +88 -0
  67. package/docs/runbooks/command-and-capability-matrix.md +162 -0
  68. package/docs/runbooks/conftest-policy-gates.md +84 -0
  69. package/docs/runbooks/consumer-driven-contract-testing-with-mock-alignment.md +45 -0
  70. package/docs/runbooks/contract-testing-playbook.md +78 -0
  71. package/docs/runbooks/cosign-signing-gates.md +71 -0
  72. package/docs/runbooks/cross-role-issue-triage-walkthrough.md +47 -0
  73. package/docs/runbooks/cursor-quick-start.md +123 -0
  74. package/docs/runbooks/custom-overlay.md +115 -0
  75. package/docs/runbooks/data-ml-pipeline-demo-execution-log.md +141 -0
  76. package/docs/runbooks/data-ml-pipeline-demo-script.md +102 -0
  77. package/docs/runbooks/data-ml-pipeline-walkthrough.md +119 -0
  78. package/docs/runbooks/data-observability-quality-demo-execution-log.md +36 -0
  79. package/docs/runbooks/data-observability-quality-demo-script.md +42 -0
  80. package/docs/runbooks/data-observability-quality-walkthrough.md +86 -0
  81. package/docs/runbooks/demo-deliverables-overview.md +278 -0
  82. package/docs/runbooks/demo-execution-log.md +530 -0
  83. package/docs/runbooks/demo-scenario.md +129 -0
  84. package/docs/runbooks/dependency-review-gates.md +63 -0
  85. package/docs/runbooks/dependency-update-automation.md +83 -0
  86. package/docs/runbooks/design-md-workflow.md +185 -0
  87. package/docs/runbooks/devops-engineer-daily-operations.md +60 -0
  88. package/docs/runbooks/devops-release-conversation-example.md +88 -0
  89. package/docs/runbooks/doc-architecture-integration.md +59 -0
  90. package/docs/runbooks/doc-architecture-quick-start.md +122 -0
  91. package/docs/runbooks/document-execution-audit.md +32 -0
  92. package/docs/runbooks/documentation-update-walkthrough.md +37 -0
  93. package/docs/runbooks/ecc-harness-usage.md +93 -0
  94. package/docs/runbooks/error-experience-usage.md +116 -0
  95. package/docs/runbooks/evolution-usage.md +162 -0
  96. package/docs/runbooks/executive-value-one-page.md +55 -0
  97. package/docs/runbooks/external-capability-approval-and-enablement-workflow.md +39 -0
  98. package/docs/runbooks/external-capability-intake.md +160 -0
  99. package/docs/runbooks/first-team-command-60-seconds.md +96 -0
  100. package/docs/runbooks/first-team-workflow-walkthrough.md +245 -0
  101. package/docs/runbooks/frontend-backend-integration-acceptance-checklist.md +46 -0
  102. package/docs/runbooks/frontend-backend-parallel-integration-walkthrough.md +48 -0
  103. package/docs/runbooks/frontend-bugfix-one-page.md +82 -0
  104. package/docs/runbooks/frontend-engineer-daily-operations.md +60 -0
  105. package/docs/runbooks/frontend-enterprise-style-profile.md +5 -0
  106. package/docs/runbooks/frontend-governance.md +47 -0
  107. package/docs/runbooks/frontend-refactor-walkthrough.md +42 -0
  108. package/docs/runbooks/git-pr-workflow.md +63 -0
  109. package/docs/runbooks/github-actions-supply-chain-demo-execution-log.md +158 -0
  110. package/docs/runbooks/github-actions-supply-chain-demo-script.md +150 -0
  111. package/docs/runbooks/github-actions-supply-chain-walkthrough.md +117 -0
  112. package/docs/runbooks/github-token-permissions-baseline.md +92 -0
  113. package/docs/runbooks/gitlab-manual-pipeline-release.md +5 -0
  114. package/docs/runbooks/gitlab-release-integration-playbook.md +5 -0
  115. package/docs/runbooks/gitnexus-code-intelligence-usage.md +133 -0
  116. package/docs/runbooks/graphify-knowledge-graph-usage.md +88 -0
  117. package/docs/runbooks/handoff-filling-guide-with-examples.md +70 -0
  118. package/docs/runbooks/handoff-governance.md +250 -0
  119. package/docs/runbooks/helm-unittest-playbook.md +101 -0
  120. package/docs/runbooks/hotfix-emergency-release-walkthrough.md +60 -0
  121. package/docs/runbooks/iac-kubernetes-platform-demo-execution-log.md +144 -0
  122. package/docs/runbooks/iac-kubernetes-platform-demo-script.md +130 -0
  123. package/docs/runbooks/iac-kubernetes-platform-walkthrough.md +120 -0
  124. package/docs/runbooks/implementation-onboarding-reading-path.md +67 -0
  125. package/docs/runbooks/in-toto-attestation-framework.md +94 -0
  126. package/docs/runbooks/incident-severity-triage-tree.md +43 -0
  127. package/docs/runbooks/incident-triage-one-page.md +65 -0
  128. package/docs/runbooks/internal-developer-platform-demo-execution-log.md +36 -0
  129. package/docs/runbooks/internal-developer-platform-demo-script.md +42 -0
  130. package/docs/runbooks/internal-developer-platform-walkthrough.md +91 -0
  131. package/docs/runbooks/karpathy-guidelines-usage.md +27 -0
  132. package/docs/runbooks/kubeconform-schema-gates.md +100 -0
  133. package/docs/runbooks/kubectl-server-dry-run-gates.md +103 -0
  134. package/docs/runbooks/kyverno-policy-gates.md +90 -0
  135. package/docs/runbooks/langfuse-and-observability-integration-guide.md +43 -0
  136. package/docs/runbooks/langfuse-coding-trace.md +44 -0
  137. package/docs/runbooks/mobile-miniapp-delivery-walkthrough.md +112 -0
  138. package/docs/runbooks/mobile-miniapp-demo-execution-log.md +139 -0
  139. package/docs/runbooks/mobile-miniapp-demo-script.md +129 -0
  140. package/docs/runbooks/multi-service-backend-integration-walkthrough.md +61 -0
  141. package/docs/runbooks/open-design-integration.md +163 -0
  142. package/docs/runbooks/open-source-release-checklist.md +90 -0
  143. package/docs/runbooks/opencode-quick-start.md +128 -0
  144. package/docs/runbooks/parallel-development-coordination-walkthrough.md +47 -0
  145. package/docs/runbooks/parallel-execution-usage.md +179 -0
  146. package/docs/runbooks/platform-capability-demo-execution-log.md +184 -0
  147. package/docs/runbooks/platform-capability-demo-script.md +192 -0
  148. package/docs/runbooks/plugin-extension-platform-demo-execution-log.md +136 -0
  149. package/docs/runbooks/plugin-extension-platform-demo-script.md +102 -0
  150. package/docs/runbooks/plugin-extension-platform-walkthrough.md +111 -0
  151. package/docs/runbooks/policy-controller-gates.md +75 -0
  152. package/docs/runbooks/post-rollback-verification-checklist.md +37 -0
  153. package/docs/runbooks/pre-release-checklist.md +50 -0
  154. package/docs/runbooks/product-manager-clarification-conversation-example.md +90 -0
  155. package/docs/runbooks/product-manager-daily-operations.md +60 -0
  156. package/docs/runbooks/production-incident-response-walkthrough.md +50 -0
  157. package/docs/runbooks/project-claude-design-rationale.md +188 -0
  158. package/docs/runbooks/project-manager-daily-operations.md +61 -0
  159. package/docs/runbooks/project-manager-planning-conversation-example.md +82 -0
  160. package/docs/runbooks/project-onboarding.md +452 -0
  161. package/docs/runbooks/qa-engineer-daily-operations.md +63 -0
  162. package/docs/runbooks/qa-review-conversation-example.md +87 -0
  163. package/docs/runbooks/release-closure-one-page.md +65 -0
  164. package/docs/runbooks/release-governance-reading-path.md +56 -0
  165. package/docs/runbooks/release-notes-automation.md +48 -0
  166. package/docs/runbooks/release-rollback-recovery-walkthrough.md +47 -0
  167. package/docs/runbooks/requirement-clarity-and-scope-walkthrough.md +46 -0
  168. package/docs/runbooks/reviewdog-pr-gates.md +49 -0
  169. package/docs/runbooks/role-prompt-recipes.md +130 -0
  170. package/docs/runbooks/rtk-integration-intake.md +45 -0
  171. package/docs/runbooks/rtk-token-optimization-usage.md +107 -0
  172. package/docs/runbooks/runner-egress-hardening.md +81 -0
  173. package/docs/runbooks/runtime-capabilities-overview.md +113 -0
  174. package/docs/runbooks/sbom-generation-gates.md +71 -0
  175. package/docs/runbooks/scorecard-supply-chain-gates.md +82 -0
  176. package/docs/runbooks/secret-scanning-gates.md +85 -0
  177. package/docs/runbooks/security-compliance-platform-demo-execution-log.md +36 -0
  178. package/docs/runbooks/security-compliance-platform-demo-script.md +49 -0
  179. package/docs/runbooks/security-compliance-platform-walkthrough.md +98 -0
  180. package/docs/runbooks/slsa-generator-patterns.md +73 -0
  181. package/docs/runbooks/slsa-verification-gates.md +75 -0
  182. package/docs/runbooks/solo-delivery-mode.md +142 -0
  183. package/docs/runbooks/solo-delivery-one-page.md +111 -0
  184. package/docs/runbooks/specialist-commands-playbook.md +85 -0
  185. package/docs/runbooks/sub-agent-invocation-map.md +144 -0
  186. package/docs/runbooks/system-architecture-design-walkthrough.md +49 -0
  187. package/docs/runbooks/team-closeout-example.md +73 -0
  188. package/docs/runbooks/team-command-output-contracts.md +358 -0
  189. package/docs/runbooks/team-commands-quick-prompts.md +125 -0
  190. package/docs/runbooks/team-execute-example.md +63 -0
  191. package/docs/runbooks/team-handoff-example.md +49 -0
  192. package/docs/runbooks/team-intake-example.md +70 -0
  193. package/docs/runbooks/team-plan-example.md +62 -0
  194. package/docs/runbooks/team-release-example.md +63 -0
  195. package/docs/runbooks/team-review-example.md +61 -0
  196. package/docs/runbooks/team-skills-test-run.md +184 -0
  197. package/docs/runbooks/team-skills-usage.md +336 -0
  198. package/docs/runbooks/team-training-reading-path.md +64 -0
  199. package/docs/runbooks/tech-lead-closure-conversation-example.md +78 -0
  200. package/docs/runbooks/tech-lead-daily-operations.md +67 -0
  201. package/docs/runbooks/trivy-security-gates.md +79 -0
  202. package/docs/runbooks/troubleshooting.md +234 -0
  203. package/docs/runbooks/vertical-scenario-capability-matrix.md +107 -0
  204. package/docs/runbooks/witness-policy-gates.md +78 -0
  205. package/docs/runbooks/zizmor-workflow-audits.md +81 -0
  206. package/manifests/install-components.json +8 -0
  207. package/manifests/install-modules.json +34 -0
  208. package/manifests/install-profiles.json +2 -0
  209. package/package.json +3 -1
  210. package/scripts/install-apply.js +9 -0
  211. package/scripts/install-open-design.js +206 -0
  212. package/scripts/install-plan.js +17 -0
  213. package/scripts/lib/install/apply.js +31 -0
  214. package/scripts/lib/install-executor.js +56 -0
  215. package/skills/open-design/SKILL.md +87 -0
  216. package/skills/open-design/agents/openai.yaml +4 -0
@@ -0,0 +1,206 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const os = require('os');
5
+ const path = require('path');
6
+ const { spawnSync } = require('child_process');
7
+
8
+ const DEFAULT_REPO_URL = 'https://github.com/nexu-io/open-design.git';
9
+ const DEFAULT_INSTALL_DIR = path.join(os.homedir(), '.tsp', 'open-design');
10
+ const DEFAULT_REF = 'main';
11
+
12
+ function parseArgs(argv) {
13
+ const parsed = {
14
+ installDir: process.env.TSP_OPEN_DESIGN_HOME || process.env.OPEN_DESIGN_HOME || DEFAULT_INSTALL_DIR,
15
+ repoUrl: process.env.TSP_OPEN_DESIGN_REPO || DEFAULT_REPO_URL,
16
+ ref: process.env.TSP_OPEN_DESIGN_REF || DEFAULT_REF,
17
+ skipDeps: process.env.TSP_OPEN_DESIGN_SKIP_DEPS === '1',
18
+ dryRun: false,
19
+ };
20
+
21
+ for (let index = 2; index < argv.length; index += 1) {
22
+ const arg = argv[index];
23
+ if (arg === '--dir') {
24
+ parsed.installDir = argv[index + 1] || parsed.installDir;
25
+ index += 1;
26
+ continue;
27
+ }
28
+ if (arg === '--repo') {
29
+ parsed.repoUrl = argv[index + 1] || parsed.repoUrl;
30
+ index += 1;
31
+ continue;
32
+ }
33
+ if (arg === '--ref') {
34
+ parsed.ref = argv[index + 1] || parsed.ref;
35
+ index += 1;
36
+ continue;
37
+ }
38
+ if (arg === '--skip-deps') {
39
+ parsed.skipDeps = true;
40
+ continue;
41
+ }
42
+ if (arg === '--dry-run') {
43
+ parsed.dryRun = true;
44
+ continue;
45
+ }
46
+ if (arg === '--help' || arg === '-h') {
47
+ parsed.help = true;
48
+ continue;
49
+ }
50
+ throw new Error(`Unknown argument: ${arg}`);
51
+ }
52
+
53
+ parsed.installDir = path.resolve(parsed.installDir);
54
+ return parsed;
55
+ }
56
+
57
+ function printHelp() {
58
+ console.log(`
59
+ Install or update Open Design for TSP.
60
+
61
+ Usage:
62
+ node scripts/install-open-design.js [--dir <path>] [--repo <url>] [--ref <git-ref>] [--skip-deps] [--dry-run]
63
+
64
+ Environment:
65
+ TSP_OPEN_DESIGN_HOME Override install directory. Default: ~/.tsp/open-design
66
+ TSP_OPEN_DESIGN_REPO Override upstream repository URL.
67
+ TSP_OPEN_DESIGN_REF Override git ref. Default: main
68
+ TSP_OPEN_DESIGN_SKIP_DEPS Set to 1 to skip pnpm dependency install.
69
+ `);
70
+ }
71
+
72
+ function commandExists(command) {
73
+ const result = spawnSync(command, ['--version'], {
74
+ encoding: 'utf8',
75
+ stdio: ['ignore', 'ignore', 'ignore'],
76
+ });
77
+ return result.status === 0;
78
+ }
79
+
80
+ function run(command, args, options = {}) {
81
+ const printable = [command, ...args].join(' ');
82
+ if (options.dryRun) {
83
+ console.log(`[dry-run] ${printable}`);
84
+ return;
85
+ }
86
+
87
+ const result = spawnSync(command, args, {
88
+ cwd: options.cwd || process.cwd(),
89
+ encoding: 'utf8',
90
+ stdio: options.quiet ? ['ignore', 'pipe', 'pipe'] : 'inherit',
91
+ });
92
+
93
+ if (result.status !== 0) {
94
+ const stderr = result.stderr ? `\n${result.stderr.trim()}` : '';
95
+ throw new Error(`Command failed: ${printable}${stderr}`);
96
+ }
97
+ }
98
+
99
+ function readGitRemote(installDir) {
100
+ const result = spawnSync('git', ['-C', installDir, 'remote', 'get-url', 'origin'], {
101
+ encoding: 'utf8',
102
+ stdio: ['ignore', 'pipe', 'ignore'],
103
+ });
104
+ return result.status === 0 ? result.stdout.trim() : null;
105
+ }
106
+
107
+ function isOpenDesignRemote(remoteUrl, expectedRepoUrl) {
108
+ const normalized = String(remoteUrl || '').replace(/\.git$/, '');
109
+ const expected = String(expectedRepoUrl || '').replace(/\.git$/, '');
110
+ return normalized === expected || normalized.endsWith('/nexu-io/open-design');
111
+ }
112
+
113
+ function ensureOpenDesignCheckout(options) {
114
+ const gitDir = path.join(options.installDir, '.git');
115
+ if (!fs.existsSync(options.installDir)) {
116
+ console.log(`Installing Open Design into ${options.installDir}`);
117
+ if (!options.dryRun) {
118
+ fs.mkdirSync(path.dirname(options.installDir), { recursive: true });
119
+ }
120
+ run('git', [
121
+ 'clone',
122
+ '--depth',
123
+ '1',
124
+ '--branch',
125
+ options.ref,
126
+ options.repoUrl,
127
+ options.installDir,
128
+ ], { dryRun: options.dryRun });
129
+ return;
130
+ }
131
+
132
+ if (!fs.existsSync(gitDir)) {
133
+ throw new Error(`Open Design install path exists but is not a git checkout: ${options.installDir}`);
134
+ }
135
+
136
+ const remoteUrl = readGitRemote(options.installDir);
137
+ if (!isOpenDesignRemote(remoteUrl, options.repoUrl)) {
138
+ throw new Error(
139
+ `Refusing to update ${options.installDir}; origin is ${remoteUrl || '(unknown)'}, expected ${options.repoUrl}`
140
+ );
141
+ }
142
+
143
+ console.log(`Updating Open Design at ${options.installDir}`);
144
+ run('git', ['-C', options.installDir, 'fetch', '--depth', '1', 'origin', options.ref], {
145
+ dryRun: options.dryRun,
146
+ });
147
+ run('git', ['-C', options.installDir, 'checkout', 'FETCH_HEAD'], {
148
+ dryRun: options.dryRun,
149
+ });
150
+ }
151
+
152
+ function installDependencies(options) {
153
+ if (options.skipDeps) {
154
+ console.log('Skipping Open Design dependency install because --skip-deps or TSP_OPEN_DESIGN_SKIP_DEPS=1 is set.');
155
+ return;
156
+ }
157
+
158
+ if (!commandExists('corepack')) {
159
+ console.warn(
160
+ 'Open Design source is installed, but corepack/pnpm is not available. '
161
+ + 'Install Node 24 with corepack, then run `corepack enable && pnpm install` in the Open Design directory.'
162
+ );
163
+ return;
164
+ }
165
+
166
+ run('corepack', ['enable'], {
167
+ cwd: options.installDir,
168
+ dryRun: options.dryRun,
169
+ });
170
+
171
+ if (!commandExists('pnpm')) {
172
+ console.warn(
173
+ 'Open Design source is installed, but pnpm is still not available after `corepack enable`. '
174
+ + 'Run `corepack prepare pnpm@10.33.2 --activate && pnpm install` in the Open Design directory.'
175
+ );
176
+ return;
177
+ }
178
+
179
+ run('pnpm', ['install'], {
180
+ cwd: options.installDir,
181
+ dryRun: options.dryRun,
182
+ });
183
+ }
184
+
185
+ function main() {
186
+ try {
187
+ const options = parseArgs(process.argv);
188
+ if (options.help) {
189
+ printHelp();
190
+ return;
191
+ }
192
+
193
+ if (!commandExists('git')) {
194
+ throw new Error('git is required to install Open Design');
195
+ }
196
+
197
+ ensureOpenDesignCheckout(options);
198
+ installDependencies(options);
199
+ console.log(`Open Design ready: ${options.installDir}`);
200
+ } catch (error) {
201
+ console.error(`Error: ${error.message}`);
202
+ process.exit(1);
203
+ }
204
+ }
205
+
206
+ main();
@@ -183,6 +183,23 @@ function printPlan(plan) {
183
183
  );
184
184
  }
185
185
  }
186
+
187
+ const externalInstalls = plan.selectedModules
188
+ .map(module => ({ module, externalInstall: module.externalInstall }))
189
+ .filter(({ externalInstall }) => externalInstall && typeof externalInstall === 'object' && !Array.isArray(externalInstall))
190
+ .filter(({ externalInstall }) => {
191
+ const profiles = Array.isArray(externalInstall.profiles)
192
+ ? externalInstall.profiles.map(value => String(value).trim()).filter(Boolean)
193
+ : [];
194
+ return profiles.length === 0 || profiles.includes(plan.profileId);
195
+ });
196
+ if (externalInstalls.length > 0) {
197
+ console.log('');
198
+ console.log(`External install plan (${externalInstalls.length}):`);
199
+ for (const { module, externalInstall } of externalInstalls) {
200
+ console.log(`- ${externalInstall.id || module.id}: ${externalInstall.description || externalInstall.script}`);
201
+ }
202
+ }
186
203
  }
187
204
 
188
205
  function main() {
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { spawnSync } = require('child_process');
5
6
 
6
7
  const { writeInstallState } = require('../install-state');
7
8
  const { writeInstallAuditManifest } = require('../install-audit-manifest');
@@ -176,6 +177,32 @@ function buildMergedSettings(plan) {
176
177
  };
177
178
  }
178
179
 
180
+ function runExternalInstall(externalInstall) {
181
+ const args = [];
182
+ if (externalInstall.scriptPath) {
183
+ args.push(externalInstall.scriptPath);
184
+ } else if (externalInstall.script) {
185
+ args.push(externalInstall.script);
186
+ }
187
+ if (Array.isArray(externalInstall.args)) {
188
+ args.push(...externalInstall.args);
189
+ }
190
+
191
+ const command = externalInstall.command || 'node';
192
+ const label = externalInstall.id || externalInstall.moduleId || command;
193
+ console.log(`Running external install: ${label}`);
194
+
195
+ const result = spawnSync(command, args, {
196
+ cwd: externalInstall.cwd || process.cwd(),
197
+ encoding: 'utf8',
198
+ stdio: 'inherit',
199
+ });
200
+
201
+ if (result.status !== 0) {
202
+ throw new Error(`External install failed: ${label}`);
203
+ }
204
+ }
205
+
179
206
  function applyInstallPlan(plan) {
180
207
  const mergedSettingsPlan = buildMergedSettings(plan);
181
208
 
@@ -199,6 +226,10 @@ function applyInstallPlan(plan) {
199
226
  );
200
227
  }
201
228
 
229
+ for (const externalInstall of Array.isArray(plan.externalInstalls) ? plan.externalInstalls : []) {
230
+ runExternalInstall(externalInstall);
231
+ }
232
+
202
233
  writeInstallState(plan.installStatePath, plan.statePreview);
203
234
  const { installManifestPath } = writeInstallAuditManifest(plan);
204
235
 
@@ -133,6 +133,56 @@ function createStatePreview(options) {
133
133
  return createInstallState(options);
134
134
  }
135
135
 
136
+ function resolveExternalInstalls(selectedModules, options = {}) {
137
+ const profileId = options.profileId || null;
138
+ const sourceRoot = options.sourceRoot || getSourceRoot();
139
+ const target = options.target || null;
140
+ const installs = [];
141
+
142
+ for (const module of selectedModules) {
143
+ const externalInstall = module && module.externalInstall;
144
+ if (!externalInstall || typeof externalInstall !== 'object' || Array.isArray(externalInstall)) {
145
+ continue;
146
+ }
147
+
148
+ const profileFilter = Array.isArray(externalInstall.profiles)
149
+ ? externalInstall.profiles.map(value => String(value).trim()).filter(Boolean)
150
+ : [];
151
+ if (profileFilter.length > 0 && (!profileId || !profileFilter.includes(profileId))) {
152
+ continue;
153
+ }
154
+
155
+ const command = typeof externalInstall.command === 'string' && externalInstall.command.trim()
156
+ ? externalInstall.command.trim()
157
+ : 'node';
158
+ const script = typeof externalInstall.script === 'string' && externalInstall.script.trim()
159
+ ? externalInstall.script.trim()
160
+ : null;
161
+ const args = Array.isArray(externalInstall.args)
162
+ ? externalInstall.args.map(value => String(value))
163
+ : [];
164
+
165
+ if (!script) {
166
+ throw new Error(`Install module ${module.id} has externalInstall but no script`);
167
+ }
168
+
169
+ installs.push({
170
+ id: externalInstall.id || module.id,
171
+ moduleId: module.id,
172
+ description: externalInstall.description || '',
173
+ command,
174
+ script,
175
+ scriptPath: path.join(sourceRoot, script),
176
+ args,
177
+ cwd: sourceRoot,
178
+ target,
179
+ profileId,
180
+ });
181
+ }
182
+
183
+ return installs;
184
+ }
185
+
136
186
  function applyInstallPlan(plan) {
137
187
  const { applyInstallPlan: applyPlan } = require('./install/apply');
138
188
  return applyPlan(plan);
@@ -617,6 +667,11 @@ function createManifestInstallPlan(options = {}) {
617
667
  });
618
668
  const adapter = getInstallTargetAdapter(target);
619
669
  const operations = plan.operations.flatMap(operation => materializeScaffoldOperation(sourceRoot, operation));
670
+ const externalInstalls = resolveExternalInstalls(plan.selectedModules, {
671
+ profileId: plan.profileId,
672
+ sourceRoot,
673
+ target,
674
+ });
620
675
  const source = {
621
676
  repoVersion: getPackageVersion(sourceRoot),
622
677
  repoCommit: getRepoCommit(sourceRoot),
@@ -667,6 +722,7 @@ function createManifestInstallPlan(options = {}) {
667
722
  skippedModuleIds: plan.skippedModuleIds,
668
723
  excludedModuleIds: plan.excludedModuleIds,
669
724
  operations,
725
+ externalInstalls,
670
726
  statePreview,
671
727
  };
672
728
  }
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: open-design
3
+ description: >
4
+ Use Open Design as an external local-first design workbench for prototypes,
5
+ decks, mobile screens, dashboards, DESIGN.md systems, and exportable visual
6
+ artifacts. Keep TSP responsible for team workflow, handoff, and quality gates.
7
+ origin: nexu-io/open-design (reference-only controlled integration)
8
+ ---
9
+
10
+ # Open Design
11
+
12
+ ## 用途
13
+
14
+ - 用 Open Design 生成或迭代高保真视觉 artifacts:web prototype、dashboard、mobile flow、deck、poster、social carousel、runbook/spec 类页面。
15
+ - 在前端任务中把 `DESIGN.md`、设计方向、skill、preview 和 export 结果作为证据回落到 TSP 主链。
16
+ - 让 `product-manager`、`frontend-engineer`、`qa-engineer` 在同一套可预览 artifact 上讨论,而不是只靠文字描述。
17
+
18
+ ## 触发信号
19
+
20
+ - 用户要“像 Claude Design 那样”快速生成可编辑原型、deck、营销页、移动界面或设计系统。
21
+ - 需求还没有稳定视觉方向,需要先通过表单、方向 picker 或 `DESIGN.md` 锁定风格。
22
+ - `/team-plan` 或 `/team-execute` 进入 UI 实施前,需要可截图、可导出、可评审的设计证据。
23
+ - `/team-review` 需要对 artifact 做视觉、响应式、可访问性、反 AI 味、导出完整性检查。
24
+
25
+ ## 默认工作流
26
+
27
+ 1. 先完成 TSP 侧任务收敛:
28
+ - 目标、受众、页面/屏幕范围、数据真实性、品牌约束、响应式范围、A11y/性能门禁。
29
+ - 若任务来自 `/team-*`,把这些约束写入 artifact 或 handoff,不只留在聊天里。
30
+ 2. 检查目标项目是否已有 `DESIGN.md`:
31
+ - 有:把它作为 Open Design 的 active design system 或直接放入 OD 项目工作目录。
32
+ - 无:先用 `frontend-ui-ux-system` 或 OD 的 design-system 能力生成候选 `DESIGN.md`。
33
+ 3. 若用户安装的是 TSP `full` profile,Open Design 默认会由 TSP 安装器准备到 `~/.tsp/open-design`;否则在独立 Open Design checkout 中运行上游工具,不在 TSP 仓库里启动 OD daemon:
34
+ ```bash
35
+ # full profile 自动路径
36
+ cd ~/.tsp/open-design
37
+
38
+ # 手动路径
39
+ git clone https://github.com/nexu-io/open-design.git
40
+ cd open-design
41
+ corepack enable
42
+ pnpm install
43
+ pnpm tools-dev
44
+ ```
45
+ 4. 在 OD 中选择合适 surface:
46
+ - prototype:`web-prototype`、`saas-landing`、`dashboard`、`mobile-app` 等。
47
+ - deck:`guizang-ppt`、`simple-deck`、`weekly-update` 等。
48
+ - document-like:`pm-spec`、`eng-runbook`、`finance-report`、`team-okrs` 等。
49
+ 5. 生成后把关键产物回落到 TSP:
50
+ - artifact 路径或导出文件
51
+ - 使用的 OD skill、design system、visual direction
52
+ - 约束与自检结论
53
+ - 对 `/team-plan`、`/team-execute`、`/team-review` 或 `/team-release` 的决策影响
54
+ 6. 若 artifact 会进入实现,frontend 角色必须继续执行 TSP 前端门禁:
55
+ - 响应式、键盘访问、对比度、性能、加载/空态/错误态
56
+ - 真实数据与授权素材检查
57
+ - 不能把 OD 输出直接视为生产代码完成
58
+
59
+ ## 输出约定
60
+
61
+ - TSP 侧只沉淀集成证据,不复制 Open Design 源码或生成数据库。
62
+ - 推荐在消费方项目中落盘:
63
+ - `docs/artifacts/<date>-open-design-brief.md`
64
+ - `docs/artifacts/<date>-open-design-review.md`
65
+ - 需要长期复用时,将最终 `DESIGN.md` 放在项目根目录或设计文档目录。
66
+ - 最小交付字段:
67
+ - 任务目标
68
+ - 使用的 OD skill / design system / visual direction
69
+ - 产物路径或导出格式
70
+ - 主要设计决策及证据
71
+ - 风险、未验证项、下一步 TSP 命令
72
+
73
+ ## 边界与禁用项
74
+
75
+ - 只有 TSP `full` profile 会自动 clone/update Open Design;其他 profile 只安装 TSP 侧 skill/runbook。
76
+ - 不把 Open Design 当作 TSP 的默认 npm 依赖;它要求独立 Node/pnpm/daemon 生命周期。
77
+ - 不在本仓库 vendoring Open Design 的 `skills/`、`design-systems/`、daemon、web app 或 SQLite 数据。
78
+ - 不把 OD 的视觉结果绕过 `/team-review` 直接发布。
79
+ - 不使用未授权品牌素材、字体、截图或第三方图片作为可分发 artifact。
80
+ - 不在 TSP 管理仓库中运行会改写本仓库 hooks、AGENTS 或 MCP 契约的外部 setup 命令。
81
+
82
+ ## 推荐组合
83
+
84
+ - 需求到原型:`/team-intake -> frontend-ui-ux-system -> open-design -> /team-plan`
85
+ - UI 实施:`/team-execute -> open-design artifact evidence -> frontend-engineering -> /handoff`
86
+ - 视觉评审:`/team-review -> open-design artifact review -> browser-smoke-testing`
87
+ - Deck / 汇报材料:`frontend-slides -> open-design deck mode -> /team-release`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Open Design"
3
+ short_description: "用 Open Design 生成和评审本地优先设计 artifact"
4
+ default_prompt: "Use $open-design when a TSP task needs local-first prototypes, decks, dashboards, mobile flows, DESIGN.md systems, or exportable visual artifacts. Keep Open Design external, avoid vendoring upstream runtime assets, and feed artifact evidence back into /team-plan, /team-execute, or /team-review."