sdtk-spec-kit 0.4.2 → 0.4.4

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.
@@ -83,12 +83,17 @@ RE_RELEASE_REF = re.compile(r"\b(?:sdtk-spec-kit@)?(0\.\d+\.\d+)\b")
83
83
  def classify_family(rel: str) -> str:
84
84
  p = rel.replace("\\", "/").lower()
85
85
  name = Path(rel).name.lower()
86
+ is_guide_path = p.startswith("guides/") or "/guides/" in p
86
87
  if p == "readme.md":
87
88
  return "root-readme"
88
89
  if "backlog" in name:
89
90
  return "backlog"
90
- if "governance" in p:
91
- return "governance"
91
+ if "skills" in p:
92
+ return "skill"
93
+ if "templates" in p:
94
+ return "template"
95
+ if "docs/database" in p or "database/" in p:
96
+ return "database"
92
97
  if "docs/specs" in p or "specs/" in p:
93
98
  return "spec"
94
99
  if "docs/architecture" in p or "architecture/" in p:
@@ -103,10 +108,10 @@ def classify_family(rel: str) -> str:
103
108
  return "dev"
104
109
  if "docs/product" in p or "product/" in p:
105
110
  return "product"
106
- if "skills" in p:
107
- return "skill"
108
- if "templates" in p:
109
- return "template"
111
+ if is_guide_path:
112
+ return "guide"
113
+ if "governance" in p:
114
+ return "governance"
110
115
  return "other-markdown"
111
116
 
112
117
 
@@ -668,9 +673,11 @@ def build_summary(
668
673
  # ---------------------------------------------------------------------------
669
674
  _FAMILY_COLORS = {
670
675
  "governance": "#58a6ff",
676
+ "guide": "#14b8a6",
671
677
  "backlog": "#d2a8ff",
672
678
  "spec": "#f0883e",
673
679
  "architecture": "#3fb950",
680
+ "database": "#a371f7",
674
681
  "api": "#f778ba",
675
682
  "qa": "#79c0ff",
676
683
  "design": "#ffa657",
@@ -170,6 +170,17 @@ a{color:var(--accent);text-decoration:none}
170
170
 
171
171
  body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:linear-gradient(180deg,#eef3f9 0%,#f7f3ec 100%);color:var(--graph-text);font-size:14px;line-height:1.6;height:100vh;overflow:hidden;--nav-width:0px}
172
172
  body.nav-open{--nav-width:84px}
173
+ body.embedded-atlas{background:#ffffff;--nav-width:0px}
174
+ body.embedded-atlas .nav{display:none !important}
175
+ body.embedded-atlas .panel{inset:0 !important;left:0 !important;right:0 !important;top:0 !important;bottom:0 !important;padding:0 !important}
176
+ body.embedded-atlas .graph-shell{padding:0;border:none;border-radius:0;box-shadow:none;background:#ffffff}
177
+ body.embedded-atlas .graph-main-header{display:none}
178
+ body.embedded-atlas .graph-stage{height:100%}
179
+ body.embedded-atlas .graph-canvas-shell{min-height:0;height:100%;border:none;border-radius:0;padding:0}
180
+ body.embedded-atlas #graph-canvas{border-radius:0}
181
+ body.embedded-atlas .graph-settings-corner{top:14px;right:14px}
182
+ body.embedded-atlas .graph-footer-status{bottom:0}
183
+ body.embedded-atlas .graph-focus-overlay{top:14px;right:14px;bottom:14px}
173
184
  .panel{border-radius:30px;overflow:hidden}
174
185
  a{color:#3156c9;text-decoration:none}
175
186
  .panel{display:none;position:fixed;top:16px;right:16px;bottom:16px;left:calc(var(--nav-width) + 16px);padding:0;min-height:0;overflow:hidden}
@@ -721,8 +732,10 @@ const INDEX = __ATLAS_INDEX_JSON__;
721
732
  const GRAPH = __ATLAS_GRAPH_JSON__;
722
733
  const FAMILY_COLORS = __ATLAS_FAMILY_COLORS_JSON__;
723
734
  const FAMILY_GLYPHS = {
735
+ 'governance': 'G', 'product': 'P', 'spec': 'S', 'architecture': 'A', 'database': 'D',
736
+ 'api': 'I', 'qa': 'Q', 'design': 'L', 'dev': 'V', 'skill': 'K', 'template': 'T',
724
737
  'governance-core': 'G', 'backlog': 'B', 'review-artifact': 'R', 'knowledge-object': 'K',
725
- 'toolkit-skill': 'S', 'toolkit-template': 'T', 'toolkit-guide': 'I', 'docs-site-guide': 'D',
738
+ 'toolkit-skill': 'S', 'toolkit-template': 'T', 'toolkit-guide': 'I', 'docs-site-guide': 'D', 'guide': 'D',
726
739
  'root-readme': 'H', 'other-markdown': 'M',
727
740
  };
728
741
  const GRAPH_EDGE_COLORS = { references_path: 'rgba(95,137,255,0.38)', references_wiki_link: 'rgba(46,181,125,0.44)' };
@@ -893,6 +906,10 @@ const ATLAS_NAV_STORAGE_KEY = 'sdtkAtlasNavOpen';
893
906
  const ATLAS_ASK_POSITION_STORAGE_KEY = 'sdtkAtlasAskDockPositionV3';
894
907
  const GRAPH_TOOLBAR_POSITION_STORAGE_KEY = 'sdtkAtlasGraphToolbarPositionV3';
895
908
  const GRAPH_FOCUS_POSITION_STORAGE_KEY = 'sdtkAtlasGraphFocusPosition';
909
+ const VIEW_PARAMS = new URLSearchParams(window.location.search);
910
+ const EMBEDDED_ATLAS = VIEW_PARAMS.get('embedded') === '1';
911
+ const REQUESTED_PANEL = VIEW_PARAMS.get('panel');
912
+ const INITIAL_PANEL = ['dash', 'docs', 'graph'].includes(REQUESTED_PANEL) ? REQUESTED_PANEL : (EMBEDDED_ATLAS ? 'graph' : 'dash');
896
913
  const atlasAskDragState = { active: false, moved: false, startX: 0, startY: 0, originX: 0, originY: 0 };
897
914
  const graphOverlayDragState = { active: false, kind: '', moved: false, startX: 0, startY: 0, originX: 0, originY: 0 };
898
915
  const ATLAS_ASK_RUNTIME_OPTIONS = [
@@ -907,6 +924,11 @@ const ATLAS_ASK_MODEL_LABELS = {
907
924
  'gpt-5.4-mini': 'GPT-5.4 Mini',
908
925
  'gpt-5.3-codex': 'GPT-5.3 Codex',
909
926
  };
927
+ if (EMBEDDED_ATLAS) {
928
+ document.body.classList.add('embedded-atlas');
929
+ }
930
+ const initialPanelButton = document.querySelector(`.nav-panel-btn[data-panel="${INITIAL_PANEL}"]`);
931
+ showPanel(INITIAL_PANEL, initialPanelButton);
910
932
  function escapeHtml(value) {
911
933
  return String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
912
934
  }
@@ -3248,13 +3270,20 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3248
3270
  (groupBy[group] = groupBy[group] || []).push(doc);
3249
3271
  });
3250
3272
  const groupNames = Object.keys(groupBy).sort();
3251
- const clusterRadius = Math.min(width, height) * 0.29;
3273
+ const isEmbeddedCompactGraph = EMBEDDED_ATLAS && visibleDocs.length <= 12;
3274
+ const clusterRadius = isEmbeddedCompactGraph
3275
+ ? Math.min(width, height) * 0.1
3276
+ : Math.min(width, height) * 0.29;
3252
3277
  const centers = {};
3253
3278
  groupNames.forEach((group, index) => {
3254
3279
  const angle = (index / Math.max(groupNames.length, 1)) * Math.PI * 2;
3255
3280
  centers[group] = {
3256
- x: width / 2 + clusterRadius * Math.cos(angle),
3257
- y: height / 2 + clusterRadius * Math.sin(angle),
3281
+ x: isEmbeddedCompactGraph
3282
+ ? width / 2 + clusterRadius * Math.cos(angle - Math.PI / 2)
3283
+ : width / 2 + clusterRadius * Math.cos(angle),
3284
+ y: isEmbeddedCompactGraph
3285
+ ? height / 2 + clusterRadius * Math.sin(angle - Math.PI / 2)
3286
+ : height / 2 + clusterRadius * Math.sin(angle),
3258
3287
  };
3259
3288
  });
3260
3289
 
@@ -3269,7 +3298,9 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3269
3298
  positions = {};
3270
3299
  groupNames.forEach(group => {
3271
3300
  const members = groupBy[group].slice().sort((a, b) => (a.title || a.id).localeCompare(b.title || b.id));
3272
- const memberRadius = Math.max(34, Math.min(140, 18 + Math.sqrt(members.length) * 12));
3301
+ const memberRadius = isEmbeddedCompactGraph
3302
+ ? Math.max(120, Math.min(260, 56 + members.length * 22))
3303
+ : Math.max(34, Math.min(140, 18 + Math.sqrt(members.length) * 12));
3273
3304
  members.forEach((doc, index) => {
3274
3305
  const angle = (index / Math.max(members.length, 1)) * Math.PI * 2;
3275
3306
  const seed = hashString(doc.id);
@@ -3339,6 +3370,7 @@ function ensureGraphLayout(width, height, visibleDocs, visibleEdges) {
3339
3370
 
3340
3371
  function drawGraph() {
3341
3372
  const visibleDocs = getVisibleDocs();
3373
+ const isEmbeddedCompactGraphView = EMBEDDED_ATLAS && visibleDocs.length <= 12;
3342
3374
  const visibleIds = new Set(visibleDocs.map(doc => doc.id));
3343
3375
  normalizeGraphFocus(visibleIds);
3344
3376
  const visibleEdges = getVisibleDocEdges(visibleIds);
@@ -3372,7 +3404,9 @@ function drawGraph() {
3372
3404
  const paddingY = 120;
3373
3405
  const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3374
3406
  const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3375
- graphState.targetZoom = Math.max(0.82, Math.min(1.52, fitZoomX, fitZoomY));
3407
+ graphState.targetZoom = isEmbeddedCompactGraphView
3408
+ ? Math.max(2.6, Math.min(6.5, fitZoomX, fitZoomY))
3409
+ : Math.max(0.82, Math.min(1.52, fitZoomX, fitZoomY));
3376
3410
  const fit = computePanForTargetCenter(
3377
3411
  bounds.centerX,
3378
3412
  bounds.centerY,
@@ -3407,7 +3441,9 @@ function drawGraph() {
3407
3441
  const paddingY = 120;
3408
3442
  const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3409
3443
  const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3410
- graphState.targetZoom = Math.max(0.84, Math.min(1.48, fitZoomX, fitZoomY));
3444
+ graphState.targetZoom = isEmbeddedCompactGraphView
3445
+ ? Math.max(2.4, Math.min(6.2, fitZoomX, fitZoomY))
3446
+ : Math.max(0.84, Math.min(1.48, fitZoomX, fitZoomY));
3411
3447
  const fit = computePanForTargetCenter(
3412
3448
  bounds.centerX,
3413
3449
  bounds.centerY,
@@ -3421,9 +3457,33 @@ function drawGraph() {
3421
3457
  graphState.targetPanY = fit.panY;
3422
3458
  }
3423
3459
  } else if (!focusId && !graphState.isDragging && !graphState.manualViewport) {
3424
- graphState.targetZoom = 1;
3425
- graphState.targetPanX = 0;
3426
- graphState.targetPanY = 0;
3460
+ if (EMBEDDED_ATLAS) {
3461
+ const bounds = computePositionBounds(visibleDocs);
3462
+ if (bounds) {
3463
+ const paddingX = 120;
3464
+ const paddingY = 120;
3465
+ const fitZoomX = viewport.usableWidth / (bounds.width + paddingX);
3466
+ const fitZoomY = viewport.usableHeight / (bounds.height + paddingY);
3467
+ graphState.targetZoom = isEmbeddedCompactGraphView
3468
+ ? Math.max(2.8, Math.min(7.2, fitZoomX, fitZoomY))
3469
+ : Math.max(0.92, Math.min(1.9, fitZoomX, fitZoomY));
3470
+ const fit = computePanForTargetCenter(
3471
+ bounds.centerX,
3472
+ bounds.centerY,
3473
+ viewport.centerX,
3474
+ viewport.centerY,
3475
+ width,
3476
+ height,
3477
+ graphState.targetZoom,
3478
+ );
3479
+ graphState.targetPanX = fit.panX;
3480
+ graphState.targetPanY = fit.panY;
3481
+ }
3482
+ } else {
3483
+ graphState.targetZoom = 1;
3484
+ graphState.targetPanX = 0;
3485
+ graphState.targetPanY = 0;
3486
+ }
3427
3487
  }
3428
3488
  applyCameraStep();
3429
3489
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "version": "0.4.2",
3
3
  "sourceCommit": "unknown",
4
- "fileCount": 96,
4
+ "fileCount": 97,
5
5
  "files": [
6
6
  {
7
7
  "path": "toolkit/AGENTS.md",
8
- "sha256": "2d9f89d03c84c4546e6430df2c26e5f53824bd4dd3b3793c215869d79e59ba67",
9
- "size": 9255
8
+ "sha256": "0eb3e48bce332ceed12f73f24fc7265f825ac98229e81f5f979edc5b8be5a91e",
9
+ "size": 14157
10
10
  },
11
11
  {
12
12
  "path": "toolkit/install.ps1",
@@ -20,13 +20,13 @@
20
20
  },
21
21
  {
22
22
  "path": "toolkit/runtimes/claude/CLAUDE_TEMPLATE.md",
23
- "sha256": "dbcc620e3f58e84279f44bdd7831926ce46cfb2cba20d5617e97f87f8e0b1ba6",
24
- "size": 3033
23
+ "sha256": "77e5f962c9d45e9f44f8125de385d74520ca7855dfc95f0bf86c24f61de8da3c",
24
+ "size": 4582
25
25
  },
26
26
  {
27
27
  "path": "toolkit/runtimes/codex/CODEX_TEMPLATE.md",
28
- "sha256": "def01a26ebc965897d9b3c9679a1b06cd1418fae637f127160254c3d8c121d65",
29
- "size": 1873
28
+ "sha256": "6e1e98dc2ef73467abe9fb26a7440a53af2a7513f8cb9b508da267488e480789",
29
+ "size": 3395
30
30
  },
31
31
  {
32
32
  "path": "toolkit/scripts/agents/run-claude-task.ps1",
@@ -90,13 +90,13 @@
90
90
  },
91
91
  {
92
92
  "path": "toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md",
93
- "sha256": "5a052c758a4f1a4565194b25914716541ce35513bea986bd1a6b6e2c2b84ebba",
94
- "size": 957
93
+ "sha256": "5823d316bd970a304a8353b9e21ec824ded500bbe4b50c31facc279c407fdda6",
94
+ "size": 2523
95
95
  },
96
96
  {
97
97
  "path": "toolkit/session/SDTK_AGENT_WORKING_RULES.md",
98
- "sha256": "93feff9eca69466f4707432a119ead134d72a84f0de8dbfd2820cfa744516e4d",
99
- "size": 867
98
+ "sha256": "a36693e3b588c2ed4b9b9934b8056e979e05bda6ed66feb021b109eea2e75051",
99
+ "size": 2125
100
100
  },
101
101
  {
102
102
  "path": "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py",
@@ -170,8 +170,8 @@
170
170
  },
171
171
  {
172
172
  "path": "toolkit/skills/sdtk-orchestrator/SKILL.md",
173
- "sha256": "76a43fd2a9b27cafa91a73c7f294106ad13d12938a413de92a4273b95b8790f1",
174
- "size": 8005
173
+ "sha256": "674ebb6be6adbbe08e0868a052c0965c3b06a4bd663e90cf9664062da695b96a",
174
+ "size": 8314
175
175
  },
176
176
  {
177
177
  "path": "toolkit/skills/sdtk-pm/SKILL.md",
@@ -363,6 +363,11 @@
363
363
  "sha256": "de563da0bc41996540b56a63b6295be5f4810c049f132c472a2a7ee816cd2884",
364
364
  "size": 16986
365
365
  },
366
+ {
367
+ "path": "toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md",
368
+ "sha256": "e383c3364bff63a7c3bd0f72a470341238c7da29027df5afd12120c2207d3052",
369
+ "size": 3449
370
+ },
366
371
  {
367
372
  "path": "toolkit/templates/docs/product/BACKLOG_TEMPLATE.md",
368
373
  "sha256": "d7e176b06b2b31c4c1eff18392eabc8f9af9cb67b2f8d0c97fc6315572fd81c3",
@@ -1,8 +1,8 @@
1
- 2d9f89d03c84c4546e6430df2c26e5f53824bd4dd3b3793c215869d79e59ba67 toolkit/AGENTS.md
1
+ 0eb3e48bce332ceed12f73f24fc7265f825ac98229e81f5f979edc5b8be5a91e toolkit/AGENTS.md
2
2
  f10d562d12532750ec7125d8925b7f56f1d4382c71be5c90e6b35c261b50c1bb toolkit/install.ps1
3
3
  1cb0643111e385a1ba606458998a977dc0c066cfdefc4e7069dd485ab2843c4e toolkit/README.md
4
- dbcc620e3f58e84279f44bdd7831926ce46cfb2cba20d5617e97f87f8e0b1ba6 toolkit/runtimes/claude/CLAUDE_TEMPLATE.md
5
- def01a26ebc965897d9b3c9679a1b06cd1418fae637f127160254c3d8c121d65 toolkit/runtimes/codex/CODEX_TEMPLATE.md
4
+ 77e5f962c9d45e9f44f8125de385d74520ca7855dfc95f0bf86c24f61de8da3c toolkit/runtimes/claude/CLAUDE_TEMPLATE.md
5
+ 6e1e98dc2ef73467abe9fb26a7440a53af2a7513f8cb9b508da267488e480789 toolkit/runtimes/codex/CODEX_TEMPLATE.md
6
6
  8616291be4aaa4fb5cb0f1f4c738c108ab79090bf767ee2b4403d6d582c150c7 toolkit/scripts/agents/run-claude-task.ps1
7
7
  5d5ddf37b902fbc8857c64f4b201da9129942c66fa54e9b53984008263862080 toolkit/scripts/agents/run-codex-task.ps1
8
8
  f726aac97132a74d64cfac238a4ad736391a67291219221bb1abb20ecf81940a toolkit/scripts/agents/validate-mailbox-formal-artifact.py
@@ -15,8 +15,8 @@ db0e580a20b43bb0af399ff3e4f7f2d826423d67bd2fa9a8121a384337a47de1 toolkit/script
15
15
  e6f3d937ce81795a41d80c7ed3864c7a315346569e2d4a36f2d6aeb4e1cf4244 toolkit/SDTK_TOOLKIT.md
16
16
  95a16a213af96c9df959435f0910462f9a740af227c41925221a5a028460edd1 toolkit/sdtk-spec.config.json
17
17
  68f8cf75ebcd1665db10a3a3b8404c90bde857d2832e3d2429b2b473489f9116 toolkit/sdtk-spec.config.profiles.example.json
18
- 5a052c758a4f1a4565194b25914716541ce35513bea986bd1a6b6e2c2b84ebba toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md
19
- 93feff9eca69466f4707432a119ead134d72a84f0de8dbfd2820cfa744516e4d toolkit/session/SDTK_AGENT_WORKING_RULES.md
18
+ 5823d316bd970a304a8353b9e21ec824ded500bbe4b50c31facc279c407fdda6 toolkit/session/SDTK_ACTIVE_BOOTSTRAP.md
19
+ a36693e3b588c2ed4b9b9934b8056e979e05bda6ed66feb021b109eea2e75051 toolkit/session/SDTK_AGENT_WORKING_RULES.md
20
20
  d6190662345da009ce8c5c235bc2cda9ef44e7e96802d103666055e26d393551 toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py
21
21
  2fd046a8b229e54ae70d0f1091f10f9dc269f02630f443cffebc0206eac5daaf toolkit/skills/sdtk-api-design-spec/SKILL.md
22
22
  b1e480f8c077927775be5b1b39010c29700c12f2c0eb052d836254bccf0c13ff toolkit/skills/sdtk-api-doc/SKILL.md
@@ -31,7 +31,7 @@ ce5af79e5c4902b9c8ceb7e8dae848a6a5a26d5b845eee94ee8aafff88990256 toolkit/skills
31
31
  099024d3b31b63a20e6a041d4a3f0062bfd4fa5b3960926112fa44a7a20972b5 toolkit/skills/sdtk-dev-backend/SKILL.md
32
32
  419def53f37a10006a54392e642f2e86ac2bfa44c8ed826159ce309f2a9a3d6a toolkit/skills/sdtk-dev-frontend/SKILL.md
33
33
  926840764de83772c12d8e7c0d07a1be28472488dd00f2ec28dc97ba77788a49 toolkit/skills/sdtk-mailbox-dispatch/SKILL.md
34
- 76a43fd2a9b27cafa91a73c7f294106ad13d12938a413de92a4273b95b8790f1 toolkit/skills/sdtk-orchestrator/SKILL.md
34
+ 674ebb6be6adbbe08e0868a052c0965c3b06a4bd663e90cf9664062da695b96a toolkit/skills/sdtk-orchestrator/SKILL.md
35
35
  90d3c9d8bb2bb3b28e81bc10c6b1799236250dfcb2ebed43eb161c78ff00a084 toolkit/skills/sdtk-pm/SKILL.md
36
36
  9e41a944a73c6960c8aa24d8930e64c1ed699ed8b410a587b042186e2d450e6e toolkit/skills/sdtk-qa/SKILL.md
37
37
  083600e458e63c6e514516a6f304440f7ab28e4bde008c5ac11c58637ea2392a toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md
@@ -70,6 +70,7 @@ dc42e5b55b097844f1c8a525d294bf77767d0b6e5ae649f40165049ab453c7b2 toolkit/templa
70
70
  d7b932d8631297b1ddcb254d516dd69fd2259ffa5c3ff23741cb3cab8bfe0caa toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md
71
71
  7730b499e42a8c78806116bea4757a0acf2c10b294f1848385c63ec053ab1719 toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md
72
72
  de563da0bc41996540b56a63b6295be5f4810c049f132c472a2a7ee816cd2884 toolkit/templates/docs/dev/OPS_HANDOFF_CREATION_RULES.md
73
+ e383c3364bff63a7c3bd0f72a470341238c7da29027df5afd12120c2207d3052 toolkit/templates/docs/discovery/REQUIREMENT_TEMPLATE.md
73
74
  d7e176b06b2b31c4c1eff18392eabc8f9af9cb67b2f8d0c97fc6315572fd81c3 toolkit/templates/docs/product/BACKLOG_TEMPLATE.md
74
75
  dcf18f2793218258d76348be38afa1a3616a24d39c43c4ef9e3e7d14cc581338 toolkit/templates/docs/product/CONDENSED_UPSTREAM_INPUT_TEMPLATE.md
75
76
  85bb843e0e8dfcd02a5afe6c120f3e79866a8da6081108ebb73addaf8ee4c35c toolkit/templates/docs/product/PRD_TEMPLATE.md
@@ -8,7 +8,9 @@ Goal: use the SDTK Suite as a coordinated operating model:
8
8
  `SDTK-SPEC` remains the orchestration and documentation entry point, but the suite is not SPEC-only.
9
9
 
10
10
  ## 0) Default Rules
11
- - If role is not specified, default to PM (entry point) and start at Phase 1.
11
+ - If role is not specified, default to Orchestrator Intake, not PM.
12
+ - Orchestrator first classifies the user request, then routes to the smallest sufficient SDTK product, role, and skill.
13
+ - PM starts only when the request is ready for formal SDTK-SPEC product initiation.
12
14
  - Do not skip phases. If inputs are missing, ask focused questions before moving on.
13
15
  - At the end of every phase, update:
14
16
  - `SHARED_PLANNING.md`
@@ -30,6 +32,56 @@ When starting a new session, read context in this order when the files exist:
30
32
 
31
33
  Do not read the entire historical session archive by default. Use `SDTK_SESSION_MEMORY_*.md` only when chronology or past acceptance details are required.
32
34
 
35
+ ## 0.3) Orchestrator-First Intake Protocol
36
+ For every unprefixed user request:
37
+ 1. Classify the request intent before selecting PM/BA/ARCH/DEV/QA or a downstream product lane.
38
+ 2. Route to the smallest sufficient workflow:
39
+ - unclear idea or early concept -> brainstorm / requirement clarification, then create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`
40
+ - formal feature discovery or planning -> SDTK-SPEC pipeline
41
+ - implementation, bug fix, refactor, verification, or ship-ready code -> SDTK-CODE
42
+ - deploy, release, infrastructure, CI/CD, monitoring, incident, backup, security-infra, or ops verification -> SDTK-OPS
43
+ - documentation graph, Atlas viewer, Atlas Ask, project ingest, project refresh, or project audit -> the matching Atlas/project command or workflow
44
+ - review or release decision -> review/QA workflow
45
+ 3. Ask focused questions only when missing information blocks safe routing.
46
+ 4. Do not force raw ideas directly into PM Phase 1. Clarify the requirement first in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`, then start PM initiation only after the artifact is marked `READY_FOR_PM_INITIATION`.
47
+ 5. When routing creates artifacts, record decisions and open questions in the correct SDTK artifact.
48
+
49
+ ## 0.4) Intent-To-Skill Routing Matrix
50
+ Use this compact matrix during intake so the agent picks the smallest sufficient workflow instead of defaulting everything to PM:
51
+
52
+ | User intent | Primary route | Output expectation |
53
+ |---|---|---|
54
+ | Raw idea | Brainstorm / requirement clarification | `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` with clarified problem, scope, assumptions, open questions, and readiness |
55
+ | Approved idea ready for product planning | `SDTK-SPEC` PM initiation | `REQUIREMENT_[FEATURE_KEY]` marked `READY_FOR_PM_INITIATION`, then `PROJECT_INITIATION` kickoff |
56
+ | Formal feature delivery | `SDTK-SPEC` pipeline | PM -> BA -> ARCH -> DEV planning -> CODE handoff -> QA |
57
+ | Build, fix, or refactor implementation | `SDTK-CODE` | Planned, implemented, verified code change |
58
+ | Debug failure or unexpected behavior | `SDTK-CODE` debug | Root cause, bounded fix, regression verification |
59
+ | Deployment, release, infra, or CI/CD work | `SDTK-OPS` | Ops plan or execution plus verification evidence |
60
+ | Code review or spec review | Review / QA workflow | Findings, risks, blockers, acceptance signal |
61
+ | Atlas graph build or viewer work | `sdtk-spec atlas` workflow | Local `.sdtk/atlas` graph or viewer result |
62
+ | Atlas Ask | Gated Atlas Ask workflow | Grounded answer or explicit entitlement/runtime blocker |
63
+ | Existing project scan: project ingest, project refresh, or project audit | Matching premium project workflow | Project-local foundation, refresh, or audit result without overclaiming entitlement |
64
+ | "what should we do next" | Orchestrator state review | Recommended next action with rationale and lane choice |
65
+
66
+ Guardrails:
67
+ - Explicit user role prefix wins unless safety or missing critical inputs block execution.
68
+ - Raw idea clarification should use `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`; do not widen BK-099 into generator automation, package sync, or BK-100 validation work.
69
+ - Do not claim Atlas Ask or project ingest/project refresh/project audit availability unless entitlement/runtime access is actually present.
70
+
71
+ ## 0.5) Proceed-Vs-Ask Decision Rules
72
+ Ask clarification when:
73
+ 1. the requested outcome is ambiguous
74
+ 2. safety, security, or release impact is unclear
75
+ 3. the target repo, project, or path is missing
76
+ 4. implementation is requested without an acceptance boundary
77
+ 5. the next command could mutate external state
78
+
79
+ Proceed when:
80
+ 1. the intent and target are clear
81
+ 2. the task is read-only analysis
82
+ 3. the user already approved the relevant plan or spec
83
+ 4. the requested change is bounded and verifiable
84
+
33
85
  ## 0.1) Clarification Protocol
34
86
  Apply for all roles (`/pm`, `/ba`, `/arch`, `/dev`, `/qa`):
35
87
  1. If there is ambiguity or missing data, log `Open Questions` as `OQ-xx` in the current phase artifact.
@@ -40,9 +92,15 @@ Apply for all roles (`/pm`, `/ba`, `/arch`, `/dev`, `/qa`):
40
92
  - asking the user if source information is still missing.
41
93
  5. Record decisions in PRD (`Decision Log`) and update the originating `OQ-xx` with resolution.
42
94
 
95
+ For raw ideas before PM initiation:
96
+ 1. Use `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` as the canonical clarification artifact.
97
+ 2. Record scope, non-goals, assumptions, constraints, open questions, and readiness there before opening `PROJECT_INITIATION`.
98
+ 3. Treat the discovery artifact as a bridge into PM initiation, not as a PRD replacement.
99
+
43
100
  ## 1) Role Selection In One Message
44
101
  When the user prefixes a message, execute that role:
45
- - `/pm` (entry point + orchestrator)
102
+ - `/orchestrator` (default intake + routing)
103
+ - `/pm` (formal product initiation + planning)
46
104
  - `/ba`
47
105
  - `/arch`
48
106
  - `/dev`
@@ -54,6 +112,9 @@ Notes:
54
112
  - There is no separate `/tester` role. Test-case design belongs to QA with `sdtk-test-case-spec`.
55
113
 
56
114
  ## 2) Standard 6-Phase Pipeline
115
+ Use this formal pipeline after Orchestrator Intake determines that the request is ready for SDTK-SPEC feature delivery.
116
+
117
+ 0. Discovery / Clarification when needed -> `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`
57
118
  1. PM Initiation -> `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md`
58
119
  2. BA Analysis -> `docs/specs/BA_SPEC_[FEATURE_KEY].md`
59
120
  3. PM Planning -> `docs/product/PRD_[FEATURE_KEY].md` + `docs/product/BACKLOG_[FEATURE_KEY].md`
@@ -61,6 +122,11 @@ Notes:
61
122
  5. DEV Planning + SDTK-CODE Handoff -> `docs/dev/FEATURE_IMPL_PLAN_[FEATURE_KEY].md` + `docs/dev/CODE_HANDOFF_[FEATURE_KEY].json`
62
123
  6. QA Testing -> `docs/qa/[FEATURE_KEY]_TEST_CASE.md` + `docs/qa/QA_RELEASE_REPORT_[FEATURE_KEY].md`
63
124
 
125
+ Notes:
126
+ - Phase 0 is only for raw ideas, unclear concepts, and early feature discovery.
127
+ - PM initiation starts only after `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` is marked `READY_FOR_PM_INITIATION`.
128
+ - The discovery artifact does not replace PM, BA, PRD, backlog, or architecture deliverables.
129
+
64
130
  Default bridge after Phase 5 planning output:
65
131
  - `/dev` emits the handoff
66
132
  - SDTK-CODE performs `start -> plan -> build -> verify -> ship`
@@ -18,8 +18,10 @@ This file defines runtime guidance for Claude Code sessions in projects using th
18
18
  - `SDTK-SPEC`: orchestration, specs, planning, architecture, QA artifacts
19
19
  - `SDTK-CODE`: implementation, bug fixing, refactoring, verification, ship flow
20
20
  - `SDTK-OPS`: deploy, infra, CI/CD, monitoring, incident, ops verification
21
- - `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA
22
- - Entry point: `/orchestrator` (recommended) or `/pm`
21
+ - Default unprefixed entry point: Orchestrator Intake.
22
+ - Orchestrator classifies the user request before selecting a role, product lane, or skill.
23
+ - `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA after intake decides formal feature delivery is ready.
24
+ - Entry point command: `/orchestrator` (recommended). Use `/pm` only for formal product initiation.
23
25
  - Role commands: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`
24
26
  - Sub-skill commands: `/api-doc`, `/api-design-spec`, `/screen-design-spec`, `/design-layout`, `/test-case-spec`, `/dev-backend`, `/dev-frontend`
25
27
  - Shared state files:
@@ -34,19 +36,33 @@ Read these in order when they exist:
34
36
  4. issue-specific controller spec and implementation plan
35
37
 
36
38
  Routing rules:
37
- - requirements/spec/planning/architecture/test artifacts -> `SDTK-SPEC`
38
- - build feature or fix code -> `SDTK-CODE` when available
39
+ - Raw idea -> brainstorm / requirement clarification, then create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation
40
+ - Formal feature delivery and approved planning work -> `SDTK-SPEC`
41
+ - build feature, fix code, refactor, or debug failure -> `SDTK-CODE` when available
39
42
  - deploy/release/infra/ops -> `SDTK-OPS` when available
43
+ - Atlas graph/viewer, Atlas Ask, project ingest, project refresh, and project audit -> matching SDTK command or workflow
44
+ - "what should we do next" -> Orchestrator state review using the smallest sufficient workflow
45
+
46
+ Proceed-vs-ask summary:
47
+ - Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation, or the next step could mutate external state.
48
+ - Proceed when intent and target are clear, the task is read-only analysis, the plan/spec is already approved, or the change is bounded and verifiable.
40
49
 
41
50
  If only SPEC runtime assets are installed:
42
51
  - keep `/dev` bounded to planning and `CODE_HANDOFF`
43
52
  - do not claim that SDTK-CODE or SDTK-OPS runtime assets are already installed
44
53
 
54
+ Discovery artifact rule:
55
+ - PM initiation starts only after `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` is marked `READY_FOR_PM_INITIATION`.
56
+ - Use `NEEDS_MORE_DISCOVERY` or `NOT_ACTIONABLE_YET` when the request is not ready.
57
+ - The discovery artifact is a pre-PM clarification bridge, not a PRD or BA replacement.
58
+
45
59
  ## 3) Minimal Session Flow
46
- 1. Start with `/orchestrator` or `/pm` to define feature scope.
47
- 2. Move phase-by-phase without skipping gates.
48
- 3. Keep traceability from requirements to design, implementation, and tests.
49
- 4. Require code review completion before QA release decision.
60
+ 1. Start with Orchestrator Intake unless the user explicitly selects a role.
61
+ 2. Classify intent and choose the smallest sufficient SDTK workflow.
62
+ 3. For raw ideas, finish discovery and readiness in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation.
63
+ 4. For formal feature delivery, move PM -> BA -> ARCH -> DEV -> QA without skipping gates.
64
+ 5. Keep traceability from requirements to design, implementation, and tests.
65
+ 6. Require code review completion before QA release decision.
50
66
 
51
67
  ## 4) Installed Skills
52
68
  Skills are installed at `.claude/skills/` and provide slash commands:
@@ -18,7 +18,9 @@ This file defines runtime guidance for Codex sessions in projects using the SDTK
18
18
  - `SDTK-SPEC`: orchestration, specs, planning, architecture, QA artifacts
19
19
  - `SDTK-CODE`: implementation, bug fixing, refactoring, verification, ship flow
20
20
  - `SDTK-OPS`: deploy, infra, CI/CD, monitoring, incident, ops verification
21
- - `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA
21
+ - Default unprefixed entry point: Orchestrator Intake.
22
+ - Orchestrator classifies the user request before selecting a role, product lane, or skill.
23
+ - `SDTK-SPEC` phase workflow remains: PM -> BA -> ARCH -> DEV -> QA after intake decides formal feature delivery is ready.
22
24
  - Role tags: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`
23
25
  - Shared state files:
24
26
  - `SHARED_PLANNING.md`
@@ -32,19 +34,33 @@ Read these in order when they exist:
32
34
  4. issue-specific controller spec and implementation plan
33
35
 
34
36
  Routing rules:
35
- - requirements/spec/planning/architecture/test artifacts -> `SDTK-SPEC`
36
- - build feature or fix code -> `SDTK-CODE` when available
37
+ - Raw idea -> brainstorm / requirement clarification, then create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation
38
+ - Formal feature delivery and approved planning work -> `SDTK-SPEC`
39
+ - build feature, fix code, refactor, or debug failure -> `SDTK-CODE` when available
37
40
  - deploy/release/infra/ops -> `SDTK-OPS` when available
41
+ - Atlas graph/viewer, Atlas Ask, project ingest, project refresh, and project audit -> matching SDTK command or workflow
42
+ - "what should we do next" -> Orchestrator state review using the smallest sufficient workflow
43
+
44
+ Proceed-vs-ask summary:
45
+ - Ask clarification when the outcome is ambiguous, the target path/repo is missing, there is no acceptance boundary for implementation, or the next step could mutate external state.
46
+ - Proceed when intent and target are clear, the task is read-only analysis, the plan/spec is already approved, or the change is bounded and verifiable.
38
47
 
39
48
  If only SPEC runtime assets are installed:
40
49
  - keep `/dev` bounded to planning and `CODE_HANDOFF`
41
50
  - do not claim that SDTK-CODE or SDTK-OPS runtime assets are already installed
42
51
 
52
+ Discovery artifact rule:
53
+ - PM initiation starts only after `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` is marked `READY_FOR_PM_INITIATION`.
54
+ - Use `NEEDS_MORE_DISCOVERY` or `NOT_ACTIONABLE_YET` when the request is not ready.
55
+ - The discovery artifact is a pre-PM clarification bridge, not a PRD or BA replacement.
56
+
43
57
  ## 3) Minimal Session Flow
44
- 1. Start with `/pm` to define feature scope.
45
- 2. Move phase-by-phase without skipping gates.
46
- 3. Keep traceability from requirements to design, implementation, and tests.
47
- 4. Require code review completion before QA release decision.
58
+ 1. Start with Orchestrator Intake unless the user explicitly selects a role.
59
+ 2. Classify intent and choose the smallest sufficient SDTK workflow.
60
+ 3. For raw ideas, finish discovery and readiness in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation.
61
+ 4. For formal feature delivery, move PM -> BA -> ARCH -> DEV -> QA without skipping gates.
62
+ 5. Keep traceability from requirements to design, implementation, and tests.
63
+ 6. Require code review completion before QA release decision.
48
64
 
49
65
  ## 4) References
50
66
  - `toolkit/SDTK_TOOLKIT.md`
@@ -7,6 +7,16 @@ Owner: SDTK Core Team
7
7
  Purpose: give new sessions a compact bootstrap layer without requiring a long manual prompt.
8
8
 
9
9
  ## 1) Suite Routing Truth
10
+ - Default unprefixed user requests start with Orchestrator Intake.
11
+ - Orchestrator classifies intent first, then routes to the smallest sufficient SDTK product, role, and skill.
12
+ - PM starts only when the request is ready for formal SDTK-SPEC product initiation.
13
+ - Compact intent routing:
14
+ - Raw idea -> brainstorm / requirement clarification in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`
15
+ - Formal feature delivery -> `SDTK-SPEC`
16
+ - build/fix/refactor/debug -> `SDTK-CODE`
17
+ - deploy/release/infra/CI/CD -> `SDTK-OPS`
18
+ - Atlas Ask / Atlas graph / project ingest / project refresh / project audit -> matching SDTK command or workflow
19
+ - "what should we do next" -> Orchestrator state review
10
20
  - `SDTK-SPEC`
11
21
  - orchestration, discovery, specs, planning, architecture, QA artifacts
12
22
  - `SDTK-CODE`
@@ -23,6 +33,13 @@ Read these in order:
23
33
 
24
34
  ## 3) Consumer Project Notes
25
35
  - This file is a bootstrap layer, not a complete historical memory archive.
36
+ - If the user sends a raw idea, clarify the requirement in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before formal PM initiation.
37
+ - Start PM initiation only after the discovery artifact is marked `READY_FOR_PM_INITIATION`.
38
+ - Use `NEEDS_MORE_DISCOVERY` or `NOT_ACTIONABLE_YET` when the request is not ready.
39
+ - Treat the discovery artifact as a lightweight bridge into PM initiation, not a PRD replacement.
40
+ - If the request is implementation or operations work, route to SDTK-CODE or SDTK-OPS when available instead of forcing the task into SPEC-only wording.
41
+ - Ask clarification when the request is ambiguous, the target path/repo is missing, there is no acceptance boundary, or the next step could mutate external state.
42
+ - Proceed when intent and target are clear, the task is read-only analysis, the plan/spec is approved, or the change is bounded and verifiable.
26
43
  - Update project-specific truths here after install if the repo has:
27
44
  - a private/public repo split
28
45
  - published package versions
@@ -7,19 +7,43 @@ Owner: SDTK Core Team
7
7
  Purpose: keep agent behavior stable across fresh sessions.
8
8
 
9
9
  ## 1) Working Contract
10
- 1. Clear spec before implementation for non-trivial work.
11
- 2. Do not widen issue scope without approval.
12
- 3. Verify before claiming done.
13
- 4. Keep changes bounded and auditable.
14
- 5. Do not commit secrets or `.env` files.
10
+ 1. Start unprefixed requests with Orchestrator Intake.
11
+ 2. Classify intent before choosing PM/BA/ARCH/DEV/QA or a downstream product lane.
12
+ 3. Clear spec before implementation for non-trivial work.
13
+ 4. Do not widen issue scope without approval.
14
+ 5. Verify before claiming done.
15
+ 6. Keep changes bounded and auditable.
16
+ 7. Do not commit secrets or `.env` files.
15
17
 
16
18
  ## 2) Product Routing
19
+ - Raw idea -> brainstorm / requirement clarification in `docs/discovery/REQUIREMENT_[FEATURE_KEY].md` before PM initiation
20
+ - Formal feature delivery -> `SDTK-SPEC`
17
21
  - `SDTK-SPEC` for specs, planning, architecture, QA artifacts, release gates
18
- - `SDTK-CODE` for implementation, bug fixing, refactor, verify, ship
22
+ - `SDTK-CODE` for build, implementation, bug fixing, refactor, debug, verify, ship
19
23
  - `SDTK-OPS` for deploy, infra, CI/CD, monitoring, incident, ops work
24
+ - Atlas Ask / Atlas graph / project ingest / project audit / project refresh -> matching SDTK command or workflow
25
+ - "what should we do next" -> Orchestrator state review using the smallest sufficient workflow
26
+
27
+ Ask clarification when:
28
+ - the request is ambiguous
29
+ - the target repo, project, or path is missing
30
+ - implementation is requested without an acceptance boundary
31
+ - the next step could mutate external state
32
+
33
+ Proceed when:
34
+ - intent and target are clear
35
+ - the task is read-only analysis
36
+ - the plan/spec is approved
37
+ - the requested change is bounded and verifiable
20
38
 
21
39
  If a task is code or ops work, do not keep it framed as SPEC-only.
22
40
 
41
+ Discovery gating:
42
+ - For raw ideas, create or update `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`.
43
+ - Start PM initiation only after the artifact is marked `READY_FOR_PM_INITIATION`.
44
+ - Use `NEEDS_MORE_DISCOVERY` or `NOT_ACTIONABLE_YET` when the request is not ready.
45
+ - Do not treat the discovery artifact as a replacement for `PROJECT_INITIATION`, PRD, BA spec, or backlog.
46
+
23
47
  ## 3) Verification Contract
24
48
  - No `done`, `pass`, or `ready` claim without fresh command evidence.
25
49
  - If verification is blocked, state the blocker and keep the task open.
@@ -17,14 +17,17 @@ description: "Orchestrate a full 6-phase SDLC multi-agent workflow (PM/BA/ARCH/D
17
17
  - `visible` and `working` are separate runtime checks; `working` requires observable controller action from a bounded request.
18
18
  - Until runtime-specific direct syntax is validated, continue via the repo-local orchestrator contract in the current session.
19
19
 
20
- ## Initialize
21
- - Ensure feature key + feature name exist (ask if missing).
22
- - Read `sdtk-spec.config.json` (project stack + commands) if present.
23
- - If `toolkit/scripts/init-feature.ps1` exists: run it to create skeleton artifacts; otherwise create the same files from `toolkit/templates/`.
24
-
25
- ## Execute pipeline (one phase per turn)
26
- - Default role: PM (entry point) if user did not specify.
27
- - Respect role tags: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`.
20
+ ## Initialize
21
+ - Start as Orchestrator Intake for unprefixed user requests.
22
+ - Classify intent before choosing PM/BA/ARCH/DEV/QA or downstream SDTK-CODE/SDTK-OPS paths.
23
+ - Use brainstorm / requirement clarification for unclear ideas before formal PM initiation.
24
+ - Ensure feature key + feature name exist (ask if missing).
25
+ - Read `sdtk-spec.config.json` (project stack + commands) if present.
26
+ - If `toolkit/scripts/init-feature.ps1` exists: run it to create skeleton artifacts; otherwise create the same files from `toolkit/templates/`.
27
+
28
+ ## Execute pipeline (one phase per turn)
29
+ - Default unprefixed role: Orchestrator Intake. Select PM only when the request is ready for formal SDTK-SPEC product initiation.
30
+ - Respect role tags: `/pm`, `/ba`, `/arch`, `/dev`, `/qa`.
28
31
  - For each phase:
29
32
  - Create/update the phase artifact(s) in `docs/`.
30
33
  - If phase is ARCH and API contract/flow is in scope, invoke `sdtk-api-doc` to produce/update `docs/api/[FeaturePascal]_API.yaml`, `docs/api/[FEATURE_KEY]_ENDPOINTS.md`, and `docs/api/[feature_snake]_api_flow_list.txt`.
@@ -0,0 +1,155 @@
1
+ # REQUIREMENT: {{FEATURE_KEY}}
2
+
3
+ **Document ID:** REQUIREMENT_{{FEATURE_KEY}}
4
+ **Version:** 1.0.0
5
+ **Date:** {{DATE}}
6
+ **Author:** Orchestrator / Discovery Agent
7
+ **Status:** DRAFT - Pre-PM Discovery
8
+
9
+ Purpose: lightweight discovery artifact for raw ideas and unclear feature concepts before formal PM initiation.
10
+
11
+ This artifact is:
12
+ - pre-PM initiation
13
+ - the canonical clarification record for `docs/discovery/REQUIREMENT_[FEATURE_KEY].md`
14
+ - not a replacement for `PROJECT_INITIATION`, PRD, BA spec, backlog, or architecture artifacts
15
+
16
+ ---
17
+
18
+ ## 1. Problem / Idea Summary
19
+
20
+ **Idea Name:** {{FEATURE_NAME}}
21
+
22
+ ### 1.1 Summary
23
+
24
+ ### 1.2 Success Signal (optional)
25
+
26
+ ---
27
+
28
+ ## 2. User Goal / Desired Outcome
29
+
30
+ ### 2.1 Desired Outcome
31
+
32
+ ### 2.2 Why This Matters Now
33
+
34
+ ---
35
+
36
+ ## 3. Target Users / Stakeholders
37
+
38
+ | Group | Role / Stakeholder | Need / Expectation |
39
+ |---|---|---|
40
+ | TG-01 | TBD | TBD |
41
+
42
+ ---
43
+
44
+ ## 4. Current Pain / Trigger
45
+
46
+ ### 4.1 Current Situation
47
+
48
+ ### 4.2 Pain, Friction, or Opportunity
49
+
50
+ ### 4.3 Triggering Context
51
+
52
+ ---
53
+
54
+ ## 5. Proposed Scope
55
+
56
+ ### 5.1 In Scope
57
+ - TBD
58
+
59
+ ### 5.2 Candidate Workflows / Lanes Affected (optional)
60
+ - TBD
61
+
62
+ ---
63
+
64
+ ## 6. Out of Scope / Non-Goals
65
+
66
+ - TBD
67
+
68
+ ---
69
+
70
+ ## 7. Assumptions
71
+
72
+ | ID | Assumption | Confidence | Notes |
73
+ |---|---|---|---|
74
+ | A-01 | TBD | TBD | TBD |
75
+
76
+ ---
77
+
78
+ ## 8. Constraints / Dependencies
79
+
80
+ | ID | Constraint / Dependency | Type | Impact | Notes |
81
+ |---|---|---|---|---|
82
+ | C-01 | TBD | TBD | TBD | TBD |
83
+
84
+ ---
85
+
86
+ ## 9. Open Questions
87
+
88
+ | OQ-ID | Question | Why It Matters | Owner | Status |
89
+ |---|---|---|---|---|
90
+ | OQ-01 | TBD | TBD | TBD | OPEN |
91
+
92
+ ---
93
+
94
+ ## 10. Candidate Feature Key
95
+
96
+ **Candidate Feature Key:** `{{FEATURE_KEY}}`
97
+
98
+ Naming note:
99
+ - use a stable candidate key once the idea is distinct enough to track
100
+ - rename only if the scope materially changes before PM initiation
101
+
102
+ ---
103
+
104
+ ## 11. Risks (optional)
105
+
106
+ | Risk ID | Risk | Impact | Mitigation / Note |
107
+ |---|---|---|---|
108
+ | R-01 | TBD | TBD | TBD |
109
+
110
+ ---
111
+
112
+ ## 12. Readiness Decision
113
+
114
+ **Decision:**
115
+ - `READY_FOR_PM_INITIATION`
116
+ - `NEEDS_MORE_DISCOVERY`
117
+ - `NOT_ACTIONABLE_YET`
118
+
119
+ **Current Decision:** `NEEDS_MORE_DISCOVERY`
120
+
121
+ Decision rules:
122
+ - `READY_FOR_PM_INITIATION`
123
+ - problem is clear
124
+ - target users or stakeholders are identified
125
+ - scope and non-goals are bounded enough for PM kickoff
126
+ - open questions do not block PM initiation
127
+ - `NEEDS_MORE_DISCOVERY`
128
+ - direction is promising but key assumptions, constraints, or boundaries remain unresolved
129
+ - `NOT_ACTIONABLE_YET`
130
+ - request is too vague, conflicting, speculative, or unsupported to begin PM initiation safely
131
+
132
+ ---
133
+
134
+ ## 13. Handoff Criteria To PM Initiation
135
+
136
+ Move to `docs/product/PROJECT_INITIATION_[FEATURE_KEY].md` only when:
137
+ 1. this discovery artifact is marked `READY_FOR_PM_INITIATION`
138
+ 2. the problem and desired outcome are understandable without relying on chat history alone
139
+ 3. target users or stakeholders are identified well enough for PM kickoff
140
+ 4. scope and non-scope are bounded enough to avoid a false PM start
141
+ 5. remaining open questions are documented and are not blocking PM initiation
142
+
143
+ PM initiation handoff note:
144
+ - this document is the discovery bridge into formal PM initiation
145
+ - PM still owns `PROJECT_INITIATION`, PRD, backlog, and downstream SPEC artifacts
146
+
147
+ ---
148
+
149
+ ## APPENDIX A: Original Input (optional)
150
+
151
+ Paste source requirement text here when useful for traceability.
152
+
153
+ ## APPENDIX B: Literal English Translation (optional)
154
+
155
+ If Appendix A is VI/JP, add a literal English translation here.
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "name": "sdtk-spec-kit",
3
- "version": "0.4.2",
4
- "description": "SDTK-SPEC CLI toolkit for deterministic software documentation workflows via the sdtk-spec command",
5
- "bin": {
6
- "sdtk-spec": "bin/sdtk.js"
7
- },
8
- "main": "src/index.js",
9
- "type": "commonjs",
10
- "files": [
11
- "bin/",
12
- "src/",
13
- "assets/"
14
- ],
15
- "scripts": {
16
- "test": "npm run verify:payload \u0026\u0026 npm run pack:smoke",
17
- "build:payload": "powershell -ExecutionPolicy Bypass -File scripts/sync-toolkit-assets.ps1 \u0026\u0026 powershell -ExecutionPolicy Bypass -File scripts/build-toolkit-manifest.ps1",
18
- "verify:payload": "node -e \"require(\u0027./src/lib/toolkit-payload\u0027).verify()\"",
19
- "pack:smoke": "npm pack --dry-run",
20
- "pack:release": "npm pack",
21
- "prepublishOnly": "node -e \"require(\u0027./src/lib/toolkit-payload\u0027).verify()\""
22
- },
23
- "engines": {
24
- "node": "\u003e=18.13.0"
25
- },
26
- "keywords": [
27
- "sdtk",
28
- "sdtk-spec",
29
- "sdtk-spec-kit",
30
- "cli",
31
- "documentation",
32
- "toolkit",
33
- "dockkit"
34
- ],
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/codexsdtk/sdtk-toolkit.git",
39
- "directory": "products/sdtk-spec/distribution/sdtk-spec-kit"
40
- },
41
- "homepage": "https://sdtk.dev",
42
- "bugs": {
43
- "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
44
- },
45
- "publishConfig": {
46
- "access": "public"
47
- }
2
+ "name": "sdtk-spec-kit",
3
+ "version": "0.4.4",
4
+ "description": "SDTK-SPEC CLI toolkit for deterministic software documentation workflows via the sdtk-spec command",
5
+ "bin": {
6
+ "sdtk-spec": "bin/sdtk.js"
7
+ },
8
+ "main": "src/index.js",
9
+ "type": "commonjs",
10
+ "files": [
11
+ "bin/",
12
+ "src/",
13
+ "assets/"
14
+ ],
15
+ "scripts": {
16
+ "test": "npm run verify:payload && npm run pack:smoke",
17
+ "build:payload": "powershell -ExecutionPolicy Bypass -File scripts/sync-toolkit-assets.ps1 && powershell -ExecutionPolicy Bypass -File scripts/build-toolkit-manifest.ps1",
18
+ "verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
19
+ "pack:smoke": "npm pack --dry-run",
20
+ "pack:release": "npm pack",
21
+ "prepublishOnly": "node -e \"require('./src/lib/toolkit-payload').verify()\""
22
+ },
23
+ "engines": {
24
+ "node": ">=18.13.0"
25
+ },
26
+ "keywords": [
27
+ "sdtk",
28
+ "sdtk-spec",
29
+ "sdtk-spec-kit",
30
+ "cli",
31
+ "documentation",
32
+ "toolkit",
33
+ "dockkit"
34
+ ],
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/codexsdtk/sdtk-toolkit.git",
39
+ "directory": "products/sdtk-spec/distribution/sdtk-spec-kit"
40
+ },
41
+ "homepage": "https://sdtk.dev",
42
+ "bugs": {
43
+ "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
48
  }
@@ -42,7 +42,7 @@ async function postActivationRequest({
42
42
  licenseKey,
43
43
  machineId,
44
44
  }) {
45
- const pkg = require("../package.json");
45
+ const pkg = require("../../package.json");
46
46
  const body = {
47
47
  license_key: licenseKey,
48
48
  machine_id: machineId,
@@ -57,13 +57,37 @@ async function postActivationRequest({
57
57
  headers: { "Content-Type": "application/json" },
58
58
  body: JSON.stringify(body),
59
59
  });
60
-
61
- const data = await response.json();
60
+ const rawText = await response.text();
61
+ let data = null;
62
+ if (rawText) {
63
+ try {
64
+ data = JSON.parse(rawText);
65
+ } catch (_err) {
66
+ data = null;
67
+ }
68
+ }
62
69
 
63
70
  if (!response.ok) {
71
+ const deniedReason =
72
+ data &&
73
+ data.decision === "denied" &&
74
+ data.manifest &&
75
+ typeof data.manifest.error === "string"
76
+ ? data.manifest.error
77
+ : null;
78
+ return {
79
+ success: false,
80
+ error:
81
+ deniedReason ||
82
+ (data && typeof data.error === "string" ? data.error : null) ||
83
+ `Activation API returned status ${response.status}`,
84
+ };
85
+ }
86
+
87
+ if (!data || typeof data !== "object") {
64
88
  return {
65
89
  success: false,
66
- error: data.error || `Activation API returned status ${response.status}`,
90
+ error: "Activation API returned a non-JSON response",
67
91
  };
68
92
  }
69
93
 
@@ -248,12 +272,12 @@ function rollbackPartialState() {
248
272
  *
249
273
  * @param {object} options
250
274
  * @param {string} options.licenseKey - Activation key from user
251
- * @param {string} [options.activationUrl] - Override API URL (default: https://sdtk-spec.com/api/activate)
275
+ * @param {string} [options.activationUrl] - Override API URL (default: https://sdtk.dev/api/activate)
252
276
  * @returns {Promise<{ success: boolean, decision?: string, message: string, exitCode: number }>}
253
277
  */
254
278
  async function activateWithLicense({
255
279
  licenseKey,
256
- activationUrl = "https://sdtk-spec.com/api/activate",
280
+ activationUrl = process.env.SDTK_ACTIVATION_URL || "https://sdtk.dev/api/activate",
257
281
  } = {}) {
258
282
  const result = {
259
283
  success: false,