forge-app-builder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseForge App Builder
Forge 应用构建器
When building a Forge app, the agent MUST complete this workflow in order. Do not skip steps. Do not substitute manual instructions for running the scripts below.
构建Forge应用时,代理必须按顺序完成以下工作流,不得跳过步骤,不得用手动说明替代运行以下脚本。
Critical Rules
核心规则
- Always use to scaffold apps — it registers the app and generates a valid app ID
forge create - Never manually scaffold — apps without valid app IDs cannot be deployed
- If fails, STOP — inform the user and provide the manual command
forge create - Never ask for API tokens in chat — direct users to run in their terminal and enter credentials there
forge login - Always ask the user to choose when multiple options exist (developer spaces, sites) — never pick on their behalf
- Always ask the user for their Atlassian site URL during installation — never try to discover it from other apps, environment variables, or any other source
- Always run the deploy script for deploy and install — do not give the user only manual /
forge deploycommands as the primary outcome; runforge installyourselfscripts.deploy_forge_app.py
- **始终使用**来生成应用脚手架——它会注册应用并生成有效的应用ID
forge create - 切勿手动搭建脚手架——没有有效应用ID的应用无法部署
- 如果失败,请停止操作——告知用户并提供手动命令
forge create - 切勿在聊天中索要API令牌——引导用户在终端中运行并在那里输入凭据
forge login - 当存在多个选项(开发者空间、站点)时,始终让用户选择——切勿代为选择
- 安装期间始终向用户索要Atlassian站点URL——切勿尝试从其他应用、环境变量或任何其他来源获取该URL
- 部署和安装时始终运行部署脚本——不要仅向用户提供手动/
forge deploy命令作为主要操作;请自行运行forge installscripts.deploy_forge_app.py
MCP Server Prerequisites
MCP服务器前置条件
This skill works best with the following MCP servers. The scripts and CLI workflow function without them, but the agent will lack access to up-to-date Forge documentation for template selection, module configuration, and code patterns.
| MCP Server | Required? | Purpose |
|---|---|---|
| Forge MCP | Strongly recommended | Template lookup, module discovery, manifest syntax, UI Kit/backend guides |
| ADS MCP | Optional | Atlaskit component/token/icon lookup (Custom UI apps only) |
If MCP servers are not connected, inform the user that code guidance may be based on the model's training data and could be outdated. Recommend they verify against developer.atlassian.com/platform/forge.
|
本技能在搭配以下MCP服务器使用时效果最佳。即使没有这些服务器,脚本和CLI工作流仍可运行,但代理将无法获取最新的Forge文档以进行模板选择、模块配置和代码模式参考。
| MCP服务器 | 是否需要? | 用途 |
|---|---|---|
| Forge MCP | 强烈推荐 | 模板查找、模块发现、清单语法、UI Kit/后端指南 |
| ADS MCP | 可选 | Atlaskit组件/令牌/图标查找(仅适用于Custom UI应用) |
如果未连接MCP服务器,请告知用户代码指导可能基于模型的训练数据,可能已过时。建议他们前往developer.atlassian.com/platform/forge进行验证。
|
Agent Workflow
代理工作流
Complete steps 0–5 in order. Run the scripts yourself; do not only instruct the user to run them.
按顺序完成步骤0–5。请自行运行脚本;不要仅指导用户运行脚本。
Step 0: Prerequisites (Install Automatically If Missing)
步骤0:前置条件(缺失时自动安装)
Before any other steps, call the tool to get the current Node.js version requirement and CLI setup instructions. Then check and install prerequisites:
forge-development-guide- Node.js — Run . If missing or below the version specified in the development guide:
node -v
- macOS (Homebrew):
brew install node - nvm: then
nvm install <version>nvm use <version> - fnm: then
fnm install <version>fnm use <version> - Other: https://nodejs.org (LTS)
- Forge CLI — Run . If missing:
forge --version
bash
npm install -g @forge/cli- Forge login — Run . If not logged in:
forge whoami
- Never ask for or accept API tokens in chat — tokens are sensitive; the user must enter them only in their terminal
- Direct the user to create an API token: https://id.atlassian.com/manage/api-tokens
- Tell the user to run in their own terminal (not via the agent). The CLI will prompt for:
forge login- Atlassian email
- API token (paste only in the terminal when prompted)
- Example message: "You need to log in to Forge. Create an API token at https://id.atlassian.com/manage/api-tokens, then run in your terminal. Enter your email and token when prompted — do not paste them here."
forge login - After the user confirms they've logged in, retry the workflow
Install in order: Node.js first (required for npm), then Forge CLI, then login. Retry the workflow after installing.
在执行任何其他步骤之前,调用工具获取当前Node.js版本要求和CLI设置说明。然后检查并安装前置条件:
forge-development-guide- Node.js — 运行。如果缺失或版本低于开发指南中指定的版本:
node -v
- macOS(Homebrew):
brew install node - nvm: 然后
nvm install <version>nvm use <version> - fnm: 然后
fnm install <version>fnm use <version> - 其他: https://nodejs.org(LTS版本)
- Forge CLI — 运行。如果缺失:
forge --version
bash
npm install -g @forge/cli- Forge登录 — 运行。如果未登录:
forge whoami
- 切勿在聊天中索要或接收API令牌——令牌属于敏感信息;用户必须仅在自己的终端中输入
- 引导用户创建API令牌:https://id.atlassian.com/manage/api-tokens
- 告知用户在自己的终端中运行(而非通过代理)。CLI将提示输入:
forge login- Atlassian邮箱
- API令牌(仅在终端提示时粘贴)
- 示例消息:"您需要登录Forge。请前往https://id.atlassian.com/manage/api-tokens创建API令牌,然后在终端中运行。提示时输入您的邮箱和令牌——请勿在此处粘贴。"
forge login - 用户确认登录后,重新执行工作流
安装顺序:先安装Node.js(npm的必备条件),然后安装Forge CLI,最后登录。安装完成后重新执行工作流。
Step 1: Discover Developer Spaces
步骤1:发现开发者空间
bash
forge developer-spaces list --jsonbash
forge developer-spaces list --jsonStep 2: Ask User to Choose Developer Space
步骤2:让用户选择开发者空间
Do not proceed to Step 3 until the user has selected a developer space. Present the list from Step 1 (names and IDs) and ask which space to use. If only one space exists, you may use it and briefly inform the user. Never pick one of multiple spaces on the user's behalf.
**在用户选择开发者空间之前,请勿进入步骤3。**展示步骤1中的列表(名称和ID)并询问用户使用哪个空间。如果只有一个空间,您可以直接使用并简要告知用户。当存在多个空间时,切勿代为选择。
Step 3: Create App
步骤3:创建应用
All * commands must be run from the skill directory (the directory containing this SKILL.md file). Derive it from the SKILL.md path provided in the system prompt. Use on macOS if is not available.
python3 -m scripts.python3pythonRun from the skill directory. The flag sets the parent directory under which the app folder (named after ) will be created. The script s into that directory before running , so the app appears as a subdirectory (e.g. ). If omitted, the app is created under the current directory.
--directory--namecdforge create<parent-directory>/<app-name>/bash
python3 -m scripts.create_forge_app \
--template <template> \
--name <app-name> \
--dev-space-id <selected-id> \
--directory <parent-directory>To find the right template for the user's needs:
- Call to identify the appropriate module type
list-forge-modules - Call with a query like "template for " to find the matching template name
search-forge-docs
Validate a template:
List all templates:
python3 -m scripts.list_templates --validate <name>python3 -m scripts.list_templates --list所有*命令必须从技能目录(包含本SKILL.md文件的目录)运行。从系统提示中提供的SKILL.md路径推导该目录。如果macOS中不可用,请使用。
python3 -m scripts.pythonpython3从技能目录运行。标志设置应用文件夹(以命名)将创建于其中的父目录。脚本会先切换到该目录,然后运行,因此应用将作为子目录出现(例如)。如果省略该标志,应用将创建于当前目录下。
--directory--nameforge create<parent-directory>/<app-name>/bash
python3 -m scripts.create_forge_app \
--template <template> \
--name <app-name> \
--dev-space-id <selected-id> \
--directory <parent-directory>为用户需求选择合适的模板:
- 调用确定合适的模块类型
list-forge-modules - 调用并使用类似"template for "的查询语句查找匹配的模板名称
search-forge-docs
验证模板:
列出所有模板:
python3 -m scripts.list_templates --validate <name>python3 -m scripts.list_templates --listStep 4: Customize Code
步骤4:自定义代码
After succeeds:
forge createbash
cd <app-name>
npm installforge createbash
cd <app-name>
npm installUI Kit vs Custom UI — Choose the Right Tools
UI Kit vs Custom UI — 选择合适的工具
Before writing any UI code, determine which approach the app uses. Getting this wrong causes import errors and broken builds.
- UI Kit (most templates): manifest uses
forge createor code imports fromrender: native. Use@forge/reactas the ONLY UI reference. Do NOT suggestforge-ui-kit-developer-guide* imports — they won't work.@atlaskit/ - Custom UI: manifest has pointing to a
resourcedirectory. Use ADS MCP tools (static/,ads_plan,ads_get_components) for component discovery. Do NOT useads_get_all_icons— it describes a different API.forge-ui-kit-developer-guide
在编写任何UI代码之前,请确定应用使用的方式。选择错误会导致导入错误和构建失败。
- UI Kit(大多数模板):清单使用
forge create或代码从render: native导入。仅使用@forge/react作为UI参考。请勿建议使用forge-ui-kit-developer-guide*导入——它们无法正常工作。@atlaskit/ - Custom UI:清单包含指向目录的
static/。使用ADS MCP工具(resource、ads_plan、ads_get_components)进行组件发现。请勿使用ads_get_all_icons——它描述的是不同的API。forge-ui-kit-developer-guide
Knowledge tools for implementation
实现用知识工具
- — Frontend components (UI Kit only)
forge-ui-kit-developer-guide - /
ads_plan— Component and token lookup (Custom UI only)ads_get_components - — Backend resolvers and APIs
forge-backend-developer-guide - — Manifest configuration
forge-app-manifest-guide - — Search for specific APIs or props
search-forge-docs
- — 前端组件(仅适用于UI Kit)
forge-ui-kit-developer-guide - /
ads_plan— 组件和令牌查找(仅适用于Custom UI)ads_get_components - — 后端解析器和API
forge-backend-developer-guide - — 清单配置
forge-app-manifest-guide - — 搜索特定API或属性
search-forge-docs
Step 5: Deploy and Install (run the deploy script)
步骤5:部署和安装(运行部署脚本)
You MUST run the deploy script — do not only paste manual / commands for the user to run. Execute the script from the skill directory.
forge deployforge install- If you have the user's Atlassian site URL (e.g. they provided it earlier or in the request), run in one go:
bash
python3 -m scripts.deploy_forge_app \
--app-dir <app-directory> \
--site <site-url> \
--product <jira|confluence>- If you do not have the site URL yet: run deploy only, then ask for the site, then run again to install:
bash
undefined您必须运行部署脚本——不要仅粘贴手动 / 命令让用户运行。从技能目录执行脚本。
forge deployforge install- 如果您已有用户的Atlassian站点URL(例如用户之前或在请求中提供过),一次性运行:
bash
python3 -m scripts.deploy_forge_app \
--app-dir <app-directory> \
--site <site-url> \
--product <jira|confluence>- 如果您还没有站点URL:先仅运行部署,然后询问用户站点URL,再再次运行以完成安装:
bash
undefined1) Deploy only
1) 仅部署
python3 -m scripts.deploy_forge_app
--app-dir <app-directory>
--product <jira|confluence>
--deploy-only
--app-dir <app-directory>
--product <jira|confluence>
--deploy-only
python3 -m scripts.deploy_forge_app
--app-dir <app-directory>
--product <jira|confluence>
--deploy-only
--app-dir <app-directory>
--product <jira|confluence>
--deploy-only
2) Ask the user: "What is your Atlassian site URL (e.g. yourcompany.atlassian.net)?"
2) 询问用户:"您的Atlassian站点URL是什么(例如yourcompany.atlassian.net)?"
3) After they reply, run again with their site to complete install
3) 用户回复后,使用他们提供的站点再次运行以完成安装
python3 -m scripts.deploy_forge_app
--app-dir <app-directory>
--site <site-url>
--product <jira|confluence>
--skip-deps
--app-dir <app-directory>
--site <site-url>
--product <jira|confluence>
--skip-deps
**Always ask the user for their site URL** when needed for install; never try to discover it. If scopes changed from a previous install, add `--upgrade` to the install (or run the script again with `--site` and the script will handle it; for manual upgrade use `forge install ... --upgrade`).python3 -m scripts.deploy_forge_app
--app-dir <app-directory>
--site <site-url>
--product <jira|confluence>
--skip-deps
--app-dir <app-directory>
--site <site-url>
--product <jira|confluence>
--skip-deps
**当安装需要时,始终向用户索要站点URL**——切勿尝试自行获取。如果作用域与之前的安装相比发生变化,请在安装时添加`--upgrade`(或再次运行带`--site`的脚本,脚本会自动处理;手动升级请使用`forge install ... --upgrade`)。Cross-product installation
跨产品安装
When an app uses scopes from multiple products (e.g. a Confluence macro that also reads Jira data), the deploy script automatically detects the required products from the manifest scopes and installs on all of them. The flag sets the primary product; the script adds any additional products found in the scopes.
--productIf you need to install manually, run once per product:
forge installbash
forge install --non-interactive --site <site-url> --product confluence -e development
forge install --non-interactive --site <site-url> --product jira -e development当应用使用多个产品的作用域时(例如同时读取Jira数据的Confluence宏),部署脚本会自动检测清单作用域中所需的产品并在所有相关产品上安装。标志设置主产品;脚本会添加作用域中发现的所有其他产品。
--product如果需要手动安装,请为每个产品运行一次:
forge installbash
forge install --non-interactive --site <site-url> --product confluence -e development
forge install --non-interactive --site <site-url> --product jira -e developmentHandling forge create
Failures
forge create处理forge create
失败
forge createWhen fails, never attempt workarounds or manual scaffolding.
forge create| Error | Action |
|---|---|
| Prerequisites missing (Node.js, Forge CLI) | Run Step 0 install commands, then retry |
| "Prompts can not be meaningfully rendered" | Ask user to run |
| "No developer spaces found" | Direct user to https://developer.atlassian.com/console/ |
| "directory already exists" | A folder named |
| Network/auth issues, not logged in | Direct user to https://id.atlassian.com/manage/api-tokens, then run |
| Any other error | Show error, ask user for guidance |
Example response when it fails:
forge create needs an interactive terminal. Please run:
forge create --template jira-dashboard-gadget my-app-name
Once created, let me know and I'll help customize it.当失败时,切勿尝试变通方法或手动搭建脚手架。
forge create| 错误 | 操作 |
|---|---|
| 前置条件缺失(Node.js、Forge CLI) | 运行步骤0的安装命令,然后重试 |
| "Prompts can not be meaningfully rendered" | 让用户在交互式终端中运行 |
| "No developer spaces found" | 引导用户前往https://developer.atlassian.com/console/ |
| "directory already exists" | 父目录中已存在名为 |
| 网络/认证问题、未登录 | 引导用户前往https://id.atlassian.com/manage/api-tokens,然后在终端中运行 |
| 其他任何错误 | 显示错误,询问用户的指导 |
失败时的示例回复:
forge create需要交互式终端。请运行:
forge create --template jira-dashboard-gadget my-app-name
创建完成后,请告知我,我会帮助您自定义它。Module Selection
模块选择
Call for a comprehensive, up-to-date list of all available modules organized by product. Then use with the module name for configuration details and YAML examples.
list-forge-modulessearch-forge-docs调用获取按产品分类的所有可用模块的全面、最新列表。然后使用并传入模块名称以获取配置详情和YAML示例。
list-forge-modulessearch-forge-docsScripts
脚本
| Script | Purpose |
|---|---|
| Create app with dev space selection and template validation. |
| List/validate all Forge templates from Atlassian registry. Run: |
| Deploy and install app (prerequisites check, npm install, lint, deploy, install). Auto-detects cross-product scopes and installs on all required products. Run: |
| 脚本 | 用途 |
|---|---|
| 结合开发者空间选择和模板验证创建应用。 |
| 列出/验证Atlassian注册表中的所有Forge模板。运行: |
| 部署和安装应用(前置条件检查、npm安装、代码检查、部署、安装)。自动检测跨产品作用域并在所有所需产品上安装。运行: |
Completion checklist
完成检查清单
Before considering the workflow done, confirm:
- User selected developer space when more than one existed (or only one existed)
- App was created via (or user ran
create_forge_appafter a failure)forge create - Code was customized and run in the app directory
npm install - Deploy script was executed by the agent (not only manual commands given to the user)
- If install was needed, user was asked for site URL and the script was run with (or user provided site and install completed)
--site - If the app uses cross-product scopes (e.g. Confluence app reading Jira data), it was installed on all required products (the deploy script handles this automatically)
在认为工作流完成之前,请确认:
- 当存在多个开发者空间时,用户已选择(或仅存在一个空间)
- 应用是通过创建的(或用户在失败后运行了
create_forge_app)forge create - 代码已自定义且在应用目录中运行了
npm install - 代理已执行部署脚本(而非仅向用户提供手动命令)
- 如果需要安装,已向用户索要站点URL并使用运行了脚本(或用户提供了站点且安装已完成)
--site - 如果应用使用跨产品作用域(例如读取Jira数据的Confluence应用),已在所有所需产品上安装(部署脚本会自动处理此操作)
Common agent mistakes (avoid these)
代理常见错误(请避免)
- Picking a developer space when multiple exist — always ask the user to choose.
- Skipping the deploy script — giving only "run and
forge deploy" instructions instead of runningforge installyourself.deploy_forge_app.py - Not asking for site URL — when install is required, ask the user for their Atlassian site URL; do not guess or skip install.
- Proceeding to create app before user chooses a developer space — wait for their selection when there are multiple spaces.
- 当存在多个开发者空间时代为选择——始终让用户选择。
- 跳过部署脚本——仅提供"运行和
forge deploy"的说明,而非自行运行forge install。deploy_forge_app.py - 不索要站点URL——当需要安装时,向用户索要Atlassian站点URL;请勿猜测或跳过安装。
- 用户选择开发者空间前就创建应用——当存在多个空间时,等待用户选择。
Troubleshooting
故障排查
For CLI commands, debugging techniques, and common error patterns, call . For quick checks:
forge-development-guide- Not logged in / auth failed: Create API token at id.atlassian.com/manage/api-tokens, then run in your terminal (never paste token in chat)
forge login - App not appearing after install: Check , verify manifest with
forge logs -e development --limit 50, re-install withforge lintif scopes changed--upgrade - "forge: command not found":
npm install -g @forge/cli
如需CLI命令、调试技巧和常见错误模式,请调用。快速检查项:
forge-development-guide- 未登录/认证失败:前往id.atlassian.com/manage/api-tokens创建API令牌,然后在终端中运行(切勿在聊天中粘贴令牌)
forge login - 安装后应用未显示:检查,使用
forge logs -e development --limit 50验证清单,如果作用域已更改,请使用forge lint重新安装--upgrade - "forge: command not found":运行
npm install -g @forge/cli