@taptap/maker 0.0.1-beta.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/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@taptap/maker",
3
+ "version": "0.0.1-beta.1",
4
+ "type": "module",
5
+ "description": "TapTap Maker local development CLI and MCP server",
6
+ "main": "dist/maker.js",
7
+ "bin": {
8
+ "taptap-maker": "bin/taptap-maker"
9
+ },
10
+ "exports": {
11
+ ".": "./dist/maker.js",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "files": [
15
+ "bin/taptap-maker",
16
+ "dist/maker.js",
17
+ "skills/taptap-maker-local/",
18
+ "skills/taptap-maker-dev-kit-guide/",
19
+ "skills/update-taptap-mcp/",
20
+ "README.md"
21
+ ],
22
+ "keywords": [
23
+ "taptap",
24
+ "maker",
25
+ "mcp",
26
+ "cli",
27
+ "game-development"
28
+ ],
29
+ "author": "TapTap Team",
30
+ "license": "MIT",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.14.1"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/taptap/instant-games-open-mcp.git",
40
+ "directory": "packages/maker"
41
+ },
42
+ "homepage": "https://github.com/taptap/instant-games-open-mcp/tree/main/packages/maker#readme",
43
+ "bugs": {
44
+ "url": "https://github.com/taptap/instant-games-open-mcp/issues"
45
+ }
46
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: taptap-maker-dev-kit-guide
3
+ description: Explain the local TapTap Maker AI dev kit installed during Maker project clone. Use after a Maker project is cloned or bound, or when the user asks what CLAUDE.md, examples, templates, or urhox-libs are for.
4
+ ---
5
+
6
+ # TapTap Maker AI Dev Kit
7
+
8
+ Use this skill to orient the local AI/Agent after `taptap-maker init` installs the AI dev kit into a
9
+ Maker project directory.
10
+
11
+ ## What To Tell The Local Agent
12
+
13
+ After the Maker project is cloned, point the local AI/Agent at these local resources:
14
+
15
+ - `CLAUDE.md`: the main AI development guide entry. Read this first before changing Maker game code.
16
+ - `examples/`: runnable or copyable examples for common Maker development patterns.
17
+ - `templates/`: starter templates for creating new files or common game structures.
18
+ - `urhox-libs/`: engine APIs, capabilities, and local reference material for Maker runtime features.
19
+
20
+ Keep the explanation short. The goal is to help the local AI discover the installed development
21
+ resources, not to duplicate their contents in chat.
22
+
23
+ ## Usage Guidance
24
+
25
+ When a user asks to develop or modify a Maker project after clone:
26
+
27
+ 1. Check whether the current directory contains the dev-kit entries above.
28
+ 2. Tell the local AI/Agent that `CLAUDE.md` is the first document to read.
29
+ 3. Use `examples/` when the user asks for implementation patterns.
30
+ 4. Use `templates/` when creating new game files or scaffolding.
31
+ 5. Use `urhox-libs/` when engine API behavior or capability names are needed.
32
+
33
+ If these entries are missing in a bound Maker project, read `maker://status` or call
34
+ `maker_status_lite` with the actual project directory as `target_dir` to confirm state, then run
35
+ `taptap-maker dev-kit update` in that project directory to restore missing local dev-kit entries.
36
+ If status includes `Maker remote sync`, follow that section before editing: pull first only when the
37
+ workspace is clean, otherwise let the local AI help the user submit, stash, or cancel before pulling.
38
+
39
+ These files are local development aids. Do not submit them to Maker Git unless the user explicitly
40
+ asks and understands they are local environment files.
41
+
42
+ ## Testing And Result Check
43
+
44
+ Keep validation simple for Maker users. 用户可以直接说“提交”或“构建”:
45
+
46
+ - If the user says “提交”, “推送”, “构建”, “预览”, or “跑一下”, use
47
+ `maker_build_current_directory`. The tool commits when needed, pushes to Maker remote, and then
48
+ runs the remote build.
49
+ - If push fails, do not start a separate build or generic Git push. Explain the returned recovery
50
+ details, follow the returned classification-specific recovery (`remote_rejected`,
51
+ `branch_not_allowed`, `forbidden_path`, or `auth`), then retry `maker_build_current_directory`.
52
+ - After submit or build finishes, tell the user to open the TapMaker 网页端查看结果.
53
+
54
+ Do not create local-only test scripts just to verify Maker changes. The expected validation path is
55
+ chat request -> Maker MCP submit/build tool -> TapMaker web result check.
@@ -0,0 +1,485 @@
1
+ ---
2
+ name: taptap-maker-local
3
+ description: Guide TapTap Maker local development workflows. Use when a user asks to initialize Maker local development, clone/download a Maker project, continue a Maker project, inspect local Maker status, pull, submit, push, or resolve Git conflicts.
4
+ ---
5
+
6
+ # TapTap Maker Local Workflow
7
+
8
+ Use this skill as the workflow layer for Maker local development. The Maker CLI owns one-time
9
+ initialization; MCP tools own the high-frequency development loop. This skill decides the sequence,
10
+ asks the user for choices, and explains local state in plain language.
11
+
12
+ ## Scope
13
+
14
+ This skill covers:
15
+
16
+ - initialize local Maker development
17
+ - run the Maker CLI initialization flow
18
+ - prepare local AI dev kit before project binding
19
+ - clone a Maker project
20
+ - choose a Maker app from the CLI app list
21
+ - explain PAT, Git, project binding, and editor reloads
22
+ - inspect local changes
23
+ - pull remote changes
24
+ - submit local changes
25
+ - push local commits
26
+ - explain and resolve conflicts with user approval
27
+
28
+ Build, submit, push, preview, and verify behavior belongs to the single Maker MCP build tool. The
29
+ post-build runtime log polling loop belongs to the local Maker CLI watcher.
30
+
31
+ ## Responsibilities
32
+
33
+ Keep this split clear:
34
+
35
+ - Skill: user intent, step order, whether to ask the user, friendly explanations, failure recovery.
36
+ - CLI: save PAT, fetch app list, prepare dev kit, clone, install MCP config, verify local setup,
37
+ and run the local runtime log watcher.
38
+ - MCP tools/resources: inspect Maker status, run the combined commit/push/build path, and support
39
+ one-shot runtime log pulls.
40
+
41
+ Do not reimplement Maker API calls or Git authentication in shell when the Maker CLI or MCP tool
42
+ exists.
43
+
44
+ ## Main Intent Table
45
+
46
+ | User intent | Required workflow |
47
+ | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
48
+ | initialize / configure / continue Maker local development | Run the Maker CLI initialization workflow. |
49
+ | clone / download Maker project locally | Follow "Initialization Workflow"; do not ask for app_id directly. |
50
+ | status / is Maker ready | Read `maker://status`, call `maker_status_lite` if resources are unavailable, then follow `Maker remote sync` if present. |
51
+ | submit / commit / push to Maker | Inspect local Git state, summarize changed files, then call `maker_build_current_directory` unless blocked. |
52
+ | pull / update from remote | Inspect local changes first; if dirty, explain options before pulling. |
53
+ | conflict / merge failed | Explain why the conflict happened, list conflict files, inspect conflict hunks, propose a resolution plan, and ask before editing. |
54
+ | build / preview / run / verify | Use `maker_build_current_directory`; it starts the local runtime log watcher after a successful remote build result. |
55
+
56
+ ## Project Detection
57
+
58
+ A directory is a Maker project when the user's current project directory or one of its parents contains:
59
+
60
+ ```text
61
+ .maker-mcp/config.json
62
+ ```
63
+
64
+ When this file exists, explain that the directory is already bound to a Maker project.
65
+
66
+ When this file is missing and the user asks to clone, initialize, or continue Maker local
67
+ development, do not ask the user for an app_id directly. Follow the initialization workflow.
68
+
69
+ The user's current project directory is the business target. Do not ask the user to choose a
70
+ directory and do not scan unrelated Maker projects. If the MCP process cwd is a transient
71
+ dialogue/session directory, pass the user's current project directory as `target_dir`. If the AI
72
+ client does not expose that directory, say the current client did not provide the project directory
73
+ instead of guessing.
74
+
75
+ ### Attached Workspace Selection
76
+
77
+ Some AI clients start MCP from a dialogue/session directory and expose the real project as an
78
+ attached workspace. For Maker status, clone, submit, and build, compare:
79
+
80
+ - the AI dialogue current directory, often containing `dialogues`
81
+ - the attached workspace directories shown by the client
82
+
83
+ If there is a single attached workspace, use that single attached workspace as `target_dir` when
84
+ calling Maker tools. If there are multiple attached workspaces, show the paths and ask the user
85
+ which one is the Maker project directory. Do not treat the dialogue/session directory as the Maker
86
+ project directory, and do not ask the user to clone an app into that directory.
87
+
88
+ If status output returns `AI client workspace selection`, follow that hint: choose an attached
89
+ workspace first, then read `maker://status` or call `maker_status_lite` with the attached project
90
+ directory.
91
+
92
+ ## Initialization Workflow
93
+
94
+ Trigger phrases include:
95
+
96
+ - 我要开发 Maker 游戏
97
+ - 本地 Maker 开发
98
+ - 拉取 Maker 游戏到本地
99
+ - clone Maker 项目
100
+ - 下载 Maker 项目代码
101
+ - 初始化 Maker 项目
102
+ - 初始化 Maker 开发目录
103
+ - 配置 Maker 本地开发
104
+ - 打开/继续开发 Maker 项目
105
+
106
+ Workflow:
107
+
108
+ 1. Run `taptap-maker doctor` for the user's intended Maker directory, or read `maker://status` when
109
+ the MCP server is already available.
110
+ 2. If the status reports the current directory is already bound to a Maker project, stop the
111
+ initialization/clone path. Continue with the user's current intent in that bound project. Do not
112
+ ask which app to clone unless the user explicitly asks to switch or re-clone.
113
+ 3. If Git is missing, stop. Tell the user Git is required for clone/submit/build-side Git work.
114
+ 4. Run `taptap-maker init` in the user's intended Maker directory. The CLI will request PAT if
115
+ missing, fetch TapTap token, show a paged app preview, ask the user to choose, prepare the AI dev
116
+ kit, clone the Maker project, and install/verify MCP config.
117
+ Tell the user that the first Maker clone can take 20+ seconds because the server may be
118
+ preparing the repository, and that they should keep the command running while the CLI retries
119
+ transient 503/5xx failures.
120
+ 5. If the CLI reports ordinary local files or parent Git repository risk, explain the warning and
121
+ ask whether the user wants to continue in this directory or switch to a clean independent one.
122
+ 6. After clone succeeds, run `taptap-maker doctor` again or explain that `.maker-mcp/config.json`
123
+ now binds the directory to the Maker project.
124
+ 7. Tell the local AI/Agent to use the `taptap-maker-dev-kit-guide` skill for the installed dev-kit
125
+ resources, especially `CLAUDE.md`, `examples/`, `templates/`, and `urhox-libs/`.
126
+
127
+ Keep the user-facing explanation short:
128
+
129
+ ```text
130
+ 我会先用 Maker CLI 检查本机 Git、PAT 和当前目录是否已绑定 Maker 项目。
131
+ 如果还没有 PAT,CLI 会让你去页面创建一个;拿到项目列表后你选游戏,我再拉代码。
132
+ ```
133
+
134
+ ## AI Dev Kit Preparation
135
+
136
+ `taptap-maker init` prepares local development environment files in the current working directory
137
+ before it checks out the Maker project.
138
+
139
+ `taptap-maker doctor` and `maker://status` check the dev-kit top-level entries for an already bound
140
+ Maker project. If `CLAUDE.md`, `examples/`, `templates/`, or `urhox-libs/` are missing, run
141
+ `taptap-maker dev-kit update` to restore the dev kit without overwriting existing local files and
142
+ refresh the managed `.gitignore` block.
143
+
144
+ The CLI downloads and installs (selected automatically by `TAPTAP_MCP_ENV`):
145
+
146
+ ```text
147
+ # production (default)
148
+ https://urhox-demo-platform.spark.xd.com/ai-dev-kit/pd/stable/ai-dev-kit.zip
149
+
150
+ # rnd
151
+ https://urhox-demo-platform.spark.xd.com/ai-dev-kit/rnd/latest/ai-dev-kit.zip
152
+ ```
153
+
154
+ After clone, use the bundled `taptap-maker-dev-kit-guide` skill to explain the installed dev-kit
155
+ resources to the local AI/Agent:
156
+
157
+ - `CLAUDE.md` is the AI development guide entry.
158
+ - `examples/` contains Maker development examples.
159
+ - `templates/` contains reusable templates.
160
+ - `urhox-libs/` contains engine APIs and capability references.
161
+
162
+ The CLI is responsible for deterministic file operations:
163
+
164
+ - extract the ZIP into the current directory
165
+ - skip the ZIP top-level `scripts` directory because it conflicts with Maker project code
166
+ - delete the downloaded `ai-dev-kit.zip` after extraction
167
+ - write a temporary `.gitignore.dev-kit-before-clone` block for installed dev-kit entries
168
+ - after Maker clone succeeds, merge that block into the checked-out `.gitignore`
169
+ - keep the dev-kit files local-only so they are not submitted to Maker Git
170
+
171
+ Do not hand-write a custom download/unzip script while this CLI command is available.
172
+
173
+ If clone fails because dev-kit network access is unavailable, explain that the Maker project can
174
+ still be cloned, but local AI development docs/API/demo support may be incomplete. Ask whether
175
+ the user wants to retry or continue without the dev kit.
176
+
177
+ If clone or fetch fails with Maker Git output, inspect the returned error fields instead of asking
178
+ the user to delete local files immediately. Treat `retryable: yes`, `classification:
179
+ remote_transient`, or retry reasons such as `remote_http_5xx`, `network_or_timeout`, and
180
+ `connection_interrupted` as temporary service/network failures. For first clone, explain that 503
181
+ often means the Maker server is still preparing the repository and can take more than 20 seconds.
182
+ The CLI already retried these automatically; if it still fails, tell the user they can retry
183
+ `taptap-maker init` later or switch to a cleaner independent directory after repeated failures. Do
184
+ not retry for auth, permission, repository-not-found, remote-rejected, local file conflict, or local
185
+ permission errors until the reported cause is fixed.
186
+
187
+ ## PAT Handling
188
+
189
+ If the user pastes a token-like string while the initialization flow is waiting for PAT, let the
190
+ running `taptap-maker init` prompt consume it, or run `taptap-maker pat set` and paste the PAT into
191
+ the prompt. Do not put PAT directly in argv unless the user explicitly accepts the ps/shell-history
192
+ exposure. Do not just say "received". If the directory is already bound, treat `taptap-maker apps`
193
+ output as account reference only and continue the user's current bound-project task.
194
+
195
+ If PAT exchange fails:
196
+
197
+ 1. Show the PAT page URL for the current environment:
198
+ production `https://maker.taptap.cn/pat-tokens`, RND `https://fuping.agnt.xd.com/pat-tokens`.
199
+ 2. Ask the user to create a new Maker PAT on that page.
200
+ 3. Run `taptap-maker pat set` and paste the PAT into the prompt.
201
+
202
+ ## App Selection
203
+
204
+ Use app selection only when the current directory is unbound and the user is initializing or cloning
205
+ a Maker project, or when the user explicitly asks to switch or re-clone.
206
+
207
+ If the current directory is already bound, app lists from `taptap-maker apps` are reference only.
208
+ Continue operating on the current bound project. When the user explicitly requests a different
209
+ project, start the project selection flow for that request.
210
+
211
+ When app selection is needed, show the returned app preview and total count, then ask the user to
212
+ choose by index, app id, or name. The default preview shows the 40 most recently active apps.
213
+ If the target is not visible, ask the user to type `all` inside `taptap-maker init` to expand the
214
+ full list, or run `taptap-maker apps --all` for a one-shot human-readable dump; use
215
+ `taptap-maker apps --json` only when AI / scripts need the machine-readable list. If the
216
+ chat/client width is enough, you may present the preview as a compact two-column layout;
217
+ otherwise keep a single column. Keep app_id visible in every app row, and include the preview
218
+ details instead of only a summary such as "40 apps are available".
219
+
220
+ Selection confirmation:
221
+
222
+ - Ask the user to choose by index, app id, or name.
223
+ - Treat the user's explicit reply as the selected app.
224
+ - If there is only one app, still ask for confirmation before selecting it.
225
+
226
+ After the user chooses, route the next action to `taptap-maker init` so the Maker initialization
227
+ workflow can continue with the selected app. For non-interactive CLI runs, pass the selected app id
228
+ through the supported CLI option.
229
+
230
+ ## Working Directory Compliance Check
231
+
232
+ Before every clone attempt, run `taptap-maker doctor` for the user's intended Maker development
233
+ directory. Use that result as the source of truth for Git availability, existing Maker binding,
234
+ outer Git repository detection, and AI dev-kit status.
235
+
236
+ ### Directory Suitability Decision
237
+
238
+ After `taptap-maker doctor`, decide whether the directory is suitable for clone:
239
+
240
+ - If the directory is already bound to a Maker project, do not clone again unless the user
241
+ explicitly asks to switch or re-clone.
242
+ - If Git is missing, stop and tell the user to install Git first.
243
+ - If `Maker Git directory` reports `inside_parent_git_repo` or `target_is_git_root: no` with an
244
+ outer `git_root`, explain that the directory is under another Git repository. Recommend a
245
+ completely independent directory, such as `~/MakerProjects/<game-name>`.
246
+ - If the directory is unbound and only contains ignored local config folders, continue after the
247
+ user chooses an app.
248
+ - If the directory contains ordinary user files or folders, explain that Maker clone keeps local
249
+ files but may stop on path conflicts. Ask whether to continue here or switch to a clean directory.
250
+
251
+ Before clone, inspect only the current directory top level.
252
+ The goal is to avoid surprising overwrites, not to deeply audit game code.
253
+
254
+ Acceptable local config entries include:
255
+
256
+ - `.claude`
257
+ - `.mcp`
258
+ - `.skill`
259
+ - `.config`
260
+ - `.ini`
261
+ - `.cursor`
262
+ - `.codex`
263
+
264
+ If the directory contains ordinary user files or folders, explain that Maker initialization will
265
+ keep local files, but clone can fail if a local path conflicts with the Maker project. Ask whether
266
+ to continue in this directory or switch to a clean directory.
267
+
268
+ If the current directory is inside a larger Git repository but is not itself a Git root, warn the
269
+ user before clone:
270
+
271
+ - The outer repository may be an existing user project.
272
+ - A Maker project can live under that directory only if the Maker directory gets its own `.git`.
273
+ - Recommend a completely independent directory, such as `~/MakerProjects/<game-name>`, for safer
274
+ local development.
275
+ - If the user explicitly continues, continue `taptap-maker init`; the CLI must initialize an
276
+ independent Maker Git repository in the target directory and must not modify the outer repository
277
+ remote.
278
+
279
+ Do not delete, move, or overwrite user files during this check.
280
+
281
+ ## Clone Directory Safety
282
+
283
+ Before clone, the Maker CLI checks local files and reports conflicts. The AI dev kit may create
284
+ local-only files before clone, so explain this in non-technical terms:
285
+
286
+ - existing local config folders such as `.claude`, `.mcp`, `.skill`, `.config`, `.ini` are kept
287
+ - normal local files are kept unless they conflict with files from the Maker project
288
+ - if conflicts are reported, tell the user exactly which files block clone and ask whether to move,
289
+ rename, or choose another directory
290
+
291
+ Do not delete or overwrite user files to make clone work unless the user explicitly asks.
292
+
293
+ If `taptap-maker init` fails and returns `partial_state`, explain the state in plain language:
294
+
295
+ - `project_bound: no` usually means clone did not finish; retrying clone is allowed.
296
+ - `git_initialized: yes` with `project_bound: no` means the directory may contain a partial local
297
+ Git setup; retry once, and if it fails again recommend a fresh independent directory.
298
+ - `ai_dev_kit_present: yes` means local AI docs/examples may already be present even though Maker
299
+ project checkout failed.
300
+ - `project_bound: yes` means the directory already has Maker binding; run `taptap-maker doctor` before
301
+ attempting anything else.
302
+
303
+ Do not delete partial files automatically. For novice users, prefer recommending a new independent
304
+ directory over manual cleanup.
305
+
306
+ ### `.gitignore` Merge During Clone
307
+
308
+ The Maker CLI stages the dev-kit managed ignore block in
309
+ `.gitignore.dev-kit-before-clone` instead of writing `.gitignore` before checkout. After Maker
310
+ clone succeeds, the CLI merges that managed block into the checked-out `.gitignore` and
311
+ removes the temporary file.
312
+
313
+ If clone still reports conflicts for files other than `.gitignore.dev-kit-before-clone`, do not
314
+ auto-merge them. Show the conflict list and ask the user whether to move the local files, choose
315
+ another directory, or let the local AI inspect and resolve the conflict.
316
+
317
+ Explain to the user that this `.gitignore` merge prevents local dev-kit files from being
318
+ submitted to Maker Git.
319
+
320
+ ## Bundled Skills
321
+
322
+ When `taptap-maker doctor`, `maker://status`, or `maker_status_lite` reports TapTap bundled workflow
323
+ skills, show the skill names and document paths. Do not install or register skills automatically.
324
+
325
+ `taptap-maker-local` covers Maker local workflow. `taptap-maker-dev-kit-guide` explains the local
326
+ AI dev-kit resources installed during clone. `update-taptap-mcp` covers local TapTap MCP cache
327
+ updates.
328
+
329
+ Prefer user/global scope for Maker MCP installation. If a project/local config already exists,
330
+ do not block the workflow; just explain that user/global scope is recommended to avoid config
331
+ being tied to a specific project folder.
332
+
333
+ ## Remote Sync Status
334
+
335
+ For a bound Maker project, `maker://status` and `maker_status_lite` include `Maker remote sync`.
336
+ Read this section before the user starts editing in a fresh conversation:
337
+
338
+ - For frequent polling or quick local-only status checks, call `maker_status_lite` with
339
+ `skip_remote_sync: true` to avoid a `git fetch origin` network round trip on every status read.
340
+ - `up_to_date`: continue development.
341
+ - `needs_pull` with `local_changes: no`: tell the user the workspace is clean and the local AI can
342
+ run `git pull --ff-only origin main` before editing.
343
+ - `needs_pull` with `local_changes: yes`: do not pull immediately. Explain that remote changes exist
344
+ and local edits are present; ask the local AI to inspect `git status` and help the user choose
345
+ submit current changes, stash then pull and restore, or cancel.
346
+ - `diverged`: do not push or blindly pull. Ask the local AI to plan a rebase or merge of current
347
+ Maker remote changes.
348
+ - `branch_not_allowed`: Maker only accepts `main`; switch/migrate local commits to `main` before
349
+ build or submit.
350
+ - `remote_unavailable`: follow the failure classification and retry later only for temporary
351
+ 5xx/network/timeout failures.
352
+
353
+ ## Local Change Review
354
+
355
+ Before submitting, run local Git inspection when available:
356
+
357
+ ```bash
358
+ git status --short --branch
359
+ git diff --stat
360
+ ```
361
+
362
+ If the change set is small, inspect relevant diffs before summarizing. Do not paste large diffs
363
+ unless the user asks. Summaries should be understandable to non-programmers:
364
+
365
+ - what changed
366
+ - why these files are being submitted
367
+ - whether any generated or suspicious files are included
368
+
369
+ If there are no local changes, do not create an empty commit unless the user explicitly asks.
370
+
371
+ ## Submit And Push
372
+
373
+ For Maker projects, user words like "提交", "提交代码", "推送", "push", or "提交到 Maker"
374
+ mean:
375
+
376
+ ```text
377
+ commit + push + Maker build
378
+ ```
379
+
380
+ Use `maker_build_current_directory` for this path. Do not use generic Git task-id,
381
+ branch-creation, or PR rules inside Maker project repositories.
382
+
383
+ If `maker_build_current_directory` returns a build failure after a successful push, report both:
384
+
385
+ - submit/push succeeded
386
+ - build failed, with the concrete build error
387
+
388
+ If `maker_build_current_directory` returns a successful remote build, check
389
+ `runtime_logs.watch_started`. The MCP starts the local watcher as a detached CLI process. The
390
+ standard command is:
391
+
392
+ ```bash
393
+ taptap-maker logs watch --target-dir <PROJECT_ROOT> --reset --interval 5s
394
+ ```
395
+
396
+ This CLI flow clears old local runtime logs before polling, then appends server-shaped rows to
397
+ `.maker/logs/runtime/runtime.log`. Do not start a second watcher unless the first one failed to
398
+ start. For gameplay/runtime diagnostics after a successful build, read
399
+ `runtime_logs.local_file`. To check whether the watcher is alive or failing, read
400
+ `runtime_logs.state_file`.
401
+
402
+ Watcher protection rules:
403
+
404
+ - The watcher owns `.maker/logs/runtime/watcher.pid`; a new watcher replaces the old watcher for
405
+ the same project before writing logs.
406
+ - Temporary poll failures are retried by default. Treat `logs_poll_error` as diagnostic output,
407
+ not as a final failure, unless the watcher exits.
408
+ - If server cursor metadata lags behind returned log timestamps, the local cursor is advanced past
409
+ the newest written log. Local log writing appends server-returned rows as-is.
410
+ - `.maker/logs/runtime/state.json` records heartbeat fields including `lastPollAt`,
411
+ `lastSuccessAt`, `lastWrittenLogs`, `consecutiveFailures`, and `lastError`.
412
+
413
+ If submit created a local commit but push failed because the Maker remote was temporarily
414
+ unavailable, do not run a manual generic `git push`. Fix the reported cause if needed, then retry
415
+ `maker_build_current_directory`. Maker MCP will detect committed-but-unpushed local commits and push
416
+ them before build.
417
+
418
+ For push failures, use the returned `classification`, `retryable`, `retry_reason`, and
419
+ `retry_attempts` fields. Temporary 5xx/network/timeout failures may be retried with the Maker build
420
+ tool; `remote_rejected` means remote updates require pull/rebase first; `auth` means refreshing PAT;
421
+ `branch_not_allowed` means Maker remote only accepts `main`; `forbidden_path` means the remote
422
+ pre-receive hook rejected one or more paths/directories and the forbidden pattern from stderr must
423
+ be removed from the unpushed commit before retrying.
424
+
425
+ When a Maker tool output contains `push_recovery`, follow it exactly:
426
+
427
+ - Tell the user the local commit is preserved but not yet on Maker remote.
428
+ - Do not ask for permission to run a generic `git push`.
429
+ - Retry with `maker_build_current_directory` for submit and build requests.
430
+ - If the failure is `remote_rejected`, ask before pull/rebase; do not create a new branch or PR.
431
+ - If the failure is `branch_not_allowed`, do not pull/rebase. Tell the user Maker only accepts
432
+ `main`, switch back to `main`, cherry-pick the preserved local commit there, then retry.
433
+ - If the failure is `forbidden_path`, do not refresh PAT. Read the forbidden pattern in stderr,
434
+ remove those paths from the unpushed commit while keeping local files, then retry after
435
+ `git status` is clean for them.
436
+
437
+ ## Pull And Conflict Handling
438
+
439
+ Before pulling:
440
+
441
+ 1. Run `git status --short --branch`.
442
+ 2. If the workspace is dirty, explain that pulling can mix remote changes with local edits.
443
+ 3. Offer safe options:
444
+ - submit current local changes first
445
+ - stash local changes, pull, then restore
446
+ - cancel and let the user review local files
447
+
448
+ If conflicts occur:
449
+
450
+ 1. Run `git status --short`.
451
+ 2. Identify conflicted files (`UU`, `AA`, `DU`, `UD`, or unmerged paths).
452
+ 3. Show the user the conflict files and explain why the conflict happened.
453
+ 4. Inspect conflict markers in each file.
454
+ 5. Explain the competing versions in plain language.
455
+ 6. Propose a resolution strategy.
456
+ 7. Ask for confirmation before editing files.
457
+
458
+ When showing conflict content, keep excerpts small and focused around conflict markers:
459
+
460
+ ```text
461
+ <<<<<<<
462
+ local version
463
+ =======
464
+ remote version
465
+ >>>>>>>
466
+ ```
467
+
468
+ Do not hide unresolved conflicts. After editing, run:
469
+
470
+ ```bash
471
+ git status --short
472
+ ```
473
+
474
+ Only submit after conflicts are fully resolved.
475
+
476
+ ## User Communication
477
+
478
+ Maker users may not understand Git terminology. Prefer concrete wording:
479
+
480
+ - "本地改动" instead of "working tree"
481
+ - "提交到 Maker" instead of "commit and push"
482
+ - "远端版本" instead of "origin/main"
483
+ - "冲突文件" instead of "unmerged paths"
484
+
485
+ Always explain the next irreversible step before taking it.