> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/v2-en/ai/skill.md).

# Skill

## @trustless-work/skill

[![skills.sh](https://skills.sh/b/trustless-work/trustlesswork-skill)](https://skills.sh/trustless-work/trustlesswork-skill)

Install AI skills and verify Trustless Work integrations directly from your terminal using Skills.sh.

***

## Installation

No global installation required.

Install the skill directly using:

```
npx skills add trustless-work/trustlesswork-skill
```

This automatically installs the Trustless Work skill into your supported AI agent.

***

## Skills.sh

The Trustless Work skill is distributed through Skills.sh:

* Skills Registry: <https://www.skills.sh/trustless-work>

Skills.sh provides a standardized ecosystem for installing reusable AI agent skills across different coding assistants.

***

## Why are Skills Useful?

### Without a skill

You repeatedly explain the same integration details in every conversation:

> "Trustless Work is an escrow protocol on Stellar..."

> "The deploy endpoint returns an unsigned XDR transaction..."

> "The user must sign it with their wallet..."

> "V2 roles are arrays, V1 roles are single addresses..."

This wastes time and often leads to integration mistakes.

***

### With a skill

The AI already understands all of this context.

You can immediately ask things like:

> "Generate the escrow deployment flow for my freelance marketplace."

And the assistant can produce accurate, idiomatic, production-ready code from the start.

Skills are especially useful for:

* Faster onboarding for new developers
* Reducing integration mistakes
* Maintaining consistency across projects
* Keeping AI assistants updated with the latest SDK/API changes

***

## The Trustless Work Skill

The Trustless Work Skill installs a curated knowledge base for building escrow integrations on Stellar using Trustless Work.

It teaches your AI assistant how to correctly integrate:

* Trustless Work REST API (V1 and Core API v2)
* `@trustless-work/escrow` (React SDK, 3.x for V1 and 5.x for V2)
* `@trustless-work/escrow-js` (framework-agnostic JS SDK, V2)
* `@trustless-work/blocks`

The skill includes architecture guidance, API references, integration patterns, lifecycle flows, and production best practices.

***

## Version awareness

The skill is **version-aware**. It knows both protocol versions and routes the assistant to the right one:

* **V1 is production and the default.** It is the only version deployed on mainnet.
* **V2 is beta and testnet-only.** The skill explains its contract semantics, the versioned `/v2/` API routes, and the beta SDKs — and tells the assistant to say V2 is beta every time it comes up.

Ask for a version explicitly ("integrate with V2 on testnet") or let the assistant default to V1 for production work.

***

## What the Skill Teaches the AI

The skill helps the AI understand critical implementation details such as:

* Every write operation returns an unsigned XDR transaction that must be signed by the correct wallet, then submitted — nothing reaches the chain until submission
* Trustline configuration: the API accepts the Soroban contract address (`C...`) **or** the issuer address (`G...`) plus symbol
* Trustlines must be added directly from the user's wallet
* Provider setup per SDK version: `<QueryClientProvider>` + `<TrustlessWorkConfig>` for the V1 SDK (3.x); the V2 SDK (5.x) needs only `<TrustlessWorkConfig>` — it has no TanStack Query dependency
* Milestone approvals are irreversible on-chain
* V2 role arrays, approval thresholds, and dispute reasons
* API rate limits and retry patterns
* Correct XDR signing workflows
* Recommended frontend architecture patterns
* Production integration checklists

***

## Supported AI Agents

Currently supported:

* Claude Code
* Gemini CLI

***

## Keeping the Skill Updated

To update installed skills to the latest version:

```
npx skills update
```

This refreshes all installed skill files and ensures your AI assistant stays aligned with the latest Trustless Work APIs and SDKs.

***

## Reviewing Your Integration

With the skill installed, you can ask your AI assistant to review an existing integration against the documented rules — for example:

> "Review my Trustless Work integration."

The assistant checks your codebase against what the skill teaches, including:

### REST API integrations

* API key usage
* Environment variable configuration
* Correct XDR signing and submission flows
* Proper base URLs for the version and network in use
* Rate limit handling

### SDK integrations (`@trustless-work/escrow`)

* Provider setup for the SDK version in use
* Wallet integration
* Payload shapes matching the escrow type and version
* Client component requirements


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/ai/skill.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
