optikit 1.2.5 → 1.3.0
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/.claude/commands/build.md +57 -0
- package/.claude/commands/clean.md +45 -0
- package/.claude/commands/generate.md +64 -0
- package/.claude/commands/rollback.md +67 -0
- package/.claude/commands/run.md +63 -0
- package/.claude/commands/setup.md +69 -0
- package/.claude/commands/sync-docs.md +148 -0
- package/.claude/commands/version.md +63 -0
- package/.claude/settings.local.json +28 -0
- package/.claude-plugin/marketplace.json +36 -0
- package/.claude-plugin/plugin.json +25 -0
- package/.history/README_20260325211923.md +268 -0
- package/.history/README_20260325212116.md +268 -0
- package/.history/README_20260325212234.md +266 -0
- package/.history/README_20260325221838.md +321 -0
- package/.history/README_20260325221920.md +327 -0
- package/.history/README_20260325222245.md +328 -0
- package/.history/README_20260325222247.md +328 -0
- package/.mcp.json +8 -0
- package/CHANGELOG.md +67 -98
- package/CLAUDE.md +57 -206
- package/OPTIKIT_AGENT.md +398 -0
- package/README.md +293 -60
- package/dist/cli.js +75 -244
- package/dist/commands/build/commands.js +146 -0
- package/dist/commands/build/testflight.js +14 -0
- package/dist/commands/clean/commands.js +41 -0
- package/dist/commands/clean/flutter.js +8 -14
- package/dist/commands/clean/ios.js +12 -15
- package/dist/commands/config/aliases.js +122 -0
- package/dist/commands/config/commands.js +49 -0
- package/dist/commands/config/initApp.js +191 -0
- package/dist/commands/config/rollback.js +15 -4
- package/dist/commands/config/upgrade.js +36 -0
- package/dist/commands/mcp/commands.js +21 -0
- package/dist/commands/mcp/server.js +27 -0
- package/dist/commands/mcp/setup.js +62 -0
- package/dist/commands/mcp/tools.js +359 -0
- package/dist/commands/project/commands.js +132 -0
- package/dist/commands/project/devices.js +10 -26
- package/dist/commands/project/doctor.js +58 -0
- package/dist/commands/project/generate.js +183 -30
- package/dist/commands/project/setup.js +10 -28
- package/dist/commands/project/status.js +65 -0
- package/dist/commands/version/bump.js +75 -101
- package/dist/commands/version/commands.js +63 -0
- package/dist/commands/version/update.js +36 -24
- package/dist/constants.js +6 -1
- package/dist/styles.js +42 -5
- package/dist/utils/helpers/error.js +14 -0
- package/dist/utils/helpers/file.js +1 -1
- package/dist/utils/helpers/version.js +2 -1
- package/dist/utils/services/backup.js +12 -1
- package/dist/utils/services/command.js +1 -34
- package/dist/utils/services/exec.js +76 -101
- package/dist/utils/services/logger.js +10 -4
- package/dist/utils/validators/validation.js +24 -12
- package/docs/INSTALLATION.md +72 -0
- package/docs/TROUBLESHOOT.md +140 -0
- package/docs/USAGE.md +185 -0
- package/docs/VERSION_MANAGEMENT.md +177 -0
- package/package.json +7 -11
- package/src/cli.ts +82 -371
- package/src/commands/build/commands.ts +169 -0
- package/src/commands/build/testflight.ts +18 -0
- package/src/commands/clean/commands.ts +43 -0
- package/src/commands/clean/flutter.ts +9 -13
- package/src/commands/clean/ios.ts +13 -13
- package/src/commands/config/aliases.ts +150 -0
- package/src/commands/config/commands.ts +50 -0
- package/src/commands/config/initApp.ts +213 -0
- package/src/commands/config/rollback.ts +16 -4
- package/src/commands/config/upgrade.ts +40 -0
- package/src/commands/mcp/commands.ts +23 -0
- package/src/commands/mcp/server.ts +35 -0
- package/src/commands/mcp/setup.ts +69 -0
- package/src/commands/mcp/tools.ts +365 -0
- package/src/commands/project/commands.ts +132 -0
- package/src/commands/project/devices.ts +11 -24
- package/src/commands/project/doctor.ts +81 -0
- package/src/commands/project/generate.ts +211 -32
- package/src/commands/project/setup.ts +13 -30
- package/src/commands/project/status.ts +72 -0
- package/src/commands/version/bump.ts +98 -110
- package/src/commands/version/commands.ts +76 -0
- package/src/commands/version/update.ts +86 -75
- package/src/constants.ts +7 -1
- package/src/styles.ts +49 -7
- package/src/utils/helpers/error.ts +16 -0
- package/src/utils/helpers/file.ts +1 -1
- package/src/utils/helpers/version.ts +2 -1
- package/src/utils/services/backup.ts +17 -1
- package/src/utils/services/command.ts +1 -58
- package/src/utils/services/exec.ts +92 -117
- package/src/utils/services/logger.ts +12 -4
- package/src/utils/validators/validation.ts +24 -12
- package/CODE_QUALITY.md +0 -398
- package/ENHANCEMENTS.md +0 -310
- package/FEATURE_ENHANCEMENTS.md +0 -435
- package/INSTALLATION.md +0 -118
- package/SAFETY_FEATURES.md +0 -396
- package/TROUBLESHOOT.md +0 -60
- package/USAGE.md +0 -412
- package/VERSION_MANAGEMENT.md +0 -438
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# OptiKit Build
|
|
2
|
+
|
|
3
|
+
Build a production Flutter artifact for this project using the OptiKit CLI.
|
|
4
|
+
|
|
5
|
+
## Available Builds
|
|
6
|
+
|
|
7
|
+
| Artifact | Command | Platform | Flags |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| APK | `optikit flutter-build-apk` | Android | `--release --obfuscate --split-debug-info` |
|
|
10
|
+
| AAB (Bundle) | `optikit flutter-build-bundle` | Android (Play Store) | `--release --obfuscate --split-debug-info` |
|
|
11
|
+
| iOS app | `optikit flutter-build-ios` | iOS (no archive) | `--release` |
|
|
12
|
+
| IPA | `optikit flutter-build-ipa` | iOS (App Store / TestFlight) | `--release` |
|
|
13
|
+
|
|
14
|
+
All commands use FVM by default. Add `--disable-fvm` if the project doesn't use FVM.
|
|
15
|
+
|
|
16
|
+
## Build Output Locations
|
|
17
|
+
|
|
18
|
+
| Artifact | Path |
|
|
19
|
+
|---|---|
|
|
20
|
+
| APK | `build/app/outputs/flutter-apk/` |
|
|
21
|
+
| AAB | `build/app/outputs/bundle/release/` |
|
|
22
|
+
| IPA | `build/ios/ipa/` |
|
|
23
|
+
|
|
24
|
+
## Open Output in Finder After Build
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
optikit open-apk # open APK output folder
|
|
28
|
+
optikit open-bundle # open AAB output folder
|
|
29
|
+
optikit open-ipa # open IPA output folder
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Typical Release Workflow
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 1. Bump version first
|
|
36
|
+
optikit bump patch
|
|
37
|
+
|
|
38
|
+
# 2. Build
|
|
39
|
+
optikit flutter-build-ipa # for iOS
|
|
40
|
+
optikit flutter-build-bundle # for Android
|
|
41
|
+
|
|
42
|
+
# 3. Open output to upload
|
|
43
|
+
optikit open-ipa
|
|
44
|
+
optikit open-bundle
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Pre-flight Checks (Automatic)
|
|
48
|
+
|
|
49
|
+
Before building, OptiKit validates:
|
|
50
|
+
- `pubspec.yaml` exists (Flutter project check)
|
|
51
|
+
- Flutter or FVM SDK is installed
|
|
52
|
+
- `ios/` with `Runner.xcodeproj` or `.xcworkspace` (iOS builds)
|
|
53
|
+
- `android/` with `build.gradle` (Android builds)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
Now look at the user's request and run the appropriate build command(s) above.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# OptiKit Clean
|
|
2
|
+
|
|
3
|
+
Clean the Flutter or iOS project using the OptiKit CLI.
|
|
4
|
+
|
|
5
|
+
## Flutter Clean
|
|
6
|
+
|
|
7
|
+
Runs 3 steps in sequence: `flutter clean` → backup + delete `pubspec.lock` → `flutter pub get`
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
optikit clean-flutter # with FVM (default)
|
|
11
|
+
optikit clean-flutter --disable-fvm # without FVM
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## iOS Clean (CocoaPods)
|
|
15
|
+
|
|
16
|
+
All pod operations run inside `ios/`, with **3 retries and 10s delay** per network operation.
|
|
17
|
+
OptiKit also auto-runs `flutter precache --ios` if `Flutter.xcframework` is missing.
|
|
18
|
+
|
|
19
|
+
| Command | Steps |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `optikit clean-ios` | deintegrate → pod install |
|
|
22
|
+
| `optikit clean-ios --clean-cache` | deintegrate → pod cache clean → pod install |
|
|
23
|
+
| `optikit clean-ios --repo-update` | deintegrate → pod repo update → pod update |
|
|
24
|
+
| `optikit clean-ios --clean-cache --repo-update` | full nuclear clean |
|
|
25
|
+
|
|
26
|
+
## When to Use What
|
|
27
|
+
|
|
28
|
+
| Symptom | Solution |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Weird build errors, stale cache | `optikit clean-flutter` |
|
|
31
|
+
| Pod version conflicts | `optikit clean-ios` |
|
|
32
|
+
| CocoaPods cache corrupt | `optikit clean-ios --clean-cache` |
|
|
33
|
+
| Outdated pod specs / repo issues | `optikit clean-ios --repo-update` |
|
|
34
|
+
| Everything broken after dependency update | `optikit clean-flutter` + `optikit clean-ios --clean-cache --repo-update` |
|
|
35
|
+
|
|
36
|
+
## Full Nuclear Clean
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
optikit clean-flutter
|
|
40
|
+
optikit clean-ios --clean-cache --repo-update
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
Now look at the user's request and run the appropriate clean command(s) above.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# OptiKit Generate Module
|
|
2
|
+
|
|
3
|
+
Scaffold a complete BLoC pattern module for the Opticore framework using the OptiKit CLI.
|
|
4
|
+
|
|
5
|
+
> Only for projects using the [Opticore](https://pub.dev/packages/opticore) package.
|
|
6
|
+
|
|
7
|
+
## Command
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
optikit generate module <module_name>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Name rules:** `snake_case` only — lowercase letters, numbers, underscores. No hyphens, no spaces, no uppercase.
|
|
14
|
+
|
|
15
|
+
## What Gets Generated
|
|
16
|
+
|
|
17
|
+
Running `optikit generate module user_profile` creates:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
lib/module/user_profile/
|
|
21
|
+
├── import/ user_profile_import.dart ← central hub (imports flutter + opticore, declares all parts)
|
|
22
|
+
├── bloc/ user_profile_bloc.dart ← UserProfileBloc extends BaseBloc
|
|
23
|
+
├── event/ user_profile_event.dart ← UserProfileInitialEvent extends BaseEvent
|
|
24
|
+
├── state/ user_profile_state.dart ← UserProfileInitialState extends RenderDataState
|
|
25
|
+
├── screen/ user_profile_screen.dart ← UserProfileScreen extends StatefulWidget + BaseScreen
|
|
26
|
+
└── factory/ user_profile_factory.dart ← UserProfileStateFactory extends BaseFactory
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Class Naming
|
|
30
|
+
|
|
31
|
+
`user_profile` → prefix `UserProfile` (snake_case → PascalCase, no suffix on prefix):
|
|
32
|
+
|
|
33
|
+
| File | Class |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `user_profile_bloc.dart` | `UserProfileBloc` |
|
|
36
|
+
| `user_profile_event.dart` | `UserProfileInitialEvent` |
|
|
37
|
+
| `user_profile_state.dart` | `UserProfileInitialState` |
|
|
38
|
+
| `user_profile_screen.dart` | `UserProfileScreen` |
|
|
39
|
+
| `user_profile_factory.dart` | `UserProfileStateFactory` |
|
|
40
|
+
|
|
41
|
+
## Generated Import File
|
|
42
|
+
|
|
43
|
+
```dart
|
|
44
|
+
import 'package:flutter/material.dart';
|
|
45
|
+
import 'package:opticore/opticore.dart';
|
|
46
|
+
|
|
47
|
+
part '../bloc/user_profile_bloc.dart';
|
|
48
|
+
part '../event/user_profile_event.dart';
|
|
49
|
+
part '../screen/user_profile_screen.dart';
|
|
50
|
+
part '../state/user_profile_state.dart';
|
|
51
|
+
part '../factory/user_profile_factory.dart';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
All other files start with `part of '../import/user_profile_import.dart';`
|
|
55
|
+
|
|
56
|
+
## After Generation
|
|
57
|
+
|
|
58
|
+
Wire the new screen into your router. The module is fully self-contained via the `part of` system — just import `user_profile_import.dart` where you need access to the screen or bloc.
|
|
59
|
+
|
|
60
|
+
> If the module already exists, files are overwritten without stopping — OptiKit shows a warning but continues.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
Now look at the user's request, determine the module name in snake_case, and run the command above.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# OptiKit Rollback
|
|
2
|
+
|
|
3
|
+
Inspect and restore automatic OptiKit backups for this Flutter project.
|
|
4
|
+
|
|
5
|
+
## How Backups Work
|
|
6
|
+
|
|
7
|
+
OptiKit automatically backs up files before modifying them:
|
|
8
|
+
|
|
9
|
+
| Command | Files Backed Up |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `bump patch/minor/major` | `pubspec.yaml`, `project.pbxproj`, `Info.plist` |
|
|
12
|
+
| `bump-ios`, `bump-android`, `bump-build` | `pubspec.yaml`, `project.pbxproj`, `Info.plist` |
|
|
13
|
+
| `flutter-update-version` | `pubspec.yaml`, `project.pbxproj`, `Info.plist` |
|
|
14
|
+
| `clean-flutter` | `pubspec.lock` |
|
|
15
|
+
|
|
16
|
+
Backups live in `.optikit-backup/` next to each original file. Last 5 kept per file.
|
|
17
|
+
|
|
18
|
+
## List All Backups
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
optikit rollback
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Output is grouped by original file, sorted newest first, with timestamps and sizes:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
pubspec.yaml
|
|
28
|
+
[1] 12/23/2025, 10:30:00 AM (5m ago, 2.14 KB)
|
|
29
|
+
[2] 12/23/2025, 9:15:00 AM (1h ago, 2.13 KB)
|
|
30
|
+
|
|
31
|
+
ios/Runner.xcodeproj/project.pbxproj
|
|
32
|
+
[3] 12/23/2025, 10:30:00 AM (5m ago, 48.2 KB)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Restore a Specific Backup
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
optikit rollback --restore <number>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Example — restore the most recent pubspec.yaml backup:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
optikit rollback --restore 1
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Backup File Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
your-flutter-project/
|
|
51
|
+
├── pubspec.yaml
|
|
52
|
+
├── .optikit-backup/
|
|
53
|
+
│ └── pubspec_2025-12-23T10-30-00-000Z.yaml
|
|
54
|
+
└── ios/
|
|
55
|
+
├── Runner.xcodeproj/
|
|
56
|
+
│ └── .optikit-backup/
|
|
57
|
+
│ └── project_2025-12-23T10-30-00-000Z.pbxproj
|
|
58
|
+
└── Runner/
|
|
59
|
+
└── .optikit-backup/
|
|
60
|
+
└── Info_2025-12-23T10-30-00-000Z.plist
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> `.optikit-backup/` is gitignored automatically by `optikit init`.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
Now look at the user's request — list backups or restore the one they need.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# OptiKit Run & Devices
|
|
2
|
+
|
|
3
|
+
List connected devices and run the Flutter app using the OptiKit CLI.
|
|
4
|
+
|
|
5
|
+
## List Connected Devices
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
optikit devices # with FVM (default)
|
|
9
|
+
optikit devices --disable-fvm
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Shows: device number, name, platform, `[Emulator]` or `[Physical]`, and device ID.
|
|
13
|
+
|
|
14
|
+
## Run the App
|
|
15
|
+
|
|
16
|
+
### On Default Device
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
optikit run
|
|
20
|
+
optikit run --release # release mode (-r)
|
|
21
|
+
optikit run --flavor <name> # with flavor (-f)
|
|
22
|
+
optikit run --disable-fvm
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### On a Specific Device
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# First list devices to get the ID
|
|
29
|
+
optikit devices
|
|
30
|
+
|
|
31
|
+
# Then run on that device
|
|
32
|
+
optikit run --device <device-id> # or -d <device-id>
|
|
33
|
+
optikit run -d <device-id> --release
|
|
34
|
+
optikit run -d <device-id> --flavor <name>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Interactive Device Picker
|
|
38
|
+
|
|
39
|
+
Prompts for a numbered selection from the connected devices list:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
optikit run-select
|
|
43
|
+
optikit run-select --release
|
|
44
|
+
optikit run-select --flavor <name>
|
|
45
|
+
optikit run-select --disable-fvm
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Typical Workflow
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# See what's connected
|
|
52
|
+
optikit devices
|
|
53
|
+
|
|
54
|
+
# Pick interactively
|
|
55
|
+
optikit run-select
|
|
56
|
+
|
|
57
|
+
# Or target a specific device
|
|
58
|
+
optikit run -d emulator-5554
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
Now look at the user's request and run the appropriate device/run command(s) above.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# OptiKit Setup
|
|
2
|
+
|
|
3
|
+
Initialize OptiKit and configure the development environment for this Flutter project.
|
|
4
|
+
|
|
5
|
+
## Initialize OptiKit
|
|
6
|
+
|
|
7
|
+
Run once per project to create the config file and update `.gitignore`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
optikit init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Creates `.optikitrc.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"backupRetentionCount": 5,
|
|
18
|
+
"useFvmByDefault": true,
|
|
19
|
+
"autoBackup": true,
|
|
20
|
+
"verbose": false
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Also appends `.optikit-backup/` to `.gitignore` automatically.
|
|
25
|
+
If config already exists, it warns and exits without overwriting.
|
|
26
|
+
|
|
27
|
+
## Configure VSCode for FVM
|
|
28
|
+
|
|
29
|
+
Creates `.vscode/settings.json` with Flutter/FVM settings:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
optikit setup-vscode
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Generated settings:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"dart.flutterSdkPath": ".fvm/flutter_sdk",
|
|
40
|
+
"editor.formatOnSave": true,
|
|
41
|
+
"dart.previewFlutterUiGuides": true,
|
|
42
|
+
"files.exclude": {
|
|
43
|
+
"**/.git": true,
|
|
44
|
+
"**/.DS_Store": true,
|
|
45
|
+
"**/node_modules": true,
|
|
46
|
+
"**/build": true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Open IDE Projects
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
optikit open-ios # open ios/Runner.xcworkspace in Xcode
|
|
55
|
+
optikit open-android # open android/ in Android Studio
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Full Onboarding for a New Developer
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
optikit init # config + .gitignore
|
|
62
|
+
optikit setup-vscode # VSCode settings
|
|
63
|
+
optikit open-ios # verify iOS project opens in Xcode
|
|
64
|
+
optikit open-android # verify Android project opens in Android Studio
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Now look at the user's request and run the appropriate setup command(s) above.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Sync OptiKit Documentation
|
|
2
|
+
|
|
3
|
+
You are the documentation maintainer for the OptiKit CLI project. Your job is to keep all documentation perfectly in sync with the actual source code after any change.
|
|
4
|
+
|
|
5
|
+
Run this workflow whenever:
|
|
6
|
+
- A new command is added or removed
|
|
7
|
+
- A command's flags, behavior, or output changes
|
|
8
|
+
- A new utility, service, or helper is added
|
|
9
|
+
- File structure changes
|
|
10
|
+
- Version bump logic changes
|
|
11
|
+
- Any source file in `src/` is modified
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Step 1 — Read the Source of Truth
|
|
16
|
+
|
|
17
|
+
Read these files to understand the current state of the code:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
src/cli.ts ← all commands and their flags
|
|
21
|
+
src/constants.ts ← build flags, paths, retry config, error messages
|
|
22
|
+
src/commands/build/releases.ts ← build command implementations
|
|
23
|
+
src/commands/clean/flutter.ts ← flutter clean steps
|
|
24
|
+
src/commands/clean/ios.ts ← ios clean steps + retry logic
|
|
25
|
+
src/commands/version/bump.ts ← bump logic, iOS reset behavior
|
|
26
|
+
src/commands/version/update.ts ← file write targets, backup triggers
|
|
27
|
+
src/commands/project/generate.ts ← module template content, class naming
|
|
28
|
+
src/commands/project/devices.ts ← device listing, run, run-select
|
|
29
|
+
src/commands/project/open.ts ← open commands, OS-specific logic
|
|
30
|
+
src/commands/project/setup.ts ← VSCode settings template
|
|
31
|
+
src/commands/config/init.ts ← init defaults, gitignore logic
|
|
32
|
+
src/commands/config/rollback.ts ← backup search, restore, grouping
|
|
33
|
+
src/utils/helpers/version.ts ← version parsing, iOS build read source
|
|
34
|
+
src/utils/services/backup.ts ← backup naming, retention, structure
|
|
35
|
+
src/utils/services/config.ts ← config lookup order
|
|
36
|
+
src/utils/validators/validation.ts ← what each validator checks
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Step 2 — Check What Changed
|
|
42
|
+
|
|
43
|
+
Compare what you read in Step 1 against each documentation file below. For each file, identify:
|
|
44
|
+
- Commands that no longer exist → remove them
|
|
45
|
+
- New commands → add them
|
|
46
|
+
- Changed flags or behavior → update descriptions
|
|
47
|
+
- Changed file paths or output paths → update references
|
|
48
|
+
- Changed retry counts, timeouts, or defaults → update numbers
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Step 3 — Update Each Doc File
|
|
53
|
+
|
|
54
|
+
Update all files that are out of sync. Do not touch files that are already accurate.
|
|
55
|
+
|
|
56
|
+
### `CLAUDE.md` (root)
|
|
57
|
+
Tracks the developer-facing architecture of the CLI itself. Update when:
|
|
58
|
+
- Folder structure changes (new command files, new utilities)
|
|
59
|
+
- New utility functions are added to helpers/services
|
|
60
|
+
- Adding new commands section changes
|
|
61
|
+
- FVM behavior, retry config, or version flow changes
|
|
62
|
+
- Important notes change (ES module rules, path patterns, etc.)
|
|
63
|
+
|
|
64
|
+
Key sections to check:
|
|
65
|
+
- Folder Structure tree
|
|
66
|
+
- Each utility module's function list
|
|
67
|
+
- Version Management Flow steps
|
|
68
|
+
- iOS Build Pattern retry numbers
|
|
69
|
+
- Adding New Commands checklist
|
|
70
|
+
|
|
71
|
+
### `docs/USAGE.md`
|
|
72
|
+
End-user command reference. Update when any command is added, removed, or its flags change.
|
|
73
|
+
|
|
74
|
+
Sections to check:
|
|
75
|
+
- Configuration Commands
|
|
76
|
+
- Version Management Commands
|
|
77
|
+
- Device Management Commands
|
|
78
|
+
- Build Commands
|
|
79
|
+
- Clean Commands
|
|
80
|
+
- Project Commands
|
|
81
|
+
|
|
82
|
+
### `docs/VERSION_MANAGEMENT.md`
|
|
83
|
+
Deep dive into version strategy. Update when:
|
|
84
|
+
- bump command behavior changes (especially iOS reset logic)
|
|
85
|
+
- New bump-* commands are added
|
|
86
|
+
- Files modified by version commands change
|
|
87
|
+
- Command reference table changes
|
|
88
|
+
|
|
89
|
+
### `docs/SAFETY_FEATURES.md`
|
|
90
|
+
Backup system and validation docs. Update when:
|
|
91
|
+
- New files get backed up
|
|
92
|
+
- Backup retention count changes
|
|
93
|
+
- New validators are added
|
|
94
|
+
- Error messages change
|
|
95
|
+
|
|
96
|
+
### `docs/INSTALLATION.md`
|
|
97
|
+
Update only if install method or prerequisites change.
|
|
98
|
+
|
|
99
|
+
### `docs/TROUBLESHOOT.md`
|
|
100
|
+
Update if new error messages are added or error handling changes.
|
|
101
|
+
|
|
102
|
+
### `OPTIKIT_AGENT.md` (root)
|
|
103
|
+
AI agent reference — the most important file to keep accurate. Update when ANYTHING changes:
|
|
104
|
+
- Any command flag, behavior, or output
|
|
105
|
+
- File paths modified by commands
|
|
106
|
+
- Retry counts, timeouts, defaults
|
|
107
|
+
- Class naming conventions in generate
|
|
108
|
+
- Backup structure or naming
|
|
109
|
+
|
|
110
|
+
### `.claude/commands/version.md`
|
|
111
|
+
Update when: bump commands change, files modified change, manual version flags change.
|
|
112
|
+
|
|
113
|
+
### `.claude/commands/build.md`
|
|
114
|
+
Update when: build flags change, output paths change, new artifact types added.
|
|
115
|
+
|
|
116
|
+
### `.claude/commands/clean.md`
|
|
117
|
+
Update when: clean steps change, retry config changes, new clean flags added.
|
|
118
|
+
|
|
119
|
+
### `.claude/commands/generate.md`
|
|
120
|
+
Update when: generated file structure changes, class naming changes, template content changes.
|
|
121
|
+
|
|
122
|
+
### `.claude/commands/run.md`
|
|
123
|
+
Update when: run flags change, device listing format changes, new run options added.
|
|
124
|
+
|
|
125
|
+
### `.claude/commands/rollback.md`
|
|
126
|
+
Update when: backup structure changes, new files are backed up, retention count changes.
|
|
127
|
+
|
|
128
|
+
### `.claude/commands/setup.md`
|
|
129
|
+
Update when: init defaults change, VSCode settings template changes, new setup commands added.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Step 4 — Cross-Check References
|
|
134
|
+
|
|
135
|
+
After updating, verify:
|
|
136
|
+
- All file path references in `CLAUDE.md` match actual files in `src/`
|
|
137
|
+
- All `docs/` cross-links still point to files that exist in `docs/`
|
|
138
|
+
- `README.md` links to `docs/` files all use the `docs/` prefix
|
|
139
|
+
- `OPTIKIT_AGENT.md` command table has no missing or phantom commands vs `src/cli.ts`
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Step 5 — Report What Changed
|
|
144
|
+
|
|
145
|
+
After finishing, summarize:
|
|
146
|
+
1. Which docs were updated and why
|
|
147
|
+
2. Which docs were already accurate (no changes needed)
|
|
148
|
+
3. Any inconsistencies found that couldn't be auto-resolved
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# OptiKit Version Management
|
|
2
|
+
|
|
3
|
+
Show current version info and bump or set version/build numbers for this Flutter project using the OptiKit CLI.
|
|
4
|
+
|
|
5
|
+
## Current Version
|
|
6
|
+
|
|
7
|
+
Run this first to see what we're working with:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
optikit version
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Bump Version (Semantic Versioning)
|
|
14
|
+
|
|
15
|
+
Based on the nature of the change, choose the right bump:
|
|
16
|
+
|
|
17
|
+
| Change Type | Command | Effect |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Bug fix | `optikit bump patch` | `1.2.3+45` → `1.2.4+46` (iOS: 1) |
|
|
20
|
+
| New feature | `optikit bump minor` | `1.2.3+45` → `1.3.0+46` (iOS: 1) |
|
|
21
|
+
| Breaking change | `optikit bump major` | `1.2.3+45` → `2.0.0+46` (iOS: 1) |
|
|
22
|
+
|
|
23
|
+
iOS build resets to 1 on any version bump (App Store Connect expects this).
|
|
24
|
+
Android build always increments (Google Play requires strictly increasing numbers).
|
|
25
|
+
|
|
26
|
+
## Bump Build Numbers Only (No Version Change)
|
|
27
|
+
|
|
28
|
+
| Platform | Command | Use Case |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| iOS only | `optikit bump-ios` | Another TestFlight upload |
|
|
31
|
+
| Android only | `optikit bump-android` | Another Google Play upload |
|
|
32
|
+
| Both | `optikit bump-build` | Simultaneous upload to both stores |
|
|
33
|
+
|
|
34
|
+
## Manual Version Override
|
|
35
|
+
|
|
36
|
+
When you need to set exact numbers:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
optikit flutter-update-version \
|
|
40
|
+
--app-version <X.Y.Z> \
|
|
41
|
+
--android-build <number> \
|
|
42
|
+
--ios-build <number>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
All three flags are optional — omit any to skip updating that platform.
|
|
46
|
+
|
|
47
|
+
## Files Modified
|
|
48
|
+
|
|
49
|
+
Every version command backs up these files before writing:
|
|
50
|
+
1. `pubspec.yaml` — `version: X.Y.Z+B`
|
|
51
|
+
2. `ios/Runner.xcodeproj/project.pbxproj` — `MARKETING_VERSION`, `CURRENT_PROJECT_VERSION`
|
|
52
|
+
3. `ios/Runner/Info.plist` — `CFBundleShortVersionString`, `CFBundleVersion`
|
|
53
|
+
|
|
54
|
+
## Rollback If Something Went Wrong
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
optikit rollback # list all backups with timestamps
|
|
58
|
+
optikit rollback --restore 1 # restore the most recent backup
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
Now look at the user's request and run the appropriate command(s) above.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(grep -E \"\\\\.\\(ts|md|json\\)$\")",
|
|
5
|
+
"Bash(gh api:*)",
|
|
6
|
+
"Bash(find /Users/elshenawy/My-CLI/optikit/src -type f -name *.ts)",
|
|
7
|
+
"WebFetch(domain:pub.dev)",
|
|
8
|
+
"WebFetch(domain:github.com)",
|
|
9
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
10
|
+
"Bash(npm run:*)",
|
|
11
|
+
"Bash(node:*)",
|
|
12
|
+
"Bash(file:*)",
|
|
13
|
+
"Bash(wc:*)",
|
|
14
|
+
"mcp__plugin_claude-mem_mcp-search__get_observations",
|
|
15
|
+
"Bash(npm link:*)",
|
|
16
|
+
"Bash(ok --version)",
|
|
17
|
+
"Bash(npm install:*)",
|
|
18
|
+
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\)[''''exports'''']; [print\\(k\\) for k in d.keys\\(\\)]\")",
|
|
19
|
+
"Bash(grep -E '^\\\\s+command:' /Users/elshenawy/My-CLI/optikit/src/commands/*/commands.ts)",
|
|
20
|
+
"Bash(printf '{\"\"\"\"jsonrpc\"\"\"\":\"\"\"\"2.0\"\"\"\",\"\"\"\"id\"\"\"\":1,\"\"\"\"method\"\"\"\":\"\"\"\"initialize\"\"\"\",\"\"\"\"params\"\"\"\":{\"\"\"\"protocolVersion\"\"\"\":\"\"\"\"2024-11-05\"\"\"\",\"\"\"\"capabilities\"\"\"\":{},\"\"\"\"clientInfo\"\"\"\":{\"\"\"\"name\"\"\"\":\"\"\"\"test\"\"\"\",\"\"\"\"version\"\"\"\":\"\"\"\"1.0\"\"\"\"}}}\\\\n')",
|
|
21
|
+
"Bash(gtimeout 5 node dist/cli.js mcp)",
|
|
22
|
+
"Bash(python3 -m json.tool)",
|
|
23
|
+
"Bash(python3:*)",
|
|
24
|
+
"WebSearch",
|
|
25
|
+
"Bash(git add:*)"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "optikit-marketplace",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Mahmoud El Shenawy",
|
|
5
|
+
"email": "dev.m.elshenawy@icloud.com"
|
|
6
|
+
},
|
|
7
|
+
"plugins": [
|
|
8
|
+
{
|
|
9
|
+
"name": "optikit",
|
|
10
|
+
"source": {
|
|
11
|
+
"source": "github",
|
|
12
|
+
"repo": "dev-mahmoud-elshenawy/optikit"
|
|
13
|
+
},
|
|
14
|
+
"description": "Build, version, and deploy Flutter apps in one CLI. 28 MCP tools for builds, versioning, module scaffolding, and project maintenance.",
|
|
15
|
+
"version": "1.3.0",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Mahmoud El Shenawy"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/dev-mahmoud-elshenawy/optikit",
|
|
20
|
+
"repository": "https://github.com/dev-mahmoud-elshenawy/optikit",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"flutter",
|
|
24
|
+
"opticore",
|
|
25
|
+
"build",
|
|
26
|
+
"version-management",
|
|
27
|
+
"testflight",
|
|
28
|
+
"apk",
|
|
29
|
+
"ipa",
|
|
30
|
+
"bloc",
|
|
31
|
+
"fvm",
|
|
32
|
+
"cli"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "optikit",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Build, version, and deploy Flutter apps in one CLI. 28 MCP tools for builds, versioning, module scaffolding, and project maintenance.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Mahmoud El Shenawy",
|
|
7
|
+
"url": "https://github.com/dev-mahmoud-elshenawy"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/dev-mahmoud-elshenawy/optikit",
|
|
10
|
+
"repository": "https://github.com/dev-mahmoud-elshenawy/optikit",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"flutter",
|
|
14
|
+
"opticore",
|
|
15
|
+
"build",
|
|
16
|
+
"version-management",
|
|
17
|
+
"testflight",
|
|
18
|
+
"apk",
|
|
19
|
+
"ipa",
|
|
20
|
+
"bloc",
|
|
21
|
+
"fvm",
|
|
22
|
+
"cli"
|
|
23
|
+
],
|
|
24
|
+
"mcpServers": "./.mcp.json"
|
|
25
|
+
}
|