@agntk/agent-harness 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +41 -0
  3. package/README.md +445 -0
  4. package/defaults/agents/summarizer.md +49 -0
  5. package/defaults/instincts/lead-with-answer.md +24 -0
  6. package/defaults/instincts/qualify-before-recommending.md +40 -0
  7. package/defaults/instincts/read-before-edit.md +23 -0
  8. package/defaults/instincts/search-before-create.md +23 -0
  9. package/defaults/playbooks/ship-feature.md +31 -0
  10. package/defaults/rules/ask-before-assuming.md +35 -0
  11. package/defaults/rules/operations.md +35 -0
  12. package/defaults/rules/respect-the-user.md +39 -0
  13. package/defaults/skills/business-analyst.md +181 -0
  14. package/defaults/skills/content-marketer.md +184 -0
  15. package/defaults/skills/research.md +34 -0
  16. package/defaults/tools/example-web-search.md +60 -0
  17. package/defaults/workflows/daily-reflection.md +54 -0
  18. package/dist/agent-framework-K4GUIICH.js +344 -0
  19. package/dist/agent-framework-K4GUIICH.js.map +1 -0
  20. package/dist/analytics-RPT73WNM.js +12 -0
  21. package/dist/analytics-RPT73WNM.js.map +1 -0
  22. package/dist/auto-processor-OLE45UI3.js +13 -0
  23. package/dist/auto-processor-OLE45UI3.js.map +1 -0
  24. package/dist/chunk-274RV3YO.js +162 -0
  25. package/dist/chunk-274RV3YO.js.map +1 -0
  26. package/dist/chunk-4CWAGBNS.js +168 -0
  27. package/dist/chunk-4CWAGBNS.js.map +1 -0
  28. package/dist/chunk-4FDUOGSZ.js +69 -0
  29. package/dist/chunk-4FDUOGSZ.js.map +1 -0
  30. package/dist/chunk-5H34JPMB.js +199 -0
  31. package/dist/chunk-5H34JPMB.js.map +1 -0
  32. package/dist/chunk-6EMOEYGU.js +102 -0
  33. package/dist/chunk-6EMOEYGU.js.map +1 -0
  34. package/dist/chunk-A7BJPQQ6.js +236 -0
  35. package/dist/chunk-A7BJPQQ6.js.map +1 -0
  36. package/dist/chunk-AGAAFJEO.js +76 -0
  37. package/dist/chunk-AGAAFJEO.js.map +1 -0
  38. package/dist/chunk-BSKDOFRT.js +65 -0
  39. package/dist/chunk-BSKDOFRT.js.map +1 -0
  40. package/dist/chunk-CHJ5GNZC.js +100 -0
  41. package/dist/chunk-CHJ5GNZC.js.map +1 -0
  42. package/dist/chunk-CSL3ERUI.js +307 -0
  43. package/dist/chunk-CSL3ERUI.js.map +1 -0
  44. package/dist/chunk-DA7IKHC4.js +229 -0
  45. package/dist/chunk-DA7IKHC4.js.map +1 -0
  46. package/dist/chunk-DGUM43GV.js +11 -0
  47. package/dist/chunk-DGUM43GV.js.map +1 -0
  48. package/dist/chunk-DTTXPHFW.js +211 -0
  49. package/dist/chunk-DTTXPHFW.js.map +1 -0
  50. package/dist/chunk-FD55B3IO.js +204 -0
  51. package/dist/chunk-FD55B3IO.js.map +1 -0
  52. package/dist/chunk-FLZU44SV.js +230 -0
  53. package/dist/chunk-FLZU44SV.js.map +1 -0
  54. package/dist/chunk-GJNNR2RA.js +200 -0
  55. package/dist/chunk-GJNNR2RA.js.map +1 -0
  56. package/dist/chunk-GNUSHD2Y.js +111 -0
  57. package/dist/chunk-GNUSHD2Y.js.map +1 -0
  58. package/dist/chunk-GUJTBGVS.js +2212 -0
  59. package/dist/chunk-GUJTBGVS.js.map +1 -0
  60. package/dist/chunk-IZ6UZ3ZL.js +207 -0
  61. package/dist/chunk-IZ6UZ3ZL.js.map +1 -0
  62. package/dist/chunk-JKMGYWXB.js +197 -0
  63. package/dist/chunk-JKMGYWXB.js.map +1 -0
  64. package/dist/chunk-KFX54TQM.js +165 -0
  65. package/dist/chunk-KFX54TQM.js.map +1 -0
  66. package/dist/chunk-M7NXUK55.js +199 -0
  67. package/dist/chunk-M7NXUK55.js.map +1 -0
  68. package/dist/chunk-MPZ3BPUI.js +374 -0
  69. package/dist/chunk-MPZ3BPUI.js.map +1 -0
  70. package/dist/chunk-OC6YSTDX.js +119 -0
  71. package/dist/chunk-OC6YSTDX.js.map +1 -0
  72. package/dist/chunk-RC6MEZB6.js +469 -0
  73. package/dist/chunk-RC6MEZB6.js.map +1 -0
  74. package/dist/chunk-RY3ZFII7.js +3440 -0
  75. package/dist/chunk-RY3ZFII7.js.map +1 -0
  76. package/dist/chunk-TAT6JU3X.js +167 -0
  77. package/dist/chunk-TAT6JU3X.js.map +1 -0
  78. package/dist/chunk-UDZIS2AQ.js +79 -0
  79. package/dist/chunk-UDZIS2AQ.js.map +1 -0
  80. package/dist/chunk-UPLBF4RZ.js +115 -0
  81. package/dist/chunk-UPLBF4RZ.js.map +1 -0
  82. package/dist/chunk-UWQTZMNI.js +154 -0
  83. package/dist/chunk-UWQTZMNI.js.map +1 -0
  84. package/dist/chunk-W4T7PGI2.js +346 -0
  85. package/dist/chunk-W4T7PGI2.js.map +1 -0
  86. package/dist/chunk-XTBKL5BI.js +111 -0
  87. package/dist/chunk-XTBKL5BI.js.map +1 -0
  88. package/dist/chunk-YIJY5DBV.js +399 -0
  89. package/dist/chunk-YIJY5DBV.js.map +1 -0
  90. package/dist/chunk-YUFNYN2H.js +242 -0
  91. package/dist/chunk-YUFNYN2H.js.map +1 -0
  92. package/dist/chunk-Z2PUCXTZ.js +94 -0
  93. package/dist/chunk-Z2PUCXTZ.js.map +1 -0
  94. package/dist/chunk-ZZJOFKAT.js +13 -0
  95. package/dist/chunk-ZZJOFKAT.js.map +1 -0
  96. package/dist/cli/index.js +3661 -0
  97. package/dist/cli/index.js.map +1 -0
  98. package/dist/config-WVMRUOCA.js +13 -0
  99. package/dist/config-WVMRUOCA.js.map +1 -0
  100. package/dist/context-loader-3ORBPMHJ.js +13 -0
  101. package/dist/context-loader-3ORBPMHJ.js.map +1 -0
  102. package/dist/conversation-QDEIDQPH.js +22 -0
  103. package/dist/conversation-QDEIDQPH.js.map +1 -0
  104. package/dist/cost-tracker-RS3W7SVY.js +24 -0
  105. package/dist/cost-tracker-RS3W7SVY.js.map +1 -0
  106. package/dist/delegate-VJCJLYEK.js +29 -0
  107. package/dist/delegate-VJCJLYEK.js.map +1 -0
  108. package/dist/emotional-state-VQVRA6ED.js +206 -0
  109. package/dist/emotional-state-VQVRA6ED.js.map +1 -0
  110. package/dist/env-discovery-2BLVMAIM.js +251 -0
  111. package/dist/env-discovery-2BLVMAIM.js.map +1 -0
  112. package/dist/export-6GCYHEHQ.js +165 -0
  113. package/dist/export-6GCYHEHQ.js.map +1 -0
  114. package/dist/graph-YUIPOSOO.js +14 -0
  115. package/dist/graph-YUIPOSOO.js.map +1 -0
  116. package/dist/harness-LCHA3DWP.js +10 -0
  117. package/dist/harness-LCHA3DWP.js.map +1 -0
  118. package/dist/harness-WE4SLCML.js +26 -0
  119. package/dist/harness-WE4SLCML.js.map +1 -0
  120. package/dist/health-NZ6WNIMV.js +23 -0
  121. package/dist/health-NZ6WNIMV.js.map +1 -0
  122. package/dist/index.d.ts +3612 -0
  123. package/dist/index.js +13501 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/indexer-LONANRRM.js +16 -0
  126. package/dist/indexer-LONANRRM.js.map +1 -0
  127. package/dist/instinct-learner-SRM72DHF.js +20 -0
  128. package/dist/instinct-learner-SRM72DHF.js.map +1 -0
  129. package/dist/intake-4M3HNU43.js +21 -0
  130. package/dist/intake-4M3HNU43.js.map +1 -0
  131. package/dist/intelligence-HJOCA4SJ.js +1081 -0
  132. package/dist/intelligence-HJOCA4SJ.js.map +1 -0
  133. package/dist/journal-WANJL3MI.js +24 -0
  134. package/dist/journal-WANJL3MI.js.map +1 -0
  135. package/dist/loader-C3TKIKZR.js +23 -0
  136. package/dist/loader-C3TKIKZR.js.map +1 -0
  137. package/dist/mcp-WTQJJZAO.js +15 -0
  138. package/dist/mcp-WTQJJZAO.js.map +1 -0
  139. package/dist/mcp-discovery-WPAQFL6S.js +377 -0
  140. package/dist/mcp-discovery-WPAQFL6S.js.map +1 -0
  141. package/dist/mcp-installer-6O2XXD3V.js +394 -0
  142. package/dist/mcp-installer-6O2XXD3V.js.map +1 -0
  143. package/dist/metrics-KXGNFAAB.js +20 -0
  144. package/dist/metrics-KXGNFAAB.js.map +1 -0
  145. package/dist/primitive-registry-I6VTIR4W.js +512 -0
  146. package/dist/primitive-registry-I6VTIR4W.js.map +1 -0
  147. package/dist/project-discovery-C4UMD7JI.js +246 -0
  148. package/dist/project-discovery-C4UMD7JI.js.map +1 -0
  149. package/dist/provider-LQHQX7Z7.js +26 -0
  150. package/dist/provider-LQHQX7Z7.js.map +1 -0
  151. package/dist/provider-SXPQZ74H.js +28 -0
  152. package/dist/provider-SXPQZ74H.js.map +1 -0
  153. package/dist/rate-limiter-RLRVM325.js +22 -0
  154. package/dist/rate-limiter-RLRVM325.js.map +1 -0
  155. package/dist/rule-engine-YGQ3RYZM.js +182 -0
  156. package/dist/rule-engine-YGQ3RYZM.js.map +1 -0
  157. package/dist/scaffold-A3VRRCBV.js +347 -0
  158. package/dist/scaffold-A3VRRCBV.js.map +1 -0
  159. package/dist/scheduler-XHHIVHRI.js +397 -0
  160. package/dist/scheduler-XHHIVHRI.js.map +1 -0
  161. package/dist/search-V3W5JMJG.js +75 -0
  162. package/dist/search-V3W5JMJG.js.map +1 -0
  163. package/dist/semantic-search-2DTOO5UX.js +241 -0
  164. package/dist/semantic-search-2DTOO5UX.js.map +1 -0
  165. package/dist/serve-DTQ3HENY.js +291 -0
  166. package/dist/serve-DTQ3HENY.js.map +1 -0
  167. package/dist/sessions-CZGVXKQE.js +21 -0
  168. package/dist/sessions-CZGVXKQE.js.map +1 -0
  169. package/dist/sources-RW5DT56F.js +32 -0
  170. package/dist/sources-RW5DT56F.js.map +1 -0
  171. package/dist/starter-packs-76YUVHEU.js +893 -0
  172. package/dist/starter-packs-76YUVHEU.js.map +1 -0
  173. package/dist/state-GMXILIHW.js +13 -0
  174. package/dist/state-GMXILIHW.js.map +1 -0
  175. package/dist/state-merge-NKO5FRBA.js +174 -0
  176. package/dist/state-merge-NKO5FRBA.js.map +1 -0
  177. package/dist/telemetry-UC6PBXC7.js +22 -0
  178. package/dist/telemetry-UC6PBXC7.js.map +1 -0
  179. package/dist/tool-executor-MJ7IG7PQ.js +28 -0
  180. package/dist/tool-executor-MJ7IG7PQ.js.map +1 -0
  181. package/dist/tools-DZ4KETET.js +20 -0
  182. package/dist/tools-DZ4KETET.js.map +1 -0
  183. package/dist/types-EW7AIB3R.js +18 -0
  184. package/dist/types-EW7AIB3R.js.map +1 -0
  185. package/dist/types-WGDLSPO6.js +16 -0
  186. package/dist/types-WGDLSPO6.js.map +1 -0
  187. package/dist/universal-installer-QGS4SJGX.js +578 -0
  188. package/dist/universal-installer-QGS4SJGX.js.map +1 -0
  189. package/dist/validator-7WXMDIHH.js +22 -0
  190. package/dist/validator-7WXMDIHH.js.map +1 -0
  191. package/dist/verification-gate-FYXUX6LH.js +246 -0
  192. package/dist/verification-gate-FYXUX6LH.js.map +1 -0
  193. package/dist/versioning-Z3XNE2Q2.js +271 -0
  194. package/dist/versioning-Z3XNE2Q2.js.map +1 -0
  195. package/dist/watcher-ISJC7YKL.js +109 -0
  196. package/dist/watcher-ISJC7YKL.js.map +1 -0
  197. package/dist/web-server-DD7ZOP46.js +28 -0
  198. package/dist/web-server-DD7ZOP46.js.map +1 -0
  199. package/package.json +76 -0
  200. package/sources.yaml +121 -0
  201. package/templates/assistant/CORE.md +24 -0
  202. package/templates/assistant/SYSTEM.md +24 -0
  203. package/templates/assistant/config.yaml +51 -0
  204. package/templates/base/CORE.md +17 -0
  205. package/templates/base/SYSTEM.md +24 -0
  206. package/templates/base/config.yaml +51 -0
  207. package/templates/claude-opus/config.yaml +51 -0
  208. package/templates/code-reviewer/CORE.md +25 -0
  209. package/templates/code-reviewer/SYSTEM.md +30 -0
  210. package/templates/code-reviewer/config.yaml +51 -0
  211. package/templates/gpt4/config.yaml +51 -0
  212. package/templates/local/config.yaml +51 -0
@@ -0,0 +1,893 @@
1
+ #!/usr/bin/env node
2
+
3
+ import "./chunk-ZZJOFKAT.js";
4
+
5
+ // src/runtime/starter-packs.ts
6
+ var PACKS = {
7
+ "daily-briefs": {
8
+ name: "daily-briefs",
9
+ description: "Morning briefing and evening review workflows \u2014 summarize upcoming tasks, review completed work, and plan next steps.",
10
+ tags: ["daily", "briefing", "review", "productivity"],
11
+ files: [
12
+ {
13
+ path: "workflows/morning-brief.md",
14
+ id: "morning-brief",
15
+ l0: "Morning briefing workflow that summarizes recent sessions and plans the day.",
16
+ content: `---
17
+ id: morning-brief
18
+ tags: [workflow, daily, morning]
19
+ author: infrastructure
20
+ status: active
21
+ schedule: "0 8 * * 1-5"
22
+ ---
23
+ # Morning Brief
24
+
25
+ Review yesterday's sessions and journal, then produce a concise daily brief.
26
+
27
+ ## Instructions
28
+
29
+ 1. Load the most recent journal entry and any sessions from the last 24 hours.
30
+ 2. Summarize key accomplishments, open questions, and blockers.
31
+ 3. List the top 3 priorities for today based on recent activity patterns.
32
+ 4. Note any instincts or rules that were frequently triggered.
33
+ 5. Keep the output under 500 words \u2014 this is a quick scan, not a deep analysis.
34
+
35
+ ## Output Format
36
+
37
+ **Yesterday's highlights:**
38
+ - [bullet points]
39
+
40
+ **Today's priorities:**
41
+ 1. [priority]
42
+ 2. [priority]
43
+ 3. [priority]
44
+
45
+ **Open questions / blockers:**
46
+ - [if any]
47
+ `
48
+ },
49
+ {
50
+ path: "workflows/evening-review.md",
51
+ id: "evening-review",
52
+ l0: "Evening review workflow that synthesizes the day and prepares for tomorrow.",
53
+ content: `---
54
+ id: evening-review
55
+ tags: [workflow, daily, evening, review]
56
+ author: infrastructure
57
+ status: active
58
+ schedule: "0 18 * * 1-5"
59
+ ---
60
+ # Evening Review
61
+
62
+ Synthesize today's work and prepare handoff notes for tomorrow.
63
+
64
+ ## Instructions
65
+
66
+ 1. Load all sessions from today.
67
+ 2. Identify what was accomplished vs. what was planned (from morning brief if available).
68
+ 3. Note any recurring patterns, surprises, or friction points.
69
+ 4. Suggest 1-2 instinct candidates if behavioral patterns emerge.
70
+ 5. Write a brief handoff note for tomorrow's morning brief.
71
+
72
+ ## Output Format
73
+
74
+ **Completed today:**
75
+ - [bullet points]
76
+
77
+ **Planned but not completed:**
78
+ - [if any, with reasons]
79
+
80
+ **Observations:**
81
+ - [patterns, friction, surprises]
82
+
83
+ **Tomorrow's handoff:**
84
+ - [brief note for morning brief]
85
+ `
86
+ }
87
+ ]
88
+ },
89
+ "weekly-review": {
90
+ name: "weekly-review",
91
+ description: "End-of-week review workflow \u2014 analyze the week, compress journals, surface trends, and set goals for next week.",
92
+ tags: ["weekly", "review", "retrospective", "planning"],
93
+ files: [
94
+ {
95
+ path: "workflows/weekly-review.md",
96
+ id: "weekly-review",
97
+ l0: "Weekly review workflow that analyzes the week and sets goals.",
98
+ content: `---
99
+ id: weekly-review
100
+ tags: [workflow, weekly, review, retrospective]
101
+ author: infrastructure
102
+ status: active
103
+ schedule: "0 17 * * 5"
104
+ ---
105
+ # Weekly Review
106
+
107
+ Analyze the past week's work, compress journals, and plan next week.
108
+
109
+ ## Instructions
110
+
111
+ 1. Load all journal entries from this week (Monday through today).
112
+ 2. Identify the top 3-5 themes across the week's work.
113
+ 3. Note which instincts fired most often and whether they were helpful.
114
+ 4. Identify any skills or playbooks that were missing or underperforming.
115
+ 5. Suggest concrete goals for next week (2-3 maximum).
116
+ 6. Flag any rules that seem outdated or contradictory.
117
+
118
+ ## Output Format
119
+
120
+ **Week of [date range]**
121
+
122
+ **Key themes:**
123
+ 1. [theme with brief explanation]
124
+ 2. [theme]
125
+ 3. [theme]
126
+
127
+ **Instinct effectiveness:**
128
+ - [instinct name]: [helpful / needs tuning / remove]
129
+
130
+ **Gaps identified:**
131
+ - [missing skill or playbook suggestion]
132
+
133
+ **Next week's goals:**
134
+ 1. [specific, actionable goal]
135
+ 2. [goal]
136
+
137
+ **Maintenance notes:**
138
+ - [rules to review, primitives to archive, etc.]
139
+ `
140
+ }
141
+ ]
142
+ },
143
+ "code-review": {
144
+ name: "code-review",
145
+ description: "Code review workflow \u2014 analyzes recent code changes, checks for patterns and anti-patterns, and generates review notes.",
146
+ tags: ["code-review", "development", "quality"],
147
+ files: [
148
+ {
149
+ path: "workflows/code-review.md",
150
+ id: "code-review-workflow",
151
+ l0: "Code review workflow that analyzes recent changes and generates review notes.",
152
+ content: `---
153
+ id: code-review-workflow
154
+ tags: [workflow, code-review, development]
155
+ author: infrastructure
156
+ status: active
157
+ ---
158
+ # Code Review Workflow
159
+
160
+ Analyze recent code changes and generate structured review notes.
161
+
162
+ ## Instructions
163
+
164
+ 1. Review the most recent session where code was written or modified.
165
+ 2. Check for common issues:
166
+ - Missing error handling (empty catches, unhandled promises)
167
+ - Type safety violations (any usage, missing return types)
168
+ - Security concerns (unsanitized input, hardcoded secrets)
169
+ - Code duplication or missed reuse opportunities
170
+ 3. Check adherence to project rules and instincts.
171
+ 4. Note positive patterns worth reinforcing as instincts.
172
+ 5. Generate a structured review with severity levels.
173
+
174
+ ## Output Format
175
+
176
+ **Review of [session/change description]**
177
+
178
+ **Critical issues:**
179
+ - [severity: high] [description]
180
+
181
+ **Improvements:**
182
+ - [severity: medium] [suggestion]
183
+
184
+ **Good patterns:**
185
+ - [pattern worth keeping / promoting to instinct]
186
+
187
+ **Summary:**
188
+ [1-2 sentence overall assessment]
189
+ `
190
+ },
191
+ {
192
+ path: "workflows/pr-checklist.md",
193
+ id: "pr-checklist",
194
+ l0: "PR checklist workflow that generates a pre-merge review checklist.",
195
+ content: `---
196
+ id: pr-checklist
197
+ tags: [workflow, code-review, pr, checklist]
198
+ author: infrastructure
199
+ status: active
200
+ ---
201
+ # PR Checklist
202
+
203
+ Generate a pre-merge checklist based on project rules and recent changes.
204
+
205
+ ## Instructions
206
+
207
+ 1. Load all active rules from the harness.
208
+ 2. For each rule category, generate a checklist item.
209
+ 3. Add standard items: tests pass, no type errors, no lint warnings.
210
+ 4. Include project-specific checks based on instincts.
211
+ 5. Output as a copy-pasteable markdown checklist.
212
+
213
+ ## Output Format
214
+
215
+ **Pre-merge checklist:**
216
+
217
+ - [ ] All tests pass
218
+ - [ ] No TypeScript errors (tsc --noEmit)
219
+ - [ ] No lint warnings
220
+ - [ ] Error handling: no empty catches, async errors handled
221
+ - [ ] Types: no \`any\`, explicit return types on exports
222
+ - [ ] Security: no hardcoded secrets, input validated
223
+ - [rule-specific items from harness rules]
224
+ `
225
+ }
226
+ ]
227
+ },
228
+ "code-reviewer": {
229
+ name: "code-reviewer",
230
+ description: "Multi-primitive code review pack \u2014 rules for code quality, instincts for review patterns, and a skill for structured review technique.",
231
+ tags: ["code-review", "quality", "rules", "instincts", "skills"],
232
+ files: [
233
+ {
234
+ path: "rules/code-quality.md",
235
+ id: "code-quality-rules",
236
+ l0: "Code quality rules enforcing error handling, type safety, and security.",
237
+ content: `---
238
+ id: code-quality-rules
239
+ tags: [rule, code-quality, error-handling, type-safety, security]
240
+ author: infrastructure
241
+ status: active
242
+ ---
243
+ # Code Quality Rules
244
+
245
+ Enforceable rules for maintaining code quality across the codebase.
246
+
247
+ ## Error Handling
248
+
249
+ - **Never** leave a catch block empty. Every catch must log or handle the error meaningfully.
250
+ - **Always** handle async errors \u2014 every async function must have error handling at its boundary.
251
+ - **Never** use generic \`catch (e) { throw e }\` \u2014 either handle or let it propagate naturally.
252
+
253
+ ## Type Safety
254
+
255
+ - **Never** use \`any\` \u2014 use \`unknown\` with type narrowing, generics, or explicit types.
256
+ - **Always** add explicit return types on exported functions.
257
+ - **Never** trust external data at runtime \u2014 validate at system boundaries.
258
+
259
+ ## Security
260
+
261
+ - **Never** hardcode secrets, API keys, or tokens in source code.
262
+ - **Always** parameterize database queries \u2014 never concatenate user input.
263
+ - **Never** use \`eval()\`, \`innerHTML\`, or \`document.write()\` with unsanitized input.
264
+ - **Always** validate and sanitize user input at the boundary where it enters the system.
265
+
266
+ ## Structure
267
+
268
+ - **Prefer** early returns and guard clauses \u2014 happy path last.
269
+ - **Never** create a new utility function without first searching for an existing one.
270
+ - **Always** prefer editing existing files over creating new ones.
271
+ `
272
+ },
273
+ {
274
+ path: "rules/review-standards.md",
275
+ id: "review-standards",
276
+ l0: "Review standards for consistent, actionable code review feedback.",
277
+ content: `---
278
+ id: review-standards
279
+ tags: [rule, code-review, standards, feedback]
280
+ author: infrastructure
281
+ status: active
282
+ ---
283
+ # Review Standards
284
+
285
+ Standards for producing consistent, actionable code review feedback.
286
+
287
+ ## Severity Levels
288
+
289
+ - **Critical**: Security vulnerability, data loss risk, or crash. Must fix before merge.
290
+ - **High**: Logic error, missing error handling, or broken contract. Should fix before merge.
291
+ - **Medium**: Code smell, duplication, or missed optimization. Fix soon.
292
+ - **Low**: Style preference, naming suggestion, or minor improvement. Optional.
293
+
294
+ ## Review Checklist
295
+
296
+ - Every review must note at least one positive pattern (reinforcement).
297
+ - Every issue must include a suggested fix, not just a complaint.
298
+ - Reviews should reference specific rules or instincts when applicable.
299
+ - Avoid vague feedback like "this could be better" \u2014 be specific and actionable.
300
+
301
+ ## Scope
302
+
303
+ - Review only what changed \u2014 do not nitpick unrelated code.
304
+ - Flag pre-existing issues separately from new issues.
305
+ - If a change is too large to review effectively, request it be split.
306
+ `
307
+ },
308
+ {
309
+ path: "instincts/review-pattern-detection.md",
310
+ id: "review-pattern-detection",
311
+ l0: "Instinct for detecting common code review patterns and anti-patterns.",
312
+ content: `---
313
+ id: review-pattern-detection
314
+ tags: [instinct, code-review, patterns, anti-patterns]
315
+ author: infrastructure
316
+ status: active
317
+ ---
318
+ # Review Pattern Detection
319
+
320
+ Behavioral instinct for recognizing patterns during code review.
321
+
322
+ ## Trigger
323
+
324
+ When reviewing code changes or analyzing session output that includes code modifications.
325
+
326
+ ## Patterns to Watch For
327
+
328
+ - **Copy-paste duplication**: Same logic appearing in multiple places \u2014 suggest extraction.
329
+ - **Error swallowing**: Catch blocks that log but don't re-throw or handle \u2014 flag as silent failure.
330
+ - **Missing edge cases**: Functions that handle the happy path but not nulls, empty arrays, or errors.
331
+ - **Leaky abstractions**: Implementation details exposed through public interfaces.
332
+ - **Premature optimization**: Complex code with no measured performance need.
333
+ - **Magic values**: Hardcoded numbers or strings that should be named constants.
334
+
335
+ ## Response
336
+
337
+ When a pattern is detected, note it in the review with the pattern name and a brief explanation. Suggest the specific fix, not just the problem.
338
+ `
339
+ },
340
+ {
341
+ path: "instincts/refactor-opportunity.md",
342
+ id: "refactor-opportunity",
343
+ l0: "Instinct for spotting refactoring opportunities during review.",
344
+ content: `---
345
+ id: refactor-opportunity
346
+ tags: [instinct, refactoring, code-review, improvement]
347
+ author: infrastructure
348
+ status: active
349
+ ---
350
+ # Refactor Opportunity Detection
351
+
352
+ Behavioral instinct for identifying refactoring opportunities.
353
+
354
+ ## Trigger
355
+
356
+ When code changes reveal structural issues or when the same area is modified repeatedly.
357
+
358
+ ## Signals
359
+
360
+ - **Shotgun surgery**: A single logical change requires touching 3+ files \u2014 extract shared logic.
361
+ - **Feature envy**: A function that mostly uses data from another module \u2014 move it.
362
+ - **Long parameter lists**: Functions with 4+ parameters \u2014 consider an options object.
363
+ - **Nested conditionals**: 3+ levels of nesting \u2014 extract early returns or helper functions.
364
+ - **God objects**: Classes or modules with 10+ responsibilities \u2014 split by concern.
365
+
366
+ ## Response
367
+
368
+ Note the refactoring opportunity with the specific smell name. Only suggest refactoring if it improves clarity \u2014 not every code smell needs immediate action.
369
+ `
370
+ },
371
+ {
372
+ path: "skills/structured-review.md",
373
+ id: "structured-review-skill",
374
+ l0: "Skill for conducting structured, multi-pass code reviews.",
375
+ content: `---
376
+ id: structured-review-skill
377
+ tags: [skill, code-review, technique, methodology]
378
+ author: infrastructure
379
+ status: active
380
+ ---
381
+ # Structured Code Review
382
+
383
+ A systematic approach to reviewing code changes in multiple passes.
384
+
385
+ ## Technique: Three-Pass Review
386
+
387
+ ### Pass 1: Correctness (5 minutes)
388
+ - Does the code do what the author intended?
389
+ - Are there logic errors, off-by-one issues, or race conditions?
390
+ - Do all error paths terminate correctly?
391
+
392
+ ### Pass 2: Quality (3 minutes)
393
+ - Does it follow project rules and coding standards?
394
+ - Are there opportunities for reuse or simplification?
395
+ - Is the code testable? Are there missing tests?
396
+
397
+ ### Pass 3: Design (2 minutes)
398
+ - Does the change fit the existing architecture?
399
+ - Are the abstractions at the right level?
400
+ - Will this be easy to modify in the future?
401
+
402
+ ## Output Template
403
+
404
+ \`\`\`
405
+ **Correctness**: [pass/issues found]
406
+ **Quality**: [pass/improvements suggested]
407
+ **Design**: [pass/concerns noted]
408
+ **Verdict**: [approve / request changes / discuss]
409
+ \`\`\`
410
+
411
+ ## Tips
412
+
413
+ - Time-box each pass to avoid rabbit holes.
414
+ - Record the first pass findings before moving to the next \u2014 fresh eyes find different things.
415
+ - If you find a critical issue in pass 1, stop and report it immediately.
416
+ `
417
+ }
418
+ ]
419
+ },
420
+ "personal-assistant": {
421
+ name: "personal-assistant",
422
+ description: "Personal assistant pack \u2014 daily planning workflow, communication instincts, and a task management skill for organizing priorities.",
423
+ tags: ["productivity", "planning", "communication", "task-management"],
424
+ files: [
425
+ {
426
+ path: "workflows/daily-planner.md",
427
+ id: "daily-planner",
428
+ l0: "Daily planning workflow that organizes priorities and schedules tasks.",
429
+ content: `---
430
+ id: daily-planner
431
+ tags: [workflow, daily, planning, productivity]
432
+ author: infrastructure
433
+ status: active
434
+ schedule: "0 7 * * 1-5"
435
+ ---
436
+ # Daily Planner
437
+
438
+ Create a structured daily plan from open tasks, calendar items, and recent context.
439
+
440
+ ## Instructions
441
+
442
+ 1. Load the most recent journal entry and state.md.
443
+ 2. Identify all open tasks from \`unfinished_business\` in state.
444
+ 3. Check for any scheduled workflows firing today.
445
+ 4. Categorize tasks by urgency and importance (Eisenhower matrix).
446
+ 5. Produce a time-blocked plan for the day.
447
+ 6. Estimate total focus hours needed vs. available.
448
+
449
+ ## Output Format
450
+
451
+ **Date: [today]**
452
+
453
+ **Must do today (urgent + important):**
454
+ 1. [task with estimated time]
455
+
456
+ **Should do today (important, not urgent):**
457
+ 1. [task]
458
+
459
+ **Quick wins (< 15 min):**
460
+ - [task]
461
+
462
+ **Scheduled:**
463
+ - [time] [event or workflow]
464
+
465
+ **Focus hours needed:** [N] / **Available:** [M]
466
+ `
467
+ },
468
+ {
469
+ path: "workflows/inbox-triage.md",
470
+ id: "inbox-triage",
471
+ l0: "Inbox triage workflow that processes and categorizes incoming items.",
472
+ content: `---
473
+ id: inbox-triage
474
+ tags: [workflow, triage, inbox, productivity]
475
+ author: infrastructure
476
+ status: active
477
+ proactive: true
478
+ ---
479
+ # Inbox Triage
480
+
481
+ Process incoming items and categorize them for action.
482
+
483
+ ## Instructions
484
+
485
+ 1. Scan recent sessions and events for unprocessed items.
486
+ 2. For each item, determine:
487
+ - **Action required?** Yes/No
488
+ - **Urgency:** Now / Today / This week / Someday
489
+ - **Category:** Task / Question / Reference / Noise
490
+ 3. Items requiring action go to state.md unfinished_business.
491
+ 4. Questions get queued for the next interactive session.
492
+ 5. Reference items get filed as session notes.
493
+ 6. Noise gets acknowledged and dropped.
494
+
495
+ ## Output Format
496
+
497
+ **Processed [N] items:**
498
+
499
+ | Item | Action | Urgency | Category |
500
+ |------|--------|---------|----------|
501
+ | [description] | [yes/no] | [urgency] | [category] |
502
+
503
+ **Added to queue:** [count]
504
+ **Filed as reference:** [count]
505
+ **Dropped:** [count]
506
+ `
507
+ },
508
+ {
509
+ path: "instincts/clear-communication.md",
510
+ id: "clear-communication",
511
+ l0: "Instinct for clear, concise communication in responses.",
512
+ content: `---
513
+ id: clear-communication
514
+ tags: [instinct, communication, clarity, writing]
515
+ author: infrastructure
516
+ status: active
517
+ ---
518
+ # Clear Communication
519
+
520
+ Behavioral instinct for producing clear, actionable communication.
521
+
522
+ ## Trigger
523
+
524
+ When generating any output that will be read by a human \u2014 responses, summaries, reports, plans.
525
+
526
+ ## Principles
527
+
528
+ - **Lead with the answer.** State the conclusion first, then provide supporting detail.
529
+ - **Be specific.** Replace "soon" with dates, "some" with counts, "improve" with metrics.
530
+ - **One idea per paragraph.** Dense paragraphs with multiple ideas are hard to scan.
531
+ - **Use structure.** Headers, lists, and tables are faster to process than prose.
532
+ - **Cut filler.** Remove "I think", "basically", "in order to", "it should be noted that".
533
+
534
+ ## Anti-patterns
535
+
536
+ - Restating the question before answering it.
537
+ - Using jargon without context.
538
+ - Providing information the reader didn't ask for.
539
+ - Hedging when confidence is high.
540
+
541
+ ## Response
542
+
543
+ Apply these principles automatically. If a draft is unclear, restructure before outputting.
544
+ `
545
+ },
546
+ {
547
+ path: "instincts/context-awareness.md",
548
+ id: "context-awareness",
549
+ l0: "Instinct for maintaining awareness of user context and recent history.",
550
+ content: `---
551
+ id: context-awareness
552
+ tags: [instinct, context, memory, personalization]
553
+ author: infrastructure
554
+ status: active
555
+ ---
556
+ # Context Awareness
557
+
558
+ Behavioral instinct for maintaining awareness of what the user is working on.
559
+
560
+ ## Trigger
561
+
562
+ At the start of every session and when switching topics.
563
+
564
+ ## Behavior
565
+
566
+ - Check state.md for current goals and active workflows before responding.
567
+ - Reference recent session history when it adds value (not gratuitously).
568
+ - Notice when the user returns to a topic from a previous session \u2014 offer continuity.
569
+ - Track which tools, files, and topics appear frequently \u2014 these are the user's active context.
570
+ - When the user's request is ambiguous, use recent context to disambiguate rather than asking.
571
+
572
+ ## Anti-patterns
573
+
574
+ - Treating every session as a fresh start with no history.
575
+ - Asking questions that were already answered in a recent session.
576
+ - Ignoring state.md goals when prioritizing tasks.
577
+ `
578
+ },
579
+ {
580
+ path: "skills/task-prioritization.md",
581
+ id: "task-prioritization-skill",
582
+ l0: "Skill for prioritizing tasks using the Eisenhower matrix and energy mapping.",
583
+ content: `---
584
+ id: task-prioritization-skill
585
+ tags: [skill, productivity, prioritization, planning]
586
+ author: infrastructure
587
+ status: active
588
+ ---
589
+ # Task Prioritization
590
+
591
+ Systematic approach to prioritizing tasks when everything feels urgent.
592
+
593
+ ## Technique: Eisenhower + Energy Mapping
594
+
595
+ ### Step 1: Classify by Urgency and Importance
596
+
597
+ | | Urgent | Not Urgent |
598
+ |---|--------|------------|
599
+ | **Important** | Do first | Schedule |
600
+ | **Not Important** | Delegate/batch | Drop or defer |
601
+
602
+ ### Step 2: Map to Energy Levels
603
+
604
+ - **High energy tasks** (creative, complex decisions): Morning block
605
+ - **Medium energy tasks** (meetings, reviews): Midday
606
+ - **Low energy tasks** (admin, filing, routine): Late afternoon
607
+
608
+ ### Step 3: Apply Constraints
609
+
610
+ - Maximum 3 "must do" items per day \u2014 more than 3 means nothing is truly prioritized.
611
+ - If everything is urgent, ask: "What happens if this waits 24 hours?" If the answer is "nothing", it's not urgent.
612
+ - Group similar tasks to reduce context-switching cost.
613
+
614
+ ## Output
615
+
616
+ Produce a prioritized list with:
617
+ 1. Task name
618
+ 2. Quadrant (urgent-important, important, urgent, neither)
619
+ 3. Estimated time
620
+ 4. Suggested time block (morning/midday/afternoon)
621
+ `
622
+ }
623
+ ]
624
+ },
625
+ "devops": {
626
+ name: "devops",
627
+ description: "DevOps safety pack \u2014 deployment rules, monitoring instincts, and an incident response skill for handling production issues.",
628
+ tags: ["devops", "deployment", "monitoring", "incident-response", "safety"],
629
+ files: [
630
+ {
631
+ path: "rules/deployment-safety.md",
632
+ id: "deployment-safety-rules",
633
+ l0: "Deployment safety rules preventing common production failures.",
634
+ content: `---
635
+ id: deployment-safety-rules
636
+ tags: [rule, devops, deployment, safety, production]
637
+ author: infrastructure
638
+ status: active
639
+ ---
640
+ # Deployment Safety Rules
641
+
642
+ Rules to prevent common deployment failures and production incidents.
643
+
644
+ ## Pre-Deployment
645
+
646
+ - **Never** deploy without all tests passing \u2014 no exceptions, no "just this once".
647
+ - **Never** deploy directly to production \u2014 always go through staging first.
648
+ - **Always** review the diff before deploying \u2014 automated deployments must still be human-approved.
649
+ - **Never** deploy on Fridays after 2 PM or before holidays without explicit approval.
650
+ - **Always** have a rollback plan before deploying \u2014 know the exact command to revert.
651
+
652
+ ## During Deployment
653
+
654
+ - **Always** deploy incrementally \u2014 canary or blue-green, never all-at-once.
655
+ - **Never** deploy multiple unrelated changes in a single deployment.
656
+ - **Always** monitor error rates for 15 minutes after deployment \u2014 do not walk away.
657
+
658
+ ## Secrets and Config
659
+
660
+ - **Never** hardcode environment-specific values \u2014 use environment variables or config maps.
661
+ - **Never** commit secrets to version control \u2014 use secret management tools.
662
+ - **Always** rotate credentials after any suspected exposure \u2014 assume compromise.
663
+
664
+ ## Database
665
+
666
+ - **Never** run destructive migrations without a backup taken in the last hour.
667
+ - **Always** test migrations on a copy of production data before running on production.
668
+ - **Never** drop columns or tables without confirming zero references in running code.
669
+ `
670
+ },
671
+ {
672
+ path: "rules/infrastructure-standards.md",
673
+ id: "infrastructure-standards",
674
+ l0: "Infrastructure standards for consistent, maintainable deployments.",
675
+ content: `---
676
+ id: infrastructure-standards
677
+ tags: [rule, devops, infrastructure, standards]
678
+ author: infrastructure
679
+ status: active
680
+ ---
681
+ # Infrastructure Standards
682
+
683
+ Standards for maintaining consistent, auditable infrastructure.
684
+
685
+ ## Configuration
686
+
687
+ - All infrastructure must be defined as code (Terraform, Pulumi, CloudFormation, or similar).
688
+ - Manual changes to production infrastructure require a follow-up PR within 24 hours.
689
+ - Every service must have health check endpoints (/health, /ready).
690
+ - Every service must emit structured logs (JSON) with request IDs for tracing.
691
+
692
+ ## Monitoring
693
+
694
+ - Every service must have alerts for: error rate > 1%, latency p99 > 2s, availability < 99.9%.
695
+ - Alerts must page on-call for critical issues \u2014 never rely on email-only alerts.
696
+ - Dashboard must show: request rate, error rate, latency percentiles, resource utilization.
697
+
698
+ ## Access Control
699
+
700
+ - Production access requires MFA and is logged.
701
+ - Prefer role-based access over individual permissions.
702
+ - Review access lists quarterly \u2014 remove unused permissions.
703
+
704
+ ## Backups
705
+
706
+ - All persistent data must be backed up daily with 30-day retention.
707
+ - Test backup restoration quarterly \u2014 untested backups are not backups.
708
+ `
709
+ },
710
+ {
711
+ path: "instincts/anomaly-detection.md",
712
+ id: "anomaly-detection",
713
+ l0: "Instinct for detecting anomalies in metrics, logs, and deployment behavior.",
714
+ content: `---
715
+ id: anomaly-detection
716
+ tags: [instinct, devops, monitoring, anomaly, alerting]
717
+ author: infrastructure
718
+ status: active
719
+ ---
720
+ # Anomaly Detection
721
+
722
+ Behavioral instinct for noticing when something is off in operational metrics.
723
+
724
+ ## Trigger
725
+
726
+ When reviewing deployment output, log summaries, or metric dashboards.
727
+
728
+ ## Signals
729
+
730
+ - **Error rate spike**: Any increase > 2x baseline within 5 minutes of a deployment.
731
+ - **Latency creep**: p99 latency increasing steadily over hours \u2014 memory leak or connection exhaustion.
732
+ - **Silent failures**: Success rate stays high but throughput drops \u2014 upstream is failing to send.
733
+ - **Resource divergence**: CPU/memory usage differs significantly between replicas \u2014 one is stuck.
734
+ - **Clock skew**: Timestamps in logs jumping backward or forward \u2014 NTP issues.
735
+ - **Cascade pattern**: Multiple unrelated services degrading simultaneously \u2014 shared dependency.
736
+
737
+ ## Response
738
+
739
+ When an anomaly is detected:
740
+ 1. Note the specific metric and timeframe.
741
+ 2. Correlate with recent deployments or config changes.
742
+ 3. If post-deployment: recommend immediate rollback, investigate after.
743
+ 4. If no recent change: check upstream dependencies and shared infrastructure.
744
+ `
745
+ },
746
+ {
747
+ path: "instincts/change-risk-assessment.md",
748
+ id: "change-risk-assessment",
749
+ l0: "Instinct for assessing risk before infrastructure or deployment changes.",
750
+ content: `---
751
+ id: change-risk-assessment
752
+ tags: [instinct, devops, risk, change-management]
753
+ author: infrastructure
754
+ status: active
755
+ ---
756
+ # Change Risk Assessment
757
+
758
+ Behavioral instinct for evaluating the risk of operational changes before executing them.
759
+
760
+ ## Trigger
761
+
762
+ Before any deployment, configuration change, or infrastructure modification.
763
+
764
+ ## Risk Factors
765
+
766
+ - **Blast radius**: How many users or services are affected if this fails?
767
+ - **Reversibility**: Can this be rolled back in under 5 minutes?
768
+ - **Observability**: Will we know if this breaks something? Are there alerts?
769
+ - **Timing**: Is this during peak traffic? During on-call handoff?
770
+ - **Novelty**: Has this type of change been done before? By this team?
771
+ - **Dependencies**: Does this change require coordinated changes in other services?
772
+
773
+ ## Risk Levels
774
+
775
+ - **Low**: Small blast radius, instantly reversible, well-observed, done before.
776
+ - **Medium**: Moderate blast radius, reversible with effort, some unknowns.
777
+ - **High**: Large blast radius, difficult to reverse, novel, or during peak.
778
+
779
+ ## Response
780
+
781
+ State the risk level and the primary risk factor before proceeding. For high-risk changes, suggest breaking the change into smaller, lower-risk steps.
782
+ `
783
+ },
784
+ {
785
+ path: "skills/incident-response.md",
786
+ id: "incident-response-skill",
787
+ l0: "Skill for structured incident response and post-incident analysis.",
788
+ content: `---
789
+ id: incident-response-skill
790
+ tags: [skill, devops, incident-response, runbook]
791
+ author: infrastructure
792
+ status: active
793
+ ---
794
+ # Incident Response
795
+
796
+ Structured approach to handling production incidents.
797
+
798
+ ## Phase 1: Detect and Assess (0-5 minutes)
799
+
800
+ 1. **Confirm the incident**: Verify the alert is real, not a false positive.
801
+ 2. **Assess impact**: How many users affected? Is data at risk?
802
+ 3. **Classify severity**:
803
+ - **SEV1**: Service down, data loss, or security breach. Page everyone.
804
+ - **SEV2**: Significant degradation, partial outage. Page on-call.
805
+ - **SEV3**: Minor degradation, workaround available. Notify team.
806
+ 4. **Communicate**: Post in incident channel with: what's happening, who's investigating, ETA for update.
807
+
808
+ ## Phase 2: Mitigate (5-30 minutes)
809
+
810
+ 1. **Check recent changes**: Was anything deployed in the last 2 hours? Roll it back.
811
+ 2. **Check dependencies**: Are upstream services healthy?
812
+ 3. **Scale or redirect**: Can traffic be shifted to healthy instances?
813
+ 4. **Apply known fix**: Check runbooks for this failure mode.
814
+ 5. **Update communication** every 15 minutes, even if no progress.
815
+
816
+ ## Phase 3: Resolve and Recover
817
+
818
+ 1. **Confirm resolution**: Metrics return to baseline for 15+ minutes.
819
+ 2. **Communicate all-clear** with summary of what happened.
820
+ 3. **Schedule post-mortem** within 48 hours.
821
+
822
+ ## Phase 4: Post-Mortem Template
823
+
824
+ \`\`\`
825
+ **Incident**: [title]
826
+ **Date**: [date] | **Duration**: [time]
827
+ **Severity**: [SEV1/2/3]
828
+ **Impact**: [users/services affected]
829
+
830
+ **Timeline:**
831
+ - [HH:MM] Alert fired
832
+ - [HH:MM] Investigation started
833
+ - [HH:MM] Root cause identified
834
+ - [HH:MM] Fix applied
835
+ - [HH:MM] Confirmed resolved
836
+
837
+ **Root cause:** [description]
838
+ **Contributing factors:** [list]
839
+ **Action items:**
840
+ - [ ] [preventive measure with owner and due date]
841
+ \`\`\`
842
+ `
843
+ }
844
+ ]
845
+ }
846
+ };
847
+ function getStarterPack(name) {
848
+ const pack = PACKS[name];
849
+ if (!pack) return null;
850
+ const now = (/* @__PURE__ */ new Date()).toISOString();
851
+ const fileEntries = pack.files.map((f) => ({
852
+ path: f.path,
853
+ type: f.path.split("/")[0],
854
+ id: f.id,
855
+ l0: f.l0
856
+ }));
857
+ const manifest = {
858
+ version: "1",
859
+ name: `pack:${pack.name}`,
860
+ description: pack.description,
861
+ author: "agent-harness",
862
+ bundle_version: "1.0.0",
863
+ created: now,
864
+ types: [...new Set(fileEntries.map((f) => f.type))],
865
+ tags: pack.tags,
866
+ files: fileEntries
867
+ };
868
+ return {
869
+ manifest,
870
+ files: pack.files.map((f) => ({ path: f.path, content: f.content }))
871
+ };
872
+ }
873
+ function listStarterPacks() {
874
+ return Object.values(PACKS).map((p) => ({
875
+ name: p.name,
876
+ description: p.description,
877
+ fileCount: p.files.length,
878
+ tags: p.tags
879
+ }));
880
+ }
881
+ function isPackReference(source) {
882
+ return source.startsWith("pack:");
883
+ }
884
+ function parsePackName(source) {
885
+ return source.slice(5);
886
+ }
887
+ export {
888
+ getStarterPack,
889
+ isPackReference,
890
+ listStarterPacks,
891
+ parsePackName
892
+ };
893
+ //# sourceMappingURL=starter-packs-76YUVHEU.js.map