diff --git a/skills/apollo-new-project/SKILL.md b/skills/apollo-new-project/SKILL.md index 16e57cc..c30c248 100644 --- a/skills/apollo-new-project/SKILL.md +++ b/skills/apollo-new-project/SKILL.md @@ -1,6 +1,6 @@ --- name: apollo-new-project -description: Set up a new Apollo V4 software project (game, demo, tool, application, library, driver) as its own git repository in which every AI agent uses ApolloKnowledgeBase as its central source of Apollo V4 knowledge, then check, install or update ApolloCrossDev, and create the Makefile and a starting program for os-friendly or os-takeover mode that builds without warnings. Use when the user wants to start, create, scaffold or set up a new program or project for the Apollo V4, Vampire V4, 68080 or SAGA, pastes the "Start Apollo V4 Project" prompt from apolloknowledgebase.com, or wants an existing folder of Apollo code prepared for AI-assisted work. +description: Set up a new Apollo V4 software project (game, demo, tool, application, library, device, datatype) as its own git repository in which every AI agent uses ApolloKnowledgeBase as its central source of Apollo V4 knowledge, then check, install or update ApolloCrossDev, and create the Makefile and a starting program for os-friendly or os-takeover mode that builds without warnings (guided setup), or only the AKB setup for the agent (basic setup). Use when the user wants to start, create, scaffold or set up a new program or project for the Apollo V4, Vampire V4, 68080 or SAGA, pastes the "Start Apollo V4 Project" prompt from apolloknowledgebase.com, or wants an existing folder of Apollo code prepared for AI-assisted work. --- # apollo-new-project @@ -18,30 +18,55 @@ check is `ApolloKnowledgeBase/skills/apollo-build/scripts/find-acd.sh`. In step 1, before the submodule exists, read KB files on GitHub if you need them: `https://raw.githubusercontent.com/ApolloTeam-dev/ApolloKnowledgeBase/main/`. -## 1. Ask what the project is +## 0. Guided or basic setup -Ask in one go, and suggest the defaults in brackets. Don't continue without -answers to the first five. +The project is the folder this session was started in: don't ask where. +First ask which setup the developer wants: -1. **Name** (becomes the folder, the program and `PROJECT_NAME`): letters, - digits, `-` or `_`, no spaces. +- **Guided setup:** the full procedure, steps 1 to 8: a few questions, AKB, + ApolloCrossDev checked, installed or updated, Makefile, a starting + program, and a build without warnings. +- **Basic setup:** only what an agent needs to use AKB correctly: steps 2 + and 3, without questions. The developer does the rest (toolchain, + Makefile, code). + +For a basic setup, skip step 1. In `AGENTS.md` (step 3), fill in the project +name (the folder's name) and the defaults from the table in step 1, and +write `not set yet` for what it is, kind, execution mode and languages, +with this line under the list: "Fields marked `not set yet`: ask the +developer before relying on them, and fill them in." Leave out the build +commands and write "Not set up yet: use the apollo-build skill when the +project gets a Makefile." Then go to step 8: show the files, offer a first +commit, and mention that the guided setup can still check ApolloCrossDev +and add a Makefile and a starting program later. + +## 1. Ask what the project is (guided setup) + +Ask these four in one go, and suggest the defaults in brackets: + +1. **Project name** [the current folder's name]: becomes `PROJECT_NAME` and + the program's name. Letters, digits, `-` or `_`, no spaces. 2. **What it is**, in one sentence, and its **kind**: game, demo, tool, - application, library or OS component. -3. **Target OS**, one or more: ApolloOS R10, AmigaOS 3.9, AmigaOS 3.2. -4. **Execution mode**: `os-takeover` (games and demos: multitasking off, + application, library, device or datatype. +3. **Execution mode**: `os-takeover` (games and demos: multitasking off, direct 68080 and SAGA access, OS restored on exit) or `os-friendly` (applications and tools: OS calls). Explain the difference if asked; it is in `KB AGENTS.md` section 1 and `KB os/os-takeover.md`. -5. **Where**: the parent folder for the project [the current folder]. -6. **Target core** [`Core 12500+`, the core with the current SAGA features - such as the pointer sprite] and **V4 model** [any V4 model]. -7. **Languages**: C, C++, 68080 assembly [C, with assembly where needed]. -8. **ApolloLib** for SAGA sound, pictures, PIP, pointer and input [yes]. See - `KB core/best-practices/prefer-library-calls-for-saga-chips.md`. +4. **Which language(s)**: C, C++ and/or assembler [C]. + +Don't ask about the rest; every new project gets these, and the developer +can change them later in `AGENTS.md`: + +| Setting | Value | +|---|---| +| Target OS | ApolloOS R10, AmigaOS 3.9 and AmigaOS 3.2 | +| Target core | the latest core release. When code uses something that a knowledge base file limits to a minimum core (its `applies_to.core`), tell the developer. | +| V4 model | any V4 model | +| ApolloLib | yes, for SAGA sound, pictures, PIP, pointer and input (`KB core/best-practices/prefer-library-calls-for-saga-chips.md`) | ## 2. Create the repository with AKB -In `/`, which must not exist yet or be empty: +In the current folder: ```sh git init @@ -49,21 +74,22 @@ git submodule add https://github.com/ApolloTeam-dev/ApolloKnowledgeBase ApolloKn ``` If the folder already holds code, don't overwrite anything: add only what is -missing and show the user what you would change. +missing and show the user what you would change. If it is already a git +repository, skip `git init`. ## 3. Make AKB the agents' central source These files make every agent that opens the project read AKB first. - **`AGENTS.md`** (read by most agents): from `KB templates/repo/AGENTS.md`. - Fill in every `` from step 1, remove the template's HTML - comments. + Fill in every `` from step 1 and its defaults, remove the + template's HTML comments. - **Build and test:** `make compile` to build, `make` to build and upload to the V4 at `$AMIGAHOST`. - **Relevant knowledge base areas:** pick from the table in `KB AGENTS.md` section 3. Always `toolchain/`; `os/os-takeover.md` and `core/` for os-takeover; the SAGA folders that the program will use; - `toolchain/apollolib/` with ApolloLib. + `toolchain/apollolib/`. - **Repository-specific rules:** the user's rules, or remove the section's placeholder line. - **`CLAUDE.md`** (Claude Code): copy `KB templates/repo/CLAUDE.md` as it is. @@ -88,7 +114,7 @@ These files make every agent that opens the project read AKB first. Other agents reach the AKB skills through `KB AGENTS.md` section 9, which the project's AGENTS.md sends them to. -## 4. ApolloCrossDev: check, install or update +## 4. ApolloCrossDev: check, install or update (guided setup) Run the check from the submodule: @@ -118,29 +144,27 @@ for it if that is missing too). Change the file only with the user's consent. For this session, pass it on the command line: `APOLLOCROSSDEV= make compile`. -## 5. Makefile +## 5. Makefile (guided setup) Copy `/Projects/_makefiles/Makefile` and change only: | Line | Set to | |---|---| | `PROJECT_NAME` | the name | -| `C_INCL_NDK` | NDK 3.2 (default), or the `ndk39-include` line when AmigaOS 3.9 is a target (`KB toolchain/target-os-headers.md`) | -| `APOLLOLIB` | keep it, or put `#` before it without ApolloLib | +| `C_INCL_NDK` | the `ndk39-include` line: AmigaOS 3.9 is a target, so a function that 3.9 lacks gives a compile error instead of a crash on 3.9 (`KB toolchain/target-os-headers.md`) | | `C_COMPILER` | the `m68k-amigaos-g++` line for C++; the template does not collect `.cpp` files, so add them as `KB toolchain/project-makefile.md` says | -Keep `C_OPTIONS` and `S_FLAGS` as they are. +Keep `APOLLOLIB`, `C_OPTIONS` and `S_FLAGS` as they are. -## 6. The starting program +## 6. The starting program (guided setup) Copy one file from this skill's `assets/` to `main.c` and replace `@PROJECT@`, `@WHAT@` and `@TARGETS@` (core, model, target OS): -| Mode | ApolloLib | File | -|---|---|---| -| os-friendly | either | `assets/main-os-friendly.c` | -| os-takeover | yes | `assets/main-os-takeover.c` | -| os-takeover | no | `assets/main-os-takeover-nolib.c` | +| Mode | File | +|---|---| +| os-friendly | `assets/main-os-friendly.c` | +| os-takeover | `assets/main-os-takeover.c` | The takeover programs leave the display takeover open on purpose: the KB doesn't document it yet (`KB os/os-takeover.md`). Tell the user, and don't @@ -148,7 +172,7 @@ fill it in from general Amiga knowledge. Copy `assets/gitignore` to `.gitignore`. -## 7. Build it +## 7. Build it (guided setup) Build as the apollo-build skill describes (`KB skills/apollo-build/SKILL.md`): `make compile`. It must end with no errors and no warnings before you @@ -156,7 +180,8 @@ continue. ## 8. Hand over -- Show the user the files you made and the build result. +- Show the user the files you made and, for a guided setup, the build + result. - Offer a first commit; commit only when they agree. - Tell them how to work from here: open the project folder in their agent, which now reads AKB first; `git submodule update --remote ApolloKnowledgeBase` diff --git a/skills/apollo-new-project/assets/main-os-takeover-nolib.c b/skills/apollo-new-project/assets/main-os-takeover-nolib.c deleted file mode 100644 index 528100d..0000000 --- a/skills/apollo-new-project/assets/main-os-takeover-nolib.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - @PROJECT@ - @WHAT@ - - Target: @TARGETS@ - Execution mode: os-takeover (multitasking off, direct 68080 and SAGA access, - multitasking and the Workbench screen restored on exit). Without ApolloLib. -*/ - -#include -#include -#include - -extern struct ExecBase *SysBase; - -/* ApolloKnowledgeBase os/best-practices/detect-68080-and-fpu-at-run-time.md */ -static int has_68080(void) { return (SysBase->AttnFlags & (1 << 10)) != 0; } - -int main(void) -{ - if (!has_68080()) - return RETURN_FAIL; - - /* 1. Allocate memory (AllocMem) and load files (Open/Read/Close) here, - while the OS still runs. */ - - Forbid(); /* multitasking off; interrupts still run */ - - /* 2. Take over the display and run the program here. ApolloKnowledgeBase - os/os-takeover.md does not document the display takeover yet. */ - - /* 3. Restore the display here. */ - Permit(); /* one Permit for every Forbid, on every exit path */ - - /* 4. Free memory (FreeMem) and close files. */ - return RETURN_OK; -} diff --git a/templates/repo/AGENTS.md b/templates/repo/AGENTS.md index 28daeac..ec2d221 100644 --- a/templates/repo/AGENTS.md +++ b/templates/repo/AGENTS.md @@ -18,7 +18,7 @@ without it. - **What it is:** -- **Kind:** +- **Kind:** - **Target core:** - **Target model:** - **Target OS:**