Project Structure

A Trik is a self-contained directory with a manifest and an agent implementation.

Minimal Structure

Conversational Mode

my-trik/ ├── manifest.json # Contract and configuration (schemaVersion: 2) ├── system-prompt.md # System prompt for the agent ├── src/ │ └── index.ts # Implementation (source) ├── dist/ │ └── index.js # Compiled output (must be committed) ├── package.json # Dependencies └── tsconfig.json # TypeScript configuration

Tool Mode

my-trik/ ├── manifest.json # Contract and configuration (schemaVersion: 2) ├── src/ │ └── index.ts # Implementation (source) ├── dist/ │ └── index.js # Compiled output (must be committed) ├── package.json # Dependencies └── tsconfig.json # TypeScript configuration

Tool-mode triks don’t need a system prompt file since they don’t run an LLM agent.

Files

manifest.json (required)

The contract that defines your Trik’s agent configuration, tools, and entry point. This is the most important file — it tells the gateway everything it needs to know about your trik.

See Writing the Manifest for the full specification.

Agent implementation (required)

src/index.ts — must export an agent object created via wrapAgent() (from @trikhub/sdk) for conversational mode or wrapToolHandlers() for tool mode.

The compiled output at dist/index.js is what the gateway loads at runtime. See Building the Agent for details.

system-prompt.md (conversational mode)

The system prompt file for conversational triks. Referenced in the manifest via agent.systemPromptFile. This file defines the personality, instructions, and boundaries for your agent’s LLM.

You are an article search assistant. You help users find and explore articles. ## Capabilities - Search for articles by topic - Retrieve article details - Provide summaries ## Guidelines - Always be helpful and concise - When you can't find results, suggest alternative search terms - Transfer back to the main agent when the user's request is outside your domain

trikhub.json (publishing only)

Registry metadata used when publishing. This is not required for development or testing — only for trik publish. Lives at the repo root.

{ "displayName": "My Trik", "shortDescription": "What this trik does", "categories": ["utilities"], "keywords": ["my-trik"], "author": { "name": "Your Name", "github": "yourusername" }, "repository": "https://github.com/yourusername/my-trik" }

See Publishing for how this is used.

package.json / pyproject.toml (required)

Standard package.json dependency file. Your trik will typically depend on @trikhub/sdk and, for conversational mode, on @langchain/anthropic, @langchain/langgraph, and @langchain/core.

dist/ directory (TypeScript only, must be committed)

Compiled JavaScript output. The entry.module path in your manifest points here (e.g., ./dist/index.js). This directory must be committed to git — the registry references your code via git tags, so it needs the compiled output in the repo.


Next: Learn about Writing the Manifest.