claude-code-orchestrator-kit 1.4.0 → 1.4.15

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 (219) hide show
  1. package/.claude/agents/business/workers/lead-research-assistant.md +199 -0
  2. package/.claude/agents/database/workers/database-architect.md +3 -3
  3. package/.claude/agents/database/workers/supabase-auditor.md +7 -7
  4. package/.claude/agents/development/workers/code-reviewer.md +17 -2
  5. package/.claude/agents/frontend/workers/nextjs-ui-designer.md +30 -0
  6. package/.claude/agents/health/workers/bug-fixer.md +31 -2
  7. package/.claude/agents/health/workers/bug-hunter.md +0 -1
  8. package/.claude/agents/health/workers/dead-code-hunter.md +167 -75
  9. package/.claude/agents/health/workers/dead-code-remover.md +217 -66
  10. package/.claude/agents/health/workers/dependency-auditor.md +83 -24
  11. package/.claude/agents/health/workers/dependency-updater.md +0 -1
  12. package/.claude/agents/health/workers/security-scanner.md +0 -1
  13. package/.claude/agents/infrastructure/workers/deployment-engineer.md +446 -0
  14. package/.claude/agents/infrastructure/workers/infrastructure-specialist.md +2 -2
  15. package/.claude/agents/meta/workers/meta-agent-v3.md +22 -0
  16. package/.claude/agents/testing/workers/integration-tester.md +1 -1
  17. package/.claude/agents/testing/workers/test-writer.md +16 -0
  18. package/.claude/commands/health-bugs.md +14 -281
  19. package/.claude/commands/health-cleanup.md +14 -281
  20. package/.claude/commands/health-deps.md +14 -281
  21. package/.claude/commands/health-metrics.md +51 -709
  22. package/.claude/commands/health-reuse.md +14 -311
  23. package/.claude/commands/health-security.md +14 -281
  24. package/.claude/commands/push.md +17 -3
  25. package/.claude/commands/speckit.implement.md +0 -11
  26. package/.claude/commands/speckit.taskstoissues.md +95 -5
  27. package/.claude/commands/worktree.md +150 -0
  28. package/.claude/scripts/gates/check-bundle-size.sh +0 -0
  29. package/.claude/scripts/gates/check-coverage.sh +0 -0
  30. package/.claude/scripts/gates/check-security.sh +0 -0
  31. package/.claude/scripts/release.sh +469 -94
  32. package/.claude/skills/algorithmic-art/LICENSE.txt +202 -0
  33. package/.claude/skills/algorithmic-art/SKILL.md +405 -0
  34. package/.claude/skills/algorithmic-art/templates/generator_template.js +223 -0
  35. package/.claude/skills/algorithmic-art/templates/viewer.html +599 -0
  36. package/.claude/skills/artifacts-builder/LICENSE.txt +202 -0
  37. package/.claude/skills/artifacts-builder/SKILL.md +74 -0
  38. package/.claude/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
  39. package/.claude/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
  40. package/.claude/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  41. package/.claude/skills/bug-health-inline/SKILL.md +221 -0
  42. package/.claude/skills/bug-health-inline/references/worker-prompts.md +182 -0
  43. package/.claude/skills/canvas-design/LICENSE.txt +202 -0
  44. package/.claude/skills/canvas-design/SKILL.md +130 -0
  45. package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  46. package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  47. package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  48. package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  49. package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  50. package/.claude/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  51. package/.claude/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  52. package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  53. package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  54. package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  55. package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  56. package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  57. package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  58. package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  59. package/.claude/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  60. package/.claude/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  61. package/.claude/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  62. package/.claude/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  63. package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  64. package/.claude/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  65. package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  66. package/.claude/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  67. package/.claude/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  68. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  69. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  70. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  71. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  72. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  73. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  74. package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  75. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  76. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  77. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  78. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  79. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  80. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  81. package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  82. package/.claude/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  83. package/.claude/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  84. package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  85. package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  86. package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  87. package/.claude/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  88. package/.claude/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  89. package/.claude/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  90. package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  91. package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  92. package/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  93. package/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  94. package/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  95. package/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  96. package/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  97. package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  98. package/.claude/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  99. package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  100. package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  101. package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  102. package/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  103. package/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  104. package/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  105. package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  106. package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  107. package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  108. package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  109. package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  110. package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  111. package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  112. package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  113. package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  114. package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  115. package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  116. package/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  117. package/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  118. package/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  119. package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  120. package/.claude/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  121. package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  122. package/.claude/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  123. package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  124. package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  125. package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  126. package/.claude/skills/changelog-generator/SKILL.md +104 -0
  127. package/.claude/skills/cleanup-health-inline/SKILL.md +224 -0
  128. package/.claude/skills/code-reviewer/SKILL.md +209 -0
  129. package/.claude/skills/code-reviewer/references/code_review_checklist.md +103 -0
  130. package/.claude/skills/code-reviewer/references/coding_standards.md +103 -0
  131. package/.claude/skills/code-reviewer/references/common_antipatterns.md +103 -0
  132. package/.claude/skills/code-reviewer/scripts/code_quality_checker.py +114 -0
  133. package/.claude/skills/code-reviewer/scripts/pr_analyzer.py +114 -0
  134. package/.claude/skills/code-reviewer/scripts/review_report_generator.py +114 -0
  135. package/.claude/skills/content-research-writer/SKILL.md +538 -0
  136. package/.claude/skills/deps-health-inline/SKILL.md +227 -0
  137. package/.claude/skills/frontend-aesthetics/SKILL.md +51 -396
  138. package/.claude/skills/git-commit-helper/SKILL.md +203 -0
  139. package/.claude/skills/lead-research-assistant/SKILL.md +199 -0
  140. package/.claude/skills/reuse-health-inline/SKILL.md +248 -0
  141. package/.claude/skills/rollback-changes/SKILL.md +50 -524
  142. package/.claude/skills/run-quality-gate/SKILL.md +36 -346
  143. package/.claude/skills/security-health-inline/SKILL.md +224 -0
  144. package/.claude/skills/senior-devops/SKILL.md +209 -0
  145. package/.claude/skills/senior-devops/references/cicd_pipeline_guide.md +103 -0
  146. package/.claude/skills/senior-devops/references/deployment_strategies.md +103 -0
  147. package/.claude/skills/senior-devops/references/infrastructure_as_code.md +103 -0
  148. package/.claude/skills/senior-devops/scripts/deployment_manager.py +114 -0
  149. package/.claude/skills/senior-devops/scripts/pipeline_generator.py +114 -0
  150. package/.claude/skills/senior-devops/scripts/terraform_scaffolder.py +114 -0
  151. package/.claude/skills/senior-prompt-engineer/SKILL.md +226 -0
  152. package/.claude/skills/senior-prompt-engineer/references/agentic_system_design.md +80 -0
  153. package/.claude/skills/senior-prompt-engineer/references/llm_evaluation_frameworks.md +80 -0
  154. package/.claude/skills/senior-prompt-engineer/references/prompt_engineering_patterns.md +80 -0
  155. package/.claude/skills/senior-prompt-engineer/scripts/agent_orchestrator.py +100 -0
  156. package/.claude/skills/senior-prompt-engineer/scripts/prompt_optimizer.py +100 -0
  157. package/.claude/skills/senior-prompt-engineer/scripts/rag_evaluator.py +100 -0
  158. package/.claude/skills/setup-knip/SKILL.md +372 -0
  159. package/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  160. package/.claude/skills/systematic-debugging/SKILL.md +296 -0
  161. package/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  162. package/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  163. package/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  164. package/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  165. package/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  166. package/.claude/skills/systematic-debugging/test-academic.md +14 -0
  167. package/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  168. package/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  169. package/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  170. package/.claude/skills/theme-factory/LICENSE.txt +202 -0
  171. package/.claude/skills/theme-factory/SKILL.md +59 -0
  172. package/.claude/skills/theme-factory/theme-showcase.pdf +0 -0
  173. package/.claude/skills/theme-factory/themes/arctic-frost.md +19 -0
  174. package/.claude/skills/theme-factory/themes/botanical-garden.md +19 -0
  175. package/.claude/skills/theme-factory/themes/desert-rose.md +19 -0
  176. package/.claude/skills/theme-factory/themes/forest-canopy.md +19 -0
  177. package/.claude/skills/theme-factory/themes/golden-hour.md +19 -0
  178. package/.claude/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  179. package/.claude/skills/theme-factory/themes/modern-minimalist.md +19 -0
  180. package/.claude/skills/theme-factory/themes/ocean-depths.md +19 -0
  181. package/.claude/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  182. package/.claude/skills/theme-factory/themes/tech-innovation.md +19 -0
  183. package/.claude/skills/ui-design-system/SKILL.md +32 -0
  184. package/.claude/skills/ui-design-system/scripts/design_token_generator.py +529 -0
  185. package/.claude/skills/ux-researcher-designer/SKILL.md +30 -0
  186. package/.claude/skills/ux-researcher-designer/scripts/persona_generator.py +508 -0
  187. package/.claude/skills/webapp-testing/LICENSE.txt +202 -0
  188. package/.claude/skills/webapp-testing/SKILL.md +96 -0
  189. package/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
  190. package/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
  191. package/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
  192. package/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
  193. package/.gitignore +4 -0
  194. package/README.md +492 -1093
  195. package/README.ru.md +719 -0
  196. package/docs/Agents Ecosystem/AGENT-ORCHESTRATION.md +2 -2
  197. package/docs/{SPECKIT-GUIDE.md → COMMANDS-GUIDE.md} +252 -20
  198. package/docs/reports/skills/new-skills-analysis-2025-12.md +331 -0
  199. package/package.json +11 -3
  200. package/.claude/agents/health/orchestrators/bug-orchestrator.md +0 -1084
  201. package/.claude/agents/health/orchestrators/dead-code-orchestrator.md +0 -1064
  202. package/.claude/agents/health/orchestrators/dependency-orchestrator.md +0 -1064
  203. package/.claude/agents/health/orchestrators/reuse-orchestrator.md +0 -1112
  204. package/.claude/agents/health/orchestrators/security-orchestrator.md +0 -1064
  205. package/.claude/commands/worktree-cleanup.md +0 -382
  206. package/.claude/commands/worktree-create.md +0 -287
  207. package/.claude/commands/worktree-list.md +0 -239
  208. package/.claude/commands/worktree-remove.md +0 -339
  209. package/.claude/project-index.md +0 -75
  210. package/.claude/skills/load-project-context/SKILL.md +0 -89
  211. package/.claude/skills/resume-session/SKILL.md +0 -164
  212. package/.claude/skills/save-session-context/SKILL.md +0 -123
  213. package/.claude/templates/project-index.template.md +0 -67
  214. package/.claude/templates/session/context.template.md +0 -40
  215. package/.claude/templates/session/log.template.md +0 -72
  216. package/.github/BRANCH_PROTECTION.md +0 -137
  217. package/.github/workflows/build.yml +0 -70
  218. package/.github/workflows/deploy-staging.yml +0 -90
  219. package/.github/workflows/test.yml +0 -104
@@ -6,577 +6,103 @@ allowed-tools: Bash, Read, Write
6
6
 
7
7
  # Rollback Changes
8
8
 
9
- Automatically rollback changes from failed workflow phases by reading changes log files and reversing all tracked modifications.
9
+ Rollback failed workflow phases by reading changes log and reversing tracked modifications.
10
10
 
11
11
  ## When to Use
12
12
 
13
13
  - Workflow phase fails and needs state restoration
14
- - Automated rollback after failed bug fixes
15
- - Restore previous state after failed security patches
16
- - Cleanup after failed refactoring operations
17
14
  - Error recovery in worker agents
18
15
  - Quality gate failures requiring revert
19
16
 
20
- ## Instructions
17
+ ## Input
21
18
 
22
- ### Step 1: Read Changes Log File
23
-
24
- Use Read tool to load the changes log file.
25
-
26
- **Expected Input**:
27
- - `changes_log_path`: String (path to changes log JSON, e.g., `.bug-changes.json`)
28
- - `phase`: String (workflow phase name, e.g., "bug-fixing")
29
- - `confirmation_required`: Boolean (default: true, ask user before rollback)
30
-
31
- **Tools Used**: Read
32
-
33
- ### Step 2: Parse Changes Log
34
-
35
- Parse the JSON content and validate structure.
36
-
37
- **Required Fields**:
38
- - `phase`: String (workflow phase that made changes)
39
- - `timestamp`: String (ISO-8601 timestamp)
40
- - `files_modified`: Array of objects with `{path, backup}` (files with backups)
41
- - `files_created`: Array of strings (new files created)
42
- - `commands_executed`: Array of strings (commands that were run)
43
- - `git_commits`: Array of strings (commit SHAs if any)
44
-
45
- **Optional Fields**:
46
- - `artifacts`: Array of strings (temporary files to remove)
47
- - `plan_files`: Array of strings (plan files to remove)
48
- - `metadata`: Object (additional context)
49
-
50
- ### Step 3: Request Confirmation (if required)
51
-
52
- If `confirmation_required` is true, ask user for confirmation.
53
-
54
- **Confirmation Prompt**:
55
- ```
56
- Rollback changes from phase "{phase}"?
57
-
58
- Changes to revert:
59
- - Files modified: {count}
60
- - Files created: {count}
61
- - Commands executed: {count}
62
- - Git commits: {count}
63
-
64
- This action will:
65
- 1. Restore {count} files from backups
66
- 2. Delete {count} created files
67
- 3. Revert {count} commands
68
- 4. Revert {count} git commits
69
-
70
- Proceed with rollback? (yes/no)
71
- ```
72
-
73
- **If user says "no"**: Return without taking action (dry run result)
74
-
75
- **If `confirmation_required` is false**: Skip confirmation and proceed
76
-
77
- ### Step 4: Restore Modified Files
78
-
79
- For each file in `files_modified`, restore from backup.
80
-
81
- **Restoration Process**:
82
- ```bash
83
- # For each {path, backup} in files_modified:
84
- if [ -f "{backup}" ]; then
85
- cp "{backup}" "{path}"
86
- echo "✓ Restored {path} from {backup}"
87
- else
88
- echo "⚠ Backup not found: {backup} (skipping)"
89
- fi
90
- ```
91
-
92
- **Error Handling**:
93
- - Missing backup file: Log warning, continue with other files
94
- - Copy failure: Log error, continue with other files
95
- - Permission issues: Log error, continue with other files
96
-
97
- **Tools Used**: Bash
98
-
99
- ### Step 5: Delete Created Files
100
-
101
- For each file in `files_created`, delete if it exists.
102
-
103
- **Deletion Process**:
104
- ```bash
105
- # For each file in files_created:
106
- if [ -f "{file}" ]; then
107
- rm "{file}"
108
- echo "✓ Deleted created file: {file}"
109
- elif [ -d "{file}" ]; then
110
- rm -rf "{file}"
111
- echo "✓ Deleted created directory: {file}"
112
- else
113
- echo "⚠ File not found (already deleted?): {file}"
114
- fi
115
- ```
116
-
117
- **Error Handling**:
118
- - File not found: Log warning (may already be deleted)
119
- - Permission issues: Log error, continue with other files
120
- - Directory not empty: Use `rm -rf` with caution
121
-
122
- **Tools Used**: Bash
123
-
124
- ### Step 6: Revert Commands
125
-
126
- For each command in `commands_executed`, attempt to revert.
127
-
128
- **Revert Mapping**:
129
- - `pnpm install` → `pnpm install` (re-run to restore lockfile)
130
- - `git add {files}` → `git restore --staged {files}`
131
- - `git commit` → Handled in Step 7
132
- - `pnpm build` → `rm -rf dist/` (remove build artifacts)
133
- - Custom commands → Log only (cannot automatically revert)
134
-
135
- **Revert Process**:
136
- ```bash
137
- # For each command:
138
- case "{command}" in
139
- "pnpm install")
140
- pnpm install
141
- echo "✓ Re-ran pnpm install to restore dependencies"
142
- ;;
143
- "git add "*)
144
- git restore --staged .
145
- echo "✓ Unstaged all files"
146
- ;;
147
- "pnpm build")
148
- rm -rf dist/
149
- echo "✓ Removed build artifacts"
150
- ;;
151
- *)
152
- echo "⚠ Cannot auto-revert: {command} (manual intervention required)"
153
- ;;
154
- esac
155
- ```
156
-
157
- **Error Handling**:
158
- - Command fails: Log error, continue with other commands
159
- - Unknown command: Log warning, cannot revert
160
- - Already reverted: Log info, continue
161
-
162
- **Tools Used**: Bash
163
-
164
- ### Step 7: Revert Git Commits
165
-
166
- For each commit SHA in `git_commits`, revert the commit.
167
-
168
- **Revert Process**:
169
- ```bash
170
- # For each SHA in git_commits (in reverse order):
171
- git revert --no-edit {sha}
172
- if [ $? -eq 0 ]; then
173
- echo "✓ Reverted commit {sha}"
174
- else
175
- echo "❌ Failed to revert commit {sha} (may have conflicts)"
176
- fi
177
- ```
178
-
179
- **Error Handling**:
180
- - Revert conflicts: Log error, provide manual instructions
181
- - Commit not found: Log error, skip commit
182
- - Detached HEAD: Log error, skip git operations
183
-
184
- **Tools Used**: Bash
185
-
186
- ### Step 8: Cleanup Artifacts
187
-
188
- Remove temporary files and plan files.
189
-
190
- **Cleanup Process**:
191
- ```bash
192
- # Remove plan files
193
- rm -f .{workflow}-plan.json
194
-
195
- # Remove other artifacts if specified
196
- for artifact in {artifacts}; do
197
- rm -f "{artifact}"
198
- echo "✓ Removed artifact: {artifact}"
199
- done
200
-
201
- # Remove rollback backups (optional, only if all succeeded)
202
- if [ {all_succeeded} == true ]; then
203
- rm -rf .rollback/
204
- echo "✓ Removed rollback backups"
205
- fi
206
- ```
207
-
208
- **Tools Used**: Bash
209
-
210
- ### Step 9: Generate Rollback Report
211
-
212
- Create a structured report of all actions taken.
213
-
214
- **Report Structure**:
215
- ```json
216
- {
217
- "success": true|false,
218
- "phase": "bug-fixing",
219
- "actions_taken": [
220
- "Restored 3 files from backups",
221
- "Deleted 2 created files",
222
- "Reverted 1 git commit",
223
- "Cleaned up 2 artifacts"
224
- ],
225
- "files_restored": 3,
226
- "files_deleted": 2,
227
- "commands_reverted": 1,
228
- "git_commits_reverted": 1,
229
- "artifacts_cleaned": 2,
230
- "errors": [],
231
- "warnings": [
232
- "Backup not found: .rollback/file.backup (skipped)"
233
- ],
234
- "timestamp": "2025-10-18T14:45:00Z",
235
- "duration_ms": 1234
236
- }
237
- ```
238
-
239
- **Tools Used**: Write
240
-
241
- ### Step 10: Return Structured Output
242
-
243
- Return complete rollback result.
244
-
245
- **Expected Output**:
246
- ```json
247
- {
248
- "success": true,
249
- "phase": "bug-fixing",
250
- "actions_taken": [
251
- "Restored src/app.ts from .rollback/src-app.ts.backup",
252
- "Deleted src/new-file.ts",
253
- "Reverted git commit abc123",
254
- "Removed artifact .bug-fixing-plan.json"
255
- ],
256
- "files_restored": 1,
257
- "files_deleted": 1,
258
- "commands_reverted": 0,
259
- "git_commits_reverted": 1,
260
- "artifacts_cleaned": 1,
261
- "errors": [],
262
- "warnings": [],
263
- "timestamp": "2025-10-18T14:45:00Z",
264
- "duration_ms": 1234
265
- }
266
- ```
267
-
268
- ## Error Handling
269
-
270
- - **Missing Changes Log**: Return error "Changes log not found at {path}"
271
- - **Invalid JSON**: Return error "Invalid JSON in changes log: {details}"
272
- - **Missing Required Fields**: Return error "Changes log missing required field: {field}"
273
- - **Backup Not Found**: Log warning, continue with other files (partial rollback)
274
- - **File Deletion Failed**: Log error, continue with other files
275
- - **Git Revert Failed**: Log error with conflict details, continue with other operations
276
- - **User Declined**: Return dry run result with `success: false, user_declined: true`
277
- - **Partial Rollback**: Return `success: true` with warnings array documenting issues
278
-
279
- ## Examples
280
-
281
- ### Example 1: Full Rollback (All Operations Succeed)
282
-
283
- **Input**:
284
19
  ```json
285
20
  {
286
21
  "changes_log_path": ".bug-changes.json",
287
22
  "phase": "bug-fixing",
288
- "confirmation_required": false
23
+ "confirmation_required": true
289
24
  }
290
25
  ```
291
26
 
292
- **Changes Log Content**:
27
+ ## Changes Log Format
28
+
293
29
  ```json
294
30
  {
295
31
  "phase": "bug-fixing",
296
32
  "timestamp": "2025-10-18T14:30:00Z",
297
- "files_modified": [
298
- {"path": "src/app.ts", "backup": ".rollback/src-app.ts.backup"},
299
- {"path": "src/utils.ts", "backup": ".rollback/src-utils.ts.backup"}
300
- ],
301
- "files_created": ["src/new-helper.ts"],
33
+ "files_modified": [{"path": "src/app.ts", "backup": ".rollback/src-app.ts.backup"}],
34
+ "files_created": ["src/new-file.ts"],
302
35
  "commands_executed": ["pnpm install", "pnpm build"],
303
- "git_commits": ["abc123def456"],
36
+ "git_commits": ["abc123"],
304
37
  "artifacts": [".bug-fixing-plan.json"]
305
38
  }
306
39
  ```
307
40
 
308
- **Output**:
309
- ```json
310
- {
311
- "success": true,
312
- "phase": "bug-fixing",
313
- "actions_taken": [
314
- "Restored src/app.ts from .rollback/src-app.ts.backup",
315
- "Restored src/utils.ts from .rollback/src-utils.ts.backup",
316
- "Deleted src/new-helper.ts",
317
- "Re-ran pnpm install to restore dependencies",
318
- "Removed build artifacts (dist/)",
319
- "Reverted git commit abc123def456",
320
- "Removed artifact .bug-fixing-plan.json"
321
- ],
322
- "files_restored": 2,
323
- "files_deleted": 1,
324
- "commands_reverted": 2,
325
- "git_commits_reverted": 1,
326
- "artifacts_cleaned": 1,
327
- "errors": [],
328
- "warnings": [],
329
- "timestamp": "2025-10-18T14:45:00Z",
330
- "duration_ms": 2345
331
- }
332
- ```
333
-
334
- ### Example 2: Partial Rollback (Some Backups Missing)
335
-
336
- **Input**:
337
- ```json
338
- {
339
- "changes_log_path": ".security-changes.json",
340
- "phase": "security-remediation",
341
- "confirmation_required": false
342
- }
343
- ```
344
-
345
- **Changes Log Content**:
346
- ```json
347
- {
348
- "phase": "security-remediation",
349
- "timestamp": "2025-10-18T14:30:00Z",
350
- "files_modified": [
351
- {"path": "src/auth.ts", "backup": ".rollback/src-auth.ts.backup"},
352
- {"path": "src/db.ts", "backup": ".rollback/src-db.ts.backup"}
353
- ],
354
- "files_created": ["src/new-auth.ts"],
355
- "commands_executed": [],
356
- "git_commits": []
357
- }
358
- ```
359
-
360
- **Scenario**: Backup for `src/db.ts` is missing
41
+ ## Process
361
42
 
362
- **Output**:
363
- ```json
364
- {
365
- "success": true,
366
- "phase": "security-remediation",
367
- "actions_taken": [
368
- "Restored src/auth.ts from .rollback/src-auth.ts.backup",
369
- "Deleted src/new-auth.ts"
370
- ],
371
- "files_restored": 1,
372
- "files_deleted": 1,
373
- "commands_reverted": 0,
374
- "git_commits_reverted": 0,
375
- "artifacts_cleaned": 0,
376
- "errors": [],
377
- "warnings": [
378
- "Backup not found: .rollback/src-db.ts.backup (file not restored)"
379
- ],
380
- "timestamp": "2025-10-18T14:45:00Z",
381
- "duration_ms": 456
382
- }
383
- ```
43
+ ### 1. Read & Parse Changes Log
44
+ Use Read tool to load JSON. Validate required fields: phase, timestamp, files_modified, files_created, commands_executed, git_commits.
384
45
 
385
- ### Example 3: Dry Run (User Declines)
46
+ ### 2. Request Confirmation (if required)
47
+ Show summary of changes to revert. If user declines, return dry run result.
386
48
 
387
- **Input**:
388
- ```json
389
- {
390
- "changes_log_path": ".refactor-changes.json",
391
- "phase": "refactoring",
392
- "confirmation_required": true
393
- }
394
- ```
395
-
396
- **User Response**: "no"
397
-
398
- **Output**:
399
- ```json
400
- {
401
- "success": false,
402
- "phase": "refactoring",
403
- "user_declined": true,
404
- "actions_taken": [],
405
- "files_restored": 0,
406
- "files_deleted": 0,
407
- "commands_reverted": 0,
408
- "git_commits_reverted": 0,
409
- "artifacts_cleaned": 0,
410
- "errors": [],
411
- "warnings": [],
412
- "timestamp": "2025-10-18T14:45:00Z",
413
- "duration_ms": 0
414
- }
415
- ```
416
-
417
- ### Example 4: No Changes Log (File Missing)
418
-
419
- **Input**:
420
- ```json
421
- {
422
- "changes_log_path": ".nonexistent-changes.json",
423
- "phase": "unknown",
424
- "confirmation_required": false
425
- }
49
+ ### 3. Restore Modified Files
50
+ ```bash
51
+ cp "{backup}" "{path}" # For each {path, backup} in files_modified
426
52
  ```
427
53
 
428
- **Output**:
429
- ```json
430
- {
431
- "success": false,
432
- "phase": "unknown",
433
- "actions_taken": [],
434
- "files_restored": 0,
435
- "files_deleted": 0,
436
- "commands_reverted": 0,
437
- "git_commits_reverted": 0,
438
- "artifacts_cleaned": 0,
439
- "errors": [
440
- "Changes log not found at .nonexistent-changes.json"
441
- ],
442
- "warnings": [],
443
- "timestamp": "2025-10-18T14:45:00Z",
444
- "duration_ms": 10
445
- }
54
+ ### 4. Delete Created Files
55
+ ```bash
56
+ rm -f "{file}" # For each file in files_created
446
57
  ```
447
58
 
448
- ### Example 5: Git Revert with Conflicts
59
+ ### 5. Revert Commands
60
+ - `pnpm install` → re-run to restore lockfile
61
+ - `git add *` → `git restore --staged .`
62
+ - `pnpm build` → `rm -rf dist/`
63
+ - Other → log warning (cannot auto-revert)
449
64
 
450
- **Input**:
451
- ```json
452
- {
453
- "changes_log_path": ".bug-changes.json",
454
- "phase": "bug-fixing",
455
- "confirmation_required": false
456
- }
65
+ ### 6. Revert Git Commits
66
+ ```bash
67
+ git revert --no-edit {sha} # In reverse order
457
68
  ```
458
69
 
459
- **Changes Log Content**:
460
- ```json
461
- {
462
- "phase": "bug-fixing",
463
- "timestamp": "2025-10-18T14:30:00Z",
464
- "files_modified": [],
465
- "files_created": [],
466
- "commands_executed": [],
467
- "git_commits": ["abc123", "def456"]
468
- }
469
- ```
70
+ ### 7. Cleanup Artifacts
71
+ Remove plan files and temporary artifacts.
470
72
 
471
- **Scenario**: Reverting `abc123` causes conflicts
73
+ ## Output
472
74
 
473
- **Output**:
474
75
  ```json
475
76
  {
476
77
  "success": true,
477
78
  "phase": "bug-fixing",
478
- "actions_taken": [
479
- "Reverted git commit def456"
480
- ],
481
- "files_restored": 0,
482
- "files_deleted": 0,
483
- "commands_reverted": 0,
79
+ "actions_taken": ["Restored src/app.ts", "Deleted src/new-file.ts", "Reverted abc123"],
80
+ "files_restored": 1,
81
+ "files_deleted": 1,
484
82
  "git_commits_reverted": 1,
485
- "artifacts_cleaned": 0,
486
- "errors": [
487
- "Failed to revert commit abc123: Merge conflict in src/app.ts"
488
- ],
489
- "warnings": [
490
- "Manual resolution required for commit abc123"
491
- ],
492
- "timestamp": "2025-10-18T14:45:00Z",
493
- "duration_ms": 876
83
+ "errors": [],
84
+ "warnings": ["Backup not found: .rollback/file.backup (skipped)"]
494
85
  }
495
86
  ```
496
87
 
497
- ## Validation
88
+ ## Error Handling
498
89
 
499
- - [ ] Reads and parses changes log correctly
500
- - [ ] Requests user confirmation when required
501
- - [ ] Restores files from backups successfully
502
- - [ ] Deletes created files correctly
503
- - [ ] Reverts commands appropriately
504
- - [ ] Handles git revert operations
505
- - [ ] Cleans up artifacts
506
- - [ ] Generates structured report
507
- - [ ] Handles partial rollback gracefully
508
- - [ ] Returns clear error messages for failures
509
- - [ ] Logs warnings for non-critical issues
510
- - [ ] Completes within reasonable time (< 30 seconds typical)
90
+ - **Missing log**: Return error "Changes log not found"
91
+ - **Invalid JSON**: Return parsing error
92
+ - **Backup not found**: Log warning, continue (partial rollback OK)
93
+ - **Git conflicts**: Log error with manual instructions, continue
511
94
 
512
95
  ## Safety Features
513
96
 
514
- ### Confirmation by Default
515
- - Always ask for confirmation unless explicitly disabled
516
- - Show clear summary of what will be reverted
517
- - Allow user to cancel before any changes
518
-
519
- ### Partial Rollback Acceptable
520
- - Don't fail entirely if some backups are missing
521
- - Continue with other operations when one fails
522
- - Document all issues in warnings array
523
-
524
- ### No Silent Failures
525
- - Log all errors and warnings explicitly
526
- - Return detailed actions_taken array
527
- - Provide troubleshooting context in errors
528
-
529
- ### Backup Verification
530
- - Never delete original files without verifying backup exists
531
- - Check backup file exists before restoration
532
- - Preserve backups until full rollback succeeds
533
-
534
- ### Audit Trail
535
- - Log all rollback actions for debugging
536
- - Include timestamps and durations
537
- - Return complete report for documentation
538
-
539
- ## Integration with Workers
540
-
541
- Workers should create changes log files during operations:
542
-
543
- ```markdown
544
- ## Step 2: Track Changes
545
-
546
- Before making any modifications:
547
- 1. Create changes log: `.{domain}-changes.json`
548
- 2. For each file modified:
549
- - Create backup in `.rollback/{path}.backup`
550
- - Add to `files_modified` array
551
- 3. For each file created:
552
- - Add to `files_created` array
553
- 4. For each command executed:
554
- - Add to `commands_executed` array
555
- 5. For each git commit:
556
- - Add SHA to `git_commits` array
557
- 6. Write changes log after each modification
558
-
559
- ## Step 5: Rollback on Failure
560
-
561
- If quality gate fails or error occurs:
562
- 1. Use rollback-changes Skill with:
563
- - changes_log_path: ".{domain}-changes.json"
564
- - phase: "{current-phase}"
565
- - confirmation_required: false (automated rollback)
566
- 2. If rollback succeeds, report clean state
567
- 3. If rollback fails, report partial state with warnings
568
- ```
569
-
570
- ## Supporting Files
571
-
572
- - `changes-log-schema.json`: JSON schema for changes log format (see below)
97
+ - Confirmation by default before any changes
98
+ - Partial rollback acceptable (documented in warnings)
99
+ - Never delete without verifying backup exists
100
+ - All actions logged for audit trail
573
101
 
574
- ## Notes
102
+ ## Worker Integration
575
103
 
576
- - Rollback operations are best-effort (may not be 100% reversible)
577
- - Git revert operations may require manual conflict resolution
578
- - Some commands (custom scripts) cannot be automatically reverted
579
- - Backups should be stored in `.rollback/` directory (gitignored)
580
- - Changes log files should be temporary (removed after successful completion)
581
- - Partial rollback is acceptable and documented in warnings
582
- - Always verify backup exists before deletion operations
104
+ Workers should track changes during operations:
105
+ 1. Create `.{domain}-changes.json` before modifications
106
+ 2. Create backups in `.rollback/` for modified files
107
+ 3. Log all file creates, commands, and commits
108
+ 4. On failure: invoke rollback-changes with confirmation_required=false