From dfce969346d3ee89b01fe3f164cda0a9f24a4a8d Mon Sep 17 00:00:00 2001 From: Aleksandr Lozhkovoi Date: Sat, 21 Feb 2026 21:26:37 +0100 Subject: [PATCH] feat: add namespaced flutter command aliases --- .cursor-plugin/plugin.json | 2 +- CHANGELOG.md | 3 ++ README.md | 3 ++ commands/flutter-generate-flutter-tests.md | 10 ++++ commands/flutter-implement-figma-screen.md | 10 ++++ commands/flutter-implement-flutter-feature.md | 10 ++++ commands/flutter-integrate-firebase.md | 10 ++++ commands/flutter-migrate-flutter-code.md | 10 ++++ commands/flutter-prepare-mobile-release.md | 10 ++++ .../flutter-resolve-flutter-build-error.md | 10 ++++ commands/flutter-review-flutter-code.md | 10 ++++ commands/flutter-scaffold-flutter-feature.md | 10 ++++ commands/flutter-security-review.md | 10 ++++ .../flutter-setup-mobile-github-pipeline.md | 10 ++++ .../flutter-sync-official-flutter-ai-rules.md | 10 ++++ .../flutter-update-flutter-dependencies.md | 10 ++++ commands/flutter-write-bloc-test.md | 10 ++++ commands/flutter-write-e2e-test.md | 10 ++++ commands/flutter-write-widget-test.md | 10 ++++ docs/command-namespacing.md | 20 ++++++++ docs/official-release-checklist.md | 1 + plugin.json | 2 +- .../generate_namespaced_command_aliases.py | 50 +++++++++++++++++++ 23 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 commands/flutter-generate-flutter-tests.md create mode 100644 commands/flutter-implement-figma-screen.md create mode 100644 commands/flutter-implement-flutter-feature.md create mode 100644 commands/flutter-integrate-firebase.md create mode 100644 commands/flutter-migrate-flutter-code.md create mode 100644 commands/flutter-prepare-mobile-release.md create mode 100644 commands/flutter-resolve-flutter-build-error.md create mode 100644 commands/flutter-review-flutter-code.md create mode 100644 commands/flutter-scaffold-flutter-feature.md create mode 100644 commands/flutter-security-review.md create mode 100644 commands/flutter-setup-mobile-github-pipeline.md create mode 100644 commands/flutter-sync-official-flutter-ai-rules.md create mode 100644 commands/flutter-update-flutter-dependencies.md create mode 100644 commands/flutter-write-bloc-test.md create mode 100644 commands/flutter-write-e2e-test.md create mode 100644 commands/flutter-write-widget-test.md create mode 100644 docs/command-namespacing.md create mode 100755 scripts/generate_namespaced_command_aliases.py diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index e722cba..5e23c20 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "flutter-cursor-plugin", "displayName": "Flutter Cursor Plugin", - "version": "1.9.1", + "version": "1.10.0", "description": "Open-source Cursor plugin for end-to-end Flutter development and testing with Dart MCP, Figma MCP, practical architecture patterns, and reliable test workflows.", "author": { "name": "Aleksandr Lozhkovoi", diff --git a/CHANGELOG.md b/CHANGELOG.md index 043e759..a94b3d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Added command namespacing with aliases in `flutter:*` form for all canonical commands. +- Added alias generator script `scripts/generate_namespaced_command_aliases.py`. +- Added command namespacing documentation (`docs/command-namespacing.md`). - Added release automation workflow: - `.github/workflows/release-automation.yml` - `scripts/release_automation.py` diff --git a/README.md b/README.md index c82899b..b0f0248 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Three ready-to-run scenarios: - Canonical manifest: `.cursor-plugin/plugin.json` (schema-aligned for Cursor plugins). - Compatibility manifest kept for existing setups: `plugin.json`. - MCP auto-configuration: `mcp.json` (Dart MCP server). +- Command namespace support: canonical commands plus `flutter:*` aliases. ## Compatibility matrix @@ -172,6 +173,8 @@ Three ready-to-run scenarios: 13. For automated release cut (version/changelog/tag/release), use: - `.github/workflows/release-automation.yml` - `docs/release-automation.md` +14. For command namespacing/aliases (`flutter:*`), see: + - `docs/command-namespacing.md` Note: every code review flow includes mandatory security checks (OWASP MASVS-oriented). diff --git a/commands/flutter-generate-flutter-tests.md b/commands/flutter-generate-flutter-tests.md new file mode 100644 index 0000000..ad9347a --- /dev/null +++ b/commands/flutter-generate-flutter-tests.md @@ -0,0 +1,10 @@ +--- +name: flutter:generate-flutter-tests +description: Alias for `generate-flutter-tests`. Generate or extend Flutter tests (unit/widget/bloc/Patrol E2E) for existing code paths. +--- + +Namespaced alias for `generate-flutter-tests`. + +1. Run the canonical command with the same intent. +2. Follow `./generate-flutter-tests.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-implement-figma-screen.md b/commands/flutter-implement-figma-screen.md new file mode 100644 index 0000000..a528622 --- /dev/null +++ b/commands/flutter-implement-figma-screen.md @@ -0,0 +1,10 @@ +--- +name: flutter:implement-figma-screen +description: Alias for `implement-figma-screen`. Implement a Flutter screen/component from Figma using Figma MCP and Flutter best practices. +--- + +Namespaced alias for `implement-figma-screen`. + +1. Run the canonical command with the same intent. +2. Follow `./implement-figma-screen.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-implement-flutter-feature.md b/commands/flutter-implement-flutter-feature.md new file mode 100644 index 0000000..f968227 --- /dev/null +++ b/commands/flutter-implement-flutter-feature.md @@ -0,0 +1,10 @@ +--- +name: flutter:implement-flutter-feature +description: Alias for `implement-flutter-feature`. Implement or refactor a Flutter feature using clean architecture and Dart MCP workflows. +--- + +Namespaced alias for `implement-flutter-feature`. + +1. Run the canonical command with the same intent. +2. Follow `./implement-flutter-feature.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-integrate-firebase.md b/commands/flutter-integrate-firebase.md new file mode 100644 index 0000000..a274516 --- /dev/null +++ b/commands/flutter-integrate-firebase.md @@ -0,0 +1,10 @@ +--- +name: flutter:integrate-firebase +description: Alias for `integrate-firebase`. Set up Firebase in Flutter app with FlutterFire CLI and production-ready checks for core Firebase services. +--- + +Namespaced alias for `integrate-firebase`. + +1. Run the canonical command with the same intent. +2. Follow `./integrate-firebase.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-migrate-flutter-code.md b/commands/flutter-migrate-flutter-code.md new file mode 100644 index 0000000..433c645 --- /dev/null +++ b/commands/flutter-migrate-flutter-code.md @@ -0,0 +1,10 @@ +--- +name: flutter:migrate-flutter-code +description: Alias for `migrate-flutter-code`. Perform targeted Flutter/Dart migration or refactor with safe incremental steps. +--- + +Namespaced alias for `migrate-flutter-code`. + +1. Run the canonical command with the same intent. +2. Follow `./migrate-flutter-code.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-prepare-mobile-release.md b/commands/flutter-prepare-mobile-release.md new file mode 100644 index 0000000..2be8c1c --- /dev/null +++ b/commands/flutter-prepare-mobile-release.md @@ -0,0 +1,10 @@ +--- +name: flutter:prepare-mobile-release +description: Alias for `prepare-mobile-release`. Execute Android and iOS release-readiness workflow for Flutter apps before Play Store/App Store submission. +--- + +Namespaced alias for `prepare-mobile-release`. + +1. Run the canonical command with the same intent. +2. Follow `./prepare-mobile-release.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-resolve-flutter-build-error.md b/commands/flutter-resolve-flutter-build-error.md new file mode 100644 index 0000000..00f2c0d --- /dev/null +++ b/commands/flutter-resolve-flutter-build-error.md @@ -0,0 +1,10 @@ +--- +name: flutter:resolve-flutter-build-error +description: Alias for `resolve-flutter-build-error`. Diagnose and fix Flutter build/runtime errors across Dart, Android, iOS, and package dependency layers. +--- + +Namespaced alias for `resolve-flutter-build-error`. + +1. Run the canonical command with the same intent. +2. Follow `./resolve-flutter-build-error.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-review-flutter-code.md b/commands/flutter-review-flutter-code.md new file mode 100644 index 0000000..6bb93db --- /dev/null +++ b/commands/flutter-review-flutter-code.md @@ -0,0 +1,10 @@ +--- +name: flutter:review-flutter-code +description: Alias for `review-flutter-code`. Review Flutter code or diff against conventions, architecture, and testing standards. +--- + +Namespaced alias for `review-flutter-code`. + +1. Run the canonical command with the same intent. +2. Follow `./review-flutter-code.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-scaffold-flutter-feature.md b/commands/flutter-scaffold-flutter-feature.md new file mode 100644 index 0000000..8f56f31 --- /dev/null +++ b/commands/flutter-scaffold-flutter-feature.md @@ -0,0 +1,10 @@ +--- +name: flutter:scaffold-flutter-feature +description: Alias for `scaffold-flutter-feature`. Generate a new Flutter feature skeleton with clean architecture and selected state-management pattern. +--- + +Namespaced alias for `scaffold-flutter-feature`. + +1. Run the canonical command with the same intent. +2. Follow `./scaffold-flutter-feature.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-security-review.md b/commands/flutter-security-review.md new file mode 100644 index 0000000..c77f44b --- /dev/null +++ b/commands/flutter-security-review.md @@ -0,0 +1,10 @@ +--- +name: flutter:security-review +description: Alias for `security-review`. Run security-focused review with secret scanning and prioritized findings for Flutter/Dart repositories. +--- + +Namespaced alias for `security-review`. + +1. Run the canonical command with the same intent. +2. Follow `./security-review.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-setup-mobile-github-pipeline.md b/commands/flutter-setup-mobile-github-pipeline.md new file mode 100644 index 0000000..d038866 --- /dev/null +++ b/commands/flutter-setup-mobile-github-pipeline.md @@ -0,0 +1,10 @@ +--- +name: flutter:setup-mobile-github-pipeline +description: Alias for `setup-mobile-github-pipeline`. Create a typical GitHub Actions mobile CI pipeline for Flutter with APK/AAB build artifacts and release-ready quality gates. +--- + +Namespaced alias for `setup-mobile-github-pipeline`. + +1. Run the canonical command with the same intent. +2. Follow `./setup-mobile-github-pipeline.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-sync-official-flutter-ai-rules.md b/commands/flutter-sync-official-flutter-ai-rules.md new file mode 100644 index 0000000..336850b --- /dev/null +++ b/commands/flutter-sync-official-flutter-ai-rules.md @@ -0,0 +1,10 @@ +--- +name: flutter:sync-official-flutter-ai-rules +description: Alias for `sync-official-flutter-ai-rules`. Sync official Flutter AI rules from Flutter upstream and select active profile (10k, 4k, 1k). +--- + +Namespaced alias for `sync-official-flutter-ai-rules`. + +1. Run the canonical command with the same intent. +2. Follow `./sync-official-flutter-ai-rules.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-update-flutter-dependencies.md b/commands/flutter-update-flutter-dependencies.md new file mode 100644 index 0000000..ee0e3bc --- /dev/null +++ b/commands/flutter-update-flutter-dependencies.md @@ -0,0 +1,10 @@ +--- +name: flutter:update-flutter-dependencies +description: Alias for `update-flutter-dependencies`. Upgrade Flutter SDK and Dart/Flutter dependencies safely with analysis, tests, and rollback guidance. +--- + +Namespaced alias for `update-flutter-dependencies`. + +1. Run the canonical command with the same intent. +2. Follow `./update-flutter-dependencies.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-write-bloc-test.md b/commands/flutter-write-bloc-test.md new file mode 100644 index 0000000..e163db3 --- /dev/null +++ b/commands/flutter-write-bloc-test.md @@ -0,0 +1,10 @@ +--- +name: flutter:write-bloc-test +description: Alias for `write-bloc-test`. Create or update a Bloc/Cubit test using the plugin skill, rules, and template. +--- + +Namespaced alias for `write-bloc-test`. + +1. Run the canonical command with the same intent. +2. Follow `./write-bloc-test.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-write-e2e-test.md b/commands/flutter-write-e2e-test.md new file mode 100644 index 0000000..7b7d653 --- /dev/null +++ b/commands/flutter-write-e2e-test.md @@ -0,0 +1,10 @@ +--- +name: flutter:write-e2e-test +description: Alias for `write-e2e-test`. Create or update a Patrol E2E test for a critical user flow. +--- + +Namespaced alias for `write-e2e-test`. + +1. Run the canonical command with the same intent. +2. Follow `./write-e2e-test.md`. +3. Keep output and checks identical to the canonical command. diff --git a/commands/flutter-write-widget-test.md b/commands/flutter-write-widget-test.md new file mode 100644 index 0000000..0aea4ae --- /dev/null +++ b/commands/flutter-write-widget-test.md @@ -0,0 +1,10 @@ +--- +name: flutter:write-widget-test +description: Alias for `write-widget-test`. Create or update a Flutter widget test using the plugin skill, rules, and template. +--- + +Namespaced alias for `write-widget-test`. + +1. Run the canonical command with the same intent. +2. Follow `./write-widget-test.md`. +3. Keep output and checks identical to the canonical command. diff --git a/docs/command-namespacing.md b/docs/command-namespacing.md new file mode 100644 index 0000000..4debd4b --- /dev/null +++ b/docs/command-namespacing.md @@ -0,0 +1,20 @@ +# Command Namespacing + +This plugin keeps canonical command names and provides namespaced aliases to reduce marketplace conflicts. + +## Naming model + +- Canonical command: `implement-flutter-feature` +- Namespaced alias: `flutter:implement-flutter-feature` + +Both forms are supported and route to the same workflow. + +## Alias generation + +To regenerate aliases for all canonical commands: + +```bash +scripts/generate_namespaced_command_aliases.py +``` + +This creates `commands/flutter-*.md` alias files for every canonical command. diff --git a/docs/official-release-checklist.md b/docs/official-release-checklist.md index 617c3a2..ed3f953 100644 --- a/docs/official-release-checklist.md +++ b/docs/official-release-checklist.md @@ -7,6 +7,7 @@ Use this checklist before tagging a public release. - Plugin metadata is up to date (`plugin.json`: name, version, author, description, keywords). - README clearly explains scope, commands, agents, and MCP requirements. - Changelog includes the release notes for the target version. +- Command naming and aliases are documented (`docs/command-namespacing.md`). ## Quality diff --git a/plugin.json b/plugin.json index c1e224c..cf8dc53 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "flutter-cursor-plugin", "displayName": "Flutter Cursor Plugin", - "version": "1.9.1", + "version": "1.10.0", "description": "Open-source Cursor plugin for end-to-end Flutter development and testing with Dart MCP, Figma MCP, practical architecture patterns, and reliable test workflows.", "author": "Aleksandr Lozhkovoi", "license": "MIT", diff --git a/scripts/generate_namespaced_command_aliases.py b/scripts/generate_namespaced_command_aliases.py new file mode 100755 index 0000000..9d47c45 --- /dev/null +++ b/scripts/generate_namespaced_command_aliases.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +import re +from pathlib import Path + + +FRONTMATTER_RE = re.compile(r"^---\n(.*?)\n---\n", re.DOTALL) + + +def extract_description(content: str) -> str: + match = FRONTMATTER_RE.search(content) + if not match: + return "Namespaced alias command." + frontmatter = match.group(1) + for line in frontmatter.splitlines(): + if line.strip().startswith("description:"): + return line.split(":", 1)[1].strip() + return "Namespaced alias command." + + +def main() -> None: + repo_root = Path(__file__).resolve().parents[1] + commands_dir = repo_root / "commands" + for cmd_file in sorted(commands_dir.glob("*.md")): + stem = cmd_file.stem + if stem.startswith("flutter-"): + continue + + alias_file = commands_dir / f"flutter-{stem}.md" + if alias_file.exists(): + continue + + content = cmd_file.read_text(encoding="utf-8") + description = extract_description(content) + alias_content = ( + "---\n" + f"name: flutter:{stem}\n" + f"description: Alias for `{stem}`. {description}\n" + "---\n\n" + f"Namespaced alias for `{stem}`.\n\n" + "1. Run the canonical command with the same intent.\n" + f"2. Follow `./{stem}.md`.\n" + "3. Keep output and checks identical to the canonical command.\n" + ) + alias_file.write_text(alias_content, encoding="utf-8") + print(f"Created {alias_file.relative_to(repo_root)}") + + +if __name__ == "__main__": + main()