Yandex Direct skill with CPA optimization
Yandex.Direct Skill для Claude Code
A dependency-free Python skill that builds Direct campaigns from a blueprint, pulls leads from Metrika and optimizes bids toward a target CPA or ROI
High risk
We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.
Why this level
- Creates and changes real campaigns, bids and budgets in the live account
- The autopilot can bulk-change bids without manual review of every step
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/yandex-direct-skill-dlya-claude-codeDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a claude-code -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a cursor -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a github-copilot -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a codex -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a gemini-cli -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a cline -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a roo -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
A fork of Roo Code, same .roo folders.
Run in a terminal in the project folder
npx skills add slikti/skill_for_claude_code_yandex_direct --skill yandex-direct -a opencode -yThe skills tool installs the current version from the repository. Add the -g flag to use the skill in every project.
Copy the yandex-direct folder from slikti/skill_for_claude_code_yandex_direct into ~/.claude/skills/, run cd scripts && cp config.example.json config.json, fill in the OAuth token, counter_id and primary_goal_id, then verify the connection with python direct_api.py ping in sandbox mode.
Other ways from the author
cp -r yandex-direct ~/.claude/skills/Copies the skill folder into the global Claude Code skills directory.
This is third-party code. Review the repository files before installing.
What it does
The skill builds Yandex Direct campaigns via API v5 from a single JSON blueprint idempotently, without duplicates on repeated runs, tracks state in a local state.json and can roll back changes with rollback.py. Separate scripts collect keyword semantics with demand checks, write ad copy, handle negative keywords and bid adjustments, and pull leads from Metrika and sales from CRM to optimize toward revenue rather than raw leads. It includes a weekly autopilot with budget-anomaly alerts, an A/B test for creatives with a statistical comparison, and photo or banner generation through an external API or MCP connector. Every request that spends money requires sandbox mode first and confirmation before switching to the live account.
Who it is for. For PPC managers and small business owners who want to run Direct campaigns toward a target cost per lead without manual busywork.
Good fit when
- You want a campaign built end to end from a brief: keywords, ads, negatives
- You need bid optimization toward a target CPA or ROI using Metrika and CRM data
- You need an autopilot with anomaly alerts and the ability to roll back changes
Not a fit when
- You have no Metrika counter with a configured goal: lead-based optimization will not work without it
- You have no separate service or MCP tool for generating photos and banners but need image ads
Example request
Build a Yandex Direct campaign for flower delivery in Moscow with a 2000 ruble daily budgetLimitations
You need an OAuth token with direct:api and metrika:read scopes, a Metrika counter with a goal, and for creatives a separate API key or an image-generation MCP connector. Sandbox mode is on by default; real money is spent only after a deliberate switch to the live account. There are no dependencies beyond the Python standard library, but Python 3.8 or newer must be installed. The token and config.json are not committed and must stay local.
How to disable. Delete the yandex-direct folder from your project's .claude/skills/ or from ~/.claude/skills/.
Security check
- Creates and changes real campaigns, bids and budgets in the live account
- The autopilot can bulk-change bids without manual review of every step
README in short
The README presents the skill as a replacement for a PPC manager: campaign assembly, ad copy, leads from Metrika, bid and budget optimization. It covers installation by copying a folder, a 15-minute OAuth token and Metrika counter setup, a list of Russian-language usage scenarios, the script layout, a sandbox mode on by default, a creative-generation pipeline via API or MCP, and safety measures: gitignored token, confirmation for live edits, and an audit log.
SKILL.md
--- name: yandex-direct description: Run and grow Yandex.Direct ad campaigns end-to-end via the Direct API v5 and Metrica. Create campaigns, ad groups, keywords and ads; generate ad copy (titles/texts/sitelinks); track leads; and optimize bids/budgets toward a target CPA/ROI. Use when the user asks to set up, manage, audit, scale, or optimize Yandex.Direct (Яндекс Директ) advertising, generate ad creatives/texts, lower CPA, find wasted spend, or report on campaign performance. --- # Yandex.Direct — autonomous campaign management Manage a user's Yandex.Direct account: build campaigns, write the copy, track leads through Metrica, and optimize spend toward a target cost-per-lead (CPA) and positive ROI. ## First: mandatory onboarding Before any API action, the agent must collect and confirm two access blocks: 1. Yandex.Direct access: OAuth token for Direct/Metrica, sandbox vs production mode, Metrica counter id + primary goal id 2. Creative production access for photos/banners: provider type (api or mcp), provider/service name, auth token, expected asset types If any of these are missing, stop and ask the user for them first. Do not invent credentials, do not silently skip the creative provider. **Money is real in production.** Confirm with the user before: switching sandbox to false, raising budgets/bids in production, or applying bulk changes on a live account.
FAQ
Can it spend money by accident?
Sandbox mode is on by default; live changes and bulk edits require explicit confirmation and the --apply flag.
How do I roll back changes?
With the rollback.py script; the state of every operation is kept locally in state.json for idempotency.
Related
Official DataLens (Yandex) skills for Claude Code, Codex and OpenCode: SDK, HTML reports and RLS resolution
A Yandex Metrika MCP server generated from the API spec: 108 methods, 10 tools declared by default, transparent filters and response metadata
An open MCP server and agent skill set for SEO: keyword research, competitors, backlinks and site audits powered by DataForSEO
A Claude Code plugin for SEO audits: technical SEO, E-E-A-T, schema, local and AI search via parallel subagents