prizmkit 1.1.159 → 1.1.160

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 (77) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/settings-adapter.js +76 -25
  3. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +9 -2
  4. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +42 -15
  5. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  6. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -1
  7. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +6 -6
  8. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +4 -3
  9. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +2 -2
  10. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -2
  11. package/bundled/dev-pipeline/tests/test_runtime_commit.py +68 -13
  12. package/bundled/dev-pipeline/tests/test_unified_cli.py +10 -6
  13. package/bundled/rules/prizm/prizm-commit-workflow.md +7 -7
  14. package/bundled/rules/prizm/prizm-documentation.md +24 -65
  15. package/bundled/rules/prizm/prizm-progressive-loading.md +9 -8
  16. package/bundled/skills/_metadata.json +1 -1
  17. package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
  18. package/bundled/skills/prizmkit-committer/SKILL.md +48 -41
  19. package/bundled/skills/prizmkit-deploy/SKILL.md +172 -198
  20. package/bundled/skills/prizmkit-deploy/references/capability-contract.md +137 -0
  21. package/bundled/skills/prizmkit-deploy/references/deploy-record-schema.json +1053 -0
  22. package/bundled/skills/prizmkit-deploy/references/deployment-declaration-schema.json +291 -0
  23. package/bundled/skills/prizmkit-deploy/references/legacy-migration.md +90 -0
  24. package/bundled/skills/prizmkit-deploy/references/policy-and-execution.md +170 -0
  25. package/bundled/skills/prizmkit-deploy/references/real-resource-test-policy.md +73 -0
  26. package/bundled/skills/prizmkit-deploy/references/verification-and-recovery.md +164 -0
  27. package/bundled/skills/prizmkit-deploy/scripts/validate-deploy-artifact.py +371 -0
  28. package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
  29. package/bundled/skills/prizmkit-init/SKILL.md +17 -17
  30. package/bundled/skills/prizmkit-init/references/update-supplement.md +5 -5
  31. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +17 -11
  32. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +95 -155
  33. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +6 -5
  34. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +4 -2
  35. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +9 -10
  36. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +6 -5
  37. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -12
  38. package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
  39. package/bundled/skills/prizmkit-test/SKILL.md +26 -13
  40. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +8 -4
  41. package/bundled/skills/prizmkit-test/references/independent-test-review.md +7 -3
  42. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +33 -10
  43. package/bundled/skills/prizmkit-test/references/test-report-template.md +33 -11
  44. package/bundled/skills/prizmkit-workflow/SKILL.md +5 -7
  45. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +5 -6
  46. package/bundled/templates/hooks/commit-intent-status.py +9 -41
  47. package/bundled/templates/hooks/commit-intent.json +3 -3
  48. package/bundled/templates/hooks/diff-prizm-docs.py +3 -1
  49. package/bundled/templates/hooks/prizm-pre-commit.py +32 -6
  50. package/bundled/templates/hooks/run-python-hook.cjs +44 -0
  51. package/bundled/templates/hooks/validate-prizm-docs.py +399 -173
  52. package/bundled/templates/project-memory-template.md +19 -19
  53. package/package.json +1 -1
  54. package/src/clean.js +6 -7
  55. package/src/gitignore-template.js +8 -12
  56. package/src/scaffold.js +125 -71
  57. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +0 -89
  58. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +0 -145
  59. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +0 -109
  60. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +0 -120
  61. package/bundled/skills/prizmkit-deploy/references/database-setup.md +0 -65
  62. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +0 -150
  63. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +0 -78
  64. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +0 -49
  65. package/bundled/skills/prizmkit-deploy/references/deployment-modes.md +0 -50
  66. package/bundled/skills/prizmkit-deploy/references/direct-upload.md +0 -26
  67. package/bundled/skills/prizmkit-deploy/references/dns-setup.md +0 -42
  68. package/bundled/skills/prizmkit-deploy/references/docker-deploy.md +0 -31
  69. package/bundled/skills/prizmkit-deploy/references/firewall-setup.md +0 -37
  70. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +0 -21
  71. package/bundled/skills/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  72. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +0 -164
  73. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +0 -221
  74. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  75. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  76. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +0 -20
  77. package/bundled/skills/prizmkit-deploy/references/ssl-setup.md +0 -56
@@ -1,48 +1,16 @@
1
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()]
2
+ """Emit Git-neutral PrizmKit lifecycle maintenance guidance."""
25
3
 
26
4
 
27
5
  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
- )
6
+ print(
7
+ "PRIZMKIT_MAINTENANCE_CHECK: If the validated change affects structure, "
8
+ "interfaces, dependencies, behavior, or durable TRAPS/RULES/DECISIONS, "
9
+ "run /prizmkit-retrospective before Committer. Retrospective never stages or "
10
+ "commits. Project Git policy controls whether .prizmkit paths are ignored, "
11
+ "untracked, or tracked; do not force-add or change ignore rules.",
12
+ end="",
13
+ )
46
14
  return 0
47
15
 
48
16
 
@@ -6,18 +6,18 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "python3 .prizmkit/scripts/commit-intent-status.py"
9
+ "command": "node .prizmkit/scripts/run-python-hook.cjs .prizmkit/scripts/commit-intent-status.py"
10
10
  }
11
11
  ]
12
12
  }
13
13
  ],
14
14
  "PostToolUse": [
15
15
  {
16
- "matcher": "Bash",
16
+ "matcher": ".*",
17
17
  "hooks": [
18
18
  {
19
19
  "type": "command",
20
- "command": "python3 .prizmkit/scripts/post-command-prizm-drift.py"
20
+ "command": "node .prizmkit/scripts/run-python-hook.cjs .prizmkit/scripts/post-command-prizm-drift.py"
21
21
  }
22
22
  ]
23
23
  }
@@ -29,7 +29,9 @@ EXCLUDED_DIR_NAMES = {
29
29
  "__tests__",
30
30
  ".claude",
31
31
  ".codebuddy",
32
- "dev-pipeline",
32
+ ".codex",
33
+ ".agents",
34
+ ".pi",
33
35
  "coverage",
34
36
  ".nyc_output",
35
37
  "out",
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- """Git pre-commit hook that runs Prizm docs validation."""
2
+ """Fail-closed staged Prizm validation entry point for installed Git hooks."""
3
3
 
4
4
  from __future__ import annotations
5
5
 
@@ -7,6 +7,8 @@ import subprocess
7
7
  import sys
8
8
  from pathlib import Path
9
9
 
10
+ DOCS_PREFIX = ".prizmkit/prizm-docs/"
11
+
10
12
 
11
13
  def run_git(args: list[str]) -> subprocess.CompletedProcess[str]:
12
14
  return subprocess.run(
@@ -15,29 +17,53 @@ def run_git(args: list[str]) -> subprocess.CompletedProcess[str]:
15
17
  encoding="utf-8",
16
18
  errors="replace",
17
19
  stdout=subprocess.PIPE,
18
- stderr=subprocess.DEVNULL,
20
+ stderr=subprocess.PIPE,
19
21
  check=False,
20
22
  )
21
23
 
22
24
 
25
+ def staged_prizm_docs() -> tuple[bool, str]:
26
+ result = run_git(["diff", "--cached", "--name-only", "-z", "--diff-filter=ACMRD"])
27
+ if result.returncode != 0:
28
+ return False, "PrizmKit: unable to inspect the staged index for Prizm validation."
29
+ paths = [path for path in result.stdout.split("\0") if path]
30
+ return any(path.startswith(DOCS_PREFIX) and path.endswith(".prizm") for path in paths), ""
31
+
32
+
23
33
  def main() -> int:
24
34
  root_result = run_git(["rev-parse", "--show-toplevel"])
25
35
  if root_result.returncode != 0:
26
36
  return 0
27
37
 
28
- project_root = Path(root_result.stdout.strip())
29
- if not (project_root / ".prizmkit/prizm-docs/root.prizm").is_file():
38
+ required, error = staged_prizm_docs()
39
+ if error:
40
+ print(error, file=sys.stderr)
41
+ return 1
42
+ if not required:
30
43
  return 0
31
44
 
45
+ project_root = Path(root_result.stdout.strip())
32
46
  candidates = [
33
47
  project_root / ".prizmkit/scripts/validate-prizm-docs.py",
34
48
  project_root / ".prizmkit/dev-pipeline/scripts/validate-prizm-docs.py",
35
49
  ]
36
50
  validate_script = next((candidate for candidate in candidates if candidate.is_file()), None)
37
51
  if validate_script is None:
38
- return 0
52
+ print(
53
+ "PrizmKit: staged Prizm documents require validation, but the canonical validator is unavailable.",
54
+ file=sys.stderr,
55
+ )
56
+ return 1
39
57
 
40
- result = subprocess.run([sys.executable, str(validate_script), "--staged"], cwd=project_root, check=False)
58
+ try:
59
+ result = subprocess.run(
60
+ [sys.executable, str(validate_script), "--staged"],
61
+ cwd=project_root,
62
+ check=False,
63
+ )
64
+ except OSError as exc:
65
+ print(f"PrizmKit: staged Prizm validation could not start: {exc}", file=sys.stderr)
66
+ return 1
41
67
  return result.returncode
42
68
 
43
69
 
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ /* global process, require */
3
+ 'use strict';
4
+
5
+ const { spawnSync } = require('node:child_process');
6
+
7
+ const [script, ...scriptArgs] = process.argv.slice(2);
8
+ if (!script) {
9
+ process.stderr.write('PrizmKit: Python hook script path is required.\n');
10
+ process.exit(1);
11
+ }
12
+
13
+ const candidates = process.platform === 'win32'
14
+ ? [
15
+ { command: 'py', prefix: ['-3'] },
16
+ { command: 'python3', prefix: [] },
17
+ { command: 'python', prefix: [] },
18
+ ]
19
+ : [
20
+ { command: 'python3', prefix: [] },
21
+ { command: 'python', prefix: [] },
22
+ { command: 'py', prefix: ['-3'] },
23
+ ];
24
+
25
+ for (const candidate of candidates) {
26
+ const result = spawnSync(
27
+ candidate.command,
28
+ [...candidate.prefix, script, ...scriptArgs],
29
+ { stdio: 'inherit', shell: false },
30
+ );
31
+ if (result.error && result.error.code === 'ENOENT') continue;
32
+ if (result.error) {
33
+ process.stderr.write(`PrizmKit: Python hook launch failed: ${result.error.message}\n`);
34
+ process.exit(1);
35
+ }
36
+ if (result.signal) {
37
+ process.stderr.write(`PrizmKit: Python hook terminated by ${result.signal}.\n`);
38
+ process.exit(1);
39
+ }
40
+ process.exit(result.status === null ? 1 : result.status);
41
+ }
42
+
43
+ process.stderr.write('PrizmKit: Python 3 is required for this managed hook.\n');
44
+ process.exit(1);