# defineAugment

Canonical: https://auggy.dev/docs/define-augment
Status: Published
Package: auggy 0.5.0

Define a runtime capability that contributes tools, context, memory, transports, lifecycle, or policy to an agent.

## Shape

**Minimal custom augment**

```ts
import { defineAugment } from "auggy";

export default function customAugment() {
  return defineAugment({
    name: "custom",
    type: "custom",
    tools: [],
  });
}
```

**Auggy** infers the augment's runtime surfaces from concrete fields such as tools, httpRoutes, context, transport, memory, and lifecycle hooks. There is no separate capabilities declaration.

## Options

| Option | Use |
| --- | --- |
| name | Unique augment identifier within the agent. |
| type | custom for project-specific augments; built-ins use their catalog type. |
| tools | defineTool entries this augment exposes to the model. |
| httpRoutes | Optional advanced preview defineRoute entries served beside /agent/run. |
| context | Async function returning ContextBlock entries for the turn. |

## Ownership

- Use one augment per domain capability, not one augment per function.
- Keep related tools, schemas, skills, integration code, and policy close together.
- Add optional routes only when software needs a deterministic entry point into this capability.
- Use lifecycle hooks for boot validation and cleanup.
- Use config files for operator-owned settings and env references.

## Related

- [Build an augment](https://auggy.dev/docs/build-augment/markdown)
- [defineRoute](https://auggy.dev/docs/define-route/markdown)
- [defineTool](https://auggy.dev/docs/define-tool/markdown)