Agent skill

Teach an AI agent to use ContentGenius safely.

An agent skill is a short instruction file (SKILL.md) that teaches an AI agent when and how to use a tool. The ContentGenius skill teaches an agent to create content through the Public API (and the CLI once released).

Get the skill

  • Current version (v1 API): /documentation/skill.md. It is generated from the same API description as this site, so it lists the Operations of this build.
  • In the repository: .agents/skills/cgenius/SKILL.md is the same file, written by npm run skill:write (and checked by npm run skill:check), with an examples/ folder of complete calls.
  • The older v2 package (npx skills add thierryteisseire/cgenius-skill) used the app's internal routes and CGENIUS_EPSIMO_TOKEN. It no longer works with API tokens; replace it with this one.

Install it

Save skill.md as SKILL.md in the agent's skills folder:

AgentLocation
Claude Code.claude/skills/cgenius/SKILL.md (project) or ~/.claude/skills/cgenius/SKILL.md
Kiro.kiro/skills/cgenius/SKILL.md (workspace) or ~/.kiro/skills/cgenius/SKILL.md
Agents that read .agents/skills (Codex, Gemini CLI, …).agents/skills/cgenius/SKILL.md
Other agentsany folder the agent reads skills or rules from; or paste it into the system prompt
mkdir -p .claude/skills/cgenius
curl -sS https://app.cgenius.app/documentation/skill.md -o .claude/skills/cgenius/SKILL.md

Then give the agent a token through the environment, never in the chat:

export CGENIUS_API_URL="https://app.cgenius.app"
export CGENIUS_API_TOKEN="cg_…"

Which token to give an agent

Create it in Settings → API Tokens with only the Scopes the agent needs, and an expiry you are comfortable with.

Agent's jobScopesAI access
Write blogs, ideas, offerscontent:read content:write jobs:read jobs:write settings:readyes
Also size and publish social posts through Bufferadd publish:read publish:writeyes
Also keep generated imagesadd media:read media:writeyes
Read-only reportingcontent:read jobs:read settings:readno

The agent can create a narrower child token for a sub-task (POST /api/v1/tokens, needs tokens:manage); a child never has more Scopes than its parent, nor AI access. Revoke the token when the agent no longer needs it.

What the skill tells the agent

  1. Check the setup with GET /api/v1/me (token valid, Scopes, AI access, Workspaces, credits) and find the assistants with GET /api/v1/assistants.
  2. Map the user's request to an Operation (blog engine, lead ideas, offer, social sizing, Buffer…).
  3. Start the Job with a new Idempotency-Key, then poll it, reporting progress now and then.
  4. Handle errors by error.code (missing Scope → ask for a token with it; no AI access → ask for a token with AI access; no credits → stop).
  5. Confirm with the user before publishing, deleting or anything that leaves the app, and never reveal the token.

Workflows

From leads to a blog

  1. GET /api/v1/lead-app/companies: use selectedCompanyId, or ask the user when they have several companies.
  2. GET /api/v1/assistants: the writing agent (ask the user, or use the one they named).
  3. POST /api/v1/ideation/lead-ideas with assistantId, companyId, mode: "quick" for a fast answer or "deep" for a thorough one; poll the Job.
  4. Show the user the ideas (topic, targetAudience, rationale), and let them pick one.
  5. POST /api/v1/blogs/v3/pipelines with the idea's topic as requestData.topic and its keywords and agentConfiguration.defaultAgentId; poll the Job; give the user result.resources.

One message, sized for each channel

ContentGenius has no social-post generation Operation yet, so the agent writes the text itself:

  1. GET /api/v1/social/channels: the length, structure, hashtag count and image size of each channel the user wants.
  2. Write one version per channel following those rules (for example a hook in the first line on LinkedIn, at most 280 characters on X).
  3. POST /api/v1/social/fit for each version: fix any status: "over" or hashtagsOk: false; for X or Threads, use thread when the message needs more than one post.
  4. Show the user every version before going further.

Publish through Buffer

  1. GET /api/v1/connections/buffer/channels: the user's channels (on 409, ask them to connect Buffer in Settings → Integrations).
  2. Ask the user which channels, when (now, queue, a date, or a Buffer draft), and confirm the text of each.
  3. POST /api/v1/publish/buffer with versions per channel (and thread for X or Threads), an Idempotency-Key, and contentId when the post comes from a saved content item.
  4. Report each channel's result; retry only the failed ones, with a new key.

Give an agent the whole documentation

Point it at /documentation/llms.txt: one plain-text file with these pages, every Operation with its Scopes, fields and a curl example, and the error codes.