Adds composio-sdk/ with SKILL.md, AGENTS.md, and 18 rule files covering Tool Router, direct execution, triggers, and auth patterns. Source: composiohq/skills Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.0 KiB
3.0 KiB
title, impact, description, tags
| title | impact | description | tags | ||||
|---|---|---|---|---|---|---|---|
| Enable Auto Authentication in Chat | HIGH | Allow users to authenticate toolkits directly within chat conversations |
|
Enable Auto Authentication in Chat
Enable manageConnections to allow users to authenticate toolkits on-demand during agent conversations.
❌ Incorrect
// DON'T: Disable connection management for interactive apps
const session = await composio.create('user_123', {
toolkits: ['gmail'],
manageConnections: false // User can't authenticate!
});
// Agent tries to use Gmail but user isn't connected
// Tool execution will fail with no way to fix it
# DON'T: Disable connection management for interactive apps
session = composio.tool_router.create(
user_id="user_123",
toolkits=["gmail"],
manage_connections=False # User can't authenticate!
)
# Agent tries to use Gmail but user isn't connected
# Tool execution will fail with no way to fix it
✅ Correct
// DO: Enable connection management for interactive apps
import { Composio } from '@composio/core';
const composio = new Composio();
const session = await composio.create('user_123', {
toolkits: ['gmail', 'slack'],
manageConnections: true // Users can authenticate in chat
});
// When agent needs Gmail and user isn't connected:
// 1. Agent calls COMPOSIO_MANAGE_CONNECTIONS tool
// 2. User receives auth link in chat
// 3. User authenticates via OAuth
// 4. Agent continues with Gmail access
# DO: Enable connection management for interactive apps
from composio import Composio
composio = Composio()
session = composio.tool_router.create(
user_id="user_123",
toolkits=["gmail", "slack"],
manage_connections=True # Users can authenticate in chat
)
# When agent needs Gmail and user isn't connected:
# 1. Agent calls COMPOSIO_MANAGE_CONNECTIONS tool
# 2. User receives auth link in chat
# 3. User authenticates via OAuth
# 4. Agent continues with Gmail access
Advanced: Custom Callback URL
// Configure custom callback for OAuth flow
const session = await composio.create('user_123', {
toolkits: ['gmail'],
manageConnections: {
enable: true,
callbackUrl: 'https://your-app.com/auth/callback'
}
});
# Configure custom callback for OAuth flow
session = composio.tool_router.create(
user_id="user_123",
toolkits=["gmail"],
manage_connections={
"enable": True,
"callback_url": "https://your-app.com/auth/callback"
}
)
How It Works
- Agent detects missing connection for a toolkit
- Agent automatically calls meta tool
COMPOSIO_MANAGE_CONNECTIONS - Tool returns OAuth redirect URL
- User authenticates via the URL
- Agent resumes with access granted