|
| 1 | +# Create a new app |
| 2 | + |
| 3 | +Read this reference only for a new deployable Forge app. |
| 4 | + |
| 5 | +## Decide before scaffolding |
| 6 | + |
| 7 | +Resolve enough of the architecture to choose an appropriate current scaffold. Retrieve the exact module and scaffolding documentation before selecting a template. |
| 8 | + |
| 9 | +Check prerequisites only when creation is imminent. Retrieve current requirements, then inspect Node.js, Forge CLI, and authentication state. If login is required, direct the user to run `forge login` interactively without sharing credentials. |
| 10 | + |
| 11 | +Confirm the destination, app name, and Developer Space. If multiple spaces are available, require the user to choose. If one is available, inform the user before using it. Explain that `forge create` registers an external app identity in the selected Developer Space. |
| 12 | + |
| 13 | +Immediately before non-interactive creation, show that the helper passes the current CLI option for accepting Forge terms and any applicable billing consent, then obtain explicit authorization. Do not invoke the helper without that authorization. If authorization is absent, let the user complete the current interactive `forge create` flow; never accept terms on the user's behalf. |
| 14 | + |
| 15 | +## Choose one scaffold branch |
| 16 | + |
| 17 | +### Stable template-first branch |
| 18 | + |
| 19 | +Prefer a current module-specific `forge create` template when it cleanly matches the architecture. Use `scripts.create_forge_app` with the current documented template name. Do not use an undocumented registry as an independent source of truth. |
| 20 | + |
| 21 | +Run the helper from the skill directory: |
| 22 | + |
| 23 | +```bash |
| 24 | +python3 -m scripts.list_templates --validate <current-documented-template> |
| 25 | + |
| 26 | +python3 -m scripts.create_forge_app \ |
| 27 | + --template <current-documented-template> \ |
| 28 | + --name <app-name> \ |
| 29 | + --dev-space-id <selected-id> \ |
| 30 | + --directory <parent-directory> |
| 31 | +``` |
| 32 | + |
| 33 | +### Compositional branch |
| 34 | + |
| 35 | +Consider a blank `forge create` app when the app needs several modules, no suitable stable template exists, or deliberate module composition is clearer. |
| 36 | + |
| 37 | +```bash |
| 38 | +python3 -m scripts.create_forge_app \ |
| 39 | + --template blank \ |
| 40 | + --name <app-name> \ |
| 41 | + --dev-space-id <selected-id> \ |
| 42 | + --directory <parent-directory> |
| 43 | +``` |
| 44 | + |
| 45 | +Before using `forge module add`, retrieve its current lifecycle and CLI documentation. If it is non-GA, obtain agreement to that exposure. Inspect `forge module add --dry-run` before applying changes, and never use `--force` without explicit approval for the specific overwrites or dependency upgrades. |
| 46 | + |
| 47 | +Official entries: |
| 48 | + |
| 49 | +- `forge create`: <https://developer.atlassian.com/platform/forge/cli-reference/create/> |
| 50 | +- Developer Spaces: <https://developer.atlassian.com/platform/forge/developer-space/create-developer-space/> |
| 51 | +- Module command tutorial: <https://developer.atlassian.com/platform/forge/build-a-jira-app-with-the-module-command/> |
| 52 | +- `forge module add`: <https://developer.atlassian.com/platform/forge/cli-reference/module-add/> |
| 53 | + |
| 54 | +## Handle creation failure |
| 55 | + |
| 56 | +Show the complete failure and triage it by cause: |
| 57 | + |
| 58 | +- If the CLI requires interaction, provide the exact current interactive `forge create` command for the user to run in their terminal. |
| 59 | +- If no Developer Space exists, direct the user to create one in the Atlassian developer console, then retry after they confirm the target. |
| 60 | +- If the destination already exists, use a different confirmed name or destination. Never delete or overwrite the existing directory without explicit authorization. |
| 61 | +- If authentication is missing or expired, direct the user to run `forge login` interactively without sharing credentials, then retry. |
| 62 | +- For any other failure, preserve the command output, retrieve the relevant current documentation, and explain what blocks creation before asking for the input or external change needed to continue. |
| 63 | + |
| 64 | +Never construct a replacement app ID or manual scaffold. Route to `forge-debugger` if diagnosis of a persistent failure becomes the primary task. |
0 commit comments