What are Triks?
Triks are secure, typed skills for AI agents.
Think of them as npm packages for agent capabilities - but designed from the ground up for security and composability.
Skills, Not Just Tools
A Trik isn’t a simple function. It’s a complete skill that can:
- Handle complex workflows - Multi-step operations, retries, error handling
- Maintain state - Sessions track context across conversation turns
- Integrate deeply - Full access to external APIs, databases, services
- Self-describe - Actions, schemas, and capabilities declared in a manifest
Traditional Tool: search(query) → results
Trik: search(query) → session-aware, secure, templated response
details(reference) → resolves "the first one" using history
list() → returns all previous resultsAgents Inside Agents
The most powerful triks are themselves agents:
Your Agent
└── Calls: @publisher/research-assistant (a Trik)
└── Calls: external APIs, LLMs, other triks
└── Returns: safe agentData + userContentThe framework handles:
- Scalability - Resource limits, timeouts, execution constraints
- Security - Output validation, type enforcement, channel separation
- Distribution - Versioning, discovery, installation
The Manifest
Every Trik has a manifest.json that declares its contract:
{
"id": "@publisher/my-trik",
"name": "My Trik",
"version": "1.0.0",
"actions": {
"search": {
"description": "Search for items",
"responseMode": "template",
"inputSchema": { ... },
"agentDataSchema": { ... }
}
}
}The manifest tells the host agent:
- What actions are available
- What inputs each action expects
- What the agent will receive back
- How responses should be formatted
Response Modes
Triks support two response modes:
Template Mode
Agent receives structured data. A template formats the user response.
Agent sees: { "count": 3, "topic": "AI" }
User sees: "Found 3 articles about AI."Best for: Search results, confirmations, structured operations.
Passthrough Mode
Content goes directly to user. Agent only knows delivery happened.
Agent sees: "Content delivered to user"
User sees: [Full article content]Best for: Articles, documents, any untrusted content.
How Distribution Works
- Publishing uses GitHub releases - no proprietary storage
- Registry is a metadata index - discovery, versioning, stats
- Installation fetches directly from GitHub
Example Triks
| Trik | Purpose |
|---|---|
@molefas/trik-article-search | Search, list, and display articles |
Next Steps
- Core Concepts - Manifest, security, sessions
- Using Triks - Install and run triks
- Creating Triks - Build your own