This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/skills/multi-repository-projects.md

3.9 KiB

Multi-Repository Projects

Purpose

Coordinate projects that are built from multiple local git repositories, and make it possible for agents to combine them into one coherent project when needed.

Core Rule

The project-level memory tracks how repositories relate to each other. Each local repository tracks its own operational details in its own root AGENTS.md.

Required Project File

Every project with more than one repository must maintain:

projects/<project>/repositories.md

This file is the source of truth for:

  • repository names;
  • local paths;
  • remote URLs;
  • repository roles;
  • primary branches;
  • ownership boundaries;
  • integration points;
  • merge or migration plan;
  • open conflicts and risks.

Required Repository File

Every participating local repository should contain a root:

AGENTS.md

Use:

templates/repository-agents.md

as the standard template.

Repository-level AGENTS.md must answer:

  • What does this repository do?
  • Which project does it belong to?
  • Where is it located locally?
  • What commands build, test, run, and verify it?
  • What files and directories matter most?
  • What other repositories does it depend on?
  • What should agents update before handoff?

Agent Startup Procedure

When assigned to a multi-repository project:

  1. Read the global memory repository AGENTS.md.
  2. Read projects/<project>/repositories.md.
  3. For each relevant local repository, read its root AGENTS.md.
  4. Check git status in every repository before editing.
  5. Work only inside the repository or repositories relevant to the task.
  6. Record reusable findings globally in skills/, problems/, or locations/.
  7. Update project-level repositories.md when repository topology changes.

Combining Repositories

Before combining several repositories into one project:

  1. Identify the target repository or new parent repository.
  2. Decide whether to preserve git history.
  3. Define the destination path for each source repository.
  4. List expected file conflicts.
  5. List dependency and build changes.
  6. Back up or push all source repositories first.
  7. Perform the merge using a documented method.
  8. Verify build, tests, and runtime behavior.
  9. Update every affected AGENTS.md.
  10. Update projects/<project>/repositories.md.

Preferred Merge Strategies

Use one of these strategies based on the situation:

  • submodules: keep independent repositories with pinned commits.
  • subtree: import another repository into a subdirectory while preserving useful history.
  • monorepo migration: move multiple repositories into one repository with clear subdirectories.
  • workspace only: keep separate repositories locally, but document how they work together.

Do not flatten multiple repositories into one directory without a written plan.

Shared Local Git Server Permissions

When a project uses a shared local bare-repository host:

  • put bare repositories under one documented root, such as /srv/git;
  • use a shared Unix group for all project writers;
  • make the repository root group-writable and setgid;
  • use default ACLs for the shared group when available;
  • initialize new bare repos with git init --bare --shared=group;
  • set core.sharedRepository=group on existing bare repos;
  • verify read access with git ls-remote;
  • verify write access with git push --dry-run or a temporary test branch only when approved;
  • never store SSH passwords, private keys, or credential helper secrets in the knowledge base.

For the garage project, the current local Git server is 192.168.1.66:/srv/git, with machine users qore, wuu, pump, and airM1 in group stereowallnd.

Handoff Requirements

After changing repository topology:

  • update projects/<project>/repositories.md;
  • update root AGENTS.md inside affected local repositories;
  • update projects/<project>/agent-log.md;
  • record reusable merge knowledge in global skills/ or problems/;
  • commit and push all changed repositories that have remotes.