lithermes-ai 0.5.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 (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +245 -0
  3. package/README_Ko-KR.md +245 -0
  4. package/assets/lithermes-plugin/NOTICE.md +37 -0
  5. package/assets/lithermes-plugin/README.md +40 -0
  6. package/assets/lithermes-plugin/__init__.py +179 -0
  7. package/assets/lithermes-plugin/core.py +853 -0
  8. package/assets/lithermes-plugin/litgoal/__init__.py +10 -0
  9. package/assets/lithermes-plugin/litgoal/cli.py +133 -0
  10. package/assets/lithermes-plugin/litgoal/hook.py +48 -0
  11. package/assets/lithermes-plugin/litgoal/model.py +171 -0
  12. package/assets/lithermes-plugin/litgoal/runtime.py +273 -0
  13. package/assets/lithermes-plugin/litgoal/store.py +93 -0
  14. package/assets/lithermes-plugin/litgoal/tools.py +228 -0
  15. package/assets/lithermes-plugin/payload-version.json +471 -0
  16. package/assets/lithermes-plugin/plugin.yaml +9 -0
  17. package/assets/lithermes-plugin/skills/ai-slop-remover/SKILL.md +142 -0
  18. package/assets/lithermes-plugin/skills/comment-checker/SKILL.md +50 -0
  19. package/assets/lithermes-plugin/skills/debugging/SKILL.md +116 -0
  20. package/assets/lithermes-plugin/skills/debugging/references/methodology/00-setup.md +108 -0
  21. package/assets/lithermes-plugin/skills/debugging/references/methodology/02-investigate.md +121 -0
  22. package/assets/lithermes-plugin/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
  23. package/assets/lithermes-plugin/skills/debugging/references/methodology/05-escalate.md +69 -0
  24. package/assets/lithermes-plugin/skills/debugging/references/methodology/06-fix.md +116 -0
  25. package/assets/lithermes-plugin/skills/debugging/references/methodology/08-qa.md +94 -0
  26. package/assets/lithermes-plugin/skills/debugging/references/methodology/09-cleanup.md +164 -0
  27. package/assets/lithermes-plugin/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
  28. package/assets/lithermes-plugin/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
  29. package/assets/lithermes-plugin/skills/debugging/references/runtimes/go.md +252 -0
  30. package/assets/lithermes-plugin/skills/debugging/references/runtimes/native-binary.md +484 -0
  31. package/assets/lithermes-plugin/skills/debugging/references/runtimes/node.md +260 -0
  32. package/assets/lithermes-plugin/skills/debugging/references/runtimes/python.md +248 -0
  33. package/assets/lithermes-plugin/skills/debugging/references/runtimes/rust.md +234 -0
  34. package/assets/lithermes-plugin/skills/debugging/references/tools/ghidra.md +212 -0
  35. package/assets/lithermes-plugin/skills/debugging/references/tools/playwright-cli.md +194 -0
  36. package/assets/lithermes-plugin/skills/debugging/references/tools/pwndbg.md +263 -0
  37. package/assets/lithermes-plugin/skills/debugging/references/tools/pwntools.md +265 -0
  38. package/assets/lithermes-plugin/skills/frontend-ui-ux/SKILL.md +77 -0
  39. package/assets/lithermes-plugin/skills/lit-plan/SKILL.md +374 -0
  40. package/assets/lithermes-plugin/skills/litgoal/.gitkeep +0 -0
  41. package/assets/lithermes-plugin/skills/litgoal/SKILL.md +207 -0
  42. package/assets/lithermes-plugin/skills/litwork/SKILL.md +262 -0
  43. package/assets/lithermes-plugin/skills/lsp/SKILL.md +53 -0
  44. package/assets/lithermes-plugin/skills/programming/SKILL.md +463 -0
  45. package/assets/lithermes-plugin/skills/programming/references/go/README.md +90 -0
  46. package/assets/lithermes-plugin/skills/programming/references/go/backend-stack.md +641 -0
  47. package/assets/lithermes-plugin/skills/programming/references/go/bootstrap.md +328 -0
  48. package/assets/lithermes-plugin/skills/programming/references/go/bubbletea-v2.md +360 -0
  49. package/assets/lithermes-plugin/skills/programming/references/go/cobra-stack.md +468 -0
  50. package/assets/lithermes-plugin/skills/programming/references/go/concurrency.md +362 -0
  51. package/assets/lithermes-plugin/skills/programming/references/go/data-modeling.md +329 -0
  52. package/assets/lithermes-plugin/skills/programming/references/go/error-handling.md +359 -0
  53. package/assets/lithermes-plugin/skills/programming/references/go/golangci-strict.md +236 -0
  54. package/assets/lithermes-plugin/skills/programming/references/go/grpc-connect.md +375 -0
  55. package/assets/lithermes-plugin/skills/programming/references/go/libraries.md +337 -0
  56. package/assets/lithermes-plugin/skills/programming/references/go/one-liners.md +202 -0
  57. package/assets/lithermes-plugin/skills/programming/references/go/sqlc-pgx.md +471 -0
  58. package/assets/lithermes-plugin/skills/programming/references/go/testing.md +467 -0
  59. package/assets/lithermes-plugin/skills/programming/references/go/type-patterns.md +298 -0
  60. package/assets/lithermes-plugin/skills/programming/references/python/README.md +314 -0
  61. package/assets/lithermes-plugin/skills/programming/references/python/async-anyio.md +442 -0
  62. package/assets/lithermes-plugin/skills/programming/references/python/data-modeling.md +233 -0
  63. package/assets/lithermes-plugin/skills/programming/references/python/data-processing.md +133 -0
  64. package/assets/lithermes-plugin/skills/programming/references/python/error-handling.md +218 -0
  65. package/assets/lithermes-plugin/skills/programming/references/python/fastapi-stack.md +316 -0
  66. package/assets/lithermes-plugin/skills/programming/references/python/httpx2-optimization.md +360 -0
  67. package/assets/lithermes-plugin/skills/programming/references/python/libraries.md +307 -0
  68. package/assets/lithermes-plugin/skills/programming/references/python/one-liners.md +268 -0
  69. package/assets/lithermes-plugin/skills/programming/references/python/orjson-stack.md +378 -0
  70. package/assets/lithermes-plugin/skills/programming/references/python/pydantic-ai.md +285 -0
  71. package/assets/lithermes-plugin/skills/programming/references/python/pyproject-strict.md +232 -0
  72. package/assets/lithermes-plugin/skills/programming/references/python/textual-tui.md +201 -0
  73. package/assets/lithermes-plugin/skills/programming/references/python/type-patterns.md +176 -0
  74. package/assets/lithermes-plugin/skills/programming/references/rust/README.md +317 -0
  75. package/assets/lithermes-plugin/skills/programming/references/rust/async-tokio.md +299 -0
  76. package/assets/lithermes-plugin/skills/programming/references/rust/axum-stack.md +467 -0
  77. package/assets/lithermes-plugin/skills/programming/references/rust/cargo-strict.md +317 -0
  78. package/assets/lithermes-plugin/skills/programming/references/rust/clap-stack.md +409 -0
  79. package/assets/lithermes-plugin/skills/programming/references/rust/concurrency.md +375 -0
  80. package/assets/lithermes-plugin/skills/programming/references/rust/libraries.md +439 -0
  81. package/assets/lithermes-plugin/skills/programming/references/rust/one-liners.md +291 -0
  82. package/assets/lithermes-plugin/skills/programming/references/rust/proptest-insta.md +429 -0
  83. package/assets/lithermes-plugin/skills/programming/references/rust/type-state.md +354 -0
  84. package/assets/lithermes-plugin/skills/programming/references/rust/unsafe-discipline.md +250 -0
  85. package/assets/lithermes-plugin/skills/programming/references/rust/zero-cost-safety.md +527 -0
  86. package/assets/lithermes-plugin/skills/programming/references/rust-ub/README.md +289 -0
  87. package/assets/lithermes-plugin/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
  88. package/assets/lithermes-plugin/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
  89. package/assets/lithermes-plugin/skills/programming/references/typescript/README.md +195 -0
  90. package/assets/lithermes-plugin/skills/programming/references/typescript/backend-hono.md +672 -0
  91. package/assets/lithermes-plugin/skills/programming/references/typescript/bootstrap.md +199 -0
  92. package/assets/lithermes-plugin/skills/programming/references/typescript/data-modeling.md +202 -0
  93. package/assets/lithermes-plugin/skills/programming/references/typescript/error-handling.md +169 -0
  94. package/assets/lithermes-plugin/skills/programming/references/typescript/tsconfig-strict.md +152 -0
  95. package/assets/lithermes-plugin/skills/programming/references/typescript/type-patterns.md +196 -0
  96. package/assets/lithermes-plugin/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
  97. package/assets/lithermes-plugin/skills/programming/scripts/go/new-project.py +138 -0
  98. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/.editorconfig +13 -0
  99. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/.golangci.yml +95 -0
  100. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
  101. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
  102. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
  103. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/ci.yml +37 -0
  104. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/config.go +24 -0
  105. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/gitignore +15 -0
  106. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
  107. package/assets/lithermes-plugin/skills/programming/scripts/go/templates/run.go +15 -0
  108. package/assets/lithermes-plugin/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
  109. package/assets/lithermes-plugin/skills/programming/scripts/python/new-project.py +172 -0
  110. package/assets/lithermes-plugin/skills/programming/scripts/python/new-script.py +116 -0
  111. package/assets/lithermes-plugin/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
  112. package/assets/lithermes-plugin/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
  113. package/assets/lithermes-plugin/skills/programming/scripts/rust/new-project.py +175 -0
  114. package/assets/lithermes-plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
  115. package/assets/lithermes-plugin/skills/programming/scripts/typescript/new-project.ts +177 -0
  116. package/assets/lithermes-plugin/skills/refactor/SKILL.md +770 -0
  117. package/assets/lithermes-plugin/skills/remove-ai-slops/SKILL.md +335 -0
  118. package/assets/lithermes-plugin/skills/review-work/SKILL.md +562 -0
  119. package/assets/lithermes-plugin/skills/rules/SKILL.md +41 -0
  120. package/assets/lithermes-plugin/skills/start-work/SKILL.md +332 -0
  121. package/bin/lithermes.js +8 -0
  122. package/cover.png +0 -0
  123. package/package.json +39 -0
  124. package/src/cli.js +129 -0
  125. package/src/lib/check.js +94 -0
  126. package/src/lib/config.js +170 -0
  127. package/src/lib/files.js +65 -0
  128. package/src/lib/hermesDiscovery.js +50 -0
  129. package/src/lib/hud.js +121 -0
  130. package/src/lib/install.js +159 -0
  131. package/src/lib/patch.js +153 -0
  132. package/src/lib/skins.js +113 -0
  133. package/src/lib/spinner.js +104 -0
@@ -0,0 +1,179 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+ from typing import Any
5
+
6
+ from . import core
7
+ from .litgoal import cli as litgoal_cli
8
+ from .litgoal import hook as litgoal_hook
9
+ from .litgoal import tools as litgoal_tools
10
+
11
+
12
+ PORTED_SKILLS = [
13
+ (
14
+ "ai-slop-remover",
15
+ "Remove AI-generated slop with the LitHermes cleanup discipline.",
16
+ ),
17
+ (
18
+ "comment-checker",
19
+ "Review comments after edits using the LitHermes comment policy.",
20
+ ),
21
+ (
22
+ "debugging",
23
+ "Run the LitHermes hypothesis-driven debugging workflow.",
24
+ ),
25
+ (
26
+ "frontend-ui-ux",
27
+ "Apply the LitHermes frontend UI/UX review discipline.",
28
+ ),
29
+ (
30
+ "lsp",
31
+ "Use Hermes' native LSP diagnostics with LitHermes LSP guidance.",
32
+ ),
33
+ (
34
+ "programming",
35
+ "Use LitHermes programming references for Python, TypeScript, Go, and Rust.",
36
+ ),
37
+ (
38
+ "refactor",
39
+ "Use the LitHermes refactoring workflow and safety checks.",
40
+ ),
41
+ (
42
+ "remove-ai-slops",
43
+ "Alias-style access to the LitHermes AI slop removal workflow.",
44
+ ),
45
+ (
46
+ "review-work",
47
+ "Run the LitHermes 5-lane review orchestrator over delegate_task.",
48
+ ),
49
+ (
50
+ "rules",
51
+ "Read and apply repo-local Hermes guidance files using the LitHermes rules discipline.",
52
+ ),
53
+ (
54
+ "start-work",
55
+ "Execute a LitHermes plan checkbox-by-checkbox with test + manual-QA + cleanup gates.",
56
+ ),
57
+ (
58
+ "lit-plan",
59
+ "Run the LitHermes planning process: explore-first, interview, approval gate, gap-analysis + plan review.",
60
+ ),
61
+ (
62
+ "litgoal",
63
+ "Drive the LitHermes litgoal durable runtime (criteria, evidence, gates).",
64
+ ),
65
+ (
66
+ "litwork",
67
+ "Hermes-native Litwork execution discipline.",
68
+ ),
69
+ ]
70
+
71
+
72
+ def _pre_llm_call(**kwargs: Any) -> dict[str, str] | None:
73
+ """Compose the Litwork directive and the active-litgoal snapshot.
74
+
75
+ Hermes appends a returned ``{"context": ...}`` to the user message. We merge
76
+ both injections so the model sees the litwork loop discipline and the live
77
+ goal/criteria/evidence gate in one block.
78
+ """
79
+ parts: list[str] = []
80
+ base = core.pre_llm_call(**kwargs)
81
+ if isinstance(base, dict) and base.get("context"):
82
+ parts.append(str(base["context"]))
83
+ elif isinstance(base, str) and base.strip():
84
+ parts.append(base)
85
+ snapshot = litgoal_hook.snapshot_context(**kwargs)
86
+ if snapshot:
87
+ parts.append(snapshot)
88
+ if not parts:
89
+ return None
90
+ return {"context": "\n\n".join(parts)}
91
+
92
+
93
+ def _setup_lithermes_cli(parser) -> None:
94
+ sub = parser.add_subparsers(dest="lh_cmd")
95
+ goal_parser = sub.add_parser("goal", help="LitHermes litgoal durable runtime")
96
+ litgoal_cli.setup(goal_parser)
97
+
98
+
99
+ def _handle_lithermes_cli(args) -> int:
100
+ if getattr(args, "lh_cmd", None) == "goal":
101
+ return litgoal_cli.handle(args)
102
+ print("usage: hermes lithermes goal <set|status|criterion|evidence|steer|checkpoint|complete>")
103
+ return 1
104
+
105
+
106
+ def register(ctx) -> None:
107
+ base = Path(__file__).resolve().parent
108
+
109
+ # Hooks: Litwork directive + litgoal snapshot/gate, both via pre_llm_call.
110
+ ctx.register_hook("pre_llm_call", _pre_llm_call)
111
+ # Record each delegate_task child (review lanes, reviewer gate) to the ledger.
112
+ ctx.register_hook("subagent_stop", core.subagent_stop)
113
+
114
+ # Model-facing litgoal tools (durable criteria/evidence/checkpoint/steering/gate).
115
+ litgoal_tools.register_tools(ctx)
116
+
117
+ # `hermes lithermes goal ...` CLI surface.
118
+ ctx.register_cli_command(
119
+ "lithermes",
120
+ "LitHermes workflow runtime (litgoal durable goal CLI)",
121
+ _setup_lithermes_cli,
122
+ _handle_lithermes_cli,
123
+ )
124
+
125
+ ctx.register_command(
126
+ "lit-plan",
127
+ core.command_lit_plan,
128
+ description="Create a durable Litwork implementation plan",
129
+ args_hint='"what to build"',
130
+ )
131
+ ctx.register_command(
132
+ "litwork-plan",
133
+ core.command_lit_plan,
134
+ description="Alias for /lit-plan",
135
+ args_hint='"what to build"',
136
+ )
137
+ ctx.register_command(
138
+ "lit",
139
+ core.command_lit,
140
+ description="Start an Litwork run and execute the task immediately",
141
+ args_hint='"task" [--completion-promise TEXT] [--strategy reset|continue]',
142
+ )
143
+ ctx.register_command(
144
+ "lit-loop",
145
+ core.command_lit_loop,
146
+ description="Start an Litwork run and execute the task immediately",
147
+ args_hint='"task" [--completion-promise TEXT] [--strategy reset|continue]',
148
+ )
149
+ ctx.register_command(
150
+ "litwork-loop",
151
+ core.command_lit_loop,
152
+ description="Alias for /lit-loop",
153
+ args_hint='"task" [--completion-promise TEXT] [--strategy reset|continue]',
154
+ )
155
+ ctx.register_command(
156
+ "litgoal",
157
+ core.command_litgoal,
158
+ description="Open or inspect the LitHermes litgoal durable runtime",
159
+ args_hint='["objective"] [--worktree PATH]',
160
+ )
161
+ ctx.register_command(
162
+ "review-work",
163
+ core.command_review_work,
164
+ description="Run the LitHermes 5-lane review orchestrator on the current diff",
165
+ args_hint="[--base REF]",
166
+ )
167
+ ctx.register_command(
168
+ "start-work",
169
+ core.command_start_work,
170
+ description="Open or dry-run a LitHermes plan against a workspace",
171
+ args_hint="[plan-name] [--worktree PATH] [--dry-run]",
172
+ )
173
+
174
+ for name, description in PORTED_SKILLS:
175
+ ctx.register_skill(
176
+ name,
177
+ base / "skills" / name / "SKILL.md",
178
+ description,
179
+ )