prizmkit 1.0.13 → 1.0.14

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/bin/create-prizmkit.js +4 -1
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/adapters/claude/command-adapter.js +35 -4
  4. package/bundled/adapters/claude/rules-adapter.js +6 -58
  5. package/bundled/adapters/claude/team-adapter.js +2 -2
  6. package/bundled/adapters/codebuddy/agent-adapter.js +0 -1
  7. package/bundled/adapters/codebuddy/rules-adapter.js +30 -0
  8. package/bundled/adapters/shared/frontmatter.js +3 -1
  9. package/bundled/dev-pipeline/README.md +13 -3
  10. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +10 -0
  11. package/bundled/dev-pipeline/launch-daemon.sh +18 -4
  12. package/bundled/dev-pipeline/lib/common.sh +105 -0
  13. package/bundled/dev-pipeline/run-bugfix.sh +57 -57
  14. package/bundled/dev-pipeline/run.sh +75 -59
  15. package/bundled/dev-pipeline/scripts/check-session-status.py +47 -2
  16. package/bundled/dev-pipeline/scripts/cleanup-logs.py +192 -0
  17. package/bundled/dev-pipeline/scripts/detect-stuck.py +15 -3
  18. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +32 -27
  19. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +23 -23
  20. package/bundled/dev-pipeline/scripts/update-feature-status.py +50 -2
  21. package/bundled/dev-pipeline/scripts/utils.py +22 -0
  22. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +18 -1
  23. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +19 -1
  24. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +18 -2
  25. package/bundled/dev-pipeline/templates/session-status-schema.json +7 -1
  26. package/bundled/dev-pipeline/tests/__init__.py +0 -0
  27. package/bundled/dev-pipeline/tests/conftest.py +133 -0
  28. package/bundled/dev-pipeline/tests/test_check_session.py +127 -0
  29. package/bundled/dev-pipeline/tests/test_cleanup_logs.py +119 -0
  30. package/bundled/dev-pipeline/tests/test_detect_stuck.py +207 -0
  31. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +181 -0
  32. package/bundled/dev-pipeline/tests/test_generate_prompt.py +190 -0
  33. package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +153 -0
  34. package/bundled/dev-pipeline/tests/test_init_pipeline.py +241 -0
  35. package/bundled/dev-pipeline/tests/test_update_bug_status.py +142 -0
  36. package/bundled/dev-pipeline/tests/test_update_feature_status.py +277 -0
  37. package/bundled/dev-pipeline/tests/test_utils.py +141 -0
  38. package/bundled/rules/USAGE.md +153 -0
  39. package/bundled/rules/_rules-metadata.json +43 -0
  40. package/bundled/rules/general/prefer-linux-commands.md +9 -0
  41. package/bundled/rules/prizm/prizm-commit-workflow.md +10 -0
  42. package/bundled/rules/prizm/prizm-documentation.md +19 -0
  43. package/bundled/rules/prizm/prizm-progressive-loading.md +11 -0
  44. package/bundled/skills/_metadata.json +130 -67
  45. package/bundled/skills/app-planner/SKILL.md +252 -499
  46. package/bundled/skills/app-planner/assets/evaluation-guide.md +44 -0
  47. package/bundled/skills/app-planner/scripts/validate-and-generate.py +143 -4
  48. package/bundled/skills/bug-planner/SKILL.md +58 -13
  49. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -7
  50. package/bundled/skills/dev-pipeline-launcher/SKILL.md +16 -7
  51. package/bundled/skills/feature-workflow/SKILL.md +175 -234
  52. package/bundled/skills/prizm-kit/SKILL.md +17 -31
  53. package/bundled/skills/{prizmkit-adr-manager → prizmkit-tool-adr-manager}/SKILL.md +6 -7
  54. package/bundled/skills/{prizmkit-api-doc-generator → prizmkit-tool-api-doc-generator}/SKILL.md +4 -5
  55. package/bundled/skills/{prizmkit-bug-reproducer → prizmkit-tool-bug-reproducer}/SKILL.md +4 -5
  56. package/bundled/skills/{prizmkit-ci-cd-generator → prizmkit-tool-ci-cd-generator}/SKILL.md +4 -5
  57. package/bundled/skills/{prizmkit-db-migration → prizmkit-tool-db-migration}/SKILL.md +4 -5
  58. package/bundled/skills/{prizmkit-dependency-health → prizmkit-tool-dependency-health}/SKILL.md +3 -4
  59. package/bundled/skills/{prizmkit-deployment-strategy → prizmkit-tool-deployment-strategy}/SKILL.md +4 -5
  60. package/bundled/skills/{prizmkit-error-triage → prizmkit-tool-error-triage}/SKILL.md +4 -5
  61. package/bundled/skills/{prizmkit-log-analyzer → prizmkit-tool-log-analyzer}/SKILL.md +4 -5
  62. package/bundled/skills/{prizmkit-monitoring-setup → prizmkit-tool-monitoring-setup}/SKILL.md +4 -5
  63. package/bundled/skills/{prizmkit-onboarding-generator → prizmkit-tool-onboarding-generator}/SKILL.md +4 -5
  64. package/bundled/skills/{prizmkit-perf-profiler → prizmkit-tool-perf-profiler}/SKILL.md +4 -5
  65. package/bundled/skills/{prizmkit-security-audit → prizmkit-tool-security-audit}/SKILL.md +3 -4
  66. package/bundled/skills/{prizmkit-tech-debt-tracker → prizmkit-tool-tech-debt-tracker}/SKILL.md +3 -4
  67. package/bundled/skills/refactor-skill/SKILL.md +371 -0
  68. package/bundled/skills/refactor-workflow/SKILL.md +17 -119
  69. package/package.json +1 -1
  70. package/src/external-skills.js +71 -0
  71. package/src/index.js +62 -4
  72. package/src/metadata.js +36 -0
  73. package/src/scaffold.js +136 -32
  74. package/bundled/skills/prizmkit-bug-fix-workflow/SKILL.md +0 -356
  75. package/bundled/templates/claude-md-template.md +0 -38
  76. package/bundled/templates/codebuddy-md-template.md +0 -35
  77. /package/bundled/skills/{prizmkit-adr-manager → prizmkit-tool-adr-manager}/assets/adr-template.md +0 -0
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-bug-reproducer"
3
- tier: 1
4
- description: "[Tier 1] Generate minimal reproduction scripts and test cases from bug descriptions. AI strength in test/script generation. (project)"
2
+ name: "prizmkit-tool-bug-reproducer"
3
+ description: [Tier 1] Generate minimal reproduction scripts and test cases from bug descriptions. AI strength in test/script generation. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Bug Reproducer
@@ -10,7 +9,7 @@ Generate minimal reproduction scripts and test cases from bug descriptions to is
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.bug-reproduce \<bug-description\>
12
+ ### `/prizmkit-bug`-reproduce \<bug-description\>
14
13
 
15
14
  Generate a minimal reproduction for a reported bug.
16
15
 
@@ -53,7 +52,7 @@ Generate a minimal reproduction for a reported bug.
53
52
 
54
53
  ## Path References
55
54
 
56
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
55
+ All internal asset paths MUST use `.claude/commands/prizmkit-bug-reproducer` placeholder for cross-IDE compatibility.
57
56
 
58
57
  ## Output
59
58
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-ci-cd-generator"
3
- tier: 2
4
- description: "[Tier 2] Generate CI/CD pipeline config templates for GitHub Actions/GitLab CI/Jenkins. Cannot validate or test pipelines. (project)"
2
+ name: "prizmkit-tool-ci-cd-generator"
3
+ description: [Tier 2] Generate CI/CD pipeline config templates for GitHub Actions/GitLab CI/Jenkins. Cannot validate or test pipelines. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit CI/CD Generator
@@ -10,7 +9,7 @@ Generate production-ready CI/CD pipeline configurations derived from your projec
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.ci-cd
12
+ ### `/prizmkit-ci`-cd
14
13
 
15
14
  Generate a CI/CD pipeline configuration for the project.
16
15
 
@@ -46,7 +45,7 @@ Generate a CI/CD pipeline configuration for the project.
46
45
 
47
46
  ## Path References
48
47
 
49
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
48
+ All internal asset paths MUST use `.claude/commands/prizmkit-ci-cd-generator` placeholder for cross-IDE compatibility.
50
49
 
51
50
  ## Output
52
51
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-db-migration"
3
- tier: 2
4
- description: "[Tier 2] Database migration script generation with rollback plans. Cannot validate against actual database. (project)"
2
+ name: "prizmkit-tool-db-migration"
3
+ description: [Tier 2] Database migration script generation with rollback plans. Cannot validate against actual database. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Database Migration
@@ -10,7 +9,7 @@ Plan safe database schema changes with forward and backward migration scripts, r
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.db-migrate
12
+ ### `/prizmkit-db`-migrate
14
13
 
15
14
  Generate a database migration plan with scripts and rollback procedures.
16
15
 
@@ -56,7 +55,7 @@ Generate a database migration plan with scripts and rollback procedures.
56
55
 
57
56
  ## Path References
58
57
 
59
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
58
+ All internal asset paths MUST use `.claude/commands/prizmkit-db-migration` placeholder for cross-IDE compatibility.
60
59
 
61
60
  ## Output
62
61
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-dependency-health"
3
- tier: 2
4
- description: "[Tier 2] Dependency review based on manifest files. Analyzes version patterns; cannot query package registries for real-time vulnerability data. (project)"
2
+ name: "prizmkit-tool-dependency-health"
3
+ description: [Tier 2] Dependency review based on manifest files. Analyzes version patterns; cannot query package registries for real-time vulnerability data. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Dependency Health
@@ -14,7 +13,7 @@ Audit project dependencies across all supported ecosystems. Identifies outdated
14
13
  - Periodically as part of maintenance workflow
15
14
  - After security advisories are published
16
15
 
17
- ### prizmkit.dependency-health
16
+ ### `/prizmkit-dependency`-health
18
17
 
19
18
  ### Steps
20
19
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-deployment-strategy"
3
- tier: 2
4
- description: "[Tier 2] Deployment planning with rollback procedures for blue-green/canary/rolling strategies. Planning only, cannot execute. (project)"
2
+ name: "prizmkit-tool-deployment-strategy"
3
+ description: [Tier 2] Deployment planning with rollback procedures for blue-green/canary/rolling strategies. Planning only, cannot execute. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Deployment Strategy
@@ -10,7 +9,7 @@ Plan comprehensive deployment strategies with rollback procedures tailored to yo
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.deploy-plan
12
+ ### `/prizmkit-deploy`-plan
14
13
 
15
14
  Generate a deployment plan with rollback procedures.
16
15
 
@@ -50,7 +49,7 @@ Generate a deployment plan with rollback procedures.
50
49
 
51
50
  ## Path References
52
51
 
53
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
52
+ All internal asset paths MUST use `.claude/commands/prizmkit-deployment-strategy` placeholder for cross-IDE compatibility.
54
53
 
55
54
  ## Output
56
55
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-error-triage"
3
- tier: 2
4
- description: "[Tier 2] Error categorization and root cause analysis via pattern matching. Checks Prizm TRAPS for known issues; no runtime debugger. (project)"
2
+ name: "prizmkit-tool-error-triage"
3
+ description: [Tier 2] Error categorization and root cause analysis via pattern matching. Checks Prizm TRAPS for known issues; no runtime debugger. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Error Triage
@@ -10,7 +9,7 @@ Systematically categorize errors, perform root cause analysis, and check Prizm d
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.error-triage \<error-description-or-log\>
12
+ ### `/prizmkit-error`-triage \<error-description-or-log\>
14
13
 
15
14
  Triage an error by classifying it, identifying root cause, and suggesting fixes.
16
15
 
@@ -47,7 +46,7 @@ Triage an error by classifying it, identifying root cause, and suggesting fixes.
47
46
 
48
47
  ## Path References
49
48
 
50
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
49
+ All internal asset paths MUST use `.claude/commands/prizmkit-error-triage` placeholder for cross-IDE compatibility.
51
50
 
52
51
  ## Output
53
52
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-log-analyzer"
3
- tier: 2
4
- description: "[Tier 2] Log pattern recognition via text analysis. Identifies error frequencies and correlations from provided log content. (project)"
2
+ name: "prizmkit-tool-log-analyzer"
3
+ description: [Tier 2] Log pattern recognition via text analysis. Identifies error frequencies and correlations from provided log content. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Log Analyzer
@@ -10,7 +9,7 @@ Analyze log files to identify anomaly patterns, frequency trends, and error corr
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.analyze-logs \<log-file-or-directory\>
12
+ ### `/prizmkit-analyze`-logs \<log-file-or-directory\>
14
13
 
15
14
  Analyze log files and produce a structured report of findings.
16
15
 
@@ -47,7 +46,7 @@ Analyze log files and produce a structured report of findings.
47
46
 
48
47
  ## Path References
49
48
 
50
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
49
+ All internal asset paths MUST use `.claude/commands/prizmkit-log-analyzer` placeholder for cross-IDE compatibility.
51
50
 
52
51
  ## Output
53
52
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-monitoring-setup"
3
- tier: 2
4
- description: "[Tier 2] Generate monitoring config templates for Prometheus/Grafana/CloudWatch/etc. Cannot test or validate actual metrics collection. (project)"
2
+ name: "prizmkit-tool-monitoring-setup"
3
+ description: [Tier 2] Generate monitoring config templates for Prometheus/Grafana/CloudWatch/etc. Cannot test or validate actual metrics collection. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Monitoring Setup
@@ -10,7 +9,7 @@ Generate comprehensive monitoring, alerting, and log collection configurations f
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.monitoring
12
+ ### `/prizmkit-monitoring`
14
13
 
15
14
  Generate monitoring and observability configurations.
16
15
 
@@ -65,7 +64,7 @@ Generate monitoring and observability configurations.
65
64
 
66
65
  ## Path References
67
66
 
68
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
67
+ All internal asset paths MUST use `.claude/commands/prizmkit-monitoring-setup` placeholder for cross-IDE compatibility.
69
68
 
70
69
  ## Output
71
70
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-onboarding-generator"
3
- tier: 2
4
- description: "[Tier 2] Generate onboarding documentation from Prizm docs context. Quality depends on existing .prizm-docs/ completeness. (project)"
2
+ name: "prizmkit-tool-onboarding-generator"
3
+ description: [Tier 2] Generate onboarding documentation from Prizm docs context. Quality depends on existing .prizm-docs/ completeness. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Onboarding Generator
@@ -10,7 +9,7 @@ Generate a comprehensive developer onboarding guide from project context, coveri
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.onboarding
12
+ ### `/prizmkit-onboarding`
14
13
 
15
14
  Generate a complete onboarding guide for new developers.
16
15
 
@@ -63,7 +62,7 @@ Generate a complete onboarding guide for new developers.
63
62
 
64
63
  ## Path References
65
64
 
66
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
65
+ All internal asset paths MUST use `.claude/commands/prizmkit-onboarding-generator` placeholder for cross-IDE compatibility.
67
66
 
68
67
  ## Output
69
68
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-perf-profiler"
3
- tier: 2
4
- description: "[Tier 2] Static analysis for potential performance issues with profiling tool recommendations. Does not measure actual runtime performance. (project)"
2
+ name: "prizmkit-tool-perf-profiler"
3
+ description: [Tier 2] Static analysis for potential performance issues with profiling tool recommendations. Does not measure actual runtime performance. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Performance Profiler
@@ -10,7 +9,7 @@ Identify performance bottlenecks through static code analysis and profiling guid
10
9
 
11
10
  ## Commands
12
11
 
13
- ### prizmkit.perf-profile [module-or-file]
12
+ ### `/prizmkit-perf`-profile [module-or-file]
14
13
 
15
14
  Analyze code for performance bottlenecks and generate optimization recommendations.
16
15
 
@@ -47,7 +46,7 @@ Analyze code for performance bottlenecks and generate optimization recommendatio
47
46
 
48
47
  ## Path References
49
48
 
50
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
49
+ All internal asset paths MUST use `.claude/commands/prizmkit-perf-profiler` placeholder for cross-IDE compatibility.
51
50
 
52
51
  ## Output
53
52
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-security-audit"
3
- tier: 2
4
- description: "[Tier 2] AI-assisted security review checklist via static code analysis. Identifies common vulnerability patterns and hardcoded secrets. Not an automated scanner. (project)"
2
+ name: "prizmkit-tool-security-audit"
3
+ description: [Tier 2] AI-assisted security review checklist via static code analysis. Identifies common vulnerability patterns and hardcoded secrets. Not an automated scanner. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Security Audit
@@ -14,7 +13,7 @@ Comprehensive security scanner that identifies vulnerabilities, hardcoded secret
14
13
  - After adding authentication, authorization, or data handling code
15
14
  - During code review of security-sensitive changes
16
15
 
17
- ### prizmkit.security-audit
16
+ ### `/prizmkit-security`-audit
18
17
 
19
18
  ### Steps
20
19
 
@@ -1,7 +1,6 @@
1
1
  ---
2
- name: "prizmkit-tech-debt-tracker"
3
- tier: 1
4
- description: "[Tier 1] Identify and track technical debt via code pattern analysis. Scans TODOs, complexity hotspots, code smells. AI strength. (project)"
2
+ name: "prizmkit-tool-tech-debt-tracker"
3
+ description: [Tier 1] Identify and track technical debt via code pattern analysis. Scans TODOs, complexity hotspots, code smells. AI strength. (project)
5
4
  ---
6
5
 
7
6
  # PrizmKit Tech Debt Tracker
@@ -14,7 +13,7 @@ Systematic technical debt identification and tracking. Scans the codebase for co
14
13
  - Before major refactoring efforts
15
14
  - Periodically as part of codebase health monitoring
16
15
 
17
- ### prizmkit.tech-debt
16
+ ### `/prizmkit-tech`-debt
18
17
 
19
18
  ### Steps
20
19
 
@@ -0,0 +1,371 @@
1
+ ---
2
+ name: "refactor-skill"
3
+ tier: companion
4
+ description: "Intelligent refactor review for existing skills: evaluates quality, proposes in-place upgrade, and enforces eval + graphical review after changes. (project) by using the newest skill-creator standard"
5
+ ---
6
+
7
+ # Refactor Skill
8
+
9
+ Specialized workflow for reviewing and upgrading existing skills with measurable quality gates.
10
+
11
+ ## When to Use
12
+
13
+ Use this skill when user says:
14
+ - "重构这个 skill", "优化技能设计", "评审并升级技能"
15
+ - "review this skill and improve it"
16
+ - "keep the same skill but improve quality"
17
+ - "原地升级这个 skill" / "in-place upgrade this skill"
18
+
19
+ Do NOT use when user only wants to run a pipeline immediately without changing skill design.
20
+
21
+ ## Core Goals
22
+
23
+ 1. Review current skill comprehensively and find concrete improvement points.
24
+ 2. **Default and preferred mode: in-place upgrade** of the existing skill.
25
+ 3. New-version fork (e.g., `-v2`) is **exception-only** and must be explicitly requested by user.
26
+ 4. After any modification, **must** run standardized evaluation and graphical review.
27
+
28
+ ## Context Readiness Gate (Mandatory)
29
+
30
+ Before any refactor action, verify whether conversation context already contains:
31
+ - target skill name/path
32
+ - current project/workspace path
33
+ - refactor objective and constraints (quality, speed, compatibility)
34
+ - whether user explicitly requests a new-version fork (default is in-place upgrade)
35
+
36
+ If any item is missing, do not block; gather context proactively:
37
+ 1. Read `/core/skills/_metadata.json` to locate target skill and related neighbors.
38
+ 2. Read target `SKILL.md` plus key assets/scripts under that skill.
39
+ 3. Check recent evaluation artifacts under `/.codebuddy/skill-evals/` if present.
40
+ 4. Ask only the minimum unresolved question(s).
41
+
42
+ ## Review Dimensions (Mandatory Rubric)
43
+
44
+ Assess and score each dimension (1-5):
45
+
46
+ 1. **功能性 (Functionality)**
47
+ - Trigger clarity and routing correctness
48
+ - Workflow completeness and error recovery
49
+ - Output contract correctness (schema/format compatibility)
50
+
51
+ 2. **效率性 (Efficiency)**
52
+ - Unnecessary steps, token/time overhead
53
+ - Reusability of scripts/assets
54
+ - Fast-path design and fallback strategy
55
+
56
+ 3. **可维护性 (Maintainability)**
57
+ - Instruction structure/readability
58
+ - Coupling to environment and path robustness
59
+ - Testability and observability (artifacts, checkpoints)
60
+
61
+ Output a concise review summary with:
62
+ - strengths
63
+ - prioritized issues (P0/P1/P2)
64
+ - expected impact for each fix
65
+
66
+ ## Optimization Strategy Selection
67
+
68
+ After review, apply **in-place upgrade** by default.
69
+
70
+ ### Default Mode — In-Place Upgrade (Required Unless Explicitly Overridden)
71
+ Use in almost all cases:
72
+ - skill naming and contract remain stable
73
+ - change scope is moderate or large but compatible
74
+ - backward compatibility is required
75
+
76
+ Actions:
77
+ 1. edit existing skill files in place
78
+ 2. preserve skill name/frontmatter compatibility
79
+ 3. keep migration notes minimal
80
+
81
+ ### Exception Mode — New Version via `skill-creator` (Explicit User Request Only)
82
+ Only use when user clearly asks to fork a new version (e.g., `create <skill>-v2`).
83
+
84
+ Additional required checks before using exception mode:
85
+ - user confirms they need side-by-side old/new variants
86
+ - user accepts added maintenance cost for two versions
87
+
88
+ Actions:
89
+ 1. copy current skill as baseline snapshot
90
+ 2. create `<skill-name>-v2` and apply redesign
91
+ 3. run evaluation against old version baseline
92
+
93
+ ## Mandatory Post-Change Validation, Review, and Optimization Loop
94
+
95
+ Run this full loop after **every** refactor (default: in-place; exception: new-version fork). Do not skip.
96
+
97
+ ### Step 0: Freeze Refactor Scope (Input Gate)
98
+ Capture and freeze:
99
+ - target skill path
100
+ - iteration id (`iteration-N`)
101
+ - baseline type (`old-snapshot` preferred, fallback `without_skill`)
102
+ - optimization goal for this round (quality, token, latency, or compatibility)
103
+
104
+ Expected output:
105
+ - one-line run plan: `skill + baseline + iteration + goal`
106
+
107
+ ### Step 1: Structural Validation (Pre-Eval)
108
+ Validate skill structure/frontmatter and required files first.
109
+
110
+ Expected output:
111
+ - validation pass/fail result
112
+ - blocking fix list if failed
113
+
114
+ ### Step 2: Execute Standardized Eval Runs (Mandatory)
115
+ Create iteration workspace:
116
+ - `/.codebuddy/skill-evals/<skill-name>-workspace/iteration-N/`
117
+
118
+ Run both configurations for the same eval set in the same iteration:
119
+ - `with_skill` (updated skill)
120
+ - `baseline` (old snapshot or `without_skill`)
121
+
122
+ Use multi-run strategy:
123
+ - default: 3 runs (fast feedback)
124
+ - release gate: 5 runs (stability check)
125
+
126
+ Required artifacts per run:
127
+ - `outputs/`
128
+ - `timing.json`
129
+ - `grading.json`
130
+ - `eval_metadata.json` (per eval directory)
131
+
132
+ Expected output:
133
+ - complete run tree with paired `with_skill` vs `baseline` runs
134
+ - no missing required artifact files
135
+
136
+ ### Step 3: Score, Aggregate, and Build Benchmark
137
+ Run grading and aggregation using standardized scripts. Keep metrics comparable across iterations.
138
+
139
+ Required outputs:
140
+ - `benchmark.json`
141
+ - `benchmark.md`
142
+
143
+ Required metrics:
144
+ - pass rate
145
+ - duration
146
+ - token usage
147
+ - with_skill vs baseline delta
148
+ - variance (`stddev`) for stability judgment
149
+
150
+ Expected output:
151
+ - benchmark summary with clear win/lose/neutral conclusion per metric
152
+
153
+ ### Step 4: Graphical Review (Mandatory via `generate_review`)
154
+ Generate review UI using official `generate_review.py` (no custom viewer).
155
+
156
+ Preferred modes:
157
+ 1. server mode for interactive inspection
158
+ 2. static HTML mode (`--static`) for headless fallback
159
+
160
+ Expected output:
161
+ - review entry recorded (URL or HTML path)
162
+ - quick notes on representative good/bad runs linked to evidence
163
+
164
+ ### Step 5: Analyze Results and Derive Optimization Actions
165
+ Translate benchmark + viewer evidence into prioritized actions:
166
+ - **P0**: contract/validation breakages
167
+ - **P1**: quality instability or high variance
168
+ - **P2**: token/time inefficiencies
169
+
170
+ For each action define:
171
+ - root cause hypothesis
172
+ - exact file/section to modify
173
+ - expected metric impact
174
+ - rollback condition
175
+
176
+ Expected output:
177
+ - actionable optimization list (not generic advice)
178
+
179
+ ### Step 6: Implement Targeted Improvements
180
+ Apply only the selected actions for this iteration.
181
+ Avoid mixing unrelated changes to keep causal attribution clear.
182
+
183
+ Expected output:
184
+ - focused diff scoped to the chosen actions
185
+
186
+ ### Step 7: Re-Run Evaluation and Compare Iterations
187
+ Re-run Step 2–4 on the updated skill and compare against previous iteration.
188
+
189
+ Decision rule:
190
+ - if goals met and no regression: accept iteration
191
+ - if partial improvement: keep gains, open next iteration with narrowed scope
192
+ - if regression: rollback or revise hypothesis and repeat
193
+
194
+ Expected output:
195
+ - iteration verdict (`accepted` / `needs-next-iteration` / `rollback`)
196
+ - before/after comparison table
197
+
198
+ ### Step 8: Close the Loop (Mandatory Delivery)
199
+ Return:
200
+ 1. what changed
201
+ 2. measured impact (pass/time/tokens/variance deltas)
202
+ 3. viewer entry
203
+ 4. remaining risks
204
+ 5. next iteration plan (if needed)
205
+
206
+ This closes the loop from **test review → evidence analysis → skill optimization → re-validation**.
207
+
208
+ ### Standard Command Blueprint (Project-level)
209
+ Use the one-command review pipeline with optional grader hook:
210
+
211
+ ```bash
212
+ npm run skill:review -- \
213
+ --workspace /abs/.codebuddy/skill-evals/<skill-name>-workspace \
214
+ --iteration iteration-N \
215
+ --skill-name <skill-name> \
216
+ --skill-path /abs/core/skills/<skill-name> \
217
+ --runs 3 \
218
+ --grader-cmd "python3 /abs/scripts/skill-evals/grade-eval-runs.py --workspace {workspace} --iteration {iteration} --validator /abs/core/skills/<skill-name>/scripts/validate-and-generate.py --baseline-input /abs/.codebuddy/skill-evals/<skill-name>-workspace/inputs/feature-list-existing.json"
219
+ ```
220
+
221
+ Minimum expected deliverables per iteration:
222
+ - `<workspace>/<iteration>/benchmark.json`
223
+ - `<workspace>/<iteration>/benchmark.md`
224
+ - `<workspace>/<iteration>/review.html`
225
+ - optimization action list with priority and owner
226
+
227
+ ## Execution Notes for `skill-creator` Integration
228
+
229
+ When available, follow latest `skill-creator` evaluation/viewer workflow as source of truth:
230
+ - parallelized run spawning (with_skill + baseline)
231
+ - assertion-based grading format compatibility
232
+ - benchmark aggregation via official script
233
+ - viewer generation via official script
234
+
235
+ ## Output Contract of This Skill
236
+
237
+ After completion, return:
238
+ 1. selected mode (`in-place` by default, or `new-version` if explicitly requested) and why
239
+ 2. files changed/created
240
+ 3. review rubric scores before vs after
241
+ 4. benchmark summary (pass/time/tokens delta)
242
+ 5. graphical review entry (URL or static HTML path)
243
+ 6. remaining risks and next iteration suggestions
244
+
245
+ ## Error Handling
246
+
247
+ - Missing target skill path: auto-discover under `/core/skills/` then confirm.
248
+ - Missing baseline snapshot: create one before modifications.
249
+ - Eval incomplete: mark status as blocked and list missing artifacts.
250
+ - Viewer runtime incompatibility: switch to `--static` mode and continue.
251
+
252
+ ## Skill Registry Modification Guide
253
+
254
+ When adding or removing skills from the framework, follow this reference checklist.
255
+
256
+ ### Adding a New Skill
257
+
258
+ **Step 1: Create skill definition**
259
+ ```
260
+ core/skills/<skill-name>/SKILL.md # Required: skill definition with frontmatter
261
+ core/skills/<skill-name>/assets/ # Optional: templates, configs, etc.
262
+ core/skills/<skill-name>/scripts/ # Optional: executable scripts
263
+ ```
264
+
265
+ **Step 2: Register in metadata**
266
+
267
+ Edit `core/skills/_metadata.json`:
268
+ ```json
269
+ {
270
+ "skills": {
271
+ "<skill-name>": {
272
+ "description": "Brief description of the skill",
273
+ "tier": "1", // "foundation", "1", "2", or "companion"
274
+ "category": "core", // "core", "quality", "devops", "debugging", "documentation", "pipeline"
275
+ "hasAssets": false, // true if assets/ directory exists
276
+ "hasScripts": false // true if scripts/ directory exists
277
+ }
278
+ }
279
+ }
280
+ ```
281
+
282
+ **Step 3: (Optional) Add to suite**
283
+
284
+ If the skill belongs to `core` or `minimal` suite, add to `suites` section in `_metadata.json`:
285
+ ```json
286
+ {
287
+ "suites": {
288
+ "core": {
289
+ "skills": ["<skill-name>", ...]
290
+ }
291
+ }
292
+ }
293
+ ```
294
+
295
+ **Step 4: Regenerate derived artifacts**
296
+ ```bash
297
+ # Update bundled directory for npm package
298
+ node scripts/bundle.js
299
+ ```
300
+
301
+ **Step 5: Validate**
302
+ ```bash
303
+ npm test
304
+ # or
305
+ node tests/validate-all.js
306
+ ```
307
+
308
+ ### Removing a Skill
309
+
310
+ **Step 1: Delete skill directory**
311
+ ```bash
312
+ rm -rf core/skills/<skill-name>/
313
+ ```
314
+
315
+ **Step 2: Remove from metadata**
316
+
317
+ Edit `core/skills/_metadata.json`:
318
+ - Remove entry from `skills` object
319
+ - Remove from any `suites` that reference it
320
+
321
+ **Step 3: Regenerate derived artifacts**
322
+ ```bash
323
+ node scripts/bundle.js
324
+ ```
325
+
326
+ **Step 4: Validate**
327
+ ```bash
328
+ npm test
329
+ ```
330
+
331
+ ### Modification Checklist Summary
332
+
333
+ | File | Action | Required |
334
+ |------|--------|----------|
335
+ | `core/skills/<name>/SKILL.md` | Create/Delete | **Always** |
336
+ | `core/skills/_metadata.json` → `skills` | Add/Remove entry | **Always** |
337
+ | `core/skills/_metadata.json` → `suites` | Add/Remove from suite | If belongs to suite |
338
+ | `core/skills/<name>/assets/` | Create/Delete | If has resources |
339
+ | `core/skills/<name>/scripts/` | Create/Delete | If has scripts |
340
+ | `create-prizmkit/bundled/` | Regenerate via script | Auto |
341
+
342
+ ### Documents That May Need Number Updates
343
+
344
+ **Recommendation: Avoid hardcoding skill counts.** Use relative descriptions instead:
345
+ - ✅ "All skills" instead of "34 skills"
346
+ - ✅ "Core Tier 1 skills" instead of "Core Tier 1 skills (17 skills)"
347
+ - ✅ "symlink (skills)" instead of "symlink (35 skills)"
348
+
349
+ If you must include counts, maintain them in one place (`_metadata.json`) and update all references together.
350
+
351
+ Files that currently contain hardcoded skill counts:
352
+
353
+ | File | Current Pattern | Suggested Fix |
354
+ |------|-----------------|---------------|
355
+ | `README.md` | "**N Skills** covering..." | Remove number or use "Skills" |
356
+ | `CODEBUDDY.md` | "**N Skills** — ..." | Remove number |
357
+ | `PK-Construct-Guide.md` | "N skills — 每个 skill..." | Remove number |
358
+ | `PK-Evolving-User-Guide.md` | "symlink (N skills)" | Use "symlink (skills)" |
359
+ | `core/skills/prizm-kit/SKILL.md` | "## Skill Inventory (N skills)" | Use "## Skill Inventory" |
360
+ | `core/skills/_metadata.json` | `"description": "All N skills"` | Use `"description": "All skills"` |
361
+
362
+ To find hardcoded numbers:
363
+ ```bash
364
+ grep -rn "[0-9]\+ skills\|[0-9]\+ Skills" --include="*.md" --include="*.json" .
365
+ ```
366
+
367
+ ## Path Rules
368
+
369
+ - Prefer absolute paths in execution commands.
370
+ - Keep path references portable in instructions when possible (e.g., `${SKILL_DIR}` for intra-skill files).
371
+ - Never delete `.codebuddy` directory.