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

# Migrating from templates

> What changed when Hugs moved from templates to hugs, and how to update agents, teams and scripts.

Hugs

Hugs used to name a **template** (`form@1`, `approval@1`) drawn by the Hub, the CLI and cliq-sdk. Now every Hug is asked
with a **hug** — a page with a definition — and `form` and `approval` are hugs that ship with cliq. Most teams need
no change.

There is no backward compatibility: update cliq, CliqHub and your agents together.

***

## Agent code

```ts theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
// Before
const answer = await ctx.ask({ template: 'form', title, params: { prompt, inputs } });
answer.values.name;

// Now
import { form } from '@getcliqio/cliq-sdk/hugs';
const answer = await ctx.ask(form, { title, params: { prompt, inputs } });
answer.value.name;          // `values` still works
```

* **The hug is the first argument** — its definition, its name, or nothing (the phase's `hug.name`, else `form`).
  `template` is refused with `HugRefusedError`, which shows how to write it now.
* **Every answer is checked** against the hug's definition before your code sees it.
* `ctx.attach(paths)` replaces passing artifact blocks for the page to show: it returns `attachments` for `ctx.ask`.
* Rebuild agents that bundle cliq-sdk.

## `team.yml`

* **Nothing changes for `form` and `approval`.**
* The gate's **`review.template_params`** is now **`review.params`** (`approve_label`, `reject_label`,
  `show_comment`); `template_params` is refused as an unknown key.
* A phase may name a hug: `hug: { name: review-batch }`.

## LLM phases

Unchanged with `form`. A phase with another hug tells the model about it ([Using hugs](https://docs.getcliq.io/hugs/using-hugs.md#in-llm-and-cli-phases)).

## Answering

* **On CliqHub**, the response is drawn by the Hug's hug, in a frame. After you answer, the page shows your answer as
  sent, with **Change answer**. Someone who can see a Hug but wasn't sent it sees the responses, not a form.
* **Locally**, `cliq run` no longer asks in the terminal: it opens cliqd's Hug page in your browser (`--no-open` to
  print the link). Scripts answer with cliqd's `hugs/respond` ([Troubleshooting](https://docs.getcliq.io/hugs/troubleshooting.md#answering-without-a-browser)).

## Hugs open during the switch

Open Hugs asked with a template are **cancelled** when CliqHub and cliqd update, and their requesters see
`cancelled` — finish or pause them before you update. Past Hugs keep their responses, shown as plain key-values.


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