@guru-ai-product/ai-product-kit 0.1.251112172507
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/README.md +107 -0
- package/bin/setup.js +89 -0
- package/package.json +24 -0
- package/skills/aipk_design/GURU_AI.md +10 -0
- package/skills/aipk_design/SKILL.md +33 -0
- package/skills/aipk_design/auto_panel_splitter/SKILL.md +360 -0
- package/skills/aipk_design/auto_panel_splitter/scripts/auto_panel_splitter.js +399 -0
- package/skills/aipk_design/auto_panel_splitter/scripts/panel_asset_mapper.js +445 -0
- package/skills/aipk_development/GURU_AI.md +8 -0
- package/skills/aipk_development/SKILL.md +20 -0
- package/skills/aipk_development/templates//345/256/236/346/226/275/350/256/241/345/210/222/346/226/207/346/241/243.md +302 -0
- package/skills/aipk_init_project/SKILL.md +188 -0
- package/skills/aipk_init_project/scripts/check_agents.sh +55 -0
- package/skills/aipk_init_project/template/AGENTS_TEMPLATE.md +138 -0
- package/skills/aipk_operations/GURU_AI.md +10 -0
- package/skills/aipk_operations/SKILL.md +37 -0
- package/skills/aipk_operations/aso_new_release/SKILL.md +84 -0
- package/skills/aipk_operations/aso_new_release/references/aso-update-notes-prompt.md +196 -0
- package/skills/aipk_operations/aso_new_release/references/aso-update-notes-template.md +162 -0
- package/skills/aipk_requirements/GURU_AI.md +39 -0
- package/skills/aipk_requirements/SKILL.md +243 -0
- package/skills/aipk_requirements/changes/SKILL.md +196 -0
- package/skills/aipk_requirements/changes/template/index.md +30 -0
- package/skills/aipk_requirements/changes/template//351/234/200/346/261/202/345/217/230/345/212/250/350/257/264/346/230/216/346/226/207/346/241/243/346/250/241/346/235/277.md +576 -0
- package/skills/aipk_requirements/changes/template//351/234/200/346/261/202/345/217/230/345/212/250/350/257/264/346/230/216/347/224/237/346/210/220Prompt.md +349 -0
- package/skills/aipk_requirements/changes/template//351/234/200/346/261/202/345/217/230/345/212/250/350/257/264/346/230/216/347/224/237/346/210/220/346/214/207/345/215/227.md +292 -0
- package/skills/aipk_requirements/documentation/SKILL.md +930 -0
- package/skills/aipk_requirements/documentation/template/1_/344/272/247/345/223/201/345/256/232/344/275/215/344/270/216/345/210/206/346/236/220.md +86 -0
- package/skills/aipk_requirements/documentation/template/2_/345/212/237/350/203/275/351/234/200/346/261/202.md +67 -0
- package/skills/aipk_requirements/documentation/template/3_/345/225/206/344/270/232/345/214/226/347/255/226/347/225/245.md +131 -0
- package/skills/aipk_requirements/documentation/template/4_/347/224/250/346/210/267/347/225/214/351/235/242/344/270/216/344/275/223/351/252/214.md +665 -0
- package/skills/aipk_requirements/documentation/template/AI /345/272/224/347/224/250/347/261/273APP/351/200/232/347/224/250/345/237/213/347/202/271/346/226/207/346/241/243.xlsx +0 -0
- package/skills/aipk_requirements/documentation/template/Draft_/344/272/247/345/223/201/351/234/200/346/261/202/350/215/211/347/250/277.md +60 -0
- package/skills/aipk_requirements/documentation/template/Draft_/347/224/250/346/210/267/346/227/205/347/250/213/350/215/211/347/250/277.md +84 -0
- package/skills/aipk_requirements/documentation/template/index.md +83 -0
- package/skills/aipk_requirements/documentation/template//345/237/213/347/202/271/350/247/204/350/214/203/346/226/207/346/241/243.md +372 -0
- package/skills/aipk_requirements/documentation/template//351/234/200/346/261/202/350/277/255/344/273/243/346/250/241/346/235/277.md +821 -0
- package/skills/aipk_requirements/documentation/template//351/234/200/346/261/202/350/277/255/344/273/243/347/264/242/345/274/225.md +30 -0
- package/skills/aipk_requirements/initiative_planning/SKILL.md +407 -0
- package/skills/aipk_requirements/initiative_planning/template/SWOT/345/210/206/346/236/220/346/250/241/346/235/277.md +381 -0
- package/skills/aipk_requirements/initiative_planning/template//344/272/247/345/223/201/350/247/204/345/210/222/346/250/241/346/235/277.md +322 -0
- package/skills/aipk_requirements/initiative_planning/template//345/225/206/344/270/232/345/214/226/350/247/204/345/210/222/346/250/241/346/235/277.md +201 -0
- package/skills/aipk_requirements/initiative_planning/template//345/270/202/345/234/272/344/270/216/345/225/206/344/270/232/345/210/206/346/236/220/346/250/241/346/235/277.md +176 -0
- package/skills/aipk_requirements/initiative_planning/template//346/212/200/346/234/257/350/247/204/345/210/222/346/250/241/346/235/277.md +314 -0
- package/skills/aipk_requirements/intake/SKILL.md +260 -0
- package/skills/aipk_requirements/intake/examples/K12/346/225/260/345/255/246/345/255/246/344/271/240/345/272/224/347/224/250/346/241/210/344/276/213.md +371 -0
- package/skills/aipk_requirements/intake/examples//347/224/265/345/225/206/345/271/263/345/217/260/344/274/230/345/214/226/346/241/210/344/276/213.md +426 -0
- package/skills/aipk_requirements/intake/references/Gemini_DeepResearch_/345/267/245/345/205/267/351/223/276/346/225/264/345/220/210/346/236/266/346/236/204/350/256/276/350/256/241.md +1272 -0
- package/skills/aipk_requirements/intake/template//344/272/247/345/223/201/351/234/200/346/261/202/345/217/221/347/216/260/344/270/216/351/252/214/350/257/201/346/250/241/346/235/277.md +53 -0
- package/skills/aipk_requirements/intake/template//345/270/202/345/234/272/346/234/272/344/274/232/350/257/204/344/274/260/344/270/216/347/253/236/344/272/211/345/210/206/346/236/220/346/250/241/346/235/277.md +53 -0
- package/skills/aipk_requirements/intake/template//346/212/200/346/234/257/346/226/271/346/241/210/350/257/204/344/274/260/344/270/216/345/217/257/350/241/214/346/200/247/345/210/206/346/236/220/346/250/241/346/235/277.md +72 -0
- package/skills/aipk_requirements/intake/template//346/267/261/345/272/246/347/224/250/346/210/267/350/241/214/344/270/272/344/270/216/351/234/200/346/261/202/346/264/236/345/257/237/346/250/241/346/235/277.md +59 -0
- package/skills/aipk_requirements/review/SKILL.md +218 -0
- package/skills/aipk_skill_generate/GURU_AI.md +8 -0
- package/skills/aipk_skill_generate/SKILL.md +259 -0
- package/skills/aipk_skill_generate/agent_skills_spec.md +79 -0
- package/skills/aipk_tool_prompts/AI/344/275/223/351/252/214/350/256/276/350/256/241/346/214/207/345/215/227.md +93 -0
- package/skills/aipk_tool_prompts/GURU_AI.md +13 -0
- package/skills/aipk_tool_prompts/Prompt/347/224/237/346/210/220.md +20 -0
- package/skills/aipk_tool_prompts/SKILL.md +55 -0
- package/skills/aipk_tool_prompts/images/20250710200701.png +0 -0
- package/skills/aipk_tool_prompts/images/20250710200802.png +0 -0
- package/skills/aipk_tool_prompts//346/240/207/350/256/260/346/226/207/346/241/243/346/233/264/346/226/260.md +33 -0
- package/skills/aipk_tool_prompts//347/224/237/346/210/220DrawIO/346/226/207/346/241/243.md +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# AI Product Kit
|
|
2
|
+
|
|
3
|
+
AI Product Kit is a doc-first toolkit designed for product managers and cross-functional teams, offering end-to-end guidance from discovery to launch.
|
|
4
|
+
|
|
5
|
+
Looking for the Chinese version? See `README_CN.md`.
|
|
6
|
+
|
|
7
|
+
## 📁 Repository Structure
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
ROOT/
|
|
11
|
+
├── AGENTS.md # Single source of truth for agent guardrails and workflow rules
|
|
12
|
+
├── skills/ # Canonical lifecycle Skills and reusable guides
|
|
13
|
+
│ ├── aipk_init_project/ # Project bootstrap workflow plus AGENTS enforcement scripts
|
|
14
|
+
│ ├── aipk_requirements/ # Research, requirements authoring, reviews, change management
|
|
15
|
+
│ ├── aipk_design/ # Script-driven automation (panel mapping, asset diffs, etc.)
|
|
16
|
+
│ ├── aipk_development/ # Engineering playbooks and implementation templates
|
|
17
|
+
│ ├── aipk_operations/ # Growth, launch prep, and post-launch tooling
|
|
18
|
+
│ ├── aipk_skill_generate/ # Standards for creating or extending Skills
|
|
19
|
+
│ └── aipk_tool_prompts/ # Reusable AI prompt blocks referenced by other Skills
|
|
20
|
+
├── docs/ # Legacy landing pages and shared standards referenced by Skills
|
|
21
|
+
├── mcp/ # Archived automation service source, documentation, and tests
|
|
22
|
+
├── bin/ # Distribution-ready CLI entry points (e.g., `ai-product-kit.js`)
|
|
23
|
+
├── tools/ # Release automation such as `publish-package.sh`
|
|
24
|
+
├── scripts/ # Helper utilities invoked by Skills and templates
|
|
25
|
+
├── todos/ # Working drafts and in-progress notes
|
|
26
|
+
├── test/ # Automated coverage for CLI helpers and scripts
|
|
27
|
+
└── README*.md # Repository entry points (English + Chinese)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Documentation Standards**: All documentation follows the standards defined in [`docs/guide_writing_standard/SKILL.md`](docs/guide_writing_standard/SKILL.md), covering document structure, content organization, formatting, and template writing guidelines.
|
|
31
|
+
|
|
32
|
+
## 🎯 Who This Helps
|
|
33
|
+
|
|
34
|
+
* **Product managers** – start in `skills/aipk_requirements` for market analysis, user research, and PRD templates.
|
|
35
|
+
* **Designers** – leverage `skills/aipk_design` for automated panel/asset workflows, and pair it with the requirements skills for context.
|
|
36
|
+
* **Engineers** – use `skills/aipk_development` for architecture notes and delivery checklists.
|
|
37
|
+
* **QA teams** – align with the acceptance criteria defined in `skills/aipk_requirements` and leverage `skills/aipk_development` checklists for validation.
|
|
38
|
+
* **Operators & growth** – explore `skills/aipk_operations` for launch, engagement, and optimization plans.
|
|
39
|
+
|
|
40
|
+
## 📚 Core Capabilities
|
|
41
|
+
|
|
42
|
+
* **Discovery & analysis** – market studies, user interviews, competitor reviews.
|
|
43
|
+
* **Product planning** – PRD templates, backlog framing, prioritization.
|
|
44
|
+
* **Design systems** – UI/UX principles, prompt and content guidelines.
|
|
45
|
+
* **Delivery enablement** – architecture references, API design, dev workflows.
|
|
46
|
+
* **Quality practice** – test plans, automation strategy, regression tooling.
|
|
47
|
+
* **Release & operations** – go-to-market, post-launch metrics, growth loops.
|
|
48
|
+
|
|
49
|
+
## ⚙️ Environment Requirements
|
|
50
|
+
|
|
51
|
+
- **Node.js 18+** – required to run `npx ai-product-kit@latest` from `ROOT`.
|
|
52
|
+
- **npm 9+** – provides access to the scoped package and carries your authenticated session, so the sync command can download the latest Skill bundle.
|
|
53
|
+
|
|
54
|
+
## 🛠️ Usage Guide
|
|
55
|
+
|
|
56
|
+
1. **Sync the latest Skills** from `ROOT` (call the explicit CLI so future additional binaries don’t break the command):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx ai-product-kit@latest ai-product-kit
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The command copies the newest Skill bundle (templates, scripts, and `GURU_AI.md` files) into your working tree. Rerun it whenever you pull updates or start a new branch.
|
|
63
|
+
2. **Prime your agent** by sending the following sentence after the sync completes:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
init project based on .claude/skill/int_project
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This prompt loads the init-project Skill documented in `AGENTS.md`, ensuring Codex/Cursor follows the canonical workflow every time.
|
|
70
|
+
3. **Review the synced artifacts** – open the relevant `skills/aipk_<lifecycle>/SKILL.md`, verify the bundled checklists and `GURU_AI.md` instructions match your task, and log any new deliverables in the tracker specified by `AGENTS.md` before editing documents.
|
|
71
|
+
|
|
72
|
+
Once the agent acknowledges the Skill load, continue with your usual prompts (for example, “Prepare the PRD for feature X using the AI Product Kit template.”)
|
|
73
|
+
|
|
74
|
+
## 🚀 Quick Start
|
|
75
|
+
|
|
76
|
+
Agents already know where each Skill lives because the mappings are declared in `AGENTS.md`. Use prompts like these to get moving quickly:
|
|
77
|
+
|
|
78
|
+
1.
|
|
79
|
+
```text
|
|
80
|
+
Draft a PRD for the AI-assisted recording feature using the latest AI Product Kit template.
|
|
81
|
+
```
|
|
82
|
+
2.
|
|
83
|
+
```text
|
|
84
|
+
Review the current launch checklist and tell me what’s missing for the beta cut.
|
|
85
|
+
```
|
|
86
|
+
3.
|
|
87
|
+
```text
|
|
88
|
+
Summarize the deltas between @panel_diff_v2 and the current AI Product Kit design standard, then propose fixes.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 📦 Release Guide
|
|
92
|
+
|
|
93
|
+
1. **Login to npm** – run `npm whoami` to verify the session before releasing.
|
|
94
|
+
2. **Execute the script** – from `ROOT` run:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
tools/publish-package.sh --version <version>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Optionally pass `--tag beta` or `--dry-run`; the script performs the necessary validations (auth checks, `npm pack --dry-run`, Skill sync) before publishing.
|
|
101
|
+
3. **Follow the prompts** – the script syncs Skills, runs `npm pack --dry-run`, and then publishes with `npm publish --access public`.
|
|
102
|
+
|
|
103
|
+
> Ensure you have the necessary permissions on the npm org before running the script.
|
|
104
|
+
|
|
105
|
+
## 📄 License
|
|
106
|
+
|
|
107
|
+
This project is distributed under the MIT License.
|
package/bin/setup.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
|
|
6
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
7
|
+
const bundledSkillsDir = path.join(packageRoot, 'skills');
|
|
8
|
+
|
|
9
|
+
function log(message) {
|
|
10
|
+
process.stdout.write(`[ai-product-kit] ${message}\n`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function exitWithError(message) {
|
|
14
|
+
console.error(`[ai-product-kit] ERROR: ${message}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function assertBundledSkills() {
|
|
19
|
+
if (!fs.existsSync(bundledSkillsDir)) {
|
|
20
|
+
exitWithError('Bundled skills folder is missing from the package.');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ensureClaudeSkillsDir(targetDir) {
|
|
25
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function containsGuruFile(dirPath) {
|
|
29
|
+
const stack = [dirPath];
|
|
30
|
+
while (stack.length > 0) {
|
|
31
|
+
const current = stack.pop();
|
|
32
|
+
const entries = fs.readdirSync(current, { withFileTypes: true });
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
const entryPath = path.join(current, entry.name);
|
|
35
|
+
if (entry.isFile() && entry.name === 'GURU_AI.md') {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (entry.isDirectory()) {
|
|
39
|
+
stack.push(entryPath);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function removeGuruDirectories(targetDir) {
|
|
47
|
+
if (!fs.existsSync(targetDir)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const entries = fs.readdirSync(targetDir, { withFileTypes: true });
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
if (!entry.isDirectory()) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const entryPath = path.join(targetDir, entry.name);
|
|
56
|
+
if (containsGuruFile(entryPath)) {
|
|
57
|
+
fs.rmSync(entryPath, { recursive: true, force: true });
|
|
58
|
+
log(`Removed existing skill: ${entry.name}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function copyBundledSkills(targetDir) {
|
|
64
|
+
const entries = fs.readdirSync(bundledSkillsDir, { withFileTypes: true });
|
|
65
|
+
for (const entry of entries) {
|
|
66
|
+
const srcPath = path.join(bundledSkillsDir, entry.name);
|
|
67
|
+
const destPath = path.join(targetDir, entry.name);
|
|
68
|
+
if (fs.existsSync(destPath)) {
|
|
69
|
+
fs.rmSync(destPath, { recursive: true, force: true });
|
|
70
|
+
}
|
|
71
|
+
if (entry.isDirectory()) {
|
|
72
|
+
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
73
|
+
} else {
|
|
74
|
+
fs.copyFileSync(srcPath, destPath);
|
|
75
|
+
}
|
|
76
|
+
log(`Copied skill asset: ${entry.name}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function main() {
|
|
81
|
+
assertBundledSkills();
|
|
82
|
+
const targetDir = path.join(process.cwd(), '.claude', 'skills');
|
|
83
|
+
ensureClaudeSkillsDir(targetDir);
|
|
84
|
+
removeGuruDirectories(targetDir);
|
|
85
|
+
copyBundledSkills(targetDir);
|
|
86
|
+
log('Skills directory updated.');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guru-ai-product/ai-product-kit",
|
|
3
|
+
"version": "0.1.251112172507",
|
|
4
|
+
"description": "Sync the AI Product Kit Skill bundle through npx without cloning the repository.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"ai-product-kit": "bin/setup.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"skills"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"model-context-protocol",
|
|
15
|
+
"ai-product-kit"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"sharp": "^0.33.3"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GURU AI Snapshot
|
|
2
|
+
|
|
3
|
+
Last refreshed: 2025-11-12T09:25:07.317552+00:00
|
|
4
|
+
|
|
5
|
+
| File | Last Modified (UTC) |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `SKILL.md` | 2025-11-12T07:57:23.698734+00:00 |
|
|
8
|
+
| `auto_panel_splitter/SKILL.md` | 2025-11-12T07:01:50.772859+00:00 |
|
|
9
|
+
| `auto_panel_splitter/scripts/auto_panel_splitter.js` | 2025-11-12T06:58:38.936920+00:00 |
|
|
10
|
+
| `auto_panel_splitter/scripts/panel_asset_mapper.js` | 2025-11-12T06:59:17.886824+00:00 |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: Central hub for automation-ready design workflows, describing how agents split composite boards, prep visual assets, sync requirement docs, and discover the right sub-skill before handling new mocks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 设计阶段 Skill
|
|
7
|
+
|
|
8
|
+
## 目标与适用范围
|
|
9
|
+
|
|
10
|
+
- 统一收录设计交付相关的脚本化流程与指引,方便在需求或开发阶段前快速对齐视觉产出。
|
|
11
|
+
- 为代理和协作者提供索引,指向符合 [`../skill_generate/SKILL.md`](../skill_generate/SKILL.md) 规范的子 Skill。
|
|
12
|
+
- 当你需要处理视觉拆分、素材入库、设计变更对齐时,先查阅此处的列表,再加载对应子 Skill。
|
|
13
|
+
|
|
14
|
+
## 当前可用的设计 Skill
|
|
15
|
+
|
|
16
|
+
- **Auto Panel Splitter**(`./auto_panel_splitter/`)
|
|
17
|
+
- 使用脚本批量切分合成设计图、生成映射 CSV、同步需求文档并输出变动说明。
|
|
18
|
+
- 包含 `./auto_panel_splitter/scripts/auto_panel_splitter.js` 与 `./auto_panel_splitter/scripts/panel_asset_mapper.js` 等自动化工具。
|
|
19
|
+
|
|
20
|
+
如需扩展新的设计场景,请在 `skills/aipk_design/` 下创建子目录,按照模板完成 `SKILL.md`、`references/` 等结构,并在本文件的“当前可用的设计 Skill”中登记用途与入口路径。
|
|
21
|
+
|
|
22
|
+
## 使用方式
|
|
23
|
+
|
|
24
|
+
1. **识别任务**:确认是面向设计交付的哪一类动作(拆 panel、生成 asset、审查视觉差异等)。
|
|
25
|
+
2. **查找子 Skill**:在上方列表定位可复用方案;若缺失,请提出需求或新建 Skill。
|
|
26
|
+
3. **加载并执行**:打开子 Skill 的 `SKILL.md` 阅读流程,或在 MCP 代理中加载该目录以自动索引规则。
|
|
27
|
+
4. **回写产出**:按子 Skill 指示更新需求文档、变动记录或素材库,并在 `AGENTS.md` 约定的进度追踪方式中记录状态。
|
|
28
|
+
|
|
29
|
+
## 维护指引
|
|
30
|
+
|
|
31
|
+
- 当脚本或流程更新时,先在对应子 Skill 中调整,再同步这里的描述,确保索引不失效。
|
|
32
|
+
- 撰写/更新任何设计 Skill 时,遵循 [`../guide_writing_standard/SKILL.md`](../guide_writing_standard/SKILL.md) 的写作与标记规则。
|
|
33
|
+
- 设计流程若影响需求、开发或发布阶段,及时在相关 Skill 中留下引用或注意事项,保持跨阶段信息一致。
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auto-panel-splitter
|
|
3
|
+
description: Split composite design boards, align requirement docs with new visuals, and emit standardized requirement-change records.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auto Panel Splitter Skill
|
|
7
|
+
|
|
8
|
+
处理最新视觉稿时使用本 Skill:先用 [`./scripts/auto_panel_splitter.js`](./scripts/auto_panel_splitter.js) 自动切分设计图,再用 [`./scripts/panel_asset_mapper.js`](./scripts/panel_asset_mapper.js) 生成映射、批量入库,并同步需求文档/变动说明。
|
|
9
|
+
|
|
10
|
+
<!-- rule: Agents must complete the entire pipeline end-to-end without依赖人工手动操作或 GUI 工具。 -->
|
|
11
|
+
|
|
12
|
+
## 1. 技能定位
|
|
13
|
+
|
|
14
|
+
- **适用场景**:收到合成设计图(多屏拼板)后,需要批量切分、覆盖需求文档插图、修正文案,并输出需求变动记录
|
|
15
|
+
- **目标人群**:需求文档维护者、AI 协作写手、设计对接 PM
|
|
16
|
+
- **价值主张**:把视觉稿拆分、命名、需求对齐、变更记录打包成标准化流程,避免手动截屏、命名混乱与遗漏输出
|
|
17
|
+
|
|
18
|
+
## 2. 快速上手
|
|
19
|
+
|
|
20
|
+
### 2.1 完整流程概览
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
graph TD
|
|
24
|
+
A[收到合成设计图] --> B[自动切分设计图]
|
|
25
|
+
B --> C[生成映射模板CSV]
|
|
26
|
+
C --> D[手动填充映射信息]
|
|
27
|
+
D --> E[批量入库到assets目录]
|
|
28
|
+
E --> F[更新需求文档并比对差异]
|
|
29
|
+
F --> G[生成需求变动说明文档]
|
|
30
|
+
G --> H[清理临时文件]
|
|
31
|
+
|
|
32
|
+
style A fill:#e1f5ff
|
|
33
|
+
style B fill:#fff4e1
|
|
34
|
+
style C fill:#fff4e1
|
|
35
|
+
style D fill:#ffe1f5
|
|
36
|
+
style E fill:#fff4e1
|
|
37
|
+
style F fill:#e1ffe1
|
|
38
|
+
style G fill:#ffe1f5
|
|
39
|
+
style H fill:#ffe1e1
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2.2 详细步骤
|
|
43
|
+
|
|
44
|
+
1. **自动切分设计图**:运行 [`scripts/auto_panel_splitter.js`](./scripts/auto_panel_splitter.js) 将合成图拆成临时 PNG(详见第3节)。
|
|
45
|
+
2. **生成映射模板CSV**:执行 `node scripts/panel_asset_mapper.js --source <tmp> --mapping <tmp>/mapping.csv --init-mapping`,脚本会扫描全部 PNG 并生成映射模板(详见第4节)。
|
|
46
|
+
3. **手动填充映射信息**:在 CSV 中补齐 `panel_title`(截图上方蓝色标题原文)与 `file_slug`(希望落库的文件名,推荐 kebab-case),必要时填写 `version`、`notes`(详见第5节)。
|
|
47
|
+
4. **批量入库到assets目录**:确认映射后,运行 `scripts/panel_asset_mapper.js`(可指定 `--destination` 或 `--doc-slug/--iteration`)完成重命名与复制(详见第6节)。
|
|
48
|
+
5. **更新需求文档并比对差异**:在需求文档中更新图片引用与文案,同时比对设计图与文档的一致性,记录不一致项(详见第7节)。
|
|
49
|
+
6. **生成需求变动说明文档**:依照 [`需求变动说明模板`](../requirements/changes/template/需求变动说明文档模板.md) 在**需求文档版本文件夹下的 `changes/` 目录**中生成版本记录(详见第8节)。**重要**:变动说明文档必须保存在需求文档版本文件夹下的 `changes/` 目录中,例如 `../../sample/docs/requirement/v1.3.0/changes/YYYYMMDD_需求文档变动说明_*.md`。在删除 `.tmp` 目录前,必须将 `mapping.csv` 的内容以表格形式直接写入需求变动说明文档的附录中(推荐),或将其复制到需求文档版本文件夹下的 `changes/` 目录下(带时间戳命名,如 `YYYYMMDD_mapping.csv`)。同时附上脚本命令行和相关 issue/PR 链接。
|
|
50
|
+
7. **清理临时文件**:完成所有步骤后,删除 `.tmp` 目录下的所有临时文件(包括切分的 PNG 和 `mapping.csv`),保持工作区整洁(详见第9节)。
|
|
51
|
+
|
|
52
|
+
**⚠️ 重要提示**:步骤5中的"比对差异"是必要步骤,必须在步骤6(生成需求变动说明)之前完成,以确保变动说明文档中包含完整的差异核对信息。
|
|
53
|
+
|
|
54
|
+
## 3. 自动切分设计图
|
|
55
|
+
|
|
56
|
+
### 3.1 输入与输出约定
|
|
57
|
+
|
|
58
|
+
- 原始合成图保存在 `../design/assets/source/`,命名保留日期或版本号。
|
|
59
|
+
- 切分输出先落在临时目录(如 `.tmp/checkout-panels`),审核和命名完成后再移动到需求文档 `assets` 目录。
|
|
60
|
+
- 最终文件名采用 "标题-版本" 形式(例:`checkout-summary-v3.png`)。
|
|
61
|
+
|
|
62
|
+
### 3.2 运行脚本
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
node scripts/auto_panel_splitter.js \
|
|
66
|
+
--input ../design/assets/source/20241115_checkout.png \
|
|
67
|
+
--output .tmp/checkout-panels \
|
|
68
|
+
--prefix checkout \
|
|
69
|
+
--margin 12 \
|
|
70
|
+
--title-scan-height 260
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**参数说明**:
|
|
74
|
+
|
|
75
|
+
- `--input`:原始合成设计图路径
|
|
76
|
+
- `--output`:临时输出目录,方便审核后再复制到需求文档 `assets`
|
|
77
|
+
- `--prefix`:临时文件名前缀(仅作初始占位名,后续会被真实标题覆盖)
|
|
78
|
+
- `--margin`:切分时保留的边距(单位:像素),默认12px
|
|
79
|
+
- `--title-scan-height`:标题扫描高度,视稿件调节以减少误切
|
|
80
|
+
- `--min-area`:最小面板面积阈值(可选参数)
|
|
81
|
+
|
|
82
|
+
### 3.3 执行结果
|
|
83
|
+
|
|
84
|
+
脚本会在临时目录下生成按顺序编号的 PNG 文件(如 `checkout_01.png`、`checkout_02.png` 等),每个文件对应一个切分出来的面板。
|
|
85
|
+
|
|
86
|
+
## 4. 生成映射模板CSV
|
|
87
|
+
|
|
88
|
+
### 4.1 执行时机
|
|
89
|
+
|
|
90
|
+
在第3节(自动切分设计图)完成后立即执行。
|
|
91
|
+
|
|
92
|
+
### 4.2 运行脚本
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
node scripts/panel_asset_mapper.js \
|
|
96
|
+
--source .tmp/checkout-panels \
|
|
97
|
+
--mapping .tmp/checkout-panels/mapping.csv \
|
|
98
|
+
--init-mapping
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**参数说明**:
|
|
102
|
+
|
|
103
|
+
- `--source`:临时目录路径(即第3节的输出目录)
|
|
104
|
+
- `--mapping`:映射文件输出路径
|
|
105
|
+
- `--init-mapping`:初始化模式,仅生成映射模板,不修改图片文件
|
|
106
|
+
|
|
107
|
+
### 4.3 生成内容
|
|
108
|
+
|
|
109
|
+
脚本会扫描 `--source` 目录下的所有 PNG 文件,生成 CSV 映射模板,包含以下列:
|
|
110
|
+
|
|
111
|
+
| 列名 | 说明 |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `original_name` | 临时目录下的原始文件名(如 `checkout_01.png`) |
|
|
114
|
+
| `file_slug` | 目标文件名(初始值为文件stem,需手动修改) |
|
|
115
|
+
| `version` | 版本号(初始为空) |
|
|
116
|
+
| `panel_title` | 面板标题(初始为空,需手动填写) |
|
|
117
|
+
| `notes` | 备注信息(初始为空) |
|
|
118
|
+
|
|
119
|
+
**示例输出**:
|
|
120
|
+
|
|
121
|
+
```csv
|
|
122
|
+
original_name,file_slug,version,panel_title,notes
|
|
123
|
+
checkout_01.png,checkout_01,,,
|
|
124
|
+
checkout_02.png,checkout_02,,,
|
|
125
|
+
checkout_03.png,checkout_03,,,
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 5. 手动填充映射信息
|
|
129
|
+
|
|
130
|
+
### 5.1 执行时机
|
|
131
|
+
|
|
132
|
+
在第4节(生成映射模板CSV)完成后,第6节(批量入库)之前执行。
|
|
133
|
+
|
|
134
|
+
### 5.2 填写内容
|
|
135
|
+
|
|
136
|
+
打开 `mapping.csv` 文件,逐行填写以下信息:
|
|
137
|
+
|
|
138
|
+
#### 5.2.1 `panel_title`(必填)
|
|
139
|
+
|
|
140
|
+
- **作用**:记录设计稿左上角的标题文本,用于文档描述及核对表
|
|
141
|
+
- **填写规则**:
|
|
142
|
+
- 照抄设计稿上的标题原文
|
|
143
|
+
- 允许中文/符号,但不要包含 `/`、`\`
|
|
144
|
+
- 保持与设计稿完全一致
|
|
145
|
+
|
|
146
|
+
#### 5.2.2 `file_slug`(必填)
|
|
147
|
+
|
|
148
|
+
- **作用**:决定最终入库的文件名
|
|
149
|
+
- **填写规则**:
|
|
150
|
+
- 推荐使用英文 kebab-case(如 `checkout-summary`)
|
|
151
|
+
- 若业务要求沿用中文标题,可直接复制 `panel_title` 的内容
|
|
152
|
+
- 禁止包含 `/`、`\` 字符
|
|
153
|
+
- 示例:`1-上传全身照`、`checkout-summary`、`error-network`
|
|
154
|
+
|
|
155
|
+
#### 5.2.3 `version`(可选)
|
|
156
|
+
|
|
157
|
+
- **作用**:版本号,脚本会自动将其拼接在 `file_slug` 末尾
|
|
158
|
+
- **填写规则**:
|
|
159
|
+
- 若不需要版本号,留空即可
|
|
160
|
+
- 若需要多版本并行,填写版本号(如 `v1-3-0`)
|
|
161
|
+
- 最终文件名格式:`<file_slug>-<version>.png`
|
|
162
|
+
|
|
163
|
+
#### 5.2.4 `notes`(可选)
|
|
164
|
+
|
|
165
|
+
- **作用**:记录差异、待办事项或其他说明
|
|
166
|
+
- **填写场景**:
|
|
167
|
+
- 标题尚未敲定:`TODO: 待产品确认标题`
|
|
168
|
+
- 文件名与内容不符:`标题写"身高",但内容为体重选择`
|
|
169
|
+
- 其他需要说明的情况
|
|
170
|
+
|
|
171
|
+
### 5.3 填写示例
|
|
172
|
+
|
|
173
|
+
```csv
|
|
174
|
+
original_name,file_slug,version,panel_title,notes
|
|
175
|
+
ai-calorie_01.png,1-上传全身照,,1-上传全身照,
|
|
176
|
+
ai-calorie_02.png,1-上传全身照备份,,1-上传全身照备份,
|
|
177
|
+
ai-calorie_09.png,10-体重,,10-体重,标题写"身高",但内容为体重选择
|
|
178
|
+
ai-calorie_10.png,11-第一阶段完成,,11-第一阶段完成,
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 5.4 注意事项
|
|
182
|
+
|
|
183
|
+
- 所有行的 `panel_title` 和 `file_slug` 都必须填写
|
|
184
|
+
- `file_slug` 不要重复,确保每个文件名唯一
|
|
185
|
+
- 填写完成后保存文件,准备进入第6节(批量入库)
|
|
186
|
+
|
|
187
|
+
## 6. 批量入库到assets目录
|
|
188
|
+
|
|
189
|
+
### 6.1 执行时机
|
|
190
|
+
|
|
191
|
+
在第5节(手动填充映射信息)完成后,确认映射信息无误后执行。
|
|
192
|
+
|
|
193
|
+
### 6.2 运行脚本
|
|
194
|
+
|
|
195
|
+
**资产入库命令**:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
node scripts/panel_asset_mapper.js \
|
|
199
|
+
--source .tmp/checkout-panels \
|
|
200
|
+
--mapping .tmp/checkout-panels/mapping.csv \
|
|
201
|
+
--destination ../../sample/docs/requirement/v1.3.0/assets \
|
|
202
|
+
--trim-top 140
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**注意**:`--diff-report` 参数用于生成图片文件的 diff 比对表(包含哈希值),但 check 目录应保存的是文案/设计对齐核对表(见第7.2节),而非图片 diff 比对表。
|
|
206
|
+
|
|
207
|
+
**参数说明**:
|
|
208
|
+
|
|
209
|
+
- `--source`:临时目录路径
|
|
210
|
+
- `--mapping`:映射文件路径
|
|
211
|
+
- `--destination`:目标assets目录路径
|
|
212
|
+
- 或使用 `--doc-slug <doc-name> --iteration <version>` 自动构建路径
|
|
213
|
+
- `--trim-top`:裁掉标题条的像素值(本项目默认140px,可选)
|
|
214
|
+
- `--dry-run`:预览操作但不实际复制(可选,用于检查)
|
|
215
|
+
- `--diff-report`:导出差异报告CSV(可选)
|
|
216
|
+
- `--update-mapping-notes`:将差异信息写回 `mapping.csv`(可选)
|
|
217
|
+
|
|
218
|
+
### 6.3 脚本行为
|
|
219
|
+
|
|
220
|
+
**文件处理**:
|
|
221
|
+
|
|
222
|
+
1. 读取 `mapping.csv` 中的映射关系
|
|
223
|
+
2. 根据 `file_slug` 和 `version` 生成目标文件名
|
|
224
|
+
3. 如果设置了 `--trim-top`,先裁掉图片顶部的标题条
|
|
225
|
+
4. 复制文件到目标目录
|
|
226
|
+
|
|
227
|
+
**差异检测**:
|
|
228
|
+
|
|
229
|
+
- **像素完全一致**:跳过复制,标记为 `identical`
|
|
230
|
+
- **文件缺失**:复制文件,标记为 `missing`
|
|
231
|
+
- **像素不一致**:覆盖文件,标记为 `different`
|
|
232
|
+
|
|
233
|
+
**输出示例**:
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
Copied .tmp/ai-calorie-panels/ai-calorie_01.png -> ../../sample/docs/requirement/v1.3.0/assets/1-上传全身照.png [missing]
|
|
237
|
+
Skipped .tmp/ai-calorie-panels/ai-calorie_02.png -> ../../sample/docs/requirement/v1.3.0/assets/1-上传全身照备份.png [identical]
|
|
238
|
+
Overwrote .tmp/ai-calorie-panels/ai-calorie_09.png -> ../../sample/docs/requirement/v1.3.0/assets/10-体重.png [different]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 6.4 资产管理约定
|
|
242
|
+
|
|
243
|
+
**目标路径规范**:
|
|
244
|
+
|
|
245
|
+
- `../requirements/documentation/<doc-slug>/assets/`(或其版本子目录)
|
|
246
|
+
- 文件直接平铺在目标目录下,不再额外创建二级子文件夹
|
|
247
|
+
- `<doc-slug>` 对应需求文档目录名
|
|
248
|
+
- `<iteration-id>` 采用 `YYYYMMDD` 或版本号
|
|
249
|
+
|
|
250
|
+
**引用方式**:在 Markdown 中使用相对路径引用,格式:``
|
|
251
|
+
|
|
252
|
+
**覆盖策略**:脚本默认覆盖旧图;若需保留历史版本,在 `mapping.csv` 中更新 `version` 并重新执行脚本。
|
|
253
|
+
|
|
254
|
+
### 6.5 映射留存
|
|
255
|
+
|
|
256
|
+
**映射留存**:
|
|
257
|
+
|
|
258
|
+
`mapping.csv` 的内容必须包含在**需求文档版本文件夹下的 `changes/`** 目录中的需求变动说明文档中(见第8节)。
|
|
259
|
+
|
|
260
|
+
**推荐方式**:将 `mapping.csv` 的内容以表格形式直接写入需求变动说明文档的附录中,这样即使删除 `.tmp` 目录,映射信息仍然保留在文档中。
|
|
261
|
+
|
|
262
|
+
**备选方式**:在删除 `.tmp` 目录前,将 `mapping.csv` 复制到**需求文档版本文件夹下的 `changes/`** 目录下,使用带时间戳的文件名(如 `YYYYMMDD_mapping.csv`),然后在需求变动说明文档中引用该文件。
|
|
263
|
+
|
|
264
|
+
## 7. 更新需求文档并比对差异
|
|
265
|
+
|
|
266
|
+
**执行时机**:在第6节(批量入库到assets目录)完成后立即执行。
|
|
267
|
+
|
|
268
|
+
### 7.1 更新需求文档图片引用
|
|
269
|
+
|
|
270
|
+
**执行步骤**:
|
|
271
|
+
|
|
272
|
+
1. **定位段落**:使用 `rg -n "<关键词>" ../requirements -g '*.md'` 找到涉及模块。
|
|
273
|
+
2. **更新图片引用**:将文档中的旧图片路径替换为新入库的图片路径,确保文件名与 `mapping.csv` 中的 `file_slug` 一致。
|
|
274
|
+
3. **对照设计**:核实按钮/标签文案、显隐逻辑、字段顺序、错误提示、状态、单位等是否与最新图一致。
|
|
275
|
+
4. **逐条更新**:直接修改 Markdown 文案与图片引用;必要时增加表格或列表突出新增/删减项。
|
|
276
|
+
5. **标注待确认**:若设计仍未定稿,使用 `<!-- TODO: 待确认责任人 + 截止时间 -->` 提示。
|
|
277
|
+
6. **写作规范**:遵循 [`../requirements/documentation/SKILL.md`](../requirements/documentation/SKILL.md),保持单主题段落、显式引用来源。
|
|
278
|
+
|
|
279
|
+
**注意事项**:
|
|
280
|
+
|
|
281
|
+
- 图片引用路径应使用相对路径,格式:``
|
|
282
|
+
- 如果发现图片文件名与内容不符(如映射文件notes中标注的问题),应同时修正文档中的引用和注释
|
|
283
|
+
|
|
284
|
+
### 7.2 比对文档与设计图差异
|
|
285
|
+
|
|
286
|
+
**执行方法**:
|
|
287
|
+
|
|
288
|
+
1. 逐一查看已入库的设计图文件
|
|
289
|
+
2. 对照需求文档中对应的章节描述
|
|
290
|
+
3. 检查以下内容的一致性:
|
|
291
|
+
- 界面标题和主标题
|
|
292
|
+
- 按钮文案和交互逻辑
|
|
293
|
+
- Toast提示和错误信息
|
|
294
|
+
- 字段顺序和显示状态
|
|
295
|
+
- 单位、格式、数值范围
|
|
296
|
+
4. 使用下表模板记录发现的不一致项
|
|
297
|
+
|
|
298
|
+
**链接格式规范**:需求文档位置列使用双重链接格式,前面为 Markdown 标准链接(显示"文件名+章节序号"),后面为 Obsidian 双向链接(在括号内显示"👁️")。**重要**:Markdown 链接的锚点应该只包含章节号,不包含标题文本。格式示例:`[文件名 §章节号](../相对路径.md#章节锚点) ([[文件名#标题\|👁️]])`
|
|
299
|
+
|
|
300
|
+
**核对表模板**:
|
|
301
|
+
|
|
302
|
+
| 图片文件 | 设计稿关键文案/控件 | 对应需求文档位置 | 当前文案描述 | 不一致说明 | 建议处理人/动作 | 状态 |
|
|
303
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
304
|
+
| 例: | "Save" 按钮 + 体重选项 | [引导页_用户体验优化 §4.3.1.6](../20250818_引导页_用户体验优化.md#4316) ([[20250818_引导页_用户体验优化#4.3.1.6 🆕 新增结果修改页面\|👁️]]) | 文档暂无说明该页面 | 命名与实际内容不符,且需求描述缺失 | 指派需求 Owner 确认是否更名/补文案 | 待确认 |
|
|
305
|
+
|
|
306
|
+
**注意**:图片文件列应使用图片嵌入格式 ``,路径相对于 check 目录或 changes 目录(两者都在版本文件夹下,assets 目录也在版本文件夹下,所以使用 `../assets/`)。
|
|
307
|
+
|
|
308
|
+
**处理原则**:
|
|
309
|
+
|
|
310
|
+
- Review 完成后再决定是否修改文档或资产;未确认前不要自动改动
|
|
311
|
+
- 核对表应包含在需求变动说明文档的"文档级变动详情"或"附录"章节中(见第8节)
|
|
312
|
+
- 对于已修正的不一致项,在状态列标记为"已完成"或"✅ 已修正"
|
|
313
|
+
|
|
314
|
+
## 8. 生成需求变动说明文档
|
|
315
|
+
|
|
316
|
+
**执行时机**:在第7节(更新需求文档并比对差异)完成后执行。
|
|
317
|
+
|
|
318
|
+
**执行步骤**:
|
|
319
|
+
|
|
320
|
+
1. **创建目录**:在**需求文档版本文件夹下**创建 `changes/` 目录(如 `../../sample/docs/requirement/v1.3.0/changes/`),若不存在则创建。**重要**:变动说明文档必须保存在需求文档版本文件夹下的 `changes/` 目录中,而不是根目录的 `changes/` 文件夹。
|
|
321
|
+
2. **文件命名**:新文件命名格式为 `YYYYMMDD_需求文档变动说明_<旧版本>至<新版本>.md`(示例:`20241116_需求文档变动说明_v2.3.0至v2.4.0.md`)。
|
|
322
|
+
3. **套用模板**:严格套用 [`../requirements/changes/template/需求变动说明文档模板.md`](../requirements/changes/template/需求变动说明文档模板.md),不得增删章节;不适用项填 `*略*`。
|
|
323
|
+
4. **填写变动详情**:在"文档级变动详情"章节明确列出:
|
|
324
|
+
- 更新的需求文档路径以及受影响的章节编号(使用行号链接)
|
|
325
|
+
- 新增/覆盖的 `assets` 目录与关键 PNG 名称
|
|
326
|
+
- 文案、字段、交互、校验规则的差异摘要
|
|
327
|
+
- 比对差异核对表的发现(如有不一致项,见第7.2节)
|
|
328
|
+
5. **包含映射信息**:在"附录"章节中必须包含 `mapping.csv` 的内容(见第6.5节)。**注意**:由于 `.tmp` 目录会在第9节被删除,因此必须将 `mapping.csv` 的内容以表格形式直接写入文档中(推荐),或先将其复制到**需求文档版本文件夹下的 `changes/`** 目录下再在文档中引用。
|
|
329
|
+
6. **记录命令**:在"附录"章节中附上完整的脚本命令行,包括:
|
|
330
|
+
- 切分命令(`scripts/auto_panel_splitter.js`,见第3节)
|
|
331
|
+
- 生成映射命令(`scripts/panel_asset_mapper.js --init-mapping`,见第4节)
|
|
332
|
+
- 入库命令(`scripts/panel_asset_mapper.js`,见第6节)
|
|
333
|
+
- 相关 issue/PR 链接(如有)
|
|
334
|
+
7. **包含核对表**:将第7.2节生成的文案/设计对齐核对表包含在文档的"文档级变动详情"或"附录"章节中。
|
|
335
|
+
8. **生成文案/设计对齐核对表**:将第7.2节生成的文案/设计对齐核对表保存为 Markdown 文件到**需求文档版本文件夹下的 `check/`** 目录(如 `../../sample/docs/requirement/v1.3.0/check/YYYYMMDD_文案设计对齐核对表.md`)。**重要**:check 目录应保存的是文案/设计对齐核对表(记录设计图与需求文档的一致性比对),而非图片 diff 比对表(图片文件的哈希值比对)。核对表使用 Markdown 格式,包含表格和必要的说明文字。
|
|
336
|
+
|
|
337
|
+
**重要提醒**:必须在执行第9节(清理临时文件)之前完成此步骤,确保 `mapping.csv` 的内容已保存到需求变动说明文档中。
|
|
338
|
+
|
|
339
|
+
## 9. 清理临时文件
|
|
340
|
+
|
|
341
|
+
**执行时机**:在第8节(生成需求变动说明文档)完成后,确认所有信息已保存到需求变动说明文档后执行。
|
|
342
|
+
|
|
343
|
+
**执行步骤**:
|
|
344
|
+
|
|
345
|
+
1. **检查确认**:确保 `mapping.csv` 的内容已包含在需求变动说明文档的附录中。
|
|
346
|
+
2. **删除临时目录**:执行 `rm -rf .tmp/<项目名>-panels` 删除整个临时目录。
|
|
347
|
+
3. **验证清理**:检查 `.tmp` 目录是否已清空,保持工作区整洁。
|
|
348
|
+
|
|
349
|
+
**注意事项**:
|
|
350
|
+
|
|
351
|
+
- 删除前务必确认 `mapping.csv` 已保存到需求变动说明文档中
|
|
352
|
+
- 如果需要保留临时文件用于调试,可以暂缓删除,但务必在提交代码前清理
|
|
353
|
+
- 临时文件不应提交到版本控制系统
|
|
354
|
+
|
|
355
|
+
## 10. 附加资源
|
|
356
|
+
|
|
357
|
+
- [自动切分脚本](./scripts/auto_panel_splitter.js) — 面板检测与裁切逻辑
|
|
358
|
+
- [资产映射脚本](./scripts/panel_asset_mapper.js) — 映射管理与批量入库
|
|
359
|
+
- [需求文档 Skill](../requirements/documentation/SKILL.md) — 需求文档结构与质检
|
|
360
|
+
- [需求变动 Skill](../requirements/changes/SKILL.md) — 需求变动说明模板与执行清单
|