Superbuild integration plan
How to introduce tools/ai-rules/ (submodule: ai-workflows/superbuild-workflow) into a legacy consuming superbuild and roll out shared workflow policy without silent divergence.
What belongs where
| Concern | Location |
|---|---|
| Shared migration policy and methodology | tools/ai-rules/docs/ (this repo) |
| Workspace inventory, per-project status, parity logs | Consumer docs/migration/ |
| Local build commands, preset names, profile paths | Consumer root AGENTS.md |
| Local migration exceptions | Consumer AGENTS.md + .cursor/rules/90-*-local.mdc |
| Product CMake, Conan, presets | Consumer repo root and src/ |
Do not copy migration docs out of the submodule and edit them locally as the primary policy path.
Phase 1: Submodule introduction
Add submodule
cd <superbuild-root>
git submodule add ssh://git@gitlab-ai/libesys/ai-workflows/superbuild-workflow.git tools/ai-rules
git submodule update --init --recursive
Pin to a tested commit on release branches; document revision in consumer AGENTS.md.
Establish consumer AGENTS.md
From templates/repo-AGENTS.template.md:
- Point to
tools/ai-rules/AGENTS.md - Document local preset names and Conan profiles
- Add Migration section linking to local
docs/migration/and sharedtools/ai-rules/docs/legacy-superbuild-migration.md
Materialize Cursor rules
Use templates/setup-dev.template.sh pattern:
# Copy or symlink shared adapters
tools/ai-rules/cursor/rules/*.mdc → .cursor/rules/
Add local overlay for migration status pointers if needed (do not duplicate full migration spec).
CI and clone discipline
Ensure CI and developer docs use:
git clone --recursive <url>
# or
git submodule update --init --recursive
Rollout sequence (recommended)
Phase 0 assessment (consumer docs/migration/)
↓
Phase 1 submodule + AGENTS.md + Cursor materialization
↓
Phase 2–3 per-project CMake (see legacy-superbuild-migration.md)
↓
Phase 4 Conan (workspace)
↓
Phase 5 presets unified
↓
Phase 6 validation; retire .vcxproj
↓
Bump tools/ai-rules when shared policy evolves
Submodule can land in Phase 1 before CMake refactors complete. Shared policy guides execution; it does not require a finished migration.
Updating shared workflow during migration
When migration reveals a gap in shared policy:
- Propose change in
ai-workflows/superbuild-workflow(upstream) - Merge and tag/commit
- Bump consumer submodule pointer
- Re-materialize
.cursor/rules/if adapters changed - Continue migration with updated policy
Never accumulate permanent edits inside tools/ai-rules/ in the consumer without upstreaming.
Governance during migration
| Activity | Rule |
|---|---|
| Per-project migration commits | Small, scoped, in src/<project> or superbuild root |
| Migration status updates | Consumer docs/migration/projects/<name>.md |
| Shared methodology change | Upstream superbuild-workflow first |
| Local exception (e.g. one project stays VS-only temporarily) | Document in consumer AGENTS.md with exit date |
| Submodule pin | Record in consumer commit message: chore: bump ai-rules to <sha> |
Team responsibilities
| Role | Responsibility |
|---|---|
| Workflow maintainers | superbuild-workflow docs, templates, adapters |
| Superbuild integrators | Submodule pin, presets, Conan workspace, CI |
| Project owners | Per-project CMake migration, parity validation |
| All developers | Use presets/Conan; stop editing .vcxproj for migrated projects |
Communication checklist
When submodule is introduced, announce:
- Path:
tools/ai-rules/ - Required reading:
AGENTS.md,docs/legacy-superbuild-migration.md - Local migration tracker:
docs/migration/ - Preset commands (once available)
- Rule: shared policy changes go upstream
Exit criteria (workflow integration complete)
-
tools/ai-rules/submodule present and pinned - Root
AGENTS.mdreferences shared policy and local migration docs - Cursor shared rules materialized; local overlay documented if any
- CI initializes submodules
- Team knows bump process for
tools/ai-rules/
This is independent of build migration complete (Phase 6) — integration can finish early in the program.
Related documents
- legacy-superbuild-migration.md — technical phases
- workflow.md — general submodule change flow
- governance.md — shared vs local ownership