prizmkit 1.1.142 → 1.1.143
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/bundled/VERSION.json +3 -3
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/templates/hooks/commit-intent-status.py +50 -0
- package/bundled/templates/hooks/commit-intent.json +2 -2
- package/bundled/templates/hooks/post-command-prizm-drift.py +44 -0
- package/package.json +1 -1
- package/src/scaffold.js +2 -0
package/bundled/VERSION.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Report whether staged source changes include Prizm documentation updates."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import subprocess
|
|
7
|
+
|
|
8
|
+
SOURCE_EXTENSIONS = (".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs", ".java")
|
|
9
|
+
PRIZM_DOCS_PREFIX = ".prizmkit/prizm-docs/"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def staged_files() -> list[str]:
|
|
13
|
+
result = subprocess.run(
|
|
14
|
+
["git", "diff", "--cached", "--name-only"],
|
|
15
|
+
text=True,
|
|
16
|
+
encoding="utf-8",
|
|
17
|
+
errors="replace",
|
|
18
|
+
stdout=subprocess.PIPE,
|
|
19
|
+
stderr=subprocess.DEVNULL,
|
|
20
|
+
check=False,
|
|
21
|
+
)
|
|
22
|
+
if result.returncode != 0:
|
|
23
|
+
return []
|
|
24
|
+
return [path for path in result.stdout.splitlines() if path.strip()]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main() -> int:
|
|
28
|
+
files = staged_files()
|
|
29
|
+
source_files = [path for path in files if path.endswith(SOURCE_EXTENSIONS)]
|
|
30
|
+
if not source_files:
|
|
31
|
+
return 0
|
|
32
|
+
|
|
33
|
+
prizm_docs = [path for path in files if path.startswith(PRIZM_DOCS_PREFIX)]
|
|
34
|
+
if prizm_docs:
|
|
35
|
+
print(
|
|
36
|
+
f"PRIZMKIT_DOC_STATUS: {len(source_files)} source file(s) staged | "
|
|
37
|
+
f".prizmkit/prizm-docs/ updated ({len(prizm_docs)} file(s))",
|
|
38
|
+
end="",
|
|
39
|
+
)
|
|
40
|
+
else:
|
|
41
|
+
print(
|
|
42
|
+
f"PRIZMKIT_DOC_STATUS: {len(source_files)} source file(s) staged | "
|
|
43
|
+
".prizmkit/prizm-docs/ NOT UPDATED — update if this is a feature change",
|
|
44
|
+
end="",
|
|
45
|
+
)
|
|
46
|
+
return 0
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
raise SystemExit(main())
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "python3
|
|
9
|
+
"command": "python3 .prizmkit/scripts/commit-intent-status.py"
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"hooks": [
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
20
|
-
"command": "python3
|
|
20
|
+
"command": "python3 .prizmkit/scripts/post-command-prizm-drift.py"
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Report Prizm documentation drift after relevant Git commands."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import re
|
|
8
|
+
import subprocess
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
DRIFT_SCRIPT = Path(".prizmkit/scripts/diff-prizm-docs.py")
|
|
13
|
+
RELEVANT_GIT_COMMAND = re.compile(r"git\s+(commit|merge|rebase)")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def tool_input() -> str:
|
|
17
|
+
return os.environ.get("CLAUDE_TOOL_INPUT") or os.environ.get("CODEBUDDY_TOOL_INPUT") or ""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main() -> int:
|
|
21
|
+
if not RELEVANT_GIT_COMMAND.search(tool_input()) or not DRIFT_SCRIPT.is_file():
|
|
22
|
+
return 0
|
|
23
|
+
|
|
24
|
+
result = subprocess.run(
|
|
25
|
+
[sys.executable, str(DRIFT_SCRIPT)],
|
|
26
|
+
text=True,
|
|
27
|
+
encoding="utf-8",
|
|
28
|
+
errors="replace",
|
|
29
|
+
stdout=subprocess.PIPE,
|
|
30
|
+
stderr=subprocess.DEVNULL,
|
|
31
|
+
check=False,
|
|
32
|
+
)
|
|
33
|
+
drift = result.stdout.strip()
|
|
34
|
+
if drift:
|
|
35
|
+
print(
|
|
36
|
+
"PRIZMKIT_DRIFT_DETECTED: prizm-docs structural differences found:\n"
|
|
37
|
+
f"{drift}\n"
|
|
38
|
+
"Please update affected .prizmkit/prizm-docs/ files."
|
|
39
|
+
)
|
|
40
|
+
return 0
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
raise SystemExit(main())
|
package/package.json
CHANGED
package/src/scaffold.js
CHANGED
|
@@ -724,6 +724,8 @@ export async function installPrizmkitScripts(projectRoot, dryRun, runtime = 'pyt
|
|
|
724
724
|
const scripts = [
|
|
725
725
|
'validate-prizm-docs.py',
|
|
726
726
|
'diff-prizm-docs.py',
|
|
727
|
+
'commit-intent-status.py',
|
|
728
|
+
'post-command-prizm-drift.py',
|
|
727
729
|
];
|
|
728
730
|
const legacyManagedScripts = [
|
|
729
731
|
'validate-prizm-docs.sh',
|