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.
- package/README.md +131 -0
- package/assets/manifest/toolkit-bundle.manifest.json +303 -0
- package/assets/manifest/toolkit-bundle.sha256.txt +59 -0
- package/assets/toolkit/toolkit/AGENTS.md +103 -0
- package/assets/toolkit/toolkit/install.ps1 +155 -0
- package/assets/toolkit/toolkit/runtimes/claude/CLAUDE_TEMPLATE.md +32 -0
- package/assets/toolkit/toolkit/runtimes/codex/CODEX_TEMPLATE.md +32 -0
- package/assets/toolkit/toolkit/scripts/init-feature.ps1 +253 -0
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +181 -0
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +116 -0
- package/assets/toolkit/toolkit/sdtk.config.json +28 -0
- package/assets/toolkit/toolkit/sdtk.config.profiles.example.json +50 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/SKILL.md +78 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py +565 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/SKILL.md +36 -0
- package/assets/toolkit/toolkit/skills/sdtk-api-doc/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/SKILL.md +43 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/skills/sdtk-arch/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-ba/SKILL.md +24 -0
- package/assets/toolkit/toolkit/skills/sdtk-design-layout/SKILL.md +21 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev/SKILL.md +20 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev-backend/SKILL.md +17 -0
- package/assets/toolkit/toolkit/skills/sdtk-dev-frontend/SKILL.md +15 -0
- package/assets/toolkit/toolkit/skills/sdtk-orchestrator/SKILL.md +44 -0
- package/assets/toolkit/toolkit/skills/sdtk-pm/SKILL.md +26 -0
- package/assets/toolkit/toolkit/skills/sdtk-qa/SKILL.md +22 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/SKILL.md +59 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/excel-image-export.md +51 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/figma-mcp.md +54 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/references/numbering-rules.md +76 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/renumber_flow_action_spec_global.py +136 -0
- package/assets/toolkit/toolkit/skills/sdtk-screen-design-spec/scripts/validate_flow_action_spec_numbering.py +249 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/SKILL.md +65 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/references/TEST_CASE_CREATION_RULES.md +129 -0
- package/assets/toolkit/toolkit/skills/sdtk-test-case-spec/scripts/validate_test_case_spec.py +97 -0
- package/assets/toolkit/toolkit/templates/QUALITY_CHECKLIST.md +124 -0
- package/assets/toolkit/toolkit/templates/README.md +56 -0
- package/assets/toolkit/toolkit/templates/SHARED_PLANNING.md +80 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_CREATION_RULES.md +212 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_DESIGN_DETAIL_TEMPLATE.md +62 -0
- package/assets/toolkit/toolkit/templates/docs/api/API_ENDPOINTS_TEMPLATE.md +229 -0
- package/assets/toolkit/toolkit/templates/docs/api/FEATURE_API_TEMPLATE.yaml +20 -0
- package/assets/toolkit/toolkit/templates/docs/api/FLOWCHART_CREATION_RULES.md +397 -0
- package/assets/toolkit/toolkit/templates/docs/api/feature_api_flow_list_TEMPLATE.txt +12 -0
- package/assets/toolkit/toolkit/templates/docs/architecture/ARCH_DESIGN_TEMPLATE.md +109 -0
- package/assets/toolkit/toolkit/templates/docs/database/DATABASE_SPEC_TEMPLATE.md +175 -0
- package/assets/toolkit/toolkit/templates/docs/design/DESIGN_LAYOUT_TEMPLATE.md +49 -0
- package/assets/toolkit/toolkit/templates/docs/dev/FEATURE_IMPL_PLAN_TEMPLATE.md +73 -0
- package/assets/toolkit/toolkit/templates/docs/product/BACKLOG_TEMPLATE.md +50 -0
- package/assets/toolkit/toolkit/templates/docs/product/PRD_TEMPLATE.md +66 -0
- package/assets/toolkit/toolkit/templates/docs/product/PROJECT_INITIATION_TEMPLATE.md +98 -0
- package/assets/toolkit/toolkit/templates/docs/qa/QA_RELEASE_REPORT_TEMPLATE.md +61 -0
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_CREATION_RULES.md +129 -0
- package/assets/toolkit/toolkit/templates/docs/qa/TEST_CASE_TEMPLATE.md +104 -0
- package/assets/toolkit/toolkit/templates/docs/specs/BA_SPEC_TEMPLATE.md +139 -0
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_CREATION_RULES.md +136 -0
- package/assets/toolkit/toolkit/templates/docs/specs/FLOW_ACTION_SPEC_TEMPLATE.md +160 -0
- package/bin/sdtk.js +15 -0
- package/package.json +47 -0
- package/src/commands/auth.js +85 -0
- package/src/commands/generate.js +177 -0
- package/src/commands/help.js +69 -0
- package/src/commands/init.js +73 -0
- package/src/index.js +56 -0
- package/src/lib/args.js +116 -0
- package/src/lib/errors.js +41 -0
- package/src/lib/github-access.js +68 -0
- package/src/lib/powershell.js +85 -0
- package/src/lib/state.js +83 -0
- package/src/lib/toolkit-payload.js +99 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[string]$SkillName,
|
|
3
|
+
[switch]$All,
|
|
4
|
+
[switch]$BackupExisting,
|
|
5
|
+
[string]$BackupPath
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
$ErrorActionPreference = 'Stop'
|
|
9
|
+
Set-StrictMode -Version Latest
|
|
10
|
+
|
|
11
|
+
function Backup-Directory {
|
|
12
|
+
param(
|
|
13
|
+
[Parameter(Mandatory = $true)][string]$SourcePath,
|
|
14
|
+
[Parameter(Mandatory = $true)][string]$BackupRoot,
|
|
15
|
+
[Parameter(Mandatory = $true)][string]$Name
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if (-not (Test-Path -LiteralPath $SourcePath)) {
|
|
19
|
+
return $null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
New-Item -ItemType Directory -Force -Path $BackupRoot | Out-Null
|
|
23
|
+
$dest = Join-Path $BackupRoot $Name
|
|
24
|
+
if (Test-Path -LiteralPath $dest) {
|
|
25
|
+
Remove-Item -LiteralPath $dest -Recurse -Force
|
|
26
|
+
}
|
|
27
|
+
Copy-Item -LiteralPath $SourcePath -Destination $dest -Recurse -Force
|
|
28
|
+
return $dest
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if ($All -and $SkillName) {
|
|
32
|
+
throw "Use either -All or -SkillName, not both."
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
|
|
36
|
+
$skillsSrc = Join-Path $repoRoot 'skills'
|
|
37
|
+
if (-not (Test-Path -LiteralPath $skillsSrc)) {
|
|
38
|
+
throw "Missing toolkit skills source directory: $skillsSrc"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$managedSkillNames = Get-ChildItem -LiteralPath $skillsSrc -Directory | Select-Object -ExpandProperty Name
|
|
42
|
+
if (-not $managedSkillNames -or $managedSkillNames.Count -eq 0) {
|
|
43
|
+
throw "No managed skills found in: $skillsSrc"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
$targetNames = @()
|
|
47
|
+
if ($SkillName) {
|
|
48
|
+
if ($managedSkillNames -notcontains $SkillName) {
|
|
49
|
+
throw "Skill '$SkillName' is not in managed toolkit skills list. Known skills: $($managedSkillNames -join ', ')"
|
|
50
|
+
}
|
|
51
|
+
$targetNames = @($SkillName)
|
|
52
|
+
} elseif ($All) {
|
|
53
|
+
$targetNames = @($managedSkillNames)
|
|
54
|
+
} else {
|
|
55
|
+
# Default behavior: uninstall all toolkit-managed skills.
|
|
56
|
+
$targetNames = @($managedSkillNames)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
$codexHome = $env:CODEX_HOME
|
|
60
|
+
if (-not $codexHome) {
|
|
61
|
+
$codexHome = Join-Path $HOME '.codex'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$skillsDest = Join-Path $codexHome 'skills'
|
|
65
|
+
if (-not (Test-Path -LiteralPath $skillsDest)) {
|
|
66
|
+
Write-Host "Codex skills directory not found: $skillsDest"
|
|
67
|
+
exit 0
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
$backupRootResolved = $null
|
|
71
|
+
if ($BackupExisting) {
|
|
72
|
+
if (-not $BackupPath -or $BackupPath.Trim().Length -eq 0) {
|
|
73
|
+
$timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
|
|
74
|
+
$BackupPath = Join-Path $codexHome (Join-Path 'skills-backups' ("uninstall-" + $timestamp))
|
|
75
|
+
}
|
|
76
|
+
New-Item -ItemType Directory -Force -Path $BackupPath | Out-Null
|
|
77
|
+
$backupRootResolved = (Resolve-Path -LiteralPath $BackupPath).Path
|
|
78
|
+
Write-Host "Backup mode enabled: $backupRootResolved"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
$removed = New-Object System.Collections.Generic.List[string]
|
|
82
|
+
$missing = New-Object System.Collections.Generic.List[string]
|
|
83
|
+
|
|
84
|
+
foreach ($name in $targetNames) {
|
|
85
|
+
$dest = Join-Path $skillsDest $name
|
|
86
|
+
if (-not (Test-Path -LiteralPath $dest)) {
|
|
87
|
+
$missing.Add($name) | Out-Null
|
|
88
|
+
Write-Warning "Skill not installed, skipping: $name"
|
|
89
|
+
continue
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if ($BackupExisting) {
|
|
93
|
+
$backupDest = Backup-Directory -SourcePath $dest -BackupRoot $backupRootResolved -Name $name
|
|
94
|
+
if ($backupDest) {
|
|
95
|
+
Write-Host "Backed up: $name -> $backupDest"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
Remove-Item -LiteralPath $dest -Recurse -Force
|
|
100
|
+
$removed.Add($name) | Out-Null
|
|
101
|
+
Write-Host "Uninstalled: $name"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
Write-Host ""
|
|
105
|
+
Write-Host "Uninstall summary:"
|
|
106
|
+
Write-Host "- Removed: $($removed.Count)"
|
|
107
|
+
if ($removed.Count -gt 0) {
|
|
108
|
+
$removed | ForEach-Object { Write-Host " - $_" }
|
|
109
|
+
}
|
|
110
|
+
Write-Host "- Missing/Skipped: $($missing.Count)"
|
|
111
|
+
if ($missing.Count -gt 0) {
|
|
112
|
+
$missing | ForEach-Object { Write-Host " - $_" }
|
|
113
|
+
}
|
|
114
|
+
if ($backupRootResolved) {
|
|
115
|
+
Write-Host "- Backup directory: $backupRootResolved"
|
|
116
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"docs": {
|
|
3
|
+
"artifactsLanguage": "EN",
|
|
4
|
+
"guidanceLanguage": "VI",
|
|
5
|
+
"preserveOriginalInput": true,
|
|
6
|
+
"appendixIncludeEnglishTranslation": true,
|
|
7
|
+
"aiPeerReviewAllowed": true
|
|
8
|
+
},
|
|
9
|
+
"orchestration": {
|
|
10
|
+
"apiDesignDetailMode": "auto",
|
|
11
|
+
"testCaseSpecMode": "auto"
|
|
12
|
+
},
|
|
13
|
+
"stack": {
|
|
14
|
+
"backend": "Set your backend stack (example: Python Django REST Framework)",
|
|
15
|
+
"frontend": "Set your frontend stack (example: React + Vite)",
|
|
16
|
+
"mobile": "N/A",
|
|
17
|
+
"database": "Set your database (example: PostgreSQL 15)",
|
|
18
|
+
"auth": "Set your auth strategy (example: JWT/OAuth2)"
|
|
19
|
+
},
|
|
20
|
+
"commands": {
|
|
21
|
+
"backendTests": "UPDATE_ME: set backend test command",
|
|
22
|
+
"backendTypecheck": "UPDATE_ME: set backend typecheck command",
|
|
23
|
+
"backendLint": "UPDATE_ME: set backend lint command",
|
|
24
|
+
"frontendTests": "UPDATE_ME: set frontend test command",
|
|
25
|
+
"frontendLint": "UPDATE_ME: set frontend lint command",
|
|
26
|
+
"e2eTests": "UPDATE_ME: set e2e test command"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"profiles": {
|
|
3
|
+
"django-react": {
|
|
4
|
+
"orchestration": {
|
|
5
|
+
"apiDesignDetailMode": "auto",
|
|
6
|
+
"testCaseSpecMode": "auto"
|
|
7
|
+
},
|
|
8
|
+
"stack": {
|
|
9
|
+
"backend": "Python 3.11 + Django 4.x + Django REST Framework",
|
|
10
|
+
"frontend": "React 18 + Vite",
|
|
11
|
+
"mobile": "N/A",
|
|
12
|
+
"database": "PostgreSQL 15",
|
|
13
|
+
"auth": "JWT"
|
|
14
|
+
},
|
|
15
|
+
"commands": {
|
|
16
|
+
"backendTests": "python -m pytest",
|
|
17
|
+
"backendTypecheck": "python -m mypy src/backend",
|
|
18
|
+
"backendLint": "python -m ruff check src/backend",
|
|
19
|
+
"frontendTests": "npm run test",
|
|
20
|
+
"frontendLint": "npm run lint",
|
|
21
|
+
"e2eTests": "npm run e2e"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"node-nextjs": {
|
|
25
|
+
"orchestration": {
|
|
26
|
+
"apiDesignDetailMode": "auto",
|
|
27
|
+
"testCaseSpecMode": "auto"
|
|
28
|
+
},
|
|
29
|
+
"stack": {
|
|
30
|
+
"backend": "Node.js 20 + Express/Fastify",
|
|
31
|
+
"frontend": "Next.js 14",
|
|
32
|
+
"mobile": "N/A",
|
|
33
|
+
"database": "PostgreSQL 15",
|
|
34
|
+
"auth": "OAuth2 + JWT"
|
|
35
|
+
},
|
|
36
|
+
"commands": {
|
|
37
|
+
"backendTests": "npm run test:api",
|
|
38
|
+
"backendTypecheck": "npm run typecheck:api",
|
|
39
|
+
"backendLint": "npm run lint:api",
|
|
40
|
+
"frontendTests": "npm run test:web",
|
|
41
|
+
"frontendLint": "npm run lint:web",
|
|
42
|
+
"e2eTests": "npm run test:e2e"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"notes": [
|
|
47
|
+
"Copy one profile into sdtk.config.json and adjust for your project.",
|
|
48
|
+
"Do not keep UPDATE_ME placeholders before running real delivery gates."
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdtk-api-design-spec
|
|
3
|
+
description: Generate detailed API design markdown (`[FEATURE_KEY]_API_DESIGN_DETAIL.md`) from OpenAPI YAML and API flow list using Excel-style structure rules. Use when you need field-level request/response tables + per-endpoint process flow images for implementation/review handoff.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SDTK API Design Detail Spec
|
|
7
|
+
|
|
8
|
+
## Outputs
|
|
9
|
+
- `docs/api/[FEATURE_KEY]_API_DESIGN_DETAIL.md`
|
|
10
|
+
- Supporting generated assets:
|
|
11
|
+
- `docs/api/flows/*.puml`
|
|
12
|
+
- `docs/api/images/*.svg`
|
|
13
|
+
|
|
14
|
+
## Required Inputs
|
|
15
|
+
- Feature key (`FEATURE_KEY`)
|
|
16
|
+
- API contract YAML:
|
|
17
|
+
- Preferred: `docs/api/[FeaturePascal]_API.yaml`
|
|
18
|
+
- Fallback: a specified YAML file path
|
|
19
|
+
- API flow list:
|
|
20
|
+
- Preferred: `docs/api/[feature_snake]_api_flow_list.txt`
|
|
21
|
+
- Fallback: a specified flow list path
|
|
22
|
+
|
|
23
|
+
## Core Rules
|
|
24
|
+
- Apply `./references/API_DESIGN_CREATION_RULES.md` first.
|
|
25
|
+
- Keep endpoint contracts consistent with source YAML.
|
|
26
|
+
- Keep process flow source synchronized with flow list (`*_api_flow_list.txt`).
|
|
27
|
+
- Keep one visible flowchart per API section (embed image), avoid duplicate preview rendering.
|
|
28
|
+
|
|
29
|
+
## Generation Procedure
|
|
30
|
+
1. Resolve input files (`yaml`, `flow_list`, `output`).
|
|
31
|
+
2. Parse YAML endpoints (method, path, request schema, success/error schema).
|
|
32
|
+
3. Parse flow blocks from flow list (`@startuml ... @enduml`) and map by `METHOD + path`.
|
|
33
|
+
4. Generate detailed markdown sections per API:
|
|
34
|
+
- Process flow source block (`text` fenced block)
|
|
35
|
+
- Embedded flowchart image
|
|
36
|
+
- Path parameter table
|
|
37
|
+
- Request table (hierarchy levels + type + format + required)
|
|
38
|
+
- Success response table
|
|
39
|
+
- Error response table
|
|
40
|
+
5. Generate/update `.puml` per API under `docs/api/flows`.
|
|
41
|
+
6. Render `.svg` images under `docs/api/images`.
|
|
42
|
+
7. Validate:
|
|
43
|
+
- every API section has one embedded image
|
|
44
|
+
- every embed path exists
|
|
45
|
+
- no render error image output
|
|
46
|
+
- markdown tables keep `No` sequential numbering
|
|
47
|
+
|
|
48
|
+
## Script
|
|
49
|
+
- `scripts/generate_api_design_detail.py`
|
|
50
|
+
|
|
51
|
+
### Typical command
|
|
52
|
+
```powershell
|
|
53
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
54
|
+
--feature-key SCHEDULE_WHITEBOARD `
|
|
55
|
+
--yaml "docs/api/ScheduleWhiteboard_API.yaml" `
|
|
56
|
+
--flow-list "docs/api/schedule_whiteboard_api_flow_list.txt" `
|
|
57
|
+
--output "docs/api/SCHEDULE_WHITEBOARD_API_DESIGN_DETAIL.md"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Optional subset generation
|
|
61
|
+
```powershell
|
|
62
|
+
python "toolkit/skills/sdtk-api-design-spec/scripts/generate_api_design_detail.py" `
|
|
63
|
+
--feature-key SCHEDULE_WHITEBOARD `
|
|
64
|
+
--yaml "docs/api/ScheduleWhiteboard_API.yaml" `
|
|
65
|
+
--flow-list "docs/api/schedule_whiteboard_api_flow_list.txt" `
|
|
66
|
+
--output "docs/api/SCHEDULE_WHITEBOARD_API_DESIGN_DETAIL.md" `
|
|
67
|
+
--include "POST /api/whiteboard/assignment/{company_uuid}" `
|
|
68
|
+
--include "POST /api/whiteboard/assignment/edit/{company_uuid}/{sagyo_assign_uuid}" `
|
|
69
|
+
--include "POST /api/whiteboard/assignment/delete/{company_uuid}/{sagyo_assign_uuid}"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Orchestrator Integration (Hybrid)
|
|
73
|
+
- `apiDesignDetailMode` in `sdtk.config.json` controls orchestration behavior:
|
|
74
|
+
- `auto` (default): generate API design detail when ARCH has API scope and YAML/flow sources are available.
|
|
75
|
+
- `on`: always generate API design detail for API scope (fail if required sources are missing).
|
|
76
|
+
- `off`: skip unless user explicitly requests.
|
|
77
|
+
|
|
78
|
+
|
package/assets/toolkit/toolkit/skills/sdtk-api-design-spec/references/API_DESIGN_CREATION_RULES.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# API Design Creation Rules for AI Agents (Excel Template)
|
|
2
|
+
|
|
3
|
+
This document defines reusable rules for creating API design documents in Excel format based on `Example/Docs/API/API_design.xlsx`.
|
|
4
|
+
|
|
5
|
+
## 1. Scope and Goal
|
|
6
|
+
|
|
7
|
+
- Reuse one consistent Excel structure for API contract documentation.
|
|
8
|
+
- Keep flow, endpoint parameters, request schema, response schema, and revision history in one workbook.
|
|
9
|
+
- Keep generated sheets deterministic and review-friendly.
|
|
10
|
+
|
|
11
|
+
## 2. Source Template Baseline
|
|
12
|
+
|
|
13
|
+
| No | Sheet Pattern | Purpose |
|
|
14
|
+
| ---: | --- | --- |
|
|
15
|
+
| 1 | `History` | Global workbook change history |
|
|
16
|
+
| 2 | `API detail (...)` | One API per sheet |
|
|
17
|
+
|
|
18
|
+
Observed baseline in `API_design.xlsx`:
|
|
19
|
+
- 1 history sheet.
|
|
20
|
+
- 5 API detail sheets (list/create/detail/update/logical delete).
|
|
21
|
+
|
|
22
|
+
## 3. Workbook Rules
|
|
23
|
+
|
|
24
|
+
### 3.1 Sheet Naming
|
|
25
|
+
|
|
26
|
+
- Use one API per sheet.
|
|
27
|
+
- Recommended naming style:
|
|
28
|
+
- `API detail (<domain action>)`
|
|
29
|
+
- Keep API sheet order stable (for example: list -> create -> detail -> update -> delete).
|
|
30
|
+
|
|
31
|
+
### 3.2 History Sheet
|
|
32
|
+
|
|
33
|
+
- Keep `History` as the first sheet.
|
|
34
|
+
- Header layout:
|
|
35
|
+
- `A3=Date`
|
|
36
|
+
- `C3=Version`
|
|
37
|
+
- `F3=Editor`
|
|
38
|
+
- `M3=Edit content`
|
|
39
|
+
- Append rows only. Do not rewrite historical rows.
|
|
40
|
+
|
|
41
|
+
## 4. API Detail Sheet Layout
|
|
42
|
+
|
|
43
|
+
### 4.1 Header Metadata Block
|
|
44
|
+
|
|
45
|
+
Use this label/value map:
|
|
46
|
+
|
|
47
|
+
| No | Label Cell Group | Value Cell Group | Meaning |
|
|
48
|
+
| ---: | --- | --- | --- |
|
|
49
|
+
| 1 | `Q1:X1` | `Y1:AQ1` | System name |
|
|
50
|
+
| 2 | `Q2:X2` | `Y2:AQ2` | System ID |
|
|
51
|
+
| 3 | `Q3:X3` | `Y3:AQ3` | Subsystem name |
|
|
52
|
+
| 4 | `Q4:X4` | `Y4:AQ4` | Function name |
|
|
53
|
+
| 5 | `AR1:AV1` | `AW1:BC1` | Created by |
|
|
54
|
+
| 6 | `AR2:AV2` | `AW2:BC2` | Created date |
|
|
55
|
+
| 7 | `AR3:AV3` | `AW3:BC3` | Revised by |
|
|
56
|
+
| 8 | `AR4:AV4` | `AW4:BC4` | Revised date |
|
|
57
|
+
|
|
58
|
+
Also keep document title block:
|
|
59
|
+
- `A1:P4` = document title area.
|
|
60
|
+
|
|
61
|
+
### 4.2 Mandatory Section Order
|
|
62
|
+
|
|
63
|
+
Each API sheet must keep this order:
|
|
64
|
+
1. Process flow section
|
|
65
|
+
2. `Parameters:`
|
|
66
|
+
3. Request parameter section (JSON format)
|
|
67
|
+
4. Success response section (JSON format)
|
|
68
|
+
5. Error response section (JSON format)
|
|
69
|
+
|
|
70
|
+
### 4.3 Endpoint Title Placement
|
|
71
|
+
|
|
72
|
+
- Put endpoint summary at top flow area: `B7`.
|
|
73
|
+
- Format: `<METHOD> <PATH> <summary>`
|
|
74
|
+
- Repeat the same endpoint summary in contract area:
|
|
75
|
+
- Column `A`, one row above `Parameters:`.
|
|
76
|
+
- Both endpoint strings must be identical.
|
|
77
|
+
|
|
78
|
+
### 4.4 Flowchart Placement
|
|
79
|
+
|
|
80
|
+
- Put PlantUML text in `BG8` (multi-line content in one cell).
|
|
81
|
+
- `BG6` can contain tool/reference note.
|
|
82
|
+
- Helper + main flows can be placed in one cell value if clearly separated.
|
|
83
|
+
- Flow syntax/content standards follow:
|
|
84
|
+
- `Example/Docs/API/FLOWCHART_CREATION_RULES.md`
|
|
85
|
+
|
|
86
|
+
## 5. Endpoint and Parameter Rules
|
|
87
|
+
|
|
88
|
+
### 5.1 Path Parameter Block
|
|
89
|
+
|
|
90
|
+
- Anchor row: column `B` equals `Parameters:`.
|
|
91
|
+
- Parameter rows:
|
|
92
|
+
- parameter key in column `C`
|
|
93
|
+
- description in column `K`
|
|
94
|
+
- Include every path placeholder from endpoint path.
|
|
95
|
+
- Keep parameter order aligned with placeholder order.
|
|
96
|
+
|
|
97
|
+
### 5.2 Consistency Checks
|
|
98
|
+
|
|
99
|
+
- Every `{placeholder}` in path must exist exactly once in the parameter rows.
|
|
100
|
+
- Avoid duplicate parameter names unless explicitly documented.
|
|
101
|
+
- Remove stale parameter rows after endpoint rename.
|
|
102
|
+
|
|
103
|
+
## 6. Request/Response Table Rules
|
|
104
|
+
|
|
105
|
+
### 6.1 Common Column Model
|
|
106
|
+
|
|
107
|
+
| No | Column Group | Meaning |
|
|
108
|
+
| ---: | --- | --- |
|
|
109
|
+
| 1 | `A:B` | Row No |
|
|
110
|
+
| 2 | `C:J` | Item label |
|
|
111
|
+
| 3 | `K:N` | Hierarchy level 1 |
|
|
112
|
+
| 4 | `O:R` | Hierarchy level 2 |
|
|
113
|
+
| 5 | `S:V` | Hierarchy level 3 |
|
|
114
|
+
| 6 | `W:Z` | Hierarchy level 4 |
|
|
115
|
+
| 7 | `AA:AD` | Hierarchy level 5 |
|
|
116
|
+
| 8 | `AE:AH` | Hierarchy level 6 |
|
|
117
|
+
| 9 | `AI:AK` | Data type |
|
|
118
|
+
|
|
119
|
+
### 6.2 Request Header Mode
|
|
120
|
+
|
|
121
|
+
For write/search request tables, include:
|
|
122
|
+
- `No`
|
|
123
|
+
- `Item Name`
|
|
124
|
+
- `Item`
|
|
125
|
+
- `Type`
|
|
126
|
+
- `Format`
|
|
127
|
+
- `Length`
|
|
128
|
+
- `Required`
|
|
129
|
+
|
|
130
|
+
Column groups:
|
|
131
|
+
- `AL:AN` -> `Format`
|
|
132
|
+
- `AO:AP` -> `Length`
|
|
133
|
+
- `AQ:AR` -> `Required`
|
|
134
|
+
|
|
135
|
+
### 6.3 Response Header Mode
|
|
136
|
+
|
|
137
|
+
For response tables, include:
|
|
138
|
+
- `No`
|
|
139
|
+
- `Item Name`
|
|
140
|
+
- `Item`
|
|
141
|
+
- `Type`
|
|
142
|
+
- `Note`
|
|
143
|
+
|
|
144
|
+
Column group:
|
|
145
|
+
- `AL:AN` -> `Note`
|
|
146
|
+
|
|
147
|
+
### 6.4 GET Request Body Rule
|
|
148
|
+
|
|
149
|
+
- If API has no JSON request body, set request body to:
|
|
150
|
+
- `None`
|
|
151
|
+
|
|
152
|
+
### 6.5 Hierarchy Modeling Rule
|
|
153
|
+
|
|
154
|
+
- Use hierarchy columns (level 1 to level 6) to represent nesting.
|
|
155
|
+
- Represent root wrapper explicitly (for example `data`).
|
|
156
|
+
- For array object children, define parent array node first, then child fields at deeper levels.
|
|
157
|
+
|
|
158
|
+
## 7. Status and Error Contract Rules
|
|
159
|
+
|
|
160
|
+
- Success response must include `status` at minimum.
|
|
161
|
+
- Error response must include:
|
|
162
|
+
- `status`
|
|
163
|
+
- `data` (message or detail payload)
|
|
164
|
+
- If status detail references an external code table, note that in response notes.
|
|
165
|
+
|
|
166
|
+
## 8. Type and Format Rules
|
|
167
|
+
|
|
168
|
+
- Use stable type keywords:
|
|
169
|
+
- `string`
|
|
170
|
+
- `integer`
|
|
171
|
+
- `number`
|
|
172
|
+
- `object`
|
|
173
|
+
- `array`
|
|
174
|
+
- If datetime format is constrained, write it in `Format` or `Note` (for example `yyyymmddHHMMSS`).
|
|
175
|
+
- Business constraints (constant flags, nullable behavior, etc.) go to `Note`.
|
|
176
|
+
|
|
177
|
+
## 9. Recommended Generation Procedure
|
|
178
|
+
|
|
179
|
+
1. Duplicate an existing API detail sheet.
|
|
180
|
+
2. Update metadata fields (`Q..BC` blocks).
|
|
181
|
+
3. Update endpoint title in `B7`.
|
|
182
|
+
4. Update PlantUML in `BG8`.
|
|
183
|
+
5. Update repeated endpoint title above `Parameters:`.
|
|
184
|
+
6. Update path parameters (`C/K` rows).
|
|
185
|
+
7. Update request section:
|
|
186
|
+
- `None` for no-body APIs.
|
|
187
|
+
- request table for body APIs.
|
|
188
|
+
8. Update success response table.
|
|
189
|
+
9. Update error response table.
|
|
190
|
+
10. Append one new row in `History`.
|
|
191
|
+
|
|
192
|
+
## 10. Quality Gate Checklist Before Handoff
|
|
193
|
+
|
|
194
|
+
- Section order is complete and unchanged.
|
|
195
|
+
- Endpoint title in `B7` matches the endpoint title above `Parameters:`.
|
|
196
|
+
- Path placeholders and parameter rows are 1:1 matched.
|
|
197
|
+
- Request/response sections use correct header mode.
|
|
198
|
+
- `No` is sequential in every table.
|
|
199
|
+
- Hierarchy columns reflect actual payload nesting.
|
|
200
|
+
- `status` and error payload structure are documented.
|
|
201
|
+
- PlantUML in `BG8` matches endpoint behavior.
|
|
202
|
+
- `History` has a new appended entry.
|
|
203
|
+
|
|
204
|
+
## 11. Known Pitfalls and Prevention
|
|
205
|
+
|
|
206
|
+
| No | Pitfall | Prevention Rule |
|
|
207
|
+
| ---: | --- | --- |
|
|
208
|
+
| 1 | Endpoint placeholder renamed but parameter rows not synced | Run path-vs-parameter check for every API sheet |
|
|
209
|
+
| 2 | Request/response headers mixed (`Note` vs `Required`) | Use section-specific header mode only |
|
|
210
|
+
| 3 | Nested array fields placed at wrong hierarchy level | Define parent array first, then child fields deeper |
|
|
211
|
+
| 4 | Endpoint summary mismatch between top and contract blocks | Maintain a single canonical endpoint title string and reuse it |
|
|
212
|
+
|