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.mdis the same file, written bynpm run skill:write(and checked bynpm run skill:check), with anexamples/folder of complete calls. - The older v2 package (
npx skills add thierryteisseire/cgenius-skill) used the app's internal routes andCGENIUS_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:
| Agent | Location |
|---|---|
| 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 agents | any 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 job | Scopes | AI access |
|---|---|---|
| Write blogs, ideas, offers | content:read content:write jobs:read jobs:write settings:read | yes |
| Also size and publish social posts through Buffer | add publish:read publish:write | yes |
| Also keep generated images | add media:read media:write | yes |
| Read-only reporting | content:read jobs:read settings:read | no |
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
- Check the setup with
GET /api/v1/me(token valid, Scopes, AI access, Workspaces, credits) and find the assistants withGET /api/v1/assistants. - Map the user's request to an Operation (blog engine, lead ideas, offer, social sizing, Buffer…).
- Start the Job with a new
Idempotency-Key, then poll it, reporting progress now and then. - 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). - Confirm with the user before publishing, deleting or anything that leaves the app, and never reveal the token.
Workflows
From leads to a blog
GET /api/v1/lead-app/companies: useselectedCompanyId, or ask the user when they have several companies.GET /api/v1/assistants: the writing agent (ask the user, or use the one they named).POST /api/v1/ideation/lead-ideaswithassistantId,companyId,mode: "quick"for a fast answer or"deep"for a thorough one; poll the Job.- Show the user the ideas (
topic,targetAudience,rationale), and let them pick one. POST /api/v1/blogs/v3/pipelineswith the idea'stopicasrequestData.topicand itskeywordsandagentConfiguration.defaultAgentId; poll the Job; give the userresult.resources.
One message, sized for each channel
ContentGenius has no social-post generation Operation yet, so the agent writes the text itself:
GET /api/v1/social/channels: the length, structure, hashtag count and image size of each channel the user wants.- Write one version per channel following those rules (for example a hook in the first line on LinkedIn, at most 280 characters on X).
POST /api/v1/social/fitfor each version: fix anystatus: "over"orhashtagsOk: false; for X or Threads, usethreadwhen the message needs more than one post.- Show the user every version before going further.
Publish through Buffer
GET /api/v1/connections/buffer/channels: the user's channels (on409, ask them to connect Buffer in Settings → Integrations).- Ask the user which channels, when (now, queue, a date, or a Buffer draft), and confirm the text of each.
POST /api/v1/publish/bufferwithversionsper channel (andthreadfor X or Threads), anIdempotency-Key, andcontentIdwhen the post comes from a saved content item.- 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.