Skip to content

Commit 761dfaa

Browse files
committed
feat: add mobile API integration skill and command
1 parent 83dc264 commit 761dfaa

8 files changed

Lines changed: 94 additions & 10 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "flutter-cursor-plugin",
33
"displayName": "Flutter Cursor Plugin",
4-
"version": "1.10.5",
4+
"version": "1.10.6",
55
"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.",
66
"author": {
77
"name": "Aleksandr Lozhkovoi",

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
- command: `commands/setup-flutter-environment.md`
3030
- skill: `skills/setup-flutter-environment/SKILL.md`
3131
- Simplified command prompts by removing repeated guardrails boilerplate from canonical command files.
32+
- Added external backend API integration workflow:
33+
- command: `commands/integrate-mobile-api.md`
34+
- skill: `skills/integrate-mobile-api/SKILL.md`
3235

3336
## 1.10.0
3437

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Reference project layout:
9898
- `prepare-mobile-release`
9999
- `setup-mobile-github-pipeline`
100100
- `setup-flutter-environment`
101+
- `integrate-mobile-api`
101102
- `integrate-firebase`
102103
- `security-review`
103104
- `sync-official-flutter-ai-rules`
@@ -113,6 +114,7 @@ Reference project layout:
113114
- `skills/build-flutter-features/`
114115
- `skills/scaffold-flutter-architecture/`
115116
- `skills/release-mobile-apps/`
117+
- `skills/integrate-mobile-api/`
116118
- `skills/integrate-firebase/`
117119
- `skills/write-flutter-tests/`
118120
- `skills/review-flutter-code/`
@@ -172,24 +174,26 @@ Reference project layout:
172174
7. For Firebase integration use:
173175
- `integrate-firebase`
174176
- `docs/firebase-integration-checklist.md`
175-
8. For security audit and secrets scanning use:
177+
8. For external backend API integration use:
178+
- `integrate-mobile-api`
179+
9. For security audit and secrets scanning use:
176180
- `security-review`
177181
- `docs/security-audit-checklist.md`
178182
- `docs/security-posture.md`
179-
9. Keep generated output aligned with plugin rules.
180-
10. For dependency upgrades, also follow:
183+
10. Keep generated output aligned with plugin rules.
184+
11. For dependency upgrades, also follow:
181185
- `docs/dependency-upgrade-checklist.md`
182-
11. For monorepo/workspace setups, follow:
186+
12. For monorepo/workspace setups, follow:
183187
- `docs/monorepo-workspace-guide.md`
184-
12. To sync official Flutter AI rules profiles (`10k`/`4k`/`1k`), use:
188+
13. To sync official Flutter AI rules profiles (`10k`/`4k`/`1k`), use:
185189
- `sync-official-flutter-ai-rules`
186190
- `docs/flutter-ai-rules-sync.md`
187-
13. For automated release cut (version/changelog/tag/release), use:
191+
14. For automated release cut (version/changelog/tag/release), use:
188192
- `.github/workflows/release-automation.yml`
189193
- `docs/release-automation.md`
190-
14. For command namespacing/aliases (`flutter:*`), see:
194+
15. For command namespacing/aliases (`flutter:*`), see:
191195
- `docs/command-namespacing.md`
192-
15. For deterministic local setup and SDK/MCP readiness, use:
196+
16. For deterministic local setup and SDK/MCP readiness, use:
193197
- `setup-flutter-environment`
194198

195199
Note: every code review flow includes mandatory security checks (OWASP MASVS-oriented).
@@ -207,3 +211,4 @@ Note: every code review flow includes mandatory security checks (OWASP MASVS-ori
207211
9. Security audit and secrets scanner workflow via `/security-review`.
208212
10. Safe Flutter/Dart dependency upgrades with deterministic validation and rollback.
209213
11. Deterministic environment bootstrapping for Flutter SDK, MCP, and baseline checks.
214+
12. External backend API integration with robust auth/error/retry patterns.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: flutter:integrate-mobile-api
3+
description: Alias for `integrate-mobile-api`. Integrate backend REST/GraphQL APIs into Flutter app with safe auth, error handling, and layered architecture.
4+
---
5+
6+
Namespaced alias for `integrate-mobile-api`.
7+
8+
1. Run the canonical command with the same intent.
9+
2. Follow `./integrate-mobile-api.md`.
10+
3. Keep output and checks identical to the canonical command.

commands/integrate-mobile-api.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: integrate-mobile-api
3+
description: Integrate backend REST/GraphQL APIs into Flutter app with safe auth, error handling, and layered architecture.
4+
---
5+
6+
Integrate external API into the target Flutter app.
7+
8+
1. Follow `../skills/integrate-mobile-api/SKILL.md`.
9+
2. Keep networking logic in data layer and map to domain models/failures.
10+
3. Add/update tests for happy and error paths.
11+
4. Provide validation evidence and explicit follow-up risks.

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "flutter-cursor-plugin",
33
"displayName": "Flutter Cursor Plugin",
4-
"version": "1.10.5",
4+
"version": "1.10.6",
55
"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.",
66
"author": "Aleksandr Lozhkovoi",
77
"license": "MIT",

scripts/validate_prompt_semantics.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ canonical_commands=(
2929
"commands/update-flutter-dependencies.md"
3030
"commands/resolve-flutter-build-error.md"
3131
"commands/prepare-mobile-release.md"
32+
"commands/integrate-mobile-api.md"
3233
"commands/integrate-firebase.md"
3334
"commands/migrate-flutter-code.md"
3435
"commands/scaffold-flutter-feature.md"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: integrate-mobile-api
3+
description: Integrate external REST/GraphQL APIs into Flutter apps with production-safe networking, auth, error handling, and test coverage.
4+
---
5+
6+
# Integrate Mobile API
7+
8+
Use this skill for integrating backend APIs into Flutter applications.
9+
10+
## Workflow
11+
12+
1. Confirm API scope and constraints:
13+
- protocol (`REST` or `GraphQL`)
14+
- authentication model (JWT, OAuth, API key, session)
15+
- required endpoints/operations
16+
2. Define architecture boundaries:
17+
- data layer for client/datasource
18+
- domain layer for repository contracts and use cases
19+
- presentation layer for state updates
20+
3. Implement API client with safe defaults:
21+
- timeouts
22+
- retry/backoff policy where appropriate
23+
- request/response logging with redaction
24+
4. Add auth handling:
25+
- token attach/refresh strategy
26+
- unauthorized flow (`401/403`) and sign-out fallback
27+
5. Add DTO mapping and error normalization:
28+
- map API payloads to domain entities
29+
- map transport/server failures to typed domain failures
30+
6. Add tests:
31+
- unit tests for mapping and repository behavior
32+
- integration tests for happy/error paths (mock server/client)
33+
7. Validate with analysis and impacted tests.
34+
35+
## Guardrails
36+
37+
- Do not expose secrets/tokens in logs or source files.
38+
- Keep API client concerns in data layer; avoid direct networking in widgets.
39+
- Do not claim API integration is complete without naming changed files and validation evidence.
40+
- In simulation/planning mode, use `planned/not executed` wording.
41+
42+
## Required output
43+
44+
1. API scope and auth model selected.
45+
2. Files changed by layer (presentation/domain/data).
46+
3. Validation commands and results.
47+
4. Error handling and retry strategy summary.
48+
5. Remaining risks/follow-up tasks.
49+
50+
## Required references
51+
52+
- `../../rules/flutter-development-best-practices.mdc`
53+
- `../../rules/dart-effective-dart.mdc`
54+
- `../../rules/flutter-test-best-practices.mdc`

0 commit comments

Comments
 (0)