xtrm-tools 2.1.7 → 2.1.9
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.
- package/cli/dist/index.cjs +144 -21
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/hooks/gitnexus-impact-reminder.py +35 -0
- package/package.json +1 -1
package/cli/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import sys
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
6
|
+
from agent_context import AgentContext
|
|
7
|
+
|
|
8
|
+
EDIT_KEYWORDS = [
|
|
9
|
+
'fix', 'refactor', 'change', 'update', 'modify', 'edit',
|
|
10
|
+
'rename', 'move', 'delete', 'remove', 'rewrite', 'implement',
|
|
11
|
+
'add', 'replace', 'extract', 'migrate', 'upgrade',
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
REMINDER = """*** GITNEXUS: Run impact analysis before editing any symbol ***
|
|
15
|
+
|
|
16
|
+
Before modifying a function, class, or method:
|
|
17
|
+
npx gitnexus impact <symbolName> --direction upstream --repo xtrm-tools
|
|
18
|
+
|
|
19
|
+
Review d=1 items (WILL BREAK) before proceeding.
|
|
20
|
+
Skip for docs, configs, and test-only changes.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
try:
|
|
24
|
+
ctx = AgentContext()
|
|
25
|
+
|
|
26
|
+
if ctx.event == 'UserPromptSubmit':
|
|
27
|
+
prompt_lower = ctx.prompt.lower()
|
|
28
|
+
if any(kw in prompt_lower for kw in EDIT_KEYWORDS):
|
|
29
|
+
ctx.allow(additional_context=REMINDER)
|
|
30
|
+
|
|
31
|
+
ctx.fail_open()
|
|
32
|
+
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print(f"Hook error: {e}", file=sys.stderr)
|
|
35
|
+
sys.exit(0)
|