> For the complete documentation index, see [llms.txt](https://no0dles.gitbook.io/hammerkit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://no0dles.gitbook.io/hammerkit/task/dependencies.md).

# Dependencies

Every task can have list of dependencies. Those will be executed before and if any of them fails abort the all pending tasks. Dependencies can be chained as deep as needed, as long as there is no loop.

{% code title=".hammerkit.yaml" %}

```yaml
tasks:
  install:
    cmds:
      - npm install
      
  build:
    deps: [install]
    cmds:
      - tsc -b
  
  publish:
    deps: [build]
    cmds:
      - npm publish
```

{% endcode %}

## Dependencies run in parallel

Dependencies that don't depend on each other run **concurrently**, up to the `--concurrency` worker count (default `4`). In the example above `install` must finish before `build`, but if two branches of the graph are independent they execute at the same time. A dependency that fails stops the whole run; see [parallelism and exit codes](/hammerkit/cli.md#parallelism) in the CLI reference.

Referenced and included tasks are addressed with the `prefix:task` syntax in `deps`, for example `deps: [npm:install]`. See [references](/hammerkit/build-file/references.md) and [includes](/hammerkit/build-file/includes.md).

{% hint style="info" %}
Make sure to set up correct [caching](/hammerkit/task/caching.md) to speed up your execution and prevent unnecessary work.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://no0dles.gitbook.io/hammerkit/task/dependencies.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.
