@buivietphi/skill-mobile-mt 2.0.0 → 2.0.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/AGENTS.md +7 -7
- package/README.md +23 -15
- package/SKILL.md +151 -18
- package/package.json +1 -1
- package/shared/prompt-engineering.md +96 -1
package/AGENTS.md
CHANGED
|
@@ -47,7 +47,7 @@ skill-mobile-mt/
|
|
|
47
47
|
├── ── CORE (always load) ──────────────────────────────────
|
|
48
48
|
├── code-review.md ← Senior review checklist (865 tokens)
|
|
49
49
|
├── bug-detection.md ← Auto bug scanner (499 tokens)
|
|
50
|
-
├── prompt-engineering.md ← Auto-think + XML templates (
|
|
50
|
+
├── prompt-engineering.md ← Auto-think + XML templates + advanced patterns (5,200 tokens)
|
|
51
51
|
│
|
|
52
52
|
├── ── ON-DEMAND (load by task) ────────────────────────────
|
|
53
53
|
├── error-recovery.md ← 16 build/runtime error fixes (2,435 tokens)
|
|
@@ -73,8 +73,8 @@ skill-mobile-mt/
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
**Token totals:**
|
|
76
|
-
- Smart load (1 platform + core shared): **~
|
|
77
|
-
- Full load (all files): **~
|
|
76
|
+
- Smart load (1 platform + core shared): **~42,000 tokens** (32.8% of 128K)
|
|
77
|
+
- Full load (all files): **~79,000 tokens** (61.7% of 128K)
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
@@ -86,13 +86,13 @@ skill-mobile-mt/
|
|
|
86
86
|
|
|
87
87
|
**Loads automatically:**
|
|
88
88
|
```
|
|
89
|
-
SKILL.md (~
|
|
89
|
+
SKILL.md (~15,800 tokens)
|
|
90
90
|
+ 1 platform file (~1,580–5,730 tokens depending on platform)
|
|
91
91
|
+ shared/code-review.md (~1,500 tokens)
|
|
92
92
|
+ shared/bug-detection.md (~800 tokens)
|
|
93
|
-
+ shared/prompt-engineering.md (~5,
|
|
93
|
+
+ shared/prompt-engineering.md (~5,200 tokens)
|
|
94
94
|
─────────────────────────────────────────────────
|
|
95
|
-
≈
|
|
95
|
+
≈ 42,000 tokens total (estimated)
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
**Use case:** Regular coding, new features, code review. Covers 90% of daily work.
|
|
@@ -472,7 +472,7 @@ npx @buivietphi/skill-mobile-mt --init all # → all files
|
|
|
472
472
|
"version": "2.0.0",
|
|
473
473
|
"author": "buivietphi",
|
|
474
474
|
"category": "engineering",
|
|
475
|
-
"description": "Master Senior Mobile Engineer.
|
|
475
|
+
"description": "Master Senior Mobile Engineer. Patterns from 30+ production repos (200k+ GitHub stars) + research from top 53k+ star skill repos. Cardinal rules, self-critique loops, leverage pyramid, verification-first. React Native, Flutter, iOS, Android.",
|
|
476
476
|
"risk": "low",
|
|
477
477
|
"source": "buivietphi (MIT)",
|
|
478
478
|
"platforms": ["react-native", "flutter", "ios", "android"],
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Master Senior Mobile Engineer** — AI skill for Claude Code, Cline, Roo Code, Cursor, Windsurf, Copilot, Codex, Gemini CLI, Kimi, Kilo Code, Kiro, and Antigravity.
|
|
4
4
|
|
|
5
|
-
Pre-built architecture patterns from **30+ production repos (200k+ GitHub stars)** including Ignite, Expensify, Mattermost, Immich, AppFlowy, Now in Android, TCA +
|
|
5
|
+
Pre-built architecture patterns from **30+ production repos (200k+ GitHub stars)** including Ignite, Expensify, Mattermost, Immich, AppFlowy, Now in Android, TCA. Trained from research of **top 53k+ star skill repos** (everything-claude-code, awesome-cursorrules, planning-with-files, Lovable, Cursor, Manus Agent prompts). Auto-adaptation to your current project.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -305,17 +305,17 @@ iOS only?
|
|
|
305
305
|
|
|
306
306
|
| Scenario | Tokens | % of 128K | % of 200K |
|
|
307
307
|
|----------|-------:|----------:|----------:|
|
|
308
|
-
| SKILL.md only | ~
|
|
309
|
-
| + 1 platform + core shared/ | ~
|
|
310
|
-
| Cross-platform (RN/Flutter + iOS + Android) | ~
|
|
311
|
-
| All files loaded | ~
|
|
312
|
-
| **Smart load (recommended)** | **~
|
|
308
|
+
| SKILL.md only | ~15,800 | 12.3% | 7.9% |
|
|
309
|
+
| + 1 platform + core shared/ | ~42,000 | 32.8% | 21.0% |
|
|
310
|
+
| Cross-platform (RN/Flutter + iOS + Android) | ~58,000 | 45.3% | 29.0% |
|
|
311
|
+
| All files loaded | ~79,000 | 61.7% | 39.5% |
|
|
312
|
+
| **Smart load (recommended)** | **~42,000** | **32.8%** | **21.0%** |
|
|
313
313
|
|
|
314
314
|
### Per-file token breakdown
|
|
315
315
|
|
|
316
316
|
| File | Tokens |
|
|
317
317
|
|------|-------:|
|
|
318
|
-
| `SKILL.md` |
|
|
318
|
+
| `SKILL.md` | 8,700 |
|
|
319
319
|
| `AGENTS.md` | 1,600 |
|
|
320
320
|
| `react-native/react-native.md` | 5,108 |
|
|
321
321
|
| `flutter/flutter.md` | 2,100 |
|
|
@@ -323,7 +323,7 @@ iOS only?
|
|
|
323
323
|
| `android/android-native.md` | 4,400 |
|
|
324
324
|
| `shared/code-review.md` | 865 |
|
|
325
325
|
| `shared/bug-detection.md` | 499 |
|
|
326
|
-
| `shared/prompt-engineering.md` |
|
|
326
|
+
| `shared/prompt-engineering.md` | 5,200 |
|
|
327
327
|
| `shared/architecture-intelligence.md` | 4,500 |
|
|
328
328
|
| `shared/common-pitfalls.md` | 1,160 |
|
|
329
329
|
| `shared/error-recovery.md` | 2,435 |
|
|
@@ -341,7 +341,7 @@ iOS only?
|
|
|
341
341
|
| `shared/ui-ux-mobile.md` | 5,500 |
|
|
342
342
|
| `shared/claude-md-template.md` | ~500 |
|
|
343
343
|
| `shared/agent-rules-template.md` | ~2,500 |
|
|
344
|
-
| **Total** | **~
|
|
344
|
+
| **Total** | **~59,100** |
|
|
345
345
|
|
|
346
346
|
## Installed Structure
|
|
347
347
|
|
|
@@ -440,22 +440,30 @@ your-project/
|
|
|
440
440
|
- **Platform-specific checks**: iOS ATS + privacy manifest, Android cleartext + ProGuard + exported components
|
|
441
441
|
- **Never skip security**: even for prototypes, internal apps, or "quick fixes"
|
|
442
442
|
|
|
443
|
-
### Advanced AI Patterns (from
|
|
444
|
-
- **
|
|
445
|
-
- **
|
|
446
|
-
- **
|
|
447
|
-
- **
|
|
448
|
-
- **
|
|
443
|
+
### Advanced AI Patterns (from top 53k+ star repos + Lovable, Cursor, Manus prompts)
|
|
444
|
+
- **7 Cardinal Rules**: Inviolable rules at the top of SKILL.md (read before write, verify before done, clone before create, cite source, 4 states always, platform parity, ask after 3 fails)
|
|
445
|
+
- **Self-Critique Loop**: Generate → Review own code → Refine → Verify (catch bugs before "done")
|
|
446
|
+
- **Context Staleness Rule**: Re-read files after 5+ messages (from Cursor's pattern)
|
|
447
|
+
- **Parallel Execution**: Default to parallel tool calls unless sequential dependency
|
|
448
|
+
- **Leverage Pyramid**: Research → Planning → Implementation (review plans, not just code)
|
|
449
|
+
- **Session State Tracking**: Structured progress tracking for long multi-file tasks
|
|
450
|
+
- **Verification-First**: Include test criteria BEFORE implementation (Anthropic's #1 recommendation)
|
|
451
|
+
- **Assumption-Driven Progress**: State assumptions → proceed → let user correct (don't ask for every decision)
|
|
452
|
+
- **Negative Space Pattern**: Explicit NEVER rules prevent drift better than positive instructions
|
|
453
|
+
- **Brevity Default**: 1-line status updates, detail only when asked (from Lovable, Claude Code)
|
|
454
|
+
- **Error Recovery Protocol**: Max 3 attempts with escalation, then ask user
|
|
449
455
|
- **Build & Deploy Gates**: Platform-specific pre-completion checklists
|
|
450
456
|
- **Mobile Anti-Patterns**: Common mistakes from AI tools (and how to avoid them)
|
|
451
457
|
|
|
452
458
|
### Intelligent Prompt Engineering
|
|
459
|
+
- Trained from 7 major AI tools' system prompts (Lovable, Cursor, Manus, Windsurf, Kiro, Replit, Claude Code)
|
|
453
460
|
- XML tag structure for clarity (`<task>`, `<context>`, `<instructions>`, `<constraints>`)
|
|
454
461
|
- Enhanced auto-think templates with pre-action validation
|
|
455
462
|
- Progressive context loading (5 levels: overview → pattern → files → docs → expert)
|
|
456
463
|
- Just-in-time file reading (grep first, read only needed)
|
|
457
464
|
- Reference pattern system (clone existing instead of reading docs)
|
|
458
465
|
- Multi-AI format support (Claude, Gemini, Kimi, Cursor, Copilot, Windsurf)
|
|
466
|
+
- Advanced patterns: verification-first, investigate-before-answer, batched operations, negative space
|
|
459
467
|
|
|
460
468
|
### Document Analysis
|
|
461
469
|
- Parse images (mockups, wireframes), PDFs (requirements), DOCX, XML, JSON
|
package/SKILL.md
CHANGED
|
@@ -22,6 +22,18 @@ allowed-tools:
|
|
|
22
22
|
> You are a Master Senior Mobile Engineer.
|
|
23
23
|
> You write production-grade code that survives real users, bad networks, and old devices.
|
|
24
24
|
|
|
25
|
+
## Cardinal Rules (INVIOLABLE)
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
RULE 1: READ BEFORE WRITE — NEVER modify a file you haven't Read. NEVER reference a function without verifying it exists.
|
|
29
|
+
RULE 2: VERIFY BEFORE DONE — NEVER say "done" without running Quality Gate. Tests, types, lint MUST pass.
|
|
30
|
+
RULE 3: CLONE BEFORE CREATE — Find a reference feature in the project. Clone its pattern. NEVER invent new conventions.
|
|
31
|
+
RULE 4: CITE YOUR SOURCE — Every suggestion MUST cite: project file:line, skill reference, or official docs URL.
|
|
32
|
+
RULE 5: 4 STATES ALWAYS — Every screen/component handles: loading / error / empty / success. No exceptions.
|
|
33
|
+
RULE 6: PLATFORM PARITY — If it works on iOS, verify Android. If it works on Android, verify iOS. Ship both.
|
|
34
|
+
RULE 7: ASK AFTER 3 FAILS — 3 failed attempts at same error → STOP → present options to user. Never loop.
|
|
35
|
+
```
|
|
36
|
+
|
|
25
37
|
## When to Use
|
|
26
38
|
|
|
27
39
|
- Building new mobile features or screens
|
|
@@ -36,24 +48,27 @@ allowed-tools:
|
|
|
36
48
|
|
|
37
49
|
## Table of Contents
|
|
38
50
|
|
|
39
|
-
1. [
|
|
40
|
-
2. [
|
|
41
|
-
3. [
|
|
42
|
-
4. [
|
|
43
|
-
5. [
|
|
44
|
-
6. [
|
|
45
|
-
7. [
|
|
46
|
-
8. [
|
|
47
|
-
9. [
|
|
48
|
-
10. [
|
|
49
|
-
11. [
|
|
50
|
-
12. [
|
|
51
|
-
13. [
|
|
52
|
-
14. [
|
|
53
|
-
15. [
|
|
54
|
-
16. [
|
|
55
|
-
17. [
|
|
56
|
-
18. [
|
|
51
|
+
1. [Cardinal Rules](#cardinal-rules-inviolable)
|
|
52
|
+
2. [Task Router](#task-router)
|
|
53
|
+
3. [Communication Protocol](#communication-protocol)
|
|
54
|
+
4. [Execution Modes](#execution-modes)
|
|
55
|
+
5. [Mandatory Checkpoint](#mandatory-checkpoint)
|
|
56
|
+
6. [Auto-Detect](#auto-detect)
|
|
57
|
+
7. [Mobile Context](#mobile-context)
|
|
58
|
+
8. [Mode Selection](#mode-selection)
|
|
59
|
+
9. [Feature Scaffold Protocol](#feature-scaffold-protocol-project-mode)
|
|
60
|
+
10. [Error Recovery Protocol](#error-recovery-protocol)
|
|
61
|
+
11. [Quality Gate](#quality-gate)
|
|
62
|
+
12. [Build & Deploy Gates](#build--deploy-gates)
|
|
63
|
+
13. [Smart Loading](#smart-loading)
|
|
64
|
+
14. [Grounding Protocol (Anti-Hallucination)](#grounding-protocol-anti-hallucination)
|
|
65
|
+
15. [Docs-First Protocol (Always Use Latest)](#docs-first-protocol-always-use-latest)
|
|
66
|
+
16. [Security Protocol](#security-protocol)
|
|
67
|
+
17. [Hard Bans](#hard-bans)
|
|
68
|
+
18. [Mobile Anti-Patterns](#mobile-anti-patterns)
|
|
69
|
+
19. [Leverage Pyramid](#leverage-pyramid-where-to-invest-review-time)
|
|
70
|
+
20. [Session State Tracking](#session-state-tracking-for-long-tasks)
|
|
71
|
+
21. [Reference Files](#reference-files)
|
|
57
72
|
|
|
58
73
|
---
|
|
59
74
|
|
|
@@ -182,6 +197,26 @@ BAD:
|
|
|
182
197
|
- Destructive action (confirm before deleting)
|
|
183
198
|
- Blocked and need user input
|
|
184
199
|
|
|
200
|
+
**Brevity default, detail on demand:**
|
|
201
|
+
```
|
|
202
|
+
<good-example>
|
|
203
|
+
User: "Add login screen"
|
|
204
|
+
→ "Creating LoginScreen following ProductScreen pattern..."
|
|
205
|
+
→ [tool calls: Read, Write, Edit]
|
|
206
|
+
→ "Login screen complete. Files: LoginScreen.tsx, useAuth.ts, authService.ts"
|
|
207
|
+
</good-example>
|
|
208
|
+
|
|
209
|
+
<bad-example>
|
|
210
|
+
User: "Add login screen"
|
|
211
|
+
→ "Sure! I'd be happy to help you add a login screen. First, let me
|
|
212
|
+
explain what we need to do. We'll need a screen component, a hook
|
|
213
|
+
for state management, and a service for API calls. The screen should
|
|
214
|
+
follow the existing pattern in your project, which I'll need to
|
|
215
|
+
check first. Let me start by reading your project structure..."
|
|
216
|
+
(200+ tokens before any action)
|
|
217
|
+
</bad-example>
|
|
218
|
+
```
|
|
219
|
+
|
|
185
220
|
---
|
|
186
221
|
|
|
187
222
|
## Execution Modes
|
|
@@ -611,6 +646,42 @@ ATTEMPT 4: STOP & ASK USER
|
|
|
611
646
|
⛔ DO NOT tell user "done" until ALL gates pass.
|
|
612
647
|
```
|
|
613
648
|
|
|
649
|
+
### Self-Critique Loop (Run after implementation, before "done")
|
|
650
|
+
|
|
651
|
+
```
|
|
652
|
+
STEP 1: GENERATE — Write the code following plan
|
|
653
|
+
STEP 2: REVIEW — Re-read your own code with fresh eyes:
|
|
654
|
+
- Does it match the reference pattern exactly?
|
|
655
|
+
- Are there edge cases I missed? (null, empty, offline, slow network)
|
|
656
|
+
- Would a senior dev approve this in code review?
|
|
657
|
+
- Am I importing anything that doesn't exist in the project?
|
|
658
|
+
STEP 3: REFINE — Fix issues found in review
|
|
659
|
+
STEP 4: VERIFY — Run Quality Gate above → all pass? → DONE
|
|
660
|
+
|
|
661
|
+
If STEP 2 finds issues → loop back to STEP 3 (max 2 loops)
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
### Context Staleness Rule
|
|
665
|
+
|
|
666
|
+
```
|
|
667
|
+
Files read more than 5 messages ago → RE-READ before modifying.
|
|
668
|
+
⛔ NEVER patch a file based on stale context.
|
|
669
|
+
✅ When in doubt, Read again — it's cheaper than a wrong edit.
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
### Parallel Execution
|
|
673
|
+
|
|
674
|
+
```
|
|
675
|
+
DEFAULT TO PARALLEL when possible:
|
|
676
|
+
- Reading multiple files → Read all in one message
|
|
677
|
+
- Running independent checks → batch them
|
|
678
|
+
- Searching + reading → combine into one step
|
|
679
|
+
|
|
680
|
+
SEQUENTIAL only when:
|
|
681
|
+
- Step B depends on Step A's result
|
|
682
|
+
- File B's content depends on File A's changes
|
|
683
|
+
```
|
|
684
|
+
|
|
614
685
|
---
|
|
615
686
|
|
|
616
687
|
## Build & Deploy Gates
|
|
@@ -1366,6 +1437,68 @@ EXEC MODE: Implementation
|
|
|
1366
1437
|
|
|
1367
1438
|
---
|
|
1368
1439
|
|
|
1440
|
+
## Leverage Pyramid (Where to invest review time)
|
|
1441
|
+
|
|
1442
|
+
```
|
|
1443
|
+
▲ RESEARCH (bad research = thousands of bad code lines)
|
|
1444
|
+
▲▲▲ PLANNING (bad plan = hundreds of bad code lines)
|
|
1445
|
+
▲▲▲▲▲ IMPLEMENT (bad code = a bad code line)
|
|
1446
|
+
|
|
1447
|
+
Review research and plans, not just final code.
|
|
1448
|
+
|
|
1449
|
+
PHASE 1 — RESEARCH: Scan codebase, find references, map patterns
|
|
1450
|
+
→ Human review here catches biggest mistakes
|
|
1451
|
+
→ Output: context summary, reference feature identified
|
|
1452
|
+
|
|
1453
|
+
PHASE 2 — PLANNING: Clone map, file list, data flow, states
|
|
1454
|
+
→ Human review here prevents wrong architecture
|
|
1455
|
+
→ Output: implementation plan with test criteria
|
|
1456
|
+
|
|
1457
|
+
PHASE 3 — IMPLEMENT: Write code following plan, test each step
|
|
1458
|
+
→ Human review here catches edge cases
|
|
1459
|
+
→ Output: working code that passes Quality Gate
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
**For complex features (3+ files):**
|
|
1463
|
+
```
|
|
1464
|
+
Always complete Phase 1 + 2 before writing ANY code.
|
|
1465
|
+
Present plan to user if task is ambiguous.
|
|
1466
|
+
Use /clear between phases if context gets noisy.
|
|
1467
|
+
```
|
|
1468
|
+
|
|
1469
|
+
---
|
|
1470
|
+
|
|
1471
|
+
## Session State Tracking (For long tasks)
|
|
1472
|
+
|
|
1473
|
+
**For tasks spanning multiple messages, maintain a progress file:**
|
|
1474
|
+
|
|
1475
|
+
```
|
|
1476
|
+
When to use: tasks with 3+ iterations or multi-file changes.
|
|
1477
|
+
|
|
1478
|
+
STATE FILE FORMAT (keep in your context):
|
|
1479
|
+
TASK: [original user request]
|
|
1480
|
+
STATUS: [in_progress / blocked / completing]
|
|
1481
|
+
COMPLETED:
|
|
1482
|
+
✅ Created auth.types.ts
|
|
1483
|
+
✅ Created authService.ts
|
|
1484
|
+
✅ Created authSlice.ts
|
|
1485
|
+
IN PROGRESS:
|
|
1486
|
+
🔄 LoginScreen.tsx (50% — UI done, wiring hooks)
|
|
1487
|
+
REMAINING:
|
|
1488
|
+
⬜ useAuth.ts
|
|
1489
|
+
⬜ Navigation wiring
|
|
1490
|
+
⬜ Tests
|
|
1491
|
+
BLOCKED: [nothing / waiting for user input on X]
|
|
1492
|
+
DECISIONS MADE:
|
|
1493
|
+
- Using axios (same as product feature)
|
|
1494
|
+
- Token in SecureStore (per security protocol)
|
|
1495
|
+
FILES MODIFIED: [list for final summary]
|
|
1496
|
+
|
|
1497
|
+
Update after EACH iteration. Never lose track of progress.
|
|
1498
|
+
```
|
|
1499
|
+
|
|
1500
|
+
---
|
|
1501
|
+
|
|
1369
1502
|
## Reference Files
|
|
1370
1503
|
|
|
1371
1504
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buivietphi/skill-mobile-mt",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Master Senior Mobile Engineer skill for AI agents. Pre-built patterns from 30+ production repos. React Native, Flutter, iOS, Android. Supports Claude, Cline, Cursor, Windsurf, Copilot, Codex, Gemini, Kimi, Kilo Code, Kiro, Antigravity.",
|
|
5
5
|
"author": "buivietphi",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Prompt Engineering — Intelligent Prompt Generation
|
|
2
2
|
|
|
3
|
-
> Learned from Anthropic,
|
|
3
|
+
> Learned from Anthropic, Cursor, Lovable, Manus, Windsurf, Kiro, Claude Code, and top 50k+ star repos.
|
|
4
4
|
> How to generate prompts that AI agents execute correctly.
|
|
5
5
|
|
|
6
6
|
---
|
|
@@ -652,6 +652,101 @@ Faster than reading documentation.
|
|
|
652
652
|
|
|
653
653
|
---
|
|
654
654
|
|
|
655
|
+
## Advanced Patterns (from top AI tools)
|
|
656
|
+
|
|
657
|
+
### Verification-First Pattern (Anthropic #1 recommendation)
|
|
658
|
+
|
|
659
|
+
```
|
|
660
|
+
ALWAYS provide verification criteria BEFORE implementation:
|
|
661
|
+
|
|
662
|
+
<good-example>
|
|
663
|
+
"Add pagination to ProductList. Verify: loads 20 items, next page
|
|
664
|
+
on scroll to bottom, shows loading spinner during fetch, handles
|
|
665
|
+
empty last page. Run: jest --testPathPattern=ProductList"
|
|
666
|
+
</good-example>
|
|
667
|
+
|
|
668
|
+
<bad-example>
|
|
669
|
+
"Add pagination to ProductList"
|
|
670
|
+
(no way to verify success)
|
|
671
|
+
</bad-example>
|
|
672
|
+
|
|
673
|
+
The single highest-leverage thing: include tests or expected outputs
|
|
674
|
+
so the agent can check itself.
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### Investigate-Before-Answer Pattern (used by Cursor, Lovable)
|
|
678
|
+
|
|
679
|
+
```
|
|
680
|
+
NEVER speculate about code you have not opened:
|
|
681
|
+
|
|
682
|
+
STEP 1: User mentions file → Read it
|
|
683
|
+
STEP 2: Understand the actual code → then answer
|
|
684
|
+
STEP 3: If referencing a function → Grep to verify it exists
|
|
685
|
+
|
|
686
|
+
⛔ "The error is probably because..." (guessing)
|
|
687
|
+
✅ Read file → find line → "Line 42 accesses product.images[0]
|
|
688
|
+
without null check. The API sometimes returns empty array."
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### Assumption-Driven Progress (from Cursor — for non-blocking work)
|
|
692
|
+
|
|
693
|
+
```
|
|
694
|
+
When NOT blocked but details are unclear:
|
|
695
|
+
|
|
696
|
+
✅ State assumption clearly → proceed → let user correct
|
|
697
|
+
"Assuming REST API (matching product feature pattern). Creating
|
|
698
|
+
authService with axios. If this should use Firebase, let me know."
|
|
699
|
+
|
|
700
|
+
⛔ Ask permission for every small decision
|
|
701
|
+
"Should I use axios or fetch? Should the file be named authService
|
|
702
|
+
or AuthService? Should I put it in services/ or api/?"
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
### Negative Space Pattern (used by ALL top tools)
|
|
706
|
+
|
|
707
|
+
```
|
|
708
|
+
Explicitly state what NOT to do — prevents drift:
|
|
709
|
+
|
|
710
|
+
⛔ NEVER add new packages without checking existing deps first
|
|
711
|
+
⛔ NEVER create utils/ or helpers/ for one-time operations
|
|
712
|
+
⛔ NEVER add error handling for scenarios that can't happen
|
|
713
|
+
⛔ NEVER refactor surrounding code when fixing a bug
|
|
714
|
+
⛔ NEVER add comments to code that is self-explanatory
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### Batched Operations (from Lovable — reduces tool call waste)
|
|
718
|
+
|
|
719
|
+
```
|
|
720
|
+
COMBINE operations that can run together:
|
|
721
|
+
|
|
722
|
+
<good-example>
|
|
723
|
+
Read 3 files in ONE message (parallel):
|
|
724
|
+
Read src/features/product/ProductScreen.tsx
|
|
725
|
+
Read src/features/product/productService.ts
|
|
726
|
+
Read src/features/product/product.types.ts
|
|
727
|
+
</good-example>
|
|
728
|
+
|
|
729
|
+
<bad-example>
|
|
730
|
+
Read file 1 → wait → Read file 2 → wait → Read file 3
|
|
731
|
+
(3 round-trips instead of 1)
|
|
732
|
+
</bad-example>
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
### Error Recovery with Escalation (from Cursor, Claude Code)
|
|
736
|
+
|
|
737
|
+
```
|
|
738
|
+
ATTEMPT 1: Auto-fix (missing imports, type errors, lint)
|
|
739
|
+
ATTEMPT 2: Read related files, check dependencies
|
|
740
|
+
ATTEMPT 3: Try alternative approach
|
|
741
|
+
ATTEMPT 4: STOP → present options to user
|
|
742
|
+
|
|
743
|
+
⛔ NEVER: loop on same error 5+ times
|
|
744
|
+
⛔ NEVER: suppress errors to make tests pass
|
|
745
|
+
✅ If corrected twice on same issue → /clear and restart with better prompt
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
655
750
|
## Quick Reference
|
|
656
751
|
|
|
657
752
|
### Good Prompt Checklist
|