@devran-ai/kit 4.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 (231) hide show
  1. package/.agent/CheatSheet.md +350 -0
  2. package/.agent/README.md +76 -0
  3. package/.agent/agents/README.md +155 -0
  4. package/.agent/agents/architect.md +185 -0
  5. package/.agent/agents/backend-specialist.md +276 -0
  6. package/.agent/agents/build-error-resolver.md +207 -0
  7. package/.agent/agents/code-reviewer.md +162 -0
  8. package/.agent/agents/database-architect.md +138 -0
  9. package/.agent/agents/devops-engineer.md +144 -0
  10. package/.agent/agents/doc-updater.md +229 -0
  11. package/.agent/agents/e2e-runner.md +145 -0
  12. package/.agent/agents/explorer-agent.md +143 -0
  13. package/.agent/agents/frontend-specialist.md +144 -0
  14. package/.agent/agents/go-reviewer.md +128 -0
  15. package/.agent/agents/knowledge-agent.md +197 -0
  16. package/.agent/agents/mobile-developer.md +150 -0
  17. package/.agent/agents/performance-optimizer.md +175 -0
  18. package/.agent/agents/planner.md +133 -0
  19. package/.agent/agents/pr-reviewer.md +148 -0
  20. package/.agent/agents/python-reviewer.md +123 -0
  21. package/.agent/agents/refactor-cleaner.md +201 -0
  22. package/.agent/agents/reliability-engineer.md +156 -0
  23. package/.agent/agents/security-reviewer.md +141 -0
  24. package/.agent/agents/sprint-orchestrator.md +124 -0
  25. package/.agent/agents/tdd-guide.md +179 -0
  26. package/.agent/agents/typescript-reviewer.md +110 -0
  27. package/.agent/checklists/README.md +102 -0
  28. package/.agent/checklists/pre-commit.md +93 -0
  29. package/.agent/checklists/session-end.md +99 -0
  30. package/.agent/checklists/session-start.md +102 -0
  31. package/.agent/checklists/task-complete.md +81 -0
  32. package/.agent/commands/README.md +130 -0
  33. package/.agent/commands/adr.md +29 -0
  34. package/.agent/commands/ask.md +28 -0
  35. package/.agent/commands/build.md +30 -0
  36. package/.agent/commands/changelog.md +40 -0
  37. package/.agent/commands/checkpoint.md +28 -0
  38. package/.agent/commands/code-review.md +65 -0
  39. package/.agent/commands/compact.md +28 -0
  40. package/.agent/commands/cook.md +30 -0
  41. package/.agent/commands/db.md +30 -0
  42. package/.agent/commands/debug.md +31 -0
  43. package/.agent/commands/deploy.md +37 -0
  44. package/.agent/commands/design.md +29 -0
  45. package/.agent/commands/doc.md +30 -0
  46. package/.agent/commands/eval.md +30 -0
  47. package/.agent/commands/fix.md +32 -0
  48. package/.agent/commands/git.md +32 -0
  49. package/.agent/commands/help.md +273 -0
  50. package/.agent/commands/implement.md +30 -0
  51. package/.agent/commands/integrate.md +32 -0
  52. package/.agent/commands/learn.md +29 -0
  53. package/.agent/commands/perf.md +31 -0
  54. package/.agent/commands/plan.md +56 -0
  55. package/.agent/commands/pr-describe.md +65 -0
  56. package/.agent/commands/pr-fix.md +45 -0
  57. package/.agent/commands/pr-merge.md +45 -0
  58. package/.agent/commands/pr-review.md +50 -0
  59. package/.agent/commands/pr-split.md +54 -0
  60. package/.agent/commands/pr-status.md +56 -0
  61. package/.agent/commands/pr.md +58 -0
  62. package/.agent/commands/refactor.md +32 -0
  63. package/.agent/commands/research.md +28 -0
  64. package/.agent/commands/scout.md +30 -0
  65. package/.agent/commands/security-scan.md +33 -0
  66. package/.agent/commands/setup.md +31 -0
  67. package/.agent/commands/status.md +59 -0
  68. package/.agent/commands/tdd.md +73 -0
  69. package/.agent/commands/verify.md +58 -0
  70. package/.agent/contexts/brainstorm.md +26 -0
  71. package/.agent/contexts/debug.md +28 -0
  72. package/.agent/contexts/implement.md +29 -0
  73. package/.agent/contexts/plan-quality-log.md +30 -0
  74. package/.agent/contexts/review.md +27 -0
  75. package/.agent/contexts/ship.md +28 -0
  76. package/.agent/decisions/001-trust-grade-governance.md +46 -0
  77. package/.agent/decisions/002-cross-ide-generation.md +15 -0
  78. package/.agent/engine/identity.json +4 -0
  79. package/.agent/engine/loading-rules.json +193 -0
  80. package/.agent/engine/marketplace-index.json +29 -0
  81. package/.agent/engine/mcp-servers/filesystem.json +9 -0
  82. package/.agent/engine/mcp-servers/github.json +11 -0
  83. package/.agent/engine/mcp-servers/postgres.json +11 -0
  84. package/.agent/engine/mcp-servers/supabase.json +11 -0
  85. package/.agent/engine/mcp-servers/vercel.json +11 -0
  86. package/.agent/engine/reliability-config.json +14 -0
  87. package/.agent/engine/sdlc-map.json +50 -0
  88. package/.agent/engine/workflow-state.json +167 -0
  89. package/.agent/hooks/README.md +101 -0
  90. package/.agent/hooks/hooks.json +104 -0
  91. package/.agent/hooks/templates/session-end.md +110 -0
  92. package/.agent/hooks/templates/session-start.md +95 -0
  93. package/.agent/manifest.json +466 -0
  94. package/.agent/rules/agent-upgrade-policy.md +56 -0
  95. package/.agent/rules/architecture.md +111 -0
  96. package/.agent/rules/coding-style.md +75 -0
  97. package/.agent/rules/documentation.md +74 -0
  98. package/.agent/rules/git-workflow.md +140 -0
  99. package/.agent/rules/quality-gate.md +117 -0
  100. package/.agent/rules/security.md +67 -0
  101. package/.agent/rules/sprint-tracking.md +103 -0
  102. package/.agent/rules/testing.md +80 -0
  103. package/.agent/rules/workflow-standards.md +30 -0
  104. package/.agent/rules.md +293 -0
  105. package/.agent/session-context.md +69 -0
  106. package/.agent/session-state.json +27 -0
  107. package/.agent/skills/README.md +135 -0
  108. package/.agent/skills/api-patterns/SKILL.md +117 -0
  109. package/.agent/skills/app-builder/SKILL.md +202 -0
  110. package/.agent/skills/architecture/SKILL.md +101 -0
  111. package/.agent/skills/behavioral-modes/SKILL.md +295 -0
  112. package/.agent/skills/brainstorming/SKILL.md +156 -0
  113. package/.agent/skills/clean-code/SKILL.md +142 -0
  114. package/.agent/skills/context-budget/SKILL.md +78 -0
  115. package/.agent/skills/continuous-learning/SKILL.md +145 -0
  116. package/.agent/skills/database-design/SKILL.md +303 -0
  117. package/.agent/skills/debugging-strategies/SKILL.md +158 -0
  118. package/.agent/skills/deployment-procedures/SKILL.md +191 -0
  119. package/.agent/skills/docker-patterns/SKILL.md +161 -0
  120. package/.agent/skills/eval-harness/SKILL.md +89 -0
  121. package/.agent/skills/frontend-patterns/SKILL.md +141 -0
  122. package/.agent/skills/git-workflow/SKILL.md +159 -0
  123. package/.agent/skills/i18n-localization/SKILL.md +191 -0
  124. package/.agent/skills/intelligent-routing/SKILL.md +180 -0
  125. package/.agent/skills/mcp-integration/SKILL.md +240 -0
  126. package/.agent/skills/mobile-design/SKILL.md +191 -0
  127. package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
  128. package/.agent/skills/parallel-agents/SKILL.md +200 -0
  129. package/.agent/skills/performance-profiling/SKILL.md +134 -0
  130. package/.agent/skills/plan-validation/SKILL.md +192 -0
  131. package/.agent/skills/plan-writing/SKILL.md +183 -0
  132. package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
  133. package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
  134. package/.agent/skills/plan-writing/plan-schema.md +119 -0
  135. package/.agent/skills/pr-toolkit/SKILL.md +174 -0
  136. package/.agent/skills/production-readiness/SKILL.md +126 -0
  137. package/.agent/skills/security-practices/SKILL.md +109 -0
  138. package/.agent/skills/shell-conventions/SKILL.md +92 -0
  139. package/.agent/skills/strategic-compact/SKILL.md +62 -0
  140. package/.agent/skills/testing-patterns/SKILL.md +141 -0
  141. package/.agent/skills/typescript-expert/SKILL.md +160 -0
  142. package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
  143. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  144. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  145. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  146. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  147. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  148. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  149. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  150. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  151. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  152. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  153. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  154. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  155. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  156. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  157. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  158. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  159. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  160. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  161. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  162. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  163. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  164. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  165. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  166. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  167. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  168. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  169. package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
  170. package/.agent/skills/verification-loop/SKILL.md +89 -0
  171. package/.agent/skills/webapp-testing/SKILL.md +175 -0
  172. package/.agent/templates/adr-template.md +32 -0
  173. package/.agent/templates/bug-report.md +37 -0
  174. package/.agent/templates/feature-request.md +32 -0
  175. package/.agent/workflows/README.md +101 -0
  176. package/.agent/workflows/brainstorm.md +86 -0
  177. package/.agent/workflows/create.md +85 -0
  178. package/.agent/workflows/debug.md +83 -0
  179. package/.agent/workflows/deploy.md +114 -0
  180. package/.agent/workflows/enhance.md +85 -0
  181. package/.agent/workflows/orchestrate.md +106 -0
  182. package/.agent/workflows/plan.md +105 -0
  183. package/.agent/workflows/pr-fix.md +163 -0
  184. package/.agent/workflows/pr-merge.md +117 -0
  185. package/.agent/workflows/pr-review.md +178 -0
  186. package/.agent/workflows/pr-split.md +118 -0
  187. package/.agent/workflows/pr.md +184 -0
  188. package/.agent/workflows/preflight.md +107 -0
  189. package/.agent/workflows/preview.md +95 -0
  190. package/.agent/workflows/quality-gate.md +103 -0
  191. package/.agent/workflows/retrospective.md +100 -0
  192. package/.agent/workflows/review.md +104 -0
  193. package/.agent/workflows/status.md +89 -0
  194. package/.agent/workflows/test.md +98 -0
  195. package/.agent/workflows/ui-ux-pro-max.md +93 -0
  196. package/.agent/workflows/upgrade.md +97 -0
  197. package/LICENSE +21 -0
  198. package/README.md +218 -0
  199. package/bin/kit.js +773 -0
  200. package/lib/agent-registry.js +228 -0
  201. package/lib/agent-reputation.js +343 -0
  202. package/lib/circuit-breaker.js +195 -0
  203. package/lib/cli-commands.js +322 -0
  204. package/lib/config-validator.js +274 -0
  205. package/lib/conflict-detector.js +252 -0
  206. package/lib/constants.js +47 -0
  207. package/lib/engineering-manager.js +336 -0
  208. package/lib/error-budget.js +370 -0
  209. package/lib/hook-system.js +256 -0
  210. package/lib/ide-generator.js +434 -0
  211. package/lib/identity.js +240 -0
  212. package/lib/io.js +146 -0
  213. package/lib/learning-engine.js +163 -0
  214. package/lib/loading-engine.js +421 -0
  215. package/lib/logger.js +118 -0
  216. package/lib/marketplace.js +321 -0
  217. package/lib/plugin-system.js +604 -0
  218. package/lib/plugin-verifier.js +197 -0
  219. package/lib/rate-limiter.js +113 -0
  220. package/lib/security-scanner.js +312 -0
  221. package/lib/self-healing.js +468 -0
  222. package/lib/session-manager.js +264 -0
  223. package/lib/skill-sandbox.js +244 -0
  224. package/lib/task-governance.js +522 -0
  225. package/lib/task-model.js +332 -0
  226. package/lib/updater.js +240 -0
  227. package/lib/verify.js +279 -0
  228. package/lib/workflow-engine.js +373 -0
  229. package/lib/workflow-events.js +166 -0
  230. package/lib/workflow-persistence.js +160 -0
  231. package/package.json +57 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "github",
3
+ "description": "GitHub API — issues, PRs, repos, code search",
4
+ "transport": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@modelcontextprotocol/server-github"],
7
+ "env": {
8
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
9
+ },
10
+ "capabilities": ["issues", "pull-requests", "repos", "code-search"]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "postgres",
3
+ "description": "PostgreSQL — query execution, schema inspection, migrations",
4
+ "transport": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@modelcontextprotocol/server-postgres"],
7
+ "env": {
8
+ "DATABASE_URL": "${DATABASE_URL}"
9
+ },
10
+ "capabilities": ["query", "schema-inspect", "migrations"]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "supabase",
3
+ "description": "Supabase — database, auth, storage, edge functions",
4
+ "transport": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@supabase/mcp-server-supabase"],
7
+ "env": {
8
+ "SUPABASE_ACCESS_TOKEN": "${SUPABASE_ACCESS_TOKEN}"
9
+ },
10
+ "capabilities": ["database", "auth", "storage", "edge-functions"]
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "vercel",
3
+ "description": "Vercel — deployments, domains, environment variables",
4
+ "transport": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@vercel/mcp"],
7
+ "env": {
8
+ "VERCEL_TOKEN": "${VERCEL_TOKEN}"
9
+ },
10
+ "capabilities": ["deployments", "domains", "env-vars", "logs"]
11
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "description": "SRE reliability configuration — error budget tracking and operational thresholds",
4
+ "errorBudget": {
5
+ "enabled": true,
6
+ "description": "When error budget is exhausted, reliability work takes priority over feature work. Projects opt-in when monitoring infrastructure exists.",
7
+ "thresholds": {
8
+ "testFailureRatePercent": 5,
9
+ "buildFailureRatePercent": 2,
10
+ "deployRollbackRatePercent": 10
11
+ },
12
+ "resetCadence": "monthly"
13
+ }
14
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "description": "Machine-readable SDLC phase-to-workflow mapping with bidirectional traversal",
4
+ "phases": {
5
+ "discover": {
6
+ "description": "Requirement exploration and validation",
7
+ "workflows": ["brainstorm", "quality-gate"],
8
+ "previous": null,
9
+ "next": "plan"
10
+ },
11
+ "plan": {
12
+ "description": "Structured implementation planning",
13
+ "workflows": ["plan"],
14
+ "previous": "discover",
15
+ "next": "build"
16
+ },
17
+ "build": {
18
+ "description": "Feature implementation and scaffolding",
19
+ "workflows": ["create", "enhance", "preview", "ui-ux-pro-max"],
20
+ "previous": "plan",
21
+ "next": "verify"
22
+ },
23
+ "verify": {
24
+ "description": "Testing and quality gate validation",
25
+ "workflows": ["test", "review"],
26
+ "previous": "build",
27
+ "next": "checkpoint"
28
+ },
29
+ "checkpoint": {
30
+ "description": "Developer decision gate with intelligence-driven recommendations",
31
+ "workflows": [],
32
+ "previous": "verify",
33
+ "next": "ship"
34
+ },
35
+ "ship": {
36
+ "description": "Production deployment with pre-flight checks",
37
+ "workflows": ["deploy"],
38
+ "previous": "checkpoint",
39
+ "next": "evaluate"
40
+ },
41
+ "evaluate": {
42
+ "description": "Post-sprint retrospective audit",
43
+ "workflows": ["retrospective"],
44
+ "previous": "ship",
45
+ "next": "discover"
46
+ }
47
+ },
48
+ "reactive": ["debug", "orchestrate"],
49
+ "crossCutting": ["status"]
50
+ }
@@ -0,0 +1,167 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "currentPhase": "IDLE",
4
+ "startedAt": null,
5
+ "phases": {
6
+ "EXPLORE": {
7
+ "status": "pending",
8
+ "description": "Codebase discovery and requirement analysis",
9
+ "agent": "explorer-agent",
10
+ "artifact": null,
11
+ "startedAt": null,
12
+ "completedAt": null
13
+ },
14
+ "PLAN": {
15
+ "status": "pending",
16
+ "description": "Structured task breakdown with Socratic gate",
17
+ "agent": "planner",
18
+ "artifact": null,
19
+ "startedAt": null,
20
+ "completedAt": null,
21
+ "requiresApproval": true
22
+ },
23
+ "IMPLEMENT": {
24
+ "status": "pending",
25
+ "description": "Code implementation following the approved plan",
26
+ "agent": null,
27
+ "artifact": null,
28
+ "startedAt": null,
29
+ "completedAt": null
30
+ },
31
+ "VERIFY": {
32
+ "status": "pending",
33
+ "description": "Quality gates, tests, and build verification",
34
+ "agent": "tdd-guide",
35
+ "skill": "verification-loop",
36
+ "artifact": null,
37
+ "startedAt": null,
38
+ "completedAt": null
39
+ },
40
+ "CHECKPOINT": {
41
+ "status": "pending",
42
+ "description": "Developer decision gate — presents completion options before commit/push",
43
+ "checklist": "checklists/task-complete.md",
44
+ "artifact": null,
45
+ "startedAt": null,
46
+ "completedAt": null,
47
+ "requiresApproval": true
48
+ },
49
+ "REVIEW": {
50
+ "status": "pending",
51
+ "description": "Code review and security audit",
52
+ "agent": "code-reviewer",
53
+ "artifact": null,
54
+ "startedAt": null,
55
+ "completedAt": null
56
+ },
57
+ "DEPLOY": {
58
+ "status": "pending",
59
+ "description": "Production deployment with pre-flight checks",
60
+ "workflow": "deploy",
61
+ "artifact": null,
62
+ "startedAt": null,
63
+ "completedAt": null
64
+ },
65
+ "MAINTAIN": {
66
+ "status": "pending",
67
+ "description": "Post-deploy monitoring and operational handoff",
68
+ "workflow": "status",
69
+ "artifact": null,
70
+ "startedAt": null,
71
+ "completedAt": null
72
+ }
73
+ },
74
+ "transitions": [
75
+ {
76
+ "from": "IDLE",
77
+ "to": "EXPLORE",
78
+ "trigger": "New task started",
79
+ "guard": "No active workflow in progress"
80
+ },
81
+ {
82
+ "from": "IDLE",
83
+ "to": "PLAN",
84
+ "trigger": "Task with known requirements",
85
+ "guard": "Requirements are clear"
86
+ },
87
+ {
88
+ "from": "EXPLORE",
89
+ "to": "PLAN",
90
+ "trigger": "Discovery complete",
91
+ "guard": "Exploration artifact exists"
92
+ },
93
+ {
94
+ "from": "PLAN",
95
+ "to": "IMPLEMENT",
96
+ "trigger": "Plan approved",
97
+ "guard": "Plan approved by user (explicit yes/approval)"
98
+ },
99
+ {
100
+ "from": "IMPLEMENT",
101
+ "to": "VERIFY",
102
+ "trigger": "Implementation complete",
103
+ "guard": "All plan items marked complete"
104
+ },
105
+ {
106
+ "from": "VERIFY",
107
+ "to": "CHECKPOINT",
108
+ "trigger": "Quality gates pass",
109
+ "guard": "All quality gates pass (build, lint, test)"
110
+ },
111
+ {
112
+ "from": "VERIFY",
113
+ "to": "IMPLEMENT",
114
+ "trigger": "Quality gates fail",
115
+ "guard": "One or more quality gates failed"
116
+ },
117
+ {
118
+ "from": "CHECKPOINT",
119
+ "to": "REVIEW",
120
+ "trigger": "Developer chooses review/commit",
121
+ "guard": "Developer selects review or commit option"
122
+ },
123
+ {
124
+ "from": "CHECKPOINT",
125
+ "to": "IMPLEMENT",
126
+ "trigger": "Developer chooses continue working",
127
+ "guard": "Developer selects continue or batch option"
128
+ },
129
+ {
130
+ "from": "REVIEW",
131
+ "to": "DEPLOY",
132
+ "trigger": "Review approved",
133
+ "guard": "No critical findings remain"
134
+ },
135
+ {
136
+ "from": "REVIEW",
137
+ "to": "IMPLEMENT",
138
+ "trigger": "Review requires changes",
139
+ "guard": "Critical findings require code changes"
140
+ },
141
+ {
142
+ "from": "DEPLOY",
143
+ "to": "MAINTAIN",
144
+ "trigger": "Deployment health check passes",
145
+ "guard": "Health check verified healthy"
146
+ },
147
+ {
148
+ "from": "DEPLOY",
149
+ "to": "REVIEW",
150
+ "trigger": "Deployment health check fails",
151
+ "guard": "Health check failure detected"
152
+ },
153
+ {
154
+ "from": "IMPLEMENT",
155
+ "to": "PLAN",
156
+ "trigger": "Unexpected complexity discovered",
157
+ "guard": "Implementation reveals plan inadequacy"
158
+ },
159
+ {
160
+ "from": "MAINTAIN",
161
+ "to": "IDLE",
162
+ "trigger": "Monitoring period complete",
163
+ "guard": "No issues detected during observation"
164
+ }
165
+ ],
166
+ "history": []
167
+ }
@@ -0,0 +1,101 @@
1
+ # Devran AI Kit — Hooks
2
+
3
+ > **Purpose**: Event-driven automation triggered by specific actions
4
+ > **Count**: 8 Event Hooks
5
+
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ Hooks are automated actions triggered by events during development sessions. They form the **operational backbone** of Trust-Grade AI governance.
11
+
12
+ ---
13
+
14
+ ## Available Hooks
15
+
16
+ | Hook | Trigger | Action | Status |
17
+ | :----------------- | :---------------- | :-------------------- | :----- |
18
+ | `session-start` | Session begins | Load context | Active |
19
+ | `session-end` | Session ends | Save state | Active |
20
+ | `pre-commit` | Before git commit | Run verification | Active |
21
+ | `secret-detection` | After file write | Block exposed secrets | Active |
22
+ | `phase-transition` | Workflow phase change| Enforce SDLC gates | Active |
23
+ | `sprint-checkpoint` | Sprint milestone | Progress verification | Active |
24
+ | `plan-complete` | Plan finalized | Plan validation trigger | Active |
25
+ | `task-complete` | Task finished | Completion verification | Active |
26
+
27
+ ---
28
+
29
+ ## Hook Templates
30
+
31
+ Detailed implementation guides are available in `templates/`:
32
+
33
+ | Template | Purpose |
34
+ | :--------------------------------------------- | :------------------------------------ |
35
+ | [session-start.md](templates/session-start.md) | Context loading and environment setup |
36
+ | [session-end.md](templates/session-end.md) | State preservation and handoff |
37
+
38
+ ---
39
+
40
+ ## Configuration
41
+
42
+ Hooks are defined in `hooks.json`:
43
+
44
+ ```json
45
+ {
46
+ "hooks": [
47
+ {
48
+ "name": "hook-name",
49
+ "trigger": "TriggerType",
50
+ "matcher": "condition",
51
+ "action": "what to do"
52
+ }
53
+ ]
54
+ }
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Trigger Types
60
+
61
+ | Trigger | When Activated |
62
+ | :------------- | :------------------------ |
63
+ | `SessionStart` | New session begins |
64
+ | `SessionEnd` | Session ends |
65
+ | `PreToolUse` | Before tool execution |
66
+ | `PostToolUse` | After tool execution |
67
+ | `FileWrite` | After writing to any file |
68
+ | `GitCommit` | Before git commit |
69
+
70
+ ---
71
+
72
+ ## Trust-Grade Principles
73
+
74
+ Hooks implement Trust-Grade governance:
75
+
76
+ 1. **Automatic**: No manual discipline required
77
+ 2. **Consistent**: Same quality gates every time
78
+ 3. **Transparent**: Actions are documented
79
+ 4. **Non-Blocking**: Warnings over hard blocks (when safe)
80
+
81
+ ---
82
+
83
+ ## Creating Custom Hooks
84
+
85
+ Add to `hooks.json`:
86
+
87
+ ```json
88
+ {
89
+ "name": "my-custom-hook",
90
+ "trigger": "PostToolUse",
91
+ "matcher": "tool == 'Write' && file.endsWith('.ts')",
92
+ "action": "Run TypeScript type check"
93
+ }
94
+ ```
95
+
96
+ Create implementation in `templates/my-custom-hook.md` with:
97
+
98
+ - Purpose
99
+ - Actions (with code examples)
100
+ - Expected output
101
+ - Customization options
@@ -0,0 +1,104 @@
1
+ {
2
+ "schemaVersion": "1.1.0",
3
+ "hooks": [
4
+ {
5
+ "event": "session-start",
6
+ "description": "Executed at the beginning of every AI session",
7
+ "enforcement": "runtime",
8
+ "actions": [
9
+ { "action": "Load session-context.md and session-state.json", "severity": "critical", "onFailure": "block" },
10
+ { "action": "Read engine/loading-rules.json for context budget", "severity": "high", "onFailure": "warn" },
11
+ { "action": "Read engine/workflow-state.json for lifecycle phase", "severity": "high", "onFailure": "warn" },
12
+ { "action": "Verify git status is clean or understood", "severity": "medium", "onFailure": "warn" },
13
+ { "action": "Load domain-relevant agents and skills via loading-rules.json", "severity": "high", "onFailure": "warn" },
14
+ { "action": "Present session state to user before proceeding", "severity": "critical", "onFailure": "block" }
15
+ ]
16
+ },
17
+ {
18
+ "event": "session-end",
19
+ "description": "Executed at the end of every AI session",
20
+ "enforcement": "runtime",
21
+ "actions": [
22
+ { "action": "Update session-context.md with handoff notes", "severity": "critical", "onFailure": "block" },
23
+ { "action": "Update session-state.json with metadata", "severity": "critical", "onFailure": "block" },
24
+ { "action": "Update engine/workflow-state.json with phase progress", "severity": "high", "onFailure": "warn" },
25
+ { "action": "Trigger continuous-learning skill for pattern extraction", "severity": "low", "onFailure": "log" },
26
+ { "action": "Update docs/ROADMAP.md if sprint items changed", "severity": "medium", "onFailure": "warn" },
27
+ { "action": "Commit tracking files together", "severity": "high", "onFailure": "warn" }
28
+ ]
29
+ },
30
+ {
31
+ "event": "pre-commit",
32
+ "description": "Verification before any git commit",
33
+ "enforcement": "runtime",
34
+ "actions": [
35
+ { "action": "Verify build passes (npm run build)", "severity": "critical", "onFailure": "block" },
36
+ { "action": "Verify lint passes (npm run lint)", "severity": "critical", "onFailure": "block" },
37
+ { "action": "Verify tests pass (npm test)", "severity": "critical", "onFailure": "block" },
38
+ { "action": "Check for console.log statements in production code", "severity": "medium", "onFailure": "warn" },
39
+ { "action": "Verify no TypeScript errors (npx tsc --noEmit)", "severity": "critical", "onFailure": "block" }
40
+ ]
41
+ },
42
+ {
43
+ "event": "secret-detection",
44
+ "description": "Scan for accidentally committed secrets",
45
+ "enforcement": "git-hook",
46
+ "severity": "critical",
47
+ "onFailure": "block",
48
+ "referenceScript": ".githooks/pre-commit",
49
+ "patterns": [
50
+ "sk-[a-zA-Z0-9]{20,}",
51
+ "AKIA[A-Z0-9]{16}",
52
+ "api_key\\s*=\\s*['\"][^'\"]+",
53
+ "password\\s*=\\s*['\"][^'\"]+",
54
+ "AWS_SECRET_ACCESS_KEY",
55
+ "PRIVATE_KEY",
56
+ "ghp_[a-zA-Z0-9]{36}",
57
+ "gho_[a-zA-Z0-9]{36}"
58
+ ]
59
+ },
60
+ {
61
+ "event": "phase-transition",
62
+ "description": "Triggered when workflow lifecycle phase changes",
63
+ "enforcement": "runtime",
64
+ "actions": [
65
+ { "action": "Validate transition guard from engine/workflow-state.json", "severity": "critical", "onFailure": "block" },
66
+ { "action": "Record transition in workflow-state.json history", "severity": "high", "onFailure": "warn" },
67
+ { "action": "Load/unload agents appropriate for new phase", "severity": "high", "onFailure": "warn" },
68
+ { "action": "Notify user of phase change with next suggested action", "severity": "medium", "onFailure": "warn" }
69
+ ]
70
+ },
71
+ {
72
+ "event": "sprint-checkpoint",
73
+ "description": "Triggered at sprint boundaries for health assessment",
74
+ "enforcement": "runtime",
75
+ "actions": [
76
+ { "action": "Sprint orchestrator generates health report", "severity": "high", "onFailure": "warn" },
77
+ { "action": "Review velocity metrics against plan", "severity": "medium", "onFailure": "warn" },
78
+ { "action": "Identify carry-over candidates", "severity": "medium", "onFailure": "log" },
79
+ { "action": "Produce sprint retrospective if ending", "severity": "high", "onFailure": "warn" }
80
+ ]
81
+ },
82
+ {
83
+ "event": "plan-complete",
84
+ "description": "Triggered when a planned task reaches VERIFY phase. Runs plan retrospective to measure accuracy and feed learnings back into future planning.",
85
+ "enforcement": "runtime",
86
+ "actions": [
87
+ { "action": "Run plan-retrospective against original plan document (compare predicted vs actual files, tasks, estimates)", "severity": "medium", "onFailure": "log" },
88
+ { "action": "Append retrospective findings to contexts/plan-quality-log.md", "severity": "low", "onFailure": "log" },
89
+ { "action": "Extract learnings for continuous-learning skill (PAAL cycle)", "severity": "low", "onFailure": "log" }
90
+ ]
91
+ },
92
+ {
93
+ "event": "task-complete",
94
+ "description": "Triggered after quality gates pass. Presents developer with structured decision options before commit/push.",
95
+ "enforcement": "runtime",
96
+ "actions": [
97
+ { "action": "Present task completion decision prompt to developer", "severity": "critical", "onFailure": "block" },
98
+ { "action": "Evaluate change scope for recommendations (sprint boundary, production impact, session duration)", "severity": "high", "onFailure": "warn" },
99
+ { "action": "Check if tracking files (ROADMAP, session-context, session-state) need updating", "severity": "medium", "onFailure": "warn" },
100
+ { "action": "Suggest session-end protocol if session has accumulated significant changes", "severity": "low", "onFailure": "log" }
101
+ ]
102
+ }
103
+ ]
104
+ }
@@ -0,0 +1,110 @@
1
+ # Session End Hook
2
+
3
+ > **Trigger**: SessionEnd
4
+ > **Priority**: 1 (Highest)
5
+ > **Status**: Active
6
+
7
+ ---
8
+
9
+ ## 🎯 Purpose
10
+
11
+ Save context and preserve state when a session ends. This hook ensures **continuity** for future sessions and proper **handoff** documentation.
12
+
13
+ ---
14
+
15
+ ## 🔄 Actions
16
+
17
+ ### 1. Update Session Context
18
+
19
+ Save current session summary:
20
+
21
+ ```javascript
22
+ // Update session-context.md
23
+ const summary = generateSessionSummary({
24
+ accomplishments: getAccomplishments(),
25
+ openItems: getOpenItems(),
26
+ commits: getSessionCommits(),
27
+ });
28
+ await writeFile(".agent/session-context.md", summary);
29
+ ```
30
+
31
+ ### 2. Save Session State
32
+
33
+ Persist machine-readable state:
34
+
35
+ ```javascript
36
+ // Update session-state.json
37
+ const state = {
38
+ lastUpdated: new Date().toISOString(),
39
+ currentTask: getCurrentTask(),
40
+ branch: await exec("git branch --show-current"),
41
+ lastCommit: await exec("git rev-parse --short HEAD"),
42
+ };
43
+ await writeJSON(".agent/session-state.json", state);
44
+ ```
45
+
46
+ ### 3. Verify Clean State
47
+
48
+ Check for uncommitted changes:
49
+
50
+ ```javascript
51
+ const gitStatus = await exec("git status --short");
52
+ if (gitStatus.length > 0) {
53
+ warn(
54
+ "Uncommitted changes detected. Consider committing before ending session.",
55
+ );
56
+ }
57
+ ```
58
+
59
+ ### 4. Generate Handoff Notes
60
+
61
+ Create handoff documentation if needed:
62
+
63
+ ```javascript
64
+ if (hasOpenItems()) {
65
+ const handoff = generateHandoffNotes({
66
+ nextPriority: getNextPriority(),
67
+ blockers: getBlockers(),
68
+ contextFiles: getRelevantFiles(),
69
+ });
70
+ appendToSessionContext(handoff);
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ## 📋 Output
77
+
78
+ ```
79
+ [Session End]
80
+ ✓ session-context.md updated
81
+ ✓ session-state.json saved
82
+ ✓ Git status: clean
83
+ ✓ Handoff notes: Generated
84
+
85
+ Session ended successfully. Ready for next session.
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 🔧 Customization
91
+
92
+ Extend this hook for project-specific needs:
93
+
94
+ ```json
95
+ {
96
+ "name": "session-end-custom",
97
+ "trigger": "SessionEnd",
98
+ "action": "Run project-specific cleanup tasks"
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## ⚖️ Trust-Grade Integration
105
+
106
+ This hook supports Trust-Grade principles:
107
+
108
+ - **Context Preservation**: Never lose work context
109
+ - **Explainability**: Document what was done and why
110
+ - **Handoff-Ready**: Future sessions can resume seamlessly