prizmkit 1.0.0 → 1.0.1

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 (89) hide show
  1. package/bundled/VERSION.json +5 -0
  2. package/bundled/adapters/claude/agent-adapter.js +108 -0
  3. package/bundled/adapters/claude/command-adapter.js +104 -0
  4. package/bundled/adapters/claude/paths.js +35 -0
  5. package/bundled/adapters/claude/rules-adapter.js +77 -0
  6. package/bundled/adapters/claude/settings-adapter.js +73 -0
  7. package/bundled/adapters/claude/team-adapter.js +183 -0
  8. package/bundled/adapters/codebuddy/agent-adapter.js +43 -0
  9. package/bundled/adapters/codebuddy/paths.js +29 -0
  10. package/bundled/adapters/codebuddy/settings-adapter.js +47 -0
  11. package/bundled/adapters/codebuddy/skill-adapter.js +68 -0
  12. package/bundled/adapters/codebuddy/team-adapter.js +46 -0
  13. package/bundled/adapters/shared/frontmatter.js +77 -0
  14. package/bundled/agents/prizm-dev-team-coordinator.md +142 -0
  15. package/bundled/agents/prizm-dev-team-dev.md +99 -0
  16. package/bundled/agents/prizm-dev-team-pm.md +114 -0
  17. package/bundled/agents/prizm-dev-team-reviewer.md +119 -0
  18. package/bundled/dev-pipeline/README.md +482 -0
  19. package/bundled/dev-pipeline/assets/feature-list-example.json +147 -0
  20. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +138 -0
  21. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +425 -0
  22. package/bundled/dev-pipeline/launch-daemon.sh +549 -0
  23. package/bundled/dev-pipeline/reset-feature.sh +209 -0
  24. package/bundled/dev-pipeline/retry-bug.sh +344 -0
  25. package/bundled/dev-pipeline/retry-feature.sh +338 -0
  26. package/bundled/dev-pipeline/run-bugfix.sh +638 -0
  27. package/bundled/dev-pipeline/run.sh +845 -0
  28. package/bundled/dev-pipeline/scripts/check-session-status.py +158 -0
  29. package/bundled/dev-pipeline/scripts/detect-stuck.py +385 -0
  30. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +598 -0
  31. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +402 -0
  32. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +294 -0
  33. package/bundled/dev-pipeline/scripts/init-dev-team.py +134 -0
  34. package/bundled/dev-pipeline/scripts/init-pipeline.py +335 -0
  35. package/bundled/dev-pipeline/scripts/update-bug-status.py +748 -0
  36. package/bundled/dev-pipeline/scripts/update-feature-status.py +1076 -0
  37. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +262 -0
  38. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +159 -0
  39. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +291 -0
  40. package/bundled/dev-pipeline/templates/feature-list-schema.json +112 -0
  41. package/bundled/dev-pipeline/templates/session-status-schema.json +77 -0
  42. package/bundled/skills/_metadata.json +267 -0
  43. package/bundled/skills/app-planner/SKILL.md +580 -0
  44. package/bundled/skills/app-planner/assets/planning-guide.md +313 -0
  45. package/bundled/skills/app-planner/scripts/validate-and-generate.py +758 -0
  46. package/bundled/skills/bug-planner/SKILL.md +235 -0
  47. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +252 -0
  48. package/bundled/skills/dev-pipeline-launcher/SKILL.md +223 -0
  49. package/bundled/skills/prizm-kit/SKILL.md +151 -0
  50. package/bundled/skills/prizm-kit/assets/claude-md-template.md +38 -0
  51. package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +35 -0
  52. package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +15 -0
  53. package/bundled/skills/prizmkit-adr-manager/SKILL.md +68 -0
  54. package/bundled/skills/prizmkit-adr-manager/assets/adr-template.md +26 -0
  55. package/bundled/skills/prizmkit-analyze/SKILL.md +194 -0
  56. package/bundled/skills/prizmkit-api-doc-generator/SKILL.md +56 -0
  57. package/bundled/skills/prizmkit-bug-fix-workflow/SKILL.md +351 -0
  58. package/bundled/skills/prizmkit-bug-reproducer/SKILL.md +62 -0
  59. package/bundled/skills/prizmkit-ci-cd-generator/SKILL.md +54 -0
  60. package/bundled/skills/prizmkit-clarify/SKILL.md +52 -0
  61. package/bundled/skills/prizmkit-code-review/SKILL.md +70 -0
  62. package/bundled/skills/prizmkit-committer/SKILL.md +117 -0
  63. package/bundled/skills/prizmkit-db-migration/SKILL.md +65 -0
  64. package/bundled/skills/prizmkit-dependency-health/SKILL.md +123 -0
  65. package/bundled/skills/prizmkit-deployment-strategy/SKILL.md +58 -0
  66. package/bundled/skills/prizmkit-error-triage/SKILL.md +55 -0
  67. package/bundled/skills/prizmkit-implement/SKILL.md +47 -0
  68. package/bundled/skills/prizmkit-init/SKILL.md +156 -0
  69. package/bundled/skills/prizmkit-log-analyzer/SKILL.md +55 -0
  70. package/bundled/skills/prizmkit-monitoring-setup/SKILL.md +75 -0
  71. package/bundled/skills/prizmkit-onboarding-generator/SKILL.md +70 -0
  72. package/bundled/skills/prizmkit-perf-profiler/SKILL.md +55 -0
  73. package/bundled/skills/prizmkit-plan/SKILL.md +54 -0
  74. package/bundled/skills/prizmkit-plan/assets/plan-template.md +37 -0
  75. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +140 -0
  76. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +943 -0
  77. package/bundled/skills/prizmkit-retrospective/SKILL.md +79 -0
  78. package/bundled/skills/prizmkit-security-audit/SKILL.md +130 -0
  79. package/bundled/skills/prizmkit-specify/SKILL.md +52 -0
  80. package/bundled/skills/prizmkit-specify/assets/spec-template.md +37 -0
  81. package/bundled/skills/prizmkit-summarize/SKILL.md +51 -0
  82. package/bundled/skills/prizmkit-summarize/assets/registry-template.md +18 -0
  83. package/bundled/skills/prizmkit-tasks/SKILL.md +50 -0
  84. package/bundled/skills/prizmkit-tasks/assets/tasks-template.md +21 -0
  85. package/bundled/skills/prizmkit-tech-debt-tracker/SKILL.md +139 -0
  86. package/bundled/team/prizm-dev-team.json +47 -0
  87. package/bundled/templates/claude-md-template.md +38 -0
  88. package/bundled/templates/codebuddy-md-template.md +35 -0
  89. package/package.json +2 -1
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: "prizmkit-init"
3
+ description: "Project takeover and bootstrap. Scans any project, generates Prizm docs, configures hooks. Use 'prizmkit.init' to start. (project)"
4
+ ---
5
+
6
+ # PrizmKit Init
7
+
8
+ Project takeover and bootstrap skill. Scans any project (brownfield or greenfield), generates Prizm documentation, and configures platform-specific hooks for documentation sync. Supports CodeBuddy, Claude Code, and dual-platform installations.
9
+
10
+ ### When to Use
11
+ - Taking over a new project (brownfield or greenfield)
12
+ - User says "initialize PrizmKit", "set up PrizmKit", "take over this project"
13
+ - First time using PrizmKit on a project
14
+
15
+ ### Commands
16
+
17
+ #### prizmkit.init
18
+ Full project initialization.
19
+
20
+ **PLATFORM DETECTION (before anything else):**
21
+ 1. Check for platform indicators in the current environment:
22
+ - CodeBuddy: `.codebuddy/` directory exists, or running inside `cbc` session
23
+ - Claude Code: `.claude/` directory exists, or running inside `claude` session
24
+ - Both: Both directories exist
25
+ - Unknown: Neither exists — ask the user which platform(s) to configure
26
+ 2. Store detected platform in `.prizmkit/config.json` as `"platform": "codebuddy" | "claude" | "both"`
27
+
28
+ MODE DETECTION:
29
+ - If `.prizm-docs/` exists: Ask user if they want to reinitialize or update
30
+ - If project has source code: brownfield mode
31
+ - If project is nearly empty: greenfield mode
32
+
33
+ BROWNFIELD WORKFLOW (existing project):
34
+
35
+ **Step 1: Project Scanning**
36
+ 1. Detect tech stack from build files (`package.json`, `requirements.txt`, `go.mod`, `pom.xml`, `Cargo.toml`, etc.)
37
+ 2. Map directory structure — identify source directories, test directories, config files
38
+ 3. Identify entry points by language convention
39
+ 4. Catalog dependencies (external packages)
40
+ 5. Count source files per directory
41
+
42
+ **Step 2: State Assessment**
43
+ 2a. Run dependency analysis:
44
+ - Count outdated dependencies (if lockfile exists)
45
+ - Note any known vulnerability patterns
46
+
47
+ 2b. Scan for technical debt indicators:
48
+ - Count TODO/FIXME/HACK/XXX comments
49
+ - Identify large files (>500 lines)
50
+ - Check for test directories and coverage config
51
+
52
+ 2c. Generate `ASSESSMENT.md` in project root with findings
53
+
54
+ **Step 3: Prizm Documentation Generation**
55
+ 3a. Invoke prizmkit-prizm-docs `prizmkit.doc.init` algorithm:
56
+ - Create `.prizm-docs/` directory structure
57
+ - Generate `root.prizm` (L0) with project meta and module index
58
+ - Generate L1 docs for all discovered modules
59
+ - Create `changelog.prizm`
60
+ - Skip L2 (lazy generation)
61
+
62
+ 3b. If project has existing `docs/AI_CONTEXT/`: suggest running `prizmkit.doc.migrate`
63
+
64
+ **Step 4: PrizmKit Workspace Initialization**
65
+ 4a. Create `.prizmkit/` directory:
66
+ - `.prizmkit/config.json` (adoption_mode, speckit_hooks_enabled, platform)
67
+ - `.prizmkit/specs/` (empty)
68
+
69
+ **Step 5: Hook & Settings Configuration (Platform-Specific)**
70
+
71
+ **If platform is CodeBuddy (or both):**
72
+ 5a-cb. Read or create `.codebuddy/settings.json`
73
+ 5b-cb. Add UserPromptSubmit hook from `${SKILL_DIR}/../../../assets/hooks/prizm-commit-hook.json`
74
+ 5c-cb. Preserve any existing hooks
75
+
76
+ **If platform is Claude Code (or both):**
77
+ 5a-cl. Read or create `.claude/settings.json`
78
+ 5b-cl. Add `permissions` and `allowedTools` entries if needed
79
+ 5c-cl. Create `.claude/rules/prizm-documentation.md` with glob-scoped rules:
80
+ ```yaml
81
+ ---
82
+ description: PrizmKit documentation rules
83
+ globs:
84
+ - "**/*.ts"
85
+ - "**/*.js"
86
+ - "**/*.py"
87
+ - "**/*.go"
88
+ ---
89
+ When modifying source files:
90
+ 1. Read `.prizm-docs/root.prizm` to understand project structure
91
+ 2. After changes, update affected `.prizm-docs/` files
92
+ 3. Follow Prizm doc format (KEY: value, not prose)
93
+ ```
94
+ 5d-cl. Create `.claude/rules/prizm-commit-workflow.md` with commit-scoped rules:
95
+ ```yaml
96
+ ---
97
+ description: PrizmKit commit workflow enforcement
98
+ globs:
99
+ - "**/*"
100
+ ---
101
+ Before any git commit:
102
+ 1. Run git diff --cached --name-status
103
+ 2. Map changed files to modules via root.prizm MODULE_INDEX
104
+ 3. Update affected .prizm-docs/ files
105
+ 4. Stage .prizm-docs/ changes
106
+ 5. Use /prizmkit-committer for the complete workflow
107
+ ```
108
+ 5e-cl. Preserve any existing Claude settings and rules
109
+
110
+ **Step 6: Project Memory Update (Platform-Specific)**
111
+
112
+ **If platform is CodeBuddy (or both):**
113
+ 6a-cb. Read existing `CODEBUDDY.md` (or create if missing)
114
+ 6b-cb. Append PrizmKit section from `${SKILL_DIR}/../../../assets/codebuddy-md-template.md`
115
+ 6c-cb. Do not duplicate if already present
116
+
117
+ **If platform is Claude Code (or both):**
118
+ 6a-cl. Read existing `CLAUDE.md` (or create if missing)
119
+ 6b-cl. Append PrizmKit section from `${SKILL_DIR}/../../../assets/claude-md-template.md`
120
+ 6c-cl. Adjust command references to use `/command-name` format (not `prizmkit.xxx`)
121
+ 6d-cl. Do not duplicate if already present
122
+
123
+ **Step 7: Report**
124
+ Output summary: platform detected, tech stack detected, modules discovered, L1 docs generated, assessment highlights, platform-specific configuration applied, next recommended steps.
125
+
126
+ Include platform-specific guidance:
127
+ - CodeBuddy: "Use `prizmkit.specify` to start your first feature"
128
+ - Claude Code: "Use `/prizmkit-specify` to start your first feature"
129
+
130
+ GREENFIELD WORKFLOW (new project):
131
+ - Skip Steps 1-2 (no code to scan)
132
+ - Step 3: Create minimal `.prizm-docs/` with just `root.prizm` skeleton
133
+ - Steps 4-6: Same as brownfield
134
+ - Step 7: Recommend starting with specify for first feature (platform-appropriate command format)
135
+
136
+ ### Gradual Adoption Path
137
+ After init, PrizmKit operates in phases:
138
+ - **Passive** (default): Generates docs, doesn't enforce workflow
139
+ - **Advisory**: Suggests improvements, flags issues (enable in config)
140
+ - **Active**: Enforces spec-driven workflow for new features (enable in config)
141
+
142
+ User can change mode in `.prizmkit/config.json`: `"adoption_mode": "passive" | "advisory" | "active"`
143
+
144
+ ### Platform Reference
145
+
146
+ | Concept | CodeBuddy | Claude Code |
147
+ |---------|-----------|-------------|
148
+ | Command invocation | `prizmkit.xxx` | `/prizmkit-xxx` |
149
+ | Project memory | `CODEBUDDY.md` | `CLAUDE.md` |
150
+ | Settings | `.codebuddy/settings.json` | `.claude/settings.json` |
151
+ | Skills/Commands | `.codebuddy/skills/` | `.claude/commands/` |
152
+ | Agents | `.codebuddy/agents/` | `.claude/agents/` |
153
+ | Rules | hooks in settings.json | `.claude/rules/*.md` |
154
+ | CLI command | `cbc` | `claude` |
155
+
156
+ IMPORTANT: Use `${SKILL_DIR}` placeholder for all path references. Never hardcode absolute paths.
@@ -0,0 +1,55 @@
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)"
5
+ ---
6
+
7
+ # PrizmKit Log Analyzer
8
+
9
+ Analyze log files to identify anomaly patterns, frequency trends, and error correlations for production issue investigation.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.analyze-logs \<log-file-or-directory\>
14
+
15
+ Analyze log files and produce a structured report of findings.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Read and parse log files (auto-detect format):
20
+ - JSON structured logs
21
+ - Structured text (key=value pairs)
22
+ - Syslog format
23
+ - Custom formats (infer delimiter and field positions)
24
+ 2. Extract entries with normalized fields:
25
+ - **Timestamp**: parse to comparable datetime
26
+ - **Level**: DEBUG, INFO, WARN, ERROR, FATAL
27
+ - **Source**: service name, module, class, or file
28
+ - **Message**: the log message body
29
+ - **Metadata**: request ID, user ID, trace ID (if present)
30
+ 3. Analyze patterns:
31
+ - **Error frequency**: count by type and time window (per minute, per hour)
32
+ - **Correlation**: errors that consistently appear together or in sequence
33
+ - **Anomaly detection**: sudden spikes in error rate, new error types not seen before
34
+ - **Timeline**: when did behavior change relative to deployments or config changes
35
+ - **Request tracing**: follow request IDs across log entries to reconstruct flows
36
+ 4. Identify top issues:
37
+ - Most frequent errors (by count)
38
+ - Most recent new errors (not seen in earlier log entries)
39
+ - Errors with increasing trend (getting worse over time)
40
+ - Errors correlated with specific endpoints, users, or time windows
41
+ 5. Generate analysis report:
42
+ - **Timeline of events**: chronological summary of significant changes
43
+ - **Top 10 error patterns**: with frequency, first/last occurrence, and sample messages
44
+ - **Correlation findings**: errors that co-occur or cascade
45
+ - **Anomaly alerts**: unusual patterns that warrant investigation
46
+ - **Recommended investigation priorities**: ranked list of what to look at first
47
+
48
+ ## Path References
49
+
50
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
51
+
52
+ ## Output
53
+
54
+ - Structured analysis report printed to console
55
+ - Summary suitable for sharing with team or pasting into incident reports
@@ -0,0 +1,75 @@
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)"
5
+ ---
6
+
7
+ # PrizmKit Monitoring Setup
8
+
9
+ Generate comprehensive monitoring, alerting, and log collection configurations for your project's observability stack.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.monitoring
14
+
15
+ Generate monitoring and observability configurations.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Read `.prizm-docs/root.prizm` for tech stack and architecture (services, databases, external dependencies)
20
+ 2. Ask user: monitoring stack
21
+ - Prometheus + Grafana
22
+ - ELK (Elasticsearch, Logstash, Kibana)
23
+ - CloudWatch (AWS)
24
+ - Datadog
25
+ - Other (specify)
26
+ 3. Identify key metrics to monitor:
27
+ - **Application (RED metrics)**:
28
+ - Request **R**ate: requests per second by endpoint
29
+ - **E**rror rate: 4xx/5xx responses, exception counts
30
+ - **D**uration: latency percentiles (p50, p95, p99)
31
+ - **System**:
32
+ - CPU utilization and saturation
33
+ - Memory usage and swap
34
+ - Disk I/O and space
35
+ - Network throughput and errors
36
+ - **Business**:
37
+ - Feature-specific metrics derived from spec (signups, transactions, etc.)
38
+ - SLA/SLO compliance indicators
39
+ - **Database**:
40
+ - Connection pool utilization
41
+ - Query latency by type (read/write)
42
+ - Replication lag
43
+ - Slow query count
44
+ 4. Generate monitoring configs:
45
+ - **Metrics collection**: Scrape configs, exporters, or agent configurations
46
+ - **Alert rules** with severity levels:
47
+ - Critical: immediate page (service down, data loss risk)
48
+ - Warning: investigate soon (degraded performance, approaching limits)
49
+ - Info: awareness (deployment events, scaling events)
50
+ - **Dashboard definition**: JSON/YAML for Grafana or equivalent
51
+ - Overview dashboard: service health at a glance
52
+ - Detail dashboard: per-service deep dive
53
+ - **Log format and collection config**:
54
+ - Structured log format recommendation
55
+ - Log shipping configuration
56
+ - Log retention policy
57
+ 5. Generate health check endpoint code if not existing:
58
+ - Liveness probe: process is running
59
+ - Readiness probe: dependencies are available
60
+ - Startup probe: initialization complete
61
+ 6. Write configs to standard locations:
62
+ - Prometheus: `monitoring/prometheus.yml`, `monitoring/alerts.yml`
63
+ - Grafana: `monitoring/dashboards/`
64
+ - Application: health check endpoint in source code
65
+
66
+ ## Path References
67
+
68
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
69
+
70
+ ## Output
71
+
72
+ - Monitoring configuration files in `monitoring/` directory
73
+ - Alert rule definitions
74
+ - Dashboard JSON/YAML files
75
+ - Health check endpoint code (if generated)
@@ -0,0 +1,70 @@
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)"
5
+ ---
6
+
7
+ # PrizmKit Onboarding Generator
8
+
9
+ Generate a comprehensive developer onboarding guide from project context, covering everything a new team member needs to be productive.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.onboarding
14
+
15
+ Generate a complete onboarding guide for new developers.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Read `.prizm-docs/root.prizm` for complete project overview (tech stack, architecture, conventions)
20
+ 2. Read `.prizm-docs/` L1 module docs for detailed module information
21
+ 3. Read existing `README.md`, `CONTRIBUTING.md` if present (avoid duplicating existing docs; reference them instead)
22
+ 4. Generate `ONBOARDING.md` covering:
23
+ - **Environment Setup**:
24
+ - Prerequisites (language runtimes, tools, accounts)
25
+ - Step-by-step install commands (copy-paste ready)
26
+ - Configuration files to create or modify
27
+ - Verification commands to confirm setup works
28
+ - **Architecture Overview**:
29
+ - High-level system description (from root.prizm ARCHITECTURE and LAYERS)
30
+ - Key services/modules and their responsibilities
31
+ - Data flow between components
32
+ - External dependencies and integrations
33
+ - **Key Directories**:
34
+ - What each top-level directory contains
35
+ - Where to find specific types of code (models, controllers, tests, configs)
36
+ - **Build and Test Commands**:
37
+ - How to build the project
38
+ - How to run the full test suite
39
+ - How to run specific tests
40
+ - How to run linters and formatters
41
+ - **Development Workflow**:
42
+ - Branch naming convention
43
+ - Development cycle: branch, develop, test, commit, PR
44
+ - Code review expectations
45
+ - CI/CD pipeline overview
46
+ - **Key Concepts and Domain Terminology**:
47
+ - Domain-specific terms and their meanings
48
+ - Acronyms used in the codebase
49
+ - **Common Tasks** (step-by-step guides):
50
+ - Adding a new API endpoint
51
+ - Adding a new database migration
52
+ - Creating a new test
53
+ - Deploying to staging
54
+ - **Debugging Tips and Common Pitfalls**:
55
+ - Known gotchas from TRAPS sections
56
+ - Common setup issues and solutions
57
+ - Useful debugging commands
58
+ - **Where to Find Help**:
59
+ - Documentation locations
60
+ - Team contacts or channels
61
+ - Issue tracker and how to file bugs
62
+ 5. Write to `ONBOARDING.md` in project root
63
+
64
+ ## Path References
65
+
66
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
67
+
68
+ ## Output
69
+
70
+ - `ONBOARDING.md` in project root: complete onboarding guide for new developers
@@ -0,0 +1,55 @@
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)"
5
+ ---
6
+
7
+ # PrizmKit Performance Profiler
8
+
9
+ Identify performance bottlenecks through static code analysis and profiling guidance. Suggests targeted optimizations with expected impact.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.perf-profile [module-or-file]
14
+
15
+ Analyze code for performance bottlenecks and generate optimization recommendations.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Read `.prizm-docs/` for architecture and module relationships (dependencies, data flow, hot paths)
20
+ 2. If specific file/module given: focus analysis on that scope; otherwise analyze project-wide critical paths
21
+ 3. Analyze for common bottleneck patterns:
22
+ - **N+1 queries**: ORM/database calls inside loops
23
+ - **Missing indexes**: queries filtering or sorting on unindexed columns
24
+ - **Synchronous blocking in async code**: blocking I/O in async handlers, missing await
25
+ - **Unnecessary serialization/deserialization**: repeated JSON parse/stringify, redundant marshaling
26
+ - **Memory leaks**: growing collections without bounds, unclosed resources, event listener accumulation
27
+ - **Inefficient algorithms**: O(n^2) where O(n) or O(n log n) is possible, nested loops over large datasets
28
+ - **Missing caching opportunities**: repeated expensive computations or external calls with stable inputs
29
+ - **Excessive logging in hot paths**: string formatting and I/O in tight loops
30
+ - **Large payload transfers**: over-fetching from database, sending unnecessary fields to client
31
+ - **Connection management**: not reusing connections, missing connection pooling
32
+ 4. Generate profiling recommendations:
33
+ - Suggest profiling tools appropriate for the project's tech stack:
34
+ - Node.js: `--prof`, `clinic.js`, `0x`
35
+ - Python: `cProfile`, `py-spy`, `line_profiler`
36
+ - Java: JFR, async-profiler, VisualVM
37
+ - Go: `pprof`, `trace`
38
+ - Rust: `perf`, `flamegraph`, `criterion`
39
+ - Provide specific commands to run the profiler against the identified hot paths
40
+ - Identify measurement baselines to establish before optimizing
41
+ 5. Output performance report:
42
+ - **Suspected bottlenecks**: ranked by likely impact (HIGH / MEDIUM / LOW)
43
+ - **Suggested optimizations**: for each bottleneck, concrete code changes or architectural adjustments
44
+ - **Profiling commands**: copy-paste ready commands to validate each suspicion
45
+ - **Expected impact**: qualitative assessment of improvement (e.g., "Eliminates N+1, expect ~10x query reduction for list endpoints")
46
+ 6. Suggest updating `.prizm-docs/` TRAPS section with discovered performance pitfalls for future reference
47
+
48
+ ## Path References
49
+
50
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
51
+
52
+ ## Output
53
+
54
+ - Performance analysis report printed to console
55
+ - Profiling command suggestions ready to execute
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: "prizmkit-plan"
3
+ description: "Generate technical implementation plan from feature spec. Creates plan.md, data-model.md, API contracts, and research docs. Invoke after 'specify' when ready to plan. (project)"
4
+ ---
5
+
6
+ # PrizmKit Plan
7
+
8
+ Generate a comprehensive technical implementation plan from a feature specification. Produces plan.md with architecture approach, component design, data model, API contracts, testing strategy, and risk assessment.
9
+
10
+ ## Commands
11
+
12
+ ### prizmkit.plan
13
+
14
+ Create a technical implementation plan for a specified feature.
15
+
16
+ **PRECONDITION:** `spec.md` exists in `.prizmkit/specs/###-feature-name/`, `.prizm-docs/root.prizm` exists
17
+
18
+ **STEPS:**
19
+
20
+ **Phase 0 — Research:**
21
+ 1. Read `spec.md` and `.prizm-docs/root.prizm` for project context
22
+ 2. Read relevant `.prizm-docs/` L1/L2 docs for affected modules
23
+ 3. Resolve any remaining `[NEEDS CLARIFICATION]` by proposing solutions
24
+ 4. Research technical approach based on project's tech stack
25
+
26
+ **Phase 1 — Design:**
27
+ 5. Generate `plan.md` from template (`${SKILL_DIR}/assets/plan-template.md`):
28
+ - Architecture approach (how feature fits into existing structure)
29
+ - Component design (new/modified components)
30
+ - Data model changes (new entities, modified schemas)
31
+ - Interface design (API endpoints, request/response formats, module interfaces)
32
+ - Integration points (external services, internal modules)
33
+ - Testing strategy (unit, integration, e2e)
34
+ - Risk assessment
35
+ 6. Cross-check plan against spec: every user story MUST map to plan components
36
+ 7. Check alignment with project rules from `.prizm-docs/root.prizm` RULES section
37
+ 8. Output: `plan.md` path and summary of design decisions
38
+
39
+ **KEY RULES:**
40
+ - Every user story in spec.md MUST have a corresponding component or task in the plan
41
+ - Architecture decisions MUST align with existing project patterns from `.prizm-docs/`
42
+ - Risk assessment MUST include at least one risk with mitigation strategy
43
+ - Supporting details (data model, interface design) are included as sections within plan.md, not as separate files
44
+
45
+ **HANDOFF:** `prizmkit.tasks` or `prizmkit.code-review`
46
+
47
+ ## Template
48
+
49
+ The plan template is located at `${SKILL_DIR}/assets/plan-template.md`.
50
+
51
+ ## Output
52
+
53
+ All outputs are written to `.prizmkit/specs/###-feature-name/`:
54
+ - `plan.md` — The implementation plan (includes architecture, component design, data model, interface design, testing strategy, risk assessment)
@@ -0,0 +1,37 @@
1
+ # Implementation Plan: [FEATURE_TITLE]
2
+
3
+ ## Architecture Approach
4
+ [How this feature integrates with existing system architecture]
5
+
6
+ ## Component Design
7
+
8
+ ### New Components
9
+ - [Component]: [Purpose]
10
+
11
+ ### Modified Components
12
+ - [Component]: [What changes and why]
13
+
14
+ ## Data Model
15
+ [Entity definitions, schemas, and relationships — include all details here]
16
+
17
+ ## Interface Design
18
+ [API endpoints, request/response formats, module interfaces — include all details here]
19
+
20
+ ## Integration Points
21
+ - [Service/Module]: [How integrated]
22
+
23
+ ## Testing Strategy
24
+ - Unit: [Approach]
25
+ - Integration: [Approach]
26
+ - E2E: [Approach]
27
+
28
+ ## Risk Assessment
29
+ | Risk | Impact | Mitigation |
30
+ |------|--------|------------|
31
+ | [Risk] | [H/M/L] | [Plan] |
32
+
33
+ ## Pre-Implementation Gates
34
+ - [ ] Spec coverage: all user stories mapped to components
35
+ - [ ] Data model reviewed
36
+ - [ ] API contracts defined
37
+ - [ ] Testing approach agreed
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: "prizmkit-prizm-docs"
3
+ description: "AI-only documentation framework for progressive context loading. Manages .prizm-docs/ with 3-level hierarchy (L0/L1/L2). Use 'prizmkit.doc.init' to bootstrap, 'prizmkit.doc.update' to sync, 'prizmkit.doc.status' to check freshness, 'prizmkit.doc.rebuild' to regenerate, 'prizmkit.doc.validate' to check compliance, 'prizmkit.doc.migrate' to convert existing docs."
4
+ ---
5
+
6
+ # Prizm Docs - AI Documentation Framework
7
+
8
+ Full specification: ${SKILL_DIR}/assets/PRIZM-SPEC.md
9
+
10
+ ## Commands
11
+
12
+ ### prizmkit.doc.init
13
+
14
+ Bootstrap .prizm-docs/ for the current project.
15
+
16
+ PRECONDITION: No .prizm-docs/ directory exists, or user confirms overwrite.
17
+
18
+ STEPS:
19
+ 1. Detect project type by scanning for build system files (go.mod, package.json, requirements.txt, Cargo.toml, pom.xml, *.csproj). Identify primary language, framework, build command, test command, and entry points.
20
+ 2. Discover modules by finding directories with 3+ source files. Recognize common patterns (controllers/, services/, models/, components/, hooks/, utils/, lib/, pkg/, internal/, cmd/, api/, routes/, middleware/). Exclude vendor/, node_modules/, .git/, build/, dist/, __pycache__/, target/, bin/. If module count > 30, ask user for include/exclude patterns.
21
+ 3. Create .prizm-docs/ directory structure mirroring the source tree.
22
+ 4. Generate root.prizm (L0) with PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY, MODULE_INDEX with arrow pointers, RULES extracted from CODEBUDDY.md/README/linter configs, and PATTERNS. Set PRIZM_VERSION: 2, UPDATED: today's date. Max 4KB.
23
+ 5. Generate L1 .prizm files for each discovered module. Each L1 includes MODULE, FILES count, RESPONSIBILITY, SUBDIRS with pointers, KEY_FILES (5-10 most important), INTERFACES (public/exported only), DEPENDENCIES (imports, imported-by, external), RULES, DATA_FLOW. Max 3KB each.
24
+ 6. DO NOT generate L2 docs during init. L2 is created lazily on first file modification in a sub-module, or when AI needs deep understanding of a module (ON_DEEP_READ trigger).
25
+ 7. Create changelog.prizm with initial entry: `- YYYY-MM-DD | root | add: initialized prizm documentation framework`
26
+ 8. Configure UserPromptSubmit hook in .codebuddy/settings.json per ${SKILL_DIR}/assets/PRIZM-SPEC.md Section 11.
27
+ 9. Append Prizm protocol section to CODEBUDDY.md per ${SKILL_DIR}/assets/PRIZM-SPEC.md Section 12.
28
+ 10. Validate all generated docs: size limits (L0 <= 4KB, L1 <= 3KB), pointer resolution (every -> reference resolves), no circular dependencies, UPDATED timestamps set, KEY: value format compliance, no anti-patterns (prose, code blocks, markdown headers).
29
+ 11. Report summary: modules discovered, L1 docs generated, files excluded, warnings.
30
+
31
+ OUTPUT: List of generated files, module count, and validation results.
32
+
33
+ ### prizmkit.doc.update
34
+
35
+ Update .prizm-docs/ to reflect recent code changes.
36
+
37
+ PRECONDITION: .prizm-docs/ exists with root.prizm.
38
+
39
+ STEPS:
40
+ 1. Get changed files via `git diff --cached --name-status`. If nothing staged, use `git diff --name-status`. If no git changes at all, do full rescan comparing code against existing docs.
41
+ 2. Map changed files to modules by matching against MODULE_INDEX in root.prizm. Group changes by module.
42
+ 3. Classify each change: A (added) -> new KEY_FILES/INTERFACES entries. D (deleted) -> remove entries, update counts. M (modified) -> check interface/dependency changes. R (renamed) -> update all path references.
43
+ 4. Update affected docs: L2 first (KEY_FILES, INTERFACES, DEPENDENCIES, CHANGELOG, UPDATED), then L1 (FILES count, KEY_FILES, INTERFACES, DEPENDENCIES, UPDATED), then L0 (MODULE_INDEX counts, UPDATED) only if structural change.
44
+ 5. Skip updates if: only internal implementation changed (no interface/dependency change), only comments/whitespace/formatting, only test files changed, only .prizm files changed, bug fixes to existing features (bugs are incomplete features being refined — no new module/interface created, no doc update needed).
45
+ 6. If new directory with 3+ source files appears and matches no module: create L1 immediately, add to MODULE_INDEX, defer L2.
46
+ 7. Append entries to changelog.prizm using format: `- YYYY-MM-DD | <module-path> | <verb>: <description>`
47
+ 8. Enforce size limits: L0 > 4KB -> consolidate. L1 > 3KB -> move details to L2. L2 > 5KB -> split or archive.
48
+ 9. Stage updated .prizm files via `git add .prizm-docs/`
49
+
50
+ OUTPUT: List of updated/created/skipped docs with reasons.
51
+
52
+ ### prizmkit.doc.status
53
+
54
+ Check freshness of all .prizm docs.
55
+
56
+ PRECONDITION: .prizm-docs/ exists with root.prizm.
57
+
58
+ STEPS:
59
+ 1. Read root.prizm UPDATED timestamp.
60
+ 2. Count commits since that timestamp via `git log --since="<timestamp>" --oneline | wc -l`.
61
+ 3. For each L1/L2 doc, compare UPDATED timestamp against latest git modification of source files in that module via `git log -1 --format="%ai" -- <module-path>/`.
62
+ 4. Classify each doc as: FRESH (updated after latest source change), STALE (source changed since last update), MISSING (module exists but no .prizm doc).
63
+ 5. Flag any docs exceeding size limits.
64
+
65
+ OUTPUT: Freshness report table with columns: DOC_PATH | LEVEL | STATUS | LAST_UPDATED | SOURCE_LAST_MODIFIED.
66
+
67
+ ### prizmkit.doc.rebuild <module-path>
68
+
69
+ Regenerate docs for a specific module from scratch.
70
+
71
+ PRECONDITION: .prizm-docs/ exists. Module path is valid.
72
+
73
+ STEPS:
74
+ 1. Delete existing L1 and all L2 docs for the specified module.
75
+ 2. Re-scan the module directory for files, interfaces, dependencies, subdirectories.
76
+ 3. Generate fresh L1 doc with full module analysis.
77
+ 4. Generate L2 docs for all sub-modules immediately (unlike init, rebuild generates L2 right away to capture current state).
78
+ 5. Update MODULE_INDEX in root.prizm with new file counts and pointers.
79
+ 6. Append rebuild entry to changelog.prizm: `- YYYY-MM-DD | <module-path> | refactor: rebuilt module documentation from scratch`
80
+ 7. Validate regenerated docs against size limits and format rules.
81
+
82
+ OUTPUT: Regenerated doc summary with before/after comparison.
83
+
84
+ ### prizmkit.doc.validate
85
+
86
+ Check format compliance and consistency of all .prizm docs.
87
+
88
+ PRECONDITION: .prizm-docs/ exists.
89
+
90
+ STEPS:
91
+ 1. FORMAT CHECK: Verify all .prizm files use KEY: value format. Flag any prose paragraphs, code blocks (```), markdown headers (##), emoji, ASCII art, or horizontal rules.
92
+ 2. SIZE CHECK: Verify size limits: L0 <= 4KB, L1 <= 3KB, L2 <= 5KB. Report files exceeding limits with current size.
93
+ 3. POINTER CHECK: Verify all arrow (->) references resolve to existing .prizm files. Report broken pointers.
94
+ 4. TIMESTAMP CHECK: Verify all docs have UPDATED field. Flag docs with UPDATED older than 30 days as potentially stale.
95
+ 5. COMPLETENESS CHECK: Verify root.prizm has all required fields (PRIZM_VERSION, PROJECT, LANG, MODULE_INDEX). Verify L1 docs have MODULE, FILES, RESPONSIBILITY, INTERFACES, DEPENDENCIES. Verify L2 docs have MODULE, FILES, KEY_FILES, DEPENDENCIES.
96
+ 6. ANTI-PATTERN CHECK: Flag duplicate information across levels, implementation details in L0/L1, TODO items, session-specific context.
97
+ 7. RULES HIERARCHY CHECK: Verify L1/L2 RULES do not contradict root.prizm RULES. L1/L2 may only supplement with module-specific exceptions.
98
+
99
+ OUTPUT: Validation report with PASS/FAIL per check, list of issues with file paths and suggested fixes.
100
+
101
+ ### prizmkit.doc.migrate
102
+
103
+ Convert existing documentation to .prizm-docs/ format.
104
+
105
+ PRECONDITION: Existing docs/ or docs/AI_CONTEXT/ directory with documentation files. No .prizm-docs/ directory (or user confirms overwrite).
106
+
107
+ STEPS:
108
+ 1. DISCOVER existing docs: Scan docs/, docs/AI_CONTEXT/, README.md, ARCHITECTURE.md, and any structured documentation files.
109
+ 2. EXTRACT information from existing docs: project metadata, module descriptions, architecture patterns, rules, decisions, dependencies.
110
+ 3. MAP existing doc content to Prizm levels: project-wide info -> L0 root.prizm, module-level info -> L1 docs, detailed module info -> L2 docs.
111
+ 4. CONVERT prose content to KEY: value format. Strip markdown formatting, tables, diagrams. Condense explanatory text into single-line values.
112
+ 5. GENERATE .prizm-docs/ structure following standard init procedure but seeded with extracted information instead of scanning source code alone.
113
+ 6. VALIDATE migrated docs against Prizm format rules and size limits.
114
+ 7. REPORT migration summary: files processed, content mapped, information that could not be automatically converted (requires manual review).
115
+
116
+ OUTPUT: Migration report with list of source docs processed, generated .prizm files, and any manual review items.
117
+
118
+ ## Progressive Loading Protocol
119
+
120
+ When working in a project with .prizm-docs/:
121
+
122
+ - ON SESSION START: Always read .prizm-docs/root.prizm (L0). This is the project map.
123
+ - ON TASK: Read L1 docs for relevant modules referenced in MODULE_INDEX.
124
+ - ON FILE EDIT: Read L2 doc before modifying files. Check TRAPS and DECISIONS sections.
125
+ - ON DEEP READ: If you need deep understanding of a module without modifying it, generate L2 if it doesn't exist.
126
+ - NEVER load all .prizm docs at once. Progressive loading saves tokens.
127
+ - BUDGET: Typical task should consume 3000-5000 tokens of Prizm docs total.
128
+
129
+ ## Auto-Update Protocol
130
+
131
+ - BEFORE EVERY COMMIT: Update affected .prizm-docs/ files per ${SKILL_DIR}/assets/PRIZM-SPEC.md Section 7.
132
+ - The UserPromptSubmit hook will remind you automatically when commit intent is detected.
133
+ - If hook is not active, you MUST still follow the update protocol manually.
134
+ - NEVER rewrite entire .prizm files. Only update affected sections.
135
+
136
+ ## RULES Hierarchy
137
+
138
+ - root.prizm RULES are authoritative and apply project-wide.
139
+ - L1/L2 RULES only supplement root.prizm with module-specific exceptions.
140
+ - If L1/L2 RULES contradict root.prizm RULES, root.prizm takes precedence.