Contents
- Purpose and scope
- Repository topology and ownership
- Branch model —
feature → staging → main - Worktree-per-Branch (WTPB) convention
- Promotion workflow — owner-controlled
- Inter-agent handoff protocol
- komiti_academy submodule lifecycle
- Code change discipline
- Testing and rollout
- Definition of Done
- Where the rules live
1) Purpose and scope
This handbook is the single source of truth for how KomITi engineering work is organised — branches, worktrees, promotion path, deploy responsibility, and inter-agent communication. It binds every contributor, human or AI agent, who touches any KomITi repository.
The handbook does not teach Git or VS Code from zero — that is the job of tutorial 02: Git & VS Code Basics. It also does not document any single Odoo module, infrastructure stack, or product feature. Instead, it codifies the operating rules that all of those activities follow.
ENGINEERING_HANDBOOK.md at the repo root. That stub exists only to point agents and developers at this Academy page. The canonical content lives here; the stub is a redirect, not a copy. If the two ever disagree, this Academy page wins.
The handbook draws on three on-repo sources, each of which remains authoritative for its own scope:
.github/copilot-instructions.md— global rules per repository (agent ownership, branch model, working-tree convention, Definition of Done)..github/instructions/INTER_AGENT_HANDOFF.instructions.md— the unified handoff block format..github/skills/delivery-workflow/SKILL.md— the operational commands (branch creation, localhost runtime prep, promotion, deploy, smoke-test).
2) Repository topology and ownership
2.1) The four KomITi repositories
The KomITi engineering workspace contains four repositories, each with a distinct role:
| Repository | Container on disk | Role |
|---|---|---|
odoo4komiti | C:\dev\KomITi\odoo4komiti | KomITi product stack — Odoo custom addons, infra (Terraform / Docker), runbooks, deploy. |
odoo4komiti4etn | C:\dev\KomITi\odoo4komiti4etn | ETN-tenant deploy of the same Odoo stack — owner-controlled DEV/PROD delivery. |
komiti_academy | C:\dev\KomITi\komiti_academy | Tutorial content — the HTML pages you are reading right now. |
komiti_library | C:\dev\KomITi\komiti_library | Training playground for newcomers — safe place to practise Git, branches, and basic Odoo modules. |
2.2) Agent ownership and authority
Each repository has a designated owner agent. The owner is the only agent allowed to promote into staging or main, or to run deploy workflows on the corresponding environments.
| Repository | Owner agent | Other agents may… |
|---|---|---|
odoo4komiti | odoo4komiti | work in their own feature branches; deliver via handoff. |
odoo4komiti4etn | Etn | not promote or deploy without owner action. |
komiti_academy | Academy | n/a — Academy is the only writer for tutorial content. |
komiti_library | (no agent — human-only) | n/a — this is a training repo. |
staging / main, or run deploy workflows. Those are the owner’s reserved actions.
2.3) Every repository needs a custom agent
KomITi prescribes that every repository that holds engineering work must have a custom agent declared in .github/agents/*.agent.md. The rationale:
- Clear ownership. The
.agent.mdfile declares who may push where. When multiple agents share a multi-root workspace, each one knows its boundaries — no accidental cross-repo pushes or unauthorized promotions. - Consistent team identity. Every agent speaks the same language (Serbian Cyrillic by default), follows the same commit discipline, and applies the same Definition of Done.
- Predictable handoffs. When
@Academyfinishes a tutorial edit, it hands off to@odoo4komitiinstead of pushing to production. This boundary is documented in each agent’s Constraints section. - Tool safety. A content agent does not need terminal access. A deploy agent does not need notebook tools. The
toolsarray enforces least privilege.
To be KomITi-compliant, every custom agent must include at least these elements:
| # | Element | Why mandatory |
|---|---|---|
| 1 | Frontmatter: name | Defines the @mention identifier. Without it the agent cannot be invoked. |
| 2 | Frontmatter: description | VS Code uses this for agent routing. A missing description means the agent will not appear in the picker. |
| 3 | Frontmatter: tools | Restricts agent capabilities to what it actually needs (least privilege). |
| 4 | Identity section | Declares the agent name, default language, and ownership boundary (which branches/repos it may push to). |
| 5 | Scope section | Lists what the agent works on — prevents scope creep and guides the router. |
| 6 | Constraints section | Rules the agent must follow: which instruction files to read, what it must not do (e.g. “do not push to main”), handoff protocol. |
A minimal KomITi-compliant agent file looks like this:
---
name: MyProjectAgent
description: "Use for development work in the my-project repository."
tools: [read, edit, search, todo]
user-invocable: true
---
You are **MyProjectAgent** — the designated agent for the `my-project` repository.
## Identity
- Always identify yourself as `MyProjectAgent`.
- Respond in Serbian Cyrillic by default.
- You may push to feature branches only. Hand off to the
repo owner for promotion to `staging` and `main`.
## Scope
- Python module development in `src/`.
- Unit tests in `tests/`.
- Documentation updates in `docs/`.
## Constraints
- Follow `.github/copilot-instructions.md` for all repo-level rules.
- One commit = one logical unit.
- Update the relevant instruction file when workflow rules change.
- Do not deploy — prepare a HANDOFF block instead.
.agent.md files are committed to the repository. Agent definitions are version-controlled, reviewable, and shared across the team — unlike personal VS Code settings that live only on one machine.
.github/agents/Academy.agent.md and .github/agents/odoo4komiti.agent.md for full KomITi examples.
3) Branch model — feature → staging → main
3.1) The three permanent branches
Every KomITi repository follows the same three-branch model, taken from Vincent Driessen’s Git Flow (2010) and adapted to a single integration branch:
main— the protected production branch. Reflects what runs in production. Direct commits are forbidden. Only the owner agent may merge here, and only via the promotion path.staging— the canonical integration branch. All feature branches are merged here first; staging is what the local runtime, the DEV server, and the smoke tests verify before anything reachesmain.feature/…— short-lived working branches. One feature branch = one logical change. Created from the currentorigin/main, merged intostaging, then promoted tomain.
prod (e.g. odoo-prod, etn-prod). Only the Git production branch is called main. Do not conflate the two.
3.2) Feature branch naming rule
Feature branches use the rule:
YYYY-MM-DD-<agent-or-developer>-feature_name
YYYY-MM-DD— today’s date (the date the branch was created fromorigin/main).<agent-or-developer>— agent slug (Academy,odoo4komiti,Etn,Designer) or human developer name (e.g.Marko,Sara).feature_name— short underscore-separated label for the change.
Examples:
2026-05-17-Academy-07_engineering_handbook— Academy agent authoring tutorial 07 on 17 May 2026.2026-05-14-Sara-fix_login_css— developer Sara fixing the login CSS.2026-05-15-Marko-add_invoicing_report— developer Marko adding a new invoicing report.
4) Worktree-per-Branch (WTPB) convention
On the real KomITi repositories (odoo4komiti, odoo4komiti4etn, komiti_academy) a feature branch is not started with git checkout -b inside the protected main worktree. Instead, each branch lives in its own folder on disk, side by side with main. The folder name equals the branch name exactly.
Why WTPB — two concrete benefits:
- The active branch is unambiguous from Windows Explorer alone. The folder name is the branch name — no need to run
git branch --show-currentto know what you are editing. - Multiple agents or developers work in parallel without disturbing the protected worktrees. The
main\andstaging\folders are reserved for promotion, deploy, and reference builds; they must always sit cleanly on their respective branches. Side-by-side feature folders mean nobody has togit checkoutinmain\orstaging\to look at someone else’s work.
The full hands-on walk-through — worktree commands, VS Code multi-root setup, what you should notice in Source Control and the Status Bar — lives in tutorial 02, section 4.6.4. This handbook only fixes the rule; the tutorial teaches the mechanics.
komiti_library the plain git checkout -b flow is still correct — the training repo deliberately keeps things simple.
Worktree commands you will use most often:
PS C:\dev\KomITi\odoo4komiti\main> git fetch origin
PS C:\dev\KomITi\odoo4komiti\main> git worktree add -b 2026-05-14-Sara-fix_login_css C:\dev\KomITi\odoo4komiti\2026-05-14-Sara-fix_login_css origin/main
PS C:\dev\KomITi\odoo4komiti\main> git worktree list
PS C:\dev\KomITi\odoo4komiti\main> git worktree remove --force C:\dev\KomITi\odoo4komiti\2026-05-14-Sara-fix_login_css
5) Promotion workflow — owner-controlled
5.1) The promotion path
Every change reaches production along the same path:
- Work in a feature branch + worktree — commit and push freely.
- Verify the change locally at the appropriate level (file render, module install/upgrade, runtime smoke).
- Send a handoff (section 6) to the owner agent.
- Owner fetches the feature branch, reviews the diff, reruns the narrowest relevant validation.
- Owner promotes
feature → staging, deploys to DEV if applicable, smoke-tests. - Owner promotes
staging → main, deploys to PROD if applicable, smoke-tests. - Owner confirms close-out (echoing the HANDOFF ID). Only then may the feature worktree and branch be cleaned up.
5.2) What a non-owner agent may and may not do
| Action | Non-owner agent | Owner agent |
|---|---|---|
Create a feature branch + worktree from origin/main | Yes | Yes |
Edit files, commit, push the feature branch to origin | Yes | Yes |
Merge a feature branch into staging or main | No | Yes |
Push directly to staging or main | No | Yes (with care) |
| Run deploy workflows targeting DEV / PROD | No | Yes |
| Upgrade Odoo modules, restart services, clear runtime caches | No | Yes |
| Delete the feature branch or worktree | Only after owner confirms close-out | Yes |
5.3) Pull requests vs handoff
Pull requests are optional review artifacts. They are useful when a human reviewer wants a GitHub-side diff with comments. They do not replace:
- the handoff block,
- the owner’s review of the diff in their own worktree,
- the owner’s control over when promotion actually happens,
- or the runtime verification on the target environment.
A merged PR does not mean “done”. Done is defined in section 10.
6) Inter-agent handoff protocol
Agents do not push to each other’s repos directly. They do not assume the other agent has context from a previous conversation. The only mechanism for cross-agent coordination is the unified HANDOFF block, relayed through the user.
6.1) The unified HANDOFF block
Every handoff between agents MUST use this single fenced block (one-click-copy):
HANDOFF ID: <from-agent>-YYYYMMDD-NN
FROM: <agent or repo that produced the change>
TO: <agent or repo that consumes it>
BRANCH: <branch name>
COMMIT: <short SHA or "uncommitted">
SOURCE: <canonical source file or "no direct source">
FILES: <list of changed files, one per line>
DELTA: <1-2 sentence summary of what changed>
STYLING: yes | no | n/a
ALIGN OK: verified | not checked | n/a
ODOO CSS: not needed | needed (<reason>) | n/a
ACTION: <numbered list - every step the receiving side must execute>
Field notes:
SOURCE— the canonical source file the change derives from, orno direct sourceif content was created in-session. For non-tutorial work usen/a.STYLING/ALIGN OK/ODOO CSS— tutorial QA fields. Set all three ton/awhen the change is not an HTML tutorial.- All other fields are always required.
6.2) HANDOFF ID rules
- Format:
<from-agent>-YYYYMMDD-NN— e.g.komiti_academy-20260517-02. NNis a 2-digit counter for that sender on that date, starting at01.- Every new handoff gets a new
HANDOFF ID. Revisions to the same work item create a new handoff with a new ID — never silently reuse an older ID for changed content. - The receiver MUST echo the
HANDOFF IDin status updates, verification notes, and close-out messages, so both sides can track exactly which handoff was executed. - Do not use a bare counter like
docs_agent-7; the date is mandatory.
6.3) ACTION field rules
ACTION must be a complete, ordered checklist — not a vague hint. Include every step required to close the loop:
- Git operations — commit, push, submodule update, merge.
- File sync — copy artifacts to their deploy-side location (e.g.
custom-addons/komiti_web/static/tutorials/en/). - Runtime verification — restart containers, clear assets, confirm UI.
- Promotion / deploy — if the change is ready for staging or prod, state the promotion path explicitly (e.g. merge to staging → merge to main → deploy prod).
- Downstream notification — if another agent or repo is affected, state who and what they need to do.
If a step is not needed, omit it. Never write “deploy if needed” — either include the concrete deploy steps or leave them out.
7) komiti_academy submodule lifecycle
Tutorial HTML lives in two places, and the relationship between them is the most common source of confusion for new contributors:
- Active working copy —
C:\dev\KomITi\komiti_academy\main(standalone clone ofKomITidoo/komiti_academy). Academy agent edits here. - Deployment-side reference —
C:\dev\KomITi\odoo4komiti\staging\komiti_academy(Git submodule, pinned to a specific commit). The Odoo runtime reads through this.
The two are not magically in sync. After a push to KomITidoo/komiti_academy, the submodule needs an explicit update:
PS C:\dev\KomITi\odoo4komiti\staging> git submodule update --remote komiti_academy
custom-addons/ and third-party-addons/. The submodule itself is not served. Tutorial HTML files must be copied into custom-addons/komiti_web/static/tutorials/en/ for Odoo to actually serve them. The deploy-side copy step is part of every Academy → odoo4komiti handoff.
End-to-end flow for an Academy tutorial change:
- Academy edits in
C:\dev\KomITi\komiti_academy\<feature-branch>\tutorials\. - Academy commits, pushes feature branch, merges into
main, pushesmain. - Academy sends HANDOFF block with commit SHA + file list to
odoo4komitiagent. odoo4komitirunsgit submodule update --remote komiti_academy.odoo4komiticopies the changed HTML file(s) intocustom-addons/komiti_web/static/tutorials/en/.odoo4komiticommits the submodule pointer + copied artifacts inodoo4komiti.odoo4komitipromotes throughstaging → main, deploys, restarts Odoo, smoke-tests the tutorial in the browser.odoo4komitiechoes the HANDOFF ID as close-out; only then does Academy clean up its feature worktree.
8) Code change discipline
8.1) One commit, one logical unit
- Fix the root cause, not the symptom. A patch that hides the symptom but leaves the underlying bug in place is not finished work.
- One commit = one logical unit. No unrelated changes piggy-backing on the same commit (no “while I was there I also reformatted X”).
- If a failed attempt needs retry, roll back the agent’s changes first. Restore the last known good state before trying again. Do not pile fixes on top of broken state.
8.2) Retry / rollback matrix
| Failure scope | What to restore before retry |
|---|---|
| Repo-only failure (code, HTML, config not yet deployed) | Roll back the agent’s local file changes; retry from last known good Git state. |
| Localhost runtime failure (module install/upgrade, container restart) | Restore the affected runtime layer (db, filestore, assets, containers) before retry — not just source code. |
| Deploy / infra failure (DEV / PROD) | Do not improvise. Follow the canonical RUNBOOK procedure and confirm runtime state before the next attempt. |
Rollback scope must match failure scope. Do not revert unrelated user changes when the failure was narrow.
9) Testing and rollout
- Functional test of the affected flow is mandatory before merge or deploy. “It builds” is not a test.
- Post-deploy smoke test is mandatory. A merged PR or a green CI run is not proof that the change works on the target environment.
- Merge does not equal deploy. Odoo runtime verification on the relevant environment (localhost, DEV server, or PROD server) is a separate step and is mandatory.
10) Definition of Done
A task is finished only when all of these are true:
- Root cause is addressed, not just the symptom.
- The affected flow has been locally verified at the appropriate level.
- If there is a runtime effect, runtime state has been confirmed (module upgrade, container restart, assets cleared, health checks green, UI flow walked end-to-end).
- Documentation has been updated in the relevant instruction file whenever the workflow or operational rules changed.
- The final report includes outcome, delta, and next step.
- No leftover agent artifacts in the workspace (stale worktrees, stale branches, temp files, half-applied patches).
11) Where the rules live
This handbook is the canonical narrative. The machine-readable rules live in the repositories themselves — that is what each agent loads at the start of every session. A KomITi repository organises them under .github/ as follows:
The table below summarises what each of these files contains. applyTo is the glob pattern that triggers automatic loading; on-demand files are loaded when their description matches the current task.
| File | Loads | Scope and content |
|---|---|---|
.github/copilot-instructions.md | always | Global rules per repository: agent ownership, language, branch model, working-tree convention, retry/rollback matrix, Definition of Done, navigation index to scoped files. |
.github/agents/*.agent.md | on @mention | Canonical, versioned agent definitions (Academy, odoo4komiti, Etn, Designer, Explore). Identity, scope, constraints, tool restrictions. |
.github/instructions/odoo.instructions.md | custom-addons/** | Odoo development discipline: change-type matrix, localhost vs remote runtime diagnosis, post-change sequence (pull → upgrade → restart → hard refresh), readable URLs. |
.github/instructions/terraform.instructions.md | infra/** | Terraform / AWS discipline: plan before every apply; state and secrets never in git; DEV and PROD workflows; inventory / scaling / pause-resume scripts. |
.github/instructions/komiti_timesheet.instructions.md | komiti_timesheet/** | Per-module rules: file map, lock-date consistency, upgrade command, UI smoke test. |
.github/instructions/komiti_gantt.instructions.md | komiti_gantt/** | Per-module rules: file map (Python + OWL JS + QWeb + SCSS), behaviour rules, search-bar defaults, cross-module styling alignment, UI smoke test. |
.github/instructions/INTER_AGENT_HANDOFF.instructions.md | crewai_orchestration/** + on-demand | The unified HANDOFF block format (section 6): FROM, TO, BRANCH, COMMIT, FILES, DELTA, ACTION; ACTION field rules; direction matrix; receiving-agent confirmation protocol. |
.github/skills/delivery-workflow/SKILL.md | on-demand | Operational commands: feature-branch creation, localhost runtime prep, promotion, deploy, smoke-test. |
infra/aws/odoo-dev-ec2-compose/RUNBOOK.md | n/a (human reference) | DEV server runbook (deploy, restart, smoke-test). |
infra/aws/odoo-prod-ec2-compose/RUNBOOK.md | n/a (human reference) | PROD server runbook. |
ENGINEERING_HANDBOOK.md (repo root) | n/a (human reference) | Short stub pointing at this Academy page. The stub is a redirect, not a copy. |
For terminology and per-command reference see tutorial 99: Cheat Sheet & Glossary. For the hands-on Git and VS Code mechanics that this handbook assumes, see tutorial 02: Git & VS Code Basics.