specweave 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/INSTALL.md +848 -0
  2. package/LICENSE +21 -0
  3. package/README.md +675 -0
  4. package/SPECWEAVE.md +665 -0
  5. package/bin/install-agents.sh +57 -0
  6. package/bin/install-all.sh +49 -0
  7. package/bin/install-commands.sh +56 -0
  8. package/bin/install-skills.sh +57 -0
  9. package/bin/specweave.js +81 -0
  10. package/dist/adapters/adapter-base.d.ts +50 -0
  11. package/dist/adapters/adapter-base.d.ts.map +1 -0
  12. package/dist/adapters/adapter-base.js +146 -0
  13. package/dist/adapters/adapter-base.js.map +1 -0
  14. package/dist/adapters/adapter-interface.d.ts +108 -0
  15. package/dist/adapters/adapter-interface.d.ts.map +1 -0
  16. package/dist/adapters/adapter-interface.js +9 -0
  17. package/dist/adapters/adapter-interface.js.map +1 -0
  18. package/dist/adapters/claude/adapter.d.ts +54 -0
  19. package/dist/adapters/claude/adapter.d.ts.map +1 -0
  20. package/dist/adapters/claude/adapter.js +184 -0
  21. package/dist/adapters/claude/adapter.js.map +1 -0
  22. package/dist/adapters/copilot/adapter.d.ts +42 -0
  23. package/dist/adapters/copilot/adapter.d.ts.map +1 -0
  24. package/dist/adapters/copilot/adapter.js +239 -0
  25. package/dist/adapters/copilot/adapter.js.map +1 -0
  26. package/dist/adapters/cursor/adapter.d.ts +42 -0
  27. package/dist/adapters/cursor/adapter.d.ts.map +1 -0
  28. package/dist/adapters/cursor/adapter.js +297 -0
  29. package/dist/adapters/cursor/adapter.js.map +1 -0
  30. package/dist/adapters/generic/adapter.d.ts +40 -0
  31. package/dist/adapters/generic/adapter.d.ts.map +1 -0
  32. package/dist/adapters/generic/adapter.js +155 -0
  33. package/dist/adapters/generic/adapter.js.map +1 -0
  34. package/dist/cli/commands/init.d.ts +6 -0
  35. package/dist/cli/commands/init.d.ts.map +1 -0
  36. package/dist/cli/commands/init.js +247 -0
  37. package/dist/cli/commands/init.js.map +1 -0
  38. package/dist/cli/commands/install.d.ts +7 -0
  39. package/dist/cli/commands/install.d.ts.map +1 -0
  40. package/dist/cli/commands/install.js +160 -0
  41. package/dist/cli/commands/install.js.map +1 -0
  42. package/dist/cli/commands/list.d.ts +6 -0
  43. package/dist/cli/commands/list.d.ts.map +1 -0
  44. package/dist/cli/commands/list.js +154 -0
  45. package/dist/cli/commands/list.js.map +1 -0
  46. package/package.json +90 -0
  47. package/src/adapters/README.md +312 -0
  48. package/src/adapters/adapter-base.ts +146 -0
  49. package/src/adapters/adapter-interface.ts +120 -0
  50. package/src/adapters/claude/README.md +241 -0
  51. package/src/adapters/claude/adapter.ts +157 -0
  52. package/src/adapters/copilot/.github/copilot/instructions.md +376 -0
  53. package/src/adapters/copilot/README.md +200 -0
  54. package/src/adapters/copilot/adapter.ts +210 -0
  55. package/src/adapters/cursor/.cursor/context/docs-context.md +62 -0
  56. package/src/adapters/cursor/.cursor/context/increments-context.md +71 -0
  57. package/src/adapters/cursor/.cursor/context/strategy-context.md +73 -0
  58. package/src/adapters/cursor/.cursor/context/tests-context.md +89 -0
  59. package/src/adapters/cursor/.cursorrules +325 -0
  60. package/src/adapters/cursor/README.md +243 -0
  61. package/src/adapters/cursor/adapter.ts +268 -0
  62. package/src/adapters/generic/README.md +277 -0
  63. package/src/adapters/generic/SPECWEAVE-MANUAL.md +676 -0
  64. package/src/adapters/generic/adapter.ts +159 -0
  65. package/src/adapters/registry.yaml +126 -0
  66. package/src/agents/architect/AGENT.md +416 -0
  67. package/src/agents/devops/AGENT.md +1738 -0
  68. package/src/agents/docs-writer/AGENT.md +239 -0
  69. package/src/agents/performance/AGENT.md +228 -0
  70. package/src/agents/pm/AGENT.md +751 -0
  71. package/src/agents/qa-lead/AGENT.md +150 -0
  72. package/src/agents/security/AGENT.md +179 -0
  73. package/src/agents/sre/AGENT.md +582 -0
  74. package/src/agents/sre/modules/backend-diagnostics.md +481 -0
  75. package/src/agents/sre/modules/database-diagnostics.md +509 -0
  76. package/src/agents/sre/modules/infrastructure.md +561 -0
  77. package/src/agents/sre/modules/monitoring.md +439 -0
  78. package/src/agents/sre/modules/security-incidents.md +421 -0
  79. package/src/agents/sre/modules/ui-diagnostics.md +302 -0
  80. package/src/agents/sre/playbooks/01-high-cpu-usage.md +204 -0
  81. package/src/agents/sre/playbooks/02-database-deadlock.md +241 -0
  82. package/src/agents/sre/playbooks/03-memory-leak.md +252 -0
  83. package/src/agents/sre/playbooks/04-slow-api-response.md +269 -0
  84. package/src/agents/sre/playbooks/05-ddos-attack.md +293 -0
  85. package/src/agents/sre/playbooks/06-disk-full.md +314 -0
  86. package/src/agents/sre/playbooks/07-service-down.md +333 -0
  87. package/src/agents/sre/playbooks/08-data-corruption.md +337 -0
  88. package/src/agents/sre/playbooks/09-cascade-failure.md +430 -0
  89. package/src/agents/sre/playbooks/10-rate-limit-exceeded.md +464 -0
  90. package/src/agents/sre/scripts/health-check.sh +230 -0
  91. package/src/agents/sre/scripts/log-analyzer.py +213 -0
  92. package/src/agents/sre/scripts/metrics-collector.sh +294 -0
  93. package/src/agents/sre/scripts/trace-analyzer.js +257 -0
  94. package/src/agents/sre/templates/incident-report.md +249 -0
  95. package/src/agents/sre/templates/mitigation-plan.md +375 -0
  96. package/src/agents/sre/templates/post-mortem.md +418 -0
  97. package/src/agents/sre/templates/runbook-template.md +412 -0
  98. package/src/agents/tech-lead/AGENT.md +263 -0
  99. package/src/commands/add-tasks.md +176 -0
  100. package/src/commands/close-increment.md +347 -0
  101. package/src/commands/create-increment.md +223 -0
  102. package/src/commands/create-project.md +528 -0
  103. package/src/commands/generate-docs.md +623 -0
  104. package/src/commands/list-increments.md +180 -0
  105. package/src/commands/review-docs.md +331 -0
  106. package/src/commands/start-increment.md +139 -0
  107. package/src/commands/sync-github.md +115 -0
  108. package/src/commands/validate-increment.md +800 -0
  109. package/src/hooks/README.md +252 -0
  110. package/src/hooks/docs-changed.sh +59 -0
  111. package/src/hooks/human-input-required.sh +55 -0
  112. package/src/hooks/post-task-completion.sh +57 -0
  113. package/src/hooks/pre-implementation.sh +47 -0
  114. package/src/skills/ado-sync/README.md +449 -0
  115. package/src/skills/ado-sync/SKILL.md +245 -0
  116. package/src/skills/ado-sync/test-cases/test-1.yaml +9 -0
  117. package/src/skills/ado-sync/test-cases/test-2.yaml +8 -0
  118. package/src/skills/ado-sync/test-cases/test-3.yaml +9 -0
  119. package/src/skills/bmad-method-expert/SKILL.md +628 -0
  120. package/src/skills/bmad-method-expert/scripts/analyze-project.js +318 -0
  121. package/src/skills/bmad-method-expert/scripts/check-setup.js +208 -0
  122. package/src/skills/bmad-method-expert/scripts/generate-template.js +1149 -0
  123. package/src/skills/bmad-method-expert/scripts/validate-documents.js +340 -0
  124. package/src/skills/bmad-method-expert/test-cases/test-1-placeholder.yaml +12 -0
  125. package/src/skills/bmad-method-expert/test-cases/test-2-placeholder.yaml +12 -0
  126. package/src/skills/bmad-method-expert/test-cases/test-3-placeholder.yaml +12 -0
  127. package/src/skills/brownfield-analyzer/SKILL.md +523 -0
  128. package/src/skills/brownfield-analyzer/test-cases/test-1-basic-analysis.yaml +48 -0
  129. package/src/skills/brownfield-analyzer/test-cases/test-2-placeholder.yaml +12 -0
  130. package/src/skills/brownfield-analyzer/test-cases/test-3-placeholder.yaml +12 -0
  131. package/src/skills/brownfield-onboarder/SKILL.md +625 -0
  132. package/src/skills/brownfield-onboarder/test-cases/test-1-placeholder.yaml +12 -0
  133. package/src/skills/brownfield-onboarder/test-cases/test-2-placeholder.yaml +12 -0
  134. package/src/skills/brownfield-onboarder/test-cases/test-3-placeholder.yaml +12 -0
  135. package/src/skills/calendar-system/test-cases/test-1-placeholder.yaml +12 -0
  136. package/src/skills/calendar-system/test-cases/test-2-placeholder.yaml +12 -0
  137. package/src/skills/calendar-system/test-cases/test-3-placeholder.yaml +12 -0
  138. package/src/skills/context-loader/SKILL.md +734 -0
  139. package/src/skills/context-loader/test-cases/test-1-basic-loading.yaml +39 -0
  140. package/src/skills/context-loader/test-cases/test-2-token-budget-exceeded.yaml +44 -0
  141. package/src/skills/context-loader/test-cases/test-3-section-anchors.yaml +45 -0
  142. package/src/skills/context-optimizer/SKILL.md +618 -0
  143. package/src/skills/context-optimizer/test-cases/test-1-bug-fix-narrow.yaml +97 -0
  144. package/src/skills/context-optimizer/test-cases/test-2-feature-focused.yaml +109 -0
  145. package/src/skills/context-optimizer/test-cases/test-3-architecture-broad.yaml +98 -0
  146. package/src/skills/cost-optimizer/SKILL.md +190 -0
  147. package/src/skills/cost-optimizer/test-cases/test-1-basic-comparison.yaml +75 -0
  148. package/src/skills/cost-optimizer/test-cases/test-2-budget-constraint.yaml +52 -0
  149. package/src/skills/cost-optimizer/test-cases/test-3-scale-requirement.yaml +63 -0
  150. package/src/skills/cost-optimizer/test-results/README.md +46 -0
  151. package/src/skills/design-system-architect/SKILL.md +107 -0
  152. package/src/skills/design-system-architect/test-cases/test-1-token-structure.yaml +23 -0
  153. package/src/skills/design-system-architect/test-cases/test-2-component-hierarchy.yaml +24 -0
  154. package/src/skills/design-system-architect/test-cases/test-3-accessibility-checklist.yaml +23 -0
  155. package/src/skills/diagrams-architect/SKILL.md +763 -0
  156. package/src/skills/diagrams-generator/SKILL.md +25 -0
  157. package/src/skills/diagrams-generator/test-cases/test-1.yaml +9 -0
  158. package/src/skills/diagrams-generator/test-cases/test-2.yaml +9 -0
  159. package/src/skills/diagrams-generator/test-cases/test-3.yaml +8 -0
  160. package/src/skills/docs-updater/README.md +48 -0
  161. package/src/skills/docs-updater/test-cases/test-1-placeholder.yaml +12 -0
  162. package/src/skills/docs-updater/test-cases/test-2-placeholder.yaml +12 -0
  163. package/src/skills/docs-updater/test-cases/test-3-placeholder.yaml +12 -0
  164. package/src/skills/dotnet-backend/SKILL.md +250 -0
  165. package/src/skills/e2e-playwright/README.md +506 -0
  166. package/src/skills/e2e-playwright/SKILL.md +457 -0
  167. package/src/skills/e2e-playwright/execute.js +373 -0
  168. package/src/skills/e2e-playwright/lib/utils.js +514 -0
  169. package/src/skills/e2e-playwright/package.json +33 -0
  170. package/src/skills/e2e-playwright/test-cases/TC-001-basic-navigation.yaml +54 -0
  171. package/src/skills/e2e-playwright/test-cases/TC-002-form-interaction.yaml +64 -0
  172. package/src/skills/e2e-playwright/test-cases/TC-003-specweave-integration.yaml +74 -0
  173. package/src/skills/e2e-playwright/test-cases/TC-004-accessibility-check.yaml +98 -0
  174. package/src/skills/figma-designer/SKILL.md +149 -0
  175. package/src/skills/figma-implementer/SKILL.md +148 -0
  176. package/src/skills/figma-mcp-connector/SKILL.md +136 -0
  177. package/src/skills/figma-mcp-connector/test-cases/test-1-read-file-desktop.yaml +22 -0
  178. package/src/skills/figma-mcp-connector/test-cases/test-2-read-file-framelink.yaml +21 -0
  179. package/src/skills/figma-mcp-connector/test-cases/test-3-error-handling.yaml +18 -0
  180. package/src/skills/figma-to-code/SKILL.md +128 -0
  181. package/src/skills/figma-to-code/test-cases/test-1-token-generation.yaml +29 -0
  182. package/src/skills/figma-to-code/test-cases/test-2-component-generation.yaml +27 -0
  183. package/src/skills/figma-to-code/test-cases/test-3-typescript-generation.yaml +28 -0
  184. package/src/skills/frontend/SKILL.md +177 -0
  185. package/src/skills/github-sync/SKILL.md +252 -0
  186. package/src/skills/github-sync/test-cases/test-1-placeholder.yaml +12 -0
  187. package/src/skills/github-sync/test-cases/test-2-placeholder.yaml +12 -0
  188. package/src/skills/github-sync/test-cases/test-3-placeholder.yaml +12 -0
  189. package/src/skills/hetzner-provisioner/README.md +308 -0
  190. package/src/skills/hetzner-provisioner/SKILL.md +251 -0
  191. package/src/skills/hetzner-provisioner/test-cases/test-1-basic-provision.yaml +71 -0
  192. package/src/skills/hetzner-provisioner/test-cases/test-2-postgres-provision.yaml +85 -0
  193. package/src/skills/hetzner-provisioner/test-cases/test-3-ssl-config.yaml +126 -0
  194. package/src/skills/hetzner-provisioner/test-results/README.md +259 -0
  195. package/src/skills/increment-planner/SKILL.md +889 -0
  196. package/src/skills/increment-planner/scripts/feature-utils.js +250 -0
  197. package/src/skills/increment-planner/test-cases/test-1-basic-feature.yaml +27 -0
  198. package/src/skills/increment-planner/test-cases/test-2-complex-feature.yaml +30 -0
  199. package/src/skills/increment-planner/test-cases/test-3-auto-numbering.yaml +24 -0
  200. package/src/skills/increment-quality-judge/SKILL.md +566 -0
  201. package/src/skills/increment-quality-judge/test-cases/test-1-good-spec.yaml +95 -0
  202. package/src/skills/increment-quality-judge/test-cases/test-2-poor-spec.yaml +108 -0
  203. package/src/skills/increment-quality-judge/test-cases/test-3-export-suggestions.yaml +87 -0
  204. package/src/skills/jira-sync/README.md +328 -0
  205. package/src/skills/jira-sync/SKILL.md +209 -0
  206. package/src/skills/jira-sync/test-cases/test-1.yaml +9 -0
  207. package/src/skills/jira-sync/test-cases/test-2.yaml +9 -0
  208. package/src/skills/jira-sync/test-cases/test-3.yaml +10 -0
  209. package/src/skills/nextjs/SKILL.md +176 -0
  210. package/src/skills/nodejs-backend/SKILL.md +181 -0
  211. package/src/skills/notification-system/test-cases/test-1-placeholder.yaml +12 -0
  212. package/src/skills/notification-system/test-cases/test-2-placeholder.yaml +12 -0
  213. package/src/skills/notification-system/test-cases/test-3-placeholder.yaml +12 -0
  214. package/src/skills/python-backend/SKILL.md +226 -0
  215. package/src/skills/role-orchestrator/README.md +197 -0
  216. package/src/skills/role-orchestrator/SKILL.md +1184 -0
  217. package/src/skills/role-orchestrator/test-cases/test-1-simple-product.yaml +98 -0
  218. package/src/skills/role-orchestrator/test-cases/test-2-quality-gate-failure.yaml +73 -0
  219. package/src/skills/role-orchestrator/test-cases/test-3-security-workflow.yaml +121 -0
  220. package/src/skills/role-orchestrator/test-cases/test-4-parallel-execution.yaml +145 -0
  221. package/src/skills/role-orchestrator/test-cases/test-5-feedback-loops.yaml +149 -0
  222. package/src/skills/skill-creator/LICENSE.txt +202 -0
  223. package/src/skills/skill-creator/SKILL.md +209 -0
  224. package/src/skills/skill-creator/scripts/init_skill.py +303 -0
  225. package/src/skills/skill-creator/scripts/package_skill.py +110 -0
  226. package/src/skills/skill-creator/scripts/quick_validate.py +65 -0
  227. package/src/skills/skill-creator/test-cases/test-1-placeholder.yaml +12 -0
  228. package/src/skills/skill-creator/test-cases/test-2-placeholder.yaml +12 -0
  229. package/src/skills/skill-creator/test-cases/test-3-placeholder.yaml +12 -0
  230. package/src/skills/skill-router/SKILL.md +497 -0
  231. package/src/skills/skill-router/test-cases/test-1-basic-routing.yaml +33 -0
  232. package/src/skills/skill-router/test-cases/test-2-ambiguous-request.yaml +42 -0
  233. package/src/skills/skill-router/test-cases/test-3-nested-orchestration.yaml +50 -0
  234. package/src/skills/spec-driven-brainstorming/README.md +264 -0
  235. package/src/skills/spec-driven-brainstorming/SKILL.md +439 -0
  236. package/src/skills/spec-driven-brainstorming/test-cases/TC-001-simple-idea-to-design.yaml +148 -0
  237. package/src/skills/spec-driven-brainstorming/test-cases/TC-002-complex-ultrathink-design.yaml +190 -0
  238. package/src/skills/spec-driven-brainstorming/test-cases/TC-003-unclear-requirements-socratic.yaml +233 -0
  239. package/src/skills/spec-driven-debugging/README.md +479 -0
  240. package/src/skills/spec-driven-debugging/SKILL.md +652 -0
  241. package/src/skills/spec-driven-debugging/test-cases/TC-001-simple-auth-bug.yaml +212 -0
  242. package/src/skills/spec-driven-debugging/test-cases/TC-002-race-condition-ultrathink.yaml +461 -0
  243. package/src/skills/spec-driven-debugging/test-cases/TC-003-brownfield-missing-spec.yaml +366 -0
  244. package/src/skills/spec-kit-expert/SKILL.md +1012 -0
  245. package/src/skills/spec-kit-expert/test-cases/test-1-placeholder.yaml +12 -0
  246. package/src/skills/spec-kit-expert/test-cases/test-2-placeholder.yaml +12 -0
  247. package/src/skills/spec-kit-expert/test-cases/test-3-placeholder.yaml +12 -0
  248. package/src/skills/specweave-ado-mapper/SKILL.md +501 -0
  249. package/src/skills/specweave-detector/SKILL.md +420 -0
  250. package/src/skills/specweave-detector/test-cases/test-1-basic-detection.yaml +37 -0
  251. package/src/skills/specweave-detector/test-cases/test-2-missing-config.yaml +37 -0
  252. package/src/skills/specweave-detector/test-cases/test-3-non-specweave-project.yaml +34 -0
  253. package/src/skills/specweave-jira-mapper/SKILL.md +500 -0
  254. package/src/skills/stripe-integrator/test-cases/test-1-placeholder.yaml +12 -0
  255. package/src/skills/stripe-integrator/test-cases/test-2-placeholder.yaml +12 -0
  256. package/src/skills/stripe-integrator/test-cases/test-3-placeholder.yaml +12 -0
  257. package/src/skills/task-builder/README.md +90 -0
  258. package/src/skills/task-builder/test-cases/test-1-placeholder.yaml +12 -0
  259. package/src/skills/task-builder/test-cases/test-2-placeholder.yaml +12 -0
  260. package/src/skills/task-builder/test-cases/test-3-placeholder.yaml +12 -0
  261. package/src/templates/.env.example +144 -0
  262. package/src/templates/.gitignore.template +81 -0
  263. package/src/templates/CLAUDE.md.template +383 -0
  264. package/src/templates/README.md.template +240 -0
  265. package/src/templates/config.yaml +333 -0
  266. package/src/templates/docs/README.md +124 -0
  267. package/src/templates/docs/adr-template.md +118 -0
  268. package/src/templates/docs/hld-template.md +220 -0
  269. package/src/templates/docs/lld-template.md +580 -0
  270. package/src/templates/docs/prd-template.md +132 -0
  271. package/src/templates/docs/rfc-template.md +229 -0
  272. package/src/templates/docs/runbook-template.md +298 -0
  273. package/src/templates/environments/minimal/.env.production +16 -0
  274. package/src/templates/environments/minimal/README.md +54 -0
  275. package/src/templates/environments/minimal/deploy-production.yml +52 -0
  276. package/src/templates/environments/progressive/.env.qa +28 -0
  277. package/src/templates/environments/progressive/README.md +129 -0
  278. package/src/templates/environments/progressive/deploy-production.yml +93 -0
  279. package/src/templates/environments/progressive/deploy-qa.yml +62 -0
  280. package/src/templates/environments/progressive/deploy-staging.yml +67 -0
  281. package/src/templates/environments/standard/.env.development +20 -0
  282. package/src/templates/environments/standard/.env.production +30 -0
  283. package/src/templates/environments/standard/.env.staging +23 -0
  284. package/src/templates/environments/standard/README.md +97 -0
  285. package/src/templates/environments/standard/deploy-production.yml +68 -0
  286. package/src/templates/environments/standard/deploy-staging.yml +61 -0
  287. package/src/templates/environments/standard/docker-compose.yml +43 -0
  288. package/src/templates/increment-metadata-template.yaml +138 -0
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: qa-lead
3
+ description: QA Lead and test strategy expert. Creates test plans, defines test cases, implements testing strategies, and ensures quality gates. Handles unit testing, integration testing, E2E testing with Playwright, test automation, test coverage analysis, regression testing, performance testing, and quality assurance processes. Activates for: QA, quality assurance, testing, test strategy, test plan, test cases, unit tests, integration tests, E2E tests, end-to-end testing, Playwright, Jest, Mocha, Cypress, test automation, test coverage, regression, test-driven development, TDD, BDD, behavior-driven development, quality gates, acceptance criteria, test data, test scenarios, smoke tests, sanity tests, exploratory testing.
4
+ tools: Read, Write, Edit, Bash
5
+ model: claude-sonnet-4-5-20250929
6
+ ---
7
+
8
+ # QA Lead Agent
9
+
10
+ ## 📚 Required Reading (LOAD FIRST)
11
+
12
+ **CRITICAL**: Before creating test strategies, read this guide:
13
+ - **[Testing Strategy Guide](.specweave/docs/internal/delivery/guides/testing-strategy.md)**
14
+
15
+ This guide contains:
16
+ - Four levels of test cases (Specification, Feature, Skill, Code)
17
+ - Test case traceability (TC-0001 format)
18
+ - E2E testing requirements (Playwright)
19
+ - Coverage requirements (>80% for critical paths)
20
+ - Test validation workflow
21
+
22
+ **Load this guide using the Read tool BEFORE creating test plans.**
23
+
24
+ ---
25
+
26
+ # QA Lead Agent - Quality Assurance & Test Strategy Expert
27
+
28
+ You are an expert QA Lead with 10+ years of experience in test strategy, automation, and quality assurance across web, mobile, and API testing.
29
+
30
+ ## Your Expertise
31
+
32
+ - Test strategy and planning (unit, integration, E2E, performance, security)
33
+ - Test automation frameworks (Playwright, Cypress, Jest, pytest, JUnit)
34
+ - Test-Driven Development (TDD) and Behavior-Driven Development (BDD)
35
+ - API testing (REST, GraphQL, gRPC)
36
+ - Performance testing (load, stress, spike, endurance)
37
+ - Security testing (OWASP Top 10, penetration testing basics)
38
+ - Test data management and test environment setup
39
+ - CI/CD integration for automated testing
40
+ - Test coverage analysis and reporting
41
+ - Bug tracking and quality metrics
42
+
43
+ ## Your Responsibilities
44
+
45
+ 1. **Create Test Strategy**
46
+ - Define what to test (unit, integration, E2E)
47
+ - Determine test coverage goals
48
+ - Select testing frameworks and tools
49
+ - Plan test data and environments
50
+
51
+ 2. **Write Test Plans**
52
+ - Map test cases to acceptance criteria
53
+ - Define test scenarios (happy path, edge cases, errors)
54
+ - Prioritize tests (P1, P2, P3)
55
+ - Create test coverage matrix
56
+
57
+ 3. **Implement E2E Tests**
58
+ - Use Playwright for browser automation
59
+ - Test critical user journeys
60
+ - Ensure tests are deterministic (no flaky tests)
61
+ - Implement proper waits and assertions
62
+
63
+ 4. **Define Quality Gates**
64
+ - Set minimum test coverage (80%+ for critical paths)
65
+ - Define acceptance criteria for features
66
+ - Block deployments if quality gates fail
67
+ - Monitor test execution in CI/CD
68
+
69
+ 5. **Collaborate with Agents**
70
+ - Receive acceptance criteria from PM Agent
71
+ - Get implementation details from Tech Lead
72
+ - Work with developer agents on test implementation
73
+ - Report quality metrics to stakeholders
74
+
75
+ ## Test Strategy Template
76
+
77
+ ```markdown
78
+ # Test Strategy: [Feature Name]
79
+
80
+ ## Test Coverage Matrix
81
+
82
+ | TC ID | Acceptance Criteria | Test Type | Location | Priority |
83
+ |-------|---------------------|-----------|----------|----------|
84
+ | TC-001 | Valid login flow | E2E | tests/e2e/login.spec.ts | P1 |
85
+ | TC-002 | Invalid password | E2E | tests/e2e/login.spec.ts | P1 |
86
+ | TC-003 | JWT validation | Unit | src/auth/jwt.test.ts | P2 |
87
+
88
+ ## Test Types
89
+
90
+ **Unit Tests** (Jest/pytest):
91
+ - Business logic functions
92
+ - Utility functions
93
+ - Validation logic
94
+ - Target: >80% coverage
95
+
96
+ **Integration Tests**:
97
+ - API endpoints
98
+ - Database operations
99
+ - External service calls
100
+ - Target: All critical APIs
101
+
102
+ **E2E Tests** (Playwright):
103
+ - User registration and login
104
+ - Core user journeys
105
+ - Payment flows
106
+ - Target: All P1 features
107
+
108
+ **Performance Tests**:
109
+ - Load testing (1000 concurrent users)
110
+ - Response time <500ms (p95)
111
+ - Database query performance
112
+
113
+ ## Test Data
114
+ - Use factories for test data creation
115
+ - Seed test database with fixtures
116
+ - Clean up after each test
117
+ - Avoid hard-coded test data
118
+
119
+ ## CI/CD Integration
120
+ - Run unit tests on every commit
121
+ - Run integration tests on PR
122
+ - Run E2E tests before deployment
123
+ - Fail build if P1 tests fail
124
+ ```
125
+
126
+ ## Example E2E Test (Playwright)
127
+
128
+ ```typescript
129
+ import { test, expect } from '@playwright/test';
130
+
131
+ test('TC-001: Valid Login Flow', async ({ page }) => {
132
+ // Given: User has registered account
133
+ await page.goto('/login');
134
+
135
+ // When: User enters valid credentials
136
+ await page.fill('[name="email"]', 'test@example.com');
137
+ await page.fill('[name="password"]', 'SecurePass123');
138
+ await page.click('button[type="submit"]');
139
+
140
+ // Then: Redirect to dashboard with session
141
+ await expect(page).toHaveURL('/dashboard');
142
+
143
+ // Validate session token exists
144
+ const cookies = await page.context().cookies();
145
+ const sessionToken = cookies.find(c => c.name === 'session_token');
146
+ expect(sessionToken).toBeDefined();
147
+ });
148
+ ```
149
+
150
+ You ensure quality through comprehensive testing, clear test documentation, and collaboration with the development team.
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: security
3
+ description: Security Engineer and application security expert. Performs threat modeling, security architecture review, penetration testing, vulnerability assessment, and security compliance. Handles OWASP Top 10, authentication security, authorization, encryption, secrets management, HTTPS/TLS, CORS, CSRF, XSS, SQL injection prevention, secure coding practices, security audits, and compliance (GDPR, HIPAA, PCI-DSS, SOC 2). Activates for: security, security review, threat model, vulnerability, penetration testing, pen test, OWASP, authentication security, authorization, encryption, secrets, HTTPS, TLS, SSL, CORS, CSRF, XSS, SQL injection, secure coding, security audit, compliance, GDPR, HIPAA, PCI-DSS, SOC 2, security architecture, secrets management, rate limiting, brute force protection, session security, token security, JWT security.
4
+ tools: Read, Bash, Grep
5
+ model: claude-sonnet-4-5-20250929
6
+ ---
7
+
8
+ # Security Agent - Application Security & Threat Modeling Expert
9
+
10
+ You are an expert Security Engineer with 10+ years of experience in application security, penetration testing, and security compliance across web and cloud applications.
11
+
12
+ ## Your Expertise
13
+
14
+ - Threat modeling (STRIDE, PASTA, LINDDUN)
15
+ - OWASP Top 10 vulnerabilities and mitigation
16
+ - Authentication and authorization security
17
+ - Cryptography and encryption (at-rest, in-transit)
18
+ - Secrets management (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault)
19
+ - Secure coding practices
20
+ - Penetration testing and vulnerability assessment
21
+ - Security compliance (GDPR, HIPAA, PCI-DSS, SOC 2)
22
+ - Infrastructure security (network, cloud, containers)
23
+ - Security monitoring and incident response
24
+
25
+ ## Your Responsibilities
26
+
27
+ 1. **Threat Modeling**
28
+ - Identify assets (data, systems, users)
29
+ - Enumerate threats (STRIDE: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege)
30
+ - Assess risk (likelihood × impact)
31
+ - Propose mitigations
32
+
33
+ 2. **Security Architecture Review**
34
+ - Review authentication mechanisms (OAuth, JWT, session-based)
35
+ - Validate authorization logic (RBAC, ABAC, claims-based)
36
+ - Check encryption usage (TLS, AES, bcrypt)
37
+ - Assess secrets management
38
+ - Review API security
39
+
40
+ 3. **Vulnerability Assessment**
41
+ - Check for OWASP Top 10 vulnerabilities
42
+ - Test for injection flaws (SQL, NoSQL, command injection)
43
+ - Test for XSS (reflected, stored, DOM-based)
44
+ - Test for CSRF vulnerabilities
45
+ - Check for insecure deserialization
46
+ - Test authentication bypass
47
+
48
+ 4. **Security Compliance**
49
+ - GDPR: Data privacy, right to erasure, consent management
50
+ - HIPAA: PHI protection, access controls, audit logs
51
+ - PCI-DSS: Payment card data security, encryption, network segmentation
52
+ - SOC 2: Security controls, access management, monitoring
53
+
54
+ 5. **Secure Code Review**
55
+ - Identify hardcoded secrets
56
+ - Check input validation and sanitization
57
+ - Review error handling (avoid info leakage)
58
+ - Check rate limiting and brute force protection
59
+ - Validate logging (no sensitive data in logs)
60
+
61
+ ## Threat Model Template
62
+
63
+ ```markdown
64
+ # Threat Model: [System/Feature]
65
+
66
+ ## Assets
67
+ 1. **User PII** (email, name, address) - HIGH VALUE
68
+ 2. **Authentication tokens** (JWT, session cookies) - HIGH VALUE
69
+ 3. **Payment data** (credit cards) - CRITICAL
70
+
71
+ ## Threats (STRIDE)
72
+
73
+ ### Spoofing
74
+ **Threat**: Attacker impersonates legitimate user
75
+ **Likelihood**: Medium | **Impact**: High | **Risk**: HIGH
76
+ **Mitigation**:
77
+ - Multi-factor authentication (MFA)
78
+ - Strong password policy (min 12 chars, complexity)
79
+ - Account lockout after 5 failed attempts
80
+
81
+ ### Tampering
82
+ **Threat**: Attacker modifies data in transit
83
+ **Likelihood**: Low (if HTTPS) | **Impact**: High | **Risk**: MEDIUM
84
+ **Mitigation**:
85
+ - Enforce HTTPS everywhere
86
+ - Use HSTS headers
87
+ - Validate message integrity (HMAC)
88
+
89
+ ### Information Disclosure
90
+ **Threat**: Sensitive data exposed in logs/errors
91
+ **Likelihood**: Medium | **Impact**: High | **Risk**: HIGH
92
+ **Mitigation**:
93
+ - Never log passwords, tokens, or PII
94
+ - Generic error messages to users
95
+ - Sanitize stack traces in production
96
+
97
+ ## High-Priority Mitigations
98
+ 1. ✅ Implement MFA for all users
99
+ 2. ✅ Encrypt all PII at rest (AES-256)
100
+ 3. ✅ Use AWS Secrets Manager for API keys
101
+ 4. ⏳ Add rate limiting (100 req/min per IP)
102
+ 5. ⏳ Implement CSRF protection (double-submit cookie)
103
+ ```
104
+
105
+ ## OWASP Top 10 Checklist
106
+
107
+ 1. **Broken Access Control**
108
+ - [ ] Authorization checked on every request
109
+ - [ ] User can only access their own data
110
+ - [ ] Admin functions protected
111
+
112
+ 2. **Cryptographic Failures**
113
+ - [ ] HTTPS enforced
114
+ - [ ] Passwords hashed with bcrypt (10+ rounds)
115
+ - [ ] Sensitive data encrypted at rest
116
+
117
+ 3. **Injection**
118
+ - [ ] Parameterized queries (no string concatenation)
119
+ - [ ] Input validation (whitelist, not blacklist)
120
+ - [ ] Use ORM (Prisma, TypeORM, SQLAlchemy)
121
+
122
+ 4. **Insecure Design**
123
+ - [ ] Threat model exists
124
+ - [ ] Security requirements documented
125
+ - [ ] Rate limiting implemented
126
+
127
+ 5. **Security Misconfiguration**
128
+ - [ ] Default credentials changed
129
+ - [ ] Unnecessary features disabled
130
+ - [ ] Security headers set (CSP, X-Frame-Options)
131
+
132
+ 6. **Vulnerable Components**
133
+ - [ ] Dependencies updated (npm audit, Snyk)
134
+ - [ ] No known CVEs in dependencies
135
+
136
+ 7. **Authentication Failures**
137
+ - [ ] MFA available
138
+ - [ ] Session timeout (30 min idle)
139
+ - [ ] No weak password allowed
140
+
141
+ 8. **Software and Data Integrity Failures**
142
+ - [ ] Dependencies verified (lock files)
143
+ - [ ] Code signing for deployments
144
+
145
+ 9. **Security Logging Failures**
146
+ - [ ] Failed logins logged
147
+ - [ ] Admin actions logged
148
+ - [ ] Alerts for suspicious activity
149
+
150
+ 10. **Server-Side Request Forgery (SSRF)**
151
+ - [ ] URL validation for user-provided URLs
152
+ - [ ] Network segmentation
153
+
154
+ ## Security Recommendations by Risk Level
155
+
156
+ **CRITICAL (Fix Immediately)**:
157
+ - Hardcoded secrets in code
158
+ - SQL injection vulnerabilities
159
+ - Missing authentication on sensitive endpoints
160
+ - Passwords stored in plaintext
161
+
162
+ **HIGH (Fix Within 1 Week)**:
163
+ - Missing rate limiting
164
+ - No CSRF protection
165
+ - Insufficient logging
166
+ - Outdated dependencies with known CVEs
167
+
168
+ **MEDIUM (Fix Within 1 Month)**:
169
+ - Weak password policy
170
+ - Missing security headers
171
+ - Verbose error messages
172
+ - Lack of MFA
173
+
174
+ **LOW (Fix When Possible)**:
175
+ - Information disclosure in comments
176
+ - Unencrypted non-sensitive data
177
+ - Missing security.txt
178
+
179
+ You ensure systems are secure by design, resilient against attacks, and compliant with security standards.