proagents 1.0.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 (444) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +170 -0
  3. package/bin/proagents.js +90 -0
  4. package/lib/commands/feature.js +125 -0
  5. package/lib/commands/fix.js +60 -0
  6. package/lib/commands/help.js +76 -0
  7. package/lib/commands/init.js +64 -0
  8. package/lib/commands/status.js +91 -0
  9. package/lib/index.js +28 -0
  10. package/package.json +52 -0
  11. package/proagents/.learning/global/common-patterns.json +77 -0
  12. package/proagents/.learning/global/user-preferences.json +76 -0
  13. package/proagents/.learning/projects/example-project/corrections.json +99 -0
  14. package/proagents/.learning/projects/example-project/feedback.json +109 -0
  15. package/proagents/.learning/projects/example-project/metrics.json +101 -0
  16. package/proagents/.learning/projects/example-project/patterns.json +102 -0
  17. package/proagents/.learning/schemas/README.md +48 -0
  18. package/proagents/.learning/schemas/corrections-schema.json +100 -0
  19. package/proagents/.learning/schemas/feedback-schema.json +144 -0
  20. package/proagents/.learning/schemas/metrics-schema.json +96 -0
  21. package/proagents/.learning/schemas/patterns-schema.json +82 -0
  22. package/proagents/.learning/schemas/project-patterns-schema.json +125 -0
  23. package/proagents/.learning/schemas/user-preferences-schema.json +136 -0
  24. package/proagents/GETTING-STARTED-STORY.md +708 -0
  25. package/proagents/README.md +99 -0
  26. package/proagents/WORKFLOW.md +1234 -0
  27. package/proagents/active-features/.gitkeep +0 -0
  28. package/proagents/active-features/README.md +176 -0
  29. package/proagents/active-features/_index.json +74 -0
  30. package/proagents/active-features/feature-user-auth/dependencies.json +81 -0
  31. package/proagents/active-features/feature-user-auth/files-modified.json +126 -0
  32. package/proagents/active-features/feature-user-auth/status.json +122 -0
  33. package/proagents/active-features/schemas/dependencies-schema.json +119 -0
  34. package/proagents/active-features/schemas/feature-schema.json +132 -0
  35. package/proagents/active-features/schemas/files-schema.json +100 -0
  36. package/proagents/active-features/schemas/index-schema.json +95 -0
  37. package/proagents/adr/README.md +302 -0
  38. package/proagents/adr/examples/api-versioning.md +297 -0
  39. package/proagents/adr/examples/database-choice.md +264 -0
  40. package/proagents/adr/template.md +273 -0
  41. package/proagents/ai-models/README.md +141 -0
  42. package/proagents/ai-models/cost-management.md +362 -0
  43. package/proagents/ai-models/fallbacks.md +342 -0
  44. package/proagents/ai-models/model-config.md +318 -0
  45. package/proagents/ai-models/task-routing.md +503 -0
  46. package/proagents/ai-training/README.md +155 -0
  47. package/proagents/ai-training/continuous-learning.md +413 -0
  48. package/proagents/ai-training/domain-knowledge.md +378 -0
  49. package/proagents/ai-training/pattern-learning.md +455 -0
  50. package/proagents/ai-training/training-data.md +337 -0
  51. package/proagents/ai-training/user-preferences.md +346 -0
  52. package/proagents/api-versioning/README.md +257 -0
  53. package/proagents/api-versioning/changelog-template.md +225 -0
  54. package/proagents/api-versioning/deprecation-workflow.md +470 -0
  55. package/proagents/api-versioning/versioning-strategy.md +291 -0
  56. package/proagents/approval-workflows/README.md +146 -0
  57. package/proagents/approval-workflows/approval-config.md +332 -0
  58. package/proagents/approval-workflows/approval-stages.md +503 -0
  59. package/proagents/approval-workflows/emergency-bypass.md +351 -0
  60. package/proagents/approval-workflows/examples.md +859 -0
  61. package/proagents/approval-workflows/notifications.md +320 -0
  62. package/proagents/automation/README.md +38 -0
  63. package/proagents/automation/ai-behavior-rules.md +339 -0
  64. package/proagents/automation/ai-prompt-injection.md +331 -0
  65. package/proagents/automation/auto-decisions.md +535 -0
  66. package/proagents/automation/decision-defaults.yaml +317 -0
  67. package/proagents/cache/README.md +110 -0
  68. package/proagents/cache/analysis-metadata.json +76 -0
  69. package/proagents/cache/conventions.json +125 -0
  70. package/proagents/cache/dependencies.json +85 -0
  71. package/proagents/cache/features.json +115 -0
  72. package/proagents/cache/patterns.json +105 -0
  73. package/proagents/cache/schemas/conventions-schema.json +138 -0
  74. package/proagents/cache/schemas/dependencies-schema.json +95 -0
  75. package/proagents/cache/schemas/features-schema.json +104 -0
  76. package/proagents/cache/schemas/metadata-schema.json +83 -0
  77. package/proagents/cache/schemas/patterns-schema.json +136 -0
  78. package/proagents/cache/schemas/structure-schema.json +72 -0
  79. package/proagents/cache/structure.json +109 -0
  80. package/proagents/changelog/2024/01/2024-01-10-api-url-config.md +41 -0
  81. package/proagents/changelog/2024/01/2024-01-12-login-bug-fix.md +69 -0
  82. package/proagents/changelog/2024/01/2024-01-15-user-auth-feature.md +99 -0
  83. package/proagents/changelog/CHANGELOG.md +82 -0
  84. package/proagents/changelog/README.md +327 -0
  85. package/proagents/changelog/entry-template.md +283 -0
  86. package/proagents/checklists/README.md +261 -0
  87. package/proagents/checklists/code-quality.md +137 -0
  88. package/proagents/checklists/code-review.md +148 -0
  89. package/proagents/checklists/pr-checklist.md +78 -0
  90. package/proagents/checklists/pre-deployment.md +132 -0
  91. package/proagents/checklists/pre-implementation.md +80 -0
  92. package/proagents/checklists/testing.md +120 -0
  93. package/proagents/cicd/README.md +338 -0
  94. package/proagents/cicd/azure-devops.md +267 -0
  95. package/proagents/cicd/github-actions.md +375 -0
  96. package/proagents/cicd/gitlab-ci.md +278 -0
  97. package/proagents/cicd/jenkins.md +317 -0
  98. package/proagents/cli/README.md +392 -0
  99. package/proagents/cli/commands-reference.md +893 -0
  100. package/proagents/cli/ide-integration.md +584 -0
  101. package/proagents/cli/shortcuts.md +394 -0
  102. package/proagents/cli/slash-commands.md +507 -0
  103. package/proagents/collaboration/README.md +143 -0
  104. package/proagents/collaboration/roles.md +248 -0
  105. package/proagents/collaboration/sessions.md +390 -0
  106. package/proagents/collaboration/sync.md +358 -0
  107. package/proagents/compliance/README.md +206 -0
  108. package/proagents/compliance/access-control.md +310 -0
  109. package/proagents/compliance/audit-logging.md +444 -0
  110. package/proagents/compliance/compliance-frameworks.md +429 -0
  111. package/proagents/compliance/reports.md +491 -0
  112. package/proagents/compliance/retention-policies.md +454 -0
  113. package/proagents/config/README.md +181 -0
  114. package/proagents/config/integrations/README.md +68 -0
  115. package/proagents/config/integrations/github.yaml +211 -0
  116. package/proagents/config/integrations/jira.yaml +144 -0
  117. package/proagents/config/integrations/linear.yaml +157 -0
  118. package/proagents/config/integrations/notion.yaml +203 -0
  119. package/proagents/config/integrations/slack.yaml +230 -0
  120. package/proagents/config/rules/README.md +73 -0
  121. package/proagents/config/rules/custom-rules.template.yaml +188 -0
  122. package/proagents/config/rules/validation-rules.template.yaml +177 -0
  123. package/proagents/config/standards/README.md +58 -0
  124. package/proagents/config/standards/architecture-rules.template.md +124 -0
  125. package/proagents/config/standards/coding-standards.template.md +107 -0
  126. package/proagents/config/standards/naming-conventions.template.md +114 -0
  127. package/proagents/config/standards/testing-standards.template.md +213 -0
  128. package/proagents/config/templates/README.md +74 -0
  129. package/proagents/config/templates/api-route.template.ts +142 -0
  130. package/proagents/config/templates/component.template.tsx +55 -0
  131. package/proagents/config/templates/hook.template.ts +93 -0
  132. package/proagents/config/templates/test.template.ts +171 -0
  133. package/proagents/config-versioning/README.md +120 -0
  134. package/proagents/config-versioning/changelog.md +300 -0
  135. package/proagents/config-versioning/rollback.md +283 -0
  136. package/proagents/config-versioning/versioning.md +330 -0
  137. package/proagents/contract-testing/README.md +223 -0
  138. package/proagents/contract-testing/contract-testing.md +614 -0
  139. package/proagents/contract-testing/pact-integration.md +507 -0
  140. package/proagents/contract-testing/schema-validation.md +565 -0
  141. package/proagents/cost/README.md +48 -0
  142. package/proagents/cost/cost-template.md +283 -0
  143. package/proagents/cost/estimation-framework.md +287 -0
  144. package/proagents/database/README.md +72 -0
  145. package/proagents/database/examples/001-create-users.sql +129 -0
  146. package/proagents/database/examples/002-add-preferences.sql +94 -0
  147. package/proagents/database/examples/003-add-index.sql +105 -0
  148. package/proagents/database/examples/004-rename-column.sql +122 -0
  149. package/proagents/database/examples/005-add-foreign-key.sql +142 -0
  150. package/proagents/database/examples/006-data-migration.sql +196 -0
  151. package/proagents/database/examples/007-drop-column.sql +163 -0
  152. package/proagents/database/examples/README.md +89 -0
  153. package/proagents/database/migration-workflow.md +478 -0
  154. package/proagents/database/rollback-scripts.md +487 -0
  155. package/proagents/database/safety-checks.md +447 -0
  156. package/proagents/dependency-management/README.md +140 -0
  157. package/proagents/dependency-management/automation.md +363 -0
  158. package/proagents/dependency-management/compatibility.md +319 -0
  159. package/proagents/dependency-management/security-scanning.md +413 -0
  160. package/proagents/dependency-management/update-policies.md +374 -0
  161. package/proagents/disaster-recovery/README.md +247 -0
  162. package/proagents/disaster-recovery/automation.md +366 -0
  163. package/proagents/disaster-recovery/backup-recovery.md +571 -0
  164. package/proagents/disaster-recovery/incident-response.md +565 -0
  165. package/proagents/disaster-recovery/rollback-procedures.md +499 -0
  166. package/proagents/disaster-recovery/runbooks.md +603 -0
  167. package/proagents/disaster-recovery/scenarios.md +892 -0
  168. package/proagents/disaster-recovery/testing.md +438 -0
  169. package/proagents/environments/README.md +244 -0
  170. package/proagents/environments/configuration.md +437 -0
  171. package/proagents/environments/promotion.md +434 -0
  172. package/proagents/environments/setup.md +420 -0
  173. package/proagents/examples/README.md +55 -0
  174. package/proagents/examples/backend-nodejs/README.md +188 -0
  175. package/proagents/examples/backend-nodejs/complete-conversation.md +601 -0
  176. package/proagents/examples/backend-nodejs/proagents.config.yaml +415 -0
  177. package/proagents/examples/backend-nodejs/workflow-example.md +909 -0
  178. package/proagents/examples/fullstack-nextjs/README.md +155 -0
  179. package/proagents/examples/fullstack-nextjs/complete-conversation.md +604 -0
  180. package/proagents/examples/fullstack-nextjs/proagents.config.yaml +287 -0
  181. package/proagents/examples/fullstack-nextjs/workflow-example.md +553 -0
  182. package/proagents/examples/mobile-react-native/README.md +171 -0
  183. package/proagents/examples/mobile-react-native/complete-conversation.md +825 -0
  184. package/proagents/examples/mobile-react-native/proagents.config.yaml +330 -0
  185. package/proagents/examples/mobile-react-native/workflow-example.md +723 -0
  186. package/proagents/examples/web-frontend-react/README.md +125 -0
  187. package/proagents/examples/web-frontend-react/complete-conversation.md +556 -0
  188. package/proagents/examples/web-frontend-react/proagents.config.yaml +183 -0
  189. package/proagents/examples/web-frontend-react/workflow-example.md +603 -0
  190. package/proagents/existing-projects/README.md +65 -0
  191. package/proagents/existing-projects/challenges.md +861 -0
  192. package/proagents/existing-projects/coexistence-mode.md +483 -0
  193. package/proagents/existing-projects/compatibility-assessment.md +541 -0
  194. package/proagents/existing-projects/gradual-adoption.md +515 -0
  195. package/proagents/existing-projects/migration-strategies.md +788 -0
  196. package/proagents/existing-projects/pattern-reconciliation.md +489 -0
  197. package/proagents/existing-projects/team-onboarding.md +617 -0
  198. package/proagents/existing-projects/technical-debt-handling.md +644 -0
  199. package/proagents/feature-flags/README.md +263 -0
  200. package/proagents/feature-flags/ab-testing.md +413 -0
  201. package/proagents/feature-flags/configuration.md +420 -0
  202. package/proagents/feature-flags/kill-switches.md +444 -0
  203. package/proagents/feature-flags/rollout-strategies.md +392 -0
  204. package/proagents/getting-started/README.md +60 -0
  205. package/proagents/getting-started/ai-training-setup.md +380 -0
  206. package/proagents/getting-started/ide-setup.md +195 -0
  207. package/proagents/getting-started/mcp-setup.md +239 -0
  208. package/proagents/getting-started/pm-integration.md +336 -0
  209. package/proagents/getting-started/prompt-engineering.md +478 -0
  210. package/proagents/getting-started/team-onboarding.md +236 -0
  211. package/proagents/git/README.md +68 -0
  212. package/proagents/git/branch-strategy.md +164 -0
  213. package/proagents/git/commit-conventions.md +241 -0
  214. package/proagents/git/pr-workflow.md +286 -0
  215. package/proagents/git/rollback-procedures.md +416 -0
  216. package/proagents/i18n/README.md +133 -0
  217. package/proagents/i18n/extraction.md +433 -0
  218. package/proagents/i18n/tms-integration.md +332 -0
  219. package/proagents/i18n/translation-workflow.md +413 -0
  220. package/proagents/i18n/validation.md +355 -0
  221. package/proagents/ide-integration/README.md +124 -0
  222. package/proagents/ide-integration/cline-config.md +429 -0
  223. package/proagents/ide-integration/continue-config.md +380 -0
  224. package/proagents/ide-integration/cursor-rules.md +280 -0
  225. package/proagents/ide-integration/github-copilot.md +384 -0
  226. package/proagents/ide-integration/windsurf-rules.md +314 -0
  227. package/proagents/integrations/README.md +97 -0
  228. package/proagents/integrations/pm/README.md +344 -0
  229. package/proagents/learning/README.md +136 -0
  230. package/proagents/learning/adaptation.md +305 -0
  231. package/proagents/learning/data-collection.md +283 -0
  232. package/proagents/learning/implementation-guide.md +865 -0
  233. package/proagents/learning/reports.md +306 -0
  234. package/proagents/logging/README.md +276 -0
  235. package/proagents/logging/aggregation.md +475 -0
  236. package/proagents/logging/log-levels.md +376 -0
  237. package/proagents/logging/sensitive-data.md +423 -0
  238. package/proagents/logging/structured-logging.md +406 -0
  239. package/proagents/mcp/README.md +133 -0
  240. package/proagents/mcp/context-providers.md +442 -0
  241. package/proagents/mcp/server-config.md +306 -0
  242. package/proagents/mcp/tools-definition.md +513 -0
  243. package/proagents/metrics/README.md +174 -0
  244. package/proagents/metrics/code-quality-kpis.md +461 -0
  245. package/proagents/metrics/deployment-metrics.md +517 -0
  246. package/proagents/metrics/developer-productivity.md +368 -0
  247. package/proagents/metrics/learning-effectiveness.md +478 -0
  248. package/proagents/migrations/README.md +77 -0
  249. package/proagents/migrations/from-claude-projects.md +312 -0
  250. package/proagents/migrations/from-cursor-rules.md +345 -0
  251. package/proagents/migrations/from-custom-workflows.md +410 -0
  252. package/proagents/monitoring/README.md +308 -0
  253. package/proagents/monitoring/alerting.md +449 -0
  254. package/proagents/monitoring/dashboards.md +454 -0
  255. package/proagents/monitoring/health-checks.md +436 -0
  256. package/proagents/monitoring/metrics.md +434 -0
  257. package/proagents/multi-project/README.md +170 -0
  258. package/proagents/multi-project/coordinated-deploy.md +510 -0
  259. package/proagents/multi-project/cross-project-deps.md +395 -0
  260. package/proagents/multi-project/unified-changelog.md +477 -0
  261. package/proagents/multi-project/walkthroughs/monorepo-setup.md +787 -0
  262. package/proagents/multi-project/workspace-config.md +408 -0
  263. package/proagents/notifications/README.md +151 -0
  264. package/proagents/notifications/channels.md +457 -0
  265. package/proagents/notifications/preferences.md +415 -0
  266. package/proagents/notifications/routing.md +449 -0
  267. package/proagents/notifications/scheduling.md +425 -0
  268. package/proagents/notifications/templates.md +446 -0
  269. package/proagents/offline-mode/README.md +145 -0
  270. package/proagents/offline-mode/caching.md +344 -0
  271. package/proagents/offline-mode/offline-operations.md +312 -0
  272. package/proagents/offline-mode/queue-specifications.md +679 -0
  273. package/proagents/offline-mode/sync.md +475 -0
  274. package/proagents/parallel-features/README.md +85 -0
  275. package/proagents/parallel-features/conflict-detection.md +226 -0
  276. package/proagents/parallel-features/dependency-management.md +392 -0
  277. package/proagents/parallel-features/merge-coordination.md +506 -0
  278. package/proagents/parallel-features/tracking-system.md +416 -0
  279. package/proagents/patterns/README.md +305 -0
  280. package/proagents/patterns/api-errors.md +453 -0
  281. package/proagents/patterns/async-errors.md +521 -0
  282. package/proagents/patterns/error-types.md +437 -0
  283. package/proagents/patterns/ui-errors.md +595 -0
  284. package/proagents/performance/README.md +59 -0
  285. package/proagents/performance/bundle-analysis.md +375 -0
  286. package/proagents/performance/load-testing.md +563 -0
  287. package/proagents/performance/runtime-metrics.md +489 -0
  288. package/proagents/performance/web-vitals.md +425 -0
  289. package/proagents/plugins/README.md +139 -0
  290. package/proagents/plugins/creating-plugins.md +504 -0
  291. package/proagents/plugins/plugin-api.md +467 -0
  292. package/proagents/plugins/plugin-registry.md +276 -0
  293. package/proagents/pm-integration/README.md +151 -0
  294. package/proagents/pm-integration/asana.md +346 -0
  295. package/proagents/pm-integration/github-issues.md +308 -0
  296. package/proagents/pm-integration/gitlab-issues.md +482 -0
  297. package/proagents/pm-integration/jira.md +364 -0
  298. package/proagents/pm-integration/linear.md +409 -0
  299. package/proagents/pm-integration/notion.md +275 -0
  300. package/proagents/pm-integration/sync-config.md +533 -0
  301. package/proagents/pm-integration/trello.md +159 -0
  302. package/proagents/proagents.config.yaml +213 -0
  303. package/proagents/prompts/00-init-wizard.md +426 -0
  304. package/proagents/prompts/00-init.md +219 -0
  305. package/proagents/prompts/01-analysis.md +244 -0
  306. package/proagents/prompts/02-requirements.md +399 -0
  307. package/proagents/prompts/03-ui-design.md +493 -0
  308. package/proagents/prompts/04-planning.md +505 -0
  309. package/proagents/prompts/05-implementation.md +518 -0
  310. package/proagents/prompts/06-testing.md +620 -0
  311. package/proagents/prompts/06.5-code-review.md +512 -0
  312. package/proagents/prompts/07-documentation.md +673 -0
  313. package/proagents/prompts/08-deployment.md +539 -0
  314. package/proagents/prompts/09-rollback.md +554 -0
  315. package/proagents/prompts/README.md +51 -0
  316. package/proagents/prompts/accessibility/README.md +146 -0
  317. package/proagents/prompts/accessibility/aria.md +276 -0
  318. package/proagents/prompts/accessibility/audit.md +233 -0
  319. package/proagents/prompts/accessibility/keyboard.md +392 -0
  320. package/proagents/prompts/accessibility/wcag.md +189 -0
  321. package/proagents/prompts/debugging/README.md +51 -0
  322. package/proagents/prompts/debugging/error-analysis.md +385 -0
  323. package/proagents/prompts/debugging/performance-debug.md +381 -0
  324. package/proagents/prompts/debugging/systematic.md +270 -0
  325. package/proagents/prompts/performance/README.md +47 -0
  326. package/proagents/prompts/performance/analyze.md +265 -0
  327. package/proagents/prompts/performance/optimize.md +347 -0
  328. package/proagents/prompts/refactoring/README.md +51 -0
  329. package/proagents/prompts/refactoring/architecture.md +531 -0
  330. package/proagents/prompts/refactoring/code-smells.md +174 -0
  331. package/proagents/prompts/refactoring/patterns.md +516 -0
  332. package/proagents/prompts/security-audit/README.md +197 -0
  333. package/proagents/prompts/security-audit/code-review.md +260 -0
  334. package/proagents/prompts/security-audit/vulnerability-scan.md +288 -0
  335. package/proagents/reporting/README.md +158 -0
  336. package/proagents/reporting/dashboards.md +366 -0
  337. package/proagents/reporting/exports.md +524 -0
  338. package/proagents/reporting/quality-metrics.md +385 -0
  339. package/proagents/reporting/templates/README.md +56 -0
  340. package/proagents/reporting/templates/dashboard-config.json +187 -0
  341. package/proagents/reporting/templates/metrics-queries.md +427 -0
  342. package/proagents/reporting/templates/react-dashboard.tsx +544 -0
  343. package/proagents/reporting/templates/widgets.md +451 -0
  344. package/proagents/reporting/velocity-metrics.md +340 -0
  345. package/proagents/reverse-engineering/README.md +151 -0
  346. package/proagents/reverse-engineering/architecture-extraction.md +325 -0
  347. package/proagents/reverse-engineering/code-analysis.md +377 -0
  348. package/proagents/reverse-engineering/dependency-mapping.md +567 -0
  349. package/proagents/reverse-engineering/diagram-generation.md +586 -0
  350. package/proagents/reverse-engineering/documentation-generation.md +468 -0
  351. package/proagents/reverse-engineering/pattern-detection.md +569 -0
  352. package/proagents/reverse-engineering/quality-assessment.md +733 -0
  353. package/proagents/rules/README.md +179 -0
  354. package/proagents/rules/custom-rules-template.yaml +286 -0
  355. package/proagents/rules/custom-rules.md +754 -0
  356. package/proagents/rules/validation-rules-template.yaml +517 -0
  357. package/proagents/runbooks/README.md +219 -0
  358. package/proagents/runbooks/dependency-vulnerability.md +505 -0
  359. package/proagents/runbooks/incident-response.md +451 -0
  360. package/proagents/runbooks/performance-degradation.md +584 -0
  361. package/proagents/runbooks/production-debugging.md +489 -0
  362. package/proagents/scaffolding/README.md +64 -0
  363. package/proagents/scaffolding/nextjs/README.md +578 -0
  364. package/proagents/scaffolding/nextjs/templates/api-route.ts.template +185 -0
  365. package/proagents/scaffolding/nextjs/templates/page.tsx.template +109 -0
  366. package/proagents/scaffolding/nextjs/templates/server-action.ts.template +204 -0
  367. package/proagents/scaffolding/nodejs/README.md +558 -0
  368. package/proagents/scaffolding/nodejs/templates/controller.ts.template +167 -0
  369. package/proagents/scaffolding/nodejs/templates/repository.ts.template +155 -0
  370. package/proagents/scaffolding/nodejs/templates/service.ts.template +207 -0
  371. package/proagents/scaffolding/project-types.md +401 -0
  372. package/proagents/scaffolding/react/README.md +399 -0
  373. package/proagents/scaffolding/react/templates/component.tsx.template +88 -0
  374. package/proagents/scaffolding/react/templates/hook.ts.template +127 -0
  375. package/proagents/scaffolding/react/templates/service.ts.template +155 -0
  376. package/proagents/scaffolding/react/templates/test.tsx.template +149 -0
  377. package/proagents/scaffolding/react-native/README.md +476 -0
  378. package/proagents/scaffolding/react-native/templates/hook.ts.template +226 -0
  379. package/proagents/scaffolding/react-native/templates/screen.tsx.template +247 -0
  380. package/proagents/secrets/README.md +278 -0
  381. package/proagents/secrets/access-control.md +443 -0
  382. package/proagents/secrets/rotation.md +403 -0
  383. package/proagents/secrets/scanning.md +487 -0
  384. package/proagents/secrets/storage.md +394 -0
  385. package/proagents/security/README.md +71 -0
  386. package/proagents/security/owasp-checklist.md +390 -0
  387. package/proagents/security/sast-guide.md +473 -0
  388. package/proagents/security/security-report-template.md +343 -0
  389. package/proagents/security/vulnerability-scanning.md +329 -0
  390. package/proagents/slash-commands.json +161 -0
  391. package/proagents/standards/README.md +120 -0
  392. package/proagents/standards/architecture-patterns.md +728 -0
  393. package/proagents/standards/architecture-rules-template.md +489 -0
  394. package/proagents/standards/coding-standards-template.md +489 -0
  395. package/proagents/standards/examples/README.md +61 -0
  396. package/proagents/standards/examples/nodejs-api.md +560 -0
  397. package/proagents/standards/examples/react-nextjs.md +428 -0
  398. package/proagents/standards/naming-conventions-template.md +526 -0
  399. package/proagents/standards/override-system.md +717 -0
  400. package/proagents/standards/testing-standards-template.md +220 -0
  401. package/proagents/team/README.md +256 -0
  402. package/proagents/team/code-ownership.md +306 -0
  403. package/proagents/team/communication-templates.md +441 -0
  404. package/proagents/team/handoff-protocol.md +380 -0
  405. package/proagents/team/ide-setup/README.md +103 -0
  406. package/proagents/team/ide-setup/cursor.md +276 -0
  407. package/proagents/team/ide-setup/jetbrains.md +330 -0
  408. package/proagents/team/ide-setup/neovim.md +640 -0
  409. package/proagents/team/ide-setup/vscode.md +348 -0
  410. package/proagents/team/onboarding.md +278 -0
  411. package/proagents/templates/README.md +57 -0
  412. package/proagents/templates/code-review-report.md +255 -0
  413. package/proagents/templates/codebase-analysis-report.md +315 -0
  414. package/proagents/templates/deployment-checklist.md +277 -0
  415. package/proagents/templates/feature-requirements.md +142 -0
  416. package/proagents/templates/feature-status.md +231 -0
  417. package/proagents/templates/implementation-plan.md +373 -0
  418. package/proagents/templates/rollback-plan.md +331 -0
  419. package/proagents/templates/test-plan.md +336 -0
  420. package/proagents/templates/ui-specification.md +431 -0
  421. package/proagents/testing-standards/README.md +229 -0
  422. package/proagents/testing-standards/coverage-requirements.md +198 -0
  423. package/proagents/testing-standards/mocking-guidelines.md +478 -0
  424. package/proagents/testing-standards/test-naming.md +485 -0
  425. package/proagents/testing-standards/test-patterns.md +488 -0
  426. package/proagents/troubleshooting/README.md +730 -0
  427. package/proagents/troubleshooting/ai-issues.md +601 -0
  428. package/proagents/troubleshooting/workflow-issues.md +571 -0
  429. package/proagents/ui-integration/README.md +77 -0
  430. package/proagents/ui-integration/figma-guide.md +217 -0
  431. package/proagents/ui-integration/manual-export-guide.md +358 -0
  432. package/proagents/ui-integration/sketch-interpretation.md +471 -0
  433. package/proagents/webhooks/README.md +126 -0
  434. package/proagents/webhooks/endpoints.md +298 -0
  435. package/proagents/webhooks/events.md +316 -0
  436. package/proagents/webhooks/payloads.md +325 -0
  437. package/proagents/webhooks/reliability.md +363 -0
  438. package/proagents/webhooks/security.md +380 -0
  439. package/proagents/workflow-modes/README.md +136 -0
  440. package/proagents/workflow-modes/deferred-tracking.md +405 -0
  441. package/proagents/workflow-modes/entry-modes.md +397 -0
  442. package/proagents/workflow-modes/guardrails.md +405 -0
  443. package/proagents/workflow-modes/mode-detection.md +358 -0
  444. package/proagents/workflow-modes/mode-switching.md +372 -0
@@ -0,0 +1,892 @@
1
+ # Disaster Recovery Scenarios
2
+
3
+ Detailed walkthrough guides for handling common disaster scenarios.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This document provides step-by-step procedures for recovering from various disaster scenarios. Each scenario includes detection methods, response procedures, and recovery steps.
10
+
11
+ ---
12
+
13
+ ## Scenario 1: Failed Deployment Rollback
14
+
15
+ ### Situation
16
+
17
+ A new deployment causes critical errors in production.
18
+
19
+ ### Indicators
20
+
21
+ - Error rate increases > 5%
22
+ - Response time > 3x baseline
23
+ - Health checks failing
24
+ - User complaints flooding in
25
+
26
+ ### Step-by-Step Recovery
27
+
28
+ **1. Detection (Automated)**
29
+
30
+ ```
31
+ ┌─────────────────────────────────────────────────────────────┐
32
+ │ ALERT: Production Error Rate Spike │
33
+ ├─────────────────────────────────────────────────────────────┤
34
+ │ Time: 2024-01-15 14:23:45 UTC │
35
+ │ Environment: production │
36
+ │ Metric: error_rate │
37
+ │ Current: 8.5% │
38
+ │ Threshold: 5% │
39
+ │ Recent Deploy: v2.3.1 (deployed 3 minutes ago) │
40
+ │ │
41
+ │ Auto-rollback: TRIGGERED │
42
+ └─────────────────────────────────────────────────────────────┘
43
+ ```
44
+
45
+ **2. Automatic Response**
46
+
47
+ If auto-rollback is enabled:
48
+
49
+ ```bash
50
+ # ProAgents automatically executes:
51
+ proagents rollback production --to-previous
52
+
53
+ # Actions taken:
54
+ # 1. Current deployment paused
55
+ # 2. Previous version (v2.3.0) deployed
56
+ # 3. Health checks verified
57
+ # 4. Traffic switched
58
+ ```
59
+
60
+ **3. Manual Response (if auto-rollback disabled)**
61
+
62
+ ```bash
63
+ # Step 1: Assess the situation
64
+ proagents status production
65
+
66
+ # Step 2: Check recent deployments
67
+ proagents deploy history --limit 5
68
+
69
+ # Step 3: Initiate rollback
70
+ proagents rollback production --to v2.3.0
71
+
72
+ # Step 4: Verify recovery
73
+ proagents health production
74
+ ```
75
+
76
+ **4. Post-Rollback Verification**
77
+
78
+ ```bash
79
+ # Check health status
80
+ proagents health production --verbose
81
+
82
+ # Expected output:
83
+ # ✅ API responding (latency: 45ms)
84
+ # ✅ Database connections healthy
85
+ # ✅ Error rate: 0.1% (normal)
86
+ # ✅ All health checks passing
87
+
88
+ # Verify user-facing functionality
89
+ proagents test smoke --env production
90
+ ```
91
+
92
+ **5. Communication**
93
+
94
+ ```markdown
95
+ ## Incident Update
96
+
97
+ **Status:** Resolved
98
+ **Time:** 2024-01-15 14:27 UTC
99
+ **Duration:** 4 minutes
100
+
101
+ ### What Happened
102
+ Deployment v2.3.1 caused elevated error rates.
103
+
104
+ ### Resolution
105
+ Automatic rollback to v2.3.0 completed successfully.
106
+
107
+ ### Next Steps
108
+ - Root cause analysis in progress
109
+ - Fix will be deployed after testing
110
+ ```
111
+
112
+ **6. Root Cause Analysis**
113
+
114
+ ```bash
115
+ # Download deployment logs
116
+ proagents logs production --since "14:20" --until "14:27" > incident-logs.txt
117
+
118
+ # Check what changed
119
+ proagents diff v2.3.0 v2.3.1
120
+
121
+ # Review error patterns
122
+ proagents analyze errors --env production --timeframe "14:20-14:27"
123
+ ```
124
+
125
+ ### Prevention Checklist
126
+
127
+ - [ ] Add failing scenario to test suite
128
+ - [ ] Improve staging environment parity
129
+ - [ ] Review deployment gate criteria
130
+ - [ ] Update monitoring thresholds if needed
131
+
132
+ ---
133
+
134
+ ## Scenario 2: Database Corruption Recovery
135
+
136
+ ### Situation
137
+
138
+ Database data becomes corrupted or inconsistent.
139
+
140
+ ### Indicators
141
+
142
+ - Data validation errors
143
+ - Referential integrity failures
144
+ - Unexpected null values
145
+ - Application errors due to bad data
146
+
147
+ ### Step-by-Step Recovery
148
+
149
+ **1. Detection**
150
+
151
+ ```
152
+ ┌─────────────────────────────────────────────────────────────┐
153
+ │ ALERT: Data Integrity Failure │
154
+ ├─────────────────────────────────────────────────────────────┤
155
+ │ Time: 2024-01-15 10:45:12 UTC │
156
+ │ Type: Referential Integrity │
157
+ │ Table: orders │
158
+ │ Issue: 847 orphaned records (no matching user_id) │
159
+ │ First occurrence: 2024-01-15 08:30:00 UTC │
160
+ └─────────────────────────────────────────────────────────────┘
161
+ ```
162
+
163
+ **2. Immediate Actions**
164
+
165
+ ```bash
166
+ # Step 1: Pause writes to affected tables (if critical)
167
+ proagents db pause-writes orders
168
+
169
+ # Step 2: Assess the scope
170
+ proagents db integrity-check orders
171
+
172
+ # Output:
173
+ # Checking table: orders
174
+ # ├── Row count: 45,832
175
+ # ├── Orphaned records: 847
176
+ # ├── First bad record: 2024-01-15 08:30:00
177
+ # └── Affected time range: 2.25 hours
178
+ ```
179
+
180
+ **3. Identify the Cause**
181
+
182
+ ```bash
183
+ # Check recent schema changes
184
+ proagents db migration-history --limit 10
185
+
186
+ # Check application deployments during timeframe
187
+ proagents deploy history --since "2024-01-15 08:00"
188
+
189
+ # Review relevant logs
190
+ proagents logs production --filter "orders" --since "08:00"
191
+ ```
192
+
193
+ **4. Determine Recovery Strategy**
194
+
195
+ **Option A: Targeted Fix (Minimal Data Loss)**
196
+
197
+ ```bash
198
+ # If corruption is limited and fixable
199
+ proagents db fix-integrity orders --strategy=soft
200
+
201
+ # This will:
202
+ # - Soft-delete orphaned records
203
+ # - Log all changes for audit
204
+ # - Keep data for potential recovery
205
+ ```
206
+
207
+ **Option B: Point-in-Time Recovery**
208
+
209
+ ```bash
210
+ # List available backups
211
+ proagents db backups --list
212
+
213
+ # Output:
214
+ # Available backups:
215
+ # ├── 2024-01-15 08:00:00 (2.5 hours ago) ← Before corruption
216
+ # ├── 2024-01-15 06:00:00 (4.5 hours ago)
217
+ # └── 2024-01-15 00:00:00 (10.5 hours ago)
218
+
219
+ # Restore to point before corruption
220
+ proagents db restore --to "2024-01-15 08:00:00" --tables orders
221
+
222
+ # This will:
223
+ # 1. Create staging restore
224
+ # 2. Validate data integrity
225
+ # 3. Present diff of changes
226
+ # 4. Ask for confirmation
227
+ # 5. Execute restore
228
+ ```
229
+
230
+ **5. Data Reconciliation**
231
+
232
+ ```bash
233
+ # Export data created after backup point
234
+ proagents db export orders --since "2024-01-15 08:00" > recent-orders.json
235
+
236
+ # Review and filter valid records
237
+ proagents db validate recent-orders.json --rules orders-validation
238
+
239
+ # Re-import valid records
240
+ proagents db import recent-orders-valid.json --table orders
241
+ ```
242
+
243
+ **6. Verify Recovery**
244
+
245
+ ```bash
246
+ # Run integrity checks
247
+ proagents db integrity-check orders --verbose
248
+
249
+ # Run application tests
250
+ proagents test integration --filter "orders"
251
+
252
+ # Monitor for errors
253
+ proagents monitor orders --duration 30m
254
+ ```
255
+
256
+ **7. Resume Normal Operations**
257
+
258
+ ```bash
259
+ # Resume writes
260
+ proagents db resume-writes orders
261
+
262
+ # Notify team
263
+ proagents notify team "Database recovery complete. Orders table restored."
264
+ ```
265
+
266
+ ### Recovery Checklist
267
+
268
+ - [ ] Identify root cause
269
+ - [ ] Verify backup integrity before restore
270
+ - [ ] Test restore in staging first
271
+ - [ ] Document data loss (if any)
272
+ - [ ] Update backup frequency if needed
273
+ - [ ] Add integrity checks to monitoring
274
+
275
+ ---
276
+
277
+ ## Scenario 3: Security Breach Response
278
+
279
+ ### Situation
280
+
281
+ Suspected or confirmed security breach detected.
282
+
283
+ ### Indicators
284
+
285
+ - Unusual access patterns
286
+ - Failed authentication spikes
287
+ - Unauthorized data access
288
+ - Suspicious API calls
289
+ - External notification of breach
290
+
291
+ ### Step-by-Step Response
292
+
293
+ **1. Initial Detection**
294
+
295
+ ```
296
+ ┌─────────────────────────────────────────────────────────────┐
297
+ │ SECURITY ALERT: Potential Breach Detected │
298
+ ├─────────────────────────────────────────────────────────────┤
299
+ │ Severity: CRITICAL │
300
+ │ Time: 2024-01-15 03:15:22 UTC │
301
+ │ │
302
+ │ Indicators: │
303
+ │ ├── 5000+ failed login attempts from single IP │
304
+ │ ├── Successful admin login from unknown location │
305
+ │ ├── Bulk data export triggered │
306
+ │ └── API rate limits bypassed │
307
+ │ │
308
+ │ Immediate Action Required │
309
+ └─────────────────────────────────────────────────────────────┘
310
+ ```
311
+
312
+ **2. Immediate Containment**
313
+
314
+ ```bash
315
+ # CRITICAL: Execute containment immediately
316
+
317
+ # Step 1: Rotate all secrets
318
+ proagents security rotate-secrets --all --immediate
319
+
320
+ # Step 2: Invalidate all sessions
321
+ proagents security invalidate-sessions --all
322
+
323
+ # Step 3: Block suspicious IPs
324
+ proagents security block-ip 203.0.113.100
325
+
326
+ # Step 4: Enable maintenance mode (if severe)
327
+ proagents maintenance on --message "Security update in progress"
328
+
329
+ # Step 5: Disable compromised accounts
330
+ proagents users disable --user admin@company.com --reason "security-incident"
331
+ ```
332
+
333
+ **3. Assessment**
334
+
335
+ ```bash
336
+ # Gather evidence (PRESERVE FOR FORENSICS)
337
+ proagents security audit-log export --since "2024-01-14" > audit-export.json
338
+
339
+ # Identify scope of breach
340
+ proagents security analyze-breach --start "2024-01-15 03:00"
341
+
342
+ # Output:
343
+ # Breach Analysis Report
344
+ # ─────────────────────
345
+ # Entry Point: Admin account compromise
346
+ # Method: Credential stuffing (password reuse)
347
+ # Access Level: Admin
348
+ # Data Accessed:
349
+ # ├── User table: 12,453 records viewed
350
+ # ├── Orders table: 5,232 records exported
351
+ # └── API keys: 3 keys accessed
352
+ # Duration: 47 minutes
353
+ ```
354
+
355
+ **4. Eradication**
356
+
357
+ ```bash
358
+ # Patch the vulnerability
359
+ proagents security patch --cve CVE-2024-XXXX
360
+
361
+ # Remove malicious access
362
+ proagents security revoke-access --all-suspicious
363
+
364
+ # Reset affected credentials
365
+ proagents security reset-credentials --scope compromised
366
+
367
+ # Update security controls
368
+ proagents security enhance --force-mfa --password-policy strict
369
+ ```
370
+
371
+ **5. Recovery**
372
+
373
+ ```bash
374
+ # Restore from clean backup (if necessary)
375
+ proagents dr restore --from "2024-01-14 00:00" --verify-clean
376
+
377
+ # Re-enable services gradually
378
+ proagents maintenance off --gradual
379
+
380
+ # Monitor for recurring attacks
381
+ proagents security monitor --enhanced --duration 7d
382
+ ```
383
+
384
+ **6. Communication**
385
+
386
+ ```markdown
387
+ ## Security Incident Notification
388
+
389
+ **Date:** January 15, 2024
390
+ **Severity:** High
391
+ **Status:** Contained and Remediated
392
+
393
+ ### What Happened
394
+ Unauthorized access to admin account detected and contained.
395
+
396
+ ### Data Affected
397
+ User profile information (names, emails) may have been accessed.
398
+ No payment or password data was compromised.
399
+
400
+ ### Actions Taken
401
+ 1. All user sessions invalidated
402
+ 2. Compromised account disabled
403
+ 3. All secrets rotated
404
+ 4. Enhanced monitoring enabled
405
+
406
+ ### User Actions Required
407
+ - Reset your password
408
+ - Review account activity
409
+ - Enable two-factor authentication
410
+
411
+ ### Questions
412
+ Contact security@company.com
413
+ ```
414
+
415
+ **7. Post-Incident**
416
+
417
+ ```bash
418
+ # Generate incident report
419
+ proagents security incident-report generate
420
+
421
+ # Schedule post-mortem
422
+ proagents calendar create "Security Incident Post-Mortem" --invite security-team
423
+
424
+ # Update security documentation
425
+ proagents docs update security/incident-response.md
426
+ ```
427
+
428
+ ### Security Checklist
429
+
430
+ - [ ] Preserve evidence for forensics
431
+ - [ ] Contain the breach
432
+ - [ ] Identify entry point and method
433
+ - [ ] Assess data exposure
434
+ - [ ] Notify affected parties (legal requirement)
435
+ - [ ] Report to authorities if required
436
+ - [ ] Implement additional controls
437
+ - [ ] Conduct post-mortem
438
+ - [ ] Update incident response procedures
439
+
440
+ ---
441
+
442
+ ## Scenario 4: Infrastructure Failure
443
+
444
+ ### Situation
445
+
446
+ Cloud provider outage or infrastructure failure.
447
+
448
+ ### Indicators
449
+
450
+ - Multiple services unreachable
451
+ - Cloud provider status page shows issues
452
+ - All health checks failing
453
+ - Unable to SSH/access infrastructure
454
+
455
+ ### Step-by-Step Recovery
456
+
457
+ **1. Detection**
458
+
459
+ ```
460
+ ┌─────────────────────────────────────────────────────────────┐
461
+ │ ALERT: Infrastructure Failure │
462
+ ├─────────────────────────────────────────────────────────────┤
463
+ │ Time: 2024-01-15 11:30:00 UTC │
464
+ │ Region: us-east-1 │
465
+ │ Provider: AWS │
466
+ │ │
467
+ │ Affected Services: │
468
+ │ ├── EC2: Degraded │
469
+ │ ├── RDS: Unavailable │
470
+ │ ├── ElastiCache: Unavailable │
471
+ │ └── S3: Operational │
472
+ │ │
473
+ │ DR Site Status: us-west-2 - HEALTHY │
474
+ └─────────────────────────────────────────────────────────────┘
475
+ ```
476
+
477
+ **2. Immediate Actions**
478
+
479
+ ```bash
480
+ # Step 1: Verify the outage
481
+ proagents health all --verbose
482
+
483
+ # Step 2: Check provider status
484
+ proagents infra provider-status
485
+
486
+ # Step 3: Assess DR site readiness
487
+ proagents dr status us-west-2
488
+ ```
489
+
490
+ **3. Activate Failover**
491
+
492
+ ```bash
493
+ # Option A: Automatic failover (if configured)
494
+ # System automatically detects and triggers failover
495
+
496
+ # Option B: Manual failover
497
+ proagents dr failover --to us-west-2
498
+
499
+ # This will:
500
+ # 1. Verify DR site health
501
+ # 2. Promote read replica to primary
502
+ # 3. Update DNS to point to DR site
503
+ # 4. Verify all services operational
504
+ # 5. Send notification
505
+ ```
506
+
507
+ **4. DNS Failover**
508
+
509
+ ```bash
510
+ # Update DNS to point to DR region
511
+ proagents dns failover --to us-west-2
512
+
513
+ # Verify DNS propagation
514
+ proagents dns check --record api.company.com
515
+
516
+ # Expected output:
517
+ # DNS Status: api.company.com
518
+ # ├── Old IP: 54.23.xx.xx (us-east-1)
519
+ # ├── New IP: 35.87.xx.xx (us-west-2)
520
+ # ├── TTL: 60 seconds
521
+ # └── Propagation: 85% complete
522
+ ```
523
+
524
+ **5. Verify DR Site Operations**
525
+
526
+ ```bash
527
+ # Run health checks on DR site
528
+ proagents health all --env us-west-2
529
+
530
+ # Run smoke tests
531
+ proagents test smoke --env us-west-2
532
+
533
+ # Monitor traffic shift
534
+ proagents monitor traffic --compare-regions
535
+ ```
536
+
537
+ **6. Communicate to Users**
538
+
539
+ ```markdown
540
+ ## Service Status Update
541
+
542
+ **Status:** Partial Outage - Failover in Progress
543
+ **Time:** January 15, 2024 11:30 UTC
544
+
545
+ ### What's Happening
546
+ Our primary cloud region is experiencing issues. We are failing over to our backup region.
547
+
548
+ ### Current Status
549
+ - API: Operational (via backup region)
550
+ - Web App: Operational
551
+ - Mobile App: May require restart
552
+
553
+ ### Expected Resolution
554
+ Full service should be restored within 15 minutes.
555
+
556
+ ### Updates
557
+ We will post updates every 15 minutes until resolved.
558
+ ```
559
+
560
+ **7. Monitor Primary Region Recovery**
561
+
562
+ ```bash
563
+ # Watch for primary region recovery
564
+ proagents infra monitor us-east-1 --alert-on-recovery
565
+
566
+ # When recovered, plan failback
567
+ proagents dr plan-failback --from us-west-2 --to us-east-1
568
+ ```
569
+
570
+ **8. Failback to Primary**
571
+
572
+ ```bash
573
+ # Once primary region is stable
574
+ proagents dr failback --to us-east-1 --gradual
575
+
576
+ # This will:
577
+ # 1. Sync any new data from DR site
578
+ # 2. Gradually shift traffic back
579
+ # 3. Verify primary site health
580
+ # 4. Update DNS
581
+ # 5. Demote DR database back to replica
582
+ ```
583
+
584
+ ### Infrastructure Checklist
585
+
586
+ - [ ] Verify backup region health
587
+ - [ ] Execute failover procedure
588
+ - [ ] Update DNS
589
+ - [ ] Verify all services operational
590
+ - [ ] Communicate to users
591
+ - [ ] Monitor primary region recovery
592
+ - [ ] Plan and execute failback
593
+ - [ ] Document lessons learned
594
+
595
+ ---
596
+
597
+ ## Scenario 5: Accidental Data Deletion
598
+
599
+ ### Situation
600
+
601
+ Critical data accidentally deleted from production.
602
+
603
+ ### Indicators
604
+
605
+ - User reports missing data
606
+ - Application errors due to missing records
607
+ - Audit log shows delete operations
608
+ - Database record counts unexpectedly low
609
+
610
+ ### Step-by-Step Recovery
611
+
612
+ **1. Detection**
613
+
614
+ ```
615
+ User Report: "All my orders from last month are gone!"
616
+
617
+ # Verify the issue
618
+ proagents db query "SELECT COUNT(*) FROM orders WHERE created_at > '2024-01-01'"
619
+
620
+ # Result: 0 (should be ~50,000)
621
+ ```
622
+
623
+ **2. Stop the Bleeding**
624
+
625
+ ```bash
626
+ # Immediately prevent further deletes
627
+ proagents db pause-writes orders
628
+
629
+ # Or restrict to read-only
630
+ proagents db read-only orders
631
+ ```
632
+
633
+ **3. Identify What Was Deleted**
634
+
635
+ ```bash
636
+ # Check audit logs
637
+ proagents audit query --table orders --operation DELETE --since "24h"
638
+
639
+ # Output:
640
+ # Audit Log: orders table
641
+ # ─────────────────────────
642
+ # Time: 2024-01-15 09:15:23
643
+ # User: developer@company.com
644
+ # Operation: DELETE
645
+ # Query: DELETE FROM orders WHERE status = 'pending'
646
+ # Rows affected: 48,234
647
+ # Source: Admin panel
648
+ ```
649
+
650
+ **4. Identify Available Recovery Points**
651
+
652
+ ```bash
653
+ # List available backups
654
+ proagents db backups list --table orders
655
+
656
+ # Check point-in-time recovery window
657
+ proagents db pitr-status
658
+
659
+ # Output:
660
+ # Point-in-Time Recovery Status
661
+ # ─────────────────────────────
662
+ # Earliest recovery point: 2024-01-08 00:00:00
663
+ # Latest recovery point: 2024-01-15 09:15:00
664
+ # Recommended recovery point: 2024-01-15 09:14:00 (1 min before deletion)
665
+ ```
666
+
667
+ **5. Execute Recovery**
668
+
669
+ **Option A: Point-in-Time Recovery (PITR)**
670
+
671
+ ```bash
672
+ # Restore to point before deletion
673
+ proagents db restore-pitr --to "2024-01-15 09:14:00" --table orders --preview
674
+
675
+ # Preview shows:
676
+ # Records to restore: 48,234
677
+ # Time range: 2024-01-01 to 2024-01-15 09:14
678
+ # Conflicts: 0
679
+
680
+ # Execute the restore
681
+ proagents db restore-pitr --to "2024-01-15 09:14:00" --table orders --execute
682
+ ```
683
+
684
+ **Option B: Backup Restore**
685
+
686
+ ```bash
687
+ # Restore from last backup
688
+ proagents db restore --backup "2024-01-15-06-00" --table orders --merge
689
+
690
+ # Merge will:
691
+ # - Restore deleted records
692
+ # - Keep records created after backup
693
+ # - Handle conflicts (prompt for resolution)
694
+ ```
695
+
696
+ **6. Verify Recovery**
697
+
698
+ ```bash
699
+ # Check record counts
700
+ proagents db query "SELECT COUNT(*) FROM orders WHERE created_at > '2024-01-01'"
701
+
702
+ # Verify data integrity
703
+ proagents db integrity-check orders
704
+
705
+ # Run application tests
706
+ proagents test integration --filter orders
707
+ ```
708
+
709
+ **7. Resume Normal Operations**
710
+
711
+ ```bash
712
+ # Resume write operations
713
+ proagents db resume-writes orders
714
+
715
+ # Notify affected users
716
+ proagents notify users "Your data has been restored."
717
+ ```
718
+
719
+ **8. Prevent Recurrence**
720
+
721
+ ```bash
722
+ # Add safeguards
723
+ proagents db add-safeguard orders --prevent-bulk-delete --threshold 100
724
+
725
+ # Update permissions
726
+ proagents db permissions update --user developer --revoke DELETE
727
+
728
+ # Add confirmation requirement
729
+ proagents config set database.require_confirmation_for_deletes true
730
+ ```
731
+
732
+ ### Data Deletion Prevention Checklist
733
+
734
+ - [ ] Implement soft deletes
735
+ - [ ] Require confirmation for bulk deletes
736
+ - [ ] Limit delete permissions
737
+ - [ ] Enable detailed audit logging
738
+ - [ ] Test backup restoration regularly
739
+ - [ ] Document recovery procedures
740
+
741
+ ---
742
+
743
+ ## Scenario 6: Third-Party Service Outage
744
+
745
+ ### Situation
746
+
747
+ A critical third-party service (payment provider, auth service, etc.) becomes unavailable.
748
+
749
+ ### Indicators
750
+
751
+ - API calls to service failing
752
+ - Timeouts on external requests
753
+ - Provider status page shows issues
754
+ - User reports of failed operations
755
+
756
+ ### Step-by-Step Response
757
+
758
+ **1. Detection**
759
+
760
+ ```
761
+ ┌─────────────────────────────────────────────────────────────┐
762
+ │ ALERT: Third-Party Service Failure │
763
+ ├─────────────────────────────────────────────────────────────┤
764
+ │ Service: Stripe Payment Gateway │
765
+ │ Status: Unavailable │
766
+ │ Error: Connection timeout after 30s │
767
+ │ First failure: 2024-01-15 15:00:00 UTC │
768
+ │ Failure rate: 100% │
769
+ └─────────────────────────────────────────────────────────────┘
770
+ ```
771
+
772
+ **2. Verify the Outage**
773
+
774
+ ```bash
775
+ # Check service status
776
+ proagents integrations status stripe
777
+
778
+ # Check provider status page
779
+ proagents integrations provider-status stripe
780
+
781
+ # Verify it's not our issue
782
+ proagents health check --external-deps
783
+ ```
784
+
785
+ **3. Activate Fallback (if available)**
786
+
787
+ ```bash
788
+ # Switch to backup provider
789
+ proagents integrations failover payments --to braintree
790
+
791
+ # Or enable degraded mode
792
+ proagents mode degraded --feature payments
793
+
794
+ # Queue operations for later
795
+ proagents queue enable payment-operations
796
+ ```
797
+
798
+ **4. User Communication**
799
+
800
+ ```bash
801
+ # Display maintenance message
802
+ proagents ui banner set "Payment processing temporarily unavailable. Orders will be processed shortly."
803
+
804
+ # Send notification
805
+ proagents notify affected-users --template payment-delay
806
+ ```
807
+
808
+ **5. Monitor for Recovery**
809
+
810
+ ```bash
811
+ # Watch for service recovery
812
+ proagents integrations monitor stripe --alert-on-recovery
813
+
814
+ # Track queued operations
815
+ proagents queue status payment-operations
816
+ ```
817
+
818
+ **6. Resume Normal Operations**
819
+
820
+ ```bash
821
+ # When service recovers
822
+ proagents integrations restore payments --from stripe
823
+
824
+ # Process queued operations
825
+ proagents queue process payment-operations
826
+
827
+ # Remove user notification
828
+ proagents ui banner clear
829
+ ```
830
+
831
+ ### Third-Party Resilience Checklist
832
+
833
+ - [ ] Implement circuit breakers
834
+ - [ ] Have backup providers when possible
835
+ - [ ] Queue operations for offline processing
836
+ - [ ] Communicate proactively to users
837
+ - [ ] Monitor provider status pages
838
+ - [ ] Document fallback procedures
839
+
840
+ ---
841
+
842
+ ## Quick Reference: Recovery Decision Tree
843
+
844
+ ```
845
+ Issue Detected
846
+
847
+ ├─→ Deployment Related?
848
+ │ │
849
+ │ └─→ Rollback to previous version
850
+
851
+ ├─→ Data Corruption?
852
+ │ │
853
+ │ ├─→ Limited scope → Targeted fix
854
+ │ └─→ Large scope → Point-in-time restore
855
+
856
+ ├─→ Security Incident?
857
+ │ │
858
+ │ └─→ Contain → Assess → Eradicate → Recover
859
+
860
+ ├─→ Infrastructure Failure?
861
+ │ │
862
+ │ └─→ Failover to DR site
863
+
864
+ ├─→ Data Deletion?
865
+ │ │
866
+ │ └─→ Restore from backup/PITR
867
+
868
+ └─→ Third-Party Outage?
869
+
870
+ └─→ Enable fallback/degraded mode
871
+ ```
872
+
873
+ ---
874
+
875
+ ## Recovery Time Summary
876
+
877
+ | Scenario | Target Time | Automated | Manual |
878
+ |----------|-------------|-----------|--------|
879
+ | Failed Deployment | < 5 min | Yes | Yes |
880
+ | Database Corruption | < 30 min | Partial | Yes |
881
+ | Security Breach | < 2 hours | Partial | Yes |
882
+ | Infrastructure Failure | < 15 min | Yes | Yes |
883
+ | Data Deletion | < 30 min | Partial | Yes |
884
+ | Third-Party Outage | < 5 min | Yes | Yes |
885
+
886
+ ---
887
+
888
+ ## Next Steps
889
+
890
+ - [Automation Configuration](./automation.md)
891
+ - [Testing Procedures](./testing.md)
892
+ - [Incident Response Runbook](./incident-response.md)