> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reduce tech debt

> Scan for vulnerabilities, stale TODOs, and refactoring opportunities on a schedule.

Tembo periodically analyzes your codebase to find technical debt, security vulnerabilities, and refactoring opportunities, then submits [PRs](https://docs.tembo.io/features/pull-requests.md) for quick wins.

## How it works

**1. Scheduled scan**

An [agent](https://docs.tembo.io/features/agents.md) runs on a schedule (daily, weekly, or monthly) and scans your codebase for issues.

**2. Issues identified**

The agent finds stale TODOs, security vulnerabilities, outdated dependencies, duplicated code, and other debt.

**3. PRs submitted**

For quick wins, the agent opens PRs with fixes. For larger issues, it creates tickets in [Linear](https://docs.tembo.io/integrations/linear.md) or [Jira](https://docs.tembo.io/integrations/jira.md) with implementation plans.

## Set up a tech debt agent

### Security vulnerability scan

**Trigger**: Daily or weekly
**[MCP Servers](https://docs.tembo.io/integrations/mcp.md)**: [GitHub](https://docs.tembo.io/integrations/github.md), [Linear](https://docs.tembo.io/integrations/linear.md)

```text theme={null}
Scan the codebase for:
- SQL injection vulnerabilities
- XSS vulnerabilities
- Hardcoded secrets or credentials
- Authentication and authorization flaws

Create Linear tickets for each finding with severity ratings.
Generate fix PRs for critical issues.
```

[Browse all templates →](https://tembo.io/for)

### Stale TODO cleanup

**Trigger**: Weekly
**[MCP Servers](https://docs.tembo.io/integrations/mcp.md)**: [GitHub](https://docs.tembo.io/integrations/github.md)

```text theme={null}
Find all TODO, FIXME, and HACK comments in the codebase.
For each one that's older than 30 days:
1. Determine if it's still relevant
2. If it's a quick fix, open a PR to resolve it
3. If it needs discussion, create an issue
```

### Dependency updates

**Trigger**: Monthly
**[MCP Servers](https://docs.tembo.io/integrations/mcp.md)**: [GitHub](https://docs.tembo.io/integrations/github.md)

```text theme={null}
Check for outdated dependencies.
For each outdated package:
1. Check the changelog for breaking changes
2. Update the dependency
3. Run tests to verify compatibility
4. Open a PR with a summary of changes
```

## Best practices

* **Start weekly**: Run scans weekly to build a habit of reviewing and merging debt-reduction PRs.
* **Prioritize security**: Set security scans to run more frequently than cosmetic cleanup.
* **Scope by directory**: Focus on one area of your codebase at a time rather than scanning everything at once.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.