sdtk-kit 0.3.0

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 (75) hide show
  1. package/README.md +131 -0
  2. package/assets/manifest/toolkit-bundle.manifest.json +303 -0
  3. package/assets/manifest/toolkit-bundle.sha256.txt +59 -0
  4. package/assets/toolkit/toolkit/AGENTS.md +103 -0
  5. package/assets/toolkit/toolkit/install.ps1 +155 -0
  6. package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +32 -0
  7. package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +32 -0
  8. package/assets/toolkit/toolkit/scripts/init-feature.ps1 +253 -0
  9. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +181 -0
  10. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +116 -0
  11. package/assets/toolkit/toolkit/sdtk.config.json +28 -0
  12. package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +50 -0
  13. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +78 -0
  14. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +212 -0
  15. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +397 -0
  16. package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +565 -0
  17. package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +36 -0
  18. package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +397 -0
  19. package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +43 -0
  20. package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +212 -0
  21. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +397 -0
  22. package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
  23. package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +24 -0
  24. package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +21 -0
  25. package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +20 -0
  26. package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +17 -0
  27. package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +15 -0
  28. package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +44 -0
  29. package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +26 -0
  30. package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +22 -0
  31. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +59 -0
  32. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
  33. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -0
  34. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -0
  35. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +76 -0
  36. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -0
  37. package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +249 -0
  38. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +65 -0
  39. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +129 -0
  40. package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -0
  41. package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -0
  42. package/assets/toolkit/toolkit/templates/README.md +56 -0
  43. package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +80 -0
  44. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +212 -0
  45. package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +62 -0
  46. package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -0
  47. package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -0
  48. package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +397 -0
  49. package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -0
  50. package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -0
  51. package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -0
  52. package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +49 -0
  53. package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +73 -0
  54. package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -0
  55. package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -0
  56. package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -0
  57. package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +61 -0
  58. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -0
  59. package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -0
  60. package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -0
  61. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
  62. package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +160 -0
  63. package/bin/sdtk.js +15 -0
  64. package/package.json +47 -0
  65. package/src/commands/auth.js +85 -0
  66. package/src/commands/generate.js +177 -0
  67. package/src/commands/help.js +69 -0
  68. package/src/commands/init.js +73 -0
  69. package/src/index.js +56 -0
  70. package/src/lib/args.js +116 -0
  71. package/src/lib/errors.js +41 -0
  72. package/src/lib/github-access.js +68 -0
  73. package/src/lib/powershell.js +85 -0
  74. package/src/lib/state.js +83 -0
  75. package/src/lib/toolkit-payload.js +99 -0
@@ -0,0 +1,139 @@
1
+ # BA SPEC: {{FEATURE_KEY}} ({{FEATURE_NAME}})
2
+
3
+ **Document ID:** BA_SPEC_{{FEATURE_KEY}}
4
+ **Version:** 1.0.0
5
+ **Date:** {{DATE}}
6
+ **Author:** BA Agent
7
+ **Status:** DRAFT - Ready for PM Review
8
+
9
+ ---
10
+
11
+ ## Abbreviations
12
+
13
+ | No | Abbreviation | Meaning |
14
+ | ---: | --- | --- |
15
+ | 1 | API | Application Programming Interface |
16
+ | 2 | DB | Database |
17
+ | 3 | UI | User Interface |
18
+ | 4 | UX | User Experience |
19
+ | 5 | BR | Business Rule |
20
+ | 6 | UC | Use Case |
21
+ | 7 | AC | Acceptance Criteria |
22
+ | 8 | NFR | Non-Functional Requirement |
23
+ | 9 | OQ | Open Question |
24
+ | 10 | REQ | Requirement |
25
+
26
+ ---
27
+
28
+ ## 1. DOMAIN ANALYSIS
29
+
30
+ ### 1.1 Domain Glossary
31
+
32
+ | No | Term | Definition | Example |
33
+ | ---: | --- | --- | --- |
34
+ | 1 | TBD | TBD | TBD |
35
+
36
+ ### 1.2 Business Rules
37
+
38
+ | No | Rule ID | Rule Description | Type | Related REQ |
39
+ | ---: | --- | --- | --- | --- |
40
+ | 1 | BR-01 | TBD | Mandatory | REQ-01 |
41
+
42
+ ### 1.3 Non-Functional Requirements
43
+
44
+ | No | NFR ID | Category | Requirement | Target |
45
+ | ---: | --- | --- | --- | --- |
46
+ | 1 | NFR-01 | Performance | TBD | TBD |
47
+
48
+ ---
49
+
50
+ ## 2. USE CASES
51
+
52
+ | No | UC ID | Use Case Name | Primary Actor | Related REQ |
53
+ | ---: | --- | --- | --- | --- |
54
+ | 1 | UC-01 | TBD | TBD | REQ-01 |
55
+
56
+ ---
57
+
58
+ ## 3. DATA MODEL (Logical)
59
+
60
+ | No | Entity | Description | Key Fields |
61
+ | ---: | --- | --- | --- |
62
+ | 1 | TBD | TBD | TBD |
63
+
64
+ ---
65
+
66
+ ## 4. CONTRACTS SUMMARY
67
+
68
+ ### 4.1 API Endpoints (High-level)
69
+
70
+ | No | Endpoint | Method | Purpose | Related UC |
71
+ | ---: | --- | --- | --- | --- |
72
+ | 1 | `/api/v1/...` | GET | TBD | UC-01 |
73
+
74
+ ### 4.2 UI Screens (if applicable)
75
+
76
+ | No | Screen ID | Screen Name | Purpose | Related UC |
77
+ | ---: | --- | --- | --- | --- |
78
+ | 1 | SCR-01 | TBD | TBD | UC-01 |
79
+
80
+ ### 4.3 Acceptance Criteria (high-level)
81
+
82
+ | No | AC ID | Acceptance Criteria | Related UC | Related BR |
83
+ | ---: | --- | --- | --- | --- |
84
+ | 1 | AC-01-01 | TBD | UC-01 | BR-01 |
85
+
86
+ ---
87
+
88
+ ## 5. RISKS & OPEN QUESTIONS
89
+
90
+ ### 5.1 Risks
91
+
92
+ | No | Risk ID | Risk | Probability | Impact | Mitigation |
93
+ | ---: | --- | --- | --- | --- | --- |
94
+ | 1 | R-01 | TBD | Medium | Medium | TBD |
95
+
96
+ ### 5.2 Open Questions
97
+
98
+ | No | Q-ID | Question | Type | Priority | Decision Owner (PM/User) | Status (OPEN/RESOLVED) | Notes/Options | Resolution |
99
+ | ---: | --- | --- | --- | --- | --- | --- | --- | --- |
100
+ | 1 | OQ-01 | TBD | Business | High | PM | OPEN | TBD | TBD |
101
+
102
+ ---
103
+
104
+ ## 6. TRACEABILITY SUMMARY
105
+
106
+ | No | REQ ID | Use Cases | Business Rules | Acceptance Criteria | Status |
107
+ | ---: | --- | --- | --- | --- | --- |
108
+ | 1 | REQ-01 | UC-01 | BR-01 | AC-01-01 | COVERED |
109
+
110
+ ---
111
+
112
+ ## 7. HANDOFF
113
+
114
+ HANDOFF TO PM:
115
+ `@pm BA_SPEC_{{FEATURE_KEY}} is ready. Please create PRD_{{FEATURE_KEY}}.md + BACKLOG_{{FEATURE_KEY}}.md`
116
+
117
+ Next:
118
+ `@arch please design architecture for {{FEATURE_KEY}} after PM review`
119
+
120
+ NOTE:
121
+ `@pm please resolve Open Questions (OQ-xx) above; if any cannot be resolved from existing docs, please confirm with the user (final stakeholder).`
122
+
123
+ ---
124
+
125
+ ## APPENDIX A: Source Requirements (Original VI/JP) - keep as-is
126
+
127
+ If the input requirements were provided in Vietnamese/Japanese, paste them here unchanged.
128
+
129
+ ## APPENDIX B: English Translation (of Appendix A)
130
+
131
+ Provide an English translation of Appendix A (literal, for traceability).
132
+
133
+ ---
134
+
135
+ ## Document History
136
+
137
+ | No | Version | Date | Author | Changes |
138
+ | ---: | --- | --- | --- | --- |
139
+ | 1 | 1.0.0 | {{DATE}} | BA Agent | Initial template-based version |
@@ -0,0 +1,136 @@
1
+ # Flow Action Spec Creation Rules for AI Agents
2
+
3
+ This document defines reusable rules for creating and updating screen flow-action specifications
4
+ (for example `docs/specs/*_FLOW_ACTION_SPEC.md`).
5
+
6
+ ## 1. Scope and Goal
7
+
8
+ - Produce a screen-level specification that is traceable from BA/ARCH to FE/BE implementation.
9
+ - Keep one source of truth for:
10
+ - screen flow
11
+ - UI items and actions
12
+ - API calls per action
13
+ - screen-to-API mapping
14
+ - Keep documentation implementation-aware and review-friendly.
15
+
16
+ ## 2. Mandatory Document Structure
17
+
18
+ A flow-action spec should include, at minimum:
19
+
20
+ 1. `Abbreviations`
21
+ 2. `Feature overview`
22
+ 3. `Screen flow action` (with PlantUML)
23
+ 4. `Screen layout spec by flow action`
24
+ 5. `System processing flow`
25
+ 6. `Open questions`
26
+ 7. `Screen - API mapping`
27
+ 8. `Document history`
28
+
29
+ If a section is not in scope, keep the section and mark explicitly as `N/A` with reason.
30
+
31
+ ## 3. Table Standards
32
+
33
+ - Every table must include a `No` column (sequential numbering).
34
+ - Use stable headers for action tables:
35
+ - `No | JP Item Name | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note`
36
+ - Use stable headers for API mapping tables:
37
+ - `No | Trigger/When | UI item (No / JP Item Name) | API to call | Data usage / Notes`
38
+ - Use stable headers for screen mapping:
39
+ - `No | Screen (section) | Screen ID | Read/Search APIs | Write APIs | Notes / Q&A refs`
40
+ - Table rows must keep column count consistent with the header (no broken or merged rows).
41
+ - Avoid single-line merged content that collapses multiple logical items into one table row.
42
+
43
+ ### 3.1 Language and Encoding Standards (EN Artifacts)
44
+
45
+ - For EN artifacts (`docs/en/**` or explicitly requested EN version), narrative text must be English.
46
+ - JP labels can remain only in JP-specific fields/columns (`JP Item Name`, `項目名`, source captions).
47
+ - Do not leave mixed-language fragments in one sentence/cell (for example VI+EN mixed text).
48
+ - If original VI/JP text is required for traceability, keep it in a clearly marked appendix block (`Original Text`), then provide EN translation.
49
+ - Save files as UTF-8 and avoid mojibake/broken glyphs (`�`, `ↁE`, garbled sequences).
50
+ - Keep canonical terminology stable across documents (for example: `bukken`, `sagyo`, `customer employee`).
51
+
52
+ ### 3.2 Markdown Structure Hygiene
53
+
54
+ - Keep each heading on its own line; do not concatenate multiple headings/sections on one line.
55
+ - Keep metadata blocks (`Information`, `Note`, `Behavior notes`) as structured bullet blocks, not single compressed lines.
56
+ - Keep image, table, and separator (`---`) boundaries explicit to preserve parser/render stability.
57
+
58
+ ## 4. Item Numbering and Duplication Rules
59
+
60
+ - Use one numbering mode only: `global across document`.
61
+ - Number values must increase across all action tables in the document.
62
+ - Avoid duplicate item descriptions for the same UI control across screens unless behavior differs.
63
+ - If duplicate number is intentional (rare), annotate reason in `Note`.
64
+
65
+ ## 5. Screen Section Rules
66
+
67
+ For each screen section:
68
+
69
+ - Provide metadata:
70
+ - official screen name
71
+ - Screen ID
72
+ - design source URL (for example Figma)
73
+ - Embed one representative image per screen.
74
+ - Provide one action table.
75
+ - Provide one API mapping table.
76
+ - If a screen has dialogs, create explicit dialog sub-sections with their own tables and API mapping.
77
+
78
+ ## 6. API Traceability Rules
79
+
80
+ - Every actionable UI event that changes state must map to a write API.
81
+ - Every data-loading UI event must map to a read/search API.
82
+ - If one endpoint serves multiple actions (initial load, search, refresh), state this explicitly.
83
+ - If no API is called for an action, state `No API` and explain why.
84
+
85
+ ## 7. PlantUML Rules for Screen Flow
86
+
87
+ - Use valid PlantUML syntax and renderability checks before handoff.
88
+ - Use `\\n` for multi-line labels in nodes.
89
+ - Keep diagram at navigation/action level (not low-level SQL or backend internals).
90
+ - Ensure screen names in PlantUML match section names in layout spec.
91
+
92
+ ## 8. Data Source and Asset Rules
93
+
94
+ - Prioritize source order:
95
+ 1. Confirmed design source (for example Figma)
96
+ 2. Confirmed requirement files (Excel/spec)
97
+ 3. User-provided screenshots
98
+ - Store images in repository-relative paths.
99
+ - Do not keep temporary local absolute paths in markdown.
100
+
101
+ ## 9. Consistency with Other Specs
102
+
103
+ - Align terms with:
104
+ - BA spec glossary
105
+ - API endpoints spec
106
+ - Database spec
107
+ - If terminology differs across docs, raise an open question and add a temporary mapping note.
108
+ - Keep endpoint paths in flow-action spec consistent with API endpoint spec.
109
+
110
+ ## 10. Open Questions and Uncertainty Handling
111
+
112
+ - Capture unresolved items in `Open questions` table.
113
+ - Do not invent UI behavior or API contracts when source is ambiguous.
114
+ - Mark uncertain mappings as `Draft` and include impacted files/sections.
115
+
116
+ ## 11. Change Management
117
+
118
+ - On each update:
119
+ - update impacted screen sections
120
+ - update API mapping tables
121
+ - update screen-to-API mapping summary
122
+ - append one row in document history
123
+ - Never overwrite past history rows.
124
+
125
+ ## 12. Final Checklist Before Handoff
126
+
127
+ - PlantUML renders successfully.
128
+ - All mandatory sections exist.
129
+ - All tables include `No`.
130
+ - Numbering is global across the document (no resets).
131
+ - No broken image links.
132
+ - Screen/API mappings are consistent with `*_ENDPOINTS.md`.
133
+ - Open questions are explicit and traceable.
134
+ - For EN artifact: no leftover VI text outside allowed `Original Text` appendix blocks.
135
+ - No mojibake/encoding corruption markers.
136
+ - Headings/tables are structurally clean (no merged lines that break readability/traceability).
@@ -0,0 +1,160 @@
1
+ # {{FEATURE_NAME}} - Screen Flow Action Specification
2
+
3
+ **Document ID:** {{FEATURE_KEY}}_FLOW_ACTION_SPEC
4
+ **Version:** 1.0.0
5
+ **Date:** {{DATE}}
6
+ **Author:** ARCH Agent
7
+ **Status:** DRAFT
8
+ **Related Specs:** `docs/specs/BA_SPEC_{{FEATURE_KEY}}.md`, `docs/api/{{FEATURE_KEY}}_ENDPOINTS.md`, `docs/database/DATABASE_SPEC_{{FEATURE_KEY}}.md`
9
+
10
+ ---
11
+
12
+ ## Abbreviations
13
+
14
+ | No | Abbreviation | Meaning |
15
+ | ---: | --- | --- |
16
+ | 1 | UI | User Interface |
17
+ | 2 | UX | User Experience |
18
+ | 3 | API | Application Programming Interface |
19
+ | 4 | FE | Frontend |
20
+ | 5 | BE | Backend |
21
+ | 6 | OQ | Open Question |
22
+
23
+ ---
24
+
25
+ ## 1) Feature overview
26
+
27
+ ### 1.1 Background and user needs
28
+ - TBD
29
+
30
+ ### 1.2 Target features in scope
31
+ - TBD
32
+
33
+ ### 1.3 Implementation direction
34
+ - TBD
35
+
36
+ ---
37
+
38
+ ## 2) Screen flow action
39
+
40
+ ### 2.1 Flow diagram (PlantUML)
41
+
42
+ ```plantuml
43
+ @startuml
44
+ left to right direction
45
+ skinparam shadowing false
46
+ skinparam packageStyle rectangle
47
+
48
+ rectangle "Screen A" as A
49
+ rectangle "Screen B" as B
50
+ rectangle "Dialog C" as C
51
+
52
+ A --> B : action
53
+ B --> C : open dialog
54
+ @enduml
55
+ ```
56
+
57
+ ### 2.2 Mapping to major screens
58
+
59
+ | No | Screen Group | Screen Name | Screen ID | Notes |
60
+ | ---: | --- | --- | --- | --- |
61
+ | 1 | Main | Screen A | SCR-01 | TBD |
62
+ | 2 | Main | Screen B | SCR-02 | TBD |
63
+
64
+ ---
65
+
66
+ ## 3) Screen layout spec by flow action
67
+
68
+ > Standard item table format:
69
+ > `No | JP Item Name | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note`
70
+
71
+ ### 3.1 Screen A
72
+
73
+ Information:
74
+ - JP: TBD
75
+ - Screen ID: SCR-01
76
+ - Figma URL: TBD
77
+
78
+ Screen image:
79
+ ![3.1 Screen A](assets/{{FEATURE_SNAKE}}/screens/screen_3_1_screen_a.png)
80
+
81
+ | No | JP Item Name | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note |
82
+ | ---: | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
83
+ | 1 | Item A (JP) | Item A | Button | - | - | - | - | Click | TBD | TBD |
84
+ | 2 | Item B (JP) | Item B | Input | string | column_a | 100 | empty | Input | TBD | TBD |
85
+
86
+ #### API Mapping (Draft)
87
+
88
+ | No | Trigger/When | UI item (No / JP Item Name) | API to call | Data usage / Notes |
89
+ | ---: | --- | --- | --- | --- |
90
+ | 1 | Initial load | Main area | `GET /api/...` | Load initial dataset |
91
+ | 2 | Click search | No 1 | `POST /api/.../search` | Refresh grid |
92
+
93
+ ---
94
+
95
+ ### 3.2 Screen B
96
+
97
+ Information:
98
+ - JP: TBD
99
+ - Screen ID: SCR-02
100
+ - Figma URL: TBD
101
+
102
+ Screen image:
103
+ ![3.2 Screen B](assets/{{FEATURE_SNAKE}}/screens/screen_3_2_screen_b.png)
104
+
105
+ | No | JP Item Name | Item Name | Item Type | Attribute | DB Column | Size | Default Value | Action | Description | Note |
106
+ | ---: | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
107
+ | 3 | Item C (JP) | Item C | Toggle | boolean | flag_a | - | false | Toggle | TBD | TBD |
108
+
109
+ #### API Mapping (Draft)
110
+
111
+ | No | Trigger/When | UI item (No / JP Item Name) | API to call | Data usage / Notes |
112
+ | ---: | --- | --- | --- | --- |
113
+ | 1 | Change mode | No 3 | `POST /api/.../edit/{uuid}` | Persist mode |
114
+
115
+ ---
116
+
117
+ ## 4) System processing flow
118
+
119
+ ### 4.1 Initial load
120
+ 1. Validate screen permissions.
121
+ 2. Load settings/profile context.
122
+ 3. Load main dataset.
123
+
124
+ ### 4.2 Create/Update/Delete flow
125
+ 1. Validate request.
126
+ 2. Execute write API.
127
+ 3. Refresh read dataset.
128
+
129
+ ---
130
+
131
+ ## 5) Notes
132
+
133
+ - Keep item numbering strategy explicit (`global` or `per-screen`).
134
+ - Do not duplicate item descriptions across screens unless behavior differs.
135
+
136
+ ---
137
+
138
+ ## 6) Open questions
139
+
140
+ | No | Scope | Question | Impact |
141
+ | ---: | --- | --- | --- |
142
+ | 1 | UI | TBD | TBD |
143
+ | 2 | API | TBD | TBD |
144
+
145
+ ---
146
+
147
+ ## 7) Screen - API Mapping
148
+
149
+ | No | Screen (section) | Screen ID | Read/Search APIs | Write APIs | Notes / Q&A refs |
150
+ | ---: | --- | --- | --- | --- | --- |
151
+ | 1 | 3.1 Screen A | SCR-01 | `GET /api/...` | `POST /api/...` | TBD |
152
+ | 2 | 3.2 Screen B | SCR-02 | `POST /api/.../search` | `POST /api/.../edit/{uuid}` | TBD |
153
+
154
+ ---
155
+
156
+ ## Document History
157
+
158
+ | No | Version | Date | Author | Changes |
159
+ | ---: | --- | --- | --- | --- |
160
+ | 1 | 1.0.0 | {{DATE}} | ARCH Agent | Initial template-based version |
package/bin/sdtk.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const { run } = require("../src/index");
6
+
7
+ run(process.argv.slice(2))
8
+ .then((exitCode) => {
9
+ process.exitCode = Number.isInteger(exitCode) ? exitCode : 0;
10
+ })
11
+ .catch((error) => {
12
+ console.error(`sdtk: ${error.message}`);
13
+ process.exitCode =
14
+ typeof error.exitCode === "number" ? error.exitCode : 4;
15
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "sdtk-kit",
3
+ "version": "0.3.0",
4
+ "description": "SDTK CLI toolkit for deterministic software documentation workflows",
5
+ "bin": {
6
+ "sdtk": "./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": "node -e \"console.log('No tests configured yet')\"",
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
+ "cli",
29
+ "documentation",
30
+ "toolkit",
31
+ "dockkit"
32
+ ],
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/codexsdtk/sdtk-toolkit.git",
37
+ "directory": "distribution/sdtk-cli"
38
+ },
39
+ "homepage": "https://sdtk.dev",
40
+ "bugs": {
41
+ "url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }
47
+
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ const { clearAuthState, readAuthState, writeAuthState } = require("../lib/state");
4
+ const { parseFlags } = require("../lib/args");
5
+ const { checkRepoAccess } = require("../lib/github-access");
6
+ const { ValidationError } = require("../lib/errors");
7
+
8
+ const FLAG_DEFS = {
9
+ token: { type: "string" },
10
+ status: { type: "boolean" },
11
+ logout: { type: "boolean" },
12
+ verify: { type: "boolean" },
13
+ };
14
+
15
+ /**
16
+ * Redact a token for safe display (show first 4 chars only).
17
+ */
18
+ function redactToken(token) {
19
+ if (!token || token.length < 8) return "****";
20
+ return token.slice(0, 4) + "****";
21
+ }
22
+
23
+ async function cmdAuth(args) {
24
+ const { flags } = parseFlags(args, FLAG_DEFS);
25
+
26
+ if (flags.status) {
27
+ const state = readAuthState();
28
+ if (!state.authenticated) {
29
+ console.log("Auth status: not authenticated");
30
+ console.log('Run "sdtk auth --token <value>" to authenticate.');
31
+ return 1;
32
+ }
33
+ console.log("Auth status: authenticated");
34
+ console.log(`Token: ${redactToken(state.token)}`);
35
+ return 0;
36
+ }
37
+
38
+ if (flags.logout) {
39
+ clearAuthState();
40
+ console.log("Auth state cleared.");
41
+ return 0;
42
+ }
43
+
44
+ // Process --token first, then optionally --verify in the same invocation.
45
+ // This supports: sdtk auth --token <value> --verify
46
+ if (flags.token) {
47
+ const { path: authFile, hardened } = writeAuthState(flags.token);
48
+ if (hardened) {
49
+ console.log("Token stored securely.");
50
+ } else {
51
+ console.log("Token stored (file permission hardening was not applied).");
52
+ }
53
+ console.log(`Auth file: ${authFile}`);
54
+
55
+ if (flags.verify) {
56
+ console.log("");
57
+ console.log("Verifying repository access...");
58
+ const result = await checkRepoAccess(flags.token);
59
+ console.log(result.message);
60
+ return result.hasAccess ? 0 : 1;
61
+ }
62
+
63
+ console.log('Run "sdtk auth --verify" to check repository access.');
64
+ return 0;
65
+ }
66
+
67
+ if (flags.verify) {
68
+ const state = readAuthState();
69
+ if (!state.authenticated) {
70
+ console.log("Not authenticated. Store a token first with --token.");
71
+ return 1;
72
+ }
73
+ const result = await checkRepoAccess(state.token);
74
+ console.log(result.message);
75
+ return result.hasAccess ? 0 : 1;
76
+ }
77
+
78
+ throw new ValidationError(
79
+ "Usage: sdtk auth --token <value> [--verify] | --status | --logout"
80
+ );
81
+ }
82
+
83
+ module.exports = {
84
+ cmdAuth,
85
+ };