MOOS-IvP Repo Builder
Overview
Use this skill to bootstrap a new external MOOS-IvP project modeled on the
course moos-ivp-extend tree. The goal is a working user-owned repository that
builds, has its bin, scripts, and behavior lib paths available from the
shell, and is ready for custom apps, behaviors, and missions.
This skill owns the repo shell and environment setup. For code inside the new
repo, delegate follow-on work to:
moos-app-builder for custom MOOS apps
ivp-behavior-builder for custom IvP behaviors
moos-ivp-mission-builder for runnable missions
Defaults
- Template source:
https://github.com/moos-ivp/moos-ivp-extend.git
- Git handling: fresh repo. Remove the template
.git/, then run git init.
- Environment file:
<repo>/env.sh
- Persistent shell integration: ask before editing a shell profile
- Environment additions:
- add
<repo>/bin and <repo>/scripts to PATH
- add
<repo>/lib to IVP_BEHAVIOR_DIRS
- Keep the example app, behavior, and missions unless the user asks for a
clean shell.
Use a different template repo or skip the repo-local environment file only when
the user explicitly asks.
Confirmation Gate
Before cloning or editing files, collect and confirm:
- New repo name and target parent directory or full target path.
- Repository author name and optional organization string for customized
project text. This is not the same as Git commit identity.
- Whether examples should stay or be removed.
- Whether to add persistent shell integration by sourcing
<repo>/env.sh from
the user's preferred shell profile. If yes, confirm the profile path.
If the user already gave these values and said to proceed, treat that as the
confirmation. Otherwise, stop and ask a concise confirmation question before
cloning.
Guiding Vague Users
When the user starts with a vague request such as "I want a new MOOS-IvP repo",
guide them with one or two small questions at a time instead of dumping the
whole checklist at once.
Good first move:
- Try to resolve
MOOS_IVP_ROOT in the background.
- Say whether it was found.
- Ask for the repo name.
Then ask for the target location, project display author, examples/defaults,
and shell integration preference as needed. If the user says "wherever is fine",
suggest a concrete default path and confirm it. Prefer a sibling of the
validated moos-ivp checkout, for example ~/my-new-repo when
MOOS_IVP_ROOT is ~/moos-ivp. Do not default to nesting the new repo inside
an unrelated active workspace. Explain that the project display author is for
README/CMake text, not a Git committer email.
When proposing persistent shell integration, show the concise block that would
be added to the selected profile:
# >>> moos-ivp repo: <repo-name> >>>
[ -f "<absolute-repo-path>/env.sh" ] && . "<absolute-repo-path>/env.sh"
# <<< moos-ivp repo: <repo-name> <<<
Before side effects, summarize the resolved values in one sentence and ask for
explicit confirmation.
MOOS-IvP Root Resolution
Resolve MOOS_IVP_ROOT before cloning. Try, in order:
- Path explicitly provided by the user.
MOOS_IVP_ROOT from the shell environment.
- A sibling or parent
moos-ivp near the target path or current workspace.
- Common home locations:
~/moos-ivp
~/src/moos-ivp
~/repos/moos-ivp
~/projects/moos-ivp
- A bounded shallow home search for a directory named
moos-ivp, suppressing
expected permission noise.
Validate a candidate by confirming:
ivp/src exists
build-moos.sh exists
build-ivp.sh exists
scripts/GenMOOSApp_AppCasting exists and is executable
scripts/GenBehavior exists and is executable
If no valid checkout is found, stop and ask explicitly for the path to the
local moos-ivp checkout. Do not clone, edit shell profiles, or create a
placeholder path.
If multiple checkouts are found, prefer the one nearest the target repo. State
which path will be used in the confirmation.
Workflow
Confirm setup values and validated MOOS_IVP_ROOT.
Create or verify the target parent directory.
Refuse to overwrite a non-empty target directory unless the user explicitly
asks to reuse it.
Clone the template into the target path:
git clone https://github.com/moos-ivp/moos-ivp-extend.git <target-repo>
Detach the template Git metadata and initialize a fresh repo:
rm -rf .git
git init
git branch -M main
Customize repository text and build wiring.
- Keep one top-level README by default. Prefer
README.md, migrate any
useful unique text from legacy README if needed, then remove README.
Keep both only if the user explicitly asks.
- Remove inherited template CI metadata by default, including
.github/workflows/build_extend.yml and .gitlab-ci.yml, and remove any
README badges or links that refer to the upstream template CI.
- Update README title and obvious references from
moos-ivp-extend to the
new repo name in the retained README.
- Use the repository author name in the top-level CMake
# NAME: line and
any newly written project text. Label this to the user as the project
display author, not Git commit identity. Do not rewrite upstream example
source file authors unless the user explicitly asks to claim or replace
example code.
- Update top-level CMake comments and
PROJECT(...) only when a clear
project identifier is available. Use an uppercase, underscore-safe project
token.
- If the repo name appears in nested example docs such as
missions/alder/README or src/lib_behaviors-test/README, update only
path references needed for the examples to remain accurate.
- Scrub obvious visible template names in comments and docs that a user is
likely to open, including top-level
CMakeLists.txt, src/CMakeLists.txt,
and mission/example README files. Do not churn source-file history
comments merely to remove upstream maintainer names.
- Make the resolved
MOOS_IVP_ROOT effective for builds. Treat it as a
setup-time input, not a shell variable that users must keep forever. The
upstream
template only searches nearby relative paths, so a repo outside the same
parent as moos-ivp can fail unless the path is wired explicitly.
Update top-level CMakeLists.txt with the resolved absolute path:
- append
<moos-ivp-root>/build/MOOS/MOOSCore to CMAKE_PREFIX_PATH
before find_package(MOOS 10.0)
- add
<moos-ivp-root> to the
find_path(MOOSIVP_SOURCE_TREE_BASE ... PATHS ...) list
This makes normal future ./build.sh runs work without requiring
MOOS_IVP_ROOT in .bashrc.
- Do not add repository automation files or remote GitHub setup unless the
user explicitly asks.
If the user requested a clean shell, remove sample source and mission
directories carefully and keep the build skeleton valid. Otherwise retain
examples so the baseline build has known artifacts to verify.
Create the repo-local shell environment file.
Write <repo>/env.sh.
Resolve the absolute paths for the new repo's bin, scripts, and
lib directories before writing the file.
Make repeated sourcing idempotent so PATH and IVP_BEHAVIOR_DIRS do not
accumulate duplicate entries.
Keep the file source-compatible with common Bash and zsh startup files.
Use this shape:
#!/usr/bin/env bash
# Source this file to use this MOOS-IvP extension repo.
case ":$PATH:" in *":<absolute-repo-bin>:"*) ;; *) PATH="$PATH:<absolute-repo-bin>" ;; esac
case ":$PATH:" in *":<absolute-repo-scripts>:"*) ;; *) PATH="$PATH:<absolute-repo-scripts>" ;; esac
case ":${IVP_BEHAVIOR_DIRS:-}:" in *":<absolute-repo-lib>:"*) ;; *) IVP_BEHAVIOR_DIRS="${IVP_BEHAVIOR_DIRS:+$IVP_BEHAVIOR_DIRS:}<absolute-repo-lib>" ;; esac
export PATH
export IVP_BEHAVIOR_DIRS
If the user opted into persistent shell integration, update the selected
shell profile.
Ask for the profile path instead of assuming one. If the user named a
shell, suggest its usual profile, such as ~/.zshrc for zsh or
~/.bashrc for Bash, and ask for confirmation. If the user did not name a
shell, ask which profile to update and offer common choices: ~/.zshrc,
~/.bashrc, or no profile edit.
Create the profile file if it does not exist.
Preserve user content.
Append the managed source block near the end of the profile so it runs
after earlier PATH setup. Do not insert it before later lines that reset or
export PATH.
Use a clearly marked block:
# >>> moos-ivp repo: <repo-name> >>>
[ -f "<absolute-repo-path>/env.sh" ] && . "<absolute-repo-path>/env.sh"
# <<< moos-ivp repo: <repo-name> <<<
If the user opted out, leave the profile unchanged and tell them they can
run . <repo>/env.sh in a shell session.
Validate the baseline.
- Run
./build.sh from a normal tool-capable shell, not from a shell whose
profile has hidden basic build tools. The repo CMake should already have
the resolved moos-ivp path wired in, so build validation should not
depend on MOOS_IVP_ROOT being exported.
- If examples were retained, confirm:
bin/pXRelayTest exists and is executable
lib/libBHV_SimpleWaypoint.dylib on macOS or
lib/libBHV_SimpleWaypoint.so on Linux exists
- Validate
<repo>/env.sh separately by sourcing it in a shell and
confirming the new absolute bin, scripts, and lib paths appear in
PATH / IVP_BEHAVIOR_DIRS.
- If a persistent profile source block was added, validate that applying the
selected profile reaches the same environment.
- If sourcing the user's profile hides build tools such as
mkdir, make,
or cmake, report that as a profile/tooling issue, not as a repo build
failure.
- Run
which pXRelayTest or command -v pXRelayTest only after applying
<repo>/env.sh or the selected profile.
Initialize the first commit when the user asked for Git setup or when they
asked for a ready fresh repo, but only if Git identity is already
configured or the user supplied both a commit author name and email.
Repository author text collected earlier is for project files, not enough
to invent a Git committer email:
git add .
git commit -m "chore: initialize MOOS-IvP extension repo"
Skip the commit if Git user identity is missing and report the exact
blocker instead of inventing identity values. Do not ask for Git email
during the initial setup unless the user specifically wants the first
commit completed in the same turn.
If no remote was attached, mention the natural next step: create an empty
GitHub repository under the user's account or organization, add it as
origin, and push main. Do not perform this unless the user explicitly
asks. Remind the user that if their GitHub credentials are connected, the
AI agent can create the GitHub repo, add the remote, and push for them.
Environment Editing Rules
- Expand
~ to an absolute path before writing shell profile blocks.
- Quote paths in shell exports.
- Do not edit any shell profile unless the user opts into persistent shell
integration and confirms the profile path.
- Do not remove an existing matching block for another repo.
- If replacing a block for the same repo path, replace only the managed block
with the same marker.
- Keep profile edits idempotent: running the skill twice should not append
duplicate path entries.
- Keep the repo-local
env.sh as the source of the PATH and
IVP_BEHAVIOR_DIRS details; shell profiles should only source that file.
Validation Checklist
- Target repo was cloned from the intended template.
- Template
.git/ was removed before git init.
git remote -v is empty unless the user asked to attach a remote.
- The resolved local
moos-ivp checkout was validated.
- The new repo's build can find the resolved
moos-ivp checkout, even when the
repo is not a sibling of moos-ivp.
./build.sh succeeds, or the exact compiler/configuration blocker is
reported.
PATH and IVP_BEHAVIOR_DIRS setup was written to <repo>/env.sh.
- If requested, the selected shell profile sources
<repo>/env.sh.
- Generated
bin/ and lib/ artifacts are not treated as source changes.
- Final message names the new repo path, env file path, profile path if
updated, validation result, and the next appropriate skills.
Failure Handling
- Missing
MOOS_IVP_ROOT: stop and ask for the local checkout path.
- Non-empty target path: stop unless the user explicitly asked to reuse it.
- Clone failure: report the template URL and Git error.
- Build failure: report the first actionable CMake or compiler error.
- Shell profile write failure: leave the repo intact and tell the user to
source
<repo>/env.sh manually.
- Git commit failure due to identity: leave files initialized and staged state
as-is; tell the user to configure Git identity.
1---2name: moos-ivp-repo-builder3description: Create a user-owned MOOS-IvP extension repository from moos-ivp-extend: clone/customize the template, confirm the local MOOS-IvP dependency, configure PATH and IVP_BEHAVIOR_DIRS, initialize independent Git, and validate the baseline build before app, behavior, or mission work.4---56# MOOS-IvP Repo Builder78## Overview910Use this skill to bootstrap a new external MOOS-IvP project modeled on the11course `moos-ivp-extend` tree. The goal is a working user-owned repository that12builds, has its `bin`, `scripts`, and behavior `lib` paths available from the13shell, and is ready for custom apps, behaviors, and missions.1415This skill owns the repo shell and environment setup. For code inside the new16repo, delegate follow-on work to:1718- `moos-app-builder` for custom MOOS apps19- `ivp-behavior-builder` for custom IvP behaviors20- `moos-ivp-mission-builder` for runnable missions2122## Defaults2324- Template source: `https://github.com/moos-ivp/moos-ivp-extend.git`25- Git handling: fresh repo. Remove the template `.git/`, then run `git init`.26- Environment file: `<repo>/env.sh`27- Persistent shell integration: ask before editing a shell profile28- Environment additions:29 - add `<repo>/bin` and `<repo>/scripts` to `PATH`30 - add `<repo>/lib` to `IVP_BEHAVIOR_DIRS`31- Keep the example app, behavior, and missions unless the user asks for a32 clean shell.3334Use a different template repo or skip the repo-local environment file only when35the user explicitly asks.3637## Confirmation Gate3839Before cloning or editing files, collect and confirm:40411. New repo name and target parent directory or full target path.422. Repository author name and optional organization string for customized43 project text. This is not the same as Git commit identity.443. Whether examples should stay or be removed.454. Whether to add persistent shell integration by sourcing `<repo>/env.sh` from46 the user's preferred shell profile. If yes, confirm the profile path.4748If the user already gave these values and said to proceed, treat that as the49confirmation. Otherwise, stop and ask a concise confirmation question before50cloning.5152## Guiding Vague Users5354When the user starts with a vague request such as "I want a new MOOS-IvP repo",55guide them with one or two small questions at a time instead of dumping the56whole checklist at once.5758Good first move:59601. Try to resolve `MOOS_IVP_ROOT` in the background.612. Say whether it was found.623. Ask for the repo name.6364Then ask for the target location, project display author, examples/defaults,65and shell integration preference as needed. If the user says "wherever is fine",66suggest a concrete default path and confirm it. Prefer a sibling of the67validated `moos-ivp` checkout, for example `~/my-new-repo` when68`MOOS_IVP_ROOT` is `~/moos-ivp`. Do not default to nesting the new repo inside69an unrelated active workspace. Explain that the project display author is for70README/CMake text, not a Git committer email.7172When proposing persistent shell integration, show the concise block that would73be added to the selected profile:7475```bash76# >>> moos-ivp repo: <repo-name> >>>77[ -f "<absolute-repo-path>/env.sh" ] && . "<absolute-repo-path>/env.sh"78# <<< moos-ivp repo: <repo-name> <<<79```8081Before side effects, summarize the resolved values in one sentence and ask for82explicit confirmation.8384## MOOS-IvP Root Resolution8586Resolve `MOOS_IVP_ROOT` before cloning. Try, in order:87881. Path explicitly provided by the user.892. `MOOS_IVP_ROOT` from the shell environment.903. A sibling or parent `moos-ivp` near the target path or current workspace.914. Common home locations:92 - `~/moos-ivp`93 - `~/src/moos-ivp`94 - `~/repos/moos-ivp`95 - `~/projects/moos-ivp`965. A bounded shallow home search for a directory named `moos-ivp`, suppressing97 expected permission noise.9899Validate a candidate by confirming:100101- `ivp/src` exists102- `build-moos.sh` exists103- `build-ivp.sh` exists104- `scripts/GenMOOSApp_AppCasting` exists and is executable105- `scripts/GenBehavior` exists and is executable106107If no valid checkout is found, stop and ask explicitly for the path to the108local `moos-ivp` checkout. Do not clone, edit shell profiles, or create a109placeholder path.110111If multiple checkouts are found, prefer the one nearest the target repo. State112which path will be used in the confirmation.113114## Workflow1151161. Confirm setup values and validated `MOOS_IVP_ROOT`.1172. Create or verify the target parent directory.1183. Refuse to overwrite a non-empty target directory unless the user explicitly119 asks to reuse it.1204. Clone the template into the target path:121122 ```bash123 git clone https://github.com/moos-ivp/moos-ivp-extend.git <target-repo>124 ```1251265. Detach the template Git metadata and initialize a fresh repo:127128 ```bash129 rm -rf .git130 git init131 git branch -M main132 ```1331346. Customize repository text and build wiring.135 - Keep one top-level README by default. Prefer `README.md`, migrate any136 useful unique text from legacy `README` if needed, then remove `README`.137 Keep both only if the user explicitly asks.138 - Remove inherited template CI metadata by default, including139 `.github/workflows/build_extend.yml` and `.gitlab-ci.yml`, and remove any140 README badges or links that refer to the upstream template CI.141 - Update README title and obvious references from `moos-ivp-extend` to the142 new repo name in the retained README.143 - Use the repository author name in the top-level CMake `# NAME:` line and144 any newly written project text. Label this to the user as the project145 display author, not Git commit identity. Do not rewrite upstream example146 source file authors unless the user explicitly asks to claim or replace147 example code.148 - Update top-level CMake comments and `PROJECT(...)` only when a clear149 project identifier is available. Use an uppercase, underscore-safe project150 token.151 - If the repo name appears in nested example docs such as152 `missions/alder/README` or `src/lib_behaviors-test/README`, update only153 path references needed for the examples to remain accurate.154 - Scrub obvious visible template names in comments and docs that a user is155 likely to open, including top-level `CMakeLists.txt`, `src/CMakeLists.txt`,156 and mission/example README files. Do not churn source-file history157 comments merely to remove upstream maintainer names.158 - Make the resolved `MOOS_IVP_ROOT` effective for builds. Treat it as a159 setup-time input, not a shell variable that users must keep forever. The160 upstream161 template only searches nearby relative paths, so a repo outside the same162 parent as `moos-ivp` can fail unless the path is wired explicitly.163 Update top-level `CMakeLists.txt` with the resolved absolute path:164 - append `<moos-ivp-root>/build/MOOS/MOOSCore` to `CMAKE_PREFIX_PATH`165 before `find_package(MOOS 10.0)`166 - add `<moos-ivp-root>` to the167 `find_path(MOOSIVP_SOURCE_TREE_BASE ... PATHS ...)` list168 This makes normal future `./build.sh` runs work without requiring169 `MOOS_IVP_ROOT` in `.bashrc`.170 - Do not add repository automation files or remote GitHub setup unless the171 user explicitly asks.1727. If the user requested a clean shell, remove sample source and mission173 directories carefully and keep the build skeleton valid. Otherwise retain174 examples so the baseline build has known artifacts to verify.1758. Create the repo-local shell environment file.176 - Write `<repo>/env.sh`.177 - Resolve the absolute paths for the new repo's `bin`, `scripts`, and178 `lib` directories before writing the file.179 - Make repeated sourcing idempotent so PATH and `IVP_BEHAVIOR_DIRS` do not180 accumulate duplicate entries.181 - Keep the file source-compatible with common Bash and zsh startup files.182 - Use this shape:183184 ```bash185 #!/usr/bin/env bash186 # Source this file to use this MOOS-IvP extension repo.187 case ":$PATH:" in *":<absolute-repo-bin>:"*) ;; *) PATH="$PATH:<absolute-repo-bin>" ;; esac188 case ":$PATH:" in *":<absolute-repo-scripts>:"*) ;; *) PATH="$PATH:<absolute-repo-scripts>" ;; esac189 case ":${IVP_BEHAVIOR_DIRS:-}:" in *":<absolute-repo-lib>:"*) ;; *) IVP_BEHAVIOR_DIRS="${IVP_BEHAVIOR_DIRS:+$IVP_BEHAVIOR_DIRS:}<absolute-repo-lib>" ;; esac190 export PATH191 export IVP_BEHAVIOR_DIRS192 ```1931949. If the user opted into persistent shell integration, update the selected195 shell profile.196 - Ask for the profile path instead of assuming one. If the user named a197 shell, suggest its usual profile, such as `~/.zshrc` for zsh or198 `~/.bashrc` for Bash, and ask for confirmation. If the user did not name a199 shell, ask which profile to update and offer common choices: `~/.zshrc`,200 `~/.bashrc`, or no profile edit.201 - Create the profile file if it does not exist.202 - Preserve user content.203 - Append the managed source block near the end of the profile so it runs204 after earlier PATH setup. Do not insert it before later lines that reset or205 export PATH.206 - Use a clearly marked block:207208 ```bash209 # >>> moos-ivp repo: <repo-name> >>>210 [ -f "<absolute-repo-path>/env.sh" ] && . "<absolute-repo-path>/env.sh"211 # <<< moos-ivp repo: <repo-name> <<<212 ```213214 - If the user opted out, leave the profile unchanged and tell them they can215 run `. <repo>/env.sh` in a shell session.21610. Validate the baseline.217 - Run `./build.sh` from a normal tool-capable shell, not from a shell whose218 profile has hidden basic build tools. The repo CMake should already have219 the resolved `moos-ivp` path wired in, so build validation should not220 depend on `MOOS_IVP_ROOT` being exported.221 - If examples were retained, confirm:222 - `bin/pXRelayTest` exists and is executable223 - `lib/libBHV_SimpleWaypoint.dylib` on macOS or224 `lib/libBHV_SimpleWaypoint.so` on Linux exists225 - Validate `<repo>/env.sh` separately by sourcing it in a shell and226 confirming the new absolute `bin`, `scripts`, and `lib` paths appear in227 `PATH` / `IVP_BEHAVIOR_DIRS`.228 - If a persistent profile source block was added, validate that applying the229 selected profile reaches the same environment.230 - If sourcing the user's profile hides build tools such as `mkdir`, `make`,231 or `cmake`, report that as a profile/tooling issue, not as a repo build232 failure.233 - Run `which pXRelayTest` or `command -v pXRelayTest` only after applying234 `<repo>/env.sh` or the selected profile.23511. Initialize the first commit when the user asked for Git setup or when they236 asked for a ready fresh repo, but only if Git identity is already237 configured or the user supplied both a commit author name and email.238 Repository author text collected earlier is for project files, not enough239 to invent a Git committer email:240241 ```bash242 git add .243 git commit -m "chore: initialize MOOS-IvP extension repo"244 ```245246 Skip the commit if Git user identity is missing and report the exact247 blocker instead of inventing identity values. Do not ask for Git email248 during the initial setup unless the user specifically wants the first249 commit completed in the same turn.25012. If no remote was attached, mention the natural next step: create an empty251 GitHub repository under the user's account or organization, add it as252 `origin`, and push `main`. Do not perform this unless the user explicitly253 asks. Remind the user that if their GitHub credentials are connected, the254 AI agent can create the GitHub repo, add the remote, and push for them.255256## Environment Editing Rules257258- Expand `~` to an absolute path before writing shell profile blocks.259- Quote paths in shell exports.260- Do not edit any shell profile unless the user opts into persistent shell261 integration and confirms the profile path.262- Do not remove an existing matching block for another repo.263- If replacing a block for the same repo path, replace only the managed block264 with the same marker.265- Keep profile edits idempotent: running the skill twice should not append266 duplicate path entries.267- Keep the repo-local `env.sh` as the source of the PATH and268 `IVP_BEHAVIOR_DIRS` details; shell profiles should only source that file.269270## Validation Checklist271272- Target repo was cloned from the intended template.273- Template `.git/` was removed before `git init`.274- `git remote -v` is empty unless the user asked to attach a remote.275- The resolved local `moos-ivp` checkout was validated.276- The new repo's build can find the resolved `moos-ivp` checkout, even when the277 repo is not a sibling of `moos-ivp`.278- `./build.sh` succeeds, or the exact compiler/configuration blocker is279 reported.280- `PATH` and `IVP_BEHAVIOR_DIRS` setup was written to `<repo>/env.sh`.281- If requested, the selected shell profile sources `<repo>/env.sh`.282- Generated `bin/` and `lib/` artifacts are not treated as source changes.283- Final message names the new repo path, env file path, profile path if284 updated, validation result, and the next appropriate skills.285286## Failure Handling287288- Missing `MOOS_IVP_ROOT`: stop and ask for the local checkout path.289- Non-empty target path: stop unless the user explicitly asked to reuse it.290- Clone failure: report the template URL and Git error.291- Build failure: report the first actionable CMake or compiler error.292- Shell profile write failure: leave the repo intact and tell the user to293 source `<repo>/env.sh` manually.294- Git commit failure due to identity: leave files initialized and staged state295 as-is; tell the user to configure Git identity.