flutter-pro-max-cli 2.1.5 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,8 +83,8 @@ This CLI bridges the gap between the Flutter Pro Max knowledge base and your dev
83
83
  | **Antigravity (Google)** | `antigravity` | Full | Compact (~5KB) | **12,000 chars** |
84
84
  | **Cursor** | `cursor` | Reference | Full (~13KB) | No Limit |
85
85
  | **Windsurf** | `windsurf` | Reference | Full (~13KB) | No Limit |
86
- | **GitHub Copilot** | `copilot` | Reference | Mini (~2KB) | **~4,000 chars** |
87
- | **VS Code** | `vscode` | Reference | Mini (~2KB) | Unknown |
86
+ | **GitHub Copilot** | `copilot` | Full | Full (~15KB) | No Limit |
87
+ | **VS Code** | `vscode` | Full | Full (~15KB) | No Limit |
88
88
  | **Kiro** | `kiro` | Reference | Full (~13KB) | No Limit |
89
89
  | **RooCode** | `roocode` | Reference | Full (~13KB) | No Limit |
90
90
  | **Qodo/Qoder** | `qoder` | Reference | Full (~13KB) | No Limit |
@@ -193,6 +193,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
193
193
 
194
194
  ## 📝 Changelog
195
195
 
196
+ ### v2.3.0 (2026-02-06)
197
+ - **VS Code 1.109 Support**: GitHub Copilot và VS Code sử dụng `.github/skills/` format
198
+ - **Breaking Change**: Copilot/VS Code chuyển từ prompts/instructions sang Skills
199
+ - **Full Install**: Copilot và VS Code nay sử dụng full template (~15KB) thay vì mini
200
+
196
201
  ### v2.2.0 (2026-02-02)
197
202
  - **Flutter AI Rules**: Cập nhật theo [Flutter Official AI Rules](https://docs.flutter.dev/ai/ai-rules)
198
203
  - **Platform Limits**: Tạo templates phù hợp với giới hạn từng platform
@@ -0,0 +1,51 @@
1
+ # Flutter Pro Max — Agent Rules
2
+
3
+ > Các rules này được tự động generate bởi `flutter-pro-max-cli`.
4
+ > Chúng là project-level rules, TÁCH BIỆT khỏi skill content.
5
+
6
+ ---
7
+
8
+ ## Rule 1: Tự động sử dụng Skill
9
+
10
+ **TRƯỚC KHI viết code Flutter**, bạn PHẢI tự động sử dụng skill để lấy knowledge phù hợp. Không được bỏ qua bước này.
11
+
12
+ | Tình huống | Domains cần search |
13
+ |------------|-------------------|
14
+ | Tạo UI/Screen mới | `style`, `pattern`, `color`, `typography`, `landing` |
15
+ | Chọn package/thư viện | `package` (kèm `--stack` filter nếu có) |
16
+ | Thiết kế kiến trúc | `architect`, `pattern` |
17
+ | Tối ưu performance | `performance` |
18
+ | Accessibility | `accessibility` |
19
+ | Không chắc UI style | Dùng `--design-system` để generate design system |
20
+
21
+ **Workflow bắt buộc:**
22
+
23
+ ```
24
+ User request → Search skill (≥2 domains) → Đọc kết quả → Áp dụng vào code
25
+ ```
26
+
27
+ > ⚠️ Viết code Flutter mà không tham khảo skill trước = thiếu context = code chất lượng thấp.
28
+
29
+ ---
30
+
31
+ ## Rule 2: Think-Before-Code Protocol
32
+
33
+ **TRƯỚC KHI tạo file mới hoặc viết widget**, bạn PHẢI trả lời 5 câu hỏi:
34
+
35
+ 1. **File này có vượt 300 dòng không?** → Nếu có khả năng, TÁCH ngay từ đầu
36
+ 2. **Widget/Component này đã tồn tại chưa?** → Search codebase trước, REUSE nếu có
37
+ 3. **Widget này có thể reuse cho nơi khác không?** → Nếu có, đặt vào `core/widgets/` hoặc shared folder
38
+ 4. **Logic này thuộc layer nào?** → UI / Domain / Data — KHÔNG được trộn layers
39
+ 5. **Có widget/hàm nào đang lặp logic tương tự không?** → Nếu có, REFACTOR thành shared component
40
+
41
+ ### Nguyên tắc cứng
42
+
43
+ | ❌ Sai | ✅ Đúng |
44
+ |--------|---------|
45
+ | Tạo `UserCard` mới khi đã có `ProfileCard` tương tự | Mở rộng `ProfileCard` hoặc extract shared `BaseCard` |
46
+ | Screen 500+ dòng | Tách thành `_HeaderSection`, `_ContentBody`, `_ActionBar` |
47
+ | 3 screens cùng copy-paste search bar | Tạo `SearchableScaffold` dùng chung |
48
+ | Hardcode colors, padding, font sizes | Dùng `Theme.of(context)`, design tokens, constants |
49
+ | Business logic trong Widget `build()` | Tách vào UseCase / Service / Provider |
50
+
51
+ > 🔴 **REUSE > CREATE.** Không bao giờ tạo file mới mà không kiểm tra codebase hiện tại trước.
@@ -216,7 +216,7 @@ python3 {{SCRIPT_PATH}}/search.py "<keyword>" --domain package --top 5
216
216
  python3 {{SCRIPT_PATH}}/search.py "<keyword>" --stack riverpod --top 5
217
217
  ```
218
218
 
219
- **Available domains:** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`
219
+ **Available domains (17):** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`, `performance`, `ui-reasoning`, `accessibility`
220
220
 
221
221
  **Available stacks:** `riverpod`, `bloc`, `provider`
222
222
 
@@ -230,6 +230,9 @@ python3 {{SCRIPT_PATH}}/search.py "<keyword>" --stack riverpod --top 5
230
230
  | Packages | `package.csv` | 100+ packages |
231
231
  | Patterns | `patterns.csv` | 100+ design patterns |
232
232
  | Architecture | `architect.csv` | Clean Architecture layers |
233
+ | Performance | `flutter-performance.csv` | 35+ performance patterns |
234
+ | Accessibility | `mobile-accessibility.csv` | 35+ accessibility patterns |
235
+ | UI Reasoning | `ui-reasoning.csv` | 35+ UI decision rules |
233
236
  | Charts | `charts.csv` | Chart recommendations |
234
237
  | Colors | `colors.csv` | Color palettes |
235
238
  | Typography | `typography.csv` | Font pairings |
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content-10k.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Flutter development guide with widgets, packages, patterns, architecture, performance, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".agent/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "Flutter Pro Max - Flutter Design Intelligence",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": "CLAUDE.md",
24
+ "mode": "append"
25
+ }
22
26
  }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".codebuddy/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".codex/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".continue/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "platform": "copilot",
3
3
  "displayName": "GitHub Copilot",
4
- "installType": "reference",
4
+ "installType": "full",
5
5
  "folderStructure": {
6
6
  "root": ".github",
7
- "skillPath": "prompts",
8
- "filename": "flutter-pro-max.prompt.md"
7
+ "skillPath": "skills/flutter-pro-max",
8
+ "filename": "SKILL.md"
9
+ },
10
+ "scriptPath": "skills/flutter-pro-max/scripts/search.py",
11
+ "frontmatter": {
12
+ "name": "flutter-pro-max",
13
+ "description": "Flutter design intelligence. Widgets, packages, patterns, architecture, performance optimization, accessibility, and UI/UX best practices."
9
14
  },
10
- "scriptPath": ".shared/flutter-pro-max/scripts/search.py",
11
- "frontmatter": null,
12
15
  "sections": {
13
16
  "quickReference": true
14
17
  },
15
- "template": "skill-content-4k.md",
16
- "title": "flutter-pro-max",
17
- "description": "Flutter development guide with widgets, packages, patterns, architecture, performance, and UI/UX best practices.",
18
- "skillOrWorkflow": "Workflow"
19
- }
18
+ "template": "skill-content.md",
19
+ "title": "Flutter Pro Max - Flutter Design Intelligence",
20
+ "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".github/copilot-instructions.md",
24
+ "mode": "append"
25
+ }
26
+ }
@@ -15,5 +15,9 @@
15
15
  "template": "skill-content.md",
16
16
  "title": "flutter-pro-max",
17
17
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
18
- "skillOrWorkflow": "Workflow"
19
- }
18
+ "skillOrWorkflow": "Workflow",
19
+ "rulesFile": {
20
+ "path": ".cursor/rules/flutter-pro-max.mdc",
21
+ "mode": "create"
22
+ }
23
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "Flutter Pro Max - Flutter Design Intelligence",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".gemini/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -15,5 +15,9 @@
15
15
  "template": "skill-content.md",
16
16
  "title": "Flutter Pro Max - Flutter Design Intelligence",
17
17
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
18
- "skillOrWorkflow": "Skill"
19
- }
18
+ "skillOrWorkflow": "Skill",
19
+ "rulesFile": {
20
+ "path": ".junie/rules/flutter-pro-max.md",
21
+ "mode": "create"
22
+ }
23
+ }
@@ -15,5 +15,9 @@
15
15
  "template": "skill-content.md",
16
16
  "title": "flutter-pro-max",
17
17
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
18
- "skillOrWorkflow": "Workflow"
19
- }
18
+ "skillOrWorkflow": "Workflow",
19
+ "rulesFile": {
20
+ "path": ".kiro/rules/flutter-pro-max.md",
21
+ "mode": "create"
22
+ }
23
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".opencode/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".qoder/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -15,5 +15,9 @@
15
15
  "template": "skill-content.md",
16
16
  "title": "flutter-pro-max",
17
17
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
18
- "skillOrWorkflow": "Workflow"
19
- }
18
+ "skillOrWorkflow": "Workflow",
19
+ "rulesFile": {
20
+ "path": ".roo/rules/flutter-pro-max.md",
21
+ "mode": "create"
22
+ }
23
+ }
@@ -18,5 +18,9 @@
18
18
  "template": "skill-content.md",
19
19
  "title": "flutter-pro-max",
20
20
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
- "skillOrWorkflow": "Skill"
22
- }
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".trae/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "platform": "vscode",
3
3
  "displayName": "VS Code",
4
- "installType": "reference",
4
+ "installType": "full",
5
5
  "folderStructure": {
6
- "root": ".vscode",
7
- "skillPath": "instructions",
8
- "filename": "flutter-pro-max.instructions.md"
6
+ "root": ".github",
7
+ "skillPath": "skills/flutter-pro-max",
8
+ "filename": "SKILL.md"
9
+ },
10
+ "scriptPath": "skills/flutter-pro-max/scripts/search.py",
11
+ "frontmatter": {
12
+ "name": "flutter-pro-max",
13
+ "description": "Flutter design intelligence. Widgets, packages, patterns, architecture, performance optimization, accessibility, and UI/UX best practices."
9
14
  },
10
- "scriptPath": ".shared/flutter-pro-max/scripts/search.py",
11
- "frontmatter": null,
12
15
  "sections": {
13
16
  "quickReference": true
14
17
  },
15
- "template": "skill-content-4k.md",
16
- "title": "Flutter Pro Max",
17
- "description": "Flutter development guide with widgets, packages, patterns, architecture, performance, and UI/UX best practices.",
18
- "skillOrWorkflow": "Workflow"
19
- }
18
+ "template": "skill-content.md",
19
+ "title": "Flutter Pro Max - Flutter Design Intelligence",
20
+ "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
21
+ "skillOrWorkflow": "Skill",
22
+ "rulesFile": {
23
+ "path": ".vscode/rules/flutter-pro-max.md",
24
+ "mode": "create"
25
+ }
26
+ }
@@ -15,5 +15,9 @@
15
15
  "template": "skill-content.md",
16
16
  "title": "flutter-pro-max",
17
17
  "description": "Comprehensive Flutter development guide with searchable database of widgets, packages, design patterns, architecture guidelines, performance optimization, accessibility, and UI/UX best practices.",
18
- "skillOrWorkflow": "Skill"
19
- }
18
+ "skillOrWorkflow": "Skill",
19
+ "rulesFile": {
20
+ "path": ".windsurf/rules/flutter-pro-max.md",
21
+ "mode": "create"
22
+ }
23
+ }
@@ -35,6 +35,10 @@ export interface PlatformConfig {
35
35
  title: string;
36
36
  description: string;
37
37
  skillOrWorkflow: string;
38
+ rulesFile?: {
39
+ path: string;
40
+ mode: 'create' | 'append';
41
+ };
38
42
  }
39
43
  export declare const AI_TYPES: AIType[];
40
44
  export declare const AI_FOLDERS: Record<Exclude<AIType, 'all'>, string[]>;
@@ -16,5 +16,5 @@ export const AI_FOLDERS = {
16
16
  opencode: ['.opencode', '.shared'],
17
17
  continue: ['.continue', '.shared'],
18
18
  junie: ['.junie', '.shared'],
19
- vscode: ['.vscode', '.shared'],
19
+ vscode: ['.github', '.shared'],
20
20
  };
@@ -65,7 +65,7 @@ export function getAITypeDescription(aiType) {
65
65
  case 'antigravity':
66
66
  return 'Antigravity / Generic Agent (.agent/skills/)';
67
67
  case 'copilot':
68
- return 'GitHub Copilot (.github/prompts/)';
68
+ return 'GitHub Copilot (.github/skills/)';
69
69
  case 'kiro':
70
70
  return 'Kiro (.kiro/steering/)';
71
71
  case 'codex':
@@ -87,7 +87,7 @@ export function getAITypeDescription(aiType) {
87
87
  case 'junie':
88
88
  return 'JetBrains AI / Junie (.junie/skills/)';
89
89
  case 'vscode':
90
- return 'VS Code (.vscode/instructions/)';
90
+ return 'VS Code (.github/skills/)';
91
91
  case 'all':
92
92
  return 'All AI assistants';
93
93
  }
@@ -1,9 +1,15 @@
1
1
  import type { AIType } from '../types/index.js';
2
2
  export declare function extractZip(zipPath: string, destDir: string): Promise<void>;
3
+ export declare function copyFolders(sourceDir: string, targetDir: string, aiType: AIType): Promise<string[]>;
4
+ export declare function cleanup(tempDir: string): Promise<void>;
5
+ /**
6
+ * Create a temporary directory for extracting ZIP files
7
+ */
3
8
  export declare function createTempDir(): Promise<string>;
9
+ /**
10
+ * Install from a downloaded and extracted ZIP file
11
+ */
4
12
  export declare function installFromZip(zipPath: string, targetDir: string, aiType: AIType): Promise<{
5
13
  copiedFolders: string[];
6
14
  tempDir: string;
7
15
  }>;
8
- export declare function copyFolders(sourceDir: string, targetDir: string, aiType: AIType): Promise<string[]>;
9
- export declare function cleanup(tempDir: string): Promise<void>;
@@ -0,0 +1,125 @@
1
+ import { mkdir, rm, access, cp, mkdtemp, readdir } from 'node:fs/promises';
2
+ import { join, basename } from 'node:path';
3
+ import { exec } from 'node:child_process';
4
+ import { promisify } from 'node:util';
5
+ import { tmpdir } from 'node:os';
6
+ import { AI_FOLDERS } from '../types/index.js';
7
+ const execAsync = promisify(exec);
8
+ const EXCLUDED_FILES = ['settings.local.json'];
9
+ export async function extractZip(zipPath, destDir) {
10
+ try {
11
+ const isWindows = process.platform === 'win32';
12
+ if (isWindows) {
13
+ await execAsync(`powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${destDir}' -Force"`);
14
+ }
15
+ else {
16
+ await execAsync(`unzip -o "${zipPath}" -d "${destDir}"`);
17
+ }
18
+ }
19
+ catch (error) {
20
+ throw new Error(`Failed to extract zip: ${error}`);
21
+ }
22
+ }
23
+ async function exists(path) {
24
+ try {
25
+ await access(path);
26
+ return true;
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ }
32
+ export async function copyFolders(sourceDir, targetDir, aiType) {
33
+ const copiedFolders = [];
34
+ const foldersToCopy = aiType === 'all'
35
+ ? Object.values(AI_FOLDERS).flat()
36
+ : AI_FOLDERS[aiType];
37
+ // Deduplicate folders (e.g., .shared might be listed multiple times)
38
+ const uniqueFolders = [...new Set(foldersToCopy)];
39
+ for (const folder of uniqueFolders) {
40
+ const sourcePath = join(sourceDir, folder);
41
+ const targetPath = join(targetDir, folder);
42
+ // Check if source folder exists
43
+ const sourceExists = await exists(sourcePath);
44
+ if (!sourceExists) {
45
+ continue;
46
+ }
47
+ // Create target directory if needed
48
+ await mkdir(targetPath, { recursive: true });
49
+ // Filter function to exclude certain files
50
+ const filterFn = (src) => {
51
+ const fileName = basename(src);
52
+ return !EXCLUDED_FILES.includes(fileName);
53
+ };
54
+ // Copy recursively
55
+ try {
56
+ await cp(sourcePath, targetPath, { recursive: true, filter: filterFn });
57
+ copiedFolders.push(folder);
58
+ }
59
+ catch {
60
+ // Try shell fallback for older Node versions
61
+ try {
62
+ if (process.platform === 'win32') {
63
+ await execAsync(`xcopy "${sourcePath}" "${targetPath}" /E /I /Y`);
64
+ }
65
+ else {
66
+ await execAsync(`cp -r "${sourcePath}/." "${targetPath}"`);
67
+ }
68
+ copiedFolders.push(folder);
69
+ }
70
+ catch {
71
+ // Skip if copy fails
72
+ }
73
+ }
74
+ }
75
+ return copiedFolders;
76
+ }
77
+ export async function cleanup(tempDir) {
78
+ try {
79
+ await rm(tempDir, { recursive: true, force: true });
80
+ }
81
+ catch {
82
+ // Ignore cleanup errors
83
+ }
84
+ }
85
+ /**
86
+ * Create a temporary directory for extracting ZIP files
87
+ */
88
+ export async function createTempDir() {
89
+ return mkdtemp(join(tmpdir(), 'flutter-pro-max-'));
90
+ }
91
+ /**
92
+ * Find the extracted folder inside temp directory
93
+ * GitHub release ZIPs often contain a single root folder
94
+ */
95
+ async function findExtractedRoot(tempDir) {
96
+ const entries = await readdir(tempDir, { withFileTypes: true });
97
+ const dirs = entries.filter(e => e.isDirectory());
98
+ // If there's exactly one directory, it's likely the extracted root
99
+ if (dirs.length === 1) {
100
+ return join(tempDir, dirs[0].name);
101
+ }
102
+ // Otherwise, assume tempDir itself is the root
103
+ return tempDir;
104
+ }
105
+ /**
106
+ * Install from a downloaded and extracted ZIP file
107
+ */
108
+ export async function installFromZip(zipPath, targetDir, aiType) {
109
+ // Create temp directory
110
+ const tempDir = await createTempDir();
111
+ try {
112
+ // Extract ZIP to temp directory
113
+ await extractZip(zipPath, tempDir);
114
+ // Find the actual root of the extracted content
115
+ const extractedRoot = await findExtractedRoot(tempDir);
116
+ // Copy folders from extracted content to target
117
+ const copiedFolders = await copyFolders(extractedRoot, targetDir, aiType);
118
+ return { copiedFolders, tempDir };
119
+ }
120
+ catch (error) {
121
+ // Cleanup on error
122
+ await cleanup(tempDir);
123
+ throw error;
124
+ }
125
+ }
@@ -144,6 +144,36 @@ async function ensureSharedExists(targetDir) {
144
144
  await copyDataAndScripts(sharedDir);
145
145
  return true; // Created new
146
146
  }
147
+ /**
148
+ * Generate rules file for a platform
149
+ */
150
+ async function generateRulesFile(targetDir, config) {
151
+ if (!config.rulesFile)
152
+ return;
153
+ // Load rules template
154
+ const rulesContent = await loadTemplate('base/rules.md');
155
+ const rulesFilePath = join(targetDir, config.rulesFile.path);
156
+ const rulesDir = dirname(rulesFilePath);
157
+ // Create directory structure
158
+ await mkdir(rulesDir, { recursive: true });
159
+ if (config.rulesFile.mode === 'append') {
160
+ // Append mode: add to existing file (e.g. CLAUDE.md, copilot-instructions.md)
161
+ let existing = '';
162
+ if (await exists(rulesFilePath)) {
163
+ existing = await readFile(rulesFilePath, 'utf-8');
164
+ // Check if rules already appended
165
+ if (existing.includes('Flutter Pro Max — Agent Rules')) {
166
+ return; // Already has rules
167
+ }
168
+ existing += '\n\n';
169
+ }
170
+ await writeFile(rulesFilePath, existing + rulesContent, 'utf-8');
171
+ }
172
+ else {
173
+ // Create mode: write new file
174
+ await writeFile(rulesFilePath, rulesContent, 'utf-8');
175
+ }
176
+ }
147
177
  /**
148
178
  * Generate platform files for a specific AI type
149
179
  */
@@ -171,6 +201,8 @@ export async function generatePlatformFiles(targetDir, aiType) {
171
201
  createdFolders.push('.shared');
172
202
  }
173
203
  }
204
+ // Generate rules file (standalone, separate from skill)
205
+ await generateRulesFile(targetDir, config);
174
206
  return createdFolders;
175
207
  }
176
208
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flutter-pro-max-cli",
3
- "version": "2.1.5",
3
+ "version": "2.3.1",
4
4
  "description": "CLI to install Flutter Pro Max skill for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Bui Long
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.