sedd 0.1.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 (90) hide show
  1. package/README.md +504 -0
  2. package/bin/sedd.js +6 -0
  3. package/commands/sedd.clarify.md +435 -0
  4. package/commands/sedd.dashboard.md +145 -0
  5. package/commands/sedd.implement.md +326 -0
  6. package/commands/sedd.migrate.md +249 -0
  7. package/commands/sedd.specify.md +198 -0
  8. package/commands/sedd.tasks.md +176 -0
  9. package/dist/cli/check.d.ts +6 -0
  10. package/dist/cli/check.d.ts.map +1 -0
  11. package/dist/cli/check.js +134 -0
  12. package/dist/cli/check.js.map +1 -0
  13. package/dist/cli/clarify.d.ts +2 -0
  14. package/dist/cli/clarify.d.ts.map +1 -0
  15. package/dist/cli/clarify.js +116 -0
  16. package/dist/cli/clarify.js.map +1 -0
  17. package/dist/cli/index.d.ts +8 -0
  18. package/dist/cli/index.d.ts.map +1 -0
  19. package/dist/cli/index.js +175 -0
  20. package/dist/cli/index.js.map +1 -0
  21. package/dist/cli/init.d.ts +9 -0
  22. package/dist/cli/init.d.ts.map +1 -0
  23. package/dist/cli/init.js +236 -0
  24. package/dist/cli/init.js.map +1 -0
  25. package/dist/cli/migrate.d.ts +7 -0
  26. package/dist/cli/migrate.d.ts.map +1 -0
  27. package/dist/cli/migrate.js +197 -0
  28. package/dist/cli/migrate.js.map +1 -0
  29. package/dist/cli/specify.d.ts +7 -0
  30. package/dist/cli/specify.d.ts.map +1 -0
  31. package/dist/cli/specify.js +131 -0
  32. package/dist/cli/specify.js.map +1 -0
  33. package/dist/cli/status.d.ts +6 -0
  34. package/dist/cli/status.d.ts.map +1 -0
  35. package/dist/cli/status.js +118 -0
  36. package/dist/cli/status.js.map +1 -0
  37. package/dist/cli/tasks.d.ts +7 -0
  38. package/dist/cli/tasks.d.ts.map +1 -0
  39. package/dist/cli/tasks.js +165 -0
  40. package/dist/cli/tasks.js.map +1 -0
  41. package/dist/core/changelog.d.ts +30 -0
  42. package/dist/core/changelog.d.ts.map +1 -0
  43. package/dist/core/changelog.js +97 -0
  44. package/dist/core/changelog.js.map +1 -0
  45. package/dist/core/file-splitter.d.ts +39 -0
  46. package/dist/core/file-splitter.d.ts.map +1 -0
  47. package/dist/core/file-splitter.js +162 -0
  48. package/dist/core/file-splitter.js.map +1 -0
  49. package/dist/core/migration-manager.d.ts +76 -0
  50. package/dist/core/migration-manager.d.ts.map +1 -0
  51. package/dist/core/migration-manager.js +230 -0
  52. package/dist/core/migration-manager.js.map +1 -0
  53. package/dist/core/timestamps.d.ts +17 -0
  54. package/dist/core/timestamps.d.ts.map +1 -0
  55. package/dist/core/timestamps.js +37 -0
  56. package/dist/core/timestamps.js.map +1 -0
  57. package/dist/index.d.ts +8 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +7 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/types/index.d.ts +102 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/types/index.js +83 -0
  64. package/dist/types/index.js.map +1 -0
  65. package/dist/utils/git.d.ts +63 -0
  66. package/dist/utils/git.d.ts.map +1 -0
  67. package/dist/utils/git.js +179 -0
  68. package/dist/utils/git.js.map +1 -0
  69. package/hooks/README.md +220 -0
  70. package/hooks/check-roadmap.js +231 -0
  71. package/hooks/check-roadmap.ps1 +343 -0
  72. package/package.json +60 -0
  73. package/scripts/bash/sedd-clarify.sh +142 -0
  74. package/scripts/bash/sedd-complete-task.sh +108 -0
  75. package/scripts/bash/sedd-specify.sh +147 -0
  76. package/scripts/powershell/sedd-clarify.ps1 +222 -0
  77. package/scripts/powershell/sedd-complete-task.ps1 +143 -0
  78. package/scripts/powershell/sedd-specify.ps1 +192 -0
  79. package/scripts/powershell/sedd-status.ps1 +153 -0
  80. package/scripts/powershell/sedd-tasks.ps1 +176 -0
  81. package/templates/changelog-template.md +6 -0
  82. package/templates/clarify-template.md +66 -0
  83. package/templates/config-template.json +20 -0
  84. package/templates/decisions-template.md +56 -0
  85. package/templates/interfaces-template.ts +131 -0
  86. package/templates/meta-template.json +12 -0
  87. package/templates/progress-template.md +61 -0
  88. package/templates/sedd.schema.json +95 -0
  89. package/templates/spec-template.md +114 -0
  90. package/templates/tasks-template.md +58 -0
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env bash
2
+ # SEDD Specify - Creates initial feature structure
3
+ # Usage: ./sedd-specify.sh <feature_id> <feature_name> [description]
4
+
5
+ set -e
6
+
7
+ FEATURE_ID="$1"
8
+ FEATURE_NAME="$2"
9
+ DESCRIPTION="${3:-}"
10
+
11
+ if [ -z "$FEATURE_ID" ] || [ -z "$FEATURE_NAME" ]; then
12
+ echo "Usage: ./sedd-specify.sh <feature_id> <feature_name> [description]"
13
+ exit 1
14
+ fi
15
+
16
+ # Load config
17
+ SPECS_DIR=".sedd"
18
+ if [ -f "sedd.config.json" ]; then
19
+ SPECS_DIR=$(grep -o '"specsDir"[[:space:]]*:[[:space:]]*"[^"]*"' sedd.config.json | cut -d'"' -f4)
20
+ [ -z "$SPECS_DIR" ] && SPECS_DIR=".sedd"
21
+ fi
22
+
23
+ BRANCH_NAME="${FEATURE_ID}-${FEATURE_NAME}"
24
+ FEATURE_DIR="${SPECS_DIR}/${BRANCH_NAME}"
25
+
26
+ # Check if exists
27
+ if [ -d "$FEATURE_DIR" ]; then
28
+ echo "Feature already exists: $FEATURE_DIR"
29
+ exit 1
30
+ fi
31
+
32
+ # Create directory
33
+ mkdir -p "$FEATURE_DIR"
34
+ echo "Created: $FEATURE_DIR"
35
+
36
+ # Create _meta.json
37
+ NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
38
+ cat > "$FEATURE_DIR/_meta.json" << EOF
39
+ {
40
+ "featureId": "$FEATURE_ID",
41
+ "featureName": "$FEATURE_NAME",
42
+ "branch": "$BRANCH_NAME",
43
+ "createdAt": "$NOW",
44
+ "specCreatedAt": "$NOW",
45
+ "currentMigration": null,
46
+ "migrations": {},
47
+ "splits": [],
48
+ "commits": []
49
+ }
50
+ EOF
51
+ echo "Created: _meta.json"
52
+
53
+ # Create spec.md
54
+ cat > "$FEATURE_DIR/spec.md" << EOF
55
+ # $FEATURE_NAME
56
+
57
+ ## Overview
58
+
59
+ $DESCRIPTION
60
+
61
+ ## Goals
62
+
63
+ - [ ] Goal 1
64
+ - [ ] Goal 2
65
+
66
+ ## Non-Goals
67
+
68
+ - Out of scope item 1
69
+
70
+ ## User Stories
71
+
72
+ ### US1: [Story Title]
73
+
74
+ **As a** [user type]
75
+ **I want** [action]
76
+ **So that** [benefit]
77
+
78
+ #### Acceptance Criteria
79
+
80
+ - [ ] Criterion 1
81
+ - [ ] Criterion 2
82
+
83
+ ## Technical Requirements
84
+
85
+ ### Architecture
86
+
87
+ [Describe the technical approach]
88
+
89
+ ### Dependencies
90
+
91
+ - Dependency 1
92
+ - Dependency 2
93
+
94
+ ## UI/UX (if applicable)
95
+
96
+ [ASCII mockups or description]
97
+
98
+ ## Open Questions
99
+
100
+ - [ ] Question 1?
101
+ - [ ] Question 2?
102
+ EOF
103
+ echo "Created: spec.md"
104
+
105
+ # Create interfaces.ts
106
+ cat > "$FEATURE_DIR/interfaces.ts" << EOF
107
+ /**
108
+ * TypeScript interfaces for $FEATURE_NAME
109
+ * Feature ID: $FEATURE_ID
110
+ *
111
+ * Define types here FIRST, then implement with Zod schemas later.
112
+ */
113
+
114
+ // Example interface - replace with actual types
115
+ export interface Example {
116
+ id: string;
117
+ name: string;
118
+ createdAt: Date;
119
+ }
120
+
121
+ // Add your interfaces below
122
+ EOF
123
+ echo "Created: interfaces.ts"
124
+
125
+ # Create CHANGELOG.md
126
+ cat > "$FEATURE_DIR/CHANGELOG.md" << EOF
127
+ # Changelog - $FEATURE_NAME
128
+
129
+ All notable changes to this feature will be documented in this file.
130
+
131
+ ## [Unreleased]
132
+
133
+ ### Added
134
+ - Initial feature specification created
135
+ EOF
136
+ echo "Created: CHANGELOG.md"
137
+
138
+ echo ""
139
+ echo "Feature structure created successfully!"
140
+ echo "Next steps:"
141
+ echo " 1. Edit spec.md with detailed requirements"
142
+ echo " 2. Define interfaces in interfaces.ts"
143
+ echo " 3. Run /sedd.clarify to start first migration"
144
+
145
+ # Output JSON
146
+ echo "---SEDD-OUTPUT---"
147
+ echo "{\"success\":true,\"featureDir\":\"$FEATURE_DIR\",\"branch\":\"$BRANCH_NAME\",\"files\":[\"_meta.json\",\"spec.md\",\"interfaces.ts\",\"CHANGELOG.md\"]}"
@@ -0,0 +1,222 @@
1
+ #!/usr/bin/env pwsh
2
+ <#
3
+ .SYNOPSIS
4
+ Creates a new SEDD migration with clarify/tasks/decisions files
5
+ .PARAMETER Branch
6
+ Feature branch name (e.g., "023-agent-executor")
7
+ .PARAMETER Questions
8
+ JSON array of clarification questions
9
+ .PARAMETER Decisions
10
+ JSON array of decisions made
11
+ .EXAMPLE
12
+ ./sedd-clarify.ps1 -Branch "023-agent-executor"
13
+ #>
14
+
15
+ param(
16
+ [Parameter(Mandatory = $false)]
17
+ [string]$Branch = "",
18
+
19
+ [Parameter(Mandatory = $false)]
20
+ [string]$Questions = "[]",
21
+
22
+ [Parameter(Mandatory = $false)]
23
+ [string]$Decisions = "[]"
24
+ )
25
+
26
+ $ErrorActionPreference = 'Stop'
27
+
28
+ #region Config
29
+
30
+ $DEFAULT_CONFIG = @{ specsDir = '.sedd' }
31
+
32
+ function Get-SeddConfig {
33
+ $configPath = Join-Path (Get-Location) 'sedd.config.json'
34
+ if (Test-Path $configPath) {
35
+ try {
36
+ $config = Get-Content $configPath -Raw | ConvertFrom-Json -AsHashtable
37
+ return @{ specsDir = if ($config.specsDir) { $config.specsDir } else { '.sedd' } }
38
+ }
39
+ catch { }
40
+ }
41
+ return $DEFAULT_CONFIG
42
+ }
43
+
44
+ function Get-CurrentBranch {
45
+ try {
46
+ return (git rev-parse --abbrev-ref HEAD 2>$null).Trim()
47
+ }
48
+ catch { return '' }
49
+ }
50
+
51
+ function Get-NextMigrationId {
52
+ param([hashtable]$Meta)
53
+
54
+ $ids = @($Meta.migrations.PSObject.Properties.Name | ForEach-Object { [int]$_ })
55
+ $max = if ($ids.Count -gt 0) { ($ids | Measure-Object -Maximum).Maximum } else { 0 }
56
+ return ($max + 1).ToString().PadLeft(3, '0')
57
+ }
58
+
59
+ #endregion
60
+
61
+ #region Main
62
+
63
+ $config = Get-SeddConfig
64
+ $specsDir = $config.specsDir
65
+
66
+ # Get branch
67
+ if (-not $Branch) {
68
+ $Branch = Get-CurrentBranch
69
+ }
70
+
71
+ if (-not ($Branch -match '^\d{3}-')) {
72
+ Write-Host "Error: Not on a feature branch (current: $Branch)" -ForegroundColor Red
73
+ exit 1
74
+ }
75
+
76
+ # Find feature directory
77
+ $featureDir = Join-Path (Get-Location) "$specsDir/$Branch"
78
+ if (-not (Test-Path $featureDir)) {
79
+ $featureDir = Join-Path (Get-Location) "specs/$Branch"
80
+ }
81
+
82
+ if (-not (Test-Path $featureDir)) {
83
+ Write-Host "Error: Feature directory not found for branch: $Branch" -ForegroundColor Red
84
+ exit 1
85
+ }
86
+
87
+ # Load meta
88
+ $metaPath = Join-Path $featureDir '_meta.json'
89
+ if (-not (Test-Path $metaPath)) {
90
+ Write-Host "Error: _meta.json not found. Run /sedd.specify first." -ForegroundColor Red
91
+ exit 1
92
+ }
93
+
94
+ $meta = Get-Content $metaPath -Raw | ConvertFrom-Json -AsHashtable
95
+
96
+ # Generate migration info
97
+ $migrationId = Get-NextMigrationId -Meta $meta
98
+ $timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
99
+ $migrationFolder = "${migrationId}_${timestamp}"
100
+ $migrationDir = Join-Path $featureDir $migrationFolder
101
+
102
+ # Create migration directory
103
+ New-Item -ItemType Directory -Path $migrationDir -Force | Out-Null
104
+ Write-Host "Created migration: $migrationFolder" -ForegroundColor Green
105
+
106
+ # Create clarify.md
107
+ $clarifyContent = @"
108
+ # Clarification Session - Migration $migrationId
109
+
110
+ **Timestamp:** $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
111
+ **Branch:** $Branch
112
+
113
+ ## Questions & Answers
114
+
115
+ <!-- Questions discussed during this clarification session -->
116
+
117
+ "@
118
+
119
+ # Parse and add questions if provided
120
+ try {
121
+ $questionList = $Questions | ConvertFrom-Json
122
+ if ($questionList.Count -gt 0) {
123
+ $qNum = 1
124
+ foreach ($q in $questionList) {
125
+ $clarifyContent += "`n### Q$qNum`: $($q.question)`n"
126
+ if ($q.answer) {
127
+ $clarifyContent += "`n**Answer:** $($q.answer)`n"
128
+ }
129
+ $qNum++
130
+ }
131
+ }
132
+ }
133
+ catch { }
134
+
135
+ Set-Content -Path (Join-Path $migrationDir 'clarify.md') -Value $clarifyContent -Encoding UTF8
136
+ Write-Host "Created: clarify.md" -ForegroundColor Green
137
+
138
+ # Create decisions.md
139
+ $decisionsContent = @"
140
+ # Decisions - Migration $migrationId
141
+
142
+ **Timestamp:** $(Get-Date -Format "yyyy-MM-dd HH:mm:ss")
143
+
144
+ ## Decisions Made
145
+
146
+ | # | Decision | Rationale |
147
+ |---|----------|-----------|
148
+ "@
149
+
150
+ try {
151
+ $decisionList = $Decisions | ConvertFrom-Json
152
+ $dNum = 1
153
+ foreach ($d in $decisionList) {
154
+ $decisionsContent += "| $dNum | $($d.decision) | $($d.rationale) |`n"
155
+ $dNum++
156
+ }
157
+ }
158
+ catch { }
159
+
160
+ Set-Content -Path (Join-Path $migrationDir 'decisions.md') -Value $decisionsContent -Encoding UTF8
161
+ Write-Host "Created: decisions.md" -ForegroundColor Green
162
+
163
+ # Create tasks.md
164
+ $tasksContent = @"
165
+ # Tasks - Migration $migrationId
166
+
167
+ **Migration:** $migrationId
168
+ **Timestamp:** $timestamp
169
+ **Parent:** $(if ($meta.currentMigration) { $meta.currentMigration } else { 'none' })
170
+
171
+ ## Tasks
172
+
173
+ <!-- Tasks will be added here by /sedd.tasks -->
174
+ <!-- Format: - [ ] T$migrationId-001 [US1] Task description -->
175
+
176
+ "@
177
+
178
+ Set-Content -Path (Join-Path $migrationDir 'tasks.md') -Value $tasksContent -Encoding UTF8
179
+ Write-Host "Created: tasks.md" -ForegroundColor Green
180
+
181
+ # Update _meta.json
182
+ $now = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"
183
+ $previousMigration = $meta.currentMigration
184
+
185
+ if (-not $meta.migrations) {
186
+ $meta.migrations = @{}
187
+ }
188
+
189
+ $meta.migrations[$migrationId] = @{
190
+ id = $migrationId
191
+ timestamp = $timestamp
192
+ folder = $migrationFolder
193
+ parent = $previousMigration
194
+ status = 'pending'
195
+ tasksTotal = 0
196
+ tasksCompleted = 0
197
+ createdAt = $now
198
+ }
199
+ $meta.currentMigration = $migrationId
200
+
201
+ Set-Content -Path $metaPath -Value ($meta | ConvertTo-Json -Depth 10) -Encoding UTF8
202
+ Write-Host "Updated: _meta.json" -ForegroundColor Green
203
+
204
+ Write-Host "`nMigration $migrationId created successfully!" -ForegroundColor Cyan
205
+ Write-Host "Next steps:" -ForegroundColor Cyan
206
+ Write-Host " 1. Add questions/answers to clarify.md" -ForegroundColor White
207
+ Write-Host " 2. Document decisions in decisions.md" -ForegroundColor White
208
+ Write-Host " 3. Run /sedd.tasks to generate tasks" -ForegroundColor White
209
+
210
+ # Output JSON for Claude
211
+ $output = @{
212
+ success = $true
213
+ migrationId = $migrationId
214
+ migrationFolder = $migrationFolder
215
+ migrationDir = $migrationDir
216
+ files = @('clarify.md', 'decisions.md', 'tasks.md')
217
+ }
218
+
219
+ Write-Output "---SEDD-OUTPUT---"
220
+ Write-Output ($output | ConvertTo-Json -Compress)
221
+
222
+ #endregion
@@ -0,0 +1,143 @@
1
+ #!/usr/bin/env pwsh
2
+ <#
3
+ .SYNOPSIS
4
+ Marks a SEDD task as completed
5
+ .PARAMETER TaskId
6
+ Task ID to complete (e.g., "T001-001")
7
+ .PARAMETER Branch
8
+ Feature branch name (optional, auto-detected)
9
+ .EXAMPLE
10
+ ./sedd-complete-task.ps1 -TaskId "T001-001"
11
+ #>
12
+
13
+ param(
14
+ [Parameter(Mandatory = $true)]
15
+ [string]$TaskId,
16
+
17
+ [Parameter(Mandatory = $false)]
18
+ [string]$Branch = ""
19
+ )
20
+
21
+ $ErrorActionPreference = 'Stop'
22
+
23
+ #region Config
24
+
25
+ function Get-SeddConfig {
26
+ $configPath = Join-Path (Get-Location) 'sedd.config.json'
27
+ if (Test-Path $configPath) {
28
+ try {
29
+ $config = Get-Content $configPath -Raw | ConvertFrom-Json -AsHashtable
30
+ return @{ specsDir = if ($config.specsDir) { $config.specsDir } else { '.sedd' } }
31
+ }
32
+ catch { }
33
+ }
34
+ return @{ specsDir = '.sedd' }
35
+ }
36
+
37
+ function Get-CurrentBranch {
38
+ try { return (git rev-parse --abbrev-ref HEAD 2>$null).Trim() }
39
+ catch { return '' }
40
+ }
41
+
42
+ #endregion
43
+
44
+ #region Main
45
+
46
+ $config = Get-SeddConfig
47
+ $specsDir = $config.specsDir
48
+
49
+ if (-not $Branch) { $Branch = Get-CurrentBranch }
50
+
51
+ if (-not ($Branch -match '^\d{3}-')) {
52
+ Write-Host "Error: Not on a feature branch" -ForegroundColor Red
53
+ exit 1
54
+ }
55
+
56
+ # Parse task ID
57
+ if (-not ($TaskId -match '^T(\d{3})-(\d{3})$')) {
58
+ Write-Host "Error: Invalid task ID format. Expected: T001-001" -ForegroundColor Red
59
+ exit 1
60
+ }
61
+
62
+ $migId = $Matches[1]
63
+
64
+ # Find feature directory
65
+ $featureDir = Join-Path (Get-Location) "$specsDir/$Branch"
66
+ if (-not (Test-Path $featureDir)) {
67
+ $featureDir = Join-Path (Get-Location) "specs/$Branch"
68
+ }
69
+
70
+ if (-not (Test-Path $featureDir)) {
71
+ Write-Host "Error: Feature not found: $Branch" -ForegroundColor Red
72
+ exit 1
73
+ }
74
+
75
+ # Load meta
76
+ $metaPath = Join-Path $featureDir '_meta.json'
77
+ if (-not (Test-Path $metaPath)) {
78
+ Write-Host "Error: _meta.json not found" -ForegroundColor Red
79
+ exit 1
80
+ }
81
+
82
+ $meta = Get-Content $metaPath -Raw | ConvertFrom-Json -AsHashtable
83
+
84
+ $migInfo = $meta.migrations[$migId]
85
+ if (-not $migInfo) {
86
+ Write-Host "Error: Migration $migId not found" -ForegroundColor Red
87
+ exit 1
88
+ }
89
+
90
+ $tasksFile = Join-Path $featureDir "$($migInfo.folder)/tasks.md"
91
+ if (-not (Test-Path $tasksFile)) {
92
+ Write-Host "Error: tasks.md not found" -ForegroundColor Red
93
+ exit 1
94
+ }
95
+
96
+ # Read and update task
97
+ $content = Get-Content $tasksFile -Raw
98
+ $pattern = "- \[ \] $TaskId"
99
+
100
+ if ($content -notmatch [regex]::Escape($pattern)) {
101
+ if ($content -match "- \[x\] $TaskId") {
102
+ Write-Host "Task $TaskId is already completed" -ForegroundColor Yellow
103
+ exit 0
104
+ }
105
+ Write-Host "Error: Task $TaskId not found" -ForegroundColor Red
106
+ exit 1
107
+ }
108
+
109
+ $newContent = $content -replace [regex]::Escape("- [ ] $TaskId"), "- [x] $TaskId"
110
+ Set-Content -Path $tasksFile -Value $newContent -Encoding UTF8
111
+
112
+ Write-Host "Completed: $TaskId" -ForegroundColor Green
113
+
114
+ # Update meta
115
+ $meta.migrations[$migId].tasksCompleted = $meta.migrations[$migId].tasksCompleted + 1
116
+
117
+ $completed = $meta.migrations[$migId].tasksCompleted
118
+ $total = $meta.migrations[$migId].tasksTotal
119
+
120
+ if ($completed -ge $total) {
121
+ $meta.migrations[$migId].status = 'completed'
122
+ $meta.migrations[$migId].completedAt = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"
123
+ Write-Host "Migration $migId completed!" -ForegroundColor Cyan
124
+ }
125
+
126
+ Set-Content -Path $metaPath -Value ($meta | ConvertTo-Json -Depth 10) -Encoding UTF8
127
+
128
+ Write-Host "Progress: $completed/$total tasks" -ForegroundColor White
129
+
130
+ # Output JSON
131
+ $output = @{
132
+ success = $true
133
+ taskId = $TaskId
134
+ migrationId = $migId
135
+ completed = $completed
136
+ total = $total
137
+ migrationStatus = $meta.migrations[$migId].status
138
+ }
139
+
140
+ Write-Output "---SEDD-OUTPUT---"
141
+ Write-Output ($output | ConvertTo-Json -Compress)
142
+
143
+ #endregion
@@ -0,0 +1,192 @@
1
+ #!/usr/bin/env pwsh
2
+ <#
3
+ .SYNOPSIS
4
+ Creates initial SEDD feature structure
5
+ .PARAMETER FeatureId
6
+ Feature ID (e.g., "023")
7
+ .PARAMETER FeatureName
8
+ Feature name (e.g., "agent-executor")
9
+ .PARAMETER Description
10
+ Brief description of the feature
11
+ .EXAMPLE
12
+ ./sedd-specify.ps1 -FeatureId "024" -FeatureName "new-feature" -Description "My new feature"
13
+ #>
14
+
15
+ param(
16
+ [Parameter(Mandatory = $true)]
17
+ [string]$FeatureId,
18
+
19
+ [Parameter(Mandatory = $true)]
20
+ [string]$FeatureName,
21
+
22
+ [Parameter(Mandatory = $false)]
23
+ [string]$Description = ""
24
+ )
25
+
26
+ $ErrorActionPreference = 'Stop'
27
+
28
+ #region Config
29
+
30
+ $DEFAULT_CONFIG = @{
31
+ specsDir = '.sedd'
32
+ }
33
+
34
+ function Get-SeddConfig {
35
+ $configPath = Join-Path (Get-Location) 'sedd.config.json'
36
+ if (Test-Path $configPath) {
37
+ try {
38
+ $config = Get-Content $configPath -Raw | ConvertFrom-Json -AsHashtable
39
+ return @{
40
+ specsDir = if ($config.specsDir) { $config.specsDir } else { $DEFAULT_CONFIG.specsDir }
41
+ }
42
+ }
43
+ catch { }
44
+ }
45
+ return $DEFAULT_CONFIG
46
+ }
47
+
48
+ #endregion
49
+
50
+ #region Main
51
+
52
+ $config = Get-SeddConfig
53
+ $specsDir = $config.specsDir
54
+ $branchName = "$FeatureId-$FeatureName"
55
+ $featureDir = Join-Path (Get-Location) "$specsDir/$branchName"
56
+
57
+ # Check if already exists
58
+ if (Test-Path $featureDir) {
59
+ Write-Host "Feature already exists: $featureDir" -ForegroundColor Yellow
60
+ exit 1
61
+ }
62
+
63
+ # Create directory
64
+ New-Item -ItemType Directory -Path $featureDir -Force | Out-Null
65
+ Write-Host "Created: $featureDir" -ForegroundColor Green
66
+
67
+ # Create _meta.json
68
+ $now = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"
69
+ $meta = @{
70
+ featureId = $FeatureId
71
+ featureName = $FeatureName
72
+ branch = $branchName
73
+ createdAt = $now
74
+ specCreatedAt = $now
75
+ currentMigration = $null
76
+ migrations = @{}
77
+ splits = @()
78
+ commits = @()
79
+ } | ConvertTo-Json -Depth 10
80
+
81
+ Set-Content -Path (Join-Path $featureDir '_meta.json') -Value $meta -Encoding UTF8
82
+ Write-Host "Created: _meta.json" -ForegroundColor Green
83
+
84
+ # Create spec.md
85
+ $specContent = @"
86
+ # $FeatureName
87
+
88
+ ## Overview
89
+
90
+ $Description
91
+
92
+ ## Goals
93
+
94
+ - [ ] Goal 1
95
+ - [ ] Goal 2
96
+
97
+ ## Non-Goals
98
+
99
+ - Out of scope item 1
100
+
101
+ ## User Stories
102
+
103
+ ### US1: [Story Title]
104
+
105
+ **As a** [user type]
106
+ **I want** [action]
107
+ **So that** [benefit]
108
+
109
+ #### Acceptance Criteria
110
+
111
+ - [ ] Criterion 1
112
+ - [ ] Criterion 2
113
+
114
+ ## Technical Requirements
115
+
116
+ ### Architecture
117
+
118
+ [Describe the technical approach]
119
+
120
+ ### Dependencies
121
+
122
+ - Dependency 1
123
+ - Dependency 2
124
+
125
+ ## UI/UX (if applicable)
126
+
127
+ [ASCII mockups or description]
128
+
129
+ ## Open Questions
130
+
131
+ - [ ] Question 1?
132
+ - [ ] Question 2?
133
+ "@
134
+
135
+ Set-Content -Path (Join-Path $featureDir 'spec.md') -Value $specContent -Encoding UTF8
136
+ Write-Host "Created: spec.md" -ForegroundColor Green
137
+
138
+ # Create interfaces.ts
139
+ $interfacesContent = @"
140
+ /**
141
+ * TypeScript interfaces for $FeatureName
142
+ * Feature ID: $FeatureId
143
+ *
144
+ * Define types here FIRST, then implement with Zod schemas later.
145
+ */
146
+
147
+ // Example interface - replace with actual types
148
+ export interface Example {
149
+ id: string;
150
+ name: string;
151
+ createdAt: Date;
152
+ }
153
+
154
+ // Add your interfaces below
155
+ "@
156
+
157
+ Set-Content -Path (Join-Path $featureDir 'interfaces.ts') -Value $interfacesContent -Encoding UTF8
158
+ Write-Host "Created: interfaces.ts" -ForegroundColor Green
159
+
160
+ # Create CHANGELOG.md
161
+ $changelogContent = @"
162
+ # Changelog - $FeatureName
163
+
164
+ All notable changes to this feature will be documented in this file.
165
+
166
+ ## [Unreleased]
167
+
168
+ ### Added
169
+ - Initial feature specification created
170
+ "@
171
+
172
+ Set-Content -Path (Join-Path $featureDir 'CHANGELOG.md') -Value $changelogContent -Encoding UTF8
173
+ Write-Host "Created: CHANGELOG.md" -ForegroundColor Green
174
+
175
+ Write-Host "`nFeature structure created successfully!" -ForegroundColor Cyan
176
+ Write-Host "Next steps:" -ForegroundColor Cyan
177
+ Write-Host " 1. Edit spec.md with detailed requirements" -ForegroundColor White
178
+ Write-Host " 2. Define interfaces in interfaces.ts" -ForegroundColor White
179
+ Write-Host " 3. Run /sedd.clarify to start first migration" -ForegroundColor White
180
+
181
+ # Output JSON for Claude to parse
182
+ $output = @{
183
+ success = $true
184
+ featureDir = $featureDir
185
+ branch = $branchName
186
+ files = @('_meta.json', 'spec.md', 'interfaces.ts', 'CHANGELOG.md')
187
+ }
188
+
189
+ Write-Output "---SEDD-OUTPUT---"
190
+ Write-Output ($output | ConvertTo-Json -Compress)
191
+
192
+ #endregion