# Design patterns

How CloudForge suggests software design patterns while it writes code, and how to add your own.

Source: https://docs.trycloudforge.com/design-patterns

## How it works


For each request, CloudForge checks which patterns might help. When one fits, it uses the pattern's guidance for your language as it writes the code.


CloudForge knows these patterns:


| Kind | Patterns |
| --- | --- |
| Creational | Builder, factory, singleton alternatives, registry |
| Structural | Adapter, decorator, facade, repository |
| Behavioral | Chain of responsibility, command, observer, state, strategy, template method |
| Architectural | Dependency injection, plugin architecture |



## Add your own


Write a pattern your team uses as a Markdown file in `.cloudforge/patterns/<name>.md`. CloudForge considers it next to the built-in patterns.


To make CloudForge always follow a pattern, write a rule instead. See [Rules, skills and hooks](https://docs.trycloudforge.com/customizations).
