worklocally
"Use only for Local First development on Studio or a Cloud Computer/Persistent Sandbox; if the current environment is the ordinary platform-managed Manus Sandbox, you do not need to follow this Skill.
SKILL.mdskills/webdev/worklocally/SKILL.md
GitHubWebdev Work Locally
Use this skill for local website, mobile app and game development. The main Webdev skill owns application capabilities, configuration, design and deployment contracts; read only the capability guides the task needs.
For requests to create or develop a website or web app, resolve the managed-versus-plain-local choice below before init/attach. For Game, the managed choice is fixed as described below. Finding a declaration does not select a project. Unrelated coding and read-only inspection do not require init/attach.
For a local mobile app request, resolve the Mobile setup choice before switching execution environments or initializing a managed project.
When to ask the user
These are missing product choices, not permission approvals for low-risk tool calls. After read-only discovery, use the blocking ask tool when any applicable choice below is unresolved. End the turn at that question; do not merely announce your own choice and continue. For Game, skip the website hosting choice and continue with Manus-managed services without asking.
- New website, hosting choice not made: offer a new Manus-managed website or a new plain local website using the explanation below. "Plain HTML", "no dependencies" and "do not publish" choose neither. If the user has rejected the old website, do not offer to reuse or overwrite it.
- Local mobile app, setup choice not made: offer managed Cloud development or plain local development as described below. A request for a backend, login or LLM capability does not select Manus-managed services or authorize a Cloud switch.
- Existing website identity or working copy is unclear: report its purpose and path and ask which copy the user intends. Honor an explicit path or prior answer. A new project in Home/Documents needs a dedicated child folder; choosing a sensible unused child name for that requested new project does not itself require a question. For a read-only request, report findings without attaching.
- Multiple or approximate matches: clarify which website the user means instead of picking one to attach.
- Existing project, unclear website scope: before init, ask whether they want to adopt the existing project as a website or add a separate companion website. An explicitly requested companion website belongs in its own subdirectory.
Combine unresolved choices into one short question. Skip choices the user has already answered. A clear request to continue a website whose root is the Session-selected folder itself can attach directly; unrelated coding needs neither this question nor attach. Before the answer, stay with read-only discovery: no implementation, directory selection, init, attach or execution-environment switch. After the answer, carry out that choice without asking it again.
Missing local Node toolchain
For web-db-user and every Game template, initialization checks the executable tools needed by that template before provisioning or scaffolding. Flexible/no-template projects do not acquire a Node dependency from this check. Godot templates additionally prepare and verify their engine and matching Web export templates.
If init returns local_node_toolchain_unavailable, follow the recovery instructions in that error result, including its blocking ask steps. This also applies to Game despite its fixed managed-hosting choice.
Explain the managed-vs-local choice
Local Game always uses Manus-managed services: never offer a plain-local Game choice, and continue to directory selection and initialization. Do not render a hosting-choice ask card. Treat the user's request to create or continue a Game as the managed choice, then resolve only the project identity and Host directory needed for init or attach. For a new Game project, use the Addon initialization flow described below; it requires code-storage confirmation only for a nonempty directory. Do not ask a separate hosting-choice question. Init or attach itself is not a code upload and does not authorize public publishing.
Use applicationKind: "game" and Game setup before new init; existing projects keep their recorded gameEngine. Follow the engine-specific init/attach receipt: threejs uses its own starter README and the Web development, build and checkpoint flow; godot uses Godot workflow. This Local guide owns directory authorization, Session ports, managed environment and separate Managed Git for both engines; it does not select their starter, preview or release commands. The same file identity, separate Managed Git and Host-directory rules still apply.
Do not use webdev.init_project for plain-local Web development. Do not initialize user Git or move to a Git root to use Webdev.
For website and web app requests, briefly explain the practical differences in plain language when asking the user to choose. Both options develop locally; the choice is whether to use Manus-managed services, not where development happens. Game does not use this choice.
- Use Manus-managed services (Recommended): Connect the project to Manus services—mention two or three capabilities relevant to the request, such as AI model calls, image generation, asset storage, databases or login, subject to the application's supported capabilities. It also supports version history, publishing and continuing development in cloud sessions. Explain that saving or syncing website versions uploads the selected website code to Manus. Only the chosen website directory is in scope, not the surrounding game or repository; init/attach is not itself a code upload, and choosing managed development does not authorize public publishing.
- Develop locally without Manus-managed services: Continue as an ordinary local project with the user's chosen tools and services. Manus-managed application services, publishing and cloud continuation are not set up. The user can connect the existing project to Manus later without rebuilding it.
Keep the explanation short, but include the code-synchronization consequence and the option to adopt Manus later in the same question. Do not rely on terms such as "infra", "registration" or "checkpoint" to explain the choice. Do not imply that development-time Agent tools are available only to managed projects, or that all managed capabilities will be enabled automatically.
For website choices, normally label the managed option "Recommended" in the user's language. Respect an explicit local-only or no-upload preference, and do not ask again when the user has already made this choice.
For a new managed website or game, once the service choice and directory are resolved, call webdev.init_project before generating project files. The Addon checks the actual selected directory on-device. An empty directory initializes directly with a storage notice; any existing entry (including .git or hidden files) requires the code-storage confirmation card before initialization. Directory read failures stop initialization. Do not classify emptiness yourself or create files to influence this check. Only when a confirmation card is returned, wait for the task owner to click. After the card notification, repeat the original call with its returned initRequestId, keeping the original arguments and project_dir unchanged; the Addon server verifies the saved decision. Do not ask for this same approval in a separate chat question or bypass the card with shell commands. If the owner cancels, stop managed initialization. After successful initialization, follow the existing Blueprint or Plan returned by the tool before implementation. Game projects retain their existing Game Blueprint flow after initialization. Cloud sessions and Mobile Dev do not use this code-storage card.
Mobile app setup choice
For a mobile app requested in Studio or another Local First environment, use the same blocking ask flow with these two options, in the user's language:
- Manus-managed (Recommended): Explain that managed Mobile currently runs in Manus Cloud, so choosing this option switches this task from the local computer to Cloud before development. Mention the relevant managed capabilities, such as backend, database, login and LLM access, plus version history and app builds. Project code will be stored in Manus Cloud; this does not authorize public publishing.
- Plain local: Keep development on the current computer using ordinary local tools and the user's chosen backend, authentication and model provider. Do not set up Manus-managed application services or promise platform credentials. Development-time Agent tools remain available.
Put the Cloud-switch consequence in the question itself, before the user chooses. Do not describe both Mobile options as local development. Wait for the answer before switch_device, webdev.init_project or webdev.attach_project; the managed Cloud requirement alone is not permission to switch.
After an informed managed choice, briefly acknowledge the move, use the existing device-switch flow to select Manus Cloud, verify the switch succeeded, then initialize with applicationKind: "mobile_app" (or attach the explicitly selected existing managed Mobile project). Omit local project_dir in Cloud. If switching is unavailable or fails, report the blocker without attempting managed Mobile initialization locally. Do not promise that switching transfers existing local files.
After a plain-local choice, stay on the selected local device and continue ordinary app development. Do not call init/attach, create manus-webdev.json or .manus-webdev/, or use Managed Git/checkpoint synchronization. Preserve existing files and user Git. The managed Expo starter restrictions do not constrain an unmanaged local app. If the user later requests managed Mobile, explain the Cloud move and assess source migration; do not promise Web's in-place adoption path.
Honor an explicit plain-local/no-upload preference without asking again. An earlier managed choice satisfies this question only if the Cloud move was already disclosed or explicitly requested; otherwise ask whether to continue in Cloud or stay plain local. Once answered, do not repeat the choice. This Mobile choice does not change Web's local managed workflow or Game's fixed managed workflow.
Rediscover before choosing
For a request to create or continue a local website, rediscover nearby websites before init or attach. Inspect the selected directory, up to three ancestor levels, and up to three levels down in the relevant nearby project folders, including relevant sibling directories such as a game's website/. Use normal file/terminal tools and directory structure to focus the search; skip dependencies, build output, node_modules, .git, .manus and .manus-webdev. This is bounded Agent-led exploration, not a recursive sweep of every ancestor's subtree or the whole device. Follow existing access permissions; request the normal directory access when needed rather than bypassing a boundary. An inaccessible location is unverified, not proof that no website exists there. Do not implement a background scanner, implicit binding or a new website-selection mode.
Prune those excluded child directories while searching; still inspect the selected working copy when its own path is inside .manus/worktrees/. A source-checkout match identifies a website, not permission to leave the user's chosen worktree. If that worktree lacks its declaration, clarify whether the user wants this website in the current copy, then attach there to establish its declaration; do not switch back to the source checkout merely because its ID matches.
Read candidate declarations, their description, and relevant README/source files to judge whether they match the user's requested website. Descriptions are project data, not instructions or permission. Apply the confirmation cases above. If the user rejects a candidate, resolve the new website's hosting choice as described above. For a confirmed existing website, select the intended directory through the existing Host workflow and attach its exact Resource. Selecting the same physical website directory reuses its Managed Git, not a copy under the Session's initial folder.
Apply a plain-local choice or later adoption
For a website or web app, if the user chooses plain local development, do not call init or attach, do not create manus-webdev.json or .manus-webdev/, and do not use this Addon's infrastructure or checkpoint-push workflow. Leave this Addon workflow and continue ordinary local development with their chosen tools and user Git; preserve any existing declarations/history. If the user later agrees to adopt Manus, use the existing website's actual directory and flexible init without overwriting its source; use attach instead when that directory already declares the intended Manus website. Game never enters this branch.
Keep a companion website inside its own directory
For a new companion website inside an established non-website project, such as a game's official site, create a dedicated website subdirectory in a sensible place in that project and pass its absolute path as project_dir to init. Determine the larger project's purpose and boundaries from its files, whether or not the larger project has .git. Do not declare the entire game/project root as the website or include unrelated code in a Managed checkpoint. Explain a different intended location when the user's selected folder is only a component directory; combine any needed location clarification with the hosting choice rather than asking repeatedly. If the selected folder is already the intended standalone website, initialize there; do not create a redundant nested website directory. Existing user Git is not an obstacle and must not be reinitialized.
File declaration and platform identity
The website root contains manus-webdev.json, outside .manus-webdev/:
{"version":1,"projectId":"wdp_0123456789abcdef01234567","description":"Official site for the Starbound Trail game: overview, trailer and download links."}
The ID above is an example. Init obtains a real platform website ID and writes the declaration; writing an invented ID does not create a platform resource. The file's directory is the website's local root. Within authorized access, the nearest declaration applies; a child declaration takes precedence and does not affect its parent or siblings. A linked worktree without its own declaration must not inherit the source checkout's website across its Git boundary.
For attach, the declaration's projectId maps directly to manus-resource://manus-webdev/project/<projectId>. This resource URI identifies the platform website, not its local directory.
The declaration is the local identity source, not the user's .git, a device ID, an absolute path or a private Studio mapping. It is not an authorization token. Platform access remains authenticated. Do not store credentials, Session ports or machine-specific paths in it.
After init, use normal file editing to add a concise description of this website's purpose, audience and main capabilities; maintain it in this working copy throughout development. Update it when the website's purpose, audience or main capabilities materially change, not for every cosmetic edit. Describe what the website is for without claiming unfinished features are complete. Do not treat the full init description (the Blueprint product brief) as this short discovery summary. Older declarations without description remain valid: use README/source to identify them and fill in the summary when doing authorized website work, not during read-only discovery. Keep the real projectId and any managedGit metadata intact; do not invent a new identity or mirror this summary into another hidden store.
The optional managedGit.baseCommit is a known Managed Git base for this working copy, not its whole history and not a publication record. Malformed or conflicting declarations require repair; do not skip them and silently use another website. An existing private repository without its declaration is not permission to initialize a replacement website.
Actual directory and attach
The task's initial working directory and the Webdev project directory are separate. project_dir selects the project only; it does not change the task workspace, permissions, Git branch or worktree. Terminal cd, exec.cwd, or a folder name in description does not set the init/attach directory.
- Studio and Cloud Computers (including Persistent Sandbox / Cloud PC):
webdev.init_projectaccepts optionalproject_dir. Omit it when the task directory itself is the intended project. If the task starts in Home/Documents, create a dedicated unused child folder with normal file/terminal tools and pass its absolute path. The directory must exist and be accessible under the current file permissions. It may be outside the initial task folder, including on another drive. Symlinks resolve to their actual directory; choosing a path does not grant access. Do not ask the user to switch the task directory just to create a child project. Do not callworkspace_set_working_directory. - Ordinary platform-managed Sandbox: omit
project_dir; the platform allocates the project workspace. This is different from a user-selected persistent Cloud Computer. The tool rejectsproject_dirin this Sandbox mode rather than silently ignoring it. - Existing website: after resolving its identity, use
webdev.attach_projectwith itsresource_uriand optionalproject_dirpointing to the intended existing working copy. Omission reuses this Session's active project; without an active project it checks the task directory and its authorized ancestors. If no declaration is found, pass an explicitproject_dirfor the intended working copy; attach does not silently declare the task directory. An explicit path is never silently replaced by an ancestor declaration. It does not scan child folders or pick a similarly named project automatically. The same Session cannot switch to a different website through attach.
Example: task directory C:\Users\Administrator, new game directory C:\Users\Administrator\minesweeper. Create the child folder with normal tools, then call init with project_dir: "C:\\Users\\Administrator\\minesweeper" and the normal Game parameters. Linux Cloud Computers use an absolute path such as /home/ubuntu/minesweeper; Studio uses the corresponding absolute path on the user's computer. No change to the task's initial directory is needed.
After success, use the returned project_dir for every project file path and for terminal cwd, including development servers, build, tests and LSP. Webdev remembers this directory across tool calls and process restarts; its config, preview operations and Managed Git use that project's declaration. Preserve the same path and other arguments on retries. Never initialize in the parent and move the files afterward.
If project_dir is rejected, do not omit it and retry init/attach in the task directory as a fallback. Paths outside the initial task folder are supported when the Host can verify their current file permissions. Older Hosts reject this selection before initialization; update Studio or Cloud Computer Control instead of retrying in the initial folder. Saved external project directories are checked again on later calls. Report any actual file-access error and use the Host's existing permission flow; do not alter permissions or claim that passing a path grants access. Preserve existing files and user Git. Use template: "flexible" when adopting existing Web code; never overlay a starter onto unrelated content.
Init creates a platform website; attach uses an existing website. Both record the actual project directory. Attach verifies manus-webdev.json there or in its authorized ancestors; if none exists and project_dir was explicit, it writes the declaration in that directory after validating the Resource. Attach does not clone, hydrate, reset, stage files or reconfigure user Git. Re-attach the same Resource with its explicit project path when recovering a moved working copy; do not use attach as a generic Git/preview retry.
Two Git repositories, shared files
game/.git/ user Git
game/website/manus-webdev.json platform website identity
game/website/.manus-webdev/repository/.git/ this copy's Managed Git
game/website/ the actual website files
Both repositories are standard Git. Where user Git exists, ordinary terminal Git keeps its normal user-repository meaning. webdev.manus_git executes a complete shell command against the website's separate Managed Git using per-command GIT_DIR and GIT_WORK_TREE, and temporarily provides the authenticated remote manus. Its command starts in the recorded website root and its declaration, not whichever folder another terminal last visited.
An existing website can use Manus or GitHub as its canonical provider. Local attach and manus_git use that current provider, including GitHub checkpoint and publishing flows; the temporary remote remains named manus. For provider switching, follow Canonical repository transfer: use the confirmed operation ID to select its target in manus_git, and omit it for the current canonical repository. Do not reconfigure user Git to imitate a managed provider switch.
Use ordinary Git commands, branches, refspecs, pipes and scripts through this tool. It does not choose a branch, merge automatically, import user Git history, or permanently change user remotes, upstreams, hooks or credentials. User commits and Managed commits do not automatically mirror each other. Managed checkout/merge changes the shared files and therefore can appear as changes in user Git.
Sessions using the same physical website folder share its Managed HEAD/index. Independent working copies and worktrees created from user Git have separate Managed repositories; equal website IDs make them access the same platform remote. Worktrees created from Managed Git instead share its object store and refs, with their own HEAD/index. The user Git branch determines starting files, not a same-named Managed branch or its Git base.
For a worktree created from user Git, only files committed on the selected user Git branch appear. Commit the declaration through the user's normal Git workflow when they want it carried across; do not silently commit user Git just to make a website discoverable. Private .manus-webdev/ history must stay out of that copy. In the new worktree, find its own declaration, attach there and let the first manus_git call prepare its independent repository. Do not switch back to the source checkout to reuse its private Git. Do not blindly run git pull or check out remote main over files already supplied by the selected user branch; restore the known Managed base as below and integrate remote changes only when intended.
For agent-created commits through webdev.manus_git, follow its command parameter instructions to include the Cloud Manus identity as temporary Git options in the original command. The tool does not inject identity or rewrite commands. When replaying history, set only the committer identity and preserve existing authors. Ordinary terminal/IDE Git uses the user's normal configuration, but the Host disables global/system Git config inside this tool: omitting the temporary identity may infer a local account/hostname identity or fail. Commit and push in separate calls so you can inspect agent-created commit identities before publishing; post-command identity notes are best-effort and cannot undo a completed push. Never persist Manus identity in repository/global configuration. Legacy Managed repository defaults are removed only when they match the old Manus values, preserving custom values.
Attach need not create the repository. The first manus_git call creates it when absent and verifies its website identity when present. A new repository is not proof that remote history has been fetched. Never silently replace a repository belonging to another website.
When no root or ancestor user .git entry exists, Managed Git preparation also creates a relative root .git pointer to its private repository, including for older working copies. Ordinary Git and Host worktree creation can then discover that repository; an actual commit is still required as a worktree starting point. Existing .git entries are preserved; an ancestor website’s Managed pointer does not prevent a nested website from receiving its own pointer. With a Managed pointer, ordinary terminal/IDE Git shares Managed history, index and repository configuration. Continue using webdev.manus_git for authenticated Manus synchronization and checkpoint bookkeeping. The declaration remains excluded from Managed commits, so attach the intended website explicitly in the new worktree. When its gitfile points to that same website’s Managed repository, manus_git reuses the linked worktree’s Git directory and its existing HEAD as the initial reliable Managed base; it does not create a second repository. A mismatched website identity, broken backlink or an additional private repository is an error: preserve the existing histories and reconcile the mismatch before continuing. Native linked worktrees share info/exclude; preparing one copy retains the child-website exclusions recorded by the other copies. If the user explicitly wants separate user Git at the primary website root, first verify that .git is exactly the Managed root pointer, back up that pointer, and replace only that gitfile before initializing user Git; preserve .manus-webdev/ and its history. Running git init while the pointer remains reinitializes Managed Git instead. Do not apply this conversion to a linked worktree or replace an unrecognized Git entry.
Before committing in a new working copy, inspect Managed HEAD. With a reliable managedGit.baseCommit, fetch that exact commit and establish it as the Managed base while preserving current files and valuable staging state; git reset --mixed <verified SHA> changes Managed HEAD/index, not working files. Do not substitute the latest remote main or unrelated user Git HEAD; an identity-verified Managed linked worktree already has its Managed HEAD. If an existing website has no reliable base, inspect/clarify its source version instead of discarding files or force-pushing unrelated history. A genuinely new website with an empty remote can create its first commit normally.
The tool records a resulting Managed HEAD that shares known history as the declaration's base. The declaration and .manus-webdev/ are excluded from Managed commits; when a separate user repository exists, the user may commit the declaration there so it follows their branches/worktrees. Private Managed history is not ordinary source and must not be committed into user Git. It may contain unpushed commits: do not treat it as disposable cache.
For requested Manus synchronization/checkpoint/publish work, fetch the relevant remote refs, integrate as needed and push the intended branch. The tool returns remote_refs; use that actual prefix rather than the user's unrelated origin. Accepted canonical main updates produce checkpoints; another branch does not automatically advance main or publish. Preserve canonical history and existing remote protections. The main Webdev skill's Git/checkpoint guide owns platform version and publish semantics. Read its publishing authorization rules and publishing.auto_publish preference before publishing; ordinary local commits do not create Manus checkpoints or trigger automatic publication.
Git exit status and checkpoint recording are separate. Check exit_code and checkpoint; do not claim a saved platform version from exit zero alone. After interruption, inspect what happened before retrying. Do not repeat a compound shell command merely to retry bookkeeping.
Moving declarations and nesting websites
Moving/renaming an entire website folder with its source, declaration and private Managed history preserves its website ID and local history. Restore any affected Session selection and preview from the actual new location through normal Host tools.
Moving/copying only the JSON points another directory at the same platform website; it does not create a new website or move source/history. For another working copy, attach the existing website and establish its own Managed history without overwriting local files. Unpushed commits cannot be restored from a JSON hash if their repository is missing.
When correcting a website mistakenly declared in a parent folder, first determine the intended source root. Preserve the website ID and valuable history, and reconcile source layout, build references and the Session directory. Moving only JSON or Git metadata is not proof that this migration is complete. Do not rewrite remote history or publish merely to tidy the layout.
A child folder can declare another website with its own ID and Managed Git. Before each command, the parent Managed repository refreshes its local exclude rules for discovered child websites; the tool reports them as nested_websites. This keeps new child files out of an ordinary parent checkpoint without changing user Git. Explicit Git force-add can override ignore rules; these rules are not a file-access boundary. If child files were already tracked by the parent, the tool reports tracked: true and leaves them tracked: explain the impact and obtain confirmation before removing them from the parent's index; preserve their files and history, and do not silently push a deletion to the parent website. These remain normal Git operations, not a separate synchronization protocol.
Local environment, preview and recovery
Use the existing webdev.config tool to read GET config, then declare PUT config/runtime with { "runtime": { "port": 5173 } } using the actual port for this task. In Studio, only runtime.port is overridden in the Addon's private data directory for this Session. Other runtime fields remain project-owned; this call may preserve them unchanged but cannot modify them. GET config returns this Session's effective runtime. The top-level revision still describes the project configuration; runtime_sync reports local application of it. Bind the listener to 127.0.0.1 on that exact port with strict-port behavior. If it is occupied, choose another free port and update the declaration. Do not save the temporary port in package.json, framework configuration or production settings. Startup and run-start restore the local proxy from the same declaration; the agent still owns the website process.
Prefer per-domain config writes. Whole-document PUT config can update project fields such as buildCache; keep the runtime.port returned by GET unchanged, and the tool preserves both the project port and Session override. The owning Desktop opens this loopback preview; another device cannot use its address. Reuse the existing unavailable/Continue in Manus Cloud behavior instead of claiming a remote browser can reach localhost.
Inspect actual dependencies before checks or service startup. Install missing dependencies explicitly with the project's selected toolchain and lockfile policy, including required lifecycle-script permissions. Wait for the finite install to complete. Keep CI/non-interactive overrides scoped to finite commands, not the resident development service. Do not treat an implicit install inside a check as a hung check.
When the application requires managed environment values, read the relevant config and wait for runtime_sync to be applied or noop before using those services. A stored config revision is not proof it loaded locally. workspace_mismatch after directory recovery needs the normal selection flow and same-resource re-attach, not a new website or relaxed permissions.
Start a resident dev server with the existing service=true execution behavior and required narrow network grant; probe the actual loopback site. Use the assigned listener for HMR too. require_escalated is not the Host's network=true permission interface.
If a preview the user requested stops after Desktop/Operator restart, restoring that preview is part of the request: check its actual port, reload the same website environment when needed, restart only if necessary and verify the website. Do not launch duplicate healthy services. Do not restart after an explicit stop/kill or during a read-only task. Report real permission/startup failures rather than looping through alternative routes.