@jakkrichm/create-nexus-devflow 2.0.19 → 2.0.21
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/dist/lib/update.js +19 -8
- package/dist/lib/update.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/00-discover/SKILL.md +28 -116
- package/template/.agents/skills/40-execute/SKILL.md +1 -1
- package/template/.agents/skills/50-verify/SKILL.md +28 -161
- package/template/.agents/skills/60-report/SKILL.md +19 -92
- package/template/.agents/skills/70-release/SKILL.md +36 -11
- package/template/.agents/skills/check/SKILL.md +19 -7
- package/template/.agents/skills/complete/SKILL.md +21 -10
- package/template/.claude/skills/00-discover/SKILL.md +28 -116
- package/template/.claude/skills/40-execute/SKILL.md +1 -1
- package/template/.claude/skills/50-verify/SKILL.md +28 -161
- package/template/.claude/skills/60-report/SKILL.md +19 -92
- package/template/.claude/skills/70-release/SKILL.md +36 -11
- package/template/.claude/skills/check/SKILL.md +19 -7
- package/template/.claude/skills/complete/SKILL.md +21 -10
- package/template/AGENTS.md +1 -1
- package/template/devflow/context/coding-standards.md +40 -29
- package/template/.agents/skills/agent/SKILL.md +0 -165
- package/template/.agents/skills/api-and-interface-design/SKILL.md +0 -294
- package/template/.agents/skills/app-builder/SKILL.md +0 -75
- package/template/.agents/skills/app-builder/agent-coordination.md +0 -71
- package/template/.agents/skills/app-builder/feature-building.md +0 -53
- package/template/.agents/skills/app-builder/project-detection.md +0 -34
- package/template/.agents/skills/app-builder/scaffolding.md +0 -118
- package/template/.agents/skills/app-builder/tech-stack.md +0 -40
- package/template/.agents/skills/app-builder/templates/SKILL.md +0 -39
- package/template/.agents/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/template/.agents/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/template/.agents/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/template/.agents/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/template/.agents/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/template/.agents/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/template/.agents/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/template/.agents/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/template/.agents/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/template/.agents/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/template/.agents/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/template/.agents/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/template/.agents/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/template/.agents/skills/architecture/SKILL.md +0 -55
- package/template/.agents/skills/architecture/context-discovery.md +0 -43
- package/template/.agents/skills/architecture/examples.md +0 -94
- package/template/.agents/skills/architecture/pattern-selection.md +0 -68
- package/template/.agents/skills/architecture/patterns-reference.md +0 -50
- package/template/.agents/skills/architecture/trade-off-analysis.md +0 -77
- package/template/.agents/skills/bash-linux/SKILL.md +0 -199
- package/template/.agents/skills/behavioral-modes/SKILL.md +0 -242
- package/template/.agents/skills/brainstorm/SKILL.md +0 -168
- package/template/.agents/skills/changelog/SKILL.md +0 -109
- package/template/.agents/skills/codebase-design/DEEPENING.md +0 -24
- package/template/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -28
- package/template/.agents/skills/codebase-design/SKILL.md +0 -58
- package/template/.agents/skills/commit/SKILL.md +0 -59
- package/template/.agents/skills/competitor-analysis/SKILL.md +0 -66
- package/template/.agents/skills/context-engineering/SKILL.md +0 -290
- package/template/.agents/skills/database-design/SKILL.md +0 -52
- package/template/.agents/skills/database-design/database-selection.md +0 -43
- package/template/.agents/skills/database-design/indexing.md +0 -39
- package/template/.agents/skills/database-design/migrations.md +0 -48
- package/template/.agents/skills/database-design/optimization.md +0 -36
- package/template/.agents/skills/database-design/orm-selection.md +0 -30
- package/template/.agents/skills/database-design/schema-design.md +0 -56
- package/template/.agents/skills/database-design/scripts/schema_validator.py +0 -172
- package/template/.agents/skills/deploy/SKILL.md +0 -63
- package/template/.agents/skills/documentation-and-adrs/SKILL.md +0 -278
- package/template/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/template/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/template/.agents/skills/domain-modeling/SKILL.md +0 -74
- package/template/.agents/skills/followup/SKILL.md +0 -83
- package/template/.agents/skills/frontend-ui-engineering/SKILL.md +0 -326
- package/template/.agents/skills/frontend-ui-engineering/accessibility-checklist.md +0 -159
- package/template/.agents/skills/goal/SKILL.md +0 -148
- package/template/.agents/skills/handoff/SKILL.md +0 -46
- package/template/.agents/skills/help/SKILL.md +0 -253
- package/template/.agents/skills/i18n-localization/SKILL.md +0 -154
- package/template/.agents/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/template/.agents/skills/insight/SKILL.md +0 -42
- package/template/.agents/skills/issue-triage/SKILL.md +0 -115
- package/template/.agents/skills/lint-and-validate/SKILL.md +0 -45
- package/template/.agents/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/template/.agents/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/template/.agents/skills/mcp-builder/SKILL.md +0 -176
- package/template/.agents/skills/merge/SKILL.md +0 -76
- package/template/.agents/skills/mobile-design/SKILL.md +0 -394
- package/template/.agents/skills/mobile-design/decision-trees.md +0 -516
- package/template/.agents/skills/mobile-design/mobile-backend.md +0 -491
- package/template/.agents/skills/mobile-design/mobile-color-system.md +0 -420
- package/template/.agents/skills/mobile-design/mobile-debugging.md +0 -122
- package/template/.agents/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/template/.agents/skills/mobile-design/mobile-navigation.md +0 -458
- package/template/.agents/skills/mobile-design/mobile-performance.md +0 -767
- package/template/.agents/skills/mobile-design/mobile-testing.md +0 -356
- package/template/.agents/skills/mobile-design/mobile-typography.md +0 -433
- package/template/.agents/skills/mobile-design/platform-android.md +0 -666
- package/template/.agents/skills/mobile-design/platform-ios.md +0 -561
- package/template/.agents/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/template/.agents/skills/mobile-design/touch-psychology.md +0 -537
- package/template/.agents/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/template/.agents/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/template/.agents/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/template/.agents/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/template/.agents/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/template/.agents/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/template/.agents/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/template/.agents/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/template/.agents/skills/nextjs-react-expert/SKILL.md +0 -286
- package/template/.agents/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/template/.agents/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/template/.agents/skills/nodejs-best-practices/SKILL.md +0 -333
- package/template/.agents/skills/package-json-generator/SKILL.md +0 -60
- package/template/.agents/skills/package-json-generator/scripts/generate.js +0 -120
- package/template/.agents/skills/package-json-generator/scripts/run.sh +0 -19
- package/template/.agents/skills/parallel-agents/SKILL.md +0 -144
- package/template/.agents/skills/performance-optimization/SKILL.md +0 -299
- package/template/.agents/skills/performance-optimization/performance-checklist.md +0 -113
- package/template/.agents/skills/powershell-windows/SKILL.md +0 -167
- package/template/.agents/skills/pr/SKILL.md +0 -93
- package/template/.agents/skills/prd/SKILL.md +0 -127
- package/template/.agents/skills/preview/SKILL.md +0 -42
- package/template/.agents/skills/python-patterns/SKILL.md +0 -441
- package/template/.agents/skills/research/SKILL.md +0 -143
- package/template/.agents/skills/review/SKILL.md +0 -71
- package/template/.agents/skills/roadmap-strategy/SKILL.md +0 -94
- package/template/.agents/skills/security-review/SKILL.md +0 -63
- package/template/.agents/skills/seo-fundamentals/SKILL.md +0 -129
- package/template/.agents/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/template/.agents/skills/server-management/SKILL.md +0 -161
- package/template/.agents/skills/simplify/SKILL.md +0 -70
- package/template/.agents/skills/skill-development/SKILL.md +0 -86
- package/template/.agents/skills/spec/SKILL.md +0 -39
- package/template/.agents/skills/spec-driven-development/SKILL.md +0 -207
- package/template/.agents/skills/tailwind-patterns/SKILL.md +0 -269
- package/template/.agents/skills/type-design/SKILL.md +0 -84
- package/template/.agents/skills/ui-ux-pro-max/SKILL.md +0 -75
- package/template/.claude/skills/agent/SKILL.md +0 -165
- package/template/.claude/skills/api-and-interface-design/SKILL.md +0 -294
- package/template/.claude/skills/app-builder/SKILL.md +0 -75
- package/template/.claude/skills/app-builder/agent-coordination.md +0 -71
- package/template/.claude/skills/app-builder/feature-building.md +0 -53
- package/template/.claude/skills/app-builder/project-detection.md +0 -34
- package/template/.claude/skills/app-builder/scaffolding.md +0 -118
- package/template/.claude/skills/app-builder/tech-stack.md +0 -40
- package/template/.claude/skills/app-builder/templates/SKILL.md +0 -39
- package/template/.claude/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/template/.claude/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/template/.claude/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/template/.claude/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/template/.claude/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/template/.claude/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/template/.claude/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/template/.claude/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/template/.claude/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/template/.claude/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/template/.claude/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/template/.claude/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/template/.claude/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/template/.claude/skills/architecture/SKILL.md +0 -55
- package/template/.claude/skills/architecture/context-discovery.md +0 -43
- package/template/.claude/skills/architecture/examples.md +0 -94
- package/template/.claude/skills/architecture/pattern-selection.md +0 -68
- package/template/.claude/skills/architecture/patterns-reference.md +0 -50
- package/template/.claude/skills/architecture/trade-off-analysis.md +0 -77
- package/template/.claude/skills/bash-linux/SKILL.md +0 -199
- package/template/.claude/skills/behavioral-modes/SKILL.md +0 -242
- package/template/.claude/skills/brainstorm/SKILL.md +0 -168
- package/template/.claude/skills/changelog/SKILL.md +0 -109
- package/template/.claude/skills/codebase-design/DEEPENING.md +0 -24
- package/template/.claude/skills/codebase-design/DESIGN-IT-TWICE.md +0 -28
- package/template/.claude/skills/codebase-design/SKILL.md +0 -58
- package/template/.claude/skills/commit/SKILL.md +0 -59
- package/template/.claude/skills/competitor-analysis/SKILL.md +0 -66
- package/template/.claude/skills/context-engineering/SKILL.md +0 -290
- package/template/.claude/skills/database-design/SKILL.md +0 -52
- package/template/.claude/skills/database-design/database-selection.md +0 -43
- package/template/.claude/skills/database-design/indexing.md +0 -39
- package/template/.claude/skills/database-design/migrations.md +0 -48
- package/template/.claude/skills/database-design/optimization.md +0 -36
- package/template/.claude/skills/database-design/orm-selection.md +0 -30
- package/template/.claude/skills/database-design/schema-design.md +0 -56
- package/template/.claude/skills/database-design/scripts/schema_validator.py +0 -172
- package/template/.claude/skills/deploy/SKILL.md +0 -63
- package/template/.claude/skills/documentation-and-adrs/SKILL.md +0 -278
- package/template/.claude/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/template/.claude/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/template/.claude/skills/domain-modeling/SKILL.md +0 -74
- package/template/.claude/skills/followup/SKILL.md +0 -83
- package/template/.claude/skills/frontend-ui-engineering/SKILL.md +0 -326
- package/template/.claude/skills/frontend-ui-engineering/accessibility-checklist.md +0 -159
- package/template/.claude/skills/goal/SKILL.md +0 -148
- package/template/.claude/skills/handoff/SKILL.md +0 -46
- package/template/.claude/skills/help/SKILL.md +0 -253
- package/template/.claude/skills/i18n-localization/SKILL.md +0 -154
- package/template/.claude/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/template/.claude/skills/insight/SKILL.md +0 -42
- package/template/.claude/skills/issue-triage/SKILL.md +0 -115
- package/template/.claude/skills/lint-and-validate/SKILL.md +0 -45
- package/template/.claude/skills/lint-and-validate/scripts/lint_runner.py +0 -184
- package/template/.claude/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/template/.claude/skills/mcp-builder/SKILL.md +0 -176
- package/template/.claude/skills/merge/SKILL.md +0 -76
- package/template/.claude/skills/mobile-design/SKILL.md +0 -394
- package/template/.claude/skills/mobile-design/decision-trees.md +0 -516
- package/template/.claude/skills/mobile-design/mobile-backend.md +0 -491
- package/template/.claude/skills/mobile-design/mobile-color-system.md +0 -420
- package/template/.claude/skills/mobile-design/mobile-debugging.md +0 -122
- package/template/.claude/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/template/.claude/skills/mobile-design/mobile-navigation.md +0 -458
- package/template/.claude/skills/mobile-design/mobile-performance.md +0 -767
- package/template/.claude/skills/mobile-design/mobile-testing.md +0 -356
- package/template/.claude/skills/mobile-design/mobile-typography.md +0 -433
- package/template/.claude/skills/mobile-design/platform-android.md +0 -666
- package/template/.claude/skills/mobile-design/platform-ios.md +0 -561
- package/template/.claude/skills/mobile-design/scripts/mobile_audit.py +0 -670
- package/template/.claude/skills/mobile-design/touch-psychology.md +0 -537
- package/template/.claude/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/template/.claude/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/template/.claude/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/template/.claude/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/template/.claude/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/template/.claude/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/template/.claude/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/template/.claude/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/template/.claude/skills/nextjs-react-expert/SKILL.md +0 -286
- package/template/.claude/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
- package/template/.claude/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
- package/template/.claude/skills/nodejs-best-practices/SKILL.md +0 -333
- package/template/.claude/skills/package-json-generator/SKILL.md +0 -60
- package/template/.claude/skills/package-json-generator/scripts/generate.js +0 -120
- package/template/.claude/skills/package-json-generator/scripts/run.sh +0 -19
- package/template/.claude/skills/parallel-agents/SKILL.md +0 -144
- package/template/.claude/skills/performance-optimization/SKILL.md +0 -299
- package/template/.claude/skills/performance-optimization/performance-checklist.md +0 -113
- package/template/.claude/skills/powershell-windows/SKILL.md +0 -167
- package/template/.claude/skills/pr/SKILL.md +0 -93
- package/template/.claude/skills/prd/SKILL.md +0 -127
- package/template/.claude/skills/preview/SKILL.md +0 -42
- package/template/.claude/skills/python-patterns/SKILL.md +0 -441
- package/template/.claude/skills/research/SKILL.md +0 -143
- package/template/.claude/skills/review/SKILL.md +0 -71
- package/template/.claude/skills/roadmap-strategy/SKILL.md +0 -94
- package/template/.claude/skills/security-review/SKILL.md +0 -63
- package/template/.claude/skills/seo-fundamentals/SKILL.md +0 -129
- package/template/.claude/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/template/.claude/skills/server-management/SKILL.md +0 -161
- package/template/.claude/skills/simplify/SKILL.md +0 -70
- package/template/.claude/skills/skill-development/SKILL.md +0 -86
- package/template/.claude/skills/spec/SKILL.md +0 -39
- package/template/.claude/skills/spec-driven-development/SKILL.md +0 -207
- package/template/.claude/skills/tailwind-patterns/SKILL.md +0 -269
- package/template/.claude/skills/type-design/SKILL.md +0 -84
- package/template/.claude/skills/ui-ux-pro-max/SKILL.md +0 -75
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const targetDir = process.argv[2] || process.cwd();
|
|
5
|
-
const packageJsonPath = path.join(targetDir, 'package.json');
|
|
6
|
-
const tasksJsonPath = path.join(targetDir, '.vscode', 'tasks.json');
|
|
7
|
-
|
|
8
|
-
// Initialize or read package.json
|
|
9
|
-
let pkg = {};
|
|
10
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
11
|
-
try {
|
|
12
|
-
pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
console.error(JSON.stringify({ status: 'error', message: 'Invalid package.json format' }));
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
pkg = {
|
|
19
|
-
name: path.basename(path.resolve(targetDir)),
|
|
20
|
-
version: '1.0.0',
|
|
21
|
-
description: '',
|
|
22
|
-
main: 'index.js',
|
|
23
|
-
scripts: {}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (!pkg.scripts) pkg.scripts = {};
|
|
28
|
-
|
|
29
|
-
let scriptsAdded = 0;
|
|
30
|
-
|
|
31
|
-
// Read .vscode/tasks.json if exists
|
|
32
|
-
if (fs.existsSync(tasksJsonPath)) {
|
|
33
|
-
try {
|
|
34
|
-
const tasksContent = fs.readFileSync(tasksJsonPath, 'utf8');
|
|
35
|
-
// Basic JSON parse (Note: tasks.json often contains comments, so we use a simple regex to strip them)
|
|
36
|
-
const jsonWithoutComments = tasksContent.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1');
|
|
37
|
-
const tasksData = JSON.parse(jsonWithoutComments);
|
|
38
|
-
|
|
39
|
-
const tasks = tasksData.tasks || [];
|
|
40
|
-
const inputs = tasksData.inputs || [];
|
|
41
|
-
|
|
42
|
-
// Helper to find input description
|
|
43
|
-
const getInputDefaultOrDesc = (inputId) => {
|
|
44
|
-
const input = inputs.find(i => i.id === inputId);
|
|
45
|
-
return input ? (input.description || input.default || inputId) : inputId;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
tasks.forEach(task => {
|
|
49
|
-
if (task.command) {
|
|
50
|
-
// Convert label to script name (e.g. "🚀 [Docker] Start Project" -> "docker:start")
|
|
51
|
-
let scriptName = task.label
|
|
52
|
-
.replace(/[\u{1F300}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu, '') // Remove emojis
|
|
53
|
-
.replace(/\[(.*?)\]/g, '$1') // Remove brackets
|
|
54
|
-
.trim()
|
|
55
|
-
.toLowerCase()
|
|
56
|
-
.replace(/[^a-z0-9]+/g, '-'); // Replace spaces/specials with dash
|
|
57
|
-
|
|
58
|
-
// Shorten some common prefixes
|
|
59
|
-
scriptName = scriptName.replace(/^docker-/, 'docker:');
|
|
60
|
-
scriptName = scriptName.replace(/^db-/, 'db:');
|
|
61
|
-
|
|
62
|
-
let cmd = task.command;
|
|
63
|
-
|
|
64
|
-
// Append args if any
|
|
65
|
-
if (task.args && Array.isArray(task.args)) {
|
|
66
|
-
cmd += ' ' + task.args.join(' ');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Convert ${input:xxx} to PowerShell Read-Host
|
|
70
|
-
const inputMatches = cmd.match(/\$\{input:([a-zA-Z0-9_-]+)\}/g);
|
|
71
|
-
if (inputMatches) {
|
|
72
|
-
let psCommands = [];
|
|
73
|
-
let currentCmd = cmd;
|
|
74
|
-
|
|
75
|
-
inputMatches.forEach(match => {
|
|
76
|
-
const inputId = match.replace('${input:', '').replace('}', '');
|
|
77
|
-
const prompt = getInputDefaultOrDesc(inputId);
|
|
78
|
-
psCommands.push(`$${inputId} = Read-Host '${prompt}'`);
|
|
79
|
-
currentCmd = currentCmd.replace(match, `$${inputId}`);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Wrap the command in PowerShell
|
|
83
|
-
cmd = `powershell -Command "${psCommands.join('; ')}; if (${inputMatches.map(m => '$'+m.replace('${input:','').replace('}','')).join(' -and ')}) { ${currentCmd} }"`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Don't overwrite existing scripts unless necessary, or just add if not exist
|
|
87
|
-
if (!pkg.scripts[scriptName]) {
|
|
88
|
-
pkg.scripts[scriptName] = cmd;
|
|
89
|
-
scriptsAdded++;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
} catch (e) {
|
|
95
|
-
// Ignore parse errors for tasks.json
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Ensure default scripts exist
|
|
100
|
-
const defaultScripts = {
|
|
101
|
-
"start": "node index.js"
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
for (const [key, value] of Object.entries(defaultScripts)) {
|
|
105
|
-
if (!pkg.scripts[key] && Object.keys(pkg.scripts).length === 0) {
|
|
106
|
-
pkg.scripts[key] = value;
|
|
107
|
-
scriptsAdded++;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
112
|
-
|
|
113
|
-
console.log(JSON.stringify({
|
|
114
|
-
status: 'success',
|
|
115
|
-
message: 'Generated package.json successfully',
|
|
116
|
-
data: {
|
|
117
|
-
scriptsAdded,
|
|
118
|
-
path: packageJsonPath
|
|
119
|
-
}
|
|
120
|
-
}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# Wrapper script to run the Node.js generator
|
|
5
|
-
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
TARGET_DIR="${1:-$(pwd)}"
|
|
8
|
-
|
|
9
|
-
# Convert WSL paths to Windows paths for Node.js if running in WSL
|
|
10
|
-
if grep -q microsoft /proc/version 2>/dev/null; then
|
|
11
|
-
# wslpath is available in WSL to convert paths
|
|
12
|
-
if command -v wslpath >/dev/null 2>&1; then
|
|
13
|
-
TARGET_DIR_WIN=$(wslpath -w "$TARGET_DIR" 2>/dev/null || echo "$TARGET_DIR")
|
|
14
|
-
node "$SCRIPT_DIR/generate.js" "$TARGET_DIR_WIN"
|
|
15
|
-
exit $?
|
|
16
|
-
fi
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
node "$SCRIPT_DIR/generate.js" "$TARGET_DIR"
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: parallel-agents
|
|
3
|
-
description: "[Devflow] Multi-agent orchestration patterns for the current DevFlow 2.0 specialist set. Use when multiple independent analyses or implementation perspectives can run in parallel."
|
|
4
|
-
allowed-tools: Read, Glob, Grep
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Parallel Agents For DevFlow 2.0
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
Use parallel specialist work only when:
|
|
12
|
-
|
|
13
|
-
- the task spans multiple independent domains
|
|
14
|
-
- findings can be gathered without one agent blocking another
|
|
15
|
-
- the lifecycle owner is already clear from the current stage or approved plan
|
|
16
|
-
|
|
17
|
-
Do not use orchestration for simple single-domain tasks.
|
|
18
|
-
|
|
19
|
-
## Preconditions
|
|
20
|
-
|
|
21
|
-
Before parallelizing:
|
|
22
|
-
|
|
23
|
-
1. read the current stage artifact or approved plan
|
|
24
|
-
2. identify the lifecycle owner
|
|
25
|
-
3. split the work into independent questions
|
|
26
|
-
|
|
27
|
-
If those conditions are missing, return first to `00-discover`, `20-spec`, or `30-plan`.
|
|
28
|
-
|
|
29
|
-
## Basic Invocation Patterns
|
|
30
|
-
|
|
31
|
-
### Single Specialist
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
Use the security-auditor agent to review authentication
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Sequential Chain
|
|
38
|
-
|
|
39
|
-
```text
|
|
40
|
-
First, use the codebase-explorer agent to discover project structure.
|
|
41
|
-
Then, use the backend-specialist to review API endpoints.
|
|
42
|
-
Finally, use the test-engineer to identify test gaps.
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Parallel Review
|
|
46
|
-
|
|
47
|
-
```text
|
|
48
|
-
Use security-auditor, code-reviewer, and performance-engineer in parallel.
|
|
49
|
-
Then synthesize the findings into one recommendation set.
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Recommended Patterns
|
|
53
|
-
|
|
54
|
-
### Pattern 1: Comprehensive Analysis
|
|
55
|
-
|
|
56
|
-
```text
|
|
57
|
-
Agents: codebase-explorer -> [domain-agents] -> synthesis
|
|
58
|
-
|
|
59
|
-
1. codebase-explorer: map the relevant code paths
|
|
60
|
-
2. security-auditor: security posture
|
|
61
|
-
3. backend-specialist: API and server quality
|
|
62
|
-
4. frontend-specialist: UI and interaction quality
|
|
63
|
-
5. test-engineer: test coverage and missing evidence
|
|
64
|
-
6. synthesize all findings
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Pattern 2: Feature Review
|
|
68
|
-
|
|
69
|
-
```text
|
|
70
|
-
Agents: affected-domain-agents -> test-engineer
|
|
71
|
-
|
|
72
|
-
1. identify the affected domains
|
|
73
|
-
2. invoke relevant domain agents
|
|
74
|
-
3. test-engineer checks missing validation or coverage
|
|
75
|
-
4. synthesize recommendations
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Pattern 3: Verification Sweep
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
Agents: code-reviewer + security-auditor + performance-engineer
|
|
82
|
-
|
|
83
|
-
1. code-reviewer: correctness and maintainability risks
|
|
84
|
-
2. security-auditor: security and logic risks
|
|
85
|
-
3. performance-engineer: bottlenecks and regression risk
|
|
86
|
-
4. synthesize priority-ranked findings
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Current Agent Set
|
|
90
|
-
|
|
91
|
-
| Agent | Expertise | Trigger Phrases |
|
|
92
|
-
|---|---|---|
|
|
93
|
-
| `orchestrator` | coordination | "multi-domain", "comprehensive", "orchestrate" |
|
|
94
|
-
| `requirements-engineer` | requirements | "scope", "acceptance criteria", "requirements" |
|
|
95
|
-
| `prp-core-planner` | planning | "plan", "breakdown", "milestones" |
|
|
96
|
-
| `codebase-explorer` | discovery | "explore", "map", "structure" |
|
|
97
|
-
| `backend-specialist` | backend | "API", "server", "Node.js", "Express" |
|
|
98
|
-
| `frontend-specialist` | frontend | "React", "UI", "components", "Next.js" |
|
|
99
|
-
| `database-architect` | database | "schema", "Prisma", "migrations" |
|
|
100
|
-
| `test-engineer` | testing | "tests", "coverage", "TDD" |
|
|
101
|
-
| `code-reviewer` | quality | "review", "risk", "correctness" |
|
|
102
|
-
| `security-auditor` | security | "security", "auth", "vulnerabilities" |
|
|
103
|
-
| `penetration-tester` | offensive security | "pentest", "exploit" |
|
|
104
|
-
| `performance-engineer` | performance | "slow", "optimize", "profiling" |
|
|
105
|
-
| `devops-engineer` | release/devops | "deploy", "CI/CD", "infrastructure" |
|
|
106
|
-
| `prp-core-debugger` | debugging | "bug", "error", "not working" |
|
|
107
|
-
| `documentation-maintainer` | docs | "write docs", "update docs", "README" |
|
|
108
|
-
| `prp-core-git-committer` | commit/release packaging | "commit", "release packaging" |
|
|
109
|
-
| `prp-core-git-pr-maker` | PR preparation | "pull request", "PR summary" |
|
|
110
|
-
| `ob-loop-engineer` | maintenance | "overnight maintenance", "maintenance loop", "cleanup loop" |
|
|
111
|
-
|
|
112
|
-
## Synthesis Protocol
|
|
113
|
-
|
|
114
|
-
After all agents complete, synthesize:
|
|
115
|
-
|
|
116
|
-
```markdown
|
|
117
|
-
## Orchestration Synthesis
|
|
118
|
-
|
|
119
|
-
### Task Summary
|
|
120
|
-
[What was accomplished]
|
|
121
|
-
|
|
122
|
-
### Agent Contributions
|
|
123
|
-
| Agent | Finding |
|
|
124
|
-
|-------|---------|
|
|
125
|
-
| security-auditor | Found X |
|
|
126
|
-
| backend-specialist | Identified Y |
|
|
127
|
-
|
|
128
|
-
### Consolidated Recommendations
|
|
129
|
-
1. **Critical**: [Issue from Agent A]
|
|
130
|
-
2. **Important**: [Issue from Agent B]
|
|
131
|
-
3. **Nice-to-have**: [Enhancement from Agent C]
|
|
132
|
-
|
|
133
|
-
### Action Items
|
|
134
|
-
- [ ] Fix critical issue
|
|
135
|
-
- [ ] Refactor affected area
|
|
136
|
-
- [ ] Add missing validation evidence
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Guardrails
|
|
140
|
-
|
|
141
|
-
- do not invent agent names that are not present in the repo
|
|
142
|
-
- do not require a legacy `PLAN.md` file in project root
|
|
143
|
-
- do not parallelize dependent tasks that need sequential ownership
|
|
144
|
-
- do not let orchestration replace the lifecycle owner
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: performance-optimization
|
|
3
|
-
description: "[Devflow] Optimizes application performance. Use when performance requirements exist, when you suspect performance regressions, or when Core Web Vitals or load times need improvement. Use when profiling reveals bottlenecks that need fixing."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Performance Optimization
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Measure before optimizing. Performance work without measurement is guessing — and guessing leads to premature optimization that adds complexity without improving what matters. Profile first, identify the actual bottleneck, fix it, measure again. Optimize only what measurements prove matters.
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- Performance requirements exist in the spec (load time budgets, response time SLAs)
|
|
15
|
-
- Users or monitoring report slow behavior
|
|
16
|
-
- Core Web Vitals scores are below thresholds
|
|
17
|
-
- You suspect a change introduced a regression
|
|
18
|
-
- Building features that handle large datasets or high traffic
|
|
19
|
-
|
|
20
|
-
**When NOT to use:** Don't optimize before you have evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains.
|
|
21
|
-
|
|
22
|
-
## Core Web Vitals Targets
|
|
23
|
-
|
|
24
|
-
| Metric | Good | Needs Improvement | Poor |
|
|
25
|
-
|--------|------|-------------------|------|
|
|
26
|
-
| **LCP** (Largest Contentful Paint) | ≤ 2.5s | ≤ 4.0s | > 4.0s |
|
|
27
|
-
| **INP** (Interaction to Next Paint) | ≤ 200ms | ≤ 500ms | > 500ms |
|
|
28
|
-
| **CLS** (Cumulative Layout Shift) | ≤ 0.1 | ≤ 0.25 | > 0.25 |
|
|
29
|
-
|
|
30
|
-
## The Optimization Workflow
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
1. MEASURE → Establish baseline with real data
|
|
34
|
-
2. IDENTIFY → Find the actual bottleneck (not assumed)
|
|
35
|
-
3. FIX → Address the specific bottleneck
|
|
36
|
-
4. VERIFY → Measure again, confirm improvement
|
|
37
|
-
5. GUARD → Add monitoring or tests to prevent regression
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Step 1: Measure
|
|
41
|
-
|
|
42
|
-
**Frontend:**
|
|
43
|
-
```bash
|
|
44
|
-
# Lighthouse in Chrome DevTools (or CI)
|
|
45
|
-
# Chrome DevTools → Performance tab → Record
|
|
46
|
-
# Chrome DevTools MCP → Performance trace
|
|
47
|
-
|
|
48
|
-
# Web Vitals library in code
|
|
49
|
-
import { onLCP, onINP, onCLS } from 'web-vitals';
|
|
50
|
-
|
|
51
|
-
onLCP(console.log);
|
|
52
|
-
onINP(console.log);
|
|
53
|
-
onCLS(console.log);
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Backend:**
|
|
57
|
-
```bash
|
|
58
|
-
# Response time logging
|
|
59
|
-
# Application Performance Monitoring (APM)
|
|
60
|
-
# Database query logging with timing
|
|
61
|
-
|
|
62
|
-
# Simple timing
|
|
63
|
-
console.time('db-query');
|
|
64
|
-
const result = await db.query(...);
|
|
65
|
-
console.timeEnd('db-query');
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Where to Start Measuring
|
|
69
|
-
|
|
70
|
-
Use the symptom to decide what to measure first:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
What is slow?
|
|
74
|
-
├── First page load
|
|
75
|
-
│ ├── Large bundle? --> Measure bundle size, check code splitting
|
|
76
|
-
│ ├── Slow server response? --> Measure TTFB, check API/database
|
|
77
|
-
│ └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking
|
|
78
|
-
├── Interaction feels sluggish
|
|
79
|
-
│ ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms)
|
|
80
|
-
│ ├── Form input lag? --> Check re-renders, controlled component overhead
|
|
81
|
-
│ └── Animation jank? --> Check layout thrashing, forced reflows
|
|
82
|
-
├── Page after navigation
|
|
83
|
-
│ ├── Data loading? --> Measure API response times, check for waterfalls
|
|
84
|
-
│ └── Client rendering? --> Profile component render time, check for N+1 fetches
|
|
85
|
-
└── Backend / API
|
|
86
|
-
├── Single endpoint slow? --> Profile database queries, check indexes
|
|
87
|
-
├── All endpoints slow? --> Check connection pool, memory, CPU
|
|
88
|
-
└── Intermittent slowness? --> Check for lock contention, GC pauses, external deps
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Step 2: Identify the Bottleneck
|
|
92
|
-
|
|
93
|
-
Common bottlenecks by category:
|
|
94
|
-
|
|
95
|
-
**Frontend:**
|
|
96
|
-
|
|
97
|
-
| Symptom | Likely Cause | Investigation |
|
|
98
|
-
|---------|-------------|---------------|
|
|
99
|
-
| Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes |
|
|
100
|
-
| High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution |
|
|
101
|
-
| Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace |
|
|
102
|
-
| Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
|
|
103
|
-
|
|
104
|
-
**Backend:**
|
|
105
|
-
|
|
106
|
-
| Symptom | Likely Cause | Investigation |
|
|
107
|
-
|---------|-------------|---------------|
|
|
108
|
-
| Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log |
|
|
109
|
-
| Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis |
|
|
110
|
-
| CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling |
|
|
111
|
-
| High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
|
|
112
|
-
|
|
113
|
-
### Step 3: Fix Common Anti-Patterns
|
|
114
|
-
|
|
115
|
-
#### N+1 Queries (Backend)
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
// BAD: N+1 — one query per task for the owner
|
|
119
|
-
const tasks = await db.tasks.findMany();
|
|
120
|
-
for (const task of tasks) {
|
|
121
|
-
task.owner = await db.users.findUnique({ where: { id: task.ownerId } });
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// GOOD: Single query with join/include
|
|
125
|
-
const tasks = await db.tasks.findMany({
|
|
126
|
-
include: { owner: true },
|
|
127
|
-
});
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
#### Unbounded Data Fetching
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
// BAD: Fetching all records
|
|
134
|
-
const allTasks = await db.tasks.findMany();
|
|
135
|
-
|
|
136
|
-
// GOOD: Paginated with limits
|
|
137
|
-
const tasks = await db.tasks.findMany({
|
|
138
|
-
take: 20,
|
|
139
|
-
skip: (page - 1) * 20,
|
|
140
|
-
orderBy: { createdAt: 'desc' },
|
|
141
|
-
});
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
#### Missing Image Optimization (Frontend)
|
|
145
|
-
|
|
146
|
-
```html
|
|
147
|
-
<!-- BAD: No dimensions, no lazy loading, no responsive sizes -->
|
|
148
|
-
<img src="/hero.jpg" />
|
|
149
|
-
|
|
150
|
-
<!-- GOOD: Responsive, lazy-loaded, properly sized -->
|
|
151
|
-
<img
|
|
152
|
-
src="/hero.jpg"
|
|
153
|
-
srcset="/hero-400.webp 400w, /hero-800.webp 800w, /hero-1200.webp 1200w"
|
|
154
|
-
sizes="(max-width: 768px) 100vw, 50vw"
|
|
155
|
-
width="1200"
|
|
156
|
-
height="600"
|
|
157
|
-
loading="lazy"
|
|
158
|
-
alt="Hero image description"
|
|
159
|
-
/>
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
#### Unnecessary Re-renders (React)
|
|
163
|
-
|
|
164
|
-
```tsx
|
|
165
|
-
// BAD: Creates new object on every render, causing children to re-render
|
|
166
|
-
function TaskList() {
|
|
167
|
-
return <TaskFilters options={{ sortBy: 'date', order: 'desc' }} />;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// GOOD: Stable reference
|
|
171
|
-
const DEFAULT_OPTIONS = { sortBy: 'date', order: 'desc' } as const;
|
|
172
|
-
function TaskList() {
|
|
173
|
-
return <TaskFilters options={DEFAULT_OPTIONS} />;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Use React.memo for expensive components
|
|
177
|
-
const TaskItem = React.memo(function TaskItem({ task }: Props) {
|
|
178
|
-
return <div>{/* expensive render */}</div>;
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Use useMemo for expensive computations
|
|
182
|
-
function TaskStats({ tasks }: Props) {
|
|
183
|
-
const stats = useMemo(() => calculateStats(tasks), [tasks]);
|
|
184
|
-
return <div>{stats.completed} / {stats.total}</div>;
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
#### Large Bundle Size
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
// BAD: Importing entire library
|
|
192
|
-
import { format } from 'date-fns';
|
|
193
|
-
|
|
194
|
-
// GOOD: Tree-shakable import (if the library supports it)
|
|
195
|
-
import { format } from 'date-fns/format';
|
|
196
|
-
|
|
197
|
-
// GOOD: Dynamic import for heavy, rarely-used features
|
|
198
|
-
const ChartLibrary = lazy(() => import('./ChartLibrary'));
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
#### Missing Caching (Backend)
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
// Cache frequently-read, rarely-changed data
|
|
205
|
-
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
206
|
-
let cachedConfig: AppConfig | null = null;
|
|
207
|
-
let cacheExpiry = 0;
|
|
208
|
-
|
|
209
|
-
async function getAppConfig(): Promise<AppConfig> {
|
|
210
|
-
if (cachedConfig && Date.now() < cacheExpiry) {
|
|
211
|
-
return cachedConfig;
|
|
212
|
-
}
|
|
213
|
-
cachedConfig = await db.config.findFirst();
|
|
214
|
-
cacheExpiry = Date.now() + CACHE_TTL;
|
|
215
|
-
return cachedConfig;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// HTTP caching headers for static assets
|
|
219
|
-
app.use('/static', express.static('public', {
|
|
220
|
-
maxAge: '1y', // Cache for 1 year
|
|
221
|
-
immutable: true, // Never revalidate (use content hashing in filenames)
|
|
222
|
-
}));
|
|
223
|
-
|
|
224
|
-
// Cache-Control for API responses
|
|
225
|
-
res.set('Cache-Control', 'public, max-age=300'); // 5 minutes
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## Bundle & Runtime Analysis
|
|
229
|
-
|
|
230
|
-
### Bundle Analysis
|
|
231
|
-
- **Large Dependencies**: Check top of bundle for oversized libraries.
|
|
232
|
-
- **Duplicate Code**: Look for duplicate modules in multiple chunks.
|
|
233
|
-
- **Tree Shaking**: Ensure unused exports are being removed.
|
|
234
|
-
- **Code Splitting**: Move heavy routes out of the main bundle.
|
|
235
|
-
|
|
236
|
-
### Runtime Profiling (DevTools Performance)
|
|
237
|
-
- **Long Tasks (>50ms)**: Identify UI blocking operations.
|
|
238
|
-
- **Layout Thrashing**: Find forced reflows during animations/scrolling.
|
|
239
|
-
- **Memory Leaks**: Look for growing heap size or detached DOM nodes.
|
|
240
|
-
|
|
241
|
-
## Performance Budget
|
|
242
|
-
|
|
243
|
-
Set budgets and enforce them:
|
|
244
|
-
|
|
245
|
-
```
|
|
246
|
-
JavaScript bundle: < 200KB gzipped (initial load)
|
|
247
|
-
CSS: < 50KB gzipped
|
|
248
|
-
Images: < 200KB per image (above the fold)
|
|
249
|
-
Fonts: < 100KB total
|
|
250
|
-
API response time: < 200ms (p95)
|
|
251
|
-
Time to Interactive: < 3.5s on 4G
|
|
252
|
-
Lighthouse Performance score: ≥ 90
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Enforce in CI:**
|
|
256
|
-
```bash
|
|
257
|
-
# Bundle size check
|
|
258
|
-
npx bundlesize --config bundlesize.config.json
|
|
259
|
-
|
|
260
|
-
# Lighthouse CI
|
|
261
|
-
npx lhci autorun
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
## See Also
|
|
265
|
-
|
|
266
|
-
For detailed performance checklists, optimization commands, and anti-pattern reference, see `performance-checklist.md`.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
## Common Rationalizations
|
|
270
|
-
|
|
271
|
-
| Rationalization | Reality |
|
|
272
|
-
|---|---|
|
|
273
|
-
| "We'll optimize later" | Performance debt compounds. Fix obvious anti-patterns now, defer micro-optimizations. |
|
|
274
|
-
| "It's fast on my machine" | Your machine isn't the user's. Profile on representative hardware and networks. |
|
|
275
|
-
| "This optimization is obvious" | If you didn't measure, you don't know. Profile first. |
|
|
276
|
-
| "Users won't notice 100ms" | Research shows 100ms delays impact conversion rates. Users notice more than you think. |
|
|
277
|
-
| "The framework handles performance" | Frameworks prevent some issues but can't fix N+1 queries or oversized bundles. |
|
|
278
|
-
|
|
279
|
-
## Red Flags
|
|
280
|
-
|
|
281
|
-
- Optimization without profiling data to justify it
|
|
282
|
-
- N+1 query patterns in data fetching
|
|
283
|
-
- List endpoints without pagination
|
|
284
|
-
- Images without dimensions, lazy loading, or responsive sizes
|
|
285
|
-
- Bundle size growing without review
|
|
286
|
-
- No performance monitoring in production
|
|
287
|
-
- `React.memo` and `useMemo` everywhere (overusing is as bad as underusing)
|
|
288
|
-
|
|
289
|
-
## Verification
|
|
290
|
-
|
|
291
|
-
After any performance-related change:
|
|
292
|
-
|
|
293
|
-
- [ ] Before and after measurements exist (specific numbers)
|
|
294
|
-
- [ ] The specific bottleneck is identified and addressed
|
|
295
|
-
- [ ] Core Web Vitals are within "Good" thresholds
|
|
296
|
-
- [ ] Bundle size hasn't increased significantly
|
|
297
|
-
- [ ] No N+1 queries in new data fetching code
|
|
298
|
-
- [ ] Performance budget passes in CI (if configured)
|
|
299
|
-
- [ ] Existing tests still pass (optimization didn't break behavior)
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Performance Checklist
|
|
2
|
-
|
|
3
|
-
Quick reference checklist for web application performance. Use alongside the `performance-optimization` skill.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Core Web Vitals Targets](#core-web-vitals-targets)
|
|
8
|
-
- [Frontend Checklist](#frontend-checklist)
|
|
9
|
-
- [Backend Checklist](#backend-checklist)
|
|
10
|
-
- [Measurement Commands](#measurement-commands)
|
|
11
|
-
- [Common Anti-Patterns](#common-anti-patterns)
|
|
12
|
-
|
|
13
|
-
## Core Web Vitals Targets
|
|
14
|
-
|
|
15
|
-
| Metric | Good | Needs Work | Poor |
|
|
16
|
-
|--------|------|------------|------|
|
|
17
|
-
| LCP (Largest Contentful Paint) | ≤ 2.5s | ≤ 4.0s | > 4.0s |
|
|
18
|
-
| INP (Interaction to Next Paint) | ≤ 200ms | ≤ 500ms | > 500ms |
|
|
19
|
-
| CLS (Cumulative Layout Shift) | ≤ 0.1 | ≤ 0.25 | > 0.25 |
|
|
20
|
-
|
|
21
|
-
## Frontend Checklist
|
|
22
|
-
|
|
23
|
-
### Images
|
|
24
|
-
- [ ] Images use modern formats (WebP, AVIF)
|
|
25
|
-
- [ ] Images are responsively sized (`srcset` and `sizes`)
|
|
26
|
-
- [ ] Images have explicit `width` and `height` attributes (prevents CLS)
|
|
27
|
-
- [ ] Below-the-fold images use `loading="lazy"`
|
|
28
|
-
- [ ] Hero/LCP images use `fetchpriority="high"` and no lazy loading
|
|
29
|
-
|
|
30
|
-
### JavaScript
|
|
31
|
-
- [ ] Bundle size under 200KB gzipped (initial load)
|
|
32
|
-
- [ ] Code splitting with dynamic `import()` for routes and heavy features
|
|
33
|
-
- [ ] Tree shaking enabled (no dead code in production bundle)
|
|
34
|
-
- [ ] No blocking JavaScript in `<head>` (use `defer` or `async`)
|
|
35
|
-
- [ ] Heavy computation offloaded to Web Workers (if applicable)
|
|
36
|
-
- [ ] `React.memo()` on expensive components that re-render with same props
|
|
37
|
-
- [ ] `useMemo()` / `useCallback()` only where profiling shows benefit
|
|
38
|
-
|
|
39
|
-
### CSS
|
|
40
|
-
- [ ] Critical CSS inlined or preloaded
|
|
41
|
-
- [ ] No render-blocking CSS for non-critical styles
|
|
42
|
-
- [ ] No CSS-in-JS runtime cost in production (use extraction)
|
|
43
|
-
- [ ] Font display strategy set (`font-display: swap` or `optional`)
|
|
44
|
-
- [ ] System font stack considered before custom fonts
|
|
45
|
-
|
|
46
|
-
### Network
|
|
47
|
-
- [ ] Static assets cached with long `max-age` + content hashing
|
|
48
|
-
- [ ] API responses cached where appropriate (`Cache-Control`)
|
|
49
|
-
- [ ] HTTP/2 or HTTP/3 enabled
|
|
50
|
-
- [ ] Resources preconnected (`<link rel="preconnect">`) for known origins
|
|
51
|
-
- [ ] No unnecessary redirects
|
|
52
|
-
|
|
53
|
-
### Rendering
|
|
54
|
-
- [ ] No layout thrashing (forced synchronous layouts)
|
|
55
|
-
- [ ] Animations use `transform` and `opacity` (GPU-accelerated)
|
|
56
|
-
- [ ] Long lists use virtualization (e.g., `react-window`)
|
|
57
|
-
- [ ] No unnecessary full-page re-renders
|
|
58
|
-
|
|
59
|
-
## Backend Checklist
|
|
60
|
-
|
|
61
|
-
### Database
|
|
62
|
-
- [ ] No N+1 query patterns (use eager loading / joins)
|
|
63
|
-
- [ ] Queries have appropriate indexes
|
|
64
|
-
- [ ] List endpoints paginated (never `SELECT * FROM table`)
|
|
65
|
-
- [ ] Connection pooling configured
|
|
66
|
-
- [ ] Slow query logging enabled
|
|
67
|
-
|
|
68
|
-
### API
|
|
69
|
-
- [ ] Response times < 200ms (p95)
|
|
70
|
-
- [ ] No synchronous heavy computation in request handlers
|
|
71
|
-
- [ ] Bulk operations instead of loops of individual calls
|
|
72
|
-
- [ ] Response compression (gzip/brotli)
|
|
73
|
-
- [ ] Appropriate caching (in-memory, Redis, CDN)
|
|
74
|
-
|
|
75
|
-
### Infrastructure
|
|
76
|
-
- [ ] CDN for static assets
|
|
77
|
-
- [ ] Server located close to users (or edge deployment)
|
|
78
|
-
- [ ] Horizontal scaling configured (if needed)
|
|
79
|
-
- [ ] Health check endpoint for load balancer
|
|
80
|
-
|
|
81
|
-
## Measurement Commands
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
# Lighthouse CLI
|
|
85
|
-
npx lighthouse https://localhost:3000 --output json --output-path ./report.json
|
|
86
|
-
|
|
87
|
-
# Bundle analysis
|
|
88
|
-
npx webpack-bundle-analyzer stats.json
|
|
89
|
-
# or for Vite:
|
|
90
|
-
npx vite-bundle-visualizer
|
|
91
|
-
|
|
92
|
-
# Check bundle size
|
|
93
|
-
npx bundlesize
|
|
94
|
-
|
|
95
|
-
# Web Vitals in code
|
|
96
|
-
import { onLCP, onINP, onCLS } from 'web-vitals';
|
|
97
|
-
onLCP(console.log);
|
|
98
|
-
onINP(console.log);
|
|
99
|
-
onCLS(console.log);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Common Anti-Patterns
|
|
103
|
-
|
|
104
|
-
| Anti-Pattern | Impact | Fix |
|
|
105
|
-
|---|---|---|
|
|
106
|
-
| N+1 queries | Linear DB load growth | Use joins, includes, or batch loading |
|
|
107
|
-
| Unbounded queries | Memory exhaustion, timeouts | Always paginate, add LIMIT |
|
|
108
|
-
| Missing indexes | Slow reads as data grows | Add indexes for filtered/sorted columns |
|
|
109
|
-
| Layout thrashing | Jank, dropped frames | Batch DOM reads, then batch writes |
|
|
110
|
-
| Unoptimized images | Slow LCP, wasted bandwidth | Use WebP, responsive sizes, lazy load |
|
|
111
|
-
| Large bundles | Slow Time to Interactive | Code split, tree shake, audit deps |
|
|
112
|
-
| Blocking main thread | Poor INP, unresponsive UI | Use Web Workers, defer work |
|
|
113
|
-
| Memory leaks | Growing memory, eventual crash | Clean up listeners, intervals, refs |
|