@jigyasudham/veto 0.8.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 (198) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/README.md +190 -0
  3. package/dist/adapters/claude.js +57 -0
  4. package/dist/adapters/codex.js +58 -0
  5. package/dist/adapters/gemini.js +58 -0
  6. package/dist/adapters/index.js +156 -0
  7. package/dist/agents/development/api.js +116 -0
  8. package/dist/agents/development/backend.js +82 -0
  9. package/dist/agents/development/coder.js +207 -0
  10. package/dist/agents/development/database.js +81 -0
  11. package/dist/agents/development/debugger.js +234 -0
  12. package/dist/agents/development/devops.js +84 -0
  13. package/dist/agents/development/frontend.js +83 -0
  14. package/dist/agents/development/migration.js +141 -0
  15. package/dist/agents/development/performance.js +142 -0
  16. package/dist/agents/development/refactor.js +85 -0
  17. package/dist/agents/development/reviewer.js +260 -0
  18. package/dist/agents/development/tester.js +143 -0
  19. package/dist/agents/executor.js +144 -0
  20. package/dist/agents/memory/context-manager.js +167 -0
  21. package/dist/agents/memory/decision-logger.js +157 -0
  22. package/dist/agents/memory/knowledge-base.js +120 -0
  23. package/dist/agents/memory/pattern-learner.js +140 -0
  24. package/dist/agents/memory/project-mapper.js +114 -0
  25. package/dist/agents/quality/accessibility.js +89 -0
  26. package/dist/agents/quality/code-quality.js +109 -0
  27. package/dist/agents/quality/compatibility.js +55 -0
  28. package/dist/agents/quality/documentation.js +95 -0
  29. package/dist/agents/quality/error-handling.js +87 -0
  30. package/dist/agents/research/competitor-analyzer.js +44 -0
  31. package/dist/agents/research/cost-analyzer.js +51 -0
  32. package/dist/agents/research/estimator.js +57 -0
  33. package/dist/agents/research/ethics-bias.js +111 -0
  34. package/dist/agents/research/researcher.js +112 -0
  35. package/dist/agents/research/risk-assessor.js +61 -0
  36. package/dist/agents/research/tech-advisor.js +52 -0
  37. package/dist/agents/security/auth.js +269 -0
  38. package/dist/agents/security/dependency-audit.js +273 -0
  39. package/dist/agents/security/penetration.js +245 -0
  40. package/dist/agents/security/privacy.js +259 -0
  41. package/dist/agents/security/scanner.js +288 -0
  42. package/dist/agents/security/secrets.js +212 -0
  43. package/dist/agents/types.js +2 -0
  44. package/dist/agents/workflow/automation.js +56 -0
  45. package/dist/agents/workflow/file-manager.js +49 -0
  46. package/dist/agents/workflow/git-agent.js +52 -0
  47. package/dist/agents/workflow/reporter.js +48 -0
  48. package/dist/agents/workflow/search-agent.js +39 -0
  49. package/dist/agents/workflow/task-coordinator.js +40 -0
  50. package/dist/agents/workflow/task-planner.js +46 -0
  51. package/dist/cli.js +132 -0
  52. package/dist/council/decision-engine.js +136 -0
  53. package/dist/council/devil-advocate.js +106 -0
  54. package/dist/council/index.js +37 -0
  55. package/dist/council/lead-developer.js +108 -0
  56. package/dist/council/legal-compliance.js +142 -0
  57. package/dist/council/product-manager.js +92 -0
  58. package/dist/council/security.js +162 -0
  59. package/dist/council/system-architect.js +122 -0
  60. package/dist/council/types.js +2 -0
  61. package/dist/council/ux-designer.js +109 -0
  62. package/dist/memory/local.js +182 -0
  63. package/dist/memory/schema.js +116 -0
  64. package/dist/memory/sync.js +199 -0
  65. package/dist/router/complexity-scorer.js +78 -0
  66. package/dist/router/context-compressor.js +58 -0
  67. package/dist/router/index.js +29 -0
  68. package/dist/router/learning-updater.js +186 -0
  69. package/dist/router/model-selector.js +51 -0
  70. package/dist/router/rate-monitor.js +73 -0
  71. package/dist/server.js +949 -0
  72. package/dist/skills/development/skill-api-design.js +313 -0
  73. package/dist/skills/development/skill-auth.js +255 -0
  74. package/dist/skills/development/skill-ci-cd.js +2 -0
  75. package/dist/skills/development/skill-crud.js +193 -0
  76. package/dist/skills/development/skill-db-schema.js +2 -0
  77. package/dist/skills/development/skill-docker.js +2 -0
  78. package/dist/skills/development/skill-env-setup.js +2 -0
  79. package/dist/skills/development/skill-scaffold.js +299 -0
  80. package/dist/skills/intelligence/skill-complexity-score.js +66 -0
  81. package/dist/skills/intelligence/skill-cost-track.js +36 -0
  82. package/dist/skills/intelligence/skill-learning-loop.js +66 -0
  83. package/dist/skills/intelligence/skill-pattern-detect.js +35 -0
  84. package/dist/skills/intelligence/skill-rate-watch.js +58 -0
  85. package/dist/skills/memory/skill-context-compress.js +82 -0
  86. package/dist/skills/memory/skill-cross-sync.js +88 -0
  87. package/dist/skills/memory/skill-decision-log.js +103 -0
  88. package/dist/skills/memory/skill-session-restore.js +44 -0
  89. package/dist/skills/memory/skill-session-save.js +78 -0
  90. package/dist/skills/quality/skill-accessibility.js +2 -0
  91. package/dist/skills/quality/skill-code-review.js +60 -0
  92. package/dist/skills/quality/skill-docs-gen.js +2 -0
  93. package/dist/skills/quality/skill-perf-audit.js +2 -0
  94. package/dist/skills/quality/skill-security-scan.js +67 -0
  95. package/dist/skills/quality/skill-test-suite.js +274 -0
  96. package/dist/skills/workflow/skill-deploy.js +2 -0
  97. package/dist/skills/workflow/skill-git-workflow.js +2 -0
  98. package/dist/skills/workflow/skill-rollback.js +2 -0
  99. package/dist/skills/workflow/skill-task-breakdown.js +2 -0
  100. package/package.json +30 -0
  101. package/src/adapters/claude.ts +70 -0
  102. package/src/adapters/codex.ts +71 -0
  103. package/src/adapters/gemini.ts +71 -0
  104. package/src/adapters/index.ts +217 -0
  105. package/src/agents/development/api.ts +120 -0
  106. package/src/agents/development/backend.ts +85 -0
  107. package/src/agents/development/coder.ts +213 -0
  108. package/src/agents/development/database.ts +83 -0
  109. package/src/agents/development/debugger.ts +238 -0
  110. package/src/agents/development/devops.ts +86 -0
  111. package/src/agents/development/frontend.ts +85 -0
  112. package/src/agents/development/migration.ts +144 -0
  113. package/src/agents/development/performance.ts +144 -0
  114. package/src/agents/development/refactor.ts +86 -0
  115. package/src/agents/development/reviewer.ts +268 -0
  116. package/src/agents/development/tester.ts +151 -0
  117. package/src/agents/executor.ts +158 -0
  118. package/src/agents/memory/context-manager.ts +171 -0
  119. package/src/agents/memory/decision-logger.ts +160 -0
  120. package/src/agents/memory/knowledge-base.ts +124 -0
  121. package/src/agents/memory/pattern-learner.ts +143 -0
  122. package/src/agents/memory/project-mapper.ts +118 -0
  123. package/src/agents/quality/accessibility.ts +99 -0
  124. package/src/agents/quality/code-quality.ts +115 -0
  125. package/src/agents/quality/compatibility.ts +58 -0
  126. package/src/agents/quality/documentation.ts +105 -0
  127. package/src/agents/quality/error-handling.ts +96 -0
  128. package/src/agents/research/competitor-analyzer.ts +45 -0
  129. package/src/agents/research/cost-analyzer.ts +54 -0
  130. package/src/agents/research/estimator.ts +60 -0
  131. package/src/agents/research/ethics-bias.ts +113 -0
  132. package/src/agents/research/researcher.ts +114 -0
  133. package/src/agents/research/risk-assessor.ts +63 -0
  134. package/src/agents/research/tech-advisor.ts +55 -0
  135. package/src/agents/security/auth.ts +287 -0
  136. package/src/agents/security/dependency-audit.ts +337 -0
  137. package/src/agents/security/penetration.ts +262 -0
  138. package/src/agents/security/privacy.ts +285 -0
  139. package/src/agents/security/scanner.ts +322 -0
  140. package/src/agents/security/secrets.ts +249 -0
  141. package/src/agents/types.ts +66 -0
  142. package/src/agents/workflow/automation.ts +59 -0
  143. package/src/agents/workflow/file-manager.ts +52 -0
  144. package/src/agents/workflow/git-agent.ts +55 -0
  145. package/src/agents/workflow/reporter.ts +51 -0
  146. package/src/agents/workflow/search-agent.ts +40 -0
  147. package/src/agents/workflow/task-coordinator.ts +41 -0
  148. package/src/agents/workflow/task-planner.ts +47 -0
  149. package/src/cli.ts +143 -0
  150. package/src/council/decision-engine.ts +171 -0
  151. package/src/council/devil-advocate.ts +116 -0
  152. package/src/council/index.ts +44 -0
  153. package/src/council/lead-developer.ts +118 -0
  154. package/src/council/legal-compliance.ts +152 -0
  155. package/src/council/product-manager.ts +102 -0
  156. package/src/council/security.ts +172 -0
  157. package/src/council/system-architect.ts +132 -0
  158. package/src/council/types.ts +33 -0
  159. package/src/council/ux-designer.ts +121 -0
  160. package/src/memory/local.ts +305 -0
  161. package/src/memory/schema.ts +174 -0
  162. package/src/memory/sync.ts +274 -0
  163. package/src/router/complexity-scorer.ts +96 -0
  164. package/src/router/context-compressor.ts +74 -0
  165. package/src/router/index.ts +60 -0
  166. package/src/router/learning-updater.ts +271 -0
  167. package/src/router/model-selector.ts +83 -0
  168. package/src/router/rate-monitor.ts +103 -0
  169. package/src/server.ts +1038 -0
  170. package/src/skills/development/skill-api-design.ts +329 -0
  171. package/src/skills/development/skill-auth.ts +271 -0
  172. package/src/skills/development/skill-ci-cd.ts +0 -0
  173. package/src/skills/development/skill-crud.ts +209 -0
  174. package/src/skills/development/skill-db-schema.ts +0 -0
  175. package/src/skills/development/skill-docker.ts +0 -0
  176. package/src/skills/development/skill-env-setup.ts +0 -0
  177. package/src/skills/development/skill-scaffold.ts +323 -0
  178. package/src/skills/intelligence/skill-complexity-score.ts +69 -0
  179. package/src/skills/intelligence/skill-cost-track.ts +39 -0
  180. package/src/skills/intelligence/skill-learning-loop.ts +69 -0
  181. package/src/skills/intelligence/skill-pattern-detect.ts +38 -0
  182. package/src/skills/intelligence/skill-rate-watch.ts +61 -0
  183. package/src/skills/memory/skill-context-compress.ts +98 -0
  184. package/src/skills/memory/skill-cross-sync.ts +104 -0
  185. package/src/skills/memory/skill-decision-log.ts +119 -0
  186. package/src/skills/memory/skill-session-restore.ts +59 -0
  187. package/src/skills/memory/skill-session-save.ts +94 -0
  188. package/src/skills/quality/skill-accessibility.ts +0 -0
  189. package/src/skills/quality/skill-code-review.ts +84 -0
  190. package/src/skills/quality/skill-docs-gen.ts +0 -0
  191. package/src/skills/quality/skill-perf-audit.ts +0 -0
  192. package/src/skills/quality/skill-security-scan.ts +91 -0
  193. package/src/skills/quality/skill-test-suite.ts +290 -0
  194. package/src/skills/workflow/skill-deploy.ts +0 -0
  195. package/src/skills/workflow/skill-git-workflow.ts +0 -0
  196. package/src/skills/workflow/skill-rollback.ts +0 -0
  197. package/src/skills/workflow/skill-task-breakdown.ts +0 -0
  198. package/tsconfig.json +20 -0
@@ -0,0 +1,66 @@
1
+ // Skill: learning-loop — how to feed outcome data back into the router and agents
2
+ export function run(input) {
3
+ return {
4
+ skill: 'learning-loop',
5
+ template: `
6
+ // ── Learning Loop Protocol ────────────────────────────────────────────────
7
+ //
8
+ // The router gets smarter when you record task outcomes.
9
+ // Without outcome data, thresholds stay at the default 30/70 forever.
10
+ //
11
+ // Step 1: Complete a task
12
+ //
13
+ // Step 2: Score the output quality (0–100):
14
+ // 90–100 Excellent — exactly what was needed, no revision required
15
+ // 70–89 Good — minor revisions needed
16
+ // 50–69 Acceptable — significant revision needed but usable
17
+ // 30–49 Poor — required a full rewrite
18
+ // 0–29 Failed — output was wrong or harmful
19
+ //
20
+ // Step 3: Record via veto_record_outcome:
21
+ // {
22
+ // task_type: "write-auth-middleware", // short label, consistent naming helps
23
+ // complexity: 58, // from veto_route_task result
24
+ // model_tier: 2, // tier that was actually used
25
+ // agent: "coder", // agent type used
26
+ // output_quality: 87, // your score
27
+ // tokens_used: 1240 // optional but useful
28
+ // }
29
+ //
30
+ // Step 4: After 20+ outcomes: call veto_learning_apply
31
+ // The router reads the quality data and adjusts tier1_max and tier2_max
32
+ // Adjustment is conservative — it needs 20+ data points to act
33
+ //
34
+ // Step 5: Check veto_learning_stats to see what changed
35
+ `.trim(),
36
+ checklist: [
37
+ 'Record every task outcome, not just the bad ones — the loop needs both successes and failures',
38
+ 'Use consistent task_type labels across sessions (e.g. "write-unit-tests" not "tests")',
39
+ 'Score output quality honestly — over-reporting quality prevents threshold improvement',
40
+ 'Include tokens_used when possible — this feeds cost/quality optimisation',
41
+ 'Call veto_learning_apply after every 10 new outcomes to keep thresholds current',
42
+ 'Call veto_learning_stats monthly to review the tier distribution and agent performance',
43
+ 'If an agent consistently scores below 70%: check veto_agent_performance_stats for patterns',
44
+ 'Council insights: review veto_council_insights monthly to see if any GREEN verdicts led to debugging',
45
+ ],
46
+ patterns: [
47
+ 'Consistent labelling: task_type labels that vary prevent pattern detection ("test" vs "write-tests" vs "unit-tests" are invisible to the loop)',
48
+ 'Regular application: apply thresholds every 10 outcomes — waiting for 100 delays improvement by months',
49
+ 'Quality honesty: the loop self-corrects only when quality scores reflect reality',
50
+ 'Council correlation: the council insights loop needs decisions logged with veto_memory_store to work',
51
+ ],
52
+ gotchas: [
53
+ 'Only recording failures — a loop trained on failures sees everything as over-tiered',
54
+ 'Inconsistent task_type labels — "auth", "authentication", "write-auth" look like three different task types',
55
+ 'Not calling veto_learning_apply — recording outcomes without applying has zero effect on routing',
56
+ 'Applying thresholds with fewer than 20 data points — results will be noisy and unreliable',
57
+ ],
58
+ resources: [
59
+ 'veto_record_outcome — record a task quality score',
60
+ 'veto_learning_apply — apply recorded outcomes to adjust tier thresholds',
61
+ 'veto_learning_stats — view tier distribution, agent performance, and suggested thresholds',
62
+ 'veto_council_insights — review council decisions correlated with debugging sessions',
63
+ ],
64
+ };
65
+ }
66
+ //# sourceMappingURL=skill-learning-loop.js.map
@@ -0,0 +1,35 @@
1
+ // Skill: pattern-detect — find repeated patterns and anti-patterns in a codebase
2
+ export function run(input) {
3
+ return {
4
+ skill: 'pattern-detect',
5
+ checklist: [
6
+ 'Call veto_patterns_list to load all stored coding patterns before scanning',
7
+ 'Scan the 5 most recently modified files for structural patterns (not style — structure)',
8
+ 'Look for: repeated try/catch shapes, recurring if/else chains, duplicated utility logic',
9
+ 'Look for anti-patterns: N+1 loops, empty catch blocks, hardcoded magic strings/numbers',
10
+ 'Compare found patterns against stored patterns — update confidence via veto_pattern_store',
11
+ 'New patterns not yet stored: add via veto_pattern_store with a category.name key format',
12
+ 'Anti-patterns found: flag them via veto_memory_store (type="pattern", title="Anti-pattern: X")',
13
+ 'After scanning: call veto_agent_plan with agent="pattern-learner" for deeper style analysis',
14
+ ],
15
+ patterns: [
16
+ 'Structure over style: detect structural patterns (how code is organised) not style (how it is formatted)',
17
+ 'Frequency threshold: a pattern seen in 3+ files is established; seen in 1–2 files is tentative',
18
+ 'Anti-pattern distinction: store anti-patterns separately with "Anti-pattern:" title prefix',
19
+ 'Confidence accumulation: every confirmed observation of a pattern increments its confidence score',
20
+ ],
21
+ gotchas: [
22
+ 'Detecting style instead of structure — style is enforced by a linter; pattern detection adds no value there',
23
+ 'Flagging intentional deviations as anti-patterns — some files deliberately break the pattern (e.g. test fixtures)',
24
+ 'Not updating stored patterns when the codebase evolves — stale patterns mislead future agents',
25
+ 'Storing too-specific patterns ("function X uses this exact shape") vs. too-generic ("uses functions")',
26
+ ],
27
+ resources: [
28
+ 'veto_patterns_list — list all stored patterns with confidence scores',
29
+ 'veto_pattern_store — add or update a pattern',
30
+ 'veto_memory_store (type="pattern") — store anti-patterns and architectural patterns',
31
+ 'veto_agent_plan with agent="pattern-learner" — deeper coding style analysis',
32
+ ],
33
+ };
34
+ }
35
+ //# sourceMappingURL=skill-pattern-detect.js.map
@@ -0,0 +1,58 @@
1
+ // Skill: rate-watch — monitor AI rate limits and trigger platform switches proactively
2
+ export function run(input) {
3
+ return {
4
+ skill: 'rate-watch',
5
+ template: `
6
+ // ── Rate Limit Thresholds ─────────────────────────────────────────────────
7
+ //
8
+ // 0–69% Green zone — normal routing, no action needed
9
+ // 70–89% Warning — Tier 1/2 auto-routes to Gemini/Codex
10
+ // Tier 3 stays on Claude (too important to downgrade)
11
+ // 90%+ Critical — all tasks routed to Gemini/Codex
12
+ // Non-urgent work queued for reset
13
+ //
14
+ // Cross-platform switch (manual):
15
+ //
16
+ // Claude at 90%+ mid-task?
17
+ // 1. Call veto_session_save (capture current state)
18
+ // 2. Note the session ID
19
+ // 3. Open Gemini terminal
20
+ // 4. Call veto_session_restore {session_id}
21
+ // 5. Continue — Gemini has full context
22
+ // Total interruption: under 10 seconds
23
+ //
24
+ // All platforms at limit simultaneously?
25
+ // Check veto_rate_status for reset times
26
+ // Work on tasks that don't need AI (docs, planning, code review checklists)
27
+ // Auto-resumes when first platform resets
28
+ `.trim(),
29
+ checklist: [
30
+ 'Call veto_rate_status at the start of long sessions to check headroom',
31
+ 'At 70%: start Tier 1/2 tasks on Gemini/Codex proactively instead of waiting for auto-routing',
32
+ 'At 80%: save the current session via veto_session_save as a precaution',
33
+ 'At 90%: switch platform manually using veto_session_save → veto_session_restore',
34
+ 'At 100%: check reset times from veto_rate_status, switch to non-AI tasks until reset',
35
+ 'After a platform switch: verify the session restored correctly before continuing',
36
+ 'Prefer Gemini for T1/T2 overflow — it has higher rate limits on the free tier',
37
+ ],
38
+ patterns: [
39
+ 'Proactive switch at 80%: switching before hitting 90% avoids a mid-task interruption',
40
+ 'Session save at 70%: ensures context is preserved if a hard limit is hit unexpectedly',
41
+ 'Platform diversity: using two platforms in parallel halves the effective rate limit pressure',
42
+ 'Tier-based overflow: only T1/T2 overflow — never route T3 to a lower-capability model',
43
+ ],
44
+ gotchas: [
45
+ 'Switching platforms without saving the session — the receiving platform starts blind',
46
+ 'Routing Tier 3 tasks to Gemini Flash or Haiku to avoid rate limits — quality loss is not worth it',
47
+ 'Not checking rate status before a long task — hitting the limit mid-migration is high risk',
48
+ 'Forgetting that rate limits reset daily at midnight UTC — a limit today may reset in 2 hours',
49
+ ],
50
+ resources: [
51
+ 'veto_rate_status — current usage % and advisory for all platforms',
52
+ 'veto_route_task — routes tasks to the least-loaded platform automatically',
53
+ 'veto_session_save — save context before switching platforms',
54
+ 'veto_session_restore — restore on the receiving platform',
55
+ ],
56
+ };
57
+ }
58
+ //# sourceMappingURL=skill-rate-watch.js.map
@@ -0,0 +1,82 @@
1
+ // Skill: context-compress — when and how to compress context before model calls
2
+ const TEMPLATE = `
3
+ // ── Context Compression Protocol ─────────────────────────────────────────
4
+ //
5
+ // Apply when token count > 8,000 or before any cross-platform handoff.
6
+ // Target: < 30% of original token count, zero loss of active constraints.
7
+ //
8
+ // Compression tiers:
9
+ //
10
+ // TIER 1 — Keep verbatim (never compress):
11
+ // - Active blockers that require human input
12
+ // - Open decisions that have not been resolved
13
+ // - File paths of files currently being modified
14
+ // - The single next action
15
+ // - Error messages that have not been diagnosed
16
+ //
17
+ // TIER 2 — Compress to 1–3 sentences:
18
+ // - Completed subtasks (collapse to "✓ Implemented X")
19
+ // - Read-back confirmations ("confirmed the file exists")
20
+ // - Resolved blockers ("fixed: dependency conflict — used --legacy-peer-deps")
21
+ // - Prior session context (collapse to a 2-sentence progress summary)
22
+ //
23
+ // TIER 3 — Drop entirely:
24
+ // - Superseded decisions (replaced by a newer ADR)
25
+ // - Files read but not modified and not needed going forward
26
+ // - Exploratory steps that led to dead ends and have been abandoned
27
+ // - Console output that has already been analyzed
28
+ //
29
+ // Compressed context shape:
30
+ {
31
+ "phase": "implementing",
32
+ "completed": ["Brief one-liner per completed subtask"],
33
+ "inProgress": "The exact current subtask in one sentence",
34
+ "remaining": ["Ordered list of remaining subtasks"],
35
+ "activeConstraints": ["Each constraint in one sentence"],
36
+ "openDecisions": [{ "question": "...", "options": ["A", "B"] }],
37
+ "blockers": ["Any current blocker with full detail"],
38
+ "keyFiles": ["Only files still needed going forward"],
39
+ "nextAction": "Single concrete step — unambiguous"
40
+ }
41
+ `.trim();
42
+ export function run(input) {
43
+ return {
44
+ skill: 'context-compress',
45
+ template: TEMPLATE,
46
+ checklist: [
47
+ 'Measure the current context token estimate before compressing',
48
+ 'Apply compression only when token count exceeds 8,000 or before a platform handoff',
49
+ 'Identify Tier 1 items first — these are never touched',
50
+ 'Identify Tier 3 items — drop them completely without summarising',
51
+ 'For Tier 2 items: write one sentence per completed subtask; the reader does not need the history',
52
+ 'Preserve the full text of any active blocker — the receiving agent must understand it in full',
53
+ 'Preserve the nextAction as a concrete step, not "continue the task"',
54
+ 'After compressing: verify the compressed context is complete by simulating a cold-start agent reading it',
55
+ 'Save the compressed context via veto_session_save before switching context',
56
+ 'Target a compression ratio of at least 3:1 — if you cannot achieve this, you have too many Tier 1 items',
57
+ 'Do not compress active error messages — they need full context to diagnose',
58
+ 'Do not summarise open decisions — they need all options preserved',
59
+ ],
60
+ patterns: [
61
+ 'Tier-based compression: verbatim | summarise | drop — never binary keep/delete',
62
+ 'Cold-start test: can a fresh agent read the compressed context and continue the task without questions?',
63
+ 'Constraint-first ordering: active constraints at the top, history at the bottom',
64
+ 'Forward-only compression: compress backward-looking content, not forward-looking content',
65
+ ],
66
+ gotchas: [
67
+ 'Compressing active constraints as if they were completed work — causes silent violations in the next session',
68
+ 'Summarising blockers instead of preserving them verbatim — the receiving agent gets a vague summary and cannot resolve the blocker',
69
+ 'Dropping unresolved error messages — the receiving agent restarts diagnosis from scratch',
70
+ 'Targeting a fixed token count without checking completeness — may cut load-bearing context',
71
+ 'Not saving the compressed context — the compression is lost on the next context switch',
72
+ 'Treating all prior session content as droppable — some prior-session decisions are still active constraints',
73
+ ],
74
+ resources: [
75
+ 'Use veto_route_task with context= to get the router\'s compression estimate',
76
+ 'Use veto_session_save to persist the compressed context',
77
+ 'Use veto_memory_store to permanently record key decisions before they are compressed away',
78
+ 'The compression target is based on the router\'s context-compressor module heuristics',
79
+ ],
80
+ };
81
+ }
82
+ //# sourceMappingURL=skill-context-compress.js.map
@@ -0,0 +1,88 @@
1
+ // Skill: cross-sync — how to move veto memory between machines using file export/import
2
+ const TEMPLATE = `
3
+ // ── Cross-Machine Memory Transfer ────────────────────────────────────────
4
+ //
5
+ // Veto stores everything in ~/.veto/veto.db (SQLite).
6
+ // To continue work on another machine: export → copy → import.
7
+ //
8
+ // No external services. No accounts. No env vars.
9
+ //
10
+ // ── Step 1: Export on Machine A ───────────────────────────────────────────
11
+ //
12
+ // veto_memory_export
13
+ // → writes to ~/.veto/veto-export.json by default
14
+ // → or specify output_path to write directly to shared storage
15
+ //
16
+ // Example with shared storage:
17
+ // veto_memory_export { output_path: "/Users/you/Dropbox/veto-export.json" }
18
+ //
19
+ // ── Step 2: Copy the file ─────────────────────────────────────────────────
20
+ //
21
+ // Options (pick any):
22
+ // • Dropbox / OneDrive / Google Drive — put output_path in your sync folder
23
+ // • USB drive
24
+ // • scp / rsync over SSH
25
+ // • Email / messaging app
26
+ // • AirDrop (Mac)
27
+ //
28
+ // ── Step 3: Import on Machine B ───────────────────────────────────────────
29
+ //
30
+ // veto_memory_import { input_path: "/path/to/veto-export.json" }
31
+ // → merges into local ~/.veto/veto.db
32
+ // → INSERT OR IGNORE — local rows are never overwritten
33
+ // → returns { merged: {...}, skipped: {...} } showing what was added
34
+ //
35
+ // ── Step 4: Verify and resume ─────────────────────────────────────────────
36
+ //
37
+ // veto_sessions_list — confirm sessions arrived
38
+ // veto_session_restore { id } — load the session you want to continue
39
+ // veto_memory_search { query } — confirm knowledge base arrived
40
+ //
41
+ // ── What gets exported ────────────────────────────────────────────────────
42
+ //
43
+ // sessions — all saved sessions with task state and context
44
+ // decisions — all logged decisions and rationale
45
+ // knowledge_base — all stored solutions, patterns, errors, references
46
+ // patterns — coding style and convention patterns
47
+ // project_map — codebase structure maps
48
+ // council_outcomes — all council debate results
49
+ `.trim();
50
+ export function run(input) {
51
+ return {
52
+ skill: 'cross-sync',
53
+ template: TEMPLATE,
54
+ checklist: [
55
+ 'Before leaving Machine A: call veto_memory_export to create the export file',
56
+ 'Check the export result — confirm row counts look right for sessions and knowledge_base',
57
+ 'Copy the export file to Machine B via any method (Dropbox, USB, scp, etc.)',
58
+ 'On Machine B: call veto_memory_import with the file path',
59
+ 'Check the import result — merged counts show what was added, skipped counts show duplicates',
60
+ 'Call veto_sessions_list to confirm the sessions you need are present',
61
+ 'Call veto_session_restore with the session ID to load your prior context',
62
+ 'Call veto_memory_search to confirm knowledge base entries are available',
63
+ 'If working across multiple machines regularly: use a shared folder (Dropbox) as output_path so no manual copy is needed',
64
+ 'After significant work on Machine B: run veto_memory_export again before switching back',
65
+ ],
66
+ patterns: [
67
+ 'Export-before-switch: always export before ending a session, not only when switching machines',
68
+ 'Shared-folder shortcut: point output_path at a Dropbox/OneDrive folder — no manual copy step',
69
+ 'Merge semantics: INSERT OR IGNORE means both machines can export/import in any order without data loss',
70
+ 'Verify-after-import: always call veto_sessions_list after import to confirm data arrived before starting work',
71
+ ],
72
+ gotchas: [
73
+ 'Forgetting to export before switching — Machine B starts with no memory of Machine A\'s work',
74
+ 'Importing a stale export (from yesterday) — you lose today\'s work on Machine A; always export fresh',
75
+ 'The export file is plain JSON — it contains your session context. Don\'t commit it to a public git repo',
76
+ 'Pattern merge adds seen_counts from both machines — this is intentional (more observations = higher confidence)',
77
+ 'INSERT OR IGNORE means if Machine B already has a session with the same ID, it is not updated. Export fresh from Machine A if you need the latest version of a session',
78
+ ],
79
+ resources: [
80
+ 'veto_memory_export — export all memory to JSON (default path: ~/.veto/veto-export.json)',
81
+ 'veto_memory_import — import and merge JSON into local SQLite',
82
+ 'veto_sessions_list — verify sessions after import',
83
+ 'veto_session_restore — load a specific session to resume work',
84
+ 'veto_memory_search — verify knowledge base after import',
85
+ ],
86
+ };
87
+ }
88
+ //# sourceMappingURL=skill-cross-sync.js.map
@@ -0,0 +1,103 @@
1
+ // Skill: decision-log — guide to logging architectural and design decisions
2
+ const TEMPLATE = `
3
+ // ── Decision Log Entry ────────────────────────────────────────────────────
4
+ //
5
+ // Use this template for any decision that is:
6
+ // - Non-obvious (a reasonable engineer could choose differently)
7
+ // - Hard to reverse (schema changes, API contracts, auth architecture)
8
+ // - Frequently re-discussed (keeps relitigating the same debate)
9
+ // - A deliberate trade-off (performance vs correctness, simplicity vs flexibility)
10
+ //
11
+ {
12
+ "id": "ADR-001", // Sequential ID for referencing
13
+ "title": "Use JWT with rotating refresh tokens for authentication",
14
+ "status": "accepted", // proposed | accepted | deprecated | superseded-by:ADR-xxx
15
+ "date": "2026-05-01",
16
+ "deciders": ["agent:auth", "human:alice"],
17
+
18
+ "context": "We need an authentication mechanism for a stateless REST API that will be consumed by a mobile app and a web SPA. Session cookies are not ideal for the mobile client.",
19
+
20
+ "decision": "Implement stateless JWTs for access (15-minute TTL) with rotating refresh tokens stored server-side in a database table.",
21
+
22
+ "rationale": "JWTs allow stateless verification on every request without a DB lookup. Refresh token rotation limits the window of token theft. httpOnly cookies for refresh tokens prevent XSS access.",
23
+
24
+ "alternatives": [
25
+ {
26
+ "option": "Server-side sessions with Redis",
27
+ "pros": ["Instant revocation", "No JWT complexity"],
28
+ "cons": ["Requires Redis infrastructure", "Not stateless — every request hits Redis", "Mobile clients struggle with cookie-based sessions"],
29
+ "rejected_because": "Adds Redis dependency; poor fit for mobile client"
30
+ },
31
+ {
32
+ "option": "Long-lived JWTs with no refresh",
33
+ "pros": ["Simple implementation"],
34
+ "cons": ["Cannot revoke without infrastructure", "Long-lived tokens are a large attack window"],
35
+ "rejected_because": "Unacceptable security risk if token is stolen"
36
+ }
37
+ ],
38
+
39
+ "consequences": {
40
+ "positive": [
41
+ "Stateless verification — no DB lookup per request",
42
+ "Refresh token rotation limits theft window to 15 minutes",
43
+ "Mobile and web clients use the same auth mechanism"
44
+ ],
45
+ "negative": [
46
+ "Access tokens cannot be revoked before expiry (15-minute window)",
47
+ "Requires refresh token table with periodic cleanup job",
48
+ "More complex than simple sessions"
49
+ ],
50
+ "neutral": [
51
+ "JWT library (jsonwebtoken) must be kept up to date for security patches"
52
+ ]
53
+ },
54
+
55
+ "references": [
56
+ "OWASP Authentication Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html",
57
+ "RFC 6749 OAuth 2.0 Bearer Tokens",
58
+ "Related implementation: src/services/auth.service.ts"
59
+ ]
60
+ }
61
+ `.trim();
62
+ export function run(input) {
63
+ return {
64
+ skill: 'decision-log',
65
+ template: TEMPLATE,
66
+ checklist: [
67
+ 'Log the decision as soon as it is made — memory fades quickly and context is lost',
68
+ 'Assign a sequential ID (ADR-001, ADR-002) to enable referencing in code comments and PRs',
69
+ 'Write the context section first: describe the forces and constraints that made a choice necessary',
70
+ 'State the decision explicitly and unambiguously — one clear sentence of what was decided',
71
+ 'Document the rationale: why this option over the alternatives?',
72
+ 'List at least two alternatives that were genuinely considered, not just strawmen',
73
+ 'For each alternative, record pros, cons, and the specific reason it was rejected',
74
+ 'Document positive, negative, and neutral consequences of the chosen option',
75
+ 'Set the status field: proposed → accepted → deprecated or superseded-by:ADR-xxx',
76
+ 'Add file references so future engineers can find the implementation',
77
+ 'Reference the decision ID in relevant code comments: // See ADR-001',
78
+ 'Store the decision log in docs/decisions/ or as a session memory entry',
79
+ 'Update the status to "deprecated" or "superseded" when the decision changes — never delete',
80
+ 'Review the decision log when revisiting a design — check if the original constraints still apply',
81
+ ],
82
+ patterns: [
83
+ 'Architecture Decision Record (ADR) format: context → decision → rationale → alternatives → consequences',
84
+ 'Decision-in-context: link from code to the decision that explains the design choice',
85
+ 'Living document: update status when decisions change rather than deleting entries',
86
+ 'Lightweight ADR: one file per decision, stored in git alongside the code it describes',
87
+ ],
88
+ gotchas: [
89
+ 'Writing the decision without the rationale — future engineers will not know why, only what',
90
+ 'Only documenting the chosen option without listing alternatives — looks like no thought went into it',
91
+ 'Not updating stale decisions — a deprecated decision still marked "accepted" causes confusion',
92
+ 'Writing the ADR after the fact with the benefit of hindsight — capture the original thinking at decision time',
93
+ 'Logging trivial decisions — reserve the log for non-obvious choices; not every variable name needs an ADR',
94
+ ],
95
+ resources: [
96
+ 'https://adr.github.io/ (Architectural Decision Records overview)',
97
+ 'https://github.com/joelparkerhenderson/architecture-decision-record (templates and examples)',
98
+ 'https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions (original Michael Nygard post)',
99
+ 'https://www.thoughtworks.com/radar/techniques/lightweight-architecture-decision-records',
100
+ ],
101
+ };
102
+ }
103
+ //# sourceMappingURL=skill-decision-log.js.map
@@ -0,0 +1,44 @@
1
+ // Skill: session-restore — guide to restoring context from a saved session
2
+ export function run(input) {
3
+ return {
4
+ skill: 'session-restore',
5
+ template: undefined,
6
+ checklist: [
7
+ 'Call veto_sessions_list to get all available saved sessions',
8
+ 'Identify the most relevant session: sort by updatedAt descending, read the task summary',
9
+ 'If multiple sessions match the current task, read the top 2-3 and pick the most recent',
10
+ 'Call veto_session_restore with the selected sessionId to load the full session object',
11
+ 'Read the phase field to understand where work was left off (planning/implementing/reviewing/blocked)',
12
+ 'Read progress.completed to know what has already been done — do not redo this work',
13
+ 'Read progress.inProgress to know the exact subtask that was interrupted',
14
+ 'Read progress.remaining to understand the full remaining scope before starting',
15
+ 'Read decisions to understand constraints and design choices already made — do not revisit them without cause',
16
+ 'Read findings to get codebase context (key files, discovered patterns, constraints)',
17
+ 'Read blockers: if any blockers are listed, address them before continuing other work',
18
+ 'Read nextAction and treat it as the starting instruction for this session',
19
+ 'Re-read any key files mentioned in findings.filePaths before making changes',
20
+ 'Verify that the code state matches expectations: if the session is old, re-check completed items',
21
+ 'Save a new session checkpoint immediately after restoring and verifying context',
22
+ ],
23
+ patterns: [
24
+ 'Restore-verify-continue: always verify actual code state matches what the session recorded before acting',
25
+ 'Trust but verify: session describes intent; re-read key files to confirm they match expectations',
26
+ 'Single source of truth: the saved session is authoritative about decisions and progress',
27
+ 'Restore at the start of every new conversation before doing any work on a multi-session task',
28
+ ],
29
+ gotchas: [
30
+ 'Restoring an old session and acting on stale file paths — files may have been moved or deleted',
31
+ 'Skipping the verify step and redoing work already marked as completed — wastes time and may undo changes',
32
+ 'Picking the wrong session when multiple tasks are in progress — check the task field carefully',
33
+ 'Not saving a new checkpoint after restore — the next session will still start from the old state',
34
+ 'Trusting a session that was saved in a "blocked" state without first resolving the blocker',
35
+ ],
36
+ resources: [
37
+ 'Use the veto_session_restore MCP tool: { sessionId } → returns full session object',
38
+ 'Use the veto_sessions_list MCP tool: returns all sessions sorted by updatedAt',
39
+ 'Use the veto_session_save MCP tool after restoration to record the new starting point',
40
+ 'MCP Session spec: https://modelcontextprotocol.io/docs/concepts/resources',
41
+ ],
42
+ };
43
+ }
44
+ //# sourceMappingURL=skill-session-restore.js.map
@@ -0,0 +1,78 @@
1
+ // Skill: session-save — when and how to save MCP sessions
2
+ const TEMPLATE = `
3
+ // ── What to include in a session save ────────────────────────────────────
4
+ //
5
+ // A session save should capture enough context so that a future agent
6
+ // can resume work without re-reading all the source files.
7
+ //
8
+ // Recommended session object shape:
9
+ {
10
+ "task": "The original task description in one sentence",
11
+ "phase": "planning | implementing | reviewing | blocked | complete",
12
+ "progress": {
13
+ "completed": ["List of finished subtasks or files written"],
14
+ "inProgress": ["Current subtask being worked on"],
15
+ "remaining": ["Subtasks still to do"]
16
+ },
17
+ "decisions": [
18
+ {
19
+ "decision": "What was decided",
20
+ "rationale": "Why this approach was chosen",
21
+ "alternatives": ["Other options that were considered"],
22
+ "timestamp": "ISO 8601 timestamp"
23
+ }
24
+ ],
25
+ "findings": [
26
+ "Any important discoveries that affect future work",
27
+ "File paths of key files that were read or modified",
28
+ "Patterns or constraints discovered in the codebase"
29
+ ],
30
+ "blockers": [
31
+ "Anything preventing progress that needs human input"
32
+ ],
33
+ "nextAction": "The single most important next step to resume work"
34
+ }
35
+ `.trim();
36
+ export function run(input) {
37
+ return {
38
+ skill: 'session-save',
39
+ template: TEMPLATE,
40
+ checklist: [
41
+ 'Save at the start of every new significant phase: planning, implementing, reviewing',
42
+ 'Save after completing each major file or subtask — checkpoint before moving to the next',
43
+ 'Save before any risky operation (file overwrites, schema migrations, destructive commands)',
44
+ 'Save immediately when a blocker is encountered that requires human input',
45
+ 'Save when token context is getting large — a compact save enables a fresh continuation',
46
+ 'Include the original task description verbatim so it is never lost across sessions',
47
+ 'Include current phase: planning / implementing / reviewing / blocked / complete',
48
+ 'Include progress: completed[], inProgress[], remaining[] as concrete task lists',
49
+ 'Include decisions made: decision + rationale + alternatives considered',
50
+ 'Include codebase findings: key file paths discovered, constraints, patterns found',
51
+ 'Include blockers: anything requiring human action before work can continue',
52
+ 'Include nextAction: the single most important next step as a concrete instruction',
53
+ 'Keep each save concise — aim for < 500 tokens; link to files rather than copying content',
54
+ 'Use the veto_session_save MCP tool to persist the session to SQLite',
55
+ 'Verify the save succeeded by calling veto_sessions_list and confirming the session appears',
56
+ ],
57
+ patterns: [
58
+ 'Checkpoint pattern: save after each completed unit of work, not only at the end',
59
+ 'Progressive detail: early saves capture intent; later saves add findings and decisions',
60
+ 'Minimal viable context: save enough to resume, not a full transcript of every action',
61
+ 'Blocker-first save: when stuck, save immediately with the blocker clearly stated',
62
+ ],
63
+ gotchas: [
64
+ 'Not saving before a context switch — the next session starts blind without a save',
65
+ 'Saving too much detail — a 5,000-token session save is expensive to restore and read',
66
+ 'Forgetting to include nextAction — the restoring agent does not know where to start',
67
+ 'Saving only at the very end — if the task fails partway through, the intermediate work is lost',
68
+ 'Using vague phase descriptions ("working") instead of concrete phases (implementing step 3 of 7)',
69
+ ],
70
+ resources: [
71
+ 'Use the veto_session_save MCP tool: { sessionId, task, phase, progress, decisions, findings }',
72
+ 'Use the veto_sessions_list MCP tool to verify saves and list available sessions',
73
+ 'Use the veto_session_restore MCP tool to reload a previous session',
74
+ 'MCP Session spec: https://modelcontextprotocol.io/docs/concepts/resources',
75
+ ],
76
+ };
77
+ }
78
+ //# sourceMappingURL=skill-session-save.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=skill-accessibility.js.map
@@ -0,0 +1,60 @@
1
+ // Skill: code-review — 20-point code review checklist
2
+ export function run(input) {
3
+ return {
4
+ skill: 'code-review',
5
+ template: undefined,
6
+ checklist: [
7
+ // Correctness (1-4)
8
+ '1. CORRECTNESS — Does the code do what the PR description says? Walk through the logic manually with a concrete example.',
9
+ '2. EDGE CASES — Does it handle null/undefined, empty collections, zero, negative numbers, very large inputs, and concurrent calls correctly?',
10
+ '3. ERROR HANDLING — Are all errors caught, typed, and handled? No silent swallowed errors, no bare catch blocks that discard the error.',
11
+ '4. CONCURRENCY — Does shared mutable state have proper synchronisation? Are async operations correctly awaited? No floating promises.',
12
+ // Security (5-7)
13
+ '5. INPUT VALIDATION — Is all user-supplied input validated with a schema library (zod/joi) before use? No raw string concatenation into queries.',
14
+ '6. AUTHENTICATION & AUTHORISATION — Does every data-access path check that the requesting user owns the resource? Is auth middleware applied?',
15
+ '7. SECRETS — No hardcoded credentials, API keys, or tokens in the diff. No sensitive values logged or included in error responses.',
16
+ // Performance (8-9)
17
+ '8. N+1 QUERIES — Are list endpoints fetching related records in a loop? Use batch/include/join instead.',
18
+ '9. COMPLEXITY — Are there any O(n²) or worse algorithms on large datasets? Is database access inside a loop?',
19
+ // Types and naming (10-12)
20
+ '10. TYPES — Is TypeScript used strictly (no `any`, no type assertions without comment)? Are interfaces and return types explicit on public functions?',
21
+ '11. NAMING — Are variables, functions, and classes named clearly and consistently? Do boolean variables use is/has/should prefixes?',
22
+ '12. MAGIC VALUES — Are all magic numbers and magic strings replaced with named constants or enums?',
23
+ // Style and complexity (13-14)
24
+ '13. COMPLEXITY — Are functions short (< 30 lines) and single-purpose? If a function requires a long comment to explain it, refactor instead.',
25
+ '14. DUPLICATION — Is the same logic copy-pasted from elsewhere? Extract a shared utility or extend an existing one.',
26
+ // Tests (15-16)
27
+ '15. TEST COVERAGE — Are there tests for the new code? Do they cover the happy path, error paths, and at least one edge case?',
28
+ '16. TEST QUALITY — Do the tests assert on the right things? Are mocks minimal and purposeful? Tests should not duplicate implementation logic.',
29
+ // Documentation (17)
30
+ '17. DOCUMENTATION — Do complex functions have a JSDoc comment explaining the why (not just the what)? Are public API changes reflected in the OpenAPI spec?',
31
+ // Dependencies and build (18)
32
+ '18. DEPENDENCIES — Are new npm packages justified? Check for license compatibility, maintenance status, and security advisories (npm audit).',
33
+ // Observability (19)
34
+ '19. OBSERVABILITY — Are significant operations logged at the appropriate level? Are errors logged with enough context to diagnose? No passwords in logs.',
35
+ // Review hygiene (20)
36
+ '20. BREAKING CHANGES — Does the change break any existing API contracts, DB schemas, or public interfaces? If so, is it properly versioned or migrated?',
37
+ ],
38
+ patterns: [
39
+ 'Review the diff, not the file — focus on what changed and why',
40
+ 'Ask questions instead of issuing commands: "Could this be null here?" vs "Fix this"',
41
+ 'Distinguish blocking issues (must fix) from suggestions (nice to have) in comments',
42
+ 'Approve with comments for minor non-blocking issues rather than blocking for style',
43
+ 'Check the tests before the implementation — tests reveal the intended behaviour',
44
+ ],
45
+ gotchas: [
46
+ 'Approving without running or reading the tests — tests are part of the code',
47
+ 'Nitpicking style when an auto-formatter (Prettier/ESLint) should enforce it',
48
+ 'Missing the forest for the trees: reviewing individual lines but missing a design flaw',
49
+ 'Not reviewing DB migrations for data safety (missing IF NOT EXISTS, backfill plan)',
50
+ 'Forgetting to check error message text — "null pointer exception" leaking to the user',
51
+ ],
52
+ resources: [
53
+ 'https://google.github.io/eng-practices/review/reviewer/',
54
+ 'https://mtlynch.io/code-review-love/',
55
+ 'https://www.conventionalcommits.org/ (PR title / commit message style)',
56
+ 'https://cheatsheetseries.owasp.org/cheatsheets/Code_Review_Guide_Introduction_Cheat_Sheet.html',
57
+ ],
58
+ };
59
+ }
60
+ //# sourceMappingURL=skill-code-review.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=skill-docs-gen.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=skill-perf-audit.js.map