LogoSkills

inspector

Flutter app runtime debugging master inspector

ํ•ญ๋ชฉ๋‚ด์šฉ
Invoke/inspector
Aliases/debug, /inspect, /flutter:debug
Categorykobic-development
Complexitymoderate
MCP Serversflutter-inspector, serena

/inspector โ€” ์•ฑ ์†์„ ๋“ค์—ฌ๋‹ค๋ณด๋Š” "์ง„๋‹จ ์˜์‚ฌ"#

ํ•œ๋งˆ๋””๋กœ#

์‹คํ–‰ ์ค‘์ธ Flutter ์•ฑ ์•ˆ์—์„œ ์ง€๊ธˆ ๋ฌด์Šจ ์ผ์ด ๋ฒŒ์–ด์ง€๊ณ  ์žˆ๋Š”์ง€ ๋“ค์—ฌ๋‹ค๋ณด๋Š” ์ฒญ์ง„๊ธฐ์ž…๋‹ˆ๋‹ค. ํ™”๋ฉด ์ „ํ™˜, ๋กœ๊ทธ์ธ, ํ™”๋ฉด ๋ฐ์ดํ„ฐ, ํ†ต์‹  ๊ฐ™์€ ๋ถ€๋ถ„์„ ์˜์‚ฌ๊ฐ€ ์ฒญ์ง„๊ธฐ๋กœ ๋ชธ์†์„ ์‚ดํŽด๋ณด๋“ฏ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ง„๋‹จํ•ฉ๋‹ˆ๋‹ค.

๋ˆ„๊ฐ€ยท์–ธ์ œ ์“ฐ๋‚˜์š”#

  • ์•ฑ์ด ์ด์ƒํ•˜๊ฒŒ ๋™์ž‘ํ•˜๋Š”๋ฐ ์›์ธ์„ ๋ˆˆ์œผ๋กœ ํ™•์ธํ•˜๊ณ  ์‹ถ์„ ๋•Œ (ํ™”๋ฉด์ด ์•ˆ ๋„˜์–ด๊ฐ, ๋กœ๊ทธ์ธ์ด ํ’€๋ฆผ, ๋ฐ์ดํ„ฐ๊ฐ€ ์•ˆ ๋ณด์ž„, ํ†ต์‹  ์˜ค๋ฅ˜ ๋“ฑ)
  • ๊ฐœ๋ฐœ์ž/AI ์—์ด์ „ํŠธ๊ฐ€ ์ฝ”๋“œ๋ฅผ ๊ณ ์น˜๊ธฐ ์ „์— ์‹ค์ œ ์‹คํ–‰ ์ƒํƒœ๋ฅผ ๋จผ์ € ์ ๊ฒ€ํ•  ๋•Œ
  • ๋‹จ, ์•ฑ์ด ๋””๋ฒ„๊ทธ ๋ชจ๋“œ๋กœ ์‹คํ–‰ ์ค‘์ด์–ด์•ผ ์ง„๋‹จ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค (์‹คํ–‰ ์กฐ๊ฑด์€ ์•„๋ž˜ ์ƒ์„ธ ๋ช…์„ธ ์ฐธ๊ณ ).

๋ฌด์—‡์„ ํ•ด์ฃผ๋‚˜์š”#

์•ฑ์˜ ๋ถ€์œ„๋ณ„๋กœ ๋‚˜๋ˆ ์ง„ 9๊ฐœ์˜ ์ „๋ฌธ ์ง„๋‹จ๊ธฐ๋ฅผ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„ ์ƒํƒœ๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

  • nav โ€” ํ™”๋ฉด ์ „ํ™˜(ํ˜„์žฌ ์–ด๋А ํ™”๋ฉด์ธ์ง€, ์ด๋™ ๊ธฐ๋ก)
  • bloc โ€” ํ™”๋ฉด ๋ฐ์ดํ„ฐยท์ƒํƒœ ๊ด€๋ฆฌ ํ๋ฆ„
  • auth โ€” ๋กœ๊ทธ์ธ/์ธ์ฆ ์ƒํƒœ
  • network โ€” ์„œ๋ฒ„์™€ ์ฃผ๊ณ ๋ฐ›์€ ํ†ต์‹  ๊ธฐ๋ก๊ณผ ์˜ค๋ฅ˜
  • log โ€” ์•ฑ์ด ๋‚จ๊ธด ๊ธฐ๋ก(๋กœ๊ทธ)
  • ui โ€” ํ™”๋ฉด ๊ตฌ์„ฑ(๋ ˆ์ด์•„์›ƒ, ํ™”๋ฉด ๋ฐ–์œผ๋กœ ์‚์ ธ๋‚˜์˜จ ๋ถ€๋ถ„ ๋“ฑ)
  • config โ€” ์„ค์ •๊ฐ’ยท๊ธฐ๋Šฅ on/off ํ”Œ๋ž˜๊ทธ
  • form โ€” ์ž…๋ ฅ ํผ์˜ ๊ฐ’ยท๊ฒ€์ฆ ์˜ค๋ฅ˜
  • image โ€” ์ด๋ฏธ์ง€ ์บ์‹œยท๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰

์–ด๋–ป๊ฒŒ ์“ฐ๋‚˜์š”#

# ๋ชจ๋“  ์˜์—ญ์„ ํ•œ ๋ฒˆ์— ์ ๊ฒ€
/inspector --all

# ํ™”๋ฉด ์ „ํ™˜ ๋ฌธ์ œ ์ง„๋‹จ
/inspector nav

# ํ™”๋ฉด ์ƒํƒœ(BLoC)๋ฅผ ์ž์„ธํžˆ ์ ๊ฒ€
/inspector bloc --verbose

# ํ†ต์‹  ์˜ค๋ฅ˜ ๋ถ„์„
/inspector network
  • ์ง„๋‹จํ•  ๋ถ€์œ„ ์ด๋ฆ„(nav, bloc, auth, network, log, ui, config, form, image)์„ ๋ถ™์—ฌ ๋ถ€๋ฅด๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • --verbose๋Š” ๋” ์ž์„ธํžˆ, --all์€ ๋ชจ๋“  ๋ถ€์œ„๋ฅผ ํ•œ๊บผ๋ฒˆ์— ์ ๊ฒ€ํ•ฉ๋‹ˆ๋‹ค.

์•ˆ์—์„œ ๋ฌด์Šจ ์ผ์ด ๋ฒŒ์–ด์ง€๋‚˜์š”#

๋Œ€๋žต 4๋‹จ๊ณ„๋กœ ์ง„๋‹จ์ด ์ง„ํ–‰๋ฉ๋‹ˆ๋‹ค.

  1. ์—ฐ๊ฒฐ ํ™•์ธ โ€” ์•ฑ๊ณผ ์ •์ƒ์ ์œผ๋กœ ์—ฐ๊ฒฐ๋๋Š”์ง€, ์ง„๋‹จ ๋„๊ตฌ๋ฅผ ์“ธ ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  2. ๋ฌธ์ œ ๋ถ€์œ„ ์ฐพ๊ธฐ โ€” ์ฆ์ƒ์— ๋งž๋Š” ๋ถ€์œ„๋กœ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค(ํ™”๋ฉด ์ „ํ™˜โ†’nav, ์ƒํƒœ ๋ฌธ์ œโ†’bloc, ๋กœ๊ทธ์ธ ๋ฌธ์ œโ†’auth, ํ†ต์‹  ๋ฌธ์ œโ†’network).
  3. ์ƒ์„ธ ๋ถ„์„ โ€” ํ•ด๋‹น ๋ถ€์œ„ ์ „๋ฌธ ์ง„๋‹จ๊ธฐ๋ฅผ ๋Œ๋ ค ๋กœ๊ทธยท์ƒํƒœ๋ฅผ ์ถ”์ ํ•˜๊ณ  ๋ฌธ์ œ๋ฅผ ์งš์–ด๋ƒ…๋‹ˆ๋‹ค.
  4. ํ•ด๊ฒฐยทํ™•์ธ โ€” ์ฝ”๋“œ ์ˆ˜์ •์•ˆ์„ ์ œ์•ˆํ•˜๊ณ , ์ฆ‰์‹œ ๋ฐ˜์˜(hot reload)ํ•œ ๋’ค ๋‹ค์‹œ ์ ๊ฒ€ํ•ด ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

โš™๏ธ ์ƒ์„ธ ์˜ต์…˜ยท์‹คํ–‰ ๋ช…์„ธ (๊ฐœ๋ฐœ์ž / AI ์—์ด์ „ํŠธ์šฉ)

Triggers#

  • When app debugging is requested
  • When runtime state inspection is needed
  • When MCP toolkit-based inspection is needed

Context Trigger Pattern#

/inspector {area} [--options]

Parameters#

ParameterRequiredDescriptionExample
areaNoInspection areanav, bloc, auth, network, log, ui, config, form, image
--verboseNoVerbose output
--allNoInspect all areas

Sub-Inspectors#

9 Specialized Inspectors#

InspectorRoleKey Tools
/inspector/navGoRouter navigationnav_get_current_route, nav_get_history
/inspector/blocBLoC state trackingbloc_list_active, bloc_get_state
/inspector/authAuthentication statusauth_get_status, auth_get_user
/inspector/networkHTTP request loggingnetwork_get_logs, network_get_errors
/inspector/logApp log managementlog_get_recent, log_get_errors
/inspector/uiWidget tree inspectionui_get_widget_tree, ui_find_overflow
/inspector/configSettings/feature flagsconfig_get_all, config_get_feature_flags
/inspector/formForm validation debuggingform_get_state, form_get_errors
/inspector/imageImage cache/memoryimg_get_cache_stats, img_analyze_warnings

Prerequisites#

Flutter App Run Conditions#

# Run in debug mode (VM Service enabled)
flutter run --debug \
  --enable-vm-service \
  --host-vmservice-port=8182 \
  --dds-port=8181 \
  --disable-service-auth-codes

MCP Toolkit Integration#

// main.dart
import 'package:mcp_toolkit/mcp_toolkit.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  MCPToolkitBinding.instance
    ..initialize()
    ..initializeFlutterToolkit();

  if (kDebugMode) {
    // Register custom tools
    registerDebugTools();
  }

  runApp(const MyApp());
}

Diagnostic Workflow#

+---------------------------------------------+
|  1. Verify App Connection                     |
+---------------------------------------------+
|  - Test hot_reload_flutter                    |
|  - Check listClientToolsAndResources          |
+---------------------------------------------+
                    |
                    v
+---------------------------------------------+
|  2. Identify Problem Area                     |
+---------------------------------------------+
|  - Screen transition - >   @flutter-inspector-nav|
|  - State issue - >   @flutter-inspector-bloc     |
|  - Login issue - >   @flutter-inspector-auth     |
|  - API issue - >   @flutter-inspector-network    |
+---------------------------------------------+
                    |
                    v
+---------------------------------------------+
|  3. Detailed Analysis                         |
+---------------------------------------------+
|  - Run specialized inspector tools            |
|  - Track logs and state                       |
|  - Identify issues                            |
+---------------------------------------------+
                    |
                    v
+---------------------------------------------+
|  4. Resolution and Verification               |
+---------------------------------------------+
|  - Suggest code fixes                         |
|  - Apply with hot_reload_flutter              |
|  - Confirm with re-inspection                 |
+---------------------------------------------+

Quick Diagnostics#

Screen Transition Issues#

1. /inspector/nav - >   Check current route
2. nav_get_history - >   Track transition history
3. nav_get_params - >   Verify passed parameters

State Management Issues#

1. /inspector/bloc - >   Active BLoC list
2. bloc_get_state - >   Check current state
3. bloc_get_events - >   Event history

API Errors#

1. /inspector/network - >   Request/response logs
2. network_get_errors - >   Check failed requests
3. /inspector/auth - >   Check token status

UI Layout Issues#

1. /inspector/ui - >   Check widget tree
2. ui_find_overflow - >   Search for overflow
3. ui_get_screen_info - >   Screen info

Performance Issues#

1. /inspector/image - >   Image cache analysis
2. img_analyze_warnings - >   Memory warnings
3. /inspector/log - >   Performance related logs

MCP Integration#

StepMCP ServerPurpose
App connectionflutter-inspectorVM Service connection
Tool queryflutter-inspectorlistClientToolsAndResources
Tool executionflutter-inspectorrunClientTool
Code analysisserenaRelated code search

Examples#

Full state check#

/inspector --all
/inspector nav

BLoC state check#

/inspector bloc --verbose

Network error analysis#

/inspector network

References#

  • Detailed implementation: .claude/agents/flutter-inspector.md
  • Sub-inspectors: .claude/commands/inspector/
  • MCP toolkit: package/mcp_toolkit/