prizmkit 1.1.78 → 1.1.80

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 (115) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/scripts/init-pipeline.py +2 -0
  3. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +2 -0
  4. package/bundled/skills/_metadata.json +1 -1
  5. package/bundled/skills/app-planner/SKILL.md +10 -347
  6. package/bundled/skills/app-planner/references/infrastructure-convention-discovery.md +108 -0
  7. package/bundled/skills/app-planner/references/project-conventions-discovery.md +59 -0
  8. package/bundled/skills/app-planner/references/project-state-detection.md +88 -0
  9. package/bundled/skills/app-planner/references/rules-configuration.md +46 -0
  10. package/bundled/skills/bug-fix-workflow/SKILL.md +1 -30
  11. package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +66 -0
  12. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +3 -40
  13. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +49 -0
  14. package/bundled/skills/feature-pipeline-launcher/SKILL.md +3 -46
  15. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +55 -0
  16. package/bundled/skills/feature-workflow/SKILL.md +5 -121
  17. package/bundled/skills/feature-workflow/references/brainstorm-guide.md +137 -0
  18. package/bundled/skills/prizm-kit/SKILL.md +11 -0
  19. package/bundled/skills/prizmkit-code-review/SKILL.md +66 -135
  20. package/bundled/skills/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  21. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +31 -0
  22. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  23. package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +186 -0
  24. package/bundled/skills/prizmkit-committer/SKILL.md +6 -0
  25. package/bundled/skills/prizmkit-deploy/SKILL.md +48 -72
  26. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +120 -0
  27. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  28. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  29. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +20 -0
  30. package/bundled/skills/prizmkit-implement/SKILL.md +6 -0
  31. package/bundled/skills/prizmkit-plan/SKILL.md +1 -83
  32. package/bundled/skills/prizmkit-plan/references/examples.md +85 -0
  33. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +13 -0
  34. package/bundled/skills/prizmkit-test/SKILL.md +3 -151
  35. package/bundled/skills/prizmkit-test/references/examples.md +70 -0
  36. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +49 -0
  37. package/bundled/skills/prizmkit-test/references/test-report-template.md +42 -0
  38. package/bundled/skills/recovery-workflow/SKILL.md +1 -30
  39. package/bundled/skills/recovery-workflow/references/detection.md +58 -0
  40. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +3 -45
  41. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +54 -0
  42. package/bundled/skills/refactor-planner/SKILL.md +9 -149
  43. package/bundled/skills/refactor-planner/references/fast-path.md +59 -0
  44. package/bundled/skills/refactor-planner/references/planning-phases.md +135 -0
  45. package/bundled/skills/refactor-workflow/SKILL.md +4 -103
  46. package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +116 -0
  47. package/bundled/skills-windows/app-planner/SKILL.md +10 -349
  48. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +108 -0
  49. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +59 -0
  50. package/bundled/skills-windows/app-planner/references/project-state-detection.md +90 -0
  51. package/bundled/skills-windows/app-planner/references/rules-configuration.md +46 -0
  52. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +1 -30
  53. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +66 -0
  54. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +2 -29
  55. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +49 -0
  56. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +2 -35
  57. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +55 -0
  58. package/bundled/skills-windows/feature-workflow/SKILL.md +5 -121
  59. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +137 -0
  60. package/bundled/skills-windows/prizm-kit/SKILL.md +92 -0
  61. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +156 -0
  62. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  63. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +31 -0
  64. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  65. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +186 -0
  66. package/bundled/skills-windows/prizmkit-committer/SKILL.md +87 -0
  67. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +444 -0
  68. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +115 -0
  69. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +93 -0
  70. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +120 -0
  71. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +46 -0
  72. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +148 -0
  73. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +62 -0
  74. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +50 -0
  75. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +26 -0
  76. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +42 -0
  77. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +31 -0
  78. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +37 -0
  79. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +21 -0
  80. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +59 -0
  81. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  82. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  83. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +20 -0
  84. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +56 -0
  85. package/bundled/skills-windows/prizmkit-implement/SKILL.md +71 -0
  86. package/bundled/skills-windows/prizmkit-plan/SKILL.md +102 -0
  87. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +115 -0
  88. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +73 -0
  89. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +67 -0
  90. package/bundled/skills-windows/prizmkit-plan/references/examples.md +85 -0
  91. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +60 -0
  92. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +128 -0
  93. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +613 -0
  94. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +45 -0
  95. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +15 -0
  96. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +14 -0
  97. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +19 -0
  98. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +17 -0
  99. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +87 -0
  100. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +50 -0
  101. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +43 -0
  102. package/bundled/skills-windows/prizmkit-test/SKILL.md +133 -0
  103. package/bundled/skills-windows/prizmkit-test/references/examples.md +70 -0
  104. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +49 -0
  105. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +42 -0
  106. package/bundled/skills-windows/recovery-workflow/SKILL.md +1 -52
  107. package/bundled/skills-windows/recovery-workflow/references/detection.md +58 -0
  108. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +2 -32
  109. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +54 -0
  110. package/bundled/skills-windows/refactor-planner/SKILL.md +9 -149
  111. package/bundled/skills-windows/refactor-planner/references/fast-path.md +59 -0
  112. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +135 -0
  113. package/bundled/skills-windows/refactor-workflow/SKILL.md +4 -103
  114. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +116 -0
  115. package/package.json +1 -1
@@ -0,0 +1,49 @@
1
+ # SSH Bootstrap Flow
2
+
3
+ Bootstraps the server before first deployment. Present a plan showing every privileged action before executing anything.
4
+
5
+ ## Always-Run Preflight
6
+
7
+ ```
8
+ locale-gen en_US.UTF-8 # fix locale warnings on bare Ubuntu
9
+ apt-get update -qq # refresh package list
10
+ ```
11
+
12
+ ## Check-and-Install (idempotent)
13
+
14
+ Node.js, npm, PM2, Nginx, Git. Use v22 LTS if v25 not available.
15
+
16
+ ## Detect Port Conflicts
17
+
18
+ `ss -tlnp | grep :80 || true`. If port 80/443 is occupied, report and ask how to resolve.
19
+
20
+ ## User and Directory Setup
21
+
22
+ ```
23
+ useradd -m -s /bin/bash <runtimeUser> # if not exists
24
+ mkdir -p /var/www/<project>/{releases,shared,deploy-logs}
25
+ chown -R <runtimeUser>:<runtimeUser> /var/www/<project>
26
+ ```
27
+
28
+ ## PM2 Startup
29
+
30
+ ```
31
+ env PATH=$PATH:/usr/bin pm2 startup systemd -u <runtimeUser> --hp /home/<runtimeUser>
32
+ ```
33
+
34
+ ## Deploy Key (Pull mode only)
35
+
36
+ ```
37
+ sudo -u <runtimeUser> ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""
38
+ sudo -u <runtimeUser> ssh-keyscan -H github.com >> ~/.ssh/known_hosts
39
+ ```
40
+
41
+ ## Security Baseline (Firewall)
42
+
43
+ After core tools are installed, ask whether to configure ufw. If user agrees, read `references/firewall-setup.md` for the full interactive flow and rule templates.
44
+
45
+ ## Database Setup
46
+
47
+ If Discovery detected database drivers, ask whether to install the database on the server. If user agrees, read `references/database-setup.md` for platform-specific setup commands and security notes.
48
+
49
+ After each bootstrap step, record the result. Bootstrap operations must be idempotent. Back up any existing config files before modifying them.
@@ -0,0 +1,41 @@
1
+ # SSH: Deployment Execution Flow
2
+
3
+ Pipeline runs in strict order. Each group must complete before the next begins. If any step before traffic switch fails, STOP — do not touch the live version.
4
+
5
+ ## Pre-flight — Change Summary
6
+
7
+ Show what will be deployed using `git log --oneline <last-deployed-commit>..HEAD`. If first deployment, show last 5 commits. If no new commits, warn "没有新的代码变更。确定要重新部署吗?"
8
+
9
+ ## Group 1 — Pre-flight & Prepare
10
+
11
+ - Verify SSH, runtime user, tools, deploy key, port availability.
12
+ - Generate `releaseId`: `YYYYMMDD-<short-commit-sha>`. Create `releases/<releaseId>`.
13
+ - Determine target color: read `activeColor` from `shared/deploy-metadata.json` and use the opposite. If first deploy (no metadata, no `current` symlink), default to blue (port 3101).
14
+
15
+ ## Group 2 — Fetch & Build
16
+
17
+ - **CI/CD Pull mode** (server-side build): git clone → install → copy `.env.production` before build (NEXT_PUBLIC_* vars are baked at build time) → build. If build fails: STOP.
18
+ - **CI/CD Push mode** (runner-side build): extract tarball, skip install/build.
19
+ - **Direct-upload mode**: build was already done locally and SCP'd. Skip this group.
20
+
21
+ ## Group 3 — Stage & Health Check
22
+
23
+ - Start new version on inactive port via PM2: `pm2 start npm --name <project>-<app>-<color> -- run start -- -p <inactivePort>`.
24
+ - PM2 process naming: `<project>-<app>-<color>` (e.g., `prizm-ideas-web-green`).
25
+ - Wait 3-5 seconds, run health checks against new port. If any fails: STOP, do NOT switch traffic.
26
+
27
+ ## Group 4 — Switch & Verify
28
+
29
+ - Update Nginx upstream to new port. Run `nginx -t` — abort on failure.
30
+ - `systemctl reload nginx`. Update `current` symlink to new release.
31
+ - Write `shared/deploy-metadata.json` with new `activeColor`, `activePort`, `lastReleaseId`.
32
+ - Run health checks against public endpoint. If any fails: rollback immediately.
33
+
34
+ ## Group 5 — Cleanup & Record
35
+
36
+ - Stop old PM2 process. Remove oldest releases beyond `releaseRetention` count. `pm2 save`.
37
+ - Write deploy-history JSON. Update `deploy.config.json` validation status.
38
+
39
+ ## Post-deploy — Completion Summary
40
+
41
+ Output a summary (project, URL, version, duration, health status) and append to deploy.md. If `deployStrategy` is `"direct-upload"`, offer CI/CD upgrade (see §SSH: Post-Deploy CI/CD Upgrade).
@@ -0,0 +1,20 @@
1
+ # SSH: Existing Deployment Takeover
2
+
3
+ When deploying to a server that already has deployment assets.
4
+
5
+ ## Detection
6
+
7
+ 1. Check for existing `/var/www/<project>` directory
8
+ 2. Check for existing PM2 processes with similar names
9
+ 3. Check Nginx config referencing the same domain/IP
10
+ 4. Check for port conflicts
11
+
12
+ ## Decision Flow
13
+
14
+ Report findings and ask for takeover decision:
15
+
16
+ - **Take over and backup**: Back up existing config, then proceed.
17
+ - **Coexist**: Use different directory/ports/process names.
18
+ - **Manual resolve**: Stop and let the user handle it.
19
+
20
+ Record takeover decision and validation results in config and history.
@@ -0,0 +1,56 @@
1
+ # SSL/HTTPS Configuration (Let's Encrypt + Certbot)
2
+
3
+ Read this file when DNS is confirmed pointing to the server and SSL needs to be configured.
4
+
5
+ ## Step 1 — Detect cloud vendor
6
+
7
+ ```
8
+ # Try metadata endpoints to detect cloud vendor
9
+ curl -s --connect-timeout 2 http://100.100.100.200/latest/meta-data/ && echo "ALIBABA"
10
+ curl -s --connect-timeout 2 http://metadata.tencentyun.com/latest/meta-data/ && echo "TENCENT"
11
+ curl -s --connect-timeout 2 http://169.254.169.254/latest/meta-data/ && echo "AWS/GCP/AZURE"
12
+ ```
13
+ Also check `/etc/hostname` for vendor patterns.
14
+
15
+ ## Step 2 — Choose SSL strategy
16
+
17
+ - **Cloud vendor detected** → ask user:
18
+ > "检测到服务器运行在 <云厂商>。用哪种 SSL 方案?"
19
+ > - **A. Let's Encrypt 免费证书(推荐)** — 一行命令永久自动续期,最省心
20
+ > - **B. <云厂商> 自有证书** — 需手动下载配置,1年有效期需手动续期
21
+ >
22
+ > 选 A 我直接帮你搞定;选 B 你需要在云控制台下载证书后告诉我路径。
23
+ - **No cloud vendor / unknown** → use certbot directly, no choice needed.
24
+
25
+ ## Step 3 — Certbot install & certificate request
26
+
27
+ ```
28
+ # Install certbot (idempotent)
29
+ which certbot || apt-get install -y certbot python3-certbot-nginx
30
+
31
+ # Request certificate
32
+ certbot --nginx -d <domain> -d www.<domain> --non-interactive --agree-tos --email <user-email>
33
+ ```
34
+
35
+ **Collect from user before running:**
36
+ - Email address (Let's Encrypt expiry notifications)
37
+ - Confirm domain list (e.g., `example.com, www.example.com`)
38
+
39
+ ## Step 4 — Verify auto-renewal
40
+
41
+ ```
42
+ systemctl status certbot.timer
43
+ certbot renew --dry-run
44
+ ```
45
+ If timer is inactive, enable it: `systemctl enable --now certbot.timer`.
46
+
47
+ ## Step 5 — Record
48
+
49
+ - Write SSL configuration summary to deploy.md: certificate paths, auto-renewal status, expiry date.
50
+ - Record a `"ssl-setup"` event in deploy history.
51
+
52
+ ## Edge cases
53
+
54
+ - **DNS not yet propagated** → certbot challenge fails. Tell user to wait and retry: `/prizmkit-deploy setup-ssl`.
55
+ - **Existing certificate found** → check expiry date (`certbot certificates`). If expiring within 30 days, warn. Otherwise skip.
56
+ - **Port 80/443 occupied by non-Nginx process** → report and ask how to resolve before proceeding.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: "prizmkit-implement"
3
+ description: "Execute plan.md tasks with TDD approach. Respects task ordering and dependencies. Use after /prizmkit-plan. Trigger on: 'implement', 'build', 'code it', 'start coding', 'execute', 'write the code'. (project)"
4
+ ---
5
+
6
+ # PrizmKit Implement
7
+
8
+ ### When to Use
9
+ - After `/prizmkit-plan` when ready to write code
10
+ - User says "implement", "build", "code it", "start coding", "develop"
11
+ - For fast-path: user describes a simple change directly (fast-path skips specify, but still requires a simplified plan.md with Tasks section)
12
+
13
+ ### When NOT to Use
14
+ - No plan.md exists — run /prizmkit-plan first
15
+ - All tasks in plan.md are already checked off — nothing to implement
16
+ - Trivial one-line changes (typo, config tweak) — edit directly without the full workflow
17
+ - Design/planning phase — use /prizmkit-plan to produce spec and plan first
18
+
19
+ **PRECONDITION:**
20
+
21
+ | Required Artifact | Check | If Missing |
22
+ |---|---|---|
23
+ | `plan.md` with Tasks section | File exists + unchecked tasks | Run `/prizmkit-plan` |
24
+ | `spec.md` | File exists in same directory as plan.md | Run `/prizmkit-plan` |
25
+
26
+ **Artifact directory**: Accept `artifact_dir` from caller. If not provided, scan `.prizmkit/` subdirectories for the most recently modified `plan.md` with unchecked tasks.
27
+
28
+ ## Input
29
+
30
+ | Parameter | Required | Description |
31
+ |-----------|----------|-------------|
32
+ | `artifact_dir` | No | Directory containing spec.md + plan.md. If omitted, auto-detect per precondition above. |
33
+
34
+ ## Context Loading
35
+
36
+ Before implementation, load context once:
37
+
38
+ 1. **Task context**: Read `plan.md` (including Tasks section) and `spec.md` from the artifact directory. If other companion documents exist in the directory (e.g., `refactor-analysis.md`), read them for additional context.
39
+ 2. **Architecture context**: Read `.prizmkit/prizm-docs/root.prizm` (L0 — project overview, module index, tech stack, conventions) and relevant L1/L2 docs for affected modules. Pay special attention to TRAPS (known pitfalls) and DECISIONS (architectural choices).
40
+ 3. **Dev rules** (if configured): Check `.prizmkit/prizm-docs/root.prizm` for a `RULES:` line — if present, read all referenced `.prizmkit/rules/<layer>-rules.md` files. If a referenced file does not exist, skip it silently and continue. These define per-layer conventions (frameworks, naming, patterns, state management, etc.) that AI must follow when generating code for that layer. Apply these rules during implementation — if a rule conflicts with what plan.md describes, call it out and ask the user.
41
+
42
+ > `.prizmkit/prizm-docs/` uses a 3-level hierarchy: L0 (`root.prizm`) is the project-wide index. L1 (e.g., `auth.prizm`) covers a module — its key files, interfaces, dependencies, traps, and decisions. L2 is for sub-modules with their own complexity. Implement reads these docs to avoid repeating known mistakes; `/prizmkit-retrospective` is responsible for updating them after implementation.
43
+
44
+ ## Execution
45
+
46
+ For each unchecked task in plan.md, in order:
47
+
48
+ 1. Read L1/L2 doc for the target file's module — check TRAPS and DECISIONS before modifying files
49
+ 2. Apply TDD where applicable: write a failing test first, then implement until it passes. For UI components or configuration changes where unit tests don't apply, skip the test-first step.
50
+ - **Internal ID hygiene**: Do not place PrizmKit feature/bug/refactor IDs (`F-001`, `B-001`, `R-001`), task IDs, session IDs, run IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths in `.prizmkit/prizm-docs/`, user-visible UI text, API responses, emails, notifications, or tests that assert visible product copy. Translate internal references into durable product/domain language before writing memory docs, tests, or UI copy.
51
+ - **Cover three paths for each function**: happy path (valid inputs producing expected behavior), edge cases (boundary values specific to the parameter type and domain — e.g., zero/min/max for numeric, empty collection, boundary index), and error conditions (inputs that should trigger error handling). Determine edge cases from the function's parameter types and domain logic, not from a fixed checklist. If a function has no edge or error paths, don't force them.
52
+ - **No redundant tests**: Check if a test for this behavior already exists before writing. Each test must verify a uniquely different code path — don't write multiple tests that exercise the same logic.
53
+ - **Test your own code only**: Don't test framework behavior, third-party library internals, or language built-ins. For library calls, test the integration point (correct parameters passed, return value correctly handled), not the library itself.
54
+ 3. Mark task as `[x]` in `plan.md` immediately after completion — not batched at the end. Immediate marking means plan.md always reflects true progress, even if the session is interrupted.
55
+ 4. **Parallel tasks**: If task has `[P]` marker, it can run in parallel with other `[P]` tasks in the same group. Sequential tasks stop on failure (later tasks may depend on this one). Parallel `[P]` tasks continue — report all failures at the end.
56
+ 5. **Checkpoint tasks** (`CP:` prefix in plan.md): When a checkpoint task is reached, verify build passes and tests pass before continuing. Checkpoints catch integration errors early — skipping them means cascading failures in later phases.
57
+ 6. After all tasks complete: run full test suite.
58
+
59
+ ## Recovery
60
+
61
+ If a session is interrupted mid-implementation:
62
+ - Completed tasks are already marked `[x]` in plan.md (because we mark immediately)
63
+ - Resume by re-running `/prizmkit-implement` — it picks up from the first unchecked `[ ]` task
64
+
65
+ **HANDOFF:** `/prizmkit-code-review`
66
+
67
+ ## Output
68
+
69
+ - Code files created/modified as specified in plan.md Tasks section
70
+ - `plan.md` Tasks section updated with completion markers `[x]`
71
+ - Implementation summary output to conversation
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: "prizmkit-plan"
3
+ description: "Specify and plan tasks: natural language → spec.md & plan.md with architecture and executable tasks. Use before /prizmkit-implement. Trigger on: 'specify', 'plan', 'new task', 'I want to add/build...', 'architect', 'design', 'break it down', 'create tasks'. (project)"
4
+ ---
5
+
6
+ # PrizmKit Plan
7
+
8
+ A universal spec + plan generator. Takes a natural-language description of ANY development task (new feature, refactoring, bug fix, migration, etc.) and produces `spec.md` (WHAT/WHY) and `plan.md` (HOW) with executable tasks.
9
+
10
+ ### When to Use
11
+ - Any non-trivial development task that benefits from written specification and planning
12
+ - Before `/prizmkit-implement` — to create the spec + task breakdown
13
+ - User says "specify", "plan", "new task", "I want to add...", "architect", "design", "break it down"
14
+
15
+ ### When NOT to Use
16
+ - Config tweaks, typo fixes, trivial one-line changes → edit directly
17
+ - Simple changes where the developer already knows exactly what to do and the scope is ≤10 lines in a single file
18
+
19
+ ## Input
20
+
21
+ | Parameter | Required | Description |
22
+ |-----------|----------|-------------|
23
+ | `description` | Yes | Natural-language description of the task |
24
+ | `artifact_dir` | No | Directory to write spec.md + plan.md into. If omitted, auto-generates under `.prizmkit/specs/` (see Phase 0 Step 2). |
25
+
26
+ ## Execution
27
+
28
+ ### Phase 0: Specify (→ spec.md)
29
+
30
+ **Skip condition**: If `spec.md` already exists in the artifact directory, skip to Phase 1.
31
+
32
+ **Steps:**
33
+
34
+ 1. Gather input: read the task description. If no description is provided and interactive session is available, ask the user; otherwise abort with an error.
35
+ 2. Determine artifact directory:
36
+ - If `artifact_dir` is provided → use it directly
37
+ - If not provided → scan `.prizmkit/specs/` for existing `###-*` directories, find highest numeric prefix, next = highest + 1 (zero-padded to 3 digits; start at `001` if empty). Create `.prizmkit/specs/###-task-slug/`
38
+ - Auto-generate 2-10 word task slug from description
39
+ 3. Load project context: read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 docs
40
+ 4. Generate `spec.md` from template (`${SKILL_DIR}/assets/spec-template.md`):
41
+ - Fill sections based on the task description — all sections are optional, include only what is relevant
42
+ - `[NEEDS CLARIFICATION]` markers for all ambiguous items
43
+ 5. **Database design detection**: If changes involve data persistence (new entities, fields, schema changes), add `## Data Model` section — scan existing schema files to extract naming conventions, ID strategy, constraint patterns. Mark uncertain decisions with `[NEEDS CLARIFICATION]`.
44
+ 6. Run quality validation : all goals have criteria? scope defined? DB conventions documented (if applicable)?
45
+ 7. **Auto-clarification**: If any `[NEEDS CLARIFICATION]` markers remain and interactive session is available, enter interactive clarification.
46
+ → Read `${SKILL_DIR}/references/clarify-guide.md` for question strategy and update rules.
47
+ If non-interactive, resolve ambiguities by choosing the most conservative option and annotating the decision.
48
+ Resolve all markers before proceeding to Phase 1.
49
+
50
+ **Writing principles**: Focus on WHAT and WHY, never HOW. Every goal needs acceptance criteria. Scope boundaries must be explicit. Mark all genuine ambiguities — the clarification phase resolves them.
51
+
52
+ **Internal ID hygiene**: PrizmKit IDs (`F-001`, `B-001`, `R-001`), task IDs (`T-100`), session IDs, run IDs, branch names, absolute worktree paths, and `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths are internal tracking metadata. They may appear in specs, plans, commit messages, and non-memory pipeline artifacts, but must never be written to `.prizmkit/prizm-docs/`, user-visible product copy, UI text, API responses, or expected UI strings in tests. If a behavior is scoped to the current feature, describe the product behavior without the ID.
53
+
54
+ ### Phase 1: Design (spec.md → plan.md)
55
+
56
+ **Precondition**: `spec.md` exists in the artifact directory.
57
+
58
+ **Steps:**
59
+
60
+ 1. Read `spec.md` from the artifact directory
61
+ 2. Load project context if not already loaded in Phase 0: read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 docs
62
+ 3. Resolve any remaining `[NEEDS CLARIFICATION]` by proposing solutions
63
+ 4. Generate `plan.md` from template (`${SKILL_DIR}/assets/plan-template.md`):
64
+ - Change approach (how the changes integrate with existing system)
65
+ - Component / file changes
66
+ - Data model changes (with **database design gate** — read ALL existing schema files, ensure new schema follows existing patterns, resolve all DB ambiguities inline before proceeding)
67
+ - Interface design (API endpoints, request/response formats)
68
+ - Testing strategy
69
+ - Risk assessment
70
+ - Behavior preservation strategy (if the task modifies existing behavior — include what must remain unchanged and how to verify)
71
+ 5. Cross-check: every goal in spec.md maps to plan components — unmapped goals = coverage gaps
72
+ 6. Check alignment with `.prizmkit/prizm-docs/root.prizm` RULES section
73
+
74
+ ### Phase 2: Task Generation (plan.md → Tasks section)
75
+
76
+ 1. If interactive session is available, ask user for strategy; otherwise infer automatically: MVP-first / Incremental / Parallel
77
+ 2. Append `## Tasks` section to `plan.md` using template in `${SKILL_DIR}/assets/plan-template.md`:
78
+ - Phases: Setup (T-001~T-009) → Foundation (T-010~T-099) → Core (T-100+) → Polish (T-900+)
79
+ - Each task: `- [ ] [T-NNN] [P?] [G-N?] Description — file: path/to/file`
80
+ - Checkpoint tasks between phases for validation
81
+ - Organize Core tasks by goals (G-1, G-2, ...) or by logical grouping appropriate to the task
82
+ 3. Verify consistency and coverage → read `${SKILL_DIR}/references/verification-checklist.md` and run all checks. Fix any issues inline before output.
83
+ 4. Output: `plan.md` path, summary of design decisions, task count.
84
+
85
+ **HANDOFF:** `/prizmkit-implement`
86
+
87
+ ## Examples
88
+
89
+ Read `${SKILL_DIR}/references/examples.md` for worked examples of feature, refactoring, and bug fix planning.
90
+
91
+ ## References
92
+
93
+ - Spec template: `${SKILL_DIR}/assets/spec-template.md`
94
+ - Plan template: `${SKILL_DIR}/assets/plan-template.md`
95
+ - Clarification guide: `${SKILL_DIR}/references/clarify-guide.md`
96
+ - Verification checklist: `${SKILL_DIR}/references/verification-checklist.md`
97
+
98
+ ## Output
99
+
100
+ | Directory | Files |
101
+ |---|---|
102
+ | `artifact_dir` (provided or auto-generated `.prizmkit/specs/###-slug/`) | `spec.md` + `plan.md` |
@@ -0,0 +1,115 @@
1
+ # Plan: [TITLE]
2
+
3
+ ## Change Approach
4
+ [Description of the technical approach — how these changes integrate with the existing system]
5
+
6
+ ## Component Design
7
+
8
+ ### New Components
9
+ - [Component]: [Purpose]
10
+
11
+ ### Modified Components
12
+ - [Component]: [What changes and why]
13
+
14
+ ## Behavior Preservation Strategy
15
+ <!-- Include when the task modifies existing behavior. Delete if not applicable (e.g., greenfield feature). -->
16
+ <!-- Strategy: one of test-gate / snapshot / manual -->
17
+ <!-- test-gate: all tests must pass after each task -->
18
+ <!-- snapshot: before-after comparison of outputs -->
19
+ <!-- manual: reviewer verification at checkpoints -->
20
+ - Strategy: [test-gate / snapshot / manual]
21
+ - Baseline: [describe green test suite or snapshot state]
22
+
23
+ ## Data Model
24
+ <!-- Include when changes involve database / data persistence. Delete if not applicable. -->
25
+ <!-- IMPORTANT: Read existing schema/model files BEFORE designing new tables -->
26
+
27
+ ### Existing Schema Audit
28
+ <!-- List existing tables/models reviewed. Note observed conventions. -->
29
+ - Tables reviewed: [list tables examined]
30
+ - Naming convention: [snake_case/camelCase — document what existing schema uses]
31
+ - ID strategy: [UUID/auto-increment/CUID — match existing]
32
+ - Timestamp fields: [created_at/updated_at pattern — match existing]
33
+ - Soft delete: [yes/no, field name if applicable]
34
+ - Constraint patterns: [NOT NULL defaults, UNIQUE patterns, index conventions]
35
+
36
+ ### Schema Changes
37
+ | Entity | Type | Fields | Constraints | Relationships | Migration Notes |
38
+ |--------|------|--------|-------------|---------------|-----------------|
39
+ | [name] | new/modify | [field: type, ...] | [NOT NULL, UNIQUE, INDEX, ...] | [FK → existing_table(id)] | [migration strategy] |
40
+
41
+ ### Style Conformance Checklist
42
+ - [ ] Table/column naming matches existing conventions
43
+ - [ ] ID strategy consistent with existing tables
44
+ - [ ] Timestamp fields follow existing patterns
45
+ - [ ] Foreign key constraints and indexes defined
46
+ - [ ] Soft delete strategy matches existing pattern (if applicable)
47
+ - [ ] All fields have explicit nullability (NOT NULL or nullable)
48
+
49
+ ### Unresolved Questions
50
+ <!-- NONE — all DB design questions must be resolved inline before proceeding to Tasks -->
51
+
52
+ ## Interface Design
53
+ [API endpoints, request/response formats, module interfaces — include all details here]
54
+
55
+ ## Integration Points
56
+ - [Service/Module]: [How integrated]
57
+
58
+ ## Testing Strategy
59
+ - Unit: [Approach]
60
+ - Integration: [Approach]
61
+ - E2E: [Approach]
62
+
63
+ ## Risk Assessment
64
+ | Risk | Impact | Mitigation |
65
+ |------|--------|------------|
66
+ | [Risk] | [H/M/L] | [Plan] |
67
+
68
+ ## Deployment Considerations
69
+ <!-- Include when there is deployment impact (new services, infra, environment changes). Delete if not applicable. -->
70
+
71
+ ### New Infrastructure Requirements
72
+ - [Component]: [Deployment target from config deploy_strategy] — [any special config needed]
73
+
74
+ ### New Environment Variables
75
+ | Variable | Required | Description | Example |
76
+ |----------|----------|-------------|---------|
77
+ | [VAR_NAME] | yes/no | [Purpose] | [example value] |
78
+
79
+ ### Deployment Impact
80
+ - [ ] No infrastructure changes needed (skip this section)
81
+ - [ ] New service/container required
82
+ - [ ] New environment variables added
83
+ - [ ] Database migration required in production
84
+ - [ ] CI/CD pipeline update needed
85
+
86
+ ## Pre-Implementation Gates
87
+ - [ ] Spec coverage: all goals mapped to components
88
+ - [ ] Data model reviewed — existing schema conventions documented and followed (if applicable)
89
+ - [ ] All `[NEEDS CLARIFICATION]` items resolved
90
+ - [ ] Testing approach agreed
91
+ - [ ] Behavior preservation strategy defined (if modifying existing behavior)
92
+ - [ ] Root cause confirmed with reproduction test design (if fixing a defect)
93
+
94
+ ## Tasks
95
+
96
+ ### Strategy: [MVP-first | Incremental | Parallel]
97
+
98
+ ### Phase: Setup
99
+ - [ ] [T-001] [Description] — file: [path]
100
+
101
+ ### Phase: Foundation
102
+ - [ ] [T-010] [Description] — file: [path]
103
+
104
+ ### Phase: Core
105
+ <!-- Organize by goals (G-1, G-2, ...) or by logical grouping appropriate to the task -->
106
+ - [ ] [T-100] [P] [G-1] [Task description] — file: [path]
107
+
108
+ ### Phase: Polish
109
+ - [ ] [T-900] Final verification
110
+ - [ ] [T-901] Documentation update
111
+
112
+ ### Checkpoints
113
+ - [ ] [CP-1] After Setup: project builds and tests pass
114
+ - [ ] [CP-2] After Foundation: base changes verified
115
+ - [ ] [CP-3] After each Core group: acceptance criteria pass
@@ -0,0 +1,73 @@
1
+ # [TITLE]
2
+
3
+ ## Overview
4
+ [One paragraph describing the purpose and motivation]
5
+
6
+ ## Goals
7
+
8
+ ### G-1: [Goal Title]
9
+ [Goal description — use whatever format best suits the task:
10
+ - User Story format: "As a [role], I want [capability], so that [benefit]."
11
+ - Objective format: "Objective: [change to make]. Target state: [desired outcome]."
12
+ - Fix format: "Fix: [symptom]. Root cause: [brief cause]."
13
+ - Or any other clear format.]
14
+
15
+ **Acceptance Criteria:**
16
+ - [ ] [Criterion 1 — Given/When/Then, or a concrete verifiable statement]
17
+
18
+ ## Scope
19
+
20
+ ### In Scope
21
+ - [Item 1]
22
+
23
+ ### Out of Scope
24
+ - [Item 1]
25
+
26
+ ## Behavior Preservation
27
+ <!-- Include this section when the task modifies existing behavior (refactoring, bug fixes, migrations, etc.). Delete if not applicable. -->
28
+ - [What behavior / contracts / interfaces must remain unchanged]
29
+ - [Existing test suites that must continue to pass]
30
+
31
+ ## Root Cause
32
+ <!-- Include this section when the task is fixing a defect. Delete if not applicable. -->
33
+ - Error classification: [Runtime / Network / Auth / Data / Logic / Config / External]
34
+ - Root cause: [specific code location and mechanism]
35
+ - Affected files: [file list with line numbers]
36
+ - Impact: [blast radius — which modules / features are affected]
37
+
38
+ ## Dependencies
39
+ - [Dependency 1]: [Why needed]
40
+
41
+ ## Data Model
42
+ <!-- Include this section when changes involve database / data persistence. Delete if not applicable. -->
43
+
44
+ ### Existing Schema Reference
45
+ <!-- Read existing schema/model files BEFORE designing new tables. Document observed conventions here. -->
46
+ - Tables reviewed: [list existing tables related to this change]
47
+ - Naming convention: [snake_case/camelCase — match existing]
48
+ - ID strategy: [UUID/auto-increment — match existing]
49
+ - Timestamp pattern: [created_at/updated_at — match existing]
50
+ - Soft delete: [yes/no, field name — match existing]
51
+
52
+ ### New/Modified Entities
53
+ | Entity | Type (new/modify) | Key Fields | Relationships | Constraints |
54
+ |--------|-------------------|------------|---------------|-------------|
55
+ | [entity_name] | new | [field: type] | [FK to existing_table] | [NOT NULL, UNIQUE, etc.] |
56
+
57
+ ### Open Data Model Questions
58
+ <!-- All questions here MUST be resolved before /prizmkit-plan generates Tasks -->
59
+ - [NEEDS CLARIFICATION] [Any uncertain data model decisions — field types, nullability, relationships]
60
+
61
+ ## Constraints
62
+ - [Constraint 1]
63
+
64
+ ## Clarifications
65
+ [NEEDS CLARIFICATION]: [Ambiguous item]
66
+
67
+ ## Review Checklist
68
+ - [ ] All goals have acceptance criteria
69
+ - [ ] Scope boundaries are clearly defined
70
+ - [ ] Dependencies are identified
71
+ - [ ] No implementation details (WHAT not HOW)
72
+ - [ ] Behavior preservation defined (if modifying existing behavior)
73
+ - [ ] Root cause identified with evidence (if fixing a defect)
@@ -0,0 +1,67 @@
1
+ # Clarification Phase — Execution Guide
2
+
3
+ Invoked automatically during `/prizmkit-plan` Phase 0 (specify) when `[NEEDS CLARIFICATION]` markers exist, or during Phase 1 (design) when data model ambiguities arise.
4
+
5
+ ---
6
+
7
+ ## Question Strategy
8
+
9
+ **Ask one question at a time.** Batching questions produces lower-quality answers.
10
+
11
+ For each question:
12
+ 1. Cite the exact location in spec.md (e.g., "§Goals G-1 says..." or "§Scope says...")
13
+ 2. State what is ambiguous and why it matters for implementation
14
+ 3. Provide a **recommended answer** with rationale — gives the user a concrete starting point to accept, modify, or reject
15
+
16
+ **Prioritize by implementation impact** (highest first):
17
+ 1. Data model (entities, relationships, field types, constraints, naming) — **hardest to change after code is written**
18
+ 2. Functional scope boundaries
19
+ 3. UX flow and error handling
20
+ 4. Non-functional requirements (performance, security)
21
+ 5. Edge cases and integration points
22
+
23
+ ## Update Discipline
24
+
25
+ After **each** user answer:
26
+ - Immediately update `spec.md` (do not batch at the end)
27
+ - Remove the resolved `[NEEDS CLARIFICATION]` marker
28
+ - Re-evaluate for new ambiguities exposed by the answer
29
+
30
+ ## No Limits Policy
31
+
32
+ **There is no cap on rounds or questions.** Keep asking until:
33
+ - All `[NEEDS CLARIFICATION]` markers are removed, AND
34
+ - No vague or underspecified areas remain, AND
35
+ - You are fully confident about the requirements
36
+
37
+ If the user's answer raises new questions — ask those too. If a previously-resolved item needs revisiting due to new context — go back.
38
+
39
+ ## Early Termination
40
+
41
+ If the user says "done", "stop", or "enough" — end immediately and output a summary of:
42
+ - What was resolved
43
+ - What remains unclear (list any open `[NEEDS CLARIFICATION]` items)
44
+
45
+ ## Example Exchange
46
+
47
+ **Question:**
48
+ > §Goals G-1 says "User can upload files" but doesn't specify file types or size limits.
49
+ >
50
+ > **Recommended:** Accept JPEG, PNG, PDF up to 10MB — covers common use cases without straining storage.
51
+ >
52
+ > Do you agree, or different constraints?
53
+
54
+ **User:** "Also allow SVG, make it 25MB"
55
+
56
+ **Action:** Update spec.md §Goals G-1 → `File upload: JPEG, PNG, PDF, SVG. Max 25MB per file.` Remove marker.
57
+
58
+ **Follow-up question triggered by answer:**
59
+ > SVGs can contain embedded scripts (XSS risk). Should uploaded SVGs be sanitized (strip `<script>` + event handlers), or restricted to trusted users only?
60
+ >
61
+ > **Recommended:** Sanitize all SVG uploads — allows all users to upload safely.
62
+
63
+ ## Guidelines
64
+
65
+ - Stay at WHAT/WHY level — no implementation details (HOW) in spec
66
+ - If an answer contradicts an existing requirement, surface the conflict and ask which takes precedence
67
+ - If the user seems fatigued: "I have N more questions — continue now or later?" — but never silently stop with unresolved ambiguities