@bhargavvc/sdd-cc 1.30.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 (227) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +834 -0
  3. package/README.ko-KR.md +823 -0
  4. package/README.md +846 -0
  5. package/README.pt-BR.md +452 -0
  6. package/README.zh-CN.md +800 -0
  7. package/agents/sdd-advisor-researcher.md +104 -0
  8. package/agents/sdd-assumptions-analyzer.md +105 -0
  9. package/agents/sdd-codebase-mapper.md +770 -0
  10. package/agents/sdd-debugger.md +1373 -0
  11. package/agents/sdd-executor.md +509 -0
  12. package/agents/sdd-integration-checker.md +443 -0
  13. package/agents/sdd-nyquist-auditor.md +176 -0
  14. package/agents/sdd-phase-researcher.md +698 -0
  15. package/agents/sdd-plan-checker.md +773 -0
  16. package/agents/sdd-planner.md +1354 -0
  17. package/agents/sdd-project-researcher.md +654 -0
  18. package/agents/sdd-research-synthesizer.md +247 -0
  19. package/agents/sdd-roadmapper.md +679 -0
  20. package/agents/sdd-ui-auditor.md +439 -0
  21. package/agents/sdd-ui-checker.md +300 -0
  22. package/agents/sdd-ui-researcher.md +357 -0
  23. package/agents/sdd-user-profiler.md +171 -0
  24. package/agents/sdd-verifier.md +700 -0
  25. package/bin/install.js +5009 -0
  26. package/commands/sdd/add-backlog.md +76 -0
  27. package/commands/sdd/add-phase.md +43 -0
  28. package/commands/sdd/add-tests.md +41 -0
  29. package/commands/sdd/add-todo.md +47 -0
  30. package/commands/sdd/audit-milestone.md +36 -0
  31. package/commands/sdd/audit-uat.md +24 -0
  32. package/commands/sdd/autonomous.md +41 -0
  33. package/commands/sdd/check-todos.md +45 -0
  34. package/commands/sdd/cleanup.md +18 -0
  35. package/commands/sdd/complete-milestone.md +136 -0
  36. package/commands/sdd/debug.md +173 -0
  37. package/commands/sdd/discuss-phase.md +64 -0
  38. package/commands/sdd/do.md +30 -0
  39. package/commands/sdd/execute-phase.md +59 -0
  40. package/commands/sdd/fast.md +30 -0
  41. package/commands/sdd/forensics.md +56 -0
  42. package/commands/sdd/health.md +22 -0
  43. package/commands/sdd/help.md +22 -0
  44. package/commands/sdd/insert-phase.md +32 -0
  45. package/commands/sdd/join-discord.md +18 -0
  46. package/commands/sdd/list-phase-assumptions.md +46 -0
  47. package/commands/sdd/list-workspaces.md +19 -0
  48. package/commands/sdd/manager.md +39 -0
  49. package/commands/sdd/map-codebase.md +71 -0
  50. package/commands/sdd/milestone-summary.md +51 -0
  51. package/commands/sdd/new-milestone.md +44 -0
  52. package/commands/sdd/new-project.md +42 -0
  53. package/commands/sdd/new-workspace.md +44 -0
  54. package/commands/sdd/next.md +24 -0
  55. package/commands/sdd/note.md +34 -0
  56. package/commands/sdd/pause-work.md +38 -0
  57. package/commands/sdd/plan-milestone-gaps.md +34 -0
  58. package/commands/sdd/plan-phase.md +47 -0
  59. package/commands/sdd/plant-seed.md +28 -0
  60. package/commands/sdd/pr-branch.md +25 -0
  61. package/commands/sdd/profile-user.md +46 -0
  62. package/commands/sdd/progress.md +24 -0
  63. package/commands/sdd/quick.md +47 -0
  64. package/commands/sdd/reapply-patches.md +123 -0
  65. package/commands/sdd/remove-phase.md +31 -0
  66. package/commands/sdd/remove-workspace.md +26 -0
  67. package/commands/sdd/research-phase.md +195 -0
  68. package/commands/sdd/resume-work.md +40 -0
  69. package/commands/sdd/review-backlog.md +61 -0
  70. package/commands/sdd/review.md +37 -0
  71. package/commands/sdd/session-report.md +19 -0
  72. package/commands/sdd/set-profile.md +12 -0
  73. package/commands/sdd/settings.md +36 -0
  74. package/commands/sdd/ship.md +23 -0
  75. package/commands/sdd/stats.md +18 -0
  76. package/commands/sdd/thread.md +127 -0
  77. package/commands/sdd/ui-phase.md +34 -0
  78. package/commands/sdd/ui-review.md +32 -0
  79. package/commands/sdd/update.md +37 -0
  80. package/commands/sdd/validate-phase.md +35 -0
  81. package/commands/sdd/verify-work.md +38 -0
  82. package/commands/sdd/workstreams.md +63 -0
  83. package/hooks/dist/sdd-check-update.js +114 -0
  84. package/hooks/dist/sdd-context-monitor.js +156 -0
  85. package/hooks/dist/sdd-prompt-guard.js +96 -0
  86. package/hooks/dist/sdd-statusline.js +119 -0
  87. package/hooks/dist/sdd-workflow-guard.js +94 -0
  88. package/package.json +55 -0
  89. package/scripts/base64-scan.sh +262 -0
  90. package/scripts/build-hooks.js +82 -0
  91. package/scripts/prompt-injection-scan.sh +198 -0
  92. package/scripts/rebrand-gsd-to-sdd.sh +220 -0
  93. package/scripts/run-tests.cjs +29 -0
  94. package/scripts/secret-scan.sh +227 -0
  95. package/scripts/sync-upstream.sh +56 -0
  96. package/sdd/bin/lib/commands.cjs +959 -0
  97. package/sdd/bin/lib/config.cjs +442 -0
  98. package/sdd/bin/lib/core.cjs +1230 -0
  99. package/sdd/bin/lib/frontmatter.cjs +336 -0
  100. package/sdd/bin/lib/init.cjs +1442 -0
  101. package/sdd/bin/lib/milestone.cjs +252 -0
  102. package/sdd/bin/lib/model-profiles.cjs +68 -0
  103. package/sdd/bin/lib/phase.cjs +888 -0
  104. package/sdd/bin/lib/profile-output.cjs +952 -0
  105. package/sdd/bin/lib/profile-pipeline.cjs +539 -0
  106. package/sdd/bin/lib/roadmap.cjs +329 -0
  107. package/sdd/bin/lib/security.cjs +382 -0
  108. package/sdd/bin/lib/state.cjs +1031 -0
  109. package/sdd/bin/lib/template.cjs +222 -0
  110. package/sdd/bin/lib/uat.cjs +282 -0
  111. package/sdd/bin/lib/verify.cjs +888 -0
  112. package/sdd/bin/lib/workstream.cjs +491 -0
  113. package/sdd/bin/sdd-tools.cjs +918 -0
  114. package/sdd/commands/sdd/workstreams.md +63 -0
  115. package/sdd/references/checkpoints.md +778 -0
  116. package/sdd/references/continuation-format.md +249 -0
  117. package/sdd/references/decimal-phase-calculation.md +64 -0
  118. package/sdd/references/git-integration.md +295 -0
  119. package/sdd/references/git-planning-commit.md +38 -0
  120. package/sdd/references/model-profile-resolution.md +36 -0
  121. package/sdd/references/model-profiles.md +139 -0
  122. package/sdd/references/phase-argument-parsing.md +61 -0
  123. package/sdd/references/planning-config.md +202 -0
  124. package/sdd/references/questioning.md +162 -0
  125. package/sdd/references/tdd.md +263 -0
  126. package/sdd/references/ui-brand.md +160 -0
  127. package/sdd/references/user-profiling.md +681 -0
  128. package/sdd/references/verification-patterns.md +612 -0
  129. package/sdd/references/workstream-flag.md +58 -0
  130. package/sdd/templates/DEBUG.md +164 -0
  131. package/sdd/templates/UAT.md +265 -0
  132. package/sdd/templates/UI-SPEC.md +100 -0
  133. package/sdd/templates/VALIDATION.md +76 -0
  134. package/sdd/templates/claude-md.md +122 -0
  135. package/sdd/templates/codebase/architecture.md +255 -0
  136. package/sdd/templates/codebase/concerns.md +310 -0
  137. package/sdd/templates/codebase/conventions.md +307 -0
  138. package/sdd/templates/codebase/integrations.md +280 -0
  139. package/sdd/templates/codebase/stack.md +186 -0
  140. package/sdd/templates/codebase/structure.md +285 -0
  141. package/sdd/templates/codebase/testing.md +480 -0
  142. package/sdd/templates/config.json +44 -0
  143. package/sdd/templates/context.md +352 -0
  144. package/sdd/templates/continue-here.md +78 -0
  145. package/sdd/templates/copilot-instructions.md +7 -0
  146. package/sdd/templates/debug-subagent-prompt.md +91 -0
  147. package/sdd/templates/dev-preferences.md +21 -0
  148. package/sdd/templates/discovery.md +146 -0
  149. package/sdd/templates/discussion-log.md +63 -0
  150. package/sdd/templates/milestone-archive.md +123 -0
  151. package/sdd/templates/milestone.md +115 -0
  152. package/sdd/templates/phase-prompt.md +610 -0
  153. package/sdd/templates/planner-subagent-prompt.md +117 -0
  154. package/sdd/templates/project.md +186 -0
  155. package/sdd/templates/requirements.md +231 -0
  156. package/sdd/templates/research-project/ARCHITECTURE.md +204 -0
  157. package/sdd/templates/research-project/FEATURES.md +147 -0
  158. package/sdd/templates/research-project/PITFALLS.md +200 -0
  159. package/sdd/templates/research-project/STACK.md +120 -0
  160. package/sdd/templates/research-project/SUMMARY.md +170 -0
  161. package/sdd/templates/research.md +552 -0
  162. package/sdd/templates/retrospective.md +54 -0
  163. package/sdd/templates/roadmap.md +202 -0
  164. package/sdd/templates/state.md +176 -0
  165. package/sdd/templates/summary-complex.md +59 -0
  166. package/sdd/templates/summary-minimal.md +41 -0
  167. package/sdd/templates/summary-standard.md +48 -0
  168. package/sdd/templates/summary.md +248 -0
  169. package/sdd/templates/user-profile.md +146 -0
  170. package/sdd/templates/user-setup.md +311 -0
  171. package/sdd/templates/verification-report.md +322 -0
  172. package/sdd/workflows/add-phase.md +112 -0
  173. package/sdd/workflows/add-tests.md +351 -0
  174. package/sdd/workflows/add-todo.md +158 -0
  175. package/sdd/workflows/audit-milestone.md +340 -0
  176. package/sdd/workflows/audit-uat.md +109 -0
  177. package/sdd/workflows/autonomous.md +891 -0
  178. package/sdd/workflows/check-todos.md +177 -0
  179. package/sdd/workflows/cleanup.md +152 -0
  180. package/sdd/workflows/complete-milestone.md +767 -0
  181. package/sdd/workflows/diagnose-issues.md +231 -0
  182. package/sdd/workflows/discovery-phase.md +289 -0
  183. package/sdd/workflows/discuss-phase-assumptions.md +653 -0
  184. package/sdd/workflows/discuss-phase.md +1049 -0
  185. package/sdd/workflows/do.md +104 -0
  186. package/sdd/workflows/execute-phase.md +846 -0
  187. package/sdd/workflows/execute-plan.md +514 -0
  188. package/sdd/workflows/fast.md +105 -0
  189. package/sdd/workflows/forensics.md +265 -0
  190. package/sdd/workflows/health.md +181 -0
  191. package/sdd/workflows/help.md +606 -0
  192. package/sdd/workflows/insert-phase.md +130 -0
  193. package/sdd/workflows/list-phase-assumptions.md +178 -0
  194. package/sdd/workflows/list-workspaces.md +56 -0
  195. package/sdd/workflows/manager.md +362 -0
  196. package/sdd/workflows/map-codebase.md +377 -0
  197. package/sdd/workflows/milestone-summary.md +223 -0
  198. package/sdd/workflows/new-milestone.md +486 -0
  199. package/sdd/workflows/new-project.md +1250 -0
  200. package/sdd/workflows/new-workspace.md +237 -0
  201. package/sdd/workflows/next.md +97 -0
  202. package/sdd/workflows/node-repair.md +92 -0
  203. package/sdd/workflows/note.md +156 -0
  204. package/sdd/workflows/pause-work.md +176 -0
  205. package/sdd/workflows/plan-milestone-gaps.md +273 -0
  206. package/sdd/workflows/plan-phase.md +859 -0
  207. package/sdd/workflows/plant-seed.md +169 -0
  208. package/sdd/workflows/pr-branch.md +129 -0
  209. package/sdd/workflows/profile-user.md +450 -0
  210. package/sdd/workflows/progress.md +507 -0
  211. package/sdd/workflows/quick.md +757 -0
  212. package/sdd/workflows/remove-phase.md +155 -0
  213. package/sdd/workflows/remove-workspace.md +90 -0
  214. package/sdd/workflows/research-phase.md +82 -0
  215. package/sdd/workflows/resume-project.md +326 -0
  216. package/sdd/workflows/review.md +228 -0
  217. package/sdd/workflows/session-report.md +146 -0
  218. package/sdd/workflows/settings.md +283 -0
  219. package/sdd/workflows/ship.md +228 -0
  220. package/sdd/workflows/stats.md +60 -0
  221. package/sdd/workflows/transition.md +671 -0
  222. package/sdd/workflows/ui-phase.md +302 -0
  223. package/sdd/workflows/ui-review.md +165 -0
  224. package/sdd/workflows/update.md +323 -0
  225. package/sdd/workflows/validate-phase.md +174 -0
  226. package/sdd/workflows/verify-phase.md +254 -0
  227. package/sdd/workflows/verify-work.md +637 -0
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env bash
2
+ ##############################################################################
3
+ # rebrand-gsd-to-sdd.sh (for sdd-cc repo)
4
+ #
5
+ # Converts all G.S.D references to S.D.D in the IDE installer package.
6
+ # IDEMPOTENT — safe to re-run. Excludes itself from modification.
7
+ #
8
+ # USAGE: bash scripts/rebrand-gsd-to-sdd.sh
9
+ # RUN AFTER: git merge upstream-sync (into main)
10
+ ##############################################################################
11
+
12
+ set -euo pipefail
13
+
14
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
15
+ cd "$REPO_ROOT"
16
+
17
+ # Build literal strings via hex to avoid self-modification by sed
18
+ OLD_LC=$(printf '\x67\x73\x64') # g-s-d
19
+ OLD_UC=$(printf '\x47\x53\x44') # G-S-D
20
+ NEW_LC="sdd"
21
+ NEW_UC="SDD"
22
+
23
+ # The old framework directory name (hex-encoded to avoid self-match)
24
+ OLD_DIR=$(printf '\x67\x65\x74\x2d\x73\x68\x69\x74\x2d\x64\x6f\x6e\x65') # get-shit-done
25
+ NEW_DIR="sdd"
26
+
27
+ # Old branding phrases (hex-encoded)
28
+ OLD_BRAND1=$(printf '\x47\x65\x74\x20\x53\x68\x69\x74\x20\x44\x6f\x6e\x65') # Get Shit Done
29
+ OLD_BRAND2=$(printf '\x47\x65\x74\x20\x53\x74\x75\x66\x66\x20\x44\x6f\x6e\x65') # Get Stuff Done
30
+ NEW_BRAND="Spec-Driven Development"
31
+
32
+ SELF_NAME="rebrand-$(echo "${OLD_LC}")-to-${NEW_LC}.sh"
33
+
34
+ echo "=== ${NEW_UC}-CC Rebrand Script ==="
35
+ echo "Working in: $REPO_ROOT"
36
+
37
+ # ─── STEP 1: Rename directories ─────────────────────────────────────────────
38
+ echo ""
39
+ echo "[1/5] Renaming directories..."
40
+
41
+ # Rename get-shit-done/ → sdd/
42
+ if [ -d "${OLD_DIR}" ] && [ ! -d "${NEW_DIR}" ]; then
43
+ echo " ${OLD_DIR}/ -> ${NEW_DIR}/"
44
+ mv "${OLD_DIR}" "${NEW_DIR}"
45
+ fi
46
+
47
+ # Rename commands/gsd/ → commands/sdd/
48
+ if [ -d "commands/${OLD_LC}" ] && [ ! -d "commands/${NEW_LC}" ]; then
49
+ echo " commands/${OLD_LC}/ -> commands/${NEW_LC}/"
50
+ mv "commands/${OLD_LC}" "commands/${NEW_LC}"
51
+ fi
52
+
53
+ # Rename internal get-shit-done/commands/gsd/ if it exists
54
+ if [ -d "${NEW_DIR}/commands/${OLD_LC}" ] && [ ! -d "${NEW_DIR}/commands/${NEW_LC}" ]; then
55
+ echo " ${NEW_DIR}/commands/${OLD_LC}/ -> ${NEW_DIR}/commands/${NEW_LC}/"
56
+ mv "${NEW_DIR}/commands/${OLD_LC}" "${NEW_DIR}/commands/${NEW_LC}"
57
+ fi
58
+
59
+ echo " Done."
60
+
61
+ # ─── STEP 2: Rename files ───────────────────────────────────────────────────
62
+ echo ""
63
+ echo "[2/5] Renaming files..."
64
+
65
+ find . -not -path './.git/*' -not -path './node_modules/*' \
66
+ -not -name "$SELF_NAME" \
67
+ \( -name "*${OLD_LC}*" -o -name "*${OLD_UC}*" -o -name "*${OLD_DIR}*" \) \
68
+ -type f 2>/dev/null | sort -r | while read -r path; do
69
+ dir=$(dirname "$path")
70
+ base=$(basename "$path")
71
+ newbase=$(echo "$base" | sed "s/${OLD_DIR}/${NEW_DIR}/g; s/${OLD_LC}/${NEW_LC}/g; s/${OLD_UC}/${NEW_UC}/g")
72
+ [ "$base" = "$newbase" ] && continue
73
+ echo " $path -> $dir/$newbase"
74
+ mv "$path" "$dir/$newbase"
75
+ done
76
+
77
+ echo " Done."
78
+
79
+ # ─── STEP 3: Replace content in all files ───────────────────────────────────
80
+ echo ""
81
+ echo "[3/5] Finding files with content to replace..."
82
+
83
+ grep -rl --include="*.md" --include="*.js" --include="*.cjs" \
84
+ --include="*.json" --include="*.sh" --include="*.yml" --include="*.yaml" \
85
+ -E "${OLD_LC}|${OLD_UC}|${OLD_DIR}" . 2>/dev/null \
86
+ | grep -v '\.git/' | grep -v 'node_modules/' \
87
+ | grep -v "$SELF_NAME" \
88
+ | grep -v 'package-lock.json' \
89
+ > /tmp/${NEW_LC}-cc-rebrand-files.txt || true
90
+
91
+ FCOUNT=$(wc -l < /tmp/${NEW_LC}-cc-rebrand-files.txt)
92
+ echo " Found $FCOUNT files."
93
+
94
+ echo " Replacing..."
95
+ while IFS= read -r file; do
96
+ [ -z "$file" ] && continue
97
+
98
+ # Branding phrases first (longest match first)
99
+ sed -i \
100
+ -e "s/${OLD_BRAND1}/${NEW_BRAND}/g" \
101
+ -e "s/${OLD_BRAND2}/${NEW_BRAND}/g" \
102
+ "$file"
103
+
104
+ # Directory name: get-shit-done → sdd
105
+ sed -i \
106
+ -e "s/${OLD_DIR}-cc/@bhargavvc\/${NEW_LC}-cc/g" \
107
+ -e "s/${OLD_DIR}/${NEW_DIR}/g" \
108
+ "$file"
109
+
110
+ # Targeted patterns
111
+ sed -i \
112
+ -e "s/${OLD_LC}:/${NEW_LC}:/g" \
113
+ -e "s/${OLD_LC}-/${NEW_LC}-/g" \
114
+ -e "s/_${OLD_LC}/_${NEW_LC}/g" \
115
+ -e "s/${OLD_LC}_/${NEW_LC}_/g" \
116
+ -e "s/\/${OLD_LC}\//\/${NEW_LC}\//g" \
117
+ -e "s/\.${OLD_LC}\//\.${NEW_LC}\//g" \
118
+ -e "s/\.${OLD_LC}\"/.${NEW_LC}\"/g" \
119
+ -e "s/\.${OLD_LC}'/.${NEW_LC}'/g" \
120
+ -e "s/\"${OLD_LC}\"/\"${NEW_LC}\"/g" \
121
+ -e "s/'${OLD_LC}'/'${NEW_LC}'/g" \
122
+ -e "s/@${OLD_LC}\//@${NEW_LC}\//g" \
123
+ -e "s/${OLD_UC}_/${NEW_UC}_/g" \
124
+ -e "s/\"${OLD_UC}\"/\"${NEW_UC}\"/g" \
125
+ -e "s/'${OLD_UC}'/'${NEW_UC}'/g" \
126
+ "$file"
127
+
128
+ # Variable syntax: {{GSD_ARGS}} → {{SDD_ARGS}}
129
+ sed -i \
130
+ -e "s/{{${OLD_UC}_ARGS}}/{{${NEW_UC}_ARGS}}/g" \
131
+ -e "s/{{${OLD_UC}_/{{${NEW_UC}_/g" \
132
+ "$file"
133
+
134
+ # Catch-all: remaining standalone instances
135
+ sed -i \
136
+ -e "s/\b${OLD_LC}\b/${NEW_LC}/g" \
137
+ -e "s/\b${OLD_UC}\b/${NEW_UC}/g" \
138
+ "$file"
139
+
140
+ # Restore @gsd-build (upstream npm scope — must stay)
141
+ if grep -q "${NEW_LC}-build" "$file" 2>/dev/null; then
142
+ sed -i \
143
+ -e "s/@${NEW_LC}-build/@${OLD_LC}-build/g" \
144
+ -e "s/${NEW_LC}-build\//${OLD_LC}-build\//g" \
145
+ "$file"
146
+ fi
147
+
148
+ done < /tmp/${NEW_LC}-cc-rebrand-files.txt
149
+
150
+ rm -f /tmp/${NEW_LC}-cc-rebrand-files.txt
151
+ echo " Done."
152
+
153
+ # ─── STEP 4: Fix package.json ───────────────────────────────────────────────
154
+ echo ""
155
+ echo "[4/5] Updating package.json..."
156
+
157
+ if [ -f "package.json" ]; then
158
+ # Fix package name and bin
159
+ sed -i \
160
+ -e 's/"name": *"[^"]*"/"name": "@bhargavvc\/sdd-cc"/' \
161
+ -e 's/"sdd-cc-cc"/"sdd-cc"/' \
162
+ -e "s/\"${OLD_DIR}-cc\"/\"${NEW_LC}-cc\"/g" \
163
+ package.json
164
+
165
+ # Fix bin entry: the key might already be partially renamed
166
+ # Ensure bin is exactly: "sdd-cc": "bin/install.js"
167
+ node -e "
168
+ const pkg = require('./package.json');
169
+ const fs = require('fs');
170
+ pkg.name = '@bhargavvc/sdd-cc';
171
+ pkg.bin = { 'sdd-cc': 'bin/install.js' };
172
+ pkg.description = pkg.description
173
+ .replace(/Get Shit Done/gi, 'Spec-Driven Development')
174
+ .replace(/GSD/g, 'SDD')
175
+ .replace(/gsd/g, 'sdd');
176
+ pkg.repository = { type: 'git', url: 'git+https://github.com/bhargavvc/sdd-cc.git' };
177
+ pkg.homepage = 'https://github.com/bhargavvc/sdd-cc';
178
+ pkg.bugs = { url: 'https://github.com/bhargavvc/sdd-cc/issues' };
179
+ pkg.publishConfig = { access: 'public' };
180
+ fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
181
+ "
182
+ echo " package.json updated."
183
+ fi
184
+
185
+ echo " Done."
186
+
187
+ # ─── STEP 5: Verify ─────────────────────────────────────────────────────────
188
+ echo ""
189
+ echo "[5/5] Verifying..."
190
+
191
+ STALE_COUNT=0
192
+
193
+ echo " Checking for stale references..."
194
+ # Check markdown and source files for remaining gsd (excluding @gsd-build and this script)
195
+ STALE=$(grep -rn "${OLD_LC}\|${OLD_DIR}" \
196
+ --include="*.md" --include="*.js" --include="*.cjs" \
197
+ . 2>/dev/null \
198
+ | grep -v '\.git/' | grep -v 'node_modules/' \
199
+ | grep -v "$SELF_NAME" \
200
+ | grep -v "@${OLD_LC}-build" \
201
+ | grep -v "REBRAND" \
202
+ | head -20 || true)
203
+
204
+ if [ -n "$STALE" ]; then
205
+ echo " WARNING: Stale references found:"
206
+ echo "$STALE"
207
+ STALE_COUNT=$(echo "$STALE" | wc -l)
208
+ else
209
+ echo " No stale references found."
210
+ fi
211
+
212
+ echo ""
213
+ echo "=== Rebrand complete ==="
214
+ echo " Stale references: $STALE_COUNT"
215
+ echo ""
216
+ echo " Next steps:"
217
+ echo " 1. Review changes: git diff --stat"
218
+ echo " 2. Test installer: node bin/install.js --cursor --local"
219
+ echo " 3. Commit: git add -A && git commit -m 'rebrand: GSD → SDD'"
220
+ echo " 4. Publish: npm publish --access public"
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ // Cross-platform test runner — resolves test file globs via Node
3
+ // instead of relying on shell expansion (which fails on Windows PowerShell/cmd).
4
+ // Propagates NODE_V8_COVERAGE so c8 collects coverage from the child process.
5
+ 'use strict';
6
+
7
+ const { readdirSync } = require('fs');
8
+ const { join } = require('path');
9
+ const { execFileSync } = require('child_process');
10
+
11
+ const testDir = join(__dirname, '..', 'tests');
12
+ const files = readdirSync(testDir)
13
+ .filter(f => f.endsWith('.test.cjs'))
14
+ .sort()
15
+ .map(f => join('tests', f));
16
+
17
+ if (files.length === 0) {
18
+ console.error('No test files found in tests/');
19
+ process.exit(1);
20
+ }
21
+
22
+ try {
23
+ execFileSync(process.execPath, ['--test', ...files], {
24
+ stdio: 'inherit',
25
+ env: { ...process.env },
26
+ });
27
+ } catch (err) {
28
+ process.exit(err.status || 1);
29
+ }
@@ -0,0 +1,227 @@
1
+ #!/usr/bin/env bash
2
+ # secret-scan.sh — Check files for accidentally committed secrets/credentials
3
+ #
4
+ # Usage:
5
+ # scripts/secret-scan.sh --diff origin/main # CI mode: scan changed files
6
+ # scripts/secret-scan.sh --file path/to/file # Scan a single file
7
+ # scripts/secret-scan.sh --dir agents/ # Scan all files in a directory
8
+ #
9
+ # Exit codes:
10
+ # 0 = clean
11
+ # 1 = findings detected
12
+ # 2 = usage error
13
+ set -euo pipefail
14
+
15
+ # ─── Secret Patterns ─────────────────────────────────────────────────────────
16
+ # Format: "LABEL:::REGEX"
17
+ # Each entry is a human label paired with a POSIX extended regex.
18
+
19
+ SECRET_PATTERNS=(
20
+ # AWS
21
+ "AWS Access Key:::AKIA[0-9A-Z]{16}"
22
+ "AWS Secret Key:::aws_secret_access_key[[:space:]]*=[[:space:]]*[A-Za-z0-9/+=]{40}"
23
+
24
+ # OpenAI / Anthropic / AI providers
25
+ "OpenAI API Key:::sk-[A-Za-z0-9]{20,}"
26
+ "Anthropic API Key:::sk-ant-[A-Za-z0-9_-]{20,}"
27
+
28
+ # GitHub
29
+ "GitHub PAT:::ghp_[A-Za-z0-9]{36}"
30
+ "GitHub OAuth:::gho_[A-Za-z0-9]{36}"
31
+ "GitHub App Token:::ghs_[A-Za-z0-9]{36}"
32
+ "GitHub Fine-grained PAT:::github_pat_[A-Za-z0-9_]{20,}"
33
+
34
+ # Stripe
35
+ "Stripe Secret Key:::sk_live_[A-Za-z0-9]{24,}"
36
+ "Stripe Publishable Key:::pk_live_[A-Za-z0-9]{24,}"
37
+
38
+ # Generic patterns
39
+ "Private Key Header:::-----BEGIN[[:space:]]+(RSA|EC|DSA|OPENSSH)?[[:space:]]*PRIVATE[[:space:]]+KEY-----"
40
+ "Generic API Key Assignment:::api[_-]?key[[:space:]]*[:=][[:space:]]*['\"][A-Za-z0-9_-]{20,}['\"]"
41
+ "Generic Secret Assignment:::secret[[:space:]]*[:=][[:space:]]*['\"][A-Za-z0-9_-]{20,}['\"]"
42
+ "Generic Token Assignment:::token[[:space:]]*[:=][[:space:]]*['\"][A-Za-z0-9_-]{20,}['\"]"
43
+ "Generic Password Assignment:::password[[:space:]]*[:=][[:space:]]*['\"][^'\"]{8,}['\"]"
44
+
45
+ # Slack
46
+ "Slack Bot Token:::xoxb-[0-9]{10,}-[A-Za-z0-9]{20,}"
47
+ "Slack Webhook:::hooks\.slack\.com/services/T[A-Z0-9]{8,}/B[A-Z0-9]{8,}/[A-Za-z0-9]{24}"
48
+
49
+ # Google
50
+ "Google API Key:::AIza[A-Za-z0-9_-]{35}"
51
+
52
+ # NPM
53
+ "NPM Token:::npm_[A-Za-z0-9]{36}"
54
+
55
+ # .env file content (key=value with sensitive-looking keys)
56
+ "Env Variable Leak:::(DATABASE_URL|DB_PASSWORD|REDIS_URL|MONGO_URI|JWT_SECRET|SESSION_SECRET|ENCRYPTION_KEY)[[:space:]]*=[[:space:]]*[^[:space:]]{8,}"
57
+ )
58
+
59
+ # ─── Ignorelist ──────────────────────────────────────────────────────────────
60
+
61
+ IGNOREFILE=".secretscanignore"
62
+ IGNORED_FILES=()
63
+
64
+ load_ignorelist() {
65
+ if [[ -f "$IGNOREFILE" ]]; then
66
+ while IFS= read -r line; do
67
+ [[ "$line" =~ ^[[:space:]]*# ]] && continue
68
+ [[ -z "${line// }" ]] && continue
69
+ IGNORED_FILES+=("$line")
70
+ done < "$IGNOREFILE"
71
+ fi
72
+ }
73
+
74
+ is_ignored() {
75
+ local file="$1"
76
+ if [[ ${#IGNORED_FILES[@]} -eq 0 ]]; then
77
+ return 1
78
+ fi
79
+ for pattern in "${IGNORED_FILES[@]}"; do
80
+ # Support glob-style matching
81
+ # shellcheck disable=SC2254
82
+ case "$file" in
83
+ $pattern) return 0 ;;
84
+ esac
85
+ done
86
+ return 1
87
+ }
88
+
89
+ # ─── Skip Rules ──────────────────────────────────────────────────────────────
90
+
91
+ should_skip_file() {
92
+ local file="$1"
93
+ # Skip binary files
94
+ case "$file" in
95
+ *.png|*.jpg|*.jpeg|*.gif|*.ico|*.woff|*.woff2|*.ttf|*.eot|*.otf) return 0 ;;
96
+ *.zip|*.tar|*.gz|*.bz2|*.xz|*.7z) return 0 ;;
97
+ *.pdf|*.doc|*.docx|*.xls|*.xlsx) return 0 ;;
98
+ esac
99
+ # Skip lockfiles and node_modules
100
+ case "$file" in
101
+ */node_modules/*) return 0 ;;
102
+ */package-lock.json) return 0 ;;
103
+ */yarn.lock) return 0 ;;
104
+ */pnpm-lock.yaml) return 0 ;;
105
+ esac
106
+ # Skip the scan scripts themselves and test files
107
+ case "$file" in
108
+ */secret-scan.sh) return 0 ;;
109
+ */security-scan.test.cjs) return 0 ;;
110
+ esac
111
+ return 1
112
+ }
113
+
114
+ # ─── File Collection ─────────────────────────────────────────────────────────
115
+
116
+ collect_files() {
117
+ local mode="$1"
118
+ shift
119
+
120
+ case "$mode" in
121
+ --diff)
122
+ local base="${1:-origin/main}"
123
+ git diff --name-only --diff-filter=ACMR "$base"...HEAD 2>/dev/null \
124
+ | grep -vE '\.(png|jpg|jpeg|gif|ico|woff|woff2|ttf|eot|otf|zip|tar|gz|pdf)$' || true
125
+ ;;
126
+ --file)
127
+ if [[ -f "$1" ]]; then
128
+ echo "$1"
129
+ else
130
+ echo "Error: file not found: $1" >&2
131
+ exit 2
132
+ fi
133
+ ;;
134
+ --dir)
135
+ local dir="$1"
136
+ if [[ ! -d "$dir" ]]; then
137
+ echo "Error: directory not found: $dir" >&2
138
+ exit 2
139
+ fi
140
+ find "$dir" -type f ! -path '*/node_modules/*' ! -path '*/.git/*' ! -path '*/dist/*' \
141
+ ! -name '*.png' ! -name '*.jpg' ! -name '*.gif' ! -name '*.woff*' 2>/dev/null || true
142
+ ;;
143
+ --stdin)
144
+ cat
145
+ ;;
146
+ *)
147
+ echo "Usage: $0 --diff [base] | --file <path> | --dir <path> | --stdin" >&2
148
+ exit 2
149
+ ;;
150
+ esac
151
+ }
152
+
153
+ # ─── Scanner ─────────────────────────────────────────────────────────────────
154
+
155
+ scan_file() {
156
+ local file="$1"
157
+ local found=0
158
+
159
+ if is_ignored "$file"; then
160
+ return 0
161
+ fi
162
+
163
+ for entry in "${SECRET_PATTERNS[@]}"; do
164
+ local label="${entry%%:::*}"
165
+ local pattern="${entry#*:::}"
166
+
167
+ local matches
168
+ matches=$(grep -nE -e "$pattern" "$file" 2>/dev/null || true)
169
+ if [[ -n "$matches" ]]; then
170
+ if [[ $found -eq 0 ]]; then
171
+ echo "FAIL: $file"
172
+ found=1
173
+ fi
174
+ echo "$matches" | while IFS= read -r line; do
175
+ echo " [$label] $line"
176
+ done
177
+ fi
178
+ done
179
+
180
+ return $found
181
+ }
182
+
183
+ # ─── Main ────────────────────────────────────────────────────────────────────
184
+
185
+ main() {
186
+ if [[ $# -eq 0 ]]; then
187
+ echo "Usage: $0 --diff [base] | --file <path> | --dir <path>" >&2
188
+ exit 2
189
+ fi
190
+
191
+ load_ignorelist
192
+
193
+ local mode="$1"
194
+ shift
195
+
196
+ local files
197
+ files=$(collect_files "$mode" "$@")
198
+
199
+ if [[ -z "$files" ]]; then
200
+ echo "secret-scan: no files to scan"
201
+ exit 0
202
+ fi
203
+
204
+ local total=0
205
+ local failed=0
206
+
207
+ while IFS= read -r file; do
208
+ [[ -z "$file" ]] && continue
209
+ if should_skip_file "$file"; then
210
+ continue
211
+ fi
212
+ total=$((total + 1))
213
+ if ! scan_file "$file"; then
214
+ failed=$((failed + 1))
215
+ fi
216
+ done <<< "$files"
217
+
218
+ echo ""
219
+ echo "secret-scan: scanned $total files, $failed with findings"
220
+
221
+ if [[ $failed -gt 0 ]]; then
222
+ exit 1
223
+ fi
224
+ exit 0
225
+ }
226
+
227
+ main "$@"
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env bash
2
+ ##############################################################################
3
+ # sync-upstream.sh
4
+ #
5
+ # Syncs the sdd-cc fork with upstream gsd-build/get-shit-done,
6
+ # then runs the rebrand script.
7
+ #
8
+ # USAGE: bash scripts/sync-upstream.sh
9
+ ##############################################################################
10
+
11
+ set -euo pipefail
12
+
13
+ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
14
+ cd "$REPO_ROOT"
15
+
16
+ echo "=== SDD-CC Upstream Sync ==="
17
+ echo ""
18
+
19
+ # Step 1: Fetch upstream
20
+ echo "[1/5] Fetching upstream..."
21
+ git fetch upstream
22
+ echo " Done."
23
+
24
+ # Step 2: Update upstream-sync branch
25
+ echo ""
26
+ echo "[2/5] Updating upstream-sync branch..."
27
+ git checkout upstream-sync
28
+ git merge upstream/main --no-edit
29
+ echo " Done."
30
+
31
+ # Step 3: Merge into main
32
+ echo ""
33
+ echo "[3/5] Merging upstream-sync into main..."
34
+ git checkout main
35
+ git merge -X theirs upstream-sync --no-edit
36
+ echo " Done."
37
+
38
+ # Step 4: Run rebrand
39
+ echo ""
40
+ echo "[4/5] Running rebrand..."
41
+ bash scripts/rebrand-gsd-to-sdd.sh
42
+ echo " Done."
43
+
44
+ # Step 5: Summary
45
+ echo ""
46
+ echo "[5/5] Summary"
47
+ echo ""
48
+ echo " Upstream version: $(git log upstream/main --oneline -1)"
49
+ echo " Local version: $(cat package.json | grep '"version"' | head -1)"
50
+ echo ""
51
+ echo " Next steps:"
52
+ echo " 1. Review: git diff --stat"
53
+ echo " 2. Test: node bin/install.js --cursor --local"
54
+ echo " 3. Commit: git add -A && git commit -m 'sync: upstream vX.Y.Z + rebrand'"
55
+ echo " 4. Push: git push origin main upstream-sync"
56
+ echo " 5. Publish: npm publish --access public"