Install as a submodule
Home / Guides / Install as a submodule
This repository is designed to be consumed as a public core while your own repository keeps only local or private differences.
1. Add the public core
Section titled “1. Add the public core”From the root of your repository:
git submodule add https://github.com/trvny/.ai.git .ai/coremkdir -p .ai/generatedcp .ai/core/examples/profile.overlay.yaml .ai/profile.yamlpython -m pip install pyyaml jsonschemaCommit both .gitmodules and the .ai/core gitlink. The parent repository records an exact .ai commit, so clones are reproducible.
Recommended layout:
your-repo/└── .ai/ ├── core/ public submodule -> trvny/.ai ├── profile.yaml your overlay ├── private/ optional project/private material └── generated/ optional generated outputDo not edit files inside .ai/core to customize a consumer repository. Put local choices in the overlay or contribute reusable changes upstream.
2. Clone a repository that already uses it
Section titled “2. Clone a repository that already uses it”Either clone recursively:
git clone --recurse-submodules https://github.com/OWNER/REPO.gitor initialize the submodule after a normal clone:
git submodule update --init --recursiveIf .ai/core looks empty, this is usually the missing step.
3. Compose your profile
Section titled “3. Compose your profile”Later layers win:
python .ai/core/tools/merge_profile.py \ .ai/core/profiles/default.yaml \ .ai/profile.yaml \ --schema .ai/core/schema/style-profile.schema.json \ --output .ai/generated/profile.yamlA small overlay can contain only the values you want to change:
id: my-projectlocale: en-USpersonality: modifiers: concise: 2 warm: 2The schema validates the final composed profile, not each partial layer by itself.
4. Render instructions
Section titled “4. Render instructions”python .ai/core/tools/render_profile.py \ .ai/core/profiles/default.yaml \ .ai/profile.yaml \ --schema .ai/core/schema/style-profile.schema.json \ --output .ai/generated/instructions.txtUse --language en or --language pl to override the language inferred from the composed locale.
5. Update the pinned core
Section titled “5. Update the pinned core”git -C .ai/core fetch origingit -C .ai/core checkout maingit -C .ai/core pull --ff-onlygit add .ai/coregit commit -m "chore: update AI core"Updating a submodule is intentionally explicit. Your repository moves to a new core commit only when you commit the changed gitlink.
Most checkout actions do not fetch submodules unless asked. For GitHub Actions:
- uses: actions/checkout@v4 with: submodules: trueOnly enable this in jobs that actually need files from .ai/core.
What belongs where
Section titled “What belongs where”- reusable profiles, schemas, tools, templates, provider defaults, instructions and public skills ->
trvny/.ai - repository-specific behavior, identities, private workflow rules and private skills -> the consumer repository
- credentials and tokens -> environment variables or secret storage, never either repository
The point is one-way composition, not synchronization gymnastics: update the public core upstream, keep local differences downstream.