@jigyasudham/veto 0.8.3 → 1.0.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 (111) hide show
  1. package/README.md +209 -52
  2. package/dist/agents/executor.js +36 -3
  3. package/dist/cli.js +246 -7
  4. package/dist/context/reader.js +113 -0
  5. package/dist/council/index.js +3 -1
  6. package/dist/plugins/loader.js +49 -0
  7. package/dist/router/index.js +2 -2
  8. package/dist/router/learning-updater.js +45 -1
  9. package/dist/server.js +478 -14
  10. package/dist/watcher/index.js +77 -0
  11. package/dist/workflow/pipeline.js +64 -0
  12. package/package.json +12 -3
  13. package/.claude/settings.local.json +0 -9
  14. package/src/adapters/claude.ts +0 -70
  15. package/src/adapters/codex.ts +0 -71
  16. package/src/adapters/gemini.ts +0 -71
  17. package/src/adapters/index.ts +0 -217
  18. package/src/agents/development/api.ts +0 -120
  19. package/src/agents/development/backend.ts +0 -85
  20. package/src/agents/development/coder.ts +0 -213
  21. package/src/agents/development/database.ts +0 -83
  22. package/src/agents/development/debugger.ts +0 -238
  23. package/src/agents/development/devops.ts +0 -86
  24. package/src/agents/development/frontend.ts +0 -85
  25. package/src/agents/development/migration.ts +0 -144
  26. package/src/agents/development/performance.ts +0 -144
  27. package/src/agents/development/refactor.ts +0 -86
  28. package/src/agents/development/reviewer.ts +0 -268
  29. package/src/agents/development/tester.ts +0 -151
  30. package/src/agents/executor.ts +0 -158
  31. package/src/agents/memory/context-manager.ts +0 -171
  32. package/src/agents/memory/decision-logger.ts +0 -160
  33. package/src/agents/memory/knowledge-base.ts +0 -124
  34. package/src/agents/memory/pattern-learner.ts +0 -143
  35. package/src/agents/memory/project-mapper.ts +0 -118
  36. package/src/agents/quality/accessibility.ts +0 -99
  37. package/src/agents/quality/code-quality.ts +0 -115
  38. package/src/agents/quality/compatibility.ts +0 -58
  39. package/src/agents/quality/documentation.ts +0 -105
  40. package/src/agents/quality/error-handling.ts +0 -96
  41. package/src/agents/research/competitor-analyzer.ts +0 -45
  42. package/src/agents/research/cost-analyzer.ts +0 -54
  43. package/src/agents/research/estimator.ts +0 -60
  44. package/src/agents/research/ethics-bias.ts +0 -113
  45. package/src/agents/research/researcher.ts +0 -114
  46. package/src/agents/research/risk-assessor.ts +0 -63
  47. package/src/agents/research/tech-advisor.ts +0 -55
  48. package/src/agents/security/auth.ts +0 -287
  49. package/src/agents/security/dependency-audit.ts +0 -337
  50. package/src/agents/security/penetration.ts +0 -262
  51. package/src/agents/security/privacy.ts +0 -285
  52. package/src/agents/security/scanner.ts +0 -322
  53. package/src/agents/security/secrets.ts +0 -249
  54. package/src/agents/types.ts +0 -66
  55. package/src/agents/workflow/automation.ts +0 -59
  56. package/src/agents/workflow/file-manager.ts +0 -52
  57. package/src/agents/workflow/git-agent.ts +0 -55
  58. package/src/agents/workflow/reporter.ts +0 -51
  59. package/src/agents/workflow/search-agent.ts +0 -40
  60. package/src/agents/workflow/task-coordinator.ts +0 -41
  61. package/src/agents/workflow/task-planner.ts +0 -47
  62. package/src/cli.ts +0 -204
  63. package/src/council/decision-engine.ts +0 -171
  64. package/src/council/devil-advocate.ts +0 -116
  65. package/src/council/index.ts +0 -44
  66. package/src/council/lead-developer.ts +0 -118
  67. package/src/council/legal-compliance.ts +0 -152
  68. package/src/council/product-manager.ts +0 -102
  69. package/src/council/security.ts +0 -172
  70. package/src/council/system-architect.ts +0 -132
  71. package/src/council/types.ts +0 -33
  72. package/src/council/ux-designer.ts +0 -121
  73. package/src/memory/local.ts +0 -305
  74. package/src/memory/schema.ts +0 -174
  75. package/src/memory/sync.ts +0 -274
  76. package/src/router/complexity-scorer.ts +0 -96
  77. package/src/router/context-compressor.ts +0 -74
  78. package/src/router/index.ts +0 -60
  79. package/src/router/learning-updater.ts +0 -271
  80. package/src/router/model-selector.ts +0 -83
  81. package/src/router/rate-monitor.ts +0 -103
  82. package/src/server.ts +0 -1038
  83. package/src/skills/development/skill-api-design.ts +0 -329
  84. package/src/skills/development/skill-auth.ts +0 -271
  85. package/src/skills/development/skill-ci-cd.ts +0 -0
  86. package/src/skills/development/skill-crud.ts +0 -209
  87. package/src/skills/development/skill-db-schema.ts +0 -0
  88. package/src/skills/development/skill-docker.ts +0 -0
  89. package/src/skills/development/skill-env-setup.ts +0 -0
  90. package/src/skills/development/skill-scaffold.ts +0 -323
  91. package/src/skills/intelligence/skill-complexity-score.ts +0 -69
  92. package/src/skills/intelligence/skill-cost-track.ts +0 -39
  93. package/src/skills/intelligence/skill-learning-loop.ts +0 -69
  94. package/src/skills/intelligence/skill-pattern-detect.ts +0 -38
  95. package/src/skills/intelligence/skill-rate-watch.ts +0 -61
  96. package/src/skills/memory/skill-context-compress.ts +0 -98
  97. package/src/skills/memory/skill-cross-sync.ts +0 -104
  98. package/src/skills/memory/skill-decision-log.ts +0 -119
  99. package/src/skills/memory/skill-session-restore.ts +0 -59
  100. package/src/skills/memory/skill-session-save.ts +0 -94
  101. package/src/skills/quality/skill-accessibility.ts +0 -0
  102. package/src/skills/quality/skill-code-review.ts +0 -84
  103. package/src/skills/quality/skill-docs-gen.ts +0 -0
  104. package/src/skills/quality/skill-perf-audit.ts +0 -0
  105. package/src/skills/quality/skill-security-scan.ts +0 -91
  106. package/src/skills/quality/skill-test-suite.ts +0 -290
  107. package/src/skills/workflow/skill-deploy.ts +0 -0
  108. package/src/skills/workflow/skill-git-workflow.ts +0 -0
  109. package/src/skills/workflow/skill-rollback.ts +0 -0
  110. package/src/skills/workflow/skill-task-breakdown.ts +0 -0
  111. package/tsconfig.json +0 -20
@@ -1,59 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- const t = (task + ' ' + (context ?? '')).toLowerCase();
5
- const isCron = t.includes('cron') || t.includes('schedule') || t.includes('recurring') || t.includes('daily') || t.includes('weekly');
6
- const isPipeline = t.includes('pipeline') || t.includes('ci') || t.includes('workflow') || t.includes('trigger') || t.includes('webhook');
7
- const isScript = t.includes('script') || t.includes('automat') || t.includes('batch') || t.includes('bulk');
8
-
9
- const approach = isCron
10
- ? 'Design the cron job with three safety properties: idempotency (running it twice should be safe), observability (every run logs start/end/result), and alerting (failed runs must page someone). The most common cron bug is silent failure — the job stops running and nobody notices for weeks.'
11
- : isPipeline
12
- ? 'Design the pipeline with exactly-once execution semantics where possible. Each stage should be independently retryable. Every stage logs its input and output. The pipeline must have a dead-letter mechanism for events that fail after max retries.'
13
- : isScript
14
- ? 'Write the automation script as a dry-run first: add a --dry-run flag that shows what would happen without doing it. Test the dry-run output before removing the flag. Automation that cannot be previewed should not exist.'
15
- : 'Design the automation with four properties: idempotent (safe to re-run), observable (logs start/end/result), alertable (failures surface immediately), and reversible (can undo if wrong).';
16
-
17
- return {
18
- agent: 'automation' as WorkerAgentType,
19
- task,
20
- tier: 2,
21
- approach,
22
- steps: [
23
- 'Define the trigger: what starts this automation? (schedule, event, webhook, manual)',
24
- 'Define the idempotency strategy: what prevents duplicate execution from causing harm?',
25
- 'Define the happy path: what are the exact steps in order?',
26
- 'Define the failure modes: what can go wrong at each step?',
27
- 'Design retry logic: how many retries, with what backoff, before giving up?',
28
- 'Design the dead-letter path: what happens to items that fail after max retries?',
29
- 'Add structured logging: every run logs start (with input), each step result, and end (with outcome)',
30
- 'Add alerting: failed runs must produce an alert, not just a log entry',
31
- 'Add a dry-run mode for scripts that modify data',
32
- 'Test the failure path explicitly — do not assume the happy path covers everything',
33
- ],
34
- checklist: [
35
- '[ ] Trigger defined and documented',
36
- '[ ] Idempotency strategy implemented',
37
- '[ ] Retry logic with bounded backoff',
38
- '[ ] Dead-letter mechanism for permanent failures',
39
- '[ ] Structured logging on every run',
40
- '[ ] Alert on failure (not just log)',
41
- '[ ] Dry-run mode for destructive operations',
42
- '[ ] Failure path tested explicitly',
43
- ],
44
- pitfalls: [
45
- 'Silent failure — cron jobs that fail without alerting are the most dangerous automation',
46
- 'No idempotency — running the job twice sends duplicate emails, charges customers twice',
47
- 'Unbounded retries — a failing job retries forever and blocks the queue',
48
- 'No dry-run — automation that modifies data cannot be safely previewed before running',
49
- 'Logging only on failure — you cannot diagnose why it failed without knowing what it was doing',
50
- ],
51
- patterns: [
52
- 'IDOA framework: Idempotent → Observable → Alertable → Dry-run-capable',
53
- 'Dead-letter queue: every event that fails max retries goes here, never silently dropped',
54
- 'Structured run log: { job, run_id, started_at, input_count, success_count, error_count, ended_at }',
55
- 'Failure-first testing: write the test for the failure path before the happy path',
56
- ],
57
- duration_estimate: '2-6 hours',
58
- };
59
- }
@@ -1,52 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- const t = (task + ' ' + (context ?? '')).toLowerCase();
5
- const isCreate = t.includes('creat') || t.includes('scaffold') || t.includes('new file') || t.includes('add');
6
- const isDelete = t.includes('delet') || t.includes('remov') || t.includes('clean') || t.includes('purge');
7
- const isMove = t.includes('mov') || t.includes('renam') || t.includes('restructur') || t.includes('reorgan');
8
-
9
- const approach = isDelete
10
- ? 'Before deleting: verify nothing imports the file (grep for the filename and all its exports). Check git log to understand why it was created. If it is safe to delete, remove it and fix all broken imports. Never delete without checking references first.'
11
- : isMove
12
- ? 'Before moving: map all import paths that reference this file. Update every import after moving. Run the build to confirm no broken imports remain. Update any barrel index files that re-export the moved module.'
13
- : isCreate
14
- ? 'Create files in the right location: match the existing directory conventions. Add the new file to any relevant barrel index. Do not create a new directory when an existing one fits. Name the file to match its primary export.'
15
- : 'Execute the file operation safely. For any destructive operation (delete, overwrite): verify the operation is correct before running it. For moves and renames: update all references atomically.';
16
-
17
- return {
18
- agent: 'file-manager' as WorkerAgentType,
19
- task,
20
- tier: 1,
21
- approach,
22
- steps: [
23
- 'Identify the exact files to create, modify, move, or delete',
24
- 'For deletes: grep for all imports/references to the file before touching it',
25
- 'For moves: list all files that import from the source path',
26
- 'Execute the operation',
27
- 'Update all import paths that reference moved or deleted files',
28
- 'Update barrel index files (index.ts) if the file is re-exported',
29
- 'Run the TypeScript build to confirm no broken imports',
30
- 'Update the project map via veto_project_map_update',
31
- ],
32
- checklist: [
33
- '[ ] References checked before any delete or rename',
34
- '[ ] All import paths updated after move/rename',
35
- '[ ] Barrel indexes updated',
36
- '[ ] Build passes after operation',
37
- '[ ] Project map updated via veto_project_map_update',
38
- ],
39
- pitfalls: [
40
- 'Deleting a file without checking what imports it — silent build breakage',
41
- 'Moving a file without updating all import paths — TypeScript will error',
42
- 'Creating a new directory when an existing one is the right home',
43
- 'Forgetting to update barrel index files after adding/removing a module',
44
- ],
45
- patterns: [
46
- 'Reference-before-delete: always grep for imports before deleting a file',
47
- 'Atomic rename: update the file and all its references in a single operation',
48
- 'Barrel maintenance: every add/remove in a directory requires checking the index.ts',
49
- ],
50
- duration_estimate: '15-60 minutes',
51
- };
52
- }
@@ -1,55 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- const t = (task + ' ' + (context ?? '')).toLowerCase();
5
- const isMerge = t.includes('merge') || t.includes('conflict') || t.includes('rebase');
6
- const isPR = t.includes('pull request') || t.includes('pr') || t.includes('review');
7
- const isCommit = t.includes('commit') || t.includes('stage') || t.includes('message');
8
-
9
- const approach = isMerge
10
- ? 'Resolve merge conflicts by understanding what both sides intended, not just what they changed. Read both versions, understand the goal of each change, then write a resolution that preserves both intentions. Never resolve a conflict by picking one side blindly.'
11
- : isPR
12
- ? 'Structure the PR to make review fast: one clear title (what changed), a summary paragraph (why), a numbered list of changes (what files/functions), and a test plan. Small PRs merge faster than large ones — if the PR touches more than 10 files, split it.'
13
- : isCommit
14
- ? 'Write commit messages that explain WHY, not what. The diff shows what changed. The commit message tells future maintainers why. Format: imperative verb subject (50 chars), blank line, body if needed (72 chars per line).'
15
- : 'Execute the git operation safely. For destructive operations (reset --hard, force push, branch delete): state the exact command and its consequences before running. Never force-push a shared branch without explicit instruction.';
16
-
17
- return {
18
- agent: 'git-agent' as WorkerAgentType,
19
- task,
20
- tier: 1,
21
- approach,
22
- steps: [
23
- 'Identify the git operation needed: commit, branch, merge, rebase, tag, PR',
24
- 'For destructive operations: state what will be lost and confirm before running',
25
- 'For commits: stage only the relevant files — never git add -A blindly',
26
- 'Write a commit message: imperative verb, 50 char subject, body if needed',
27
- 'For merges: read both sides of each conflict before resolving',
28
- 'For PRs: title (what), summary (why), change list (how), test plan',
29
- 'For branch cleanup: verify the branch is fully merged before deleting',
30
- 'For rebases: ensure the branch is not shared with others before rewriting history',
31
- ],
32
- checklist: [
33
- '[ ] No accidental files staged (check git diff --staged before committing)',
34
- '[ ] Commit message is imperative and explains WHY',
35
- '[ ] No force-push to shared branches without explicit instruction',
36
- '[ ] Merge conflicts resolved by understanding intent, not picking one side',
37
- '[ ] Branch verified as merged before deletion',
38
- '[ ] .env, credentials, and secrets not included in staged files',
39
- ],
40
- pitfalls: [
41
- 'git add -A without reviewing what is staged — accidentally commits secrets or build artifacts',
42
- 'Commit messages that describe what the diff shows — useless to future maintainers',
43
- 'Force-pushing a branch others have cloned — rewrites their history',
44
- 'Resolving merge conflicts by always taking "ours" — loses the other branch\'s intent',
45
- 'Deleting a branch before verifying it is merged — loses work',
46
- ],
47
- patterns: [
48
- 'Why-first commit messages: the diff shows what; the message explains why',
49
- 'Surgical staging: add specific files, not directories, to keep commits atomic',
50
- 'Pre-commit diff review: git diff --staged before every commit to catch surprises',
51
- 'Branch lifecycle: feature → PR → merge → delete (never skip the verify-merged step)',
52
- ],
53
- duration_estimate: '15-45 minutes',
54
- };
55
- }
@@ -1,51 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- const t = (task + ' ' + (context ?? '')).toLowerCase();
5
- const isSession = t.includes('session') || t.includes('summary') || t.includes('what was done');
6
- const isStatus = t.includes('status') || t.includes('progress') || t.includes('where are we');
7
-
8
- const approach = isSession
9
- ? 'Produce a session summary: what was accomplished, what decisions were made, what is next. Structure: one-sentence headline, bullet list of completed work, bullet list of open items, single next action. Optimised for someone picking up this work cold — they should need to read nothing else.'
10
- : isStatus
11
- ? 'Produce a status report: current phase, percent complete, what is blocking progress, and the next milestone. Include a risk flag if any blocker has been open for more than one session.'
12
- : 'Produce the appropriate report for this context. Default to the session summary format: headline, completed, open, next action.';
13
-
14
- return {
15
- agent: 'reporter' as WorkerAgentType,
16
- task,
17
- tier: 1,
18
- approach,
19
- steps: [
20
- 'Identify what type of report is needed: session summary, status report, or decision log',
21
- 'Collect the facts: what was completed, what decisions were made, what is open',
22
- 'Write the headline: one sentence that captures the most important thing',
23
- 'List completed work as bullet points — specific, verifiable ("Auth middleware passing all tests")',
24
- 'List open items with priority order',
25
- 'Identify blockers: anything that prevents progress without human input',
26
- 'State the single next action as a concrete step',
27
- 'Save to session via veto_session_save if this report closes a work session',
28
- ],
29
- checklist: [
30
- '[ ] Headline captures the most important single thing',
31
- '[ ] Completed items are specific and verifiable',
32
- '[ ] Open items are prioritised',
33
- '[ ] Blockers are explicitly named',
34
- '[ ] Next action is a single concrete step',
35
- '[ ] Report saved if it closes a session',
36
- ],
37
- pitfalls: [
38
- 'Vague completed items ("worked on auth") — not verifiable, not useful',
39
- 'Listing everything instead of prioritising — buries the important items',
40
- 'No next action — the person reading the report cannot resume without re-reading everything',
41
- 'Including implementation details the reader does not need — reports should be scannable in 30 seconds',
42
- ],
43
- patterns: [
44
- 'Headline-first: the most important thing should be visible without scrolling',
45
- 'Scannable structure: headline → done → open → blockers → next — in that order',
46
- 'One next action: multiple next actions means no prioritisation has happened',
47
- 'Cold-start test: can someone who has not seen this work pick up where you left off from this report alone?',
48
- ],
49
- duration_estimate: '10-20 minutes',
50
- };
51
- }
@@ -1,40 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- return {
5
- agent: 'search-agent' as WorkerAgentType,
6
- task,
7
- tier: 1,
8
- approach: 'Search the codebase efficiently by starting with the most specific query and widening only if needed. Check veto_project_map_get first — if the answer is in the project map, no filesystem scan is needed. For symbol search: grep for the exact name. For concept search: grep for 2-3 keywords likely to co-occur. For file discovery: use glob patterns. Never read entire files when a targeted search suffices.',
9
- steps: [
10
- 'Call veto_project_map_get — check if the answer is already in the project map',
11
- 'If the query is a symbol (function name, class, variable): grep for the exact name',
12
- 'If the query is a concept: identify 2–3 keywords likely to co-occur in the relevant code',
13
- 'Grep for keywords with file type filter (e.g. *.ts) to reduce noise',
14
- 'Read only the matching sections, not entire files',
15
- 'If nothing found: try synonyms or broader terms',
16
- 'If still nothing: scan the directory structure for a likely home',
17
- 'Update veto_project_map_update if the search revealed a gap in the map',
18
- ],
19
- checklist: [
20
- '[ ] Project map checked before any filesystem scan',
21
- '[ ] Exact symbol name tried before broad keyword search',
22
- '[ ] File type filter applied to grep to reduce noise',
23
- '[ ] Only matching sections read, not whole files',
24
- '[ ] Project map updated if a previously unknown file was found',
25
- ],
26
- pitfalls: [
27
- 'Reading entire files to find one function — wastes context tokens',
28
- 'Searching without a file type filter — finds matches in node_modules and dist',
29
- 'Using a broad term as the first query — too many false positives',
30
- 'Not checking the project map first — may already have the answer',
31
- ],
32
- patterns: [
33
- 'Specific-first search: exact symbol → keywords → directory scan',
34
- 'Context-budgeted reading: read the matching section plus 10 lines of context, not the whole file',
35
- 'Map-first navigation: the project map is faster than a filesystem scan for known files',
36
- 'Synonym expansion: if the first query returns nothing, try 2-3 synonyms before giving up',
37
- ],
38
- duration_estimate: '5-20 minutes',
39
- };
40
- }
@@ -1,41 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- return {
5
- agent: 'task-coordinator' as WorkerAgentType,
6
- task,
7
- tier: 2,
8
- approach: 'Coordinate multi-agent execution: assign tasks to the right worker agents, run independent tasks in parallel via veto_execute_parallel, collect results, reconcile conflicts, and assemble the final output. The coordinator does not do the work — it routes, monitors, and assembles.',
9
- steps: [
10
- 'Receive the task plan from task-planner (or build one if not provided)',
11
- 'For each task: identify the best worker agent (coder, tester, security-scanner, etc.)',
12
- 'Group independent tasks that can run in parallel',
13
- 'Submit parallel group via veto_execute_parallel',
14
- 'Wait for results — check each result for errors before proceeding',
15
- 'If a parallel task fails: decide whether to retry, skip, or block the dependent tasks',
16
- 'Submit the next sequential task or parallel group based on dependency order',
17
- 'Collect all results and check for conflicts (two agents modify the same file)',
18
- 'Resolve conflicts: the higher-priority agent wins, or escalate to the human',
19
- 'Assemble the final output and save the session checkpoint',
20
- ],
21
- checklist: [
22
- '[ ] Each task assigned to the correct worker agent',
23
- '[ ] Independent tasks submitted to veto_execute_parallel',
24
- '[ ] Each result checked for errors before triggering dependents',
25
- '[ ] Conflicts identified and resolved',
26
- '[ ] Final session saved via veto_session_save',
27
- ],
28
- pitfalls: [
29
- 'Running all tasks sequentially when most could be parallel — wastes time',
30
- 'Ignoring errors in parallel results and proceeding to dependent tasks — cascading failures',
31
- 'Assigning the wrong agent type — a coder reviewing security is worse than no review',
32
- 'Not saving progress after each parallel batch — a failure loses all intermediate work',
33
- ],
34
- patterns: [
35
- 'Batch-and-wait: submit all independent tasks in one veto_execute_parallel call, then process results before the next batch',
36
- 'Fail-fast on blockers: if a critical task fails, stop and report rather than continuing with invalid state',
37
- 'Agent specialisation: always use the most specific agent available for each task type',
38
- ],
39
- duration_estimate: '30-90 minutes',
40
- };
41
- }
@@ -1,47 +0,0 @@
1
- import { AgentPlan, WorkerAgentType } from '../types.js';
2
-
3
- export function plan(task: string, context?: string): AgentPlan {
4
- return {
5
- agent: 'task-planner' as WorkerAgentType,
6
- task,
7
- tier: 2,
8
- approach: 'Decompose the goal into a concrete, ordered task list where each task is independently completable in 1–4 hours. The output is not a project plan — it is the immediate next N tasks in execution order, each with a clear acceptance criterion. Identify which tasks can run in parallel and which are sequential dependencies.',
9
- steps: [
10
- 'State the goal in one sentence — if you cannot, the goal needs clarifying first',
11
- 'Identify all constraints: blocked by X, requires Y to exist first, cannot touch Z',
12
- 'List all deliverables: what files, APIs, tests, or docs must exist when done?',
13
- 'Break deliverables into tasks of 1–4 hours each — nothing larger',
14
- 'For each task: write one acceptance criterion ("done when X passes" or "done when Y returns Z")',
15
- 'Identify dependencies: which tasks must complete before others can start?',
16
- 'Group independent tasks — these can run in parallel via veto_execute_parallel',
17
- 'Order the dependent tasks: what is the critical path?',
18
- 'Identify the single highest-risk task and put it first — fail fast',
19
- 'Save the task plan via veto_session_save so it survives context switches',
20
- ],
21
- checklist: [
22
- '[ ] Goal stated in one sentence',
23
- '[ ] All constraints identified',
24
- '[ ] Tasks are 1–4 hours each',
25
- '[ ] Every task has an acceptance criterion',
26
- '[ ] Dependencies mapped — no implicit ordering',
27
- '[ ] Parallel tasks identified',
28
- '[ ] Critical path identified',
29
- '[ ] Highest-risk task is first',
30
- '[ ] Plan saved via veto_session_save',
31
- ],
32
- pitfalls: [
33
- 'Tasks too large ("implement auth") — cannot track progress or parallelize',
34
- 'Tasks too small ("add semicolon") — overhead exceeds value',
35
- 'Missing acceptance criteria — "done" is subjective without them',
36
- 'Not identifying blockers upfront — a hidden blocker discovered mid-task stops everything',
37
- 'Putting the risky unknown task last — you should fail fast, not late',
38
- ],
39
- patterns: [
40
- 'Risk-first ordering: the most uncertain task goes first so you discover problems early',
41
- 'Acceptance-criteria-first: write the criterion before the task to clarify what done means',
42
- 'Parallel identification: tasks with no shared outputs can always run concurrently',
43
- 'Four-hour rule: if a task cannot be completed in 4 hours, it contains hidden complexity — split it',
44
- ],
45
- duration_estimate: '30-60 minutes',
46
- };
47
- }
package/src/cli.ts DELETED
@@ -1,204 +0,0 @@
1
- #!/usr/bin/env node
2
- // Veto CLI — entry point for `npx veto init`
3
-
4
- // Suppress Node experimental warnings (node:sqlite) for clean UX
5
- process.removeAllListeners('warning');
6
-
7
- import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
8
- import { join, dirname } from 'node:path';
9
- import { homedir } from 'node:os';
10
-
11
- const VERSION = '0.8.2';
12
- const VETO_DIR = join(homedir(), '.veto');
13
- const HOME = homedir();
14
-
15
- const c = {
16
- bold: (s: string) => `\x1b[1m${s}\x1b[0m`,
17
- green: (s: string) => `\x1b[32m${s}\x1b[0m`,
18
- yellow: (s: string) => `\x1b[33m${s}\x1b[0m`,
19
- cyan: (s: string) => `\x1b[36m${s}\x1b[0m`,
20
- dim: (s: string) => `\x1b[2m${s}\x1b[0m`,
21
- red: (s: string) => `\x1b[31m${s}\x1b[0m`,
22
- };
23
-
24
- function printBanner() {
25
- console.log('');
26
- console.log(c.bold(c.cyan(' ██╗ ██╗███████╗████████╗ ██████╗')));
27
- console.log(c.bold(c.cyan(' ██║ ██║██╔════╝╚══██╔══╝██╔═══██╗')));
28
- console.log(c.bold(c.cyan(' ██║ ██║█████╗ ██║ ██║ ██║')));
29
- console.log(c.bold(c.cyan(' ╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║')));
30
- console.log(c.bold(c.cyan(' ╚████╔╝ ███████╗ ██║ ╚██████╔╝')));
31
- console.log(c.bold(c.cyan(' ╚═══╝ ╚══════╝ ╚═╝ ╚═════╝')));
32
- console.log('');
33
- console.log(c.dim(` 50 agents. 28 skills. 3 AIs. Self-learning. Zero extra cost.`));
34
- console.log(c.dim(` v${VERSION}`));
35
- console.log('');
36
- }
37
-
38
- // Merge veto entry into an existing JSON config file, creating it if needed.
39
- // Supports both "mcpServers" format (Claude/Gemini/Codex/Cursor/Windsurf)
40
- // and "servers" format (VS Code).
41
- function writeVetoConfig(
42
- configPath: string,
43
- format: 'mcpServers' | 'servers'
44
- ): 'created' | 'updated' | 'skipped' {
45
- let existing: Record<string, unknown> = {};
46
-
47
- if (existsSync(configPath)) {
48
- try {
49
- existing = JSON.parse(readFileSync(configPath, 'utf8'));
50
- } catch {
51
- // Unreadable / invalid JSON — skip to avoid corrupting it
52
- return 'skipped';
53
- }
54
- } else {
55
- mkdirSync(dirname(configPath), { recursive: true });
56
- }
57
-
58
- const wasEmpty = Object.keys(existing).length === 0;
59
-
60
- if (format === 'mcpServers') {
61
- const servers = (existing.mcpServers as Record<string, unknown>) ?? {};
62
- servers['veto'] = { command: 'veto-server' };
63
- existing.mcpServers = servers;
64
- } else {
65
- const servers = (existing.servers as Record<string, unknown>) ?? {};
66
- servers['veto'] = { type: 'stdio', command: 'veto-server' };
67
- existing.servers = servers;
68
- }
69
-
70
- writeFileSync(configPath, JSON.stringify(existing, null, 2) + '\n', 'utf8');
71
- return wasEmpty ? 'created' : 'updated';
72
- }
73
-
74
- // All platforms Veto supports, with their config paths and formats.
75
- const PLATFORMS = [
76
- {
77
- name: 'Claude Code',
78
- path: join(HOME, '.claude', 'mcp_servers.json'),
79
- format: 'mcpServers' as const,
80
- detectionDir: join(HOME, '.claude'),
81
- },
82
- {
83
- name: 'Gemini CLI',
84
- path: join(HOME, '.gemini', 'settings.json'),
85
- format: 'mcpServers' as const,
86
- detectionDir: join(HOME, '.gemini'),
87
- },
88
- {
89
- name: 'Codex CLI',
90
- path: join(HOME, '.codex', 'config.json'),
91
- format: 'mcpServers' as const,
92
- detectionDir: join(HOME, '.codex'),
93
- },
94
- {
95
- name: 'Cursor',
96
- path: join(HOME, '.cursor', 'mcp.json'),
97
- format: 'mcpServers' as const,
98
- detectionDir: join(HOME, '.cursor'),
99
- },
100
- {
101
- name: 'Windsurf',
102
- path: join(HOME, '.codeium', 'windsurf', 'mcp_config.json'),
103
- format: 'mcpServers' as const,
104
- detectionDir: join(HOME, '.codeium', 'windsurf'),
105
- },
106
- ];
107
-
108
- async function initCommand() {
109
- printBanner();
110
-
111
- // 1. Create ~/.veto directory
112
- if (!existsSync(VETO_DIR)) {
113
- mkdirSync(VETO_DIR, { recursive: true });
114
- console.log(c.green(' ✓') + ` Created ${VETO_DIR}`);
115
- } else {
116
- console.log(c.dim(' · ') + `Found existing ${VETO_DIR}`);
117
- }
118
-
119
- // 2. Initialize SQLite database
120
- process.stdout.write(' · Initializing SQLite database...');
121
- const { getDb, getDbPath, saveSession } = await import('./memory/local.js');
122
-
123
- try {
124
- const db = getDb();
125
- const dbPath = getDbPath();
126
- const { session_id } = saveSession({
127
- platform: 'claude',
128
- summary: 'Veto initialized',
129
- context: 'Initial setup via npx veto init',
130
- });
131
- const row = db.prepare('SELECT id FROM sessions WHERE id = ?').get(session_id);
132
- if (!row) throw new Error('DB smoke test failed');
133
- db.prepare('DELETE FROM sessions WHERE id = ?').run(session_id);
134
- console.log(c.green(' ✓'));
135
- console.log(c.green(' ✓') + ` Database ready at ${dbPath}`);
136
- } catch (err: unknown) {
137
- console.log(c.red(' ✗'));
138
- const msg = err instanceof Error ? err.message : String(err);
139
- console.error(c.red(` Error initializing database: ${msg}`));
140
- process.exit(1);
141
- }
142
-
143
- // 3. Auto-configure every AI CLI / IDE found on this machine
144
- console.log('');
145
- console.log(' Configuring all AI tools found on this machine...');
146
- console.log('');
147
-
148
- let configured = 0;
149
- let skipped = 0;
150
-
151
- for (const platform of PLATFORMS) {
152
- const detected = existsSync(platform.detectionDir);
153
- if (!detected) {
154
- console.log(c.dim(' · ') + c.dim(`${platform.name} — not installed, skipping`));
155
- continue;
156
- }
157
-
158
- const result = writeVetoConfig(platform.path, platform.format);
159
-
160
- if (result === 'skipped') {
161
- console.log(c.yellow(' ⚠ ') + `${platform.name} — config unreadable, skipped`);
162
- skipped++;
163
- } else if (result === 'created') {
164
- console.log(c.green(' ✓ ') + `${platform.name} — configured`);
165
- configured++;
166
- } else {
167
- console.log(c.green(' ✓ ') + `${platform.name} — updated`);
168
- configured++;
169
- }
170
- }
171
-
172
- console.log('');
173
-
174
- if (configured === 0 && skipped === 0) {
175
- console.log(c.yellow(' ⚠ No AI tools detected.'));
176
- console.log(' Install Claude Code, Gemini CLI, or Codex CLI and run veto init again.');
177
- console.log('');
178
- } else {
179
- console.log(c.green(` ✓ Veto configured for ${configured} tool${configured !== 1 ? 's' : ''}!`));
180
- console.log('');
181
- console.log(' Next steps:');
182
- console.log(c.dim(' 1.') + ' Restart your AI CLI or IDE');
183
- console.log(c.dim(' 2.') + ' Run: veto_status — should return { "status": "running", "version": "' + VERSION + '" }');
184
- console.log('');
185
- }
186
- }
187
-
188
- // ─── Router ────────────────────────────────────────────────────────────────────
189
-
190
- const command = process.argv[2] ?? 'init';
191
-
192
- switch (command) {
193
- case 'init':
194
- initCommand().catch((err) => {
195
- console.error(c.red(`Error: ${err.message}`));
196
- process.exit(1);
197
- });
198
- break;
199
-
200
- default:
201
- console.error(`Unknown command: ${command}`);
202
- console.log('Usage: veto init');
203
- process.exit(1);
204
- }