flocon-mock-mode
Skill379 starsChanged 29 days agoMITView on GitHub
Use when you need Flocon Desktop running with data and no phone connected - doc screenshots, checking how a screen looks in a given state, testing MCP tools on known data, edge cases (huge bodies, invalid JSON, many devices).
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- create-pull-requestSkill
- dev-workflowSkill
- git-setupSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Run it in the background: the app blocks until its window is closed.
- Very specific: line 71
Add a file in mock/scenarios/ (or extend Scenarios.kt):
- Very specific: line 95
Add it to MockScenarios.all (mock/MockScenarios.kt).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flocon Desktop mock mode
--mock=<scenario> starts Flocon Desktop with fake connected devices and pre-filled data. The data goes through the real handlers, Room and UI, exactly like a real SDK would send it. Timestamps are relative to the launch time, so the screens always look recent.
Covered plugins: network, timeline, crash reporter, analytics, feature flags (+ devices/apps). Not covered: database, files, shared preferences, images, dashboards… use the sample app for those.
Launch
From FloconDesktop/, with JDK 21:
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
./gradlew :composeApp:run --args="--mock=default"--mock=list(or--mock) prints the scenarios and exits.- An unknown name exits with the list of available names.
- Run it in the background: the app blocks until its window is closed. It is ready when the MCP port answers:
lsof -nP -iTCP:9042 -sTCP:LISTEN. - Each mock launch wipes and reuses
~/.flocon/mock/flocon_room.db: the same scenario always gives the same screens. The real database (~/.flocon/flocon_room.db) is never touched. - adb and the iOS simulator are disabled in mock mode (no command reaches a real phone).
Limits
- The MCP server listens on the usual port 9042: close the real Flocon Desktop first, or the mock one can't start its MCP server and your MCP calls reach the real app.
- Settings (theme, app scale, hidden menus, columns…) are the user's real settings, shared with the normal app.
- Commands sent by the desktop to the device (network mocks, bad network, toggling a flag…) are accepted and ignored.
Scenarios
| Name | Content |
default | A Pixel 8 with a bit of every plugin |
doc-network | Network only: JSON bodies, headers, 4xx/5xx, timeout, GraphQL, a pending call |
doc-timeline | Timeline logs only: navigation, user actions, lifecycle, every level |
doc-crashreporter | Crashes with stack traces |
doc-analytics | Analytics events in two tables |
doc-featureflags | Feature flags from two providers |
empty | A connected device with no data (empty states) |
multi-device | Android with two apps + an iPhone |
weird | 5 MB body, invalid JSON, unicode, 50×500, 2 000-char URL, old SDK version, odd timestamps |
Code: FloconDesktop/data/remote/src/commonMain/kotlin/com/flocon/data/remote/mock/ (scenarios/Scenarios.kt and the shared scenarios/SampleData.kt).
Take screenshots / check the data
With the mock app running, use its MCP server (http://localhost:9042/mcp, the flocon MCP tools if connected):
flocon_navigate_into_desktop_appwithscreen(network,timeline,analytics,feature_flags,crash_reporter…) to show a screen.take_flocon_desktop_screenshotreturns a PNG of the window.list_devices,list_network_calls,get_timeline,list_crash_reports,list_analytics_events,list_feature_flagsto check the data.
Without the MCP tools connected, call them with curl (stateless JSON-RPC):
curl -s -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
http://localhost:9042/mcp \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"take_flocon_desktop_screenshot","arguments":{}}}'The image is base64 in result.content[].data.
Write a new scenario
Scenarios are Kotlin, compiled with the app, and committed with the change they test.
- Add a file in
mock/scenarios/(or extendScenarios.kt):
internal val checkoutErrorsScenario = scenario("checkout-errors", description = "Checkout failing in every way") {
android("Pixel 8", app = SAMPLE_APP, packageName = SAMPLE_PACKAGE) {
network(5.minutes.ago, "POST", "https://api.example.com/checkout", status = 500, duration = 1.seconds) {
requestHeader("content-type", "application/json")
requestBody("""{"cartId":"c-1"}""")
responseBody("""{"error":"internal_error"}""")
}
network(4.minutes.ago, "POST", "https://api.example.com/checkout", error = "java.net.SocketTimeoutException: timeout")
network(3.minutes.ago, "GET", "https://api.example.com/slow", pending = true)
repeat(100) { network((200 - it).seconds.ago, "GET", "https://api.example.com/items/$it") }
timeline(6.minutes.ago, "CheckoutScreen", type = "navigation", level = null)
timeline(3.minutes.ago, "Checkout failed", type = "billing", level = "error", params = mapOf("code" to "500"))
crash(2.minutes.ago, exceptionType = "java.lang.IllegalStateException", message = "boom", stackTrace = "at a.b(C.kt:1)")
analytics(1.minutes.ago, "checkout_error", "code" to "500", tableId = "analytics")
featureFlags("firebase") { flag("checkout_v2", state = "custom", variant = "treatment", payload = "{}") }
raw(30.seconds.ago, plugin = "network", method = "log_network_call_request", body = "{not json")
}
ios("iPhone 16", app = "Shop", packageName = "com.example.shop", appStartedAt = 10.minutes.ago, sdkVersion = "1.0.0") { }
}- Add it to
MockScenarios.all(mock/MockScenarios.kt). ./gradlew :data:remote:desktopTest --tests "*MockScenariosTest"(update the expected name list there), then launch it.
DSL notes:
atis the time before launch (5.minutes.ago).appStartedAtis when the app started (default: 1 s before its first event); the timeline session starts there.sdkVersionis the Flocon SDK version on the device (default: the desktop version, so no "SDK out of date" banner).raw(plugin, method, body)sends any message as is, to test what a real SDK would not send.- Timeline types
navigation,userAction,lifecyclehave their own icon; uselevel = nullfor them.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

