Communitygithub.com

SamuelChien/mega-skills-collection

Infraestrutura de e-mail para agentes de IA. Crie contas, envie/receba e-mails, gerencie webhooks e verifique o saldo de karma através da API AgentMail.

O que é mega-skills-collection?

Esta skill fornece uma infraestrutura de e-mail completa e programática para agentes de IA, usando a API REST do AgentMail. Com ela, agentes podem criar contas de e-mail reais no domínio `@theagentmail.net`, enviar e receber mensagens, e gerenciar a caixa de entrada de forma automatizada. A skill é ideal para fluxos que exigem cadastro em serviços (como GitHub, AWS ou Slack), recebimento de códigos de verificação, ou comunicação transacional com humanos. Além disso, oferece um sistema de karma para controlar o uso e prevenir spam: cada ação (criar conta, enviar e-mail) consome karma, enquanto receber respostas de domínios confiáveis ou excluir contas recupera pontos. A skill também suporta webhooks para processamento em tempo real de e-mails recebidos, com verificação de assinatura HMAC-SHA256 para segurança. Inclui um SDK em TypeScript para integração mais elegante e exemplos práticos de padrões comuns, como assinar serviços e aguardar e-mails de verificação ou respostas. É compatível com agentes que usam REST API ou SDK em TypeScript/JavaScript, e o código-fonte da skill está disponível no repositório 'SamuelChien/mega-skills-collection'.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/agentmail

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

AgentMail — E-mail para Agentes de IA

O AgentMail fornece endereços de e-mail reais (@theagentmail.net) para agentes de IA com uma API REST. Agentes podem enviar e receber e-mails, cadastrar-se em serviços (GitHub, AWS, Slack, etc.) e obter códigos de verificação. Um sistema de karma previne spam e mantém a reputação do domínio compartilhado elevada.

URL Base: https://api.theagentmail.net

Quando Usar

  • Um agente de IA precisa de uma caixa de entrada/saída real para cadastros, fluxos de verificação ou comunicação transacional.
  • Você precisa provisionar contas AgentMail, enviar mensagens, ler o conteúdo da caixa de entrada ou registrar webhooks de recebimento.
  • Você precisa monitorar o uso de karma ou conectar eventos de e-mail na automação do agente.

Início Rápido

Todas as requisições exigem o cabeçalho Authorization: Bearer am_... (chave de API do dashboard).

Criar uma conta de e-mail (-10 karma)

curl -X POST https://api.theagentmail.net/v1/accounts \
  -H "Authorization: Bearer am_..." \
  -H "Content-Type: application/json" \
  -d '{"address": "[email protected]"}'

Resposta: {"data": {"id": "...", "address": "[email protected]", "displayName": null, "createdAt": 123}}

Enviar e-mail (-1 karma)

curl -X POST https://api.theagentmail.net/v1/accounts/{accountId}/messages \
  -H "Authorization: Bearer am_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["[email protected]"],
    "subject": "Olá do meu agente",
    "text": "Corpo em texto simples",
    "html": "<p>Corpo HTML opcional</p>"
  }'

Campos opcionais: cc, bcc (arrays de string), inReplyTo, references (strings para encadeamento), attachments (array de {filename, contentType, content} onde content é base64).

Ler caixa de entrada

# Listar mensagens
curl https://api.theagentmail.net/v1/accounts/{accountId}/messages \
  -H "Authorization: Bearer am_..."

# Obter mensagem completa (com corpo e anexos)
curl https://api.theagentmail.net/v1/accounts/{accountId}/messages/{messageId} \
  -H "Authorization: Bearer am_..."

Verificar karma

curl https://api.theagentmail.net/v1/karma \
  -H "Authorization: Bearer am_..."

Resposta: {"data": {"balance": 90, "events": [...]}}

Registrar webhook (recebimento em tempo real)

curl -X POST https://api.theagentmail.net/v1/accounts/{accountId}/webhooks \
  -H "Authorization: Bearer am_..." \
  -H "Content-Type: application/json" \
  -d '{"url": "https://my-agent.example.com/inbox"}'

As entregas do webhook incluem dois cabeçalhos de segurança:

  • X-AgentMail-Signature -- digest HMAC-SHA256 em hexadecimal do corpo da requisição, assinado com o segredo do webhook
  • X-AgentMail-Timestamp -- timestamp em milissegundos do momento do envio

Verifique a assinatura e rejeite requisições com timestamp mais antigo que 5 minutos para evitar ataques de repetição:

import { createHmac } from "crypto";

const verifyWebhook = (body: string, signature: string, timestamp: string, secret: string) => {
  if (Date.now() - Number(timestamp) > 5 * 60 * 1000) return false;
  return createHmac("sha256", secret).update(body).digest("hex") === signature;
};

Baixar anexo

curl https://api.theagentmail.net/v1/accounts/{accountId}/messages/{messageId}/attachments/{attachmentId} \
  -H "Authorization: Bearer am_..."

Retorna {"data": {"url": "https://signed-download-url..."}}.

Referência Completa da API

MétodoCaminhoDescriçãoKarma
POST/v1/accountsCriar conta de e-mail-10
GET/v1/accountsListar todas as contas
GET/v1/accounts/:idObter detalhes da conta
DELETE/v1/accounts/:idExcluir conta+10
POST/v1/accounts/:id/messagesEnviar e-mail-1
GET/v1/accounts/:id/messagesListar mensagens
GET/v1/accounts/:id/messages/:msgIdObter mensagem completa
GET/v1/accounts/:id/messages/:msgId/attachments/:attIdObter URL do anexo
POST/v1/accounts/:id/webhooksRegistrar webhook
GET/v1/accounts/:id/webhooksListar webhooks
DELETE/v1/accounts/:id/webhooks/:whIdExcluir webhook
GET/v1/karmaObter saldo + eventos

Sistema de Karma

Cada ação tem um custo ou recompensa em karma:

EventoKarmaPorquê
money_paid+100Compra de créditos
email_received+2Alguém respondeu de um domínio confiável
account_deleted+10Reembolso de karma ao excluir um endereço
email_sent-1Enviar custa karma
account_created-10Criar endereços custa karma

Regras importantes:

  • Karma é concedido apenas para e-mails recebidos de provedores confiáveis (Gmail, Outlook, Yahoo, iCloud, ProtonMail, Fastmail, Hey, etc.). E-mails de domínios desconhecidos/descartáveis não geram karma.
  • Você só ganha karma uma vez por remetente até que o agente responda. Se o remetente X enviar 5 e-mails sem resposta, apenas o primeiro gera karma. Responda ao X, e o próximo e-mail de X gerará karma novamente.
  • Excluir uma conta reembolsa os 10 karma que custou para criá-la.

Quando o karma chega a 0, envios e criação de conta retornam HTTP 402. Sempre verifique o saldo antes de operações que consomem karma.

SDK TypeScript

import { createClient } from "@agentmail/sdk";

const mail = createClient({ apiKey: "am_..." });

// Criar conta
const account = await mail.accounts.create({
  address: "[email protected]",
});

// Enviar e-mail
await mail.messages.send(account.id, {
  to: ["[email protected]"],
  subject: "Olá",
  text: "Enviado por um agente de IA.",
});

// Ler caixa de entrada
const messages = await mail.messages.list(account.id);
const detail = await mail.messages.get(account.id, messages[0].id);

// Anexos
const att = await mail.attachments.getUrl(accountId, messageId, attachmentId);
// att.url é uma URL de download assinada

// Webhooks
await mail.webhooks.create(account.id, {
  url: "https://my-agent.example.com/inbox",
});

// Karma
const karma = await mail.karma.getBalance();
console.log(karma.balance);

Tratamento de Erros

import { AgentMailError } from "@agentmail/sdk";

try {
  await mail.messages.send(accountId, { to: ["[email protected]"], subject: "Oi", text: "Olá" });
} catch (e) {
  if (e instanceof AgentMailError) {
    console.log(e.status);   // 402, 404, 401, etc.
    console.log(e.code);     // "INSUFFICIENT_KARMA", "NOT_FOUND", etc.
    console.log(e.message);
  }
}

Padrões Comuns

Cadastrar em um serviço e ler e-mail de verificação

const account = await mail.accounts.create({
  address: "[email protected]",
});

// Use o endereço para se cadastrar (automação de navegador, API, etc.)

// Aguarde o e-mail de verificação
for (let i = 0; i < 30; i++) {
  const messages = await mail.messages.list(account.id);
  const verification = messages.find(m =>
    m.subject.toLowerCase().includes("verify") ||
    m.subject.toLowerCase().includes("confirm")
  );
  if (verification) {
    const detail = await mail.messages.get(account.id, verification.id);
    // Extraia o link/código de verificação de detail.bodyText ou detail.bodyHtml
    break;
  }
  await new Promise(r => setTimeout(r, 2000));
}

Enviar e-mail e aguardar resposta

const sent = await mail.messages.send(account.id, {
  to: ["[email protected]"],
  subject: "Pergunta sobre pedido #12345",
  text: "Você pode verificar o status?",
});

for (let i = 0; i < 60; i++) {
  const messages = await mail.messages.list(account.id);
  const reply = messages.find(m =>
    m.direction === "inbound" && m.timestamp > sent.timestamp
  );
  if (reply) {
    const detail = await mail.messages.get(account.id, reply.id);
    // Processar resposta
    break;
  }
  await new Promise(r => setTimeout(r, 5000));
}

Tipos

type Account = { id: string; address: string; displayName: string | null; createdAt: number };
type Message = { id: string; from: string; to: string[]; subject: string; direction: "inbound" | "outbound"; status: string; timestamp: number };
type MessageDetail = Message & { cc: string[] | null; bcc: string[] | null; bodyText: string | null; bodyHtml: string | null; inReplyTo: string | null; references: string | null; attachments: AttachmentMeta[] };
type AttachmentMeta = { id: string; filename: string; contentType: string; size: number };
type KarmaBalance = { balance: number; events: KarmaEvent[] };
type KarmaEvent = { id: string; type: string; amount: number; timestamp: number; metadata?: Record<string, unknown> };

Limitações

  • Use esta skill apenas quando a tarefa corresponder claramente ao escopo descrito acima.
  • Não trate a saída como substituta para validação, testes ou revisão por especialistas específicos do ambiente.
  • Pare e peça esclarecimentos se as entradas, permissões, limites de segurança ou critérios de sucesso necessários estiverem ausentes.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

Habilidades Relacionadas