@vesviet/agent-skills 5.6.0 → 5.6.1

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 (113) hide show
  1. package/INDEX.md +1 -1
  2. package/README.md +1 -1
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/a2a-config.template.yaml +1 -1
  5. package/adapters/antigravity/role-skill-index.json +1 -1
  6. package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
  7. package/adapters/cursor/README.md +185 -185
  8. package/bin/agent-skills.mjs +17 -14
  9. package/core/contracts/schemas/api-contract-spec.json +191 -191
  10. package/core/contracts/schemas/feature-ticket.json +1293 -1293
  11. package/core/contracts/schemas/pull-request-spec.json +338 -338
  12. package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
  13. package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
  14. package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
  15. package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
  16. package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
  17. package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
  18. package/core/contracts/schemas/test-report.json +530 -530
  19. package/core/roles/references/business-analyst-responsibilities.md +207 -207
  20. package/core/roles/references/frontend-developer-responsibilities.md +275 -275
  21. package/core/roles/system-engineer.md +465 -465
  22. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
  23. package/core/skills/backend/build-mcp-server/SKILL.md +100 -100
  24. package/core/skills/backend/implement-structured-outputs/SKILL.md +94 -94
  25. package/core/skills/business/elicit-requirements/SKILL.md +102 -102
  26. package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
  27. package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
  28. package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
  29. package/core/skills/business/write-use-cases/SKILL.md +106 -106
  30. package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
  31. package/core/skills/document/pptx/scripts/add_slide.py +0 -0
  32. package/core/skills/document/pptx/scripts/clean.py +0 -0
  33. package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
  34. package/core/skills/document/xlsx/scripts/recalc.py +0 -0
  35. package/core/skills/documentation/write-documentation/SKILL.md +143 -143
  36. package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
  37. package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
  38. package/core/skills/foundation/release-notes/SKILL.md +192 -192
  39. package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
  40. package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
  41. package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
  42. package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
  43. package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
  44. package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
  45. package/core/skills/platform/setup-gpu-finops/SKILL.md +107 -107
  46. package/core/skills/platform/setup-llm-gateway/SKILL.md +108 -108
  47. package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
  48. package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
  49. package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
  50. package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
  51. package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
  52. package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
  53. package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
  54. package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
  55. package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
  56. package/core/skills/platform/web-perf/SKILL.md +151 -151
  57. package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
  58. package/core/skills/product/build-story-map/SKILL.md +104 -104
  59. package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
  60. package/core/skills/product/define-product-strategy/SKILL.md +105 -105
  61. package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
  62. package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
  63. package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
  64. package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
  65. package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
  66. package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
  67. package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
  68. package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
  69. package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
  70. package/core/skills/repo-ops/review-service/SKILL.md +186 -186
  71. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
  72. package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
  73. package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
  74. package/core/skills/security-data/security-audit/SKILL.md +119 -119
  75. package/core/workflows/add-new-feature.md +212 -212
  76. package/core/workflows/agent-a2a-delegation.md +142 -142
  77. package/core/workflows/bug-fix.md +147 -147
  78. package/core/workflows/build-deploy.md +208 -208
  79. package/core/workflows/code-review.md +137 -137
  80. package/core/workflows/dependency-upgrade.md +193 -193
  81. package/core/workflows/feature-delivery.md +149 -149
  82. package/core/workflows/hotfix-production.md +172 -172
  83. package/core/workflows/qa-validation.md +231 -231
  84. package/core/workflows/refactoring.md +154 -154
  85. package/core/workflows/revert-deployment.md +147 -147
  86. package/core/workflows/security-incident-response.md +191 -191
  87. package/core/workflows/seo-content-lifecycle.md +91 -91
  88. package/core/workflows/service-review-release.md +223 -223
  89. package/core/workflows/setup-new-service.md +214 -214
  90. package/core/workflows/tech-repo-review.md +245 -245
  91. package/core/workflows/troubleshooting.md +241 -241
  92. package/overlays/astro-cloudflare/README.md +93 -93
  93. package/overlays/data-analyst-stack/README.md +109 -109
  94. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
  95. package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
  96. package/overlays/ecommerce-microservices/README.md +65 -65
  97. package/overlays/go-microservices/README.md +78 -78
  98. package/overlays/go-microservices/rules/go-conventions.md +223 -223
  99. package/overlays/laravel-filament/README.md +90 -90
  100. package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
  101. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
  102. package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
  103. package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
  104. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
  105. package/overlays/r3f-stack/README.md +89 -89
  106. package/overlays/r3f-stack/rules/stub.md +43 -43
  107. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
  108. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
  109. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
  110. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
  111. package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
  112. package/package.json +2 -2
  113. package/core/README.md +0 -53
@@ -1,154 +1,154 @@
1
- ---
2
- description: Workflow for structural improvements that preserve behavior
3
- ---
4
-
5
- ## Refactoring Workflow
6
-
7
- Use this workflow when improving structure, readability, modularity, or maintainability without intentionally changing externally visible behavior.
8
-
9
- ### Prerequisites
10
-
11
- - the current behavior is understood well enough to preserve
12
- - baseline verification exists or can be added first
13
- - the target area has a clear reason to change
14
-
15
- ### Workflow Steps
16
-
17
- #### 1. Define The Goal
18
-
19
- Role: **Technical Lead**, **Technical Architect**
20
-
21
- State the narrow objective:
22
-
23
- - split a large file or function
24
- - isolate a dependency
25
- - reduce duplication
26
- - improve naming or boundaries
27
- - prepare for a future feature safely
28
-
29
- If the goal includes behavior change, use a feature workflow instead.
30
-
31
- #### 2. Establish A Safety Net
32
-
33
- Role: **Backend Developer**, **Frontend Developer**
34
-
35
- Use skill: `write-tests`
36
-
37
- Before moving code:
38
-
39
- - add or strengthen tests around the current behavior
40
- - identify critical edge cases
41
- - record performance-sensitive paths if relevant
42
-
43
- #### 3. Understand The Existing Structure
44
-
45
- Role: **Technical Lead**, **Backend Developer**
46
-
47
- Use skill: `navigate-service`
48
-
49
- Map:
50
-
51
- - current call flow
52
- - dependency edges
53
- - side effects
54
- - public entry points
55
-
56
- #### 4. Choose The Smallest Refactor Sequence
57
-
58
- Role: **Technical Lead**
59
-
60
- Prefer a series of safe, reviewable steps:
61
-
62
- - rename first
63
- - extract next
64
- - move code after tests are stable
65
- - delete dead code last
66
-
67
- Avoid mixing structural cleanup with new business logic.
68
-
69
- When AI coding assistants (Cursor Agent, GitHub Copilot Agent) are used for large renames or extractions: scope them to a single pass with an explicit instruction constraint file (`AGENTS.md` / `.cursorrules`) listing which files and layers are in scope. Always review the full diff before merging — AI refactors can silently introduce behavioral changes in edge paths.
70
-
71
- #### 5. Execute Incrementally
72
-
73
- Role: **Backend Developer**, **Frontend Developer**
74
-
75
- After each meaningful step:
76
-
77
- - rerun the most relevant tests
78
- - rebuild the affected package or service
79
- - compare behavior against the baseline
80
-
81
- If the refactor touches **service API boundaries or event contracts**: run **Pact v4** or **Specmatic** contract tests to confirm no consumer-breaking changes were introduced — structural refactors often break wire format or field naming in ways that unit tests miss.
82
-
83
- Use skill: `review-code` when the change alters boundaries or ownership between layers.
84
-
85
- #### 6. Check Secondary Effects
86
-
87
- Role: **Reviewer**, **SRE**
88
-
89
- If the refactor touches hot paths, shared code, or contracts:
90
-
91
- - verify performance did not regress
92
- - verify logs, metrics, or error shapes still make sense
93
- - verify downstream callers still compile and behave correctly
94
-
95
- Use skill: `performance-profiling` if the path is latency-sensitive.
96
-
97
- #### 7. Prepare Delivery
98
-
99
- Role: **Backend Developer**, **Frontend Developer**
100
-
101
- Use skill: `commit-code`
102
-
103
- Before committing:
104
-
105
- - remove temporary scaffolding
106
- - confirm no accidental behavior changes slipped in
107
- - update docs when code organization changes matter to teammates
108
-
109
- Do not create a commit until the user explicitly confirms that commit action.
110
- Do not push, tag, or publish until the user explicitly confirms that specific action.
111
-
112
- ### Checklist
113
-
114
- - [ ] goal limited to structural improvement
115
- - [ ] safety-net tests added or confirmed
116
- - [ ] current structure mapped
117
- - [ ] refactor broken into safe steps
118
- - [ ] tests and build rerun during execution
119
- - [ ] performance checked if needed
120
- - [ ] docs updated if needed
121
-
122
- ### Related Workflows
123
-
124
- - [Add New Feature](add-new-feature.md)
125
- - [Service Review & Release](service-review-release.md)
126
-
127
- ### Related Skills
128
-
129
- - **navigate-service**: Understand the current structure before refactoring
130
- - **write-tests**: Establish behavior-preserving safety coverage
131
- - **review-code**: Review boundary and ownership changes
132
- - **performance-profiling**: Check performance-sensitive refactors
133
- - **commit-code**: Prepare approved refactor changes for delivery
134
-
135
- ### Failure Modes
136
-
137
- - **Behavior changed during refactor**: a refactor introduces a user-visible behavior change. **Mitigation:** the refactor must be behavior-preserving; the diff is verified against the existing test suite and acceptance criteria before the change is shipped.
138
- - **Refactor expands scope**: a refactor pulls in unrelated changes (style fixes, dependency bumps). **Mitigation:** split into separate PRs; the refactor PR is rejected if it touches unrelated code.
139
- - **Test coverage missing for the refactored path**: the refactor deletes or moves code without preserving the test coverage. **Mitigation:** the refactor PR must include a passing test for the new structure; reject the PR if a path is uncovered.
140
- - **Performance regression undetected**: a refactor slows the hot path. **Mitigation:** run the benchmark before and after the refactor; reject the change if the regression exceeds the agreed budget.
141
-
142
- ### Output Contracts
143
-
144
- When this workflow produces a structured handoff, emit:
145
-
146
- - **`contracts/schemas/implementation-result.json`** — capture the behavior-preservation evidence, the test coverage delta, the benchmark before/after, and the files touched.
147
- - **`contracts/schemas/code-review-finding.json`** (adapted for refactor) — when the refactor surfaces a structural concern; capture the smell, the proposed resolution, and the trade-off.
148
-
149
- ### Security Guardrails (OWASP ASI)
150
-
151
- - **ASI05 RCE Guard**: never construct refactored code, scripts, or test fixtures from external or user-supplied content without strict schema validation; reject string-concatenated refactors.
152
- - **ASI07 Inter-Agent Communication**: the refactor result is consumed by code review and release roles; emit a structured contract so each consumer can validate the behavior-preservation evidence.
153
- - **ASI09 Human-Agent Trust Exploitation**: do not present a refactor as "safe" without the behavior-preservation evidence and the test coverage delta; surface the residual risk honestly.
154
-
1
+ ---
2
+ description: Workflow for structural improvements that preserve behavior
3
+ ---
4
+
5
+ ## Refactoring Workflow
6
+
7
+ Use this workflow when improving structure, readability, modularity, or maintainability without intentionally changing externally visible behavior.
8
+
9
+ ### Prerequisites
10
+
11
+ - the current behavior is understood well enough to preserve
12
+ - baseline verification exists or can be added first
13
+ - the target area has a clear reason to change
14
+
15
+ ### Workflow Steps
16
+
17
+ #### 1. Define The Goal
18
+
19
+ Role: **Technical Lead**, **Technical Architect**
20
+
21
+ State the narrow objective:
22
+
23
+ - split a large file or function
24
+ - isolate a dependency
25
+ - reduce duplication
26
+ - improve naming or boundaries
27
+ - prepare for a future feature safely
28
+
29
+ If the goal includes behavior change, use a feature workflow instead.
30
+
31
+ #### 2. Establish A Safety Net
32
+
33
+ Role: **Backend Developer**, **Frontend Developer**
34
+
35
+ Use skill: `write-tests`
36
+
37
+ Before moving code:
38
+
39
+ - add or strengthen tests around the current behavior
40
+ - identify critical edge cases
41
+ - record performance-sensitive paths if relevant
42
+
43
+ #### 3. Understand The Existing Structure
44
+
45
+ Role: **Technical Lead**, **Backend Developer**
46
+
47
+ Use skill: `navigate-service`
48
+
49
+ Map:
50
+
51
+ - current call flow
52
+ - dependency edges
53
+ - side effects
54
+ - public entry points
55
+
56
+ #### 4. Choose The Smallest Refactor Sequence
57
+
58
+ Role: **Technical Lead**
59
+
60
+ Prefer a series of safe, reviewable steps:
61
+
62
+ - rename first
63
+ - extract next
64
+ - move code after tests are stable
65
+ - delete dead code last
66
+
67
+ Avoid mixing structural cleanup with new business logic.
68
+
69
+ When AI coding assistants (Cursor Agent, GitHub Copilot Agent) are used for large renames or extractions: scope them to a single pass with an explicit instruction constraint file (`AGENTS.md` / `.cursorrules`) listing which files and layers are in scope. Always review the full diff before merging — AI refactors can silently introduce behavioral changes in edge paths.
70
+
71
+ #### 5. Execute Incrementally
72
+
73
+ Role: **Backend Developer**, **Frontend Developer**
74
+
75
+ After each meaningful step:
76
+
77
+ - rerun the most relevant tests
78
+ - rebuild the affected package or service
79
+ - compare behavior against the baseline
80
+
81
+ If the refactor touches **service API boundaries or event contracts**: run **Pact v4** or **Specmatic** contract tests to confirm no consumer-breaking changes were introduced — structural refactors often break wire format or field naming in ways that unit tests miss.
82
+
83
+ Use skill: `review-code` when the change alters boundaries or ownership between layers.
84
+
85
+ #### 6. Check Secondary Effects
86
+
87
+ Role: **Reviewer**, **SRE**
88
+
89
+ If the refactor touches hot paths, shared code, or contracts:
90
+
91
+ - verify performance did not regress
92
+ - verify logs, metrics, or error shapes still make sense
93
+ - verify downstream callers still compile and behave correctly
94
+
95
+ Use skill: `performance-profiling` if the path is latency-sensitive.
96
+
97
+ #### 7. Prepare Delivery
98
+
99
+ Role: **Backend Developer**, **Frontend Developer**
100
+
101
+ Use skill: `commit-code`
102
+
103
+ Before committing:
104
+
105
+ - remove temporary scaffolding
106
+ - confirm no accidental behavior changes slipped in
107
+ - update docs when code organization changes matter to teammates
108
+
109
+ Do not create a commit until the user explicitly confirms that commit action.
110
+ Do not push, tag, or publish until the user explicitly confirms that specific action.
111
+
112
+ ### Checklist
113
+
114
+ - [ ] goal limited to structural improvement
115
+ - [ ] safety-net tests added or confirmed
116
+ - [ ] current structure mapped
117
+ - [ ] refactor broken into safe steps
118
+ - [ ] tests and build rerun during execution
119
+ - [ ] performance checked if needed
120
+ - [ ] docs updated if needed
121
+
122
+ ### Related Workflows
123
+
124
+ - [Add New Feature](add-new-feature.md)
125
+ - [Service Review & Release](service-review-release.md)
126
+
127
+ ### Related Skills
128
+
129
+ - **navigate-service**: Understand the current structure before refactoring
130
+ - **write-tests**: Establish behavior-preserving safety coverage
131
+ - **review-code**: Review boundary and ownership changes
132
+ - **performance-profiling**: Check performance-sensitive refactors
133
+ - **commit-code**: Prepare approved refactor changes for delivery
134
+
135
+ ### Failure Modes
136
+
137
+ - **Behavior changed during refactor**: a refactor introduces a user-visible behavior change. **Mitigation:** the refactor must be behavior-preserving; the diff is verified against the existing test suite and acceptance criteria before the change is shipped.
138
+ - **Refactor expands scope**: a refactor pulls in unrelated changes (style fixes, dependency bumps). **Mitigation:** split into separate PRs; the refactor PR is rejected if it touches unrelated code.
139
+ - **Test coverage missing for the refactored path**: the refactor deletes or moves code without preserving the test coverage. **Mitigation:** the refactor PR must include a passing test for the new structure; reject the PR if a path is uncovered.
140
+ - **Performance regression undetected**: a refactor slows the hot path. **Mitigation:** run the benchmark before and after the refactor; reject the change if the regression exceeds the agreed budget.
141
+
142
+ ### Output Contracts
143
+
144
+ When this workflow produces a structured handoff, emit:
145
+
146
+ - **`contracts/schemas/implementation-result.json`** — capture the behavior-preservation evidence, the test coverage delta, the benchmark before/after, and the files touched.
147
+ - **`contracts/schemas/code-review-finding.json`** (adapted for refactor) — when the refactor surfaces a structural concern; capture the smell, the proposed resolution, and the trade-off.
148
+
149
+ ### Security Guardrails (OWASP ASI)
150
+
151
+ - **ASI05 RCE Guard**: never construct refactored code, scripts, or test fixtures from external or user-supplied content without strict schema validation; reject string-concatenated refactors.
152
+ - **ASI07 Inter-Agent Communication**: the refactor result is consumed by code review and release roles; emit a structured contract so each consumer can validate the behavior-preservation evidence.
153
+ - **ASI09 Human-Agent Trust Exploitation**: do not present a refactor as "safe" without the behavior-preservation evidence and the test coverage delta; surface the residual risk honestly.
154
+
@@ -1,147 +1,147 @@
1
- ---
2
- description: Emergency workflow for safely rolling back a failed deployment, release, or database migration
3
- ---
4
-
5
- ## Revert Deployment Workflow
6
-
7
- Use this workflow when a release causes severe degradation or outages and rolling back to the previous stable state is the fastest mitigation.
8
-
9
- ### When To Use
10
-
11
- - a recent deployment caused service degradation or outage
12
- - a database migration introduced data corruption risk
13
- - a config change broke runtime behavior
14
- - progressive delivery (Canary, Blue/Green) shows unacceptable error rates
15
-
16
- ### Prerequisites
17
-
18
- - the failing deployment or release is identified
19
- - stakeholders or on-call owners are aware
20
- - the previous known good state is identifiable
21
-
22
- ### Workflow Steps
23
-
24
- #### 1. Assess Impact
25
-
26
- Role: **SRE**, **Technical Lead**
27
-
28
- Confirm that the issue is caused by the recent deployment:
29
-
30
- - check telemetry, alerts, and logs
31
- - correlate the timeline with the deployment event
32
- - determine scope of user impact
33
- - decide whether rollback is safer than a forward fix
34
-
35
- Use skill: `troubleshoot-service`
36
-
37
- #### 2. Halt Rollout
38
-
39
- Role: **DevOps Engineer**, **SRE**
40
-
41
- Stop any progressive delivery if it is still ongoing:
42
-
43
- - pause Canary or Blue/Green promotion
44
- - prevent further replicas from receiving the new revision
45
- - communicate the halt to relevant stakeholders
46
-
47
- #### 3. Check Database State
48
-
49
- Role: **Backend Developer**, **SRE**
50
-
51
- Determine if the rollback requires a database migration revert:
52
-
53
- - check if the new migration is backward compatible
54
- - if yes, the app rollback can proceed independently
55
- - if no, execute the down-migration safely before or after reverting the application code
56
- - verify data integrity after any migration revert
57
-
58
- Use skill: `database-maintenance`
59
-
60
- #### 4. Revert Configuration And Code
61
-
62
- Role: **DevOps Engineer**
63
-
64
- Revert the deployment source-of-truth to the previous known good state:
65
-
66
- - revert GitOps configuration, Helm charts, or infrastructure as code (in Argo CD: trigger a sync to the previous ApplicationSet revision; in Flux: revert the HelmRelease manifest in Git)
67
- - ensure the rollback follows the same delivery path as the original deploy — never apply runtime patches that bypass the GitOps source of truth
68
- - do not make manual runtime patches that bypass the source of truth
69
-
70
- If the rollout used **Argo Rollouts** canary/blue-green with automated metric analysis: trigger an `argo rollouts abort` to immediately shift 100% of traffic back to the stable revision — this is faster and safer than manual manifest changes.
71
-
72
- If the failing feature is behind an **OpenFeature** flag: disable the flag as an immediate mitigation before or alongside the deployment revert — this can stop user impact in seconds.
73
-
74
- Do not create a commit until the user explicitly confirms that commit action.
75
- Do not push, create a tag, or publish a release until the user explicitly confirms that specific action.
76
-
77
- Use skill: `setup-deployment`
78
-
79
- #### 5. Verify Stability
80
-
81
- Role: **SRE**, **DevOps Engineer**
82
-
83
- Monitor the system to ensure it has fully stabilized:
84
-
85
- - check health endpoints and readiness probes
86
- - watch error rates and latency against pre-incident baselines
87
- - verify dependent services are reachable and healthy
88
- - run a focused smoke test on the affected paths
89
-
90
- Use skill: `debug-runtime-platform`
91
-
92
- #### 6. Document The Rollback
93
-
94
- Role: **Technical Lead**, **Technical Writer**
95
-
96
- Capture the incident and rollback for the post-mortem:
97
-
98
- - timeline of events
99
- - rollback actions taken
100
- - root cause (if known) or investigation status
101
- - follow-up work and preventive measures
102
-
103
- ### Checklist
104
-
105
- - [ ] impact assessed and recent deployment correlated
106
- - [ ] rollout halted when applicable
107
- - [ ] database state and migration safety checked
108
- - [ ] deployment source of truth reverted
109
- - [ ] system stability verified after rollback
110
- - [ ] rollback actions and follow-up documented
111
-
112
- ### Related Workflows
113
-
114
- - [Hotfix Production](hotfix-production.md)
115
- - [Troubleshooting](troubleshooting.md)
116
- - [Build & Deploy](build-deploy.md)
117
-
118
- ### Related Skills
119
-
120
- - **troubleshoot-service**: Confirm the failing layer before rollback
121
- - **debug-runtime-platform**: Verify runtime recovery after rollback
122
- - **database-maintenance**: Handle data or migration rollback safely
123
- - **setup-deployment**: Revert deployment source-of-truth configuration
124
- - **commit-code**: Prepare approved rollback changes for delivery
125
-
126
- ### Failure Modes
127
-
128
- - **Revert without a previous deployment**: a revert is requested but the previous artifact is missing. **Mitigation:** verify the previous deployment is rollbackable before issuing the revert; reject the revert when no prior artifact is available.
129
- - **Revert cascades to dependent services**: a downstream service depends on the schema or contract of the new release. **Mitigation:** before reverting, identify downstream consumers in the dependency graph; route a coordinated revert through `contracts/schemas/coordination-plan.json` when more than one service is affected.
130
- - **Database migration not reversible**: a forward migration ran but the data has already changed. **Mitigation:** document the partial-rollback path in the revert plan; require human sign-off when the revert is unsafe.
131
- - **Cache stale after revert**: a CDN or browser cache still serves the new release. **Mitigation:** require a full purge of the affected route pattern; verify the cache miss with curl after revert.
132
- - **Revert skipped because of feature flag**: a flag is intended to gate a release, but a separate code path bypasses it. **Mitigation:** verify the flag is checked in every code path that touches the gated feature; never trust the flag alone.
133
-
134
- ### Output Contracts
135
-
136
- When this workflow produces a structured handoff, emit:
137
-
138
- - **`contracts/schemas/deployment-plan.json`** — For the revert; capture the target revision, the rollback steps, the cache purge, and the validation run.
139
- - **`contracts/schemas/incident-report.json`** — When the revert is triggered by an incident; capture the symptom, the failed artifact, the revert rationale, and the follow-up postmortem reference.
140
- - **`contracts/schemas/coordination-plan.json`** — When the revert cascades to dependent services; route the coordinated revert through the coordinator.
141
-
142
- ### Security Guardrails (OWASP ASI)
143
-
144
- - **ASI03 Identity & Privilege Abuse**: revert credentials must be scoped to the role that owns the deploy; reject reverts requested by a role that does not hold `run_deployment` in `action-boundaries.yaml`.
145
- - **ASI05 RCE Guard**: never construct revert commands or cache-purge scripts from external content without strict schema validation.
146
- - **ASI07 Inter-Agent Communication**: the revert is consumed by SRE, release, and downstream roles; emit structured contracts so each role can validate the cascade.
147
- - **ASI09 Human-Agent Trust Exploitation**: do not present the revert as "successful" without end-to-end verification on the previous revision; surface the actual `validation_run` evidence.
1
+ ---
2
+ description: Emergency workflow for safely rolling back a failed deployment, release, or database migration
3
+ ---
4
+
5
+ ## Revert Deployment Workflow
6
+
7
+ Use this workflow when a release causes severe degradation or outages and rolling back to the previous stable state is the fastest mitigation.
8
+
9
+ ### When To Use
10
+
11
+ - a recent deployment caused service degradation or outage
12
+ - a database migration introduced data corruption risk
13
+ - a config change broke runtime behavior
14
+ - progressive delivery (Canary, Blue/Green) shows unacceptable error rates
15
+
16
+ ### Prerequisites
17
+
18
+ - the failing deployment or release is identified
19
+ - stakeholders or on-call owners are aware
20
+ - the previous known good state is identifiable
21
+
22
+ ### Workflow Steps
23
+
24
+ #### 1. Assess Impact
25
+
26
+ Role: **SRE**, **Technical Lead**
27
+
28
+ Confirm that the issue is caused by the recent deployment:
29
+
30
+ - check telemetry, alerts, and logs
31
+ - correlate the timeline with the deployment event
32
+ - determine scope of user impact
33
+ - decide whether rollback is safer than a forward fix
34
+
35
+ Use skill: `troubleshoot-service`
36
+
37
+ #### 2. Halt Rollout
38
+
39
+ Role: **DevOps Engineer**, **SRE**
40
+
41
+ Stop any progressive delivery if it is still ongoing:
42
+
43
+ - pause Canary or Blue/Green promotion
44
+ - prevent further replicas from receiving the new revision
45
+ - communicate the halt to relevant stakeholders
46
+
47
+ #### 3. Check Database State
48
+
49
+ Role: **Backend Developer**, **SRE**
50
+
51
+ Determine if the rollback requires a database migration revert:
52
+
53
+ - check if the new migration is backward compatible
54
+ - if yes, the app rollback can proceed independently
55
+ - if no, execute the down-migration safely before or after reverting the application code
56
+ - verify data integrity after any migration revert
57
+
58
+ Use skill: `database-maintenance`
59
+
60
+ #### 4. Revert Configuration And Code
61
+
62
+ Role: **DevOps Engineer**
63
+
64
+ Revert the deployment source-of-truth to the previous known good state:
65
+
66
+ - revert GitOps configuration, Helm charts, or infrastructure as code (in Argo CD: trigger a sync to the previous ApplicationSet revision; in Flux: revert the HelmRelease manifest in Git)
67
+ - ensure the rollback follows the same delivery path as the original deploy — never apply runtime patches that bypass the GitOps source of truth
68
+ - do not make manual runtime patches that bypass the source of truth
69
+
70
+ If the rollout used **Argo Rollouts** canary/blue-green with automated metric analysis: trigger an `argo rollouts abort` to immediately shift 100% of traffic back to the stable revision — this is faster and safer than manual manifest changes.
71
+
72
+ If the failing feature is behind an **OpenFeature** flag: disable the flag as an immediate mitigation before or alongside the deployment revert — this can stop user impact in seconds.
73
+
74
+ Do not create a commit until the user explicitly confirms that commit action.
75
+ Do not push, create a tag, or publish a release until the user explicitly confirms that specific action.
76
+
77
+ Use skill: `setup-deployment`
78
+
79
+ #### 5. Verify Stability
80
+
81
+ Role: **SRE**, **DevOps Engineer**
82
+
83
+ Monitor the system to ensure it has fully stabilized:
84
+
85
+ - check health endpoints and readiness probes
86
+ - watch error rates and latency against pre-incident baselines
87
+ - verify dependent services are reachable and healthy
88
+ - run a focused smoke test on the affected paths
89
+
90
+ Use skill: `debug-runtime-platform`
91
+
92
+ #### 6. Document The Rollback
93
+
94
+ Role: **Technical Lead**, **Technical Writer**
95
+
96
+ Capture the incident and rollback for the post-mortem:
97
+
98
+ - timeline of events
99
+ - rollback actions taken
100
+ - root cause (if known) or investigation status
101
+ - follow-up work and preventive measures
102
+
103
+ ### Checklist
104
+
105
+ - [ ] impact assessed and recent deployment correlated
106
+ - [ ] rollout halted when applicable
107
+ - [ ] database state and migration safety checked
108
+ - [ ] deployment source of truth reverted
109
+ - [ ] system stability verified after rollback
110
+ - [ ] rollback actions and follow-up documented
111
+
112
+ ### Related Workflows
113
+
114
+ - [Hotfix Production](hotfix-production.md)
115
+ - [Troubleshooting](troubleshooting.md)
116
+ - [Build & Deploy](build-deploy.md)
117
+
118
+ ### Related Skills
119
+
120
+ - **troubleshoot-service**: Confirm the failing layer before rollback
121
+ - **debug-runtime-platform**: Verify runtime recovery after rollback
122
+ - **database-maintenance**: Handle data or migration rollback safely
123
+ - **setup-deployment**: Revert deployment source-of-truth configuration
124
+ - **commit-code**: Prepare approved rollback changes for delivery
125
+
126
+ ### Failure Modes
127
+
128
+ - **Revert without a previous deployment**: a revert is requested but the previous artifact is missing. **Mitigation:** verify the previous deployment is rollbackable before issuing the revert; reject the revert when no prior artifact is available.
129
+ - **Revert cascades to dependent services**: a downstream service depends on the schema or contract of the new release. **Mitigation:** before reverting, identify downstream consumers in the dependency graph; route a coordinated revert through `contracts/schemas/coordination-plan.json` when more than one service is affected.
130
+ - **Database migration not reversible**: a forward migration ran but the data has already changed. **Mitigation:** document the partial-rollback path in the revert plan; require human sign-off when the revert is unsafe.
131
+ - **Cache stale after revert**: a CDN or browser cache still serves the new release. **Mitigation:** require a full purge of the affected route pattern; verify the cache miss with curl after revert.
132
+ - **Revert skipped because of feature flag**: a flag is intended to gate a release, but a separate code path bypasses it. **Mitigation:** verify the flag is checked in every code path that touches the gated feature; never trust the flag alone.
133
+
134
+ ### Output Contracts
135
+
136
+ When this workflow produces a structured handoff, emit:
137
+
138
+ - **`contracts/schemas/deployment-plan.json`** — For the revert; capture the target revision, the rollback steps, the cache purge, and the validation run.
139
+ - **`contracts/schemas/incident-report.json`** — When the revert is triggered by an incident; capture the symptom, the failed artifact, the revert rationale, and the follow-up postmortem reference.
140
+ - **`contracts/schemas/coordination-plan.json`** — When the revert cascades to dependent services; route the coordinated revert through the coordinator.
141
+
142
+ ### Security Guardrails (OWASP ASI)
143
+
144
+ - **ASI03 Identity & Privilege Abuse**: revert credentials must be scoped to the role that owns the deploy; reject reverts requested by a role that does not hold `run_deployment` in `action-boundaries.yaml`.
145
+ - **ASI05 RCE Guard**: never construct revert commands or cache-purge scripts from external content without strict schema validation.
146
+ - **ASI07 Inter-Agent Communication**: the revert is consumed by SRE, release, and downstream roles; emit structured contracts so each role can validate the cascade.
147
+ - **ASI09 Human-Agent Trust Exploitation**: do not present the revert as "successful" without end-to-end verification on the previous revision; surface the actual `validation_run` evidence.