prizmkit 1.0.5 → 1.0.6

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.0.5",
3
- "bundledAt": "2026-03-11T13:23:09.380Z",
4
- "bundledFrom": "05b3a5c"
2
+ "frameworkVersion": "1.0.6",
3
+ "bundledAt": "2026-03-11T13:45:52.858Z",
4
+ "bundledFrom": "34eeda9"
5
5
  }
@@ -5,9 +5,8 @@
5
5
  "matcher": "\\b(commit|Commit|push|Push|finish|Finish|ship|Ship|merge|Merge|pull request|Pull Request|pr|PR)\\b|提交|推送|收尾|完成任务|合并|发版|发布",
6
6
  "hooks": [
7
7
  {
8
- "type": "prompt",
9
- "prompt": "You are a commit-intent detector for PrizmKit. Analyze the user prompt and determine if the user intends to COMMIT, PUSH, FINISH, SHIP, MERGE, or create a PULL REQUEST.\n\nUser prompt: $ARGUMENTS\n\nIF commit intent detected, respond with:\n{\"ok\": true, \"reason\": \"PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.\"}\n\nIF no commit intent, respond with:\n{\"ok\": true}\n\nRespond with JSON only. No explanation.",
10
- "timeout": 300
8
+ "type": "command",
9
+ "command": "echo 'PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.'"
11
10
  }
12
11
  ]
13
12
  }
@@ -665,11 +665,11 @@ STEPS:
665
665
 
666
666
  ## 11.1 Mechanism
667
667
 
668
- HOOK_TYPE: prompt (LLM-evaluated, not script-based)
668
+ HOOK_TYPE: command (shell echo, fast and reliable)
669
669
  EVENT: UserPromptSubmit
670
- BEHAVIOR: Detects commit intent in user prompt, injects doc update reminder
671
- ALWAYS_RETURNS: ok: true (never blocks the user prompt)
672
- INJECTION: When commit intent detected, "reason" field carries update instructions that AI sees as additional context
670
+ BEHAVIOR: When matcher detects commit-related keywords, echoes doc update reminder as stdout
671
+ INJECTION: stdout content is injected into AI's context as a system-reminder
672
+ NOTE: Previously used type: prompt (LLM-evaluated), but switched to type: command for reliability prompt type is prone to timeout and JSON format errors
673
673
 
674
674
  ## 11.2 Configuration Template
675
675
 
@@ -680,11 +680,11 @@ JSON:
680
680
  "hooks": {
681
681
  "UserPromptSubmit": [
682
682
  {
683
+ "matcher": "(?i)\\b(commit|push|finish|ship|merge|pull request|pr)\\b|提交|推送|收尾|完成任务|合并|发版|发布",
683
684
  "hooks": [
684
685
  {
685
- "type": "prompt",
686
- "prompt": "You are a commit-intent detector for the Prizm documentation framework. Analyze the user prompt and determine if the user intends to COMMIT, PUSH, FINISH, SHIP, MERGE, or create a PULL REQUEST.\n\nUser prompt: $ARGUMENTS\n\nIF commit intent detected, respond with:\n{\"ok\": true, \"reason\": \"PRIZM_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files. 6) Then commit. RULES: Never rewrite entire files. Never add prose. Only update affected sections.\"}\n\nIF no commit intent, respond with:\n{\"ok\": true}\n\nJSON only.",
687
- "timeout": 300
686
+ "type": "command",
687
+ "command": "echo 'PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.'"
688
688
  }
689
689
  ]
690
690
  }
@@ -696,13 +696,10 @@ JSON:
696
696
 
697
697
  FLOW:
698
698
  1. User types prompt (e.g., "commit these changes" or "push to main")
699
- 2. UserPromptSubmit hook fires before AI processes the prompt
700
- 3. Fast LLM (Haiku) evaluates the prompt against commit-intent keywords
701
- 4. IF commit intent: Returns {ok: true, reason: "PRIZM_UPDATE_REQUIRED: ..."}
702
- - The "reason" content is injected into AI's context as additional instructions
699
+ 2. UserPromptSubmit hook fires, matcher regex checks for commit-related keywords
700
+ 3. IF matcher matches: command hook runs echo, stdout is injected as system-reminder
703
701
  - AI sees the update instructions and executes them before committing
704
- 5. IF no commit intent: Returns {ok: true} with no reason
705
- - AI proceeds normally, no extra context injected
702
+ 4. IF matcher does not match: hook does not fire, AI proceeds normally
706
703
 
707
704
  KEYWORDS_DETECTED: commit, push, finish, done, ship, merge, PR, pull request, /commit, save changes
708
705
 
@@ -5,9 +5,8 @@
5
5
  "matcher": "\\b(commit|Commit|push|Push|finish|Finish|ship|Ship|merge|Merge|pull request|Pull Request|pr|PR)\\b|提交|推送|收尾|完成任务|合并|发版|发布",
6
6
  "hooks": [
7
7
  {
8
- "type": "prompt",
9
- "prompt": "You are a commit-intent detector for PrizmKit. Analyze the user prompt and determine if the user intends to COMMIT, PUSH, FINISH, SHIP, MERGE, or create a PULL REQUEST.\n\nUser prompt: $ARGUMENTS\n\nIF commit intent detected, respond with:\n{\"ok\": true, \"reason\": \"PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.\"}\n\nIF no commit intent, respond with:\n{\"ok\": true}\n\nRespond with JSON only. No explanation.",
10
- "timeout": 300
8
+ "type": "command",
9
+ "command": "echo 'PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.'"
11
10
  }
12
11
  ]
13
12
  }
@@ -5,9 +5,8 @@
5
5
  "matcher": "(?i)\\b(commit|push|finish|ship|merge|pull request|pr)\\b|提交|推送|收尾|完成任务|合并|发版|发布",
6
6
  "hooks": [
7
7
  {
8
- "type": "prompt",
9
- "prompt": "You are a commit-intent detector for PrizmKit. Analyze the user prompt and determine if the user intends to COMMIT, PUSH, FINISH, SHIP, MERGE, or create a PULL REQUEST.\n\nUser prompt: $ARGUMENTS\n\nIF commit intent detected, respond with:\n{\"ok\": true, \"reason\": \"PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.\"}\n\nIF no commit intent, respond with:\n{\"ok\": true}\n\nRespond with JSON only. No explanation.",
10
- "timeout": 300
8
+ "type": "command",
9
+ "command": "echo 'PRIZMKIT_DOC_UPDATE_REQUIRED: Before committing, you MUST update .prizm-docs/ per Prizm auto-update protocol. Steps: 1) Run git diff --cached --name-status. 2) Map changed files to modules via root.prizm MODULE_INDEX. 3) Read and update affected .prizm files (only changed sections). 4) Append to changelog.prizm. 5) Stage .prizm files with git add .prizm-docs/. 6) Then proceed with commit using prizmkit-committer workflow. RULES: Never rewrite entire .prizm files. Never add prose. Only update affected sections.'"
11
10
  }
12
11
  ]
13
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {