Goal
Dispatch all ordinary NocoBase UI authoring to one explicitly resolved Portal and manage Portal workspaces, preserving env selection, source storage configuration, and clear readback after changes.
Scope
- Inspect Portal inventory and details.
- Start every ordinary NocoBase page, menu, block, field, action, layout, and reaction request by resolving the target env and Portal.
- Use the
nocobase-ui-builderskill to build no-code Portal UI. - Use the
nocobase-ai-builderskill for AI Portal source development after locating or pulling the corresponding Portal source directory. - Create Portal workspaces from templates.
- Configure Portal source storage, including Git repo, branch, and path.
- Pull and push Portal source between local workspace, NocoBase storage, and Git source storage.
- Deploy a Portal or start Portal development mode.
- Diagnose common Portal CLI and Git source storage failures.
- Destroy a Portal only when explicitly requested and confirmed.
Non-Goals
- Do not directly author no-code Modern UI pages, blocks, menus, reactions, or page content inside this skill; use the
nocobase-ui-builderskill while preserving Portal env and workspace context. - Do not implement AI Portal source changes directly inside this skill; resolve or pull the source directory and hand the same request to
nocobase-ai-builder. - Do not manage app runtime lifecycle, CLI self-update, env setup, or installed skills update; hand off to
nocobase-env-manage. - Do not manage backup restore or migration publishing; hand off to
nocobase-publish-manage. - Do not infer Portal type from user wording, templates, source layout, current directory, or local files; use the selected record's
portalTypeonly. - Once an AI Portal is selected for an ordinary UI build, that build request authorizes implementing and testing the change in its source project; do not ask for separate source-code authorization.
- Do not mutate databases or NocoBase internals outside the public
nb portalcommand surface. - Do not run wrapper scripts, Docker fallback commands, or direct SQL as a substitute for
nb portal. - Do not treat the absence of
nb portalas permission to emulate Portal lifecycle, source storage, sync, deploy, or destroy operations through private APIs.
Hard Rules
- Before executing any
nb portal ...command, confirm the installed CLI exposes the Portal command surface withnb portal --help,nb --help, or an equivalent local command-help check. - Use direct
nb portalcommands for Portal lifecycle, source storage, sync, deploy, and diagnosis operations when that command surface exists. - If
nb portalis unavailable, report lifecycle/source/deploy/destroy tasks as blocked by the installed CLI version and hand CLI update/env work tonocobase-env-manage; do not switch transports. - Treat this skill as the entry point for every ordinary NocoBase UI authoring request, even if it does not contain the word "Portal".
- Before any ordinary UI authoring write, inspect structured Portal inventory with
nb portal list -j; count only records whereenabled === true. - Treat
isDefault/ default marker fromnb portal list -jas informational readback only. Include it when listing choices or reporting readback, but never use it to select among multiple enabled Portals. - When the user specifies a Portal, match its CLI
nameexactly across structured records. Continue only when exactly one record matches and it hasenabled === true; a missing, disabled, or non-unique match must stop without substitution. - When the user does not specify a Portal: zero enabled Portals must stop the UI build without automatically creating one; exactly one is selected automatically; multiple Portals must be listed by
nameandportalTypefor explicit user selection. - When multiple enabled Portals exist, do not auto-select the record with
isDefault === true; list it with a default marker and ask for the target Portal explicitly. - Do not infer a target among multiple Portals from cwd, active files, a nearby or recent
portal.config.json,localPath, sync state, title similarity, or Portal type preference. - Determine the selected Portal's implementation path only from its
portalType; do not infer type from the request, template, source tree, or local workspace. - Use
portal.config.json,localPath, and other local workspace information only after an AI Portal is selected, and only to locate its source project before invokingnocobase-ai-builder. - When the selected record has
portalType === "ai", loading and executingnocobase-ai-builderis mandatory. Ifnb portal list -jornb portal info <portal> -jreports an emptydevelopmentPath/localPath/ local source path, runnb portal pull <portal>first, then read back the Portal info/list again and enter the pulled development directory. Pass the resolved Portal name, environment, local source path, and original user request; do not substitute an ad hoc source-edit workflow. - Do not use source storage configuration as an AI Portal working directory.
sourceStorage,git_repo,git_branch,git_path,--git-path, repository subdirectories, and deployment/storage paths are remote storage configuration for pull/push/deploy; they are not the local development directory. Source edits happen only in the selected Portal's existingdevelopmentPath/localPathor in the local directory returned afternb portal pull <portal>readback. - Treat
nb portalas runtime-unavailable when the command is unknown or whennb portal list -jreturns the explicit endpoint-absence signatures404/Not Found. For ordinary UI authoring only, this enters the legacy capability probe below; Portal lifecycle/source/deploy operations remain blocked. - When Portal inventory is runtime-unavailable, do not use
flow-surfaces list-navigation-targetsas Portal inventory or infer no-code versus AI. Runnb api flow-surfaces list-navigation-targets -jonly to inspectcapabilities.multiPortal:falseenables the legacy UI Builder lane andtruestops. - Older pre-Portal runtimes may not expose
list-navigation-targets. When that action is explicitly unknown or returns404/Not Found, and the user did not name a Portal, allow the legacy UI Builder lane only after both checks succeed:nb api flow-surfaces --helpexposesapply-blueprintandlist-templates, andnb api flow-surfaces list-templates --body '{}' -jreturns a structured success response. This is the verified legacy Flow Surfaces signature. Auth errors,5xx, malformed output, a missing core action, or a failed read probe must stop; never reinterpret them as legacy evidence. - Use the current configured CLI env unless the user provides an explicit env.
- When passing an explicit env that may differ from the current env, include
--yesonly when the user requested non-interactive execution or explicitly confirmed the target env. - Before
destroy, require explicit confirmation from the user. - Before
pull --force,create --force, or any operation that overwrites local Portal source, require explicit confirmation. - For one-Portal-per-repository Git workflows, prefer
--git-path .. - Use subdirectory
--git-pathvalues only when the user wants multiple Portals or other content in the same Git repository. - Never enter or edit a
--git-path/git_pathvalue as if it were the local Portal project. It is a repository-relative storage path, not the pulled development directory. - If an existing
portal.config.jsonor remote Portal record already has a configured Git path, do not assume the current CLI default rewrites it; change it explicitly withnb portal config <portal> --git-path .when requested. - For
push, use the user's requested commit message when provided; otherwise let CLI defaults apply. - Do not automatically run
pushordeployafter source or UI changes. Executepushonly when the user emphasizes pushing/syncing/committing Portal source. Executedeployonly when the user emphasizes deployment/publishing/releasing the Portal. A deploy request does not imply a prior push. - Treat
pushanddeployas independent actions when both are explicitly requested. A failedpushmust be reported, but it must not automatically block an explicitly requesteddeployunless the user said deployment is conditional on push success, such as "push successfully then deploy", "only deploy after push succeeds", or equivalent wording. - On command failure, report the relevant CLI output and the next concrete recovery command instead of switching transports.
Supported Tasks
listinfocreateconfigpullpushdeploydevdestroydiagnosebuild
Input Contract
| Input | Required | Default | Validation | Clarification Question |
|---|---|---|---|---|
action |
yes | inferred | one of build/list/info/create/config/pull/push/deploy/dev/destroy/diagnose |
"Which Portal action should I run?" |
portal |
lifecycle actions except list; optional for build |
the only enabled Portal for build |
exact CLI name |
"Which Portal should I target?" |
runtime_env_name |
no | current env | configured CLI env name | "Which env should I target?" |
template |
create only | CLI default | npm package, local path, or file:// URL |
"Which Portal template should I use?" |
title |
create only | generated from slug | non-empty string | "What display title should this Portal use?" |
source_storage |
create/config only | nocobase for create, existing config for config |
nocobase or git |
"Should source storage be nocobase or git?" |
git_repo |
git create/config | none | full Git remote URL | "Which Git remote URL should store the Portal source?" |
git_branch |
no | main |
non-empty branch name | "Which Git branch should be used?" |
git_path |
no | . |
relative path inside repository, no .. |
"Which repository path should store the Portal source?" |
message |
push only | CLI default | non-empty commit message | "What commit message should I use?" |
force |
destructive/overwrite actions | false |
requires explicit confirmation | "Confirm overwrite/destruction before I continue." |
Rules:
- If required inputs for a mutating action are missing, stop and ask one concise clarification question.
- If the user says "you decide", use the documented defaults and direct
nb portalbehavior. - Do not ask for optional inputs that have safe CLI defaults unless the choice materially affects data, source, or deployment outcome.
Mandatory Clarification Gate
- Max clarification rounds:
2. - Max questions per round:
3. - Before mutation, resolve
action,portal, env target when explicit, and any required Git fields. - Before
destroy, ask for secondary confirmation. - Before
pull --forceorcreate --force, ask for secondary confirmation. - Before configuring Git storage without
git_repo, ask for the Git remote URL. - If a Git source storage failure mentions an empty remote, missing branch, or missing configured Git path, diagnose from Git Source Storage before recommending manual Git commands.
Workflow
Ordinary UI Build Workflow
Use this path for every ordinary NocoBase page, menu, block, field, action, layout, or reaction request, including requests that never say "Portal".
- Inspect the current env with
nb env currentandnb env info. - Detect Portal CLI support with
nb portal --helpor equivalent command-help output. - If
nb portalis unavailable:- For create/config/pull/push/deploy/dev/destroy/list/info requests, stop and report the missing CLI capability; recommend
nocobase-env-managefor CLI/runtime upgrade or environment diagnosis. - For ordinary UI authoring, call
nb api flow-surfaces list-navigation-targets -jonly as a capability check. Ifcapabilities.multiPortalis explicitlyfalse, use thenocobase-ui-builderlegacy lane. If it istrue, stop. If the action is explicitly unknown or returns404/Not Found, use the verified legacy Flow Surfaces probe defined in Hard Rules; continue only when that full probe succeeds. Other missing, unclear, or failed results stop with CLI/runtime guidance. - Never treat navigation targets as no-code/AI Portal inventory.
- For create/config/pull/push/deploy/dev/destroy/list/info requests, stop and report the missing CLI capability; recommend
- Inspect structured Portal inventory with
nb portal list -jwhen the command surface is available, and retain only records whereenabled === true. If this inventory call returns explicit endpoint absence (404/Not Found), treat Portal inventory as runtime-unavailable and apply step 3 for ordinary UI authoring; do not do so for auth errors,5xx, or malformed output. - Resolve the target Portal:
- If the user supplied a Portal name, require exactly one record whose
nameis an exact match and whoseenabledvalue istrue. A missing, disabled, or non-unique match stops the build. - If no Portal was supplied and zero enabled Portals exist, stop and tell the user to explicitly create a Portal first. Do not create one automatically.
- If no Portal was supplied and exactly one enabled Portal exists, select it automatically.
- If no Portal was supplied and multiple Portals exist, list each
name,portalType, and default status when present, ask for an explicit selection, and do no UI write. A singleisDefault === truerecord does not break the tie. - Do not infer the target from cwd, active files,
portal.config.json,localPath, sync state, title similarity, or type preference.
- If the user supplied a Portal name, require exactly one record whose
- Read the selected record's
portalType. It is the only source for no-code versus AI routing. - If it is a no-code Portal, use the
nocobase-ui-builderskill for page, menu, block, field, action, and permission authoring. - If it is an AI Portal, use
nb portal info <portal> -j, the selected list record'sdevelopmentPath,localPath,portal.config.json, or local workspace state only to locate the already selected Portal's local source project. If that local development path is empty or missing, runnb portal pull <portal>first, then read back withnb portal info <portal> -jornb portal list -jand enter the pulled development directory. IgnoresourceStorage,git_repo,git_branch,git_path,--git-path, and deployment/storage paths as edit locations; those only describe where the Portal source is stored for pull/push/deploy. Then load and executenocobase-ai-builderwith the resolved Portal name, environment, source path, and original request. The original request authorizes implementation and verification; do not ask for separate code-edit authorization. - If
portalTypeis absent or unsupported, stop instead of guessing. - After UI changes, do not automatically run
nb portal pushornb portal deploy. Usenb portal devonly when needed for local verification or when requested. Runpushonly for explicit source-push intent, and rundeployonly for explicit deployment intent.
Explicit action=create requests continue through the Portal Command Workflow. The zero-Portal stop above applies only to ordinary UI builds and must not suppress an explicit lifecycle request to create a Portal.
Portal Command Workflow
- Infer the Portal action and target env from the user's request.
- Read Runtime Contract before executing an unfamiliar command shape or when building a command with flags.
- For Git source storage setup or failures, read Git Source Storage.
- Check whether
nb portalis available before trying the action. - If
nb portalis unavailable, stop without fallback mutation and report the missing command surface plus the nextnocobase-env-managehandoff. - Ask only for missing required inputs or required confirmations.
- Execute the direct
nb portalcommand. - For write actions except
dev, read back withnb portal info <portal>when available; otherwise usenb portal list -j. - For
push, report whether source changes were committed or the CLI reported no changes. - For combined
push+deployrequests, execute the requested actions independently in order. Ifpushfails, record the failure and continue to the requesteddeployafter any required deploy confirmation, unless the user made deploy conditional on push success. If the request only says deploy, do not insert a push step. - For failures, return the failed command, key CLI output, likely cause, and one next command.
Action Routing
- Use
listfor "show portals", "有哪些 portal", "portal 列表". - Use
infofor "portal details", "查看 portal 配置", "当前 git 配置". - Use
createfor "创建 portal", "new Portal workspace", "from template". - Use
configfor "配置 portal git", "改 source storage", "set git repo/branch/path". - Use
pullfor "拉取 portal 源码", "sync remote to local". - Use
pushonly for explicit source-push intent such as "推送 portal 源码", "push source", "portal push", "commit source to Git", or "sync Portal source". Do not infer push from a generic build, finish, publish, deploy, or release request. - Use
deployonly for explicit deployment intent such as "部署 portal", "deploy", "publish online", or "release Portal". Do not runpushfirst unless the user also explicitly asks to push source. - Use
devfor "启动 portal dev", "local portal development". - Use
destroyonly for explicit delete/destroy intent. - Use
diagnosewhen the user provides an error log or asks why a Portal command failed. - Use
buildfor every ordinary NocoBase page, menu, block, field, action, layout, or reaction request, whether or not it mentions a Portal. - When a UI request omits the Portal name, inspect structured env inventory first: zero stops, exactly one is automatic, and multiple require explicit selection even when one is marked default.
- For no-code Portal build requests, use the
nocobase-ui-builderskill for UI authoring. - For AI Portal build requests, locate the Portal local source directory; if the CLI reports no development path yet, run
nb portal pull <portal>first, then executenocobase-ai-builderin the pulled directory. Do not develop inside source storage paths such asgit_path/--git-path.
Reference Loading Map
| Reference | Use When | Notes |
|---|---|---|
| Runtime Contract | Building or checking direct nb portal command invocations |
Contains command map, env flag placement, and readback rules. |
| Git Source Storage | Configuring Git source storage or diagnosing Git push/pull failures | Covers root path default, empty repositories, and branch/path recovery. |
| Test Playbook | Validating the skill or planning capability checks | Read before adding tests or forward-testing the skill. |
Safety Gate
High-impact actions:
nb portal destroynb portal pull --forcenb portal create --force- configuring Git source storage for a shared or production Portal
nb portal deployto a production-like env
Secondary confirmation templates:
- Destroy:
Confirm execution: destroy Portal <portal> in env <env>. Expected impact: Portal record/workspace may be removed. Reply confirm to continue. - Overwrite local source:
Confirm execution: overwrite local Portal source for <portal> in env <env>. Reply confirm to continue. - Production deploy:
Confirm execution: deploy Portal <portal> to env <env>. Reply confirm to continue.
Rollback guidance:
- Failed
config: inspect withnb portal info <portal>and re-runnb portal configwith the previous values if known. - Failed
pull --force: local overwritten files may require restoration from Git or backup; do not invent a rollback. - Failed
push: inspect the Git error and retry only after branch, auth, repo, or path issue is corrected. - Failed
deploy: report CLI output and runnb portal info <portal>or deployment-specific readback if available.
Verification Checklist
- Action and Portal target are resolved when the command surface supports the requested operation.
- Direct
nb portalcommand is used whennb portalis available. nb portalavailability is checked before Portal command execution.- Explicit env handling is preserved.
- Required confirmations are collected before destructive or overwrite actions.
- Git source storage commands include a full remote URL when required.
- Default Git path uses
.for one-Portal-per-repository workflows. - Write actions have readback with
nb portal infoornb portal list -j. - Ordinary UI build requests use
nb portal list -j, filterenabled === true, preserveisDefaultfor display/readback only, and resolve exactly one Portal before choosing an implementation path. - Explicit Portal names match
nameexactly; multiple Portals never use local context for selection. - Multiple Portals never use default status for selection; default status is shown to the user as a marker only.
- Portal type comes only from
portalType. - No-code Portal UI authoring uses the
nocobase-ui-builderskill. - AI Portal UI authoring uses
nocobase-ai-builderin the corresponding Portal local source directory, pulling it withnb portal pull <portal>first whendevelopmentPath/localPathis empty, and never treats source storage paths such asgit_path/--git-pathas edit directories. pushanddeployare never auto-added after UI/source edits. A source-push request executes only push; a deployment request executes only deploy; an explicit combined request executes both independently.- Combined
push+deployrequests preserve both requested actions independently;pushfailure is reported but does not blockdeployunless deploy was explicitly conditional on push success. - Failure output includes the failed command and relevant CLI lines.
- Final answer reports commands, result, readback status, assumptions, and remaining risks.
Minimal Test Scenarios
listusesnb portal list -jand does not ask for a Portal name.configwith Git storage requiresgit_repoand defaultsgit_pathto..pushwith an empty Git repository reports branch creation support or actionable recovery.- A plain deployment request executes
deployonly and does not insert a push step. - A plain source-push request executes
pushonly and does not deploy. - Combined
push+deploycontinues to deploy after a push failure when the user requested both actions independently; it stops before deploy only when the user made deploy conditional on push success. pull --forceblocks until explicit confirmation.destroyblocks until explicit confirmation.- Zero enabled Portals stop ordinary UI authoring without implicit creation.
- Exactly one no-code Portal uses the
nocobase-ui-builderskill. - Exactly one AI Portal resolves its local source directory, or runs
nb portal pull <portal>first when no development path exists, then invokesnocobase-ai-builderwith the original request. - Multiple Portals list
name,portalType, and default status when available, and require explicit selection without cwd, default-marker, or local-file inference. - Explicit missing, disabled, or non-unique Portal names stop without substitution.
- App start/update request is handed off to
nocobase-env-manage. - Missing
nb portalblocks lifecycle/source/deploy actions with a clear CLI capability report and does not use private API fallbacks. - Missing Portal runtime support permits the legacy UI Builder lane when
list-navigation-targetsexplicitly returnscapabilities.multiPortal: false, or when the action is explicitly absent and the verified legacy Flow Surfaces signature succeeds.true, auth errors,5xx, malformed output, or a failed core probe stop.
Output Contract
For direct Portal command tasks, always return:
requestcapabilitycommandsenvportaldefaultresultreadbackassumptionsnext_steps
For natural UI build tasks, return:
requestenvportaldefaultcapabilityportal_typeimplementation_pathbuild_summaryverificationnext_steps
References
- Runtime Contract
- Git Source Storage
- Test Playbook
- NocoBase Portal CLI docs: official command reference. [verified: 2026-07-28]