@jamesaphoenix/tx-cli 0.4.6 → 0.5.2

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 (110) hide show
  1. package/dist/cli-exit.d.ts.map +1 -0
  2. package/dist/cli-exit.js.map +1 -0
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +69 -21
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/attempt.d.ts.map +1 -0
  8. package/dist/commands/attempt.js +4 -5
  9. package/dist/commands/attempt.js.map +1 -0
  10. package/dist/commands/bulk.d.ts.map +1 -0
  11. package/dist/commands/bulk.js +7 -8
  12. package/dist/commands/bulk.js.map +1 -0
  13. package/dist/commands/claim.d.ts.map +1 -0
  14. package/dist/commands/claim.js +3 -4
  15. package/dist/commands/claim.js.map +1 -0
  16. package/dist/commands/compact.d.ts.map +1 -0
  17. package/dist/commands/compact.js.map +1 -0
  18. package/dist/commands/coordinator.d.ts.map +1 -0
  19. package/dist/commands/coordinator.js.map +1 -0
  20. package/dist/commands/cycle.d.ts +1 -3
  21. package/dist/commands/cycle.d.ts.map +1 -0
  22. package/dist/commands/cycle.js +28 -25
  23. package/dist/commands/cycle.js.map +1 -0
  24. package/dist/commands/daemon.d.ts +1 -1
  25. package/dist/commands/daemon.d.ts.map +1 -0
  26. package/dist/commands/daemon.js.map +1 -0
  27. package/dist/commands/dashboard.d.ts.map +1 -0
  28. package/dist/commands/dashboard.js +70 -18
  29. package/dist/commands/dashboard.js.map +1 -0
  30. package/dist/commands/dashboard.test.d.ts +2 -0
  31. package/dist/commands/dashboard.test.d.ts.map +1 -0
  32. package/dist/commands/dashboard.test.js +166 -0
  33. package/dist/commands/dashboard.test.js.map +1 -0
  34. package/dist/commands/dep.d.ts.map +1 -0
  35. package/dist/commands/dep.js +2 -3
  36. package/dist/commands/dep.js.map +1 -0
  37. package/dist/commands/doc.d.ts +1 -1
  38. package/dist/commands/doc.d.ts.map +1 -0
  39. package/dist/commands/doc.js +3 -3
  40. package/dist/commands/doc.js.map +1 -0
  41. package/dist/commands/doctor.d.ts +1 -1
  42. package/dist/commands/doctor.d.ts.map +1 -0
  43. package/dist/commands/doctor.js +32 -21
  44. package/dist/commands/doctor.js.map +1 -0
  45. package/dist/commands/graph.d.ts.map +1 -0
  46. package/dist/commands/graph.js.map +1 -0
  47. package/dist/commands/hierarchy.d.ts.map +1 -0
  48. package/dist/commands/hierarchy.js +2 -3
  49. package/dist/commands/hierarchy.js.map +1 -0
  50. package/dist/commands/hooks.d.ts +2 -2
  51. package/dist/commands/hooks.d.ts.map +1 -0
  52. package/dist/commands/hooks.js +22 -14
  53. package/dist/commands/hooks.js.map +1 -0
  54. package/dist/commands/invariant.d.ts +1 -1
  55. package/dist/commands/invariant.d.ts.map +1 -0
  56. package/dist/commands/invariant.js +4 -5
  57. package/dist/commands/invariant.js.map +1 -0
  58. package/dist/commands/learning.d.ts.map +1 -0
  59. package/dist/commands/learning.js +57 -14
  60. package/dist/commands/learning.js.map +1 -0
  61. package/dist/commands/migrate.d.ts.map +1 -0
  62. package/dist/commands/migrate.js.map +1 -0
  63. package/dist/commands/orchestrator.d.ts.map +1 -0
  64. package/dist/commands/orchestrator.js.map +1 -0
  65. package/dist/commands/outbox.d.ts +48 -0
  66. package/dist/commands/outbox.d.ts.map +1 -0
  67. package/dist/commands/outbox.js +186 -0
  68. package/dist/commands/outbox.js.map +1 -0
  69. package/dist/commands/scaffold.d.ts +30 -0
  70. package/dist/commands/scaffold.d.ts.map +1 -0
  71. package/dist/commands/scaffold.js +222 -0
  72. package/dist/commands/scaffold.js.map +1 -0
  73. package/dist/commands/stats.d.ts.map +1 -0
  74. package/dist/commands/stats.js.map +1 -0
  75. package/dist/commands/sync-platform.d.ts.map +1 -0
  76. package/dist/commands/sync-platform.js +3 -4
  77. package/dist/commands/sync-platform.js.map +1 -0
  78. package/dist/commands/sync.d.ts.map +1 -0
  79. package/dist/commands/sync.js +2 -3
  80. package/dist/commands/sync.js.map +1 -0
  81. package/dist/commands/task.d.ts.map +1 -0
  82. package/dist/commands/task.js +7 -8
  83. package/dist/commands/task.js.map +1 -0
  84. package/dist/commands/test.d.ts.map +1 -0
  85. package/dist/commands/test.js.map +1 -0
  86. package/dist/commands/trace.d.ts.map +1 -0
  87. package/dist/commands/trace.js +13 -14
  88. package/dist/commands/trace.js.map +1 -0
  89. package/dist/commands/validate.d.ts.map +1 -0
  90. package/dist/commands/validate.js +1 -2
  91. package/dist/commands/validate.js.map +1 -0
  92. package/dist/commands/worker.d.ts +1 -1
  93. package/dist/commands/worker.d.ts.map +1 -0
  94. package/dist/commands/worker.js.map +1 -0
  95. package/dist/help.d.ts.map +1 -0
  96. package/dist/help.js +893 -203
  97. package/dist/help.js.map +1 -0
  98. package/dist/output.d.ts.map +1 -0
  99. package/dist/output.js.map +1 -0
  100. package/dist/tx +0 -0
  101. package/dist/utils/parse.d.ts.map +1 -0
  102. package/dist/utils/parse.js.map +1 -0
  103. package/dist/utils/parse.test.d.ts +2 -0
  104. package/dist/utils/parse.test.d.ts.map +1 -0
  105. package/dist/utils/parse.test.js +140 -0
  106. package/dist/utils/parse.test.js.map +1 -0
  107. package/dist/version.d.ts.map +1 -0
  108. package/dist/version.js.map +1 -0
  109. package/package.json +11 -20
  110. package/bin/tx +0 -41
package/dist/help.js CHANGED
@@ -14,19 +14,20 @@ Tasks:
14
14
  show <id> Show task details
15
15
  update <id> Update task
16
16
  done <id> Mark task complete
17
- reset <id> Reset task to ready (recover from stuck)
17
+ reset <id> Reset task to ready
18
18
  delete <id> Delete task
19
+
20
+ Dependencies & Hierarchy:
19
21
  block <id> <blocker> Add blocking dependency
20
22
  unblock <id> <blocker> Remove blocking dependency
21
23
  children <id> List child tasks
22
24
  tree <id> Show task subtree
25
+
26
+ Attempts:
23
27
  try <id> <approach> Record an attempt on a task
24
28
  attempts <id> List attempts for a task
25
- claim Claim a task with a lease
26
- claim:release Release a claim on a task
27
- claim:renew Renew the lease on a claim
28
29
 
29
- Context & Learnings:
30
+ Memory:
30
31
  learning:add Add a learning
31
32
  learning:search Search learnings
32
33
  learning:recent List recent learnings
@@ -36,19 +37,29 @@ Context & Learnings:
36
37
  learn Attach a learning to file/glob pattern
37
38
  recall Query learnings for a path
38
39
 
39
- Sync:
40
+ Messages:
41
+ send Send a message to a channel
42
+ inbox Read messages from a channel
43
+ ack Acknowledge a message
44
+ ack:all Acknowledge all messages on a channel
45
+ outbox:pending Count pending messages on a channel
46
+ outbox:gc Garbage collect old messages
47
+
48
+ Docs:
49
+ doc <subcommand> Manage docs (add, edit, show, list, render, lock, version, link, attach, patch, validate, drift)
50
+ invariant <subcommand> Manage invariants (list, show, record, sync)
51
+
52
+ Cycle Scan:
53
+ cycle Run cycle-based issue discovery with sub-agent swarms
54
+
55
+ Sync & Data:
40
56
  sync export Export tasks to JSONL file
41
57
  sync import Import tasks from JSONL file
42
58
  sync status Show sync status
43
59
  sync claude Sync tasks to Claude Code team directory
44
- sync codex Sync tasks to Codex (coming soon)
45
-
46
- Traces:
47
- trace list Show recent runs with event counts
48
- trace show Show metrics events for a run
49
- trace transcript Display raw transcript content
50
- trace stderr Display stderr content
51
- trace errors Show recent errors across all runs
60
+ compact Compact completed tasks and export learnings
61
+ history View compaction history
62
+ migrate status Show database migration status
52
63
 
53
64
  Bulk Operations:
54
65
  bulk done <id...> Complete multiple tasks
@@ -56,36 +67,11 @@ Bulk Operations:
56
67
  bulk reset <id...> Reset multiple tasks to ready
57
68
  bulk delete <id...> Delete multiple tasks
58
69
 
59
- Docs:
60
- doc add <kind> <name> Create a doc (overview, prd, design)
61
- doc edit <name> Open doc YAML in $EDITOR
62
- doc show <name> Show doc details
63
- doc list List all docs
64
- doc render [name] Render MD files + regenerate index
65
- doc lock <name> Lock doc (immutable)
66
- doc version <name> Create new version from locked doc
67
- doc link <from> <to> Link two docs
68
- doc attach <task> <doc> Link task to doc
69
- doc patch <design> <n> Create design patch on locked doc
70
- doc validate Warn about unlinked tasks
71
- doc drift <name> Detect drift between doc and tasks
72
-
73
- Invariants:
74
- invariant list List all invariants
75
- invariant show <id> Show invariant details
76
- invariant record <id> Record pass/fail check result
77
- invariant sync Sync invariants from doc YAML to DB
78
-
79
- Cycle Scan:
80
- cycle Run cycle-based issue discovery scan
81
-
82
- Utilities:
70
+ Tools:
83
71
  stats Show queue metrics and health overview
84
72
  validate Run pre-flight database health checks
85
- migrate status Show database migration status
86
- doctor Run system diagnostics for troubleshooting
87
- dashboard Start API server + dashboard and open in browser
88
- mcp-server Start MCP server (JSON-RPC over stdio)
73
+ doctor Run system diagnostics
74
+ dashboard Start API server + dashboard
89
75
 
90
76
  Global Options:
91
77
  --json Output as JSON
@@ -106,17 +92,22 @@ Examples:
106
92
  export const commandHelp = {
107
93
  init: `tx init - Initialize task database
108
94
 
109
- Usage: tx init [--db <path>]
95
+ Usage: tx init [--db <path>] [--claude] [--codex]
110
96
 
111
97
  Initializes the tx database and required tables. Creates .tx/tasks.db
112
98
  by default. Safe to run multiple times (idempotent).
113
99
 
114
100
  Options:
115
101
  --db <path> Database path (default: .tx/tasks.db)
102
+ --claude Scaffold Claude Code integration (CLAUDE.md + .claude/skills/)
103
+ --codex Scaffold Codex integration (AGENTS.md + .codex/agents)
116
104
  --help Show this help
117
105
 
118
106
  Examples:
119
- tx init # Initialize in .tx/tasks.db
107
+ tx init # Initialize database only
108
+ tx init --claude # Database + Claude Code skills & CLAUDE.md
109
+ tx init --codex # Database + Codex AGENTS.md + agent profiles
110
+ tx init --claude --codex # Database + both integrations
120
111
  tx init --db ~/my-tasks.db # Use custom path`,
121
112
  add: `tx add - Create a new task
122
113
 
@@ -579,8 +570,9 @@ Examples:
579
570
 
580
571
  Usage: tx learning:search <query> [options]
581
572
 
582
- Searches learnings using hybrid BM25 + vector search with RRF fusion.
583
- Returns results ranked by relevance.
573
+ Searches learnings using BM25 full-text search. Returns results ranked by
574
+ relevance (BM25 score) and recency. Supports graph expansion to discover
575
+ related learnings through the knowledge graph.
584
576
 
585
577
  Arguments:
586
578
  <query> Required. Search query (keywords or phrase)
@@ -588,12 +580,16 @@ Arguments:
588
580
  Options:
589
581
  -n, --limit <n> Maximum results (default: 10)
590
582
  --min-score <n> Minimum relevance score 0-1 (default: 0.3)
583
+ --expand Enable graph expansion to find related learnings
584
+ --depth <n> Graph expansion depth (default: 2)
585
+ --edge-types <types> Comma-separated edge types to traverse
591
586
  --json Output as JSON
592
587
  --help Show this help
593
588
 
594
589
  Examples:
595
590
  tx learning:search "database transactions"
596
- tx learning:search "authentication" -n 5 --json`,
591
+ tx learning:search "authentication" -n 5 --json
592
+ tx learning:search "auth" --expand --depth 3`,
597
593
  "learning:recent": `tx learning:recent - List recent learnings
598
594
 
599
595
  Usage: tx learning:recent [options]
@@ -659,8 +655,8 @@ Examples:
659
655
  Usage: tx context <task-id> [options]
660
656
 
661
657
  Retrieves learnings relevant to a specific task based on its title and
662
- description. Uses hybrid BM25 + vector search with RRF fusion, optional
663
- re-ranking and MMR diversification.
658
+ description. Uses hybrid BM25 + recency scoring. Supports graph expansion
659
+ to discover related learnings through the knowledge graph.
664
660
 
665
661
  Arguments:
666
662
  <task-id> Required. Task ID (e.g., tx-a1b2c3d4)
@@ -668,6 +664,9 @@ Arguments:
668
664
  Options:
669
665
  --json Output as JSON
670
666
  --inject Write to .tx/context.md for injection
667
+ --expand Enable graph expansion to find related learnings
668
+ --depth <n> Graph expansion depth (default: 2)
669
+ --edge-types <types> Comma-separated edge types to traverse
671
670
  --retriever <path> Use custom retriever module (exports Layer<RetrieverService>)
672
671
  --help Show this help
673
672
 
@@ -690,6 +689,7 @@ Examples:
690
689
  tx context tx-a1b2c3d4
691
690
  tx context tx-a1b2c3d4 --json
692
691
  tx context tx-a1b2c3d4 --inject
692
+ tx context tx-a1b2c3d4 --expand --depth 3
693
693
  tx context tx-a1b2c3d4 --retriever ./my-retriever.ts`,
694
694
  learn: `tx learn - Attach a learning to a file path or glob pattern
695
695
 
@@ -742,6 +742,580 @@ Examples:
742
742
  tx help # General help
743
743
  tx help add # Help for 'add' command
744
744
  tx add --help # Same as above`,
745
+ "graph:verify": `tx graph:verify - Verify anchor validity
746
+
747
+ Usage: tx graph:verify [file] [--all] [--json]
748
+
749
+ Verifies that anchors still point to valid code locations. Checks if files
750
+ exist, content hashes match, and symbols are present.
751
+
752
+ Arguments:
753
+ [file] Optional. File path to verify anchors for
754
+
755
+ Options:
756
+ --file <path> File path to verify (alternative to positional arg)
757
+ --all Verify all anchors (default if no file specified)
758
+ --json Output as JSON
759
+ --help Show this help
760
+
761
+ Examples:
762
+ tx graph:verify # Verify all anchors
763
+ tx graph:verify src/auth.ts # Verify anchors for specific file
764
+ tx graph:verify --json # Output as JSON`,
765
+ "graph:invalidate": `tx graph:invalidate - Manually invalidate an anchor
766
+
767
+ Usage: tx graph:invalidate <anchor-id> [--reason <reason>] [--json]
768
+
769
+ Marks an anchor as invalid (soft delete). The anchor is kept for history
770
+ but excluded from retrieval. Use graph:restore to undo.
771
+
772
+ Arguments:
773
+ <anchor-id> Required. Anchor ID (number)
774
+
775
+ Options:
776
+ --reason <text> Reason for invalidation (default: "Manual invalidation")
777
+ --json Output as JSON
778
+ --help Show this help
779
+
780
+ Examples:
781
+ tx graph:invalidate 42 --reason "Code removed"
782
+ tx graph:invalidate 42 --json`,
783
+ "graph:restore": `tx graph:restore - Restore a soft-deleted anchor
784
+
785
+ Usage: tx graph:restore <anchor-id> [--json]
786
+
787
+ Restores an invalid anchor back to valid status. Use this to undo
788
+ accidental invalidations or re-enable an anchor after code is restored.
789
+
790
+ Arguments:
791
+ <anchor-id> Required. Anchor ID (number)
792
+
793
+ Options:
794
+ --json Output as JSON
795
+ --help Show this help
796
+
797
+ Examples:
798
+ tx graph:restore 42
799
+ tx graph:restore 42 --json`,
800
+ "graph:prune": `tx graph:prune - Hard delete old invalid anchors
801
+
802
+ Usage: tx graph:prune [--older-than <days>] [--json]
803
+
804
+ Permanently deletes anchors that have been invalid for longer than the
805
+ specified period. Default retention is 90 days.
806
+
807
+ Options:
808
+ --older-than <days> Delete anchors invalid for this many days (default: 90)
809
+ --json Output as JSON
810
+ --help Show this help
811
+
812
+ Examples:
813
+ tx graph:prune # Delete anchors invalid > 90 days
814
+ tx graph:prune --older-than 30 # Delete anchors invalid > 30 days
815
+ tx graph:prune --json`,
816
+ "graph:status": `tx graph:status - Show graph health metrics
817
+
818
+ Usage: tx graph:status [--json]
819
+
820
+ Shows overall health of the knowledge graph including anchor counts by
821
+ status, pinned anchors, and recent invalidation events.
822
+
823
+ Options:
824
+ --json Output as JSON
825
+ --help Show this help
826
+
827
+ Examples:
828
+ tx graph:status
829
+ tx graph:status --json`,
830
+ "graph:pin": `tx graph:pin - Pin an anchor
831
+
832
+ Usage: tx graph:pin <anchor-id> [--json]
833
+
834
+ Pins an anchor to prevent automatic invalidation. Pinned anchors are
835
+ skipped during periodic and on-access verification. Use for anchors
836
+ you want to preserve regardless of code changes.
837
+
838
+ Arguments:
839
+ <anchor-id> Required. Anchor ID (number)
840
+
841
+ Options:
842
+ --json Output as JSON
843
+ --help Show this help
844
+
845
+ Examples:
846
+ tx graph:pin 42
847
+ tx graph:pin 42 --json`,
848
+ "graph:unpin": `tx graph:unpin - Unpin an anchor
849
+
850
+ Usage: tx graph:unpin <anchor-id> [--json]
851
+
852
+ Removes the pin from an anchor, allowing automatic invalidation
853
+ during verification.
854
+
855
+ Arguments:
856
+ <anchor-id> Required. Anchor ID (number)
857
+
858
+ Options:
859
+ --json Output as JSON
860
+ --help Show this help
861
+
862
+ Examples:
863
+ tx graph:unpin 42
864
+ tx graph:unpin 42 --json`,
865
+ "hooks:install": `tx hooks:install - Install post-commit hook
866
+
867
+ Usage: tx hooks:install [options]
868
+
869
+ Installs a git post-commit hook that automatically triggers anchor
870
+ verification when commits meet certain criteria:
871
+ - More than 10 files changed (configurable)
872
+ - High-value configuration files modified
873
+
874
+ The hook runs verification in the background to avoid blocking commits.
875
+ Configuration is stored in .txrc.json and can be customized.
876
+
877
+ Options:
878
+ --force, -f Overwrite existing hook
879
+ --threshold, -t <n> File count threshold (default: 10)
880
+ --high-value, -h <list> Comma-separated list of high-value file patterns
881
+ --json Output as JSON
882
+ --help Show this help
883
+
884
+ Examples:
885
+ tx hooks:install # Install with defaults
886
+ tx hooks:install --threshold 5 # Trigger on 5+ files
887
+ tx hooks:install --high-value "*.config.ts,schema.prisma"
888
+ tx hooks:install --force # Reinstall hook
889
+ tx hooks:install --json # JSON output for scripting`,
890
+ "hooks:uninstall": `tx hooks:uninstall - Remove post-commit hook
891
+
892
+ Usage: tx hooks:uninstall [options]
893
+
894
+ Removes the tx post-commit hook. Only removes hooks that were
895
+ installed by tx (identified by marker comment). Updates .txrc.json
896
+ to disable hook settings.
897
+
898
+ Options:
899
+ --json Output as JSON
900
+ --help Show this help
901
+
902
+ Examples:
903
+ tx hooks:uninstall
904
+ tx hooks:uninstall --json # JSON output for scripting`,
905
+ "hooks:status": `tx hooks:status - Show git hook status
906
+
907
+ Usage: tx hooks:status [--json]
908
+
909
+ Shows the current status of the tx git hook integration including:
910
+ - Whether a hook is installed
911
+ - Whether hooks are enabled in config
912
+ - Current configuration settings
913
+
914
+ Options:
915
+ --json Output as JSON
916
+ --help Show this help
917
+
918
+ Examples:
919
+ tx hooks:status
920
+ tx hooks:status --json`,
921
+ "test:cache-stats": `tx test:cache-stats - Show LLM cache statistics
922
+
923
+ Usage: tx test:cache-stats [--json]
924
+
925
+ Shows statistics about the LLM response cache including:
926
+ - Total number of cache entries
927
+ - Total cache size in bytes
928
+ - Date range of cached entries
929
+ - Breakdown by model
930
+ - Breakdown by cache version
931
+
932
+ Options:
933
+ --json Output as JSON
934
+ --help Show this help
935
+
936
+ Examples:
937
+ tx test:cache-stats # Show formatted statistics
938
+ tx test:cache-stats --json # Output as JSON`,
939
+ "test:clear-cache": `tx test:clear-cache - Clear LLM cache entries
940
+
941
+ Usage: tx test:clear-cache [options]
942
+
943
+ Clears LLM cache entries based on specified criteria. At least one
944
+ option must be provided to prevent accidental cache deletion.
945
+
946
+ Options:
947
+ --all Clear all cache entries
948
+ --older-than <n>d Clear entries older than N days (e.g., 30d, 7d)
949
+ Supports: d (days), h (hours), m (minutes), s (seconds)
950
+ --model <name> Clear entries for a specific model
951
+ --version <n> Clear entries with a specific cache version
952
+ --json Output as JSON
953
+ --help Show this help
954
+
955
+ Examples:
956
+ tx test:clear-cache --all # Clear entire cache
957
+ tx test:clear-cache --older-than 30d # Clear entries older than 30 days
958
+ tx test:clear-cache --older-than 2h # Clear entries older than 2 hours
959
+ tx test:clear-cache --model claude-haiku # Clear claude-haiku entries
960
+ tx test:clear-cache --version 1 # Clear version 1 entries
961
+ tx test:clear-cache --model claude-sonnet-4 --older-than 7d`,
962
+ daemon: `tx daemon - Background daemon for learning extraction
963
+
964
+ Usage: tx daemon <subcommand> [options]
965
+
966
+ Subcommands:
967
+ start Start the background daemon
968
+ stop Stop the background daemon
969
+ status Show daemon status
970
+ track Track a project for learning extraction
971
+ untrack Stop tracking a project
972
+ list List tracked projects
973
+ process Process learning candidates
974
+ review Review a learning candidate
975
+ promote Promote a candidate to learning
976
+ reject Reject a learning candidate
977
+
978
+ Run 'tx daemon <subcommand> --help' for subcommand-specific help.
979
+
980
+ Examples:
981
+ tx daemon start # Start the daemon
982
+ tx daemon status # Show daemon status
983
+ tx daemon track . # Track current directory
984
+ tx daemon list # List tracked projects`,
985
+ "daemon start": `tx daemon start - Start the background daemon
986
+
987
+ Usage: tx daemon start [options]
988
+
989
+ Starts the background daemon process that monitors tracked projects
990
+ for file changes and extracts learning candidates.
991
+
992
+ Options:
993
+ --json Output as JSON
994
+ --help Show this help
995
+
996
+ Examples:
997
+ tx daemon start`,
998
+ "daemon stop": `tx daemon stop - Stop the background daemon
999
+
1000
+ Usage: tx daemon stop [options]
1001
+
1002
+ Stops the running background daemon process.
1003
+
1004
+ Options:
1005
+ --json Output as JSON
1006
+ --help Show this help
1007
+
1008
+ Examples:
1009
+ tx daemon stop`,
1010
+ "daemon status": `tx daemon status - Show daemon status
1011
+
1012
+ Usage: tx daemon status [options]
1013
+
1014
+ Shows the current status of the daemon including:
1015
+ - Whether daemon is running
1016
+ - PID if running
1017
+ - Number of tracked projects
1018
+ - Number of pending candidates
1019
+
1020
+ Options:
1021
+ --json Output as JSON
1022
+ --help Show this help
1023
+
1024
+ Examples:
1025
+ tx daemon status
1026
+ tx daemon status --json`,
1027
+ "daemon track": `tx daemon track - Track a project for learning extraction
1028
+
1029
+ Usage: tx daemon track <project-path> [options]
1030
+
1031
+ Adds a project directory to the daemon's watch list. The daemon will
1032
+ monitor file changes and extract learning candidates.
1033
+
1034
+ Arguments:
1035
+ <project-path> Required. Path to the project directory
1036
+
1037
+ Options:
1038
+ --json Output as JSON
1039
+ --help Show this help
1040
+
1041
+ Examples:
1042
+ tx daemon track . # Track current directory
1043
+ tx daemon track ~/projects/my-app`,
1044
+ "daemon untrack": `tx daemon untrack - Stop tracking a project
1045
+
1046
+ Usage: tx daemon untrack <project-path> [options]
1047
+
1048
+ Removes a project from the daemon's watch list.
1049
+
1050
+ Arguments:
1051
+ <project-path> Required. Path to the project directory
1052
+
1053
+ Options:
1054
+ --json Output as JSON
1055
+ --help Show this help
1056
+
1057
+ Examples:
1058
+ tx daemon untrack .
1059
+ tx daemon untrack ~/projects/my-app`,
1060
+ "daemon list": `tx daemon list - List tracked projects
1061
+
1062
+ Usage: tx daemon list [options]
1063
+
1064
+ Lists all projects currently being tracked by the daemon.
1065
+
1066
+ Options:
1067
+ --json Output as JSON
1068
+ --help Show this help
1069
+
1070
+ Examples:
1071
+ tx daemon list
1072
+ tx daemon list --json`,
1073
+ "daemon process": `tx daemon process - Process JSONL files for learning candidates
1074
+
1075
+ Usage: tx daemon process [options]
1076
+
1077
+ Processes JSONL files to extract learning candidates. By default, processes
1078
+ files from tracked projects. Use --path to specify a custom glob pattern.
1079
+
1080
+ Options:
1081
+ --path, -p <glob> Glob pattern for JSONL files to process
1082
+ --json Output as JSON
1083
+ --help Show this help
1084
+
1085
+ Examples:
1086
+ tx daemon process # Process tracked projects
1087
+ tx daemon process --path ~/.claude/**/*.jsonl # Process specific files`,
1088
+ "daemon review": `tx daemon review - List pending learning candidates
1089
+
1090
+ Usage: tx daemon review [options]
1091
+
1092
+ Lists pending learning candidates awaiting promotion.
1093
+
1094
+ Options:
1095
+ --confidence, -c <levels> Filter by confidence (comma-separated: high,medium,low)
1096
+ --limit, -l <n> Maximum candidates to show
1097
+ --json Output as JSON
1098
+ --help Show this help
1099
+
1100
+ Examples:
1101
+ tx daemon review
1102
+ tx daemon review --confidence medium,low
1103
+ tx daemon review --limit 10 --json`,
1104
+ "daemon promote": `tx daemon promote - Promote a candidate to learning
1105
+
1106
+ Usage: tx daemon promote <candidate-id> [options]
1107
+
1108
+ Promotes a learning candidate to a permanent learning entry.
1109
+
1110
+ Arguments:
1111
+ <candidate-id> Required. Candidate ID
1112
+
1113
+ Options:
1114
+ --json Output as JSON
1115
+ --help Show this help
1116
+
1117
+ Examples:
1118
+ tx daemon promote 42`,
1119
+ "daemon reject": `tx daemon reject - Reject a learning candidate
1120
+
1121
+ Usage: tx daemon reject <candidate-id> --reason <reason> [options]
1122
+
1123
+ Rejects a learning candidate with a reason.
1124
+
1125
+ Arguments:
1126
+ <candidate-id> Required. Candidate ID
1127
+
1128
+ Options:
1129
+ --reason <text> Required. Reason for rejection
1130
+ --json Output as JSON
1131
+ --help Show this help
1132
+
1133
+ Examples:
1134
+ tx daemon reject 42 --reason "Not relevant"
1135
+ tx daemon reject 42 --reason "Duplicate of existing learning"`,
1136
+ coordinator: `tx coordinator - Worker coordination primitives
1137
+
1138
+ Usage: tx coordinator <subcommand> [options]
1139
+
1140
+ Manages the worker coordination system for parallel task processing.
1141
+ Provides Kubernetes-style worker health tracking, lease-based claims,
1142
+ and automatic orphan detection.
1143
+
1144
+ Subcommands:
1145
+ start Start the coordinator
1146
+ stop Stop the coordinator
1147
+ status Show coordinator status
1148
+ reconcile Force a reconciliation pass
1149
+
1150
+ Run 'tx coordinator <subcommand> --help' for subcommand-specific help.
1151
+
1152
+ Examples:
1153
+ tx coordinator start # Start with default settings
1154
+ tx coordinator start --workers 3 # Start with 3 workers
1155
+ tx coordinator status # Show current status
1156
+ tx coordinator reconcile # Force orphan detection`,
1157
+ "coordinator start": `tx coordinator start - Start the coordinator
1158
+
1159
+ Usage: tx coordinator start [options]
1160
+
1161
+ Starts the worker coordination system. The coordinator manages worker
1162
+ health via heartbeats, handles lease-based task claims, and runs periodic
1163
+ reconciliation to detect dead workers and orphaned tasks.
1164
+
1165
+ Options:
1166
+ --workers, -w <n> Worker pool size (default: 1)
1167
+ --daemon, -d Run as daemon in background
1168
+ --json Output as JSON
1169
+ --help Show this help
1170
+
1171
+ Examples:
1172
+ tx coordinator start # Start with 1 worker
1173
+ tx coordinator start --workers 3 # Start with 3 workers
1174
+ tx coordinator start -w 5 --daemon # 5 workers in background`,
1175
+ "coordinator stop": `tx coordinator stop - Stop the coordinator
1176
+
1177
+ Usage: tx coordinator stop [options]
1178
+
1179
+ Stops the running coordinator. By default, immediately marks all workers
1180
+ as dead. With --graceful, signals workers to finish current tasks first.
1181
+
1182
+ Options:
1183
+ --graceful, -g Wait for workers to finish current tasks
1184
+ --json Output as JSON
1185
+ --help Show this help
1186
+
1187
+ Examples:
1188
+ tx coordinator stop # Immediate stop
1189
+ tx coordinator stop --graceful # Wait for workers to finish`,
1190
+ "coordinator status": `tx coordinator status - Show coordinator status
1191
+
1192
+ Usage: tx coordinator status [options]
1193
+
1194
+ Shows the current status of the coordinator including:
1195
+ - Running status (stopped/starting/running/stopping)
1196
+ - Process ID if running
1197
+ - Worker pool size configuration
1198
+ - Heartbeat and lease timing settings
1199
+ - Last reconciliation timestamp
1200
+
1201
+ Options:
1202
+ --json Output as JSON
1203
+ --help Show this help
1204
+
1205
+ Examples:
1206
+ tx coordinator status
1207
+ tx coordinator status --json`,
1208
+ "coordinator reconcile": `tx coordinator reconcile - Force reconciliation pass
1209
+
1210
+ Usage: tx coordinator reconcile [options]
1211
+
1212
+ Runs a single reconciliation pass immediately. Reconciliation:
1213
+ - Detects dead workers (missed 2+ heartbeats)
1214
+ - Releases expired task claims
1215
+ - Recovers orphaned tasks (active but no claim)
1216
+ - Fixes state inconsistencies
1217
+
1218
+ Normally runs automatically every 60s, but can be triggered manually.
1219
+
1220
+ Options:
1221
+ --json Output as JSON
1222
+ --help Show this help
1223
+
1224
+ Examples:
1225
+ tx coordinator reconcile
1226
+ tx coordinator reconcile --json`,
1227
+ worker: `tx worker - Worker process management
1228
+
1229
+ Usage: tx worker <subcommand> [options]
1230
+
1231
+ Manages worker processes for the coordination system. Workers claim and
1232
+ execute tasks, sending heartbeats to the coordinator.
1233
+
1234
+ Subcommands:
1235
+ start Start a worker process
1236
+ stop Stop a worker process
1237
+ status Show worker status
1238
+ list List all workers
1239
+
1240
+ Run 'tx worker <subcommand> --help' for subcommand-specific help.
1241
+
1242
+ Examples:
1243
+ tx worker start # Start with defaults
1244
+ tx worker start --name my-worker # Start with custom name
1245
+ tx worker status # Show worker summary
1246
+ tx worker list # List all workers`,
1247
+ "worker start": `tx worker start - Start a worker process
1248
+
1249
+ Usage: tx worker start [options]
1250
+
1251
+ Starts a worker process that registers with the coordinator, claims tasks,
1252
+ and executes them using Claude. The worker sends periodic heartbeats and
1253
+ handles graceful shutdown on SIGTERM/SIGINT.
1254
+
1255
+ Options:
1256
+ --name, -n <name> Worker name (default: worker-<auto>)
1257
+ --capabilities, -c <list> Comma-separated capabilities (default: tx-implementer)
1258
+ --heartbeat <seconds> Heartbeat interval in seconds (default: 30)
1259
+ --json Output as JSON
1260
+ --help Show this help
1261
+
1262
+ Examples:
1263
+ tx worker start # Start with defaults
1264
+ tx worker start --name my-worker # Custom name
1265
+ tx worker start -c tx-implementer,tx-tester # Multiple capabilities
1266
+ tx worker start --heartbeat 15 # Custom heartbeat interval`,
1267
+ "worker stop": `tx worker stop - Stop a worker process
1268
+
1269
+ Usage: tx worker stop [options]
1270
+
1271
+ Workers are stopped by sending SIGTERM to the worker process. The worker
1272
+ will finish its current task (if any) before exiting gracefully.
1273
+
1274
+ Options:
1275
+ --graceful, -g Graceful shutdown (workers already handle this)
1276
+ --json Output as JSON
1277
+ --help Show this help
1278
+
1279
+ Note: To stop a worker, find its PID with 'tx worker list --json' and
1280
+ send SIGTERM:
1281
+
1282
+ kill -SIGTERM <worker-pid>
1283
+
1284
+ Examples:
1285
+ tx worker stop # Show stop instructions`,
1286
+ "worker status": `tx worker status - Show worker status
1287
+
1288
+ Usage: tx worker status [worker-id] [options]
1289
+
1290
+ Shows the status of workers. If a worker ID is provided, shows detailed
1291
+ status for that specific worker. Otherwise, shows a summary of all workers.
1292
+
1293
+ Arguments:
1294
+ [worker-id] Optional. Show detailed status for this worker
1295
+
1296
+ Options:
1297
+ --json Output as JSON
1298
+ --help Show this help
1299
+
1300
+ Examples:
1301
+ tx worker status # Summary of all workers
1302
+ tx worker status worker-abc12345 # Detailed status for one worker
1303
+ tx worker status --json # Summary as JSON`,
1304
+ "worker list": `tx worker list - List all workers
1305
+
1306
+ Usage: tx worker list [options]
1307
+
1308
+ Lists all registered workers with their current status, name, and active task.
1309
+
1310
+ Options:
1311
+ --status, -s <list> Filter by status (comma-separated: starting,idle,busy,stopping,dead)
1312
+ --json Output as JSON
1313
+ --help Show this help
1314
+
1315
+ Examples:
1316
+ tx worker list # List all workers
1317
+ tx worker list --status idle,busy # Only idle and busy workers
1318
+ tx worker list --json # Output as JSON for scripting`,
745
1319
  trace: `tx trace - Execution tracing for debugging run failures
746
1320
 
747
1321
  Usage: tx trace <subcommand> [options]
@@ -899,6 +1473,47 @@ Fails if:
899
1473
  Examples:
900
1474
  tx claim:renew tx-abc123 worker-def456
901
1475
  tx claim:renew tx-abc123 worker-def456 --json`,
1476
+ compact: `tx compact - Compact completed tasks and export learnings
1477
+
1478
+ Usage: tx compact [options]
1479
+
1480
+ Compacts completed tasks older than a specified date and exports learnings
1481
+ to a markdown file (default: CLAUDE.md). Uses LLM to generate summaries
1482
+ and extract actionable learnings from completed work.
1483
+
1484
+ Options:
1485
+ --before <date> Compact tasks before this date (default: 7 days ago)
1486
+ Formats: YYYY-MM-DD or Nd (e.g., 7d for 7 days ago)
1487
+ --output, -o <file> Output file for learnings (default: CLAUDE.md)
1488
+ --dry-run, --preview Preview without compacting (no API key needed)
1489
+ --json Output as JSON
1490
+ --help Show this help
1491
+
1492
+ Requirements:
1493
+ - ANTHROPIC_API_KEY environment variable must be set for actual compaction
1494
+ - --dry-run works without an API key
1495
+
1496
+ Examples:
1497
+ tx compact # Compact tasks older than 7 days
1498
+ tx compact --before 2024-01-15 # Compact tasks before Jan 15
1499
+ tx compact --before 30d # Compact tasks older than 30 days
1500
+ tx compact --dry-run # Preview what would be compacted
1501
+ tx compact --output agents.md # Export learnings to agents.md
1502
+ tx compact --json # Output as JSON`,
1503
+ history: `tx history - View compaction history
1504
+
1505
+ Usage: tx history [options]
1506
+
1507
+ Shows the history of past compaction operations including dates,
1508
+ task counts, and where learnings were exported.
1509
+
1510
+ Options:
1511
+ --json Output as JSON
1512
+ --help Show this help
1513
+
1514
+ Examples:
1515
+ tx history
1516
+ tx history --json`,
902
1517
  validate: `tx validate - Database health checks
903
1518
 
904
1519
  Usage: tx validate [options]
@@ -1009,57 +1624,127 @@ Examples:
1009
1624
  tx dashboard # Start and open in Brave/Chrome
1010
1625
  tx dashboard --no-open # Start without opening browser
1011
1626
  tx dashboard --port 3002 # Custom API port`,
1012
- doc: `tx doc - Docs as primitives (DD-023)
1627
+ send: `tx send - Send a message to a channel
1628
+
1629
+ Usage: tx send <channel> <content> [options]
1630
+
1631
+ Options:
1632
+ --sender <s> Sender name (default: "cli")
1633
+ --task <id> Associate with a task ID
1634
+ --ttl <seconds> Time-to-live in seconds
1635
+ --correlation <id> Correlation ID for request/reply
1636
+ --metadata '{}' JSON metadata object
1637
+ --json Output as JSON
1638
+
1639
+ Examples:
1640
+ tx send worker-3 "Review PR #42" --sender orchestrator
1641
+ tx send broadcast "v2.3.0 deployed" --sender ci --ttl 3600
1642
+ tx send errors "OOM at step 4" --sender worker-3 --task tx-abc123
1643
+ tx send orchestrator "Done" --correlation 550e8400-e29b`,
1644
+ inbox: `tx inbox - Read messages from a channel
1645
+
1646
+ Usage: tx inbox <channel> [options]
1647
+
1648
+ Read-only: does NOT modify message status. Use tx ack to acknowledge.
1649
+ Use --after for cursor-based reading (each reader tracks their own position).
1650
+
1651
+ Options:
1652
+ --after <id> Only messages with ID > this value (cursor)
1653
+ --limit <n> Max messages to return (default: 50)
1654
+ --sender <s> Filter by sender
1655
+ --correlation <id> Filter by correlation ID
1656
+ --include-acked Include already-acknowledged messages
1657
+ --json Output as JSON
1658
+
1659
+ Examples:
1660
+ tx inbox worker-3 # Read pending messages
1661
+ tx inbox broadcast --after 42 # Cursor-based fan-out
1662
+ tx inbox orchestrator --json # JSON output
1663
+ tx inbox errors --include-acked # Include acked messages`,
1664
+ ack: `tx ack - Acknowledge a message
1665
+
1666
+ Usage: tx ack <message-id> [--json]
1667
+
1668
+ Transitions a message from pending to acked.
1669
+
1670
+ Examples:
1671
+ tx ack 42
1672
+ tx ack 42 --json`,
1673
+ "ack:all": `tx ack:all - Acknowledge all pending messages on a channel
1674
+
1675
+ Usage: tx ack:all <channel> [--json]
1676
+
1677
+ Examples:
1678
+ tx ack:all worker-3
1679
+ tx ack:all errors --json`,
1680
+ "outbox:pending": `tx outbox:pending - Count pending messages
1013
1681
 
1014
- Usage: tx doc <subcommand> [options]
1682
+ Usage: tx outbox:pending <channel> [--json]
1683
+
1684
+ Examples:
1685
+ tx outbox:pending errors
1686
+ tx outbox:pending worker-3 --json`,
1687
+ "outbox:gc": `tx outbox:gc - Garbage collect old messages
1688
+
1689
+ Usage: tx outbox:gc [--acked-older-than <hours>] [--json]
1690
+
1691
+ Deletes expired messages (past TTL) and optionally old acked messages.
1692
+
1693
+ Options:
1694
+ --acked-older-than <hours> Delete acked messages older than N hours
1695
+
1696
+ Examples:
1697
+ tx outbox:gc # Delete expired only
1698
+ tx outbox:gc --acked-older-than 24 # Also clean acked > 24h old`,
1699
+ doc: `tx doc - Manage docs-as-primitives
1700
+
1701
+ Usage: tx doc [subcommand] [options]
1015
1702
 
1016
1703
  Subcommands:
1017
- add <kind> <name> Create a doc (overview, prd, design)
1018
- edit <name> Open doc YAML in $EDITOR
1019
- show <name> Show doc details (--md for rendered markdown)
1020
- list List all docs (--kind, --status filters)
1021
- render [name] Render MD files + regenerate index
1022
- lock <name> Lock doc (immutable after locking)
1023
- version <name> Create new version from locked doc (copies content)
1024
- link <from> <to> Link two docs (auto-infers link type)
1025
- attach <task> <doc> Link task to doc (--type implements|references)
1026
- patch <design> <name> Create design patch on locked doc
1027
- validate Warn about tasks not linked to docs
1028
- drift <name> Detect drift between doc and linked tasks
1704
+ add <kind> <name> Create a new doc (overview, prd, design)
1705
+ edit <name> Open doc YAML in $EDITOR
1706
+ show <name> Show doc details
1707
+ list List all docs
1708
+ render [name] Render YAML to Markdown (all docs if no name)
1709
+ lock <name> Lock a doc version (immutable)
1710
+ version <name> Create new version from locked doc
1711
+ link <from> <to> Link two docs
1712
+ attach <task-id> <name> Attach a doc to a task
1713
+ patch <design> <patch> Create a design patch doc
1714
+ validate Check all tasks are linked to docs
1715
+ drift <name> Detect hash/link drift for a doc
1029
1716
 
1030
1717
  Run 'tx doc <subcommand> --help' for subcommand-specific help.
1718
+ Running 'tx doc' with no subcommand defaults to 'tx doc list'.
1031
1719
 
1032
1720
  Examples:
1033
- tx doc add overview system-design
1034
- tx doc add design DD-023 --title "Docs as Primitives"
1721
+ tx doc add prd auth-flow --title "Authentication Flow"
1722
+ tx doc show auth-flow --json
1723
+ tx doc list --kind design --status changing
1724
+ tx doc lock auth-flow
1725
+ tx doc version auth-flow
1035
1726
  tx doc render
1036
- tx doc lock DD-023
1037
- tx doc version DD-023
1038
- tx doc validate`,
1727
+ tx doc attach tx-abc123 auth-flow
1728
+ tx doc drift auth-flow`,
1039
1729
  "doc add": `tx doc add - Create a new doc
1040
1730
 
1041
- Usage: tx doc add <kind> <name> [--title <title>]
1731
+ Usage: tx doc add <kind> <name> [--title <title>] [--json]
1042
1732
 
1043
- Creates a new doc with template YAML content. The file is written to
1044
- .tx/docs/<kind>/<name>.yml (overview docs go to .tx/docs/<name>.yml).
1733
+ Creates a new doc with generated YAML template on disk and metadata in DB.
1045
1734
 
1046
1735
  Arguments:
1047
- <kind> Required. Doc kind: overview, prd, design
1048
- <name> Required. Doc name (e.g., DD-023-docs-as-primitives)
1736
+ <kind> Required. Doc kind: overview, prd, or design
1737
+ <name> Required. Doc name (alphanumeric with dashes/dots)
1049
1738
 
1050
1739
  Options:
1051
- --title, -t <title> Doc title (defaults to name)
1052
- --json Output as JSON
1053
- --help Show this help
1054
-
1055
- Notes:
1056
- - Only ONE overview doc is allowed per project
1057
- - YAML content is the source of truth; MD is generated via 'tx doc render'
1740
+ --title, -t <title> Doc title (defaults to name)
1741
+ --json Output as JSON
1742
+ --help Show this help
1058
1743
 
1059
1744
  Examples:
1060
- tx doc add overview system-design --title "System Design & Invariants"
1061
- tx doc add prd PRD-023 --title "Docs as Primitives"
1062
- tx doc add design DD-023 --title "Docs as Primitives"`,
1745
+ tx doc add prd auth-flow --title "Authentication Flow"
1746
+ tx doc add design auth-impl -t "Auth Implementation"
1747
+ tx doc add overview system-overview`,
1063
1748
  "doc edit": `tx doc edit - Open doc YAML in editor
1064
1749
 
1065
1750
  Usage: tx doc edit <name>
@@ -1070,66 +1755,66 @@ Arguments:
1070
1755
  <name> Required. Doc name
1071
1756
 
1072
1757
  Examples:
1073
- tx doc edit DD-023
1074
- EDITOR=code tx doc edit DD-023`,
1758
+ tx doc edit auth-flow
1759
+ EDITOR=code tx doc edit auth-flow`,
1075
1760
  "doc show": `tx doc show - Show doc details
1076
1761
 
1077
1762
  Usage: tx doc show <name> [--md] [--json]
1078
1763
 
1079
- Shows metadata for a doc. Use --md to display rendered markdown content.
1764
+ Shows doc metadata. With --md, renders and displays Markdown content.
1080
1765
 
1081
1766
  Arguments:
1082
1767
  <name> Required. Doc name
1083
1768
 
1084
1769
  Options:
1085
- --md Show rendered markdown content instead of metadata
1770
+ --md Render and display Markdown content
1086
1771
  --json Output as JSON
1087
1772
  --help Show this help
1088
1773
 
1089
1774
  Examples:
1090
- tx doc show DD-023
1091
- tx doc show DD-023 --md
1092
- tx doc show DD-023 --json`,
1775
+ tx doc show auth-flow
1776
+ tx doc show auth-flow --md
1777
+ tx doc show auth-flow --json`,
1093
1778
  "doc list": `tx doc list - List all docs
1094
1779
 
1095
- Usage: tx doc list [--kind <k>] [--status <s>] [--json]
1780
+ Usage: tx doc list [--kind <kind>] [--status <status>] [--json]
1096
1781
 
1097
- Lists all docs with their kind, version, status, and title.
1782
+ Lists all docs, optionally filtered by kind or status.
1098
1783
 
1099
1784
  Options:
1100
- --kind, -k <kind> Filter by kind (overview, prd, design)
1101
- --status, -s <status> Filter by status (changing, locked)
1102
- --json Output as JSON
1103
- --help Show this help
1785
+ --kind, -k <kind> Filter by kind (overview, prd, design)
1786
+ --status, -s <status> Filter by status (changing, locked)
1787
+ --json Output as JSON
1788
+ --help Show this help
1104
1789
 
1105
1790
  Examples:
1106
1791
  tx doc list
1107
1792
  tx doc list --kind design
1108
1793
  tx doc list --status locked --json`,
1109
- "doc render": `tx doc render - Render MD files from YAML
1794
+ "doc render": `tx doc render - Render YAML to Markdown
1110
1795
 
1111
1796
  Usage: tx doc render [name] [--json]
1112
1797
 
1113
- Reads YAML source files and generates markdown. Always regenerates
1114
- index.yml and index.md alongside any specific doc.
1798
+ Renders doc YAML to Markdown files. If no name given, renders all docs.
1799
+ Also regenerates index.yml and index.md.
1115
1800
 
1116
1801
  Arguments:
1117
- [name] Optional. Specific doc to render (default: all)
1802
+ [name] Optional. Doc name (renders all if omitted)
1118
1803
 
1119
1804
  Options:
1120
1805
  --json Output as JSON
1121
1806
  --help Show this help
1122
1807
 
1123
1808
  Examples:
1124
- tx doc render # Render all docs + index
1125
- tx doc render DD-023 # Render specific doc + index`,
1126
- "doc lock": `tx doc lock - Lock a doc
1809
+ tx doc render # Render all docs
1810
+ tx doc render auth-flow # Render specific doc
1811
+ tx doc render --json`,
1812
+ "doc lock": `tx doc lock - Lock a doc version
1127
1813
 
1128
1814
  Usage: tx doc lock <name> [--json]
1129
1815
 
1130
- Locks a doc, making it immutable. Renders final MD. To make changes
1131
- to a locked doc, create a new version (tx doc version) or a patch
1132
- (tx doc patch).
1816
+ Locks a doc, making it immutable. Also renders final Markdown.
1817
+ Use 'tx doc version' to create a new editable version from a locked doc.
1133
1818
 
1134
1819
  Arguments:
1135
1820
  <name> Required. Doc name
@@ -1139,13 +1824,13 @@ Options:
1139
1824
  --help Show this help
1140
1825
 
1141
1826
  Examples:
1142
- tx doc lock DD-023`,
1827
+ tx doc lock auth-flow
1828
+ tx doc lock auth-flow --json`,
1143
1829
  "doc version": `tx doc version - Create new version from locked doc
1144
1830
 
1145
1831
  Usage: tx doc version <name> [--json]
1146
1832
 
1147
- Creates a new version (v2, v3, etc.) by copying the locked doc's content.
1148
- The new version starts in 'changing' status and can be edited.
1833
+ Creates a new editable version of a locked doc. The doc must be locked first.
1149
1834
 
1150
1835
  Arguments:
1151
1836
  <name> Required. Doc name (must be locked)
@@ -1155,70 +1840,66 @@ Options:
1155
1840
  --help Show this help
1156
1841
 
1157
1842
  Examples:
1158
- tx doc version DD-023 # Creates DD-023 v2 from locked v1`,
1843
+ tx doc version auth-flow`,
1159
1844
  "doc link": `tx doc link - Link two docs
1160
1845
 
1161
1846
  Usage: tx doc link <from-name> <to-name> [--type <link-type>]
1162
1847
 
1163
- Creates a link between two docs. Link type is auto-inferred from
1164
- doc kinds (overview->prd, prd->design, etc.) unless overridden.
1848
+ Creates a directed link between two docs. Link type is auto-inferred
1849
+ from doc kinds if not specified.
1165
1850
 
1166
1851
  Arguments:
1167
- <from-name> Required. Source doc name
1168
- <to-name> Required. Target doc name
1852
+ <from-name> Required. Source doc name
1853
+ <to-name> Required. Target doc name
1169
1854
 
1170
1855
  Options:
1171
- --type <type> Link type (overview_to_prd, overview_to_design,
1172
- prd_to_design, design_patch). Auto-inferred if omitted.
1173
- --json Output as JSON
1174
- --help Show this help
1856
+ --type <type> Link type (overview_to_prd, overview_to_design, prd_to_design, design_patch)
1857
+ --json Output as JSON
1858
+ --help Show this help
1175
1859
 
1176
1860
  Examples:
1177
- tx doc link system-design PRD-023
1178
- tx doc link PRD-023 DD-023`,
1179
- "doc attach": `tx doc attach - Link task to doc
1861
+ tx doc link system-overview auth-prd
1862
+ tx doc link auth-prd auth-impl --type prd_to_design`,
1863
+ "doc attach": `tx doc attach - Attach a doc to a task
1180
1864
 
1181
- Usage: tx doc attach <task-id> <doc-name> [--type <link-type>]
1865
+ Usage: tx doc attach <task-id> <doc-name> [--type implements|references]
1182
1866
 
1183
- Links a task to a doc. Allowed even on locked docs (Class A bugs
1184
- can reference locked designs).
1867
+ Creates a link between a task and a doc.
1185
1868
 
1186
1869
  Arguments:
1187
1870
  <task-id> Required. Task ID (e.g., tx-a1b2c3d4)
1188
1871
  <doc-name> Required. Doc name
1189
1872
 
1190
1873
  Options:
1191
- --type <type> Link type: implements (default) or references
1192
- --json Output as JSON
1193
- --help Show this help
1874
+ --type <type> Link type: implements (default) or references
1875
+ --json Output as JSON
1876
+ --help Show this help
1194
1877
 
1195
1878
  Examples:
1196
- tx doc attach tx-abc123 DD-023
1197
- tx doc attach tx-abc123 DD-023 --type references`,
1198
- "doc patch": `tx doc patch - Create design patch on locked doc
1879
+ tx doc attach tx-abc123 auth-flow
1880
+ tx doc attach tx-abc123 auth-flow --type references`,
1881
+ "doc patch": `tx doc patch - Create a design patch doc
1199
1882
 
1200
1883
  Usage: tx doc patch <design-name> <patch-name> [--title <title>]
1201
1884
 
1202
- Creates a new design doc linked as a patch to a locked design doc.
1203
- Use for Class B bug fixes on locked designs.
1885
+ Creates a new design doc that patches an existing design doc.
1204
1886
 
1205
1887
  Arguments:
1206
- <design-name> Required. Name of locked design doc to patch
1207
- <patch-name> Required. Name for the patch doc
1888
+ <design-name> Required. Parent design doc name
1889
+ <patch-name> Required. New patch doc name
1208
1890
 
1209
1891
  Options:
1210
- --title, -t <title> Patch title (defaults to patch name)
1211
- --json Output as JSON
1212
- --help Show this help
1892
+ --title, -t <title> Patch title (defaults to patch name)
1893
+ --json Output as JSON
1894
+ --help Show this help
1213
1895
 
1214
1896
  Examples:
1215
- tx doc patch DD-023 DD-023-patch-1 --title "Fix rendering edge case"`,
1216
- "doc validate": `tx doc validate - Warn about unlinked tasks
1897
+ tx doc patch auth-impl auth-impl-v2 --title "Auth v2 Migration"`,
1898
+ "doc validate": `tx doc validate - Check task-doc coverage
1217
1899
 
1218
1900
  Usage: tx doc validate [--json]
1219
1901
 
1220
- Checks all tasks and warns about any that are not linked to a design doc.
1221
- Does not block operations (warn-only enforcement).
1902
+ Checks that all tasks are linked to at least one doc.
1222
1903
 
1223
1904
  Options:
1224
1905
  --json Output as JSON
@@ -1227,12 +1908,12 @@ Options:
1227
1908
  Examples:
1228
1909
  tx doc validate
1229
1910
  tx doc validate --json`,
1230
- "doc drift": `tx doc drift - Detect drift between doc and tasks
1911
+ "doc drift": `tx doc drift - Detect drift for a doc
1231
1912
 
1232
1913
  Usage: tx doc drift <name> [--json]
1233
1914
 
1234
- Checks for drift between a doc and its linked tasks. Reports tasks
1235
- that are linked but may not be covered in the doc's work breakdown.
1915
+ Checks for drift between the DB metadata and the YAML file on disk.
1916
+ Reports hash mismatches, missing files, and unlinked design docs.
1236
1917
 
1237
1918
  Arguments:
1238
1919
  <name> Required. Doc name
@@ -1242,93 +1923,113 @@ Options:
1242
1923
  --help Show this help
1243
1924
 
1244
1925
  Examples:
1245
- tx doc drift DD-023
1246
- tx doc drift DD-023 --json`,
1247
- invariant: `tx invariant - Manage structured invariants (DD-023)
1926
+ tx doc drift auth-flow
1927
+ tx doc drift auth-flow --json`,
1928
+ invariant: `tx invariant - Manage machine-checkable invariants
1248
1929
 
1249
1930
  Usage: tx invariant <subcommand> [options]
1250
1931
 
1251
1932
  Subcommands:
1252
- list List all invariants (--subsystem, --enforcement filters)
1253
- show <id> Show invariant details
1254
- record <id> Record pass/fail check result
1255
- sync Sync invariants from doc YAML files to DB
1933
+ list List all invariants
1934
+ show <id> Show invariant details
1935
+ record <id> Record a check result (--passed or --failed)
1936
+ sync Sync invariants from doc YAML files into DB
1256
1937
 
1257
1938
  Run 'tx invariant <subcommand> --help' for subcommand-specific help.
1258
1939
 
1259
1940
  Examples:
1260
1941
  tx invariant list
1261
- tx invariant list --subsystem docs
1262
- tx invariant show INV-DOC-001
1263
- tx invariant record INV-DOC-001 --passed
1264
- tx invariant sync`,
1942
+ tx invariant list --subsystem auth --enforcement integration_test
1943
+ tx invariant show INV-AUTH-001
1944
+ tx invariant record INV-AUTH-001 --passed
1945
+ tx invariant sync
1946
+ tx invariant sync --doc auth-flow`,
1265
1947
  "invariant list": `tx invariant list - List all invariants
1266
1948
 
1267
- Usage: tx invariant list [--subsystem <s>] [--enforcement <e>] [--json]
1949
+ Usage: tx invariant list [options]
1268
1950
 
1269
- Lists all invariants with their rule, enforcement type, and status.
1951
+ Lists all invariants, optionally filtered by subsystem or enforcement type.
1270
1952
 
1271
1953
  Options:
1272
- --subsystem, -s <sub> Filter by subsystem (e.g., docs, task-management)
1273
- --enforcement, -e <type> Filter by enforcement type (integration_test, linter, llm_as_judge)
1274
- --json Output as JSON
1275
- --help Show this help
1954
+ --subsystem, -s <name> Filter by subsystem
1955
+ --enforcement, -e <type> Filter by enforcement (integration_test, linter, llm_as_judge)
1956
+ --json Output as JSON
1957
+ --help Show this help
1276
1958
 
1277
1959
  Examples:
1278
1960
  tx invariant list
1279
- tx invariant list --subsystem docs
1280
- tx invariant list --enforcement integration_test --json`,
1961
+ tx invariant list --subsystem auth
1962
+ tx invariant list --enforcement linter --json`,
1281
1963
  "invariant show": `tx invariant show - Show invariant details
1282
1964
 
1283
1965
  Usage: tx invariant show <id> [--json]
1284
1966
 
1285
1967
  Shows full details for an invariant including rule, enforcement type,
1286
- subsystem, test/lint/prompt references, and status.
1968
+ subsystem, test/lint/prompt references, and creation date.
1287
1969
 
1288
1970
  Arguments:
1289
- <id> Required. Invariant ID (e.g., INV-001, INV-DOC-001)
1971
+ <id> Required. Invariant ID (e.g., INV-AUTH-001)
1290
1972
 
1291
1973
  Options:
1292
1974
  --json Output as JSON
1293
1975
  --help Show this help
1294
1976
 
1295
1977
  Examples:
1296
- tx invariant show INV-001
1297
- tx invariant show INV-DOC-001 --json`,
1298
- "invariant record": `tx invariant record - Record invariant check result
1978
+ tx invariant show INV-AUTH-001
1979
+ tx invariant show INV-AUTH-001 --json`,
1980
+ "invariant record": `tx invariant record - Record a check result
1299
1981
 
1300
- Usage: tx invariant record <id> --passed|--failed [--details <text>]
1982
+ Usage: tx invariant record <id> --passed|--failed [--details <text>] [--json]
1301
1983
 
1302
- Manually records the result of checking an invariant. In v1, all
1303
- checks are manual. Automated runners (test, lint, LLM) are v2.
1984
+ Records whether an invariant check passed or failed. Creates an audit
1985
+ trail entry for compliance tracking.
1304
1986
 
1305
1987
  Arguments:
1306
- <id> Required. Invariant ID (e.g., INV-001)
1988
+ <id> Required. Invariant ID (e.g., INV-AUTH-001)
1307
1989
 
1308
1990
  Flags (one required):
1309
- --passed Record a passing check
1310
- --failed Record a failing check
1991
+ --passed Record a passing check
1992
+ --failed Record a failing check
1311
1993
 
1312
1994
  Options:
1313
- --details, -d <text> Additional details about the check
1995
+ --details, -d <text> Additional details about the check result
1314
1996
  --json Output as JSON
1315
1997
  --help Show this help
1316
1998
 
1317
1999
  Examples:
1318
- tx invariant record INV-001 --passed
1319
- tx invariant record INV-DOC-001 --failed --details "Missing test coverage"
1320
- tx invariant record INV-001 --passed --json`,
1321
- cycle: `tx cycle - Run cycle-based issue discovery scan
2000
+ tx invariant record INV-AUTH-001 --passed
2001
+ tx invariant record INV-AUTH-001 --failed --details "Missing null check"
2002
+ tx invariant record INV-AUTH-001 --passed --json`,
2003
+ "invariant sync": `tx invariant sync - Sync invariants from YAML
2004
+
2005
+ Usage: tx invariant sync [--doc <name>] [--json]
2006
+
2007
+ Syncs invariants from doc YAML files into the database. If a doc name
2008
+ is given, syncs only that doc's invariants. Otherwise syncs all docs.
2009
+
2010
+ Options:
2011
+ --doc <name> Sync invariants from a specific doc only
2012
+ --json Output as JSON
2013
+ --help Show this help
2014
+
2015
+ Examples:
2016
+ tx invariant sync # Sync all docs
2017
+ tx invariant sync --doc auth-flow # Sync specific doc
2018
+ tx invariant sync --json`,
2019
+ cycle: `tx cycle - Cycle-based issue discovery with sub-agent swarms
1322
2020
 
1323
2021
  Usage: tx cycle --task-prompt <text|file> [options]
1324
2022
 
1325
- Dispatches sub-agent swarms to scan for codebase issues, deduplicates
1326
- findings against known issues using LLM-as-judge, and optionally fixes them.
1327
- Repeats in rounds within each cycle until convergence.
2023
+ Dispatches parallel sub-agent swarms to scan for codebase issues,
2024
+ deduplicates findings across rounds, and optionally fixes them.
2025
+ Uses a convergence loop: scan dedup → score → repeat until no new
2026
+ issues are found (loss stabilizes).
2027
+
2028
+ Arguments:
2029
+ --task-prompt <text|file> Required. Area/work being reviewed
1328
2030
 
1329
2031
  Options:
1330
- --task-prompt <text|file> Area/work being reviewed (required)
1331
- --scan-prompt <text|file> What sub-agents look for (optional)
2032
+ --scan-prompt <text|file> What sub-agents look for (default: bugs, anti-patterns, security)
1332
2033
  --name <text> Cycle name (shown in dashboard)
1333
2034
  --description <text> Cycle description
1334
2035
  --cycles <N> Number of cycles (default: 1)
@@ -1340,27 +2041,16 @@ Options:
1340
2041
  --dry-run Report only, no DB writes
1341
2042
  --score <N> Base score for new tasks (default: 500)
1342
2043
  --json Output as JSON
2044
+ --help Show this help
1343
2045
 
1344
- Examples:
1345
- tx cycle --task-prompt "Review core services" --scan-prompt "Find bugs"
1346
- tx cycle --task-prompt "Auth module" --scan-only --name "Auth review"
1347
- tx cycle --task-prompt "Review core" --agents 2 --model claude-sonnet-4-5-20250929
1348
- tx cycle --task-prompt "Full review" --cycles 3 --fix`,
1349
- "invariant sync": `tx invariant sync - Sync invariants from doc YAML to DB
1350
-
1351
- Usage: tx invariant sync [--doc <name>] [--json]
1352
-
1353
- Parses invariant definitions from doc YAML files and upserts them
1354
- into the database. Invariants removed from YAML are deprecated.
1355
-
1356
- Options:
1357
- --doc <name> Only sync invariants from a specific doc
1358
- --json Output as JSON
1359
- --help Show this help
2046
+ Loss Calculation:
2047
+ loss = 3 * HIGH + 2 * MEDIUM + 1 * LOW
2048
+ Convergence: loss drops to 0 or stops decreasing between rounds
1360
2049
 
1361
2050
  Examples:
1362
- tx invariant sync # Sync all docs
1363
- tx invariant sync --doc DD-023 # Sync specific doc
1364
- tx invariant sync --json`
2051
+ tx cycle --task-prompt "Review core services"
2052
+ tx cycle --task-prompt "Review auth module" --scan-prompt "Find security issues"
2053
+ tx cycle --task-prompt "Audit API" --agents 5 --max-rounds 5 --fix
2054
+ tx cycle --task-prompt prompt.md --dry-run --json`
1365
2055
  };
1366
2056
  //# sourceMappingURL=help.js.map