# Code Ownership

## The What

Code ownership is **NOT** one person who owns a codebase. Instead, it refers to how we **collaborate** on a shared codebase.

## The How

### Prerequisites

* The team owns the codebase
* The team works in an agile way
* The team embraces risk and learns from failure
* The team doesn’t have a heavy and prescriptive process

### Create a supportive environment

* Recognise the assistance of other team members in achieving their goals
* Recognise the contributions to improve Dev Experience, even though it isn't visible&#x20;
* Recognise the patience to tackle tech debt
* An appropriate level of autonomy

### Narrow the ownership **when appropriate**

* In many cases, splitting ownership is not ideal, but it can help you tackle small, maintenance & repeated tasks. e.g.,
* Upgrade dependencies
* Approve PRs generated by [Renovate](https://github.com/renovatebot/renovate)
* Bake the duties in the development workflow&#x20;
* Keep track of who owns what in a shared document

## :white\_check\_mark: Exceptions

* It only works on the known challenge with a certain solution

## :red\_circle: Red Flags

* Don’t go too far down the track
* Code ownership may demotivate the team

## :scroll: Tips

* Recognise desirable behaviours, e.g., refactoring, patching, improving dev experience, tidying up, improving CI/CD pipelines, etc
* It's quite OK for product managers or stakeholders to be outcome-driven
* The tech lead should recognise the contributions made on the journey to their goal

## :hole: Pitfalls

* Simply establishing clear ownership will not help you build a high-performing team


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jamiewen00.gitbook.io/tech-lead-handbook/engineering/code-ownership.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
