sinapse-ai 1.2.1 → 1.4.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 (257) hide show
  1. package/.claude/hooks/README.md +16 -10
  2. package/.claude/hooks/mind-clone-governance.py +212 -212
  3. package/.claude/hooks/read-protection.py +152 -152
  4. package/.claude/hooks/slug-validation.py +175 -175
  5. package/.claude/hooks/sql-governance.py +183 -183
  6. package/.claude/rules/documentation-first.md +69 -0
  7. package/.claude/rules/project-intelligence.md +121 -16
  8. package/.claude/rules/safe-collaboration.md +2 -2
  9. package/.codex/agents/developer.md +1 -0
  10. package/.codex/agents/product-lead.md +1 -0
  11. package/.codex/agents/project-lead.md +1 -0
  12. package/.codex/agents/quality-gate.md +1 -0
  13. package/.codex/agents/snps-orqx.md +72 -10
  14. package/.codex/agents/sprint-lead.md +1 -0
  15. package/.sinapse-ai/constitution.md +5 -5
  16. package/.sinapse-ai/core/grounding/vault.cjs +1 -1
  17. package/.sinapse-ai/core/orchestration/bob-orchestrator.js +341 -21
  18. package/.sinapse-ai/core/orchestration/brownfield-handler.js +27 -5
  19. package/.sinapse-ai/core/orchestration/greenfield-handler.js +61 -2
  20. package/.sinapse-ai/core-config.yaml +0 -3
  21. package/.sinapse-ai/data/entity-registry.yaml +13540 -13688
  22. package/.sinapse-ai/development/agents/developer.md +1 -0
  23. package/.sinapse-ai/development/agents/product-lead.md +1 -0
  24. package/.sinapse-ai/development/agents/project-lead.md +1 -0
  25. package/.sinapse-ai/development/agents/quality-gate.md +1 -0
  26. package/.sinapse-ai/development/agents/snps-orqx.md +72 -10
  27. package/.sinapse-ai/development/agents/sprint-lead.md +1 -0
  28. package/.sinapse-ai/development/scripts/unified-activation-pipeline.js +4 -9
  29. package/.sinapse-ai/development/tasks/brownfield-create-story.md +13 -0
  30. package/.sinapse-ai/development/tasks/create-brownfield-story.md +14 -0
  31. package/.sinapse-ai/development/tasks/push-and-pr.md +89 -0
  32. package/.sinapse-ai/development/tasks/self-heal.md +84 -0
  33. package/.sinapse-ai/development/templates/service-template/README.md.hbs +159 -159
  34. package/.sinapse-ai/development/templates/service-template/__tests__/index.test.ts.hbs +238 -238
  35. package/.sinapse-ai/development/templates/service-template/client.ts.hbs +404 -404
  36. package/.sinapse-ai/development/templates/service-template/errors.ts.hbs +183 -183
  37. package/.sinapse-ai/development/templates/service-template/index.ts.hbs +121 -121
  38. package/.sinapse-ai/development/templates/service-template/package.json.hbs +88 -88
  39. package/.sinapse-ai/development/templates/service-template/types.ts.hbs +146 -146
  40. package/.sinapse-ai/development/templates/squad-template/LICENSE +22 -22
  41. package/.sinapse-ai/development/workflows/development-cycle.yaml +6 -6
  42. package/.sinapse-ai/hooks/unified/runners/precompact-runner.js +15 -61
  43. package/.sinapse-ai/infrastructure/templates/coderabbit.yaml.template +280 -280
  44. package/.sinapse-ai/infrastructure/templates/config/env.example +16 -16
  45. package/.sinapse-ai/infrastructure/templates/config/gitignore-additions.tmpl +59 -59
  46. package/.sinapse-ai/infrastructure/templates/github/CODEOWNERS.template +12 -12
  47. package/.sinapse-ai/infrastructure/templates/github-workflows/ci.yml.template +170 -170
  48. package/.sinapse-ai/infrastructure/templates/github-workflows/pr-automation.yml.template +331 -331
  49. package/.sinapse-ai/infrastructure/templates/github-workflows/release.yml.template +197 -197
  50. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +19 -19
  51. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-node.tmpl +86 -86
  52. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-python.tmpl +146 -146
  53. package/.sinapse-ai/infrastructure/templates/gitignore/gitignore-sinapse-base.tmpl +64 -64
  54. package/.sinapse-ai/infrastructure/templates/safe-collab/CODEOWNERS.template +16 -16
  55. package/.sinapse-ai/infrastructure/templates/sinapse-sync.yaml.template +183 -183
  56. package/.sinapse-ai/install-manifest.yaml +98 -90
  57. package/.sinapse-ai/local-config.yaml.template +65 -65
  58. package/.sinapse-ai/monitor/hooks/lib/__init__.py +2 -2
  59. package/.sinapse-ai/monitor/hooks/lib/enrich.py +59 -59
  60. package/.sinapse-ai/monitor/hooks/lib/send_event.py +48 -48
  61. package/.sinapse-ai/monitor/hooks/notification.py +30 -30
  62. package/.sinapse-ai/monitor/hooks/post_tool_use.py +46 -46
  63. package/.sinapse-ai/monitor/hooks/pre_compact.py +30 -30
  64. package/.sinapse-ai/monitor/hooks/pre_tool_use.py +41 -41
  65. package/.sinapse-ai/monitor/hooks/stop.py +30 -30
  66. package/.sinapse-ai/monitor/hooks/subagent_stop.py +30 -30
  67. package/.sinapse-ai/monitor/hooks/user_prompt_submit.py +39 -39
  68. package/.sinapse-ai/product/templates/adr.hbs +126 -126
  69. package/.sinapse-ai/product/templates/dbdr.hbs +242 -242
  70. package/.sinapse-ai/product/templates/epic.hbs +213 -213
  71. package/.sinapse-ai/product/templates/ide-rules/codex-rules.md +1 -1
  72. package/.sinapse-ai/product/templates/pmdr.hbs +187 -187
  73. package/.sinapse-ai/product/templates/prd-v2.0.hbs +217 -217
  74. package/.sinapse-ai/product/templates/prd.hbs +202 -202
  75. package/.sinapse-ai/product/templates/story.hbs +264 -264
  76. package/.sinapse-ai/product/templates/task.hbs +171 -171
  77. package/.sinapse-ai/product/templates/tmpl-comment-on-examples.sql +159 -159
  78. package/.sinapse-ai/product/templates/tmpl-migration-script.sql +92 -92
  79. package/.sinapse-ai/product/templates/tmpl-rls-granular-policies.sql +105 -105
  80. package/.sinapse-ai/product/templates/tmpl-rls-kiss-policy.sql +11 -11
  81. package/.sinapse-ai/product/templates/tmpl-rls-roles.sql +136 -136
  82. package/.sinapse-ai/product/templates/tmpl-rls-simple.sql +78 -78
  83. package/.sinapse-ai/product/templates/tmpl-rls-tenant.sql +153 -153
  84. package/.sinapse-ai/product/templates/tmpl-rollback-script.sql +78 -78
  85. package/.sinapse-ai/product/templates/tmpl-seed-data.sql +141 -141
  86. package/.sinapse-ai/product/templates/tmpl-smoke-test.sql +17 -17
  87. package/.sinapse-ai/product/templates/tmpl-staging-copy-merge.sql +140 -140
  88. package/.sinapse-ai/product/templates/tmpl-stored-proc.sql +141 -141
  89. package/.sinapse-ai/product/templates/tmpl-trigger.sql +153 -153
  90. package/.sinapse-ai/product/templates/tmpl-view-materialized.sql +134 -134
  91. package/.sinapse-ai/product/templates/tmpl-view.sql +178 -178
  92. package/.sinapse-ai/project-config.yaml +0 -3
  93. package/LICENSE +63 -63
  94. package/README.en.md +6 -6
  95. package/README.md +14 -14
  96. package/bin/commands/install.js +34 -2
  97. package/bin/lib/register-grounding-hooks.js +1 -1
  98. package/docs/README.md +24 -58
  99. package/docs/agent-reference-guide.md +108 -0
  100. package/docs/constitution-compliance.md +87 -0
  101. package/docs/framework/orqx-plan.md +1 -1
  102. package/docs/framework/source-tree.md +1 -1
  103. package/docs/getting-started.md +68 -0
  104. package/docs/guides/development-setup.md +2 -2
  105. package/docs/guides/grounding-setup.md +3 -3
  106. package/docs/guides/parallel-collaboration-source-of-truth.md +1 -1
  107. package/docs/guides/squad-commands-reference.md +1 -1
  108. package/docs/guides/template-engine-v2.md +1 -1
  109. package/docs/installation/v4-quick-start.md +1 -1
  110. package/docs/pt/DOCUMENTATION-ROADMAP.md +6 -5
  111. package/docs/pt/architecture/dual-register-pattern.md +7 -7
  112. package/docs/pt/architecture/source-tree.md +1 -1
  113. package/docs/pt/architecture/sub-orqx-pattern.md +5 -5
  114. package/docs/pt/framework/source-tree.md +1 -1
  115. package/docs/pt/guides/development-setup.md +2 -2
  116. package/docs/pt/guides/template-engine-v2.md +1 -1
  117. package/docs/pt/installation/v4-quick-start.md +1 -1
  118. package/docs/troubleshooting.md +114 -0
  119. package/package.json +11 -18
  120. package/packages/installer/src/wizard/feedback.js +1 -1
  121. package/packages/installer/src/wizard/questions.js +1 -1
  122. package/packages/installer/src/wizard/wizard.js +113 -13
  123. package/packages/installer/templates/vault-routing.example.json +1 -1
  124. package/packages/sinapse-install/bin/edmcp.js +0 -0
  125. package/packages/sinapse-install/bin/sinapse-install.js +0 -0
  126. package/scripts/check-markdown-links.py +352 -353
  127. package/scripts/perf-baseline.sh +98 -0
  128. package/scripts/sync-squad-yaml-components.js +137 -0
  129. package/scripts/validate-all.js +153 -0
  130. package/scripts/validate-cross-refs.js +225 -0
  131. package/scripts/validate-no-personal-leaks.js +204 -0
  132. package/scripts/validate-orqx-discipline.js +160 -0
  133. package/sinapse/agents/snps-orqx.md +18 -9
  134. package/sinapse/knowledge-base/routing-catalog.md +2 -2
  135. package/sinapse/squad.yaml +2 -2
  136. package/squads/{squad-claude → claude-code-mastery}/agents/claude-orqx.md +50 -1
  137. package/squads/{squad-claude → claude-code-mastery}/knowledge-base/context-window-optimization.md +1 -1
  138. package/squads/{squad-claude → claude-code-mastery}/knowledge-base/knowledge-architecture-reference.md +3 -25
  139. package/squads/{squad-claude → claude-code-mastery}/knowledge-base/skill-creation-patterns.md +3 -3
  140. package/squads/{squad-claude → claude-code-mastery}/knowledge-base/swarm-orchestration-patterns.md +12 -15
  141. package/squads/claude-code-mastery/squad.yaml +14 -0
  142. package/squads/{squad-claude → claude-code-mastery}/workflows/optimization-cycle.yaml +1 -1
  143. package/squads/{squad-claude → claude-code-mastery}/workflows/project-setup-cycle.yaml +1 -1
  144. package/squads/squad-animations/agents/animations-orqx.md +53 -0
  145. package/squads/squad-animations/squad.yaml +15 -0
  146. package/squads/squad-artdir/agents/artdir-orqx.md +69 -0
  147. package/squads/squad-artdir/squad.yaml +20 -0
  148. package/squads/squad-cloning/squad.yaml +15 -0
  149. package/squads/squad-commercial/squad.yaml +17 -0
  150. package/squads/squad-copy/squad.yaml +20 -0
  151. package/squads/squad-council/squad.yaml +17 -0
  152. package/squads/squad-courses/squad.yaml +14 -0
  153. package/squads/squad-design/agents/design-orqx.md +49 -0
  154. package/squads/squad-design/squad.yaml +17 -0
  155. package/squads/squad-finance/squad.yaml +11 -0
  156. package/squads/squad-growth/agents/growth-orqx.md +59 -0
  157. package/squads/squad-growth/squad.yaml +13 -0
  158. package/squads/squad-paidmedia/squad.yaml +16 -0
  159. package/squads/squad-product/agents/product-orqx.md +58 -0
  160. package/squads/squad-product/squad.yaml +13 -0
  161. package/squads/squad-research/knowledge-base/agentic-second-brain-reference.md +2 -48
  162. package/squads/squad-research/squad.yaml +14 -0
  163. package/.claude/hooks/enforce-architecture-first.py +0 -197
  164. package/.claude/hooks/write-path-validation.py +0 -195
  165. package/.sinapse-ai/lib/build.json +0 -1
  166. package/bin/utils/pro-detector.js +0 -114
  167. package/docs/guides/agents/ANALYST-SYSTEM.md +0 -674
  168. package/docs/guides/agents/ARCHITECT-SYSTEM.md +0 -736
  169. package/docs/guides/agents/DATA-ENGINEER-SYSTEM.md +0 -802
  170. package/docs/guides/agents/DEV-SYSTEM.md +0 -580
  171. package/docs/guides/agents/DEVOPS-SYSTEM.md +0 -638
  172. package/docs/guides/agents/PM-SYSTEM.md +0 -728
  173. package/docs/guides/agents/QA-SYSTEM.md +0 -655
  174. package/docs/guides/agents/SINAPSE-AGENT-FLOWS.zip +0 -0
  175. package/docs/guides/agents/SINAPSE-MASTER-SYSTEM.md +0 -576
  176. package/docs/guides/agents/SM-SYSTEM.md +0 -496
  177. package/docs/guides/agents/SQUAD-CREATOR-SYSTEM.md +0 -699
  178. package/docs/guides/agents/UX-DESIGN-EXPERT-SYSTEM.md +0 -835
  179. package/packages/sinapse-pro-cli/bin/sinapse-pro.js +0 -233
  180. package/packages/sinapse-pro-cli/package.json +0 -36
  181. package/packages/sinapse-pro-cli/src/recover.js +0 -101
  182. package/packages/sinapse-pro-cli/tests/sinapse-pro-bin.smoke.test.js +0 -70
  183. package/squads/squad-claude/README.md +0 -84
  184. package/squads/squad-claude/agents/config-engineer.md +0 -73
  185. package/squads/squad-claude/agents/hooks-architect.md +0 -68
  186. package/squads/squad-claude/agents/mcp-integrator.md +0 -67
  187. package/squads/squad-claude/agents/project-integrator.md +0 -73
  188. package/squads/squad-claude/agents/roadmap-sentinel.md +0 -69
  189. package/squads/squad-claude/agents/skill-craftsman.md +0 -73
  190. package/squads/squad-claude/agents/swarm-orqx.md +0 -106
  191. package/squads/squad-claude/knowledge-base/obsidian-claude-integration.md +0 -423
  192. package/squads/squad-claude/preferences/README.md +0 -15
  193. package/squads/squad-claude/squad.yaml +0 -32
  194. package/squads/squad-claude/tasks/audit-settings.md +0 -72
  195. package/squads/squad-claude/tasks/audit-setup.md +0 -85
  196. package/squads/squad-claude/tasks/brownfield-setup.md +0 -77
  197. package/squads/squad-claude/tasks/ci-cd-setup.md +0 -56
  198. package/squads/squad-claude/tasks/claude-md-engineer.md +0 -58
  199. package/squads/squad-claude/tasks/context-rot-audit.md +0 -83
  200. package/squads/squad-claude/tasks/create-agent-definition.md +0 -59
  201. package/squads/squad-claude/tasks/create-rules.md +0 -55
  202. package/squads/squad-claude/tasks/create-team-topology.md +0 -72
  203. package/squads/squad-claude/tasks/diagnose.md +0 -76
  204. package/squads/squad-claude/tasks/enterprise-config.md +0 -74
  205. package/squads/squad-claude/tasks/hook-designer.md +0 -72
  206. package/squads/squad-claude/tasks/integrate-project.md +0 -73
  207. package/squads/squad-claude/tasks/mcp-integration-plan.md +0 -75
  208. package/squads/squad-claude/tasks/mcp-workflow.md +0 -75
  209. package/squads/squad-claude/tasks/multi-project-setup.md +0 -72
  210. package/squads/squad-claude/tasks/optimize-context.md +0 -75
  211. package/squads/squad-claude/tasks/optimize-workflow.md +0 -75
  212. package/squads/squad-claude/tasks/parallel-decomposition.md +0 -77
  213. package/squads/squad-claude/tasks/permission-strategy.md +0 -74
  214. package/squads/squad-claude/tasks/sandbox-setup.md +0 -75
  215. package/squads/squad-claude/tasks/setup-repository.md +0 -58
  216. package/squads/squad-claude/tasks/setup-wizard.md +0 -78
  217. package/squads/squad-claude/tasks/worktree-strategy.md +0 -77
  218. package/squads/squad-design/agents/brad-frost.md +0 -56
  219. package/squads/squad-design/agents/dan-mall.md +0 -53
  220. package/squads/squad-design/agents/dave-malouf.md +0 -53
  221. package/squads/squad-design/agents/nano-banana-generator.md +0 -42
  222. /package/squads/{squad-claude → claude-code-mastery}/agents/db-sage.md +0 -0
  223. /package/squads/{squad-claude → claude-code-mastery}/agents/tools-orqx.md +0 -0
  224. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/agent-team-patterns.md +0 -0
  225. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/claude-code-configuration-reference.md +0 -0
  226. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/claude-code-hooks-reference.md +0 -0
  227. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/claude-code-internals-deep.md +0 -0
  228. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/claude-code-tools-reference.md +0 -0
  229. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/context-engineering-guide.md +0 -0
  230. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/mcp-integration-patterns.md +0 -0
  231. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/memory-systems-reference.md +0 -0
  232. /package/squads/{squad-claude → claude-code-mastery}/knowledge-base/retrieval-augmented-generation.md +0 -0
  233. /package/squads/{squad-claude → claude-code-mastery}/tasks/agent-persona-creation.md +0 -0
  234. /package/squads/{squad-claude → claude-code-mastery}/tasks/ai-testing-automation.md +0 -0
  235. /package/squads/{squad-claude → claude-code-mastery}/tasks/audit-hooks.md +0 -0
  236. /package/squads/{squad-claude → claude-code-mastery}/tasks/automated-code-review-pipeline.md +0 -0
  237. /package/squads/{squad-claude → claude-code-mastery}/tasks/batch-processing-workflow.md +0 -0
  238. /package/squads/{squad-claude → claude-code-mastery}/tasks/chain-of-thought-optimization.md +0 -0
  239. /package/squads/{squad-claude → claude-code-mastery}/tasks/claude-code-hooks-setup.md +0 -0
  240. /package/squads/{squad-claude → claude-code-mastery}/tasks/claude-code-project-setup.md +0 -0
  241. /package/squads/{squad-claude → claude-code-mastery}/tasks/configure-settings.md +0 -0
  242. /package/squads/{squad-claude → claude-code-mastery}/tasks/content-curation-pipeline.md +0 -0
  243. /package/squads/{squad-claude → claude-code-mastery}/tasks/context-window-audit.md +0 -0
  244. /package/squads/{squad-claude → claude-code-mastery}/tasks/end-to-end-ai-workflow.md +0 -0
  245. /package/squads/{squad-claude → claude-code-mastery}/tasks/few-shot-example-library.md +0 -0
  246. /package/squads/{squad-claude → claude-code-mastery}/tasks/human-in-the-loop-design.md +0 -0
  247. /package/squads/{squad-claude → claude-code-mastery}/tasks/knowledge-base-architecture.md +0 -0
  248. /package/squads/{squad-claude → claude-code-mastery}/tasks/knowledge-retrieval-optimization.md +0 -0
  249. /package/squads/{squad-claude → claude-code-mastery}/tasks/mcp-integration-audit.md +0 -0
  250. /package/squads/{squad-claude → claude-code-mastery}/tasks/mcp-server-design.md +0 -0
  251. /package/squads/{squad-claude → claude-code-mastery}/tasks/memory-system-design.md +0 -0
  252. /package/squads/{squad-claude → claude-code-mastery}/tasks/multi-agent-orchestration.md +0 -0
  253. /package/squads/{squad-claude → claude-code-mastery}/tasks/multi-turn-conversation-design.md +0 -0
  254. /package/squads/{squad-claude → claude-code-mastery}/tasks/prompt-testing-framework.md +0 -0
  255. /package/squads/{squad-claude → claude-code-mastery}/tasks/slash-command-library-design.md +0 -0
  256. /package/squads/{squad-claude → claude-code-mastery}/tasks/system-prompt-design.md +0 -0
  257. /package/squads/{squad-claude → claude-code-mastery}/tasks/tool-orchestration-pattern.md +0 -0
@@ -1,331 +1,331 @@
1
- # =============================================================================
2
- # SINAPSE PR Automation Template
3
- # =============================================================================
4
- # Template for user projects created with SINAPSE-FULLSTACK
5
- # Generated by: *setup-github task (Story 5.10)
6
- #
7
- # Features:
8
- # - Required status checks (blocking)
9
- # - Coverage report posted as PR comment
10
- # - Quality gate summary comment
11
- # - CodeRabbit integration status
12
- # =============================================================================
13
-
14
- name: PR Automation
15
-
16
- on:
17
- pull_request:
18
- branches:
19
- - main
20
- - develop
21
- types: [opened, synchronize, reopened]
22
-
23
- permissions:
24
- contents: read
25
- pull-requests: write
26
- checks: write
27
-
28
- env:
29
- NODE_VERSION: '{{NODE_VERSION}}'
30
-
31
- jobs:
32
- # ===========================================================================
33
- # REQUIRED STATUS CHECKS (Blocking)
34
- # ===========================================================================
35
-
36
- lint:
37
- name: Lint
38
- runs-on: ubuntu-latest
39
- timeout-minutes: 5
40
- steps:
41
- - name: Checkout code
42
- uses: actions/checkout@v4
43
-
44
- - name: Setup Node.js
45
- uses: actions/setup-node@v4
46
- with:
47
- node-version: ${{ env.NODE_VERSION }}
48
- cache: 'npm'
49
-
50
- - name: Install dependencies
51
- run: npm ci
52
-
53
- - name: Run ESLint
54
- run: {{LINT_COMMAND}}
55
-
56
- typecheck:
57
- name: TypeCheck
58
- runs-on: ubuntu-latest
59
- timeout-minutes: 5
60
- steps:
61
- - name: Checkout code
62
- uses: actions/checkout@v4
63
-
64
- - name: Setup Node.js
65
- uses: actions/setup-node@v4
66
- with:
67
- node-version: ${{ env.NODE_VERSION }}
68
- cache: 'npm'
69
-
70
- - name: Install dependencies
71
- run: npm ci
72
-
73
- - name: Run TypeScript type checking
74
- run: {{TYPECHECK_COMMAND}}
75
-
76
- test:
77
- name: Test
78
- runs-on: ubuntu-latest
79
- timeout-minutes: 10
80
- outputs:
81
- coverage-summary: ${{ steps.coverage.outputs.summary }}
82
- steps:
83
- - name: Checkout code
84
- uses: actions/checkout@v4
85
-
86
- - name: Setup Node.js
87
- uses: actions/setup-node@v4
88
- with:
89
- node-version: ${{ env.NODE_VERSION }}
90
- cache: 'npm'
91
-
92
- - name: Install dependencies
93
- run: npm ci
94
-
95
- - name: Run tests with coverage
96
- id: test-run
97
- run: {{TEST_COMMAND}}
98
-
99
- - name: Upload coverage to Codecov
100
- uses: codecov/codecov-action@v4
101
- with:
102
- files: ./coverage/lcov.info
103
- flags: unittests
104
- fail_ci_if_error: false
105
-
106
- - name: Extract coverage summary
107
- id: coverage
108
- run: |
109
- if [ -f coverage/coverage-summary.json ]; then
110
- LINES=$(jq '.total.lines.pct' coverage/coverage-summary.json)
111
- STATEMENTS=$(jq '.total.statements.pct' coverage/coverage-summary.json)
112
- BRANCHES=$(jq '.total.branches.pct' coverage/coverage-summary.json)
113
- FUNCTIONS=$(jq '.total.functions.pct' coverage/coverage-summary.json)
114
- echo "summary=Lines: ${LINES}% | Statements: ${STATEMENTS}% | Branches: ${BRANCHES}% | Functions: ${FUNCTIONS}%" >> $GITHUB_OUTPUT
115
- else
116
- echo "summary=Coverage report not available" >> $GITHUB_OUTPUT
117
- fi
118
-
119
- - name: Upload coverage artifact
120
- uses: actions/upload-artifact@v4
121
- with:
122
- name: coverage-report
123
- path: coverage/
124
- retention-days: 7
125
-
126
- # ===========================================================================
127
- # COVERAGE COMMENT
128
- # ===========================================================================
129
-
130
- coverage-comment:
131
- name: Coverage Comment
132
- runs-on: ubuntu-latest
133
- needs: [test]
134
- if: always() && needs.test.result != 'cancelled'
135
- steps:
136
- - name: Post coverage comment
137
- uses: actions/github-script@v7
138
- with:
139
- script: |
140
- const coverageSummary = '${{ needs.test.outputs.coverage-summary }}' || 'Coverage data not available';
141
-
142
- const body = `## 📊 Coverage Report
143
-
144
- ${coverageSummary}
145
-
146
- <details>
147
- <summary>Coverage Details</summary>
148
-
149
- | Metric | Coverage |
150
- |--------|----------|
151
- | Lines | See Codecov |
152
- | Branches | See Codecov |
153
- | Functions | See Codecov |
154
- | Statements | See Codecov |
155
-
156
- </details>
157
-
158
- > 📈 Full coverage report available in [Codecov](https://codecov.io/gh/${{ github.repository }}/pull/${{ github.event.pull_request.number }})
159
- `;
160
-
161
- // Find existing comment
162
- const { data: comments } = await github.rest.issues.listComments({
163
- owner: context.repo.owner,
164
- repo: context.repo.repo,
165
- issue_number: context.issue.number,
166
- });
167
-
168
- const botComment = comments.find(comment =>
169
- comment.user.type === 'Bot' &&
170
- comment.body.includes('📊 Coverage Report')
171
- );
172
-
173
- if (botComment) {
174
- await github.rest.issues.updateComment({
175
- owner: context.repo.owner,
176
- repo: context.repo.repo,
177
- comment_id: botComment.id,
178
- body: body
179
- });
180
- } else {
181
- await github.rest.issues.createComment({
182
- owner: context.repo.owner,
183
- repo: context.repo.repo,
184
- issue_number: context.issue.number,
185
- body: body
186
- });
187
- }
188
-
189
- # ===========================================================================
190
- # QUALITY SUMMARY
191
- # ===========================================================================
192
-
193
- quality-summary:
194
- name: Quality Summary
195
- runs-on: ubuntu-latest
196
- needs: [lint, typecheck, test]
197
- if: always()
198
- steps:
199
- - name: Generate quality summary
200
- uses: actions/github-script@v7
201
- with:
202
- script: |
203
- const lintResult = '${{ needs.lint.result }}';
204
- const typecheckResult = '${{ needs.typecheck.result }}';
205
- const testResult = '${{ needs.test.result }}';
206
-
207
- const getEmoji = (result) => {
208
- switch(result) {
209
- case 'success': return '✅';
210
- case 'failure': return '❌';
211
- case 'cancelled': return '⏹️';
212
- case 'skipped': return '⏭️';
213
- default: return '⏳';
214
- }
215
- };
216
-
217
- const allPassed = lintResult === 'success' &&
218
- typecheckResult === 'success' &&
219
- testResult === 'success';
220
-
221
- const overallStatus = allPassed ? '✅ All checks passed' : '❌ Some checks failed';
222
-
223
- const body = `## 📋 Quality Gate Summary
224
-
225
- **Overall Status:** ${overallStatus}
226
-
227
- | Check | Status | Result |
228
- |-------|--------|--------|
229
- | Lint | ${getEmoji(lintResult)} | ${lintResult} |
230
- | TypeCheck | ${getEmoji(typecheckResult)} | ${typecheckResult} |
231
- | Tests | ${getEmoji(testResult)} | ${testResult} |
232
-
233
- ### Required for Merge
234
- - ${getEmoji(lintResult)} ESLint validation
235
- - ${getEmoji(typecheckResult)} TypeScript type checking
236
- - ${getEmoji(testResult)} Test suite passing
237
-
238
- ### CodeRabbit Review
239
- 🐰 CodeRabbit will provide automated code review comments separately.
240
- - **CRITICAL** issues must be resolved before merge
241
- - **HIGH** issues should be addressed or documented
242
-
243
- ---
244
- *Generated by SINAPSE PR Automation*
245
- `;
246
-
247
- // Find existing comment
248
- const { data: comments } = await github.rest.issues.listComments({
249
- owner: context.repo.owner,
250
- repo: context.repo.repo,
251
- issue_number: context.issue.number,
252
- });
253
-
254
- const botComment = comments.find(comment =>
255
- comment.user.type === 'Bot' &&
256
- comment.body.includes('📋 Quality Gate Summary')
257
- );
258
-
259
- if (botComment) {
260
- await github.rest.issues.updateComment({
261
- owner: context.repo.owner,
262
- repo: context.repo.repo,
263
- comment_id: botComment.id,
264
- body: body
265
- });
266
- } else {
267
- await github.rest.issues.createComment({
268
- owner: context.repo.owner,
269
- repo: context.repo.repo,
270
- issue_number: context.issue.number,
271
- body: body
272
- });
273
- }
274
-
275
- - name: Set final status
276
- if: always()
277
- run: |
278
- LINT="${{ needs.lint.result }}"
279
- TYPE="${{ needs.typecheck.result }}"
280
- TEST="${{ needs.test.result }}"
281
-
282
- echo "=== PR Quality Gate Summary ==="
283
- echo "Lint: $LINT"
284
- echo "TypeCheck: $TYPE"
285
- echo "Tests: $TEST"
286
-
287
- if [ "$LINT" != "success" ] || [ "$TYPE" != "success" ] || [ "$TEST" != "success" ]; then
288
- echo "❌ Quality gate failed - merge will be blocked"
289
- exit 1
290
- fi
291
-
292
- echo "✅ All quality gates passed - ready for review"
293
-
294
- # ===========================================================================
295
- # CODERABBIT STATUS CHECK
296
- # ===========================================================================
297
-
298
- coderabbit-check:
299
- name: CodeRabbit Status
300
- runs-on: ubuntu-latest
301
- needs: [lint, typecheck, test]
302
- if: always()
303
- steps:
304
- - name: Check CodeRabbit configuration
305
- run: |
306
- echo "🐰 CodeRabbit Integration Status"
307
- echo "================================"
308
- echo ""
309
- echo "CodeRabbit is configured via .coderabbit.yaml"
310
- echo "Review will be posted as PR comments automatically"
311
- echo ""
312
- echo "Severity Handling:"
313
- echo " - CRITICAL: Must fix before merge"
314
- echo " - HIGH: Should address or document"
315
- echo " - MEDIUM/LOW: Optional"
316
-
317
- - name: Checkout for config check
318
- uses: actions/checkout@v4
319
- with:
320
- sparse-checkout: .coderabbit.yaml
321
- sparse-checkout-cone-mode: false
322
-
323
- - name: Validate config
324
- run: |
325
- if [ -f ".coderabbit.yaml" ]; then
326
- echo "✅ CodeRabbit configuration found"
327
- else
328
- echo "⚠️ CodeRabbit configuration not found"
329
- echo "Create .coderabbit.yaml to customize review behavior"
330
- fi
331
-
1
+ # =============================================================================
2
+ # SINAPSE PR Automation Template
3
+ # =============================================================================
4
+ # Template for user projects created with SINAPSE-FULLSTACK
5
+ # Generated by: *setup-github task (Story 5.10)
6
+ #
7
+ # Features:
8
+ # - Required status checks (blocking)
9
+ # - Coverage report posted as PR comment
10
+ # - Quality gate summary comment
11
+ # - CodeRabbit integration status
12
+ # =============================================================================
13
+
14
+ name: PR Automation
15
+
16
+ on:
17
+ pull_request:
18
+ branches:
19
+ - main
20
+ - develop
21
+ types: [opened, synchronize, reopened]
22
+
23
+ permissions:
24
+ contents: read
25
+ pull-requests: write
26
+ checks: write
27
+
28
+ env:
29
+ NODE_VERSION: '{{NODE_VERSION}}'
30
+
31
+ jobs:
32
+ # ===========================================================================
33
+ # REQUIRED STATUS CHECKS (Blocking)
34
+ # ===========================================================================
35
+
36
+ lint:
37
+ name: Lint
38
+ runs-on: ubuntu-latest
39
+ timeout-minutes: 5
40
+ steps:
41
+ - name: Checkout code
42
+ uses: actions/checkout@v4
43
+
44
+ - name: Setup Node.js
45
+ uses: actions/setup-node@v4
46
+ with:
47
+ node-version: ${{ env.NODE_VERSION }}
48
+ cache: 'npm'
49
+
50
+ - name: Install dependencies
51
+ run: npm ci
52
+
53
+ - name: Run ESLint
54
+ run: {{LINT_COMMAND}}
55
+
56
+ typecheck:
57
+ name: TypeCheck
58
+ runs-on: ubuntu-latest
59
+ timeout-minutes: 5
60
+ steps:
61
+ - name: Checkout code
62
+ uses: actions/checkout@v4
63
+
64
+ - name: Setup Node.js
65
+ uses: actions/setup-node@v4
66
+ with:
67
+ node-version: ${{ env.NODE_VERSION }}
68
+ cache: 'npm'
69
+
70
+ - name: Install dependencies
71
+ run: npm ci
72
+
73
+ - name: Run TypeScript type checking
74
+ run: {{TYPECHECK_COMMAND}}
75
+
76
+ test:
77
+ name: Test
78
+ runs-on: ubuntu-latest
79
+ timeout-minutes: 10
80
+ outputs:
81
+ coverage-summary: ${{ steps.coverage.outputs.summary }}
82
+ steps:
83
+ - name: Checkout code
84
+ uses: actions/checkout@v4
85
+
86
+ - name: Setup Node.js
87
+ uses: actions/setup-node@v4
88
+ with:
89
+ node-version: ${{ env.NODE_VERSION }}
90
+ cache: 'npm'
91
+
92
+ - name: Install dependencies
93
+ run: npm ci
94
+
95
+ - name: Run tests with coverage
96
+ id: test-run
97
+ run: {{TEST_COMMAND}}
98
+
99
+ - name: Upload coverage to Codecov
100
+ uses: codecov/codecov-action@v4
101
+ with:
102
+ files: ./coverage/lcov.info
103
+ flags: unittests
104
+ fail_ci_if_error: false
105
+
106
+ - name: Extract coverage summary
107
+ id: coverage
108
+ run: |
109
+ if [ -f coverage/coverage-summary.json ]; then
110
+ LINES=$(jq '.total.lines.pct' coverage/coverage-summary.json)
111
+ STATEMENTS=$(jq '.total.statements.pct' coverage/coverage-summary.json)
112
+ BRANCHES=$(jq '.total.branches.pct' coverage/coverage-summary.json)
113
+ FUNCTIONS=$(jq '.total.functions.pct' coverage/coverage-summary.json)
114
+ echo "summary=Lines: ${LINES}% | Statements: ${STATEMENTS}% | Branches: ${BRANCHES}% | Functions: ${FUNCTIONS}%" >> $GITHUB_OUTPUT
115
+ else
116
+ echo "summary=Coverage report not available" >> $GITHUB_OUTPUT
117
+ fi
118
+
119
+ - name: Upload coverage artifact
120
+ uses: actions/upload-artifact@v4
121
+ with:
122
+ name: coverage-report
123
+ path: coverage/
124
+ retention-days: 7
125
+
126
+ # ===========================================================================
127
+ # COVERAGE COMMENT
128
+ # ===========================================================================
129
+
130
+ coverage-comment:
131
+ name: Coverage Comment
132
+ runs-on: ubuntu-latest
133
+ needs: [test]
134
+ if: always() && needs.test.result != 'cancelled'
135
+ steps:
136
+ - name: Post coverage comment
137
+ uses: actions/github-script@v7
138
+ with:
139
+ script: |
140
+ const coverageSummary = '${{ needs.test.outputs.coverage-summary }}' || 'Coverage data not available';
141
+
142
+ const body = `## 📊 Coverage Report
143
+
144
+ ${coverageSummary}
145
+
146
+ <details>
147
+ <summary>Coverage Details</summary>
148
+
149
+ | Metric | Coverage |
150
+ |--------|----------|
151
+ | Lines | See Codecov |
152
+ | Branches | See Codecov |
153
+ | Functions | See Codecov |
154
+ | Statements | See Codecov |
155
+
156
+ </details>
157
+
158
+ > 📈 Full coverage report available in [Codecov](https://codecov.io/gh/${{ github.repository }}/pull/${{ github.event.pull_request.number }})
159
+ `;
160
+
161
+ // Find existing comment
162
+ const { data: comments } = await github.rest.issues.listComments({
163
+ owner: context.repo.owner,
164
+ repo: context.repo.repo,
165
+ issue_number: context.issue.number,
166
+ });
167
+
168
+ const botComment = comments.find(comment =>
169
+ comment.user.type === 'Bot' &&
170
+ comment.body.includes('📊 Coverage Report')
171
+ );
172
+
173
+ if (botComment) {
174
+ await github.rest.issues.updateComment({
175
+ owner: context.repo.owner,
176
+ repo: context.repo.repo,
177
+ comment_id: botComment.id,
178
+ body: body
179
+ });
180
+ } else {
181
+ await github.rest.issues.createComment({
182
+ owner: context.repo.owner,
183
+ repo: context.repo.repo,
184
+ issue_number: context.issue.number,
185
+ body: body
186
+ });
187
+ }
188
+
189
+ # ===========================================================================
190
+ # QUALITY SUMMARY
191
+ # ===========================================================================
192
+
193
+ quality-summary:
194
+ name: Quality Summary
195
+ runs-on: ubuntu-latest
196
+ needs: [lint, typecheck, test]
197
+ if: always()
198
+ steps:
199
+ - name: Generate quality summary
200
+ uses: actions/github-script@v7
201
+ with:
202
+ script: |
203
+ const lintResult = '${{ needs.lint.result }}';
204
+ const typecheckResult = '${{ needs.typecheck.result }}';
205
+ const testResult = '${{ needs.test.result }}';
206
+
207
+ const getEmoji = (result) => {
208
+ switch(result) {
209
+ case 'success': return '✅';
210
+ case 'failure': return '❌';
211
+ case 'cancelled': return '⏹️';
212
+ case 'skipped': return '⏭️';
213
+ default: return '⏳';
214
+ }
215
+ };
216
+
217
+ const allPassed = lintResult === 'success' &&
218
+ typecheckResult === 'success' &&
219
+ testResult === 'success';
220
+
221
+ const overallStatus = allPassed ? '✅ All checks passed' : '❌ Some checks failed';
222
+
223
+ const body = `## 📋 Quality Gate Summary
224
+
225
+ **Overall Status:** ${overallStatus}
226
+
227
+ | Check | Status | Result |
228
+ |-------|--------|--------|
229
+ | Lint | ${getEmoji(lintResult)} | ${lintResult} |
230
+ | TypeCheck | ${getEmoji(typecheckResult)} | ${typecheckResult} |
231
+ | Tests | ${getEmoji(testResult)} | ${testResult} |
232
+
233
+ ### Required for Merge
234
+ - ${getEmoji(lintResult)} ESLint validation
235
+ - ${getEmoji(typecheckResult)} TypeScript type checking
236
+ - ${getEmoji(testResult)} Test suite passing
237
+
238
+ ### CodeRabbit Review
239
+ 🐰 CodeRabbit will provide automated code review comments separately.
240
+ - **CRITICAL** issues must be resolved before merge
241
+ - **HIGH** issues should be addressed or documented
242
+
243
+ ---
244
+ *Generated by SINAPSE PR Automation*
245
+ `;
246
+
247
+ // Find existing comment
248
+ const { data: comments } = await github.rest.issues.listComments({
249
+ owner: context.repo.owner,
250
+ repo: context.repo.repo,
251
+ issue_number: context.issue.number,
252
+ });
253
+
254
+ const botComment = comments.find(comment =>
255
+ comment.user.type === 'Bot' &&
256
+ comment.body.includes('📋 Quality Gate Summary')
257
+ );
258
+
259
+ if (botComment) {
260
+ await github.rest.issues.updateComment({
261
+ owner: context.repo.owner,
262
+ repo: context.repo.repo,
263
+ comment_id: botComment.id,
264
+ body: body
265
+ });
266
+ } else {
267
+ await github.rest.issues.createComment({
268
+ owner: context.repo.owner,
269
+ repo: context.repo.repo,
270
+ issue_number: context.issue.number,
271
+ body: body
272
+ });
273
+ }
274
+
275
+ - name: Set final status
276
+ if: always()
277
+ run: |
278
+ LINT="${{ needs.lint.result }}"
279
+ TYPE="${{ needs.typecheck.result }}"
280
+ TEST="${{ needs.test.result }}"
281
+
282
+ echo "=== PR Quality Gate Summary ==="
283
+ echo "Lint: $LINT"
284
+ echo "TypeCheck: $TYPE"
285
+ echo "Tests: $TEST"
286
+
287
+ if [ "$LINT" != "success" ] || [ "$TYPE" != "success" ] || [ "$TEST" != "success" ]; then
288
+ echo "❌ Quality gate failed - merge will be blocked"
289
+ exit 1
290
+ fi
291
+
292
+ echo "✅ All quality gates passed - ready for review"
293
+
294
+ # ===========================================================================
295
+ # CODERABBIT STATUS CHECK
296
+ # ===========================================================================
297
+
298
+ coderabbit-check:
299
+ name: CodeRabbit Status
300
+ runs-on: ubuntu-latest
301
+ needs: [lint, typecheck, test]
302
+ if: always()
303
+ steps:
304
+ - name: Check CodeRabbit configuration
305
+ run: |
306
+ echo "🐰 CodeRabbit Integration Status"
307
+ echo "================================"
308
+ echo ""
309
+ echo "CodeRabbit is configured via .coderabbit.yaml"
310
+ echo "Review will be posted as PR comments automatically"
311
+ echo ""
312
+ echo "Severity Handling:"
313
+ echo " - CRITICAL: Must fix before merge"
314
+ echo " - HIGH: Should address or document"
315
+ echo " - MEDIUM/LOW: Optional"
316
+
317
+ - name: Checkout for config check
318
+ uses: actions/checkout@v4
319
+ with:
320
+ sparse-checkout: .coderabbit.yaml
321
+ sparse-checkout-cone-mode: false
322
+
323
+ - name: Validate config
324
+ run: |
325
+ if [ -f ".coderabbit.yaml" ]; then
326
+ echo "✅ CodeRabbit configuration found"
327
+ else
328
+ echo "⚠️ CodeRabbit configuration not found"
329
+ echo "Create .coderabbit.yaml to customize review behavior"
330
+ fi
331
+