prizmkit 1.1.53 → 1.1.55
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.
- package/bin/create-prizmkit.js +2 -0
- package/bundled/VERSION.json +3 -3
- package/bundled/rules/_rules-metadata.json +6 -1
- package/bundled/rules/general/cohesive-modeling.md +27 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +114 -4
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +609 -0
- package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +285 -0
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +249 -0
- package/bundled/skills/app-planner/references/rules/backend/template.md +173 -0
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +373 -0
- package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +211 -0
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +184 -0
- package/bundled/skills/app-planner/references/rules/database/template.md +158 -0
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +810 -0
- package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +188 -0
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +302 -0
- package/bundled/skills/app-planner/references/rules/frontend/template.md +320 -0
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +639 -0
- package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +290 -0
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +232 -0
- package/bundled/skills/app-planner/references/rules/mobile/template.md +175 -0
- package/bundled/skills/prizm-kit/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/SKILL.md +47 -6
- package/bundled/skills/prizmkit-init/references/config-schema.md +7 -3
- package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +41 -0
- package/package.json +1 -1
- package/src/index.js +10 -0
- package/src/scaffold.js +124 -7
package/bin/create-prizmkit.js
CHANGED
|
@@ -41,6 +41,8 @@ program
|
|
|
41
41
|
.option('--no-playwright-cli', 'Disable playwright-cli installation')
|
|
42
42
|
.option('--open-cli', 'Install opencli browser tool (default: true)')
|
|
43
43
|
.option('--no-open-cli', 'Disable opencli installation')
|
|
44
|
+
.option('--open-cli-auto-download', 'Auto-download opencli extension if missing (default: true)')
|
|
45
|
+
.option('--no-open-cli-auto-download', 'Skip auto-download, show manual steps only')
|
|
44
46
|
.option('--rules <preset>', 'Rules preset: recommended, minimal, or none', 'recommended')
|
|
45
47
|
.option('--ai-cli <command>', 'AI CLI executable command (e.g. cbc, claude, claude-internal)')
|
|
46
48
|
.option('--external-skills <names>', 'Comma-separated external skill names to install (e.g. find-skills,impeccable)')
|
package/bundled/VERSION.json
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"general/prefer-linux-commands": {
|
|
17
17
|
"description": "Prefer Linux/Unix shell commands",
|
|
18
18
|
"tags": ["general", "shell"]
|
|
19
|
+
},
|
|
20
|
+
"general/cohesive-modeling": {
|
|
21
|
+
"description": "Group co-occurring variables/fields/concepts into a cohesive unit (struct/class/interface)",
|
|
22
|
+
"tags": ["general", "design"]
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"presets": {
|
|
@@ -25,7 +29,8 @@
|
|
|
25
29
|
"prizm/prizm-documentation",
|
|
26
30
|
"prizm/prizm-commit-workflow",
|
|
27
31
|
"prizm/prizm-progressive-loading",
|
|
28
|
-
"general/prefer-linux-commands"
|
|
32
|
+
"general/prefer-linux-commands",
|
|
33
|
+
"general/cohesive-modeling"
|
|
29
34
|
]
|
|
30
35
|
},
|
|
31
36
|
"minimal": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "将总是同时出现的变量/字段/概念建模为高内聚的整体,而非散落碎片"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
在设计或理解任何系统时,如果一组变量、字段、概念总是同时出现、表达同一个语义单元,就应该把它们规划成一个整体,而不是散落为独立的碎片:
|
|
6
|
+
|
|
7
|
+
- **Go** — 定义 struct
|
|
8
|
+
- **Java/Python** — 定义 class
|
|
9
|
+
- **TypeScript** — 定义 interface/type
|
|
10
|
+
- **配置** — 归入嵌套配置块
|
|
11
|
+
- **模块划分** — 拆为独立模块
|
|
12
|
+
|
|
13
|
+
本质是同一个原则:**高内聚的东西,在建模那一刻就应该是一个东西。**
|
|
14
|
+
|
|
15
|
+
## 触发场景
|
|
16
|
+
|
|
17
|
+
1. 同一个函数/方法的参数列表中,某几个参数始终一起传递 → 抽取为参数对象
|
|
18
|
+
2. 多个变量总是被一起赋值、一起传递、一起返回 → 合并为结构体/类
|
|
19
|
+
3. 配置文件中一组键总是成对/成群出现 → 合并为嵌套配置块
|
|
20
|
+
4. 发现自己在不同文件里重复声明相同的一组字段 → 提取为公共类型/接口
|
|
21
|
+
5. 修改一个值就必须同步修改另一个值 → 它们属于同一个不变量,应封装在一起
|
|
22
|
+
|
|
23
|
+
## 反面模式(应避免)
|
|
24
|
+
|
|
25
|
+
- 基本类型偏执(Primitive Obsession):用散落的 string/number 代替有意义的类型
|
|
26
|
+
- 数据泥团(Data Clumps):相同的一组数据在参数列表、返回值、变量声明中反复出现
|
|
27
|
+
- 霰弹式修改(Shotgun Surgery):加一个字段需要改 N 个文件的函数签名
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "app-planner"
|
|
3
|
-
description: "Plan an application through interactive conversation — capture vision, tech stack, constraints, and project brief. Works for both new (greenfield) and existing (brownfield) projects that need app-level planning. Use this skill when users say 'plan an app', 'design a new project', 'start from scratch', 'build a new application', or discuss app-level architecture and design. Also use for existing projects that need a project brief or app-level context. For adding features to existing projects that already have a project brief, use feature-planner instead."
|
|
3
|
+
description: "Plan an application through interactive conversation — capture vision, tech stack, constraints, dev rules, and project brief. Works for both new (greenfield) and existing (brownfield) projects that need app-level planning. Also use for configuring per-layer development rules (frontend/backend/database/mobile) that AI coding assistants should follow. Use this skill when users say 'plan an app', 'design a new project', 'start from scratch', 'build a new application', 'set up dev rules', 'configure frontend rules', 'configure backend rules', or discuss app-level architecture and design. Also use for existing projects that need a project brief or app-level context. For adding features to existing projects that already have a project brief, use feature-planner instead."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# app planner
|
|
@@ -29,7 +29,7 @@ If you believe the task is better suited for a different workflow, you MUST:
|
|
|
29
29
|
|
|
30
30
|
**This skill is PLANNING ONLY.** You must NEVER:
|
|
31
31
|
- Create, modify, or delete source code files (*.js, *.ts, *.py, *.go, *.html, *.css, etc.)
|
|
32
|
-
- Create project scaffolding, directories, or boilerplate
|
|
32
|
+
- Create project scaffolding, directories, or boilerplate (exception: `.prizmkit/rules/` and `.prizmkit/prizm-docs/` directories may be created for dev rules and root.prizm output)
|
|
33
33
|
- Run build/install/test commands (npm init, pip install, etc.)
|
|
34
34
|
- Execute any implementation action beyond writing planning artifacts
|
|
35
35
|
|
|
@@ -37,6 +37,8 @@ If you believe the task is better suited for a different workflow, you MUST:
|
|
|
37
37
|
1. `.prizmkit/plans/project-brief.md` (`.prizmkit/plans/` — accumulated project context brief)
|
|
38
38
|
2. Project conventions and architecture decisions appended to `CLAUDE.md` / `CODEBUDDY.md` (with user consent)
|
|
39
39
|
3. Infrastructure configuration (database conventions, deployment config, **cloud services**) appended to `CLAUDE.md` / `CODEBUDDY.md` `### Infrastructure` section
|
|
40
|
+
4. `.prizmkit/rules/<layer>-rules.md` — per-layer development rules generated by Rules Configuration
|
|
41
|
+
5. `.prizmkit/prizm-docs/root.prizm` — `RULES:` pointer line only (not other root.prizm content; created minimally if absent)
|
|
40
42
|
|
|
41
43
|
**After planning is complete**, you MUST:
|
|
42
44
|
1. Present the summary of captured project-level context (vision, conventions, architecture decisions, project brief)
|
|
@@ -128,7 +130,7 @@ Do NOT use this skill when:
|
|
|
128
130
|
|
|
129
131
|
After project conventions are captured, check `CLAUDE.md` / `CODEBUDDY.md` for `### Infrastructure` section:
|
|
130
132
|
|
|
131
|
-
- If `### Infrastructure` section does not exist → this project was not initialized with prizmkit-init's Phase 4.
|
|
133
|
+
- If `### Infrastructure` section does not exist → this project was not initialized with prizmkit-init's Phase 4.6. Treat as if both database and deployment are undecided — run full inquiry below.
|
|
132
134
|
- If `<!-- infrastructure: deferred -->` → user explicitly skipped at init time. Ask: "During project init you deferred infrastructure decisions. Would you like to configure them now?" (options: "Yes — configure now (Recommended)", "Skip — decide later")
|
|
133
135
|
- If `<!-- database: deferred -->` → only database was deferred, run database inquiry only
|
|
134
136
|
- If `<!-- deployment: deferred -->` or deployment section is missing → run deployment inquiry only
|
|
@@ -232,6 +234,112 @@ Do NOT use this skill when:
|
|
|
232
234
|
→ Read `${SKILL_DIR}/references/project-brief-guide.md` for template and rules
|
|
233
235
|
→ Update after each meaningful user response containing business intent, constraints, or design decisions
|
|
234
236
|
|
|
237
|
+
## Rules Configuration (after Infrastructure)
|
|
238
|
+
|
|
239
|
+
After Infrastructure configuration is complete (CP-AP-1.5), check whether the project's development layers have custom rules configured. Rules are per-layer documents (frontend-rules.md, backend-rules.md, database-rules.md, mobile-rules.md) that tell AI coding assistants how to generate code for that layer — UI framework, state management, naming conventions, etc.
|
|
240
|
+
|
|
241
|
+
Rules are optional. If the user skips, AI uses general best practices freely — no reminders, no blocking.
|
|
242
|
+
|
|
243
|
+
### Step 1: Detect missing rules
|
|
244
|
+
|
|
245
|
+
1. Read `.prizmkit/config.json` to get `detected_layers` (written by `prizmkit-init` Phase 4.5).
|
|
246
|
+
- If `detected_layers` field is absent or empty → skip this entire section, proceed to Prerequisites.
|
|
247
|
+
2. For each layer in `detected_layers`, check if `.prizmkit/rules/<layer>-rules.md` exists:
|
|
248
|
+
- `frontend` → `.prizmkit/rules/frontend-rules.md`
|
|
249
|
+
- `backend` → `.prizmkit/rules/backend-rules.md`
|
|
250
|
+
- `database` → `.prizmkit/rules/database-rules.md`
|
|
251
|
+
- `mobile` → `.prizmkit/rules/mobile-rules.md`
|
|
252
|
+
3. Display status:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
Rules Status Check:
|
|
256
|
+
[missing] frontend-rules.md — frontend code detected, no rules configured
|
|
257
|
+
[exists] backend-rules.md — already configured
|
|
258
|
+
[missing] database-rules.md — database interaction detected, no rules configured
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
4. If all detected layers already have rules → skip to Prerequisites.
|
|
262
|
+
5. If missing rules found, proceed to Step 2.
|
|
263
|
+
|
|
264
|
+
### Step 2: Ask configuration mode
|
|
265
|
+
|
|
266
|
+
Use `AskUserQuestion`:
|
|
267
|
+
|
|
268
|
+
**Question**: "{N} layer(s) without custom dev rules. How would you like to configure?"
|
|
269
|
+
- **Quick setup (only core decisions, rest use recommended defaults)** — covers essential architecture, core technology decisions, and testing questions specific to each layer. Detailed configuration topics (design-system, i18n, performance tuning, deployment details, AI constraints) adopt recommended defaults. See Step 4 for exact per-layer coverage.
|
|
270
|
+
- **Full setup (customize every detail)** — 15-25 questions per layer
|
|
271
|
+
- **Skip — no custom rules needed**
|
|
272
|
+
|
|
273
|
+
If user picks "Skip" → proceed to Prerequisites.
|
|
274
|
+
|
|
275
|
+
### Step 3: Select layers to configure
|
|
276
|
+
|
|
277
|
+
Use `AskUserQuestion` (multiSelect):
|
|
278
|
+
|
|
279
|
+
**Question**: "Which layers do you want to configure?"
|
|
280
|
+
- Options: the missing layers from Step 1, each with a brief description
|
|
281
|
+
- All pre-selected by default
|
|
282
|
+
|
|
283
|
+
### Step 4: Configure each selected layer
|
|
284
|
+
|
|
285
|
+
For each selected layer, run the rules Q&A workflow. This follows the 4-phase rule generation pattern:
|
|
286
|
+
|
|
287
|
+
**Phase A — Load layer resources:**
|
|
288
|
+
- Read `${SKILL_DIR}/references/rules/<layer>/fixed-rules.md` — industry-consensus rules injected without asking
|
|
289
|
+
- Read `${SKILL_DIR}/references/rules/<layer>/question-bank.md` — interactive questions organized in groups (G1→G10)
|
|
290
|
+
|
|
291
|
+
**Phase B — Interactive Q&A:**
|
|
292
|
+
- Ask questions one group at a time (max 3 questions per message), as defined in question-bank.md
|
|
293
|
+
- Each question shows a "Recommended" option to reduce decision cost
|
|
294
|
+
- **Quick mode**: ask only the following groups per layer. All other groups adopt recommended defaults silently.
|
|
295
|
+
- **Frontend**: G1 (Tech Stack), G2 (Styling), G3 (State & Data Fetching), G7 (Testing & Quality). Skip: G4 (Design System), G5 (Responsive), G6 (i18n), G8 (AI Vibecoding), G9 (Performance).
|
|
296
|
+
- **Backend**: G1 (Language & Runtime), G2 (Framework & Architecture), G3 (API Style), G4 (Data Layer), G7 (Testing & Quality). Skip: G5 (Auth), G6 (Infrastructure), G8 (Observability), G9 (AI Constraints).
|
|
297
|
+
- **Database**: G1 (Database Selection), G2 (Data Modeling), G3 (Migration), G7 (AI Constraints). Skip: G4 (Index & Performance), G5 (Security & Compliance), G6 (High Availability & Ops).
|
|
298
|
+
- **Mobile**: G1 (Platform & Language), G2 (Architecture), G3 (UI Framework), G4 (Navigation & State), G7 (Testing). Skip: G5 (Networking & Data), G6 (Platform Features), G8 (App Distribution), G9 (Performance & Accessibility), G10 (AI Constraints).
|
|
299
|
+
- **Full mode**: ask all groups in order (G1→G9 for frontend/backend, G1→G7 for database, G1→G10 for mobile)
|
|
300
|
+
- Shortcut commands work at any point:
|
|
301
|
+
- `recommended` / `default` → adopt all recommended for current group
|
|
302
|
+
- `all recommended` → adopt all recommended for all remaining groups
|
|
303
|
+
- `skip` → mark current group as "Not required at this stage"
|
|
304
|
+
- Record answers in memory after each group.
|
|
305
|
+
|
|
306
|
+
**Phase C — Auto-derivation:**
|
|
307
|
+
- Read `${SKILL_DIR}/references/rules/<layer>/derivation-rules.md`
|
|
308
|
+
- Match user answers against the trigger map using keyword matching
|
|
309
|
+
- Derive platform-specific rules without asking the user (e.g., choosing Flutter → auto-inject Flutter widget/persistence/navigation rules)
|
|
310
|
+
|
|
311
|
+
**Phase D — Render and write:**
|
|
312
|
+
- Read `${SKILL_DIR}/references/rules/<layer>/template.md`
|
|
313
|
+
- Fill all template placeholders with accumulated content from Phases A+B+C
|
|
314
|
+
- **Post-render self-check**: scan for residual `{{ ` or ` }}` — count must be 0 before writing
|
|
315
|
+
- Generate Appendix A (Deny List) and Appendix B (Recommended Tools) per template instructions
|
|
316
|
+
- Create `.prizmkit/rules/` directory if it doesn't exist
|
|
317
|
+
- Write `.prizmkit/rules/<layer>-rules.md`
|
|
318
|
+
|
|
319
|
+
### Step 5: Update root.prizm
|
|
320
|
+
|
|
321
|
+
After all selected layers are configured:
|
|
322
|
+
1. Check if `.prizmkit/prizm-docs/root.prizm` exists.
|
|
323
|
+
2. **If root.prizm exists**:
|
|
324
|
+
- Read the file.
|
|
325
|
+
- Check if `RULES:` line exists:
|
|
326
|
+
- If present: append new rules file paths to the existing line.
|
|
327
|
+
- If absent: add `RULES: .prizmkit/rules/<layer>-rules.md, ...` at the end (after PROJECT_BRIEF line).
|
|
328
|
+
3. **If root.prizm does not exist** (e.g., project without prizm-docs init):
|
|
329
|
+
- Create a minimal `root.prizm` with:
|
|
330
|
+
```
|
|
331
|
+
PRIZM_VERSION: 2
|
|
332
|
+
PROJECT: <name> — from package.json name, directory name, or git repo name
|
|
333
|
+
MODULE_INDEX:
|
|
334
|
+
RULES: .prizmkit/rules/<layer>-rules.md, ...
|
|
335
|
+
```
|
|
336
|
+
- The file will be expanded when the project later runs `prizmkit-prizm-docs init`.
|
|
337
|
+
4. The RULES pointer tells every AI session where to find custom dev rules — AI reads rules via this pointer on session start
|
|
338
|
+
|
|
339
|
+
### After rules configuration
|
|
340
|
+
|
|
341
|
+
Proceed to Prerequisites and continue the app-planner workflow.
|
|
342
|
+
|
|
235
343
|
## Prerequisites
|
|
236
344
|
|
|
237
345
|
Before questions, check optional context files (never block if absent):
|
|
@@ -421,6 +529,7 @@ Checkpoints catch cascading errors early — skipping one means the next phase b
|
|
|
421
529
|
| **CP-AP-0** | Intent Confirmed | User confirmed session goal (produce / explore) | 1 |
|
|
422
530
|
| **CP-AP-1** | Conventions Checked | Project conventions loaded or asked; `### Project Conventions` section in `CLAUDE.md` / `CODEBUDDY.md` up to date | 1 |
|
|
423
531
|
| **CP-AP-1.5** | Infrastructure Checked | Infrastructure config loaded or asked; `### Infrastructure` section in `CLAUDE.md` / `CODEBUDDY.md` addressed — database, deployment **and cloud services** each configured or explicitly deferred | 1-2 |
|
|
532
|
+
| **CP-AP-1.6** | Rules Configured | For each layer in `detected_layers`, rules file exists in `.prizmkit/rules/` or user explicitly skipped. `root.prizm` `RULES:` pointer up-to-date. | 2 |
|
|
424
533
|
| **CP-AP-2** | Vision Summary | Goal/users/differentiators confirmed by user. For brownfield: existing purpose confirmed or refined. | 1-2 |
|
|
425
534
|
| **CP-AP-3** | Frontend Design Evaluated | For frontend projects: checked for existing UI/UX design system; user was asked if missing. **Auto-pass** for backend-only or non-UI projects. | 2 |
|
|
426
535
|
| **CP-AP-4** | Project Brief Accumulated | `.prizmkit/plans/project-brief.md` exists at `.prizmkit/plans/` with at least 3 ideas listed. For brownfield: already-implemented items marked `[x]` count toward this total. | 3 |
|
|
@@ -433,7 +542,7 @@ After Phase 2, if framework-shaping architecture decisions emerged during planni
|
|
|
433
542
|
**How it works**:
|
|
434
543
|
1. If decisions are captured → append to `CLAUDE.md` / `CODEBUDDY.md` under `### Architecture Decisions` section
|
|
435
544
|
2. Downstream skills (feature-planner, prizmkit-plan, etc.) read `CLAUDE.md` / `CODEBUDDY.md` as standard context, so they automatically receive these decisions
|
|
436
|
-
3. Do NOT write directly to `.prizmkit/prizm-docs/root.prizm` — that file is maintained by `prizmkit-prizm-docs` and `prizmkit-retrospective`. If the project needs `.prizmkit/prizm-docs/`, recommend the user run `prizmkit-prizm-docs` init after planning.
|
|
545
|
+
3. Do NOT write architecture decision content directly to `.prizmkit/prizm-docs/root.prizm` — that file is maintained by `prizmkit-prizm-docs` and `prizmkit-retrospective`. (The `RULES:` pointer line is managed by Rules Configuration, not by this section.) If the project needs `.prizmkit/prizm-docs/`, recommend the user run `prizmkit-prizm-docs` init after planning.
|
|
437
546
|
|
|
438
547
|
## Project Brief Accumulation
|
|
439
548
|
|
|
@@ -469,6 +578,7 @@ After all checkpoints pass, present a summary and end the session:
|
|
|
469
578
|
- Infrastructure config → `CLAUDE.md` / `CODEBUDDY.md` `### Infrastructure` (database conventions + deployment config)
|
|
470
579
|
- Tech stack → `.prizmkit/config.json`
|
|
471
580
|
- Architecture decisions (if any) → `CLAUDE.md` / `CODEBUDDY.md` `### Architecture Decisions`
|
|
581
|
+
- Dev rules (if configured) → `.prizmkit/rules/<layer>-rules.md` (with `root.prizm` `RULES:` pointer)
|
|
472
582
|
- Project brief → `.prizmkit/plans/project-brief.md`
|
|
473
583
|
|
|
474
584
|
2. **Suggest possible next steps** (as text, NOT auto-invoked):
|