AgentSkillsCN

integrations

外部平台集成的技术细节(API、凭证、速率限制)。适用于发布内容、排查问题,或新增集成时使用。

SKILL.md
--- frontmatter
name: integrations
description: Technical details for external platform integrations (APIs, credentials, rate limits). Use when posting, debugging issues, or adding new integrations.
user-invocable: false

Integrations Technical Skill

How Posting Works

  1. Agent creates files in agent/outputs/{platform}/
  2. process-outputs.yml workflow runs on push
  3. Calls agent/integrations/{platform}/post.sh for each file
  4. Success → file moves to posted/
  5. Failure → file stays for next run

X (Twitter) Integration

Credentials (OAuth 1.0a - preferred)

Stable tokens that don't expire.

NameTypeDescription
X_API_KEYvarConsumer API Key
X_API_KEY_SECRETsecretConsumer API Secret
X_ACCESS_TOKENsecretAccess Token
X_ACCESS_TOKEN_SECRETsecretAccess Token Secret

Credentials (OAuth 2.0 - fallback)

⚠️ Refresh token rotates on each use - not recommended.

NameTypeDescription
X_CLIENT_IDvarOAuth 2.0 Client ID
X_CLIENT_SECRETsecretOAuth 2.0 Client Secret
X_REFRESH_TOKENsecretRefresh token (rotates!)

Rate Limits

  • Free tier: 17 tweets per 24-hour rolling window (observed limit; official docs say higher but enforcement is stricter)
  • Workflow adds 5s delay between posts
  • On 429 error, stops processing remaining files

Evidence: Week 1 (2026-02-03) hit 429 after 17th tweet. See agent/memory/learnings/2026-02-03-x-rate-limits.md.

Diagnostics

Check credentials configured

bash
gh variable list | grep X_

If variables exist, presume secrets are also configured.

Check posting runs

bash
gh run list --workflow=process-outputs.yml --limit 5
gh run view <run-id> --log

Common Issues

SymptomCauseFix
429 errorsRate limitWait 15+ min
Files in posted/ but not postedBad exit codeCheck post.sh returns 1 on failure
Auth errorsMissing credentialsCheck gh variable list

Adding New Platforms

  1. Create agent/integrations/{platform}/post.sh
    • Takes content as arg: post.sh "content"
    • Returns 0 on success, 1 on failure
  2. Create agent/outputs/{platform}/
  3. Add credentials to process-outputs.yml env section