Авторский курс Елизаровой НаталииAuthor's course by Nataliia Elizarova
Модуль 15 · Урок 15-30Module 15 · Lesson 15-30

Навык «Очистка базовой линии»: пишем методику один разThe "baseline cleaning" skill: write the method once

Каждый месяц планер делает одно и то же: убирает из продаж промо, возвраты, затаривание, возвращает спрос, потерянный на дефиците. Если делать это «на глаз» — у каждого планера и каждый месяц получается своя базовая линия. В этом уроке вы записываете методику один раз: правила — в файл, расчёт — в скрипт, порядок работы — в навык /baseline-clean.

Every month a planner does the same thing: removes promo, returns and stocking from sales and adds back demand lost to stock-outs. Done "by eye", every planner gets a different baseline every month. In this lesson you write the method down once: rules into a file, the calculation into a script, the routine into a /baseline-clean skill.

⏱ 35 минут⏱ 35 minutes 🎮 Тренажёр «Сколько оставить в базе?»🎮 Drill: "How much stays in the base?" 📥 Учебный файл CSV📥 Training CSV file ✅ Тест из 5 вопросов✅ A 5-question quiz 🔎 Проверено: ноябрь 2026🔎 Checked: November 2026

После урока вы сможетеAfter this lesson you will be able to

  • очистить базовую линию по 8 правилам и проверить себя равенством «база − OOS + блоки = факт»;
  • собрать папку навыка: SKILL.md, rules.md, events.csv, checks.md и скрипт;
  • попросить Claude Code написать скрипт по вашей методике и проверить его на эталоне;
  • подготовить навык для чата claude.ai, где разрешены не все поля шапки.
  • clean a baseline with 8 rules and check yourself with "base − OOS + blocks = actual";
  • build the skill folder: SKILL.md, rules.md, events.csv, checks.md and a script;
  • ask Claude Code to write the script from your method and test it against a reference;
  • prepare the skill for claude.ai chat, where not all header fields are allowed.
1

Словарик из семи словA seven-word glossary

Базовая линия (baseline)Baselineсколько продалось бы в обычный месяц: без промо, без дефицита, без разовых всплесков. С неё начинается прогнозwhat would have sold in an ordinary month: no promo, no stock-out, no one-off spikes. The forecast starts from it
ОчисткаCleaningпревращение факта продаж в базовую линию по записанным правиламturning actual sales into a baseline by written rules
OOS (дефицит)OOS (stock-out)спрос был, а товара не было. Продажи упали не потому, что не хотели купитьthere was demand but no product. Sales dropped not because people didn't want to buy
Промо-подъёмPromo liftпродажи сверх обычного уровня, которые дала акция. Это «блок», а не базаsales above the ordinary level created by a promotion. It is a "block", not base
Разовое событиеOne-off eventзатаривание перед повышением цены и провал после него, слив остатков. Объём не появился и не исчез — он переехалstocking before a price rise and the dip after it, a stock clearance. The volume didn't appear or vanish — it moved
Справочник событийEvent registerтаблица: дата, город, SKU, тип события, комментарий. Без неё скрипт не знает, где было промоa table: date, city, SKU, event type, comment. Without it the script doesn't know where promo happened
Навык (skill)Skillпапка с SKILL.md: порядок работы, который запускается командой /имя (урок 15-28)a folder with SKILL.md: a routine started with the command /name (lesson 15-28)
2

На пальцах: обычный вес без праздничного ужинаIn plain words: your normal weight without the holiday dinner

⚖️ Факт = вес на весах⚖️ Actual = the number on the scale

Взвесились после праздничного ужина — +2 кг. После болезни — −2 кг. Весы не врут, но «обычный вес» по ним не прочитать.

Weighed after a holiday dinner — +2 kg. After an illness — −2 kg. The scale doesn't lie, but you can't read your "normal weight" from it.

📏 База = обычный вес📏 Base = your normal weight

Обычный вес — это вес без ужина и без болезни. Так и база: продажи без акции, без дефицита, без затаривания. Прогноз строят от неё, а события добавляют сверху отдельными блоками.

Normal weight is the weight without the dinner and without the illness. Same with the base: sales without promo, stock-outs or stocking. The forecast is built from it, and events are added on top as separate blocks.

Главная мысльKey idea Очистка — это не «убрать некрасивое», а разложить факт на части, которые снова складываются в факт. Если части не складываются до литра — где-то ошибка. Cleaning is not "removing what looks ugly" but splitting the actual into parts that add back up to the actual. If the parts don't add up to the litre, there is an error somewhere.
база − в т.ч. OOS + блоки = факт без возвратовbase − of which OOS + blocks = actual without returns
3

Пример: 12 месяцев одного SKUExample: 12 months of one SKU

«Долина напитков», «Сок яблочный 1 л», город А, 2025 год, литры. С мая у SKU сменился код (10045 → 10078) — коды уже склеены, ряд один. Обычный уровень = среднее базы трёх предыдущих месяцев.

Valley Beverages, "Apple juice 1 L", city A, 2025, litres. In May the SKU changed its code (10045 → 10078) — the codes are already glued, there is one series. Ordinary level = the average base of the three previous months.

МесяцMonthФактActualСобытиеEventЧто делаемWhat we doБазаBase
ЯнвJan760—оставляемkeep760
ФевFeb750возврат −30return −30правило 2: строку возврата убираем, продажи 780rule 2: drop the return row, sales 780780
МарMar860праздникholidayправило 6: не чистим, это сезонrule 6: not cleaned, it's seasonality860
АпрApr1 200промоpromoправило 4: обычный (760+780+860)/3 = 800; блок 400 ≤ 0,6 × 800 = 480rule 4: ordinary (760+780+860)/3 = 800; block 400 ≤ 0.6 × 800 = 480800
МайMay860—оставляемkeep860
ИюнJun560OOSправило 3: обычный (860+800+860)/3 = 840; (840 − 560) × 0,5 = 140 — «в т.ч. OOS»rule 3: ordinary (860+800+860)/3 = 840; (840 − 560) × 0.5 = 140 — "of which OOS"700
ИюлJul980—оставляем (лето)keep (summer)980
АвгAug1 300затаривание перед ростом цены 1 сентябряstocking before the 1 Sep price riseправило 5: пара авг + сен = 1 920, каждому 960; перенос +340rule 5: pair Aug + Sep = 1,920, 960 each; transfer +340960
СенSep620провал после роста ценыdip after the price riseправило 5: та же пара; перенос −340rule 5: same pair; transfer −340960
ОктOct900обычная скидка дистрибутору 5 %regular 5% distributor discountправило 7: остаётся в базеrule 7: stays in the base900
НояNov760точек 340 вместо 400340 outlets instead of 400правило 8: не чистим, база идёт за покрытиемrule 8: not cleaned, the base follows coverage760
ДекDec1 100Новый годNew Yearправило 6: не чистимrule 6: not cleaned1 100
ГодYear10 650без возвратов 10 680without returns 10,68010 420
Сверка до литраReconcile to the litre База 10 420 − в т.ч. OOS 140 + промо 400 + перенос (+340 − 340 = 0) = 10 680 = факт без возвратов. Сошлось — значит, ничего не потеряли и не придумали. Base 10,420 − of which OOS 140 + promo 400 + transfer (+340 − 340 = 0) = 10,680 = actual without returns. It matches — nothing was lost or invented.

В уроке «обычный уровень» упрощён до среднего трёх месяцев. В настоящем скрипте его обычно считают с поправкой на сезон — это тоже записывают в rules.md.

In the lesson the "ordinary level" is simplified to a three-month average. A real script usually adjusts it for seasonality — that also goes into rules.md.

4

Методика: 8 правил по порядкуThe method: 8 rules in order

Порядок важен: правило 1 всегда первое, иначе все остальные считаются по разорванному ряду.

The order matters: rule 1 always comes first, otherwise all the others work on a broken series.

№ПравилоRuleПочемуWhy
1Склеить переключения кодов (старый → новый) до всего остальногоGlue code switches (old → new) before anything elseИначе старый код «умирает», новый «рождается», и скрипт видит падение и новинку вместо одного рядаOtherwise the old code "dies", the new one is "born", and the script sees a drop plus a launch instead of one series
2Убрать возвраты — строки с минусомDrop returns — the minus rowsВозврат — это учёт, а не спрос. Он приходит в другой месяц и рвёт рядA return is bookkeeping, not demand. It lands in another month and breaks the series
3OOS: вернуть только часть потерянного спроса: (обычный − факт) × oos_share, например 0,5. Показывать плюсом «в т.ч. OOS» внутри базы, а не строкой с минусомOOS: add back only part of the lost demand: (ordinary − actual) × oos_share, e.g. 0.5. Show it as a positive "of which OOS" inside the base, not as a minus rowНе нашёл товар — покупатель часто берёт замену или идёт в другой магазин. Вернуть 100 % — завысить базу. Строка с минусом читается как отдельный провал, хотя это часть базыWhen the product is missing, a buyer often takes a substitute or goes to another store. Adding back 100% inflates the base. A minus row reads as a separate drop, though it is part of the base
4Промо: снять подъём над обычным уровнем, но не больше (promo_cap − 1) × обычный, например promo_cap = 1,6. Всё сверх предела остаётся в базе и идёт в список «проверить»Promo: remove the lift above the ordinary level, but no more than (promo_cap − 1) × ordinary, e.g. promo_cap = 1.6. Anything above the cap stays in the base and goes to the "to check" listИначе промо «съедает» весь рост месяца — даже тот, что дали лето или новые клиентыOtherwise promo "eats" all the month's growth — even what summer or new customers brought
5Затаривание и провал после него — одно событие. Сумма пары сохраняется, база каждого месяца = сумма / 2, разница — блок «перенос» (+X и −X)Stocking and the dip after it are one event. The pair's total is kept, each month's base = total / 2, the difference is a "transfer" block (+X and −X)Покупатели не выпили больше — они купили раньше. Удалить всплеск = потерять объём, который реально проданBuyers didn't drink more — they bought earlier. Deleting the spike = losing volume that was really sold
6Праздники не чистимHolidays are not cleanedНовый год повторяется каждый год — это сезон. Его ловит сезонность модели, а не очисткаNew Year repeats every year — it is seasonality. The model's seasonality catches it, not cleaning
7Обычные скидки дистрибуторам остаются в базеRegular distributor discounts stay in the baseОни действуют всегда — это привычный уровень продаж (статистическая база), а не акцияThey are always on — this is the usual sales level (a statistical baseline), not a promotion
8Изменение числа точек не чистимA change in the number of outlets is not cleanedМеньше точек — ниже база. Это новый уровень, а не потеря, которая вернётся самаFewer outlets — a lower base. It is a new level, not a loss that will come back on its own
Методика — ваша, не ClaudeThe method is yours, not Claude's Числа 0,5 и 1,6 — пример. У вашей категории они свои. Claude может посчитать их по истории, но утверждает их планер, и они записываются в rules.md с датой. The numbers 0.5 and 1.6 are examples. Your category has its own. Claude can estimate them from history, but the planner approves them, and they are written into rules.md with a date.
5

Почему навык и скрипт, а не просто просьбаWhy a skill and a script, not just a request

Только словаWords only

«Очисти базу»"Clean the base"

Каждый раз Claude считает чуть по-другому: то медиана, то среднее, то забыл про возвраты. Две очистки одного месяца — две разные цифры.

Each time Claude calculates slightly differently: a median, then an average, then it forgets returns. Two cleanings of the same month — two different numbers.

СкриптScript

clean_baseline.pyclean_baseline.py

Считает по rules.md одинаково каждый месяц. Тот же вход — та же цифра, до литра. Его можно проверить на эталоне.

Calculates by rules.md the same way every month. Same input — same number, to the litre. It can be tested against a reference.

НавыкSkill

/baseline-clean/baseline-clean

Claude проверяет входы, запускает скрипт, сверяет итог, пишет отчёт и останавливается, если что-то не так.

Claude checks the inputs, runs the script, reconciles the total, writes a report and stops if something is wrong.

КтоWhoЧто делаетWhat it does
ПланерPlannerутверждает правила и параметры, ведёт events.csv, читает список «проверить»approves rules and parameters, keeps events.csv, reads the "to check" list
СкриптScriptсчитает все цифрыcalculates every number
Claudeпроверяет входы, запускает, сверяет, объясняет, пишет скрипт и правит его по вашей просьбеchecks inputs, runs, reconciles, explains, writes the script and fixes it on request
6

Папка навыка: пять файловThe skill folder: five files

.claude/skills/baseline-clean/ ├── SKILL.md ← порядок работы (обязательно, имя именно SKILL.md)← the routine (required, the name is exactly SKILL.md) ├── rules.md ← методика и параметры← the method and parameters ├── events.csv ← справочник событий: дата; город; SKU; тип; комментарий← event register: date; city; SKU; type; comment ├── checks.md ← список проверок результата← list of result checks └── scripts/ └── clean_baseline.py ← расчёт← the calculation
ФайлFileКто читаетWho reads itВажноImportant
SKILL.mdClaude, целиком при запускеClaude, in full at startкоротко, до 500 строк; подробности — в других файлах со ссылкой на нихshort, under 500 lines; details go to other files linked from it
rules.md, checks.mdClaude, когда нужно; вы и коллегиClaude, when needed; you and colleaguesчеловеческим языком, с датой версииin plain language, with a version date
events.csvскриптthe scriptзаполняет планер; пустой месяц = строка «событий нет»filled by the planner; an empty month = a "no events" row
clean_baseline.pyкомпьютерthe computerскрипт запускается, а не читается Claude целиком — длинный код не занимает его памятьthe script is run, not read in full by Claude — long code doesn't use up its memory

Навык проекта лежит в папке проекта (.claude/skills/) — его получит каждый планер, который работает в этой папке. Личный — в ~/.claude/skills/, только у вас.

A project skill lives in the project folder (.claude/skills/) — every planner working in that folder gets it. A personal one lives in ~/.claude/skills/, just for you.

7

Готовый SKILL.mdA ready SKILL.md

SKILL.md для копированияSKILL.md to copy
---
name: baseline-clean
description: Очистка базовой линии продаж по стране за месяц — склеить коды, убрать возвраты, промо и затаривание, вернуть часть OOS по методике rules.md. Пример запуска: /baseline-clean KAZ 2026-10
disable-model-invocation: true
argument-hint: [страна] [месяц ГГГГ-ММ]
allowed-tools: Read Bash(python *)
---
# Очистка базовой линии: $ARGUMENTS
Методика и параметры — в [rules.md](rules.md). Проверки — в [checks.md](checks.md).
Справочник событий — events.csv. Считает только скрипт; ты проверяешь и объясняешь.
## Шаг 1. Входы (остановись, если…)
1. В папке data/ есть выгрузка продаж по стране $0 за 24 месяца до $1 включительно.
   Нет файла или нет месяца — остановись и скажи мне.
2. Все коды из выгрузки есть в справочнике переключений codes_switch.csv
   или в справочнике SKU. Неизвестный код — остановись и покажи список.
3. В events.csv есть строки за $1 (хотя бы «событий нет»).
   Нет — остановись и спроси меня про промо, OOS и повышения цен.
## Шаг 2. Расчёт
4. Запусти: python ${CLAUDE_SKILL_DIR}/scripts/clean_baseline.py $ARGUMENTS
5. Цифры руками не меняй и в уме не пересчитывай. Скрипт упал — покажи ошибку
   и остановись.
6. Исходные файлы только читай. Результат — новый файл
   output/baseline_$0_$1.xlsx рядом с исходными.
## Шаг 3. Проверки (подробно — checks.md)
7. По каждой строке город × SKU × месяц: база − в т.ч. OOS + блоки = факт
   без возвратов, до литра. Не сошлось — остановись и покажи строки.
8. База не меньше нуля.
9. База больше 2× своей медианы за 12 месяцев, а события нет — в список «проверить».
10. Промо, упёршееся в предел promo_cap, — в список «проверить».
## Шаг 4. Отчёт мне
11. Пять строк: факт, база, в т.ч. OOS, блоки (тыс. л); сколько строк
    в «проверить»; что изменилось против прошлого месяца.
12. Правило не подходит к данным — не придумывай своё, спроси меня.
---
name: baseline-clean
description: Clean the sales baseline for a country and month — glue codes, drop returns, promo and stocking, add back part of OOS by the method in rules.md. Example: /baseline-clean KAZ 2026-10
disable-model-invocation: true
argument-hint: [country] [month YYYY-MM]
allowed-tools: Read Bash(python *)
---
# Baseline cleaning: $ARGUMENTS
Method and parameters — in [rules.md](rules.md). Checks — in [checks.md](checks.md).
Event register — events.csv. Only the script calculates; you check and explain.
## Step 1. Inputs (stop if…)
1. The data/ folder has the sales export for country $0, 24 months up to $1 inclusive.
   No file or no month — stop and tell me.
2. Every code in the export is in the code-switch register codes_switch.csv
   or in the SKU list. Unknown code — stop and show the list.
3. events.csv has rows for $1 (at least "no events").
   None — stop and ask me about promo, OOS and price rises.
## Step 2. Calculation
4. Run: python ${CLAUDE_SKILL_DIR}/scripts/clean_baseline.py $ARGUMENTS
5. Don't change numbers by hand or recalculate in your head. Script failed — show
   the error and stop.
6. Only read the source files. The result is a new file
   output/baseline_$0_$1.xlsx next to the sources.
## Step 3. Checks (details — checks.md)
7. For every city × SKU × month row: base − of which OOS + blocks = actual
   without returns, to the litre. No match — stop and show the rows.
8. The base is never below zero.
9. Base above 2× its 12-month median with no event — add to the "to check" list.
10. Promo that hit the promo_cap limit — add to the "to check" list.
## Step 4. Report to me
11. Five lines: actual, base, of which OOS, blocks (thousand L); how many rows
    are in "to check"; what changed vs last month.
12. A rule doesn't fit the data — don't invent your own, ask me.
Строка шапкиHeader lineЧто значитWhat it means
nameкоманда /baseline-clean; латиницей через дефисthe command /baseline-clean; Latin letters with hyphens
descriptionглавное — в начале: по нему Claude понимает, о чём навык. Длиннее 1 536 символов обрезаетсяthe key use case first: Claude uses it to understand what the skill is for. Over 1,536 characters is cut off
disable-model-invocation: trueзапуск только вашей командой — Claude не начнёт очистку «по догадке»runs only on your command — Claude won't start cleaning "on a guess"
argument-hintподсказка в меню, что писать после командыa hint in the menu for what to type after the command
allowed-toolsчто можно без вопроса: читать файлы и запускать python. Остальное Claude спроситwhat is allowed without asking: read files and run python. For anything else Claude asks
$ARGUMENTS, $0, $1всё, что вы написали после команды; $0 = первое слово (KAZ), $1 = второе (2026-10)everything you typed after the command; $0 = the first word (KAZ), $1 = the second (2026-10)
${CLAUDE_SKILL_DIR}папка навыка — скрипт найдётся, откуда бы вы ни запускалиthe skill folder — the script is found wherever you start from

Вместо $0 и $1 можно дать аргументам имена: строка arguments: [country, month] в шапке — и в тексте пишут $country и $month.

Instead of $0 and $1 you can name the arguments: the line arguments: [country, month] in the header — and the text uses $country and $month.

8

Готовый rules.md: методика с параметрамиA ready rules.md: the method with parameters

rules.md для копированияrules.md to copy
# Методика очистки базовой линии · версия 1.0
Уровень расчёта: город × SKU × месяц, литры.
Порядок применения — строго сверху вниз.
## Параметры
| Параметр  | Значение | Смысл |
|-----------|----------|-------|
| window    | 3        | обычный уровень = среднее базы 3 предыдущих месяцев |
| oos_share | 0,5      | какую долю потерянного на OOS спроса возвращаем в базу |
| promo_cap | 1,6      | промо-блок не больше (promo_cap − 1) × обычный уровень |
| pair_split| поровну  | затаривание + провал: база каждого месяца = сумма пары / 2 |
| flag_x    | 2        | база выше 2× медианы 12 мес. без события — «проверить» |
## Правила
1. Склеить переключения кодов (старый → новый) по codes_switch.csv — до всех правил.
2. Убрать возвраты (строки с минусом).
3. OOS: в т.ч. OOS = (обычный − факт) × oos_share; база = факт + в т.ч. OOS.
   Показывать плюсом внутри базы, не строкой с минусом.
4. Промо: блок = факт − обычный, но не больше (promo_cap − 1) × обычный.
   Остаток — в базе, строка — в «проверить».
5. Затаривание перед повышением цены и провал после — одна пара: сумма сохраняется,
   база = сумма / 2 каждому месяцу, блок «перенос» +X и −X.
6. Праздники не чистим — это сезон.
7. Обычные скидки дистрибуторам остаются в базе.
8. Изменение числа точек не чистим — база идёт за покрытием.
## Тождество
база − в т.ч. OOS + блоки = факт без возвратов (до литра)
## Журнал изменений
| Дата       | Версия | Что поменяли    | Кто утвердил |
|------------|--------|-----------------|--------------|
| 2026-11-02 | 1.0    | первая версия   | планер       |
# Baseline cleaning method · version 1.0
Level: city × SKU × month, litres.
Apply strictly top to bottom.
## Parameters
| Parameter | Value  | Meaning |
|-----------|--------|---------|
| window    | 3      | ordinary level = average base of the 3 previous months |
| oos_share | 0.5    | share of demand lost to OOS that we add back to the base |
| promo_cap | 1.6    | promo block at most (promo_cap − 1) × ordinary level |
| pair_split| equal  | stocking + dip: each month's base = pair total / 2 |
| flag_x    | 2      | base above 2× the 12-month median with no event — "to check" |
## Rules
1. Glue code switches (old → new) by codes_switch.csv — before all other rules.
2. Drop returns (minus rows).
3. OOS: of which OOS = (ordinary − actual) × oos_share; base = actual + of which OOS.
   Show it as a positive inside the base, not as a minus row.
4. Promo: block = actual − ordinary, but no more than (promo_cap − 1) × ordinary.
   The rest stays in the base, the row goes to "to check".
5. Stocking before a price rise and the dip after it are one pair: the total is kept,
   base = total / 2 for each month, a "transfer" block +X and −X.
6. Holidays are not cleaned — it is seasonality.
7. Regular distributor discounts stay in the base.
8. A change in the number of outlets is not cleaned — the base follows coverage.
## Identity
base − of which OOS + blocks = actual without returns (to the litre)
## Change log
| Date       | Version | What changed   | Approved by |
|------------|---------|----------------|-------------|
| 2026-11-02 | 1.0     | first version  | planner     |
Зачем журнал внизуWhy the log at the bottom Через полгода кто-то спросит: «почему база в марте ниже, чем в прошлом отчёте?». Ответ — в журнале: «oos_share поменяли с 0,5 на 0,4, утвердила такая-то». Без журнала это не восстановить. In six months someone will ask: "why is the March base lower than in the last report?". The answer is in the log: "oos_share changed from 0.5 to 0.4, approved by so-and-so". Without the log it can't be reconstructed.
9

Пусть Claude Code напишет скрипт и навыкLet Claude Code write the script and the skill

Путь 1 — у вас уже есть методика. Положите rules.md в папку навыка, откройте Claude Code в папке проекта, включите режим плана (Shift+Tab, урок 15-25) и отправьте:

Path 1 — you already have a method. Put rules.md into the skill folder, open Claude Code in the project folder, switch on plan mode (Shift+Tab, lesson 15-25) and send:

Запрос для копированияRequest to copy

Напиши скрипт .claude/skills/baseline-clean/scripts/clean_baseline.py строго по методике rules.md — ничего не добавляй от себя. Вход: выгрузка продаж из data/, events.csv, codes_switch.csv. Аргументы: страна и месяц. Выход: новый файл output/baseline_<страна>_<месяц>.xlsx — по строке на город × SKU × месяц: факт, возвраты, база, в т.ч. OOS, промо, перенос, флаг «проверить» и причина флага. Числа — числами, без заливок и объединённых ячеек. Исходные файлы не менять, без абсолютных путей. Сначала покажи план. Потом проверим на трёх SKU, которые я посчитаю руками: я дам цифры, а ты покажешь, совпало ли до литра.

Write the script .claude/skills/baseline-clean/scripts/clean_baseline.py strictly by the method in rules.md — add nothing of your own. Input: the sales export from data/, events.csv, codes_switch.csv. Arguments: country and month. Output: a new file output/baseline_<country>_<month>.xlsx — one row per city × SKU × month: actual, returns, base, of which OOS, promo, transfer, a "to check" flag and the flag reason. Numbers as numbers, no fills or merged cells. Don't change source files, no absolute paths. Show me the plan first. Then we'll test on three SKUs I calculate by hand: I'll give you the numbers and you show whether they match to the litre.

Путь 2 — методика пока в голове. Пусть Claude возьмёт у вас интервью и сам соберёт rules.md и SKILL.md:

Path 2 — the method is still in your head. Let Claude interview you and build rules.md and SKILL.md itself:

Запрос для копированияRequest to copy

Я планер. Хочу навык проекта .claude/skills/baseline-clean, который каждый месяц очищает базовую линию продаж. Возьми у меня интервью: задавай вопросы по одному и жди ответа. Спроси: на каком уровне считаем, откуда данные, как отмечены промо, OOS, затаривание, возвраты, переключения кодов; что считать обычным уровнем; что делать с праздниками, скидками и точками; какие проверки обязательны и когда останавливаться. Потом покажи мне rules.md (методика, параметры таблицей, журнал изменений) и SKILL.md (шапка: name, description, disable-model-invocation: true, argument-hint; шаги со «остановись, если…»). Ничего не сохраняй, пока я не скажу «сохраняй».

I am a planner. I want a project skill .claude/skills/baseline-clean that cleans the sales baseline every month. Interview me: ask questions one at a time and wait for the answer. Ask: what level we calculate at, where the data comes from, how promo, OOS, stocking, returns and code switches are marked; what counts as the ordinary level; what to do with holidays, discounts and outlets; which checks are mandatory and when to stop. Then show me rules.md (method, parameters as a table, change log) and SKILL.md (header: name, description, disable-model-invocation: true, argument-hint; steps with "stop if…"). Don't save anything until I say "save".

МетодикаMethodrules.md — сами или интервьюrules.md — yourself or via interview
ПланPlanShift+Tab, читаете план скриптаShift+Tab, you read the script plan
ЭталонReference3 SKU руками → совпало до литра?3 SKUs by hand → match to the litre?
НавыкSkillSKILL.md, новый чат, /baseline-cleanSKILL.md, new chat, /baseline-clean
10

Как проверить навык, прежде чем ему веритьHow to test the skill before trusting it

1. Эталон руками.1. A hand-made reference. Возьмите 3 SKU, где есть промо, OOS и затаривание. Посчитайте в Excel по rules.md. Скрипт обязан дать те же цифры до литра. Take 3 SKUs that have promo, OOS and stocking. Calculate them in Excel by rules.md. The script must give the same numbers to the litre.
2. Два запуска — одна цифра.2. Two runs — one number. Запустите /baseline-clean дважды на тех же данных. Разные итоги = где-то считает не скрипт, а «мысль» Claude. Найти и убрать. Run /baseline-clean twice on the same data. Different totals = something is calculated by Claude's "thinking", not the script. Find it and remove it.
3. Проверка на поломку.3. A break test. Уберите месяц из выгрузки, допишите несуществующий код, очистите events.csv. Навык должен остановиться каждый раз, а не досчитать «как-нибудь». Remove a month from the export, add a non-existent code, empty events.csv. The skill must stop every time, not finish "somehow".
4. Журнал.4. The log. Поменяли параметр — строка в журнале rules.md и повторная проверка на эталоне. Changed a parameter — a line in the rules.md log and a re-test on the reference.
checks.md для копированияchecks.md to copy
# Проверки результата очистки
1. Тождество по каждой строке: база − в т.ч. OOS + блоки = факт без возвратов (до литра).
2. Сумма по стране за месяц: факт в результате = факт в исходной выгрузке без возвратов.
3. База ≥ 0 во всех строках.
4. Блоки «перенос» по каждой паре в сумме дают 0.
5. Промо-блок ≤ (promo_cap − 1) × обычный уровень.
6. База > 2× медианы 12 мес. без события — в список «проверить».
7. Число строк город × SKU после склейки = числу живых SKU в справочнике.
# Result checks for cleaning
1. Identity on every row: base − of which OOS + blocks = actual without returns (to the litre).
2. Country total for the month: actual in the result = actual in the source export without returns.
3. Base ≥ 0 on every row.
4. "Transfer" blocks sum to 0 for every pair.
5. Promo block ≤ (promo_cap − 1) × ordinary level.
6. Base > 2× the 12-month median with no event — to the "to check" list.
7. Number of city × SKU rows after gluing = number of live SKUs in the register.
11

Тот же навык в чате claude.ai и CoworkThe same skill in claude.ai chat and Cowork

Навык можно загрузить и в чат: упакуйте папку навыка в ZIP и загрузите в настройках (раздел вроде «Настройки → Навыки (Skills)» — названия могут отличаться). Но у чата строже правила:

You can also upload a skill to chat: zip the skill folder and upload it in settings (a section like "Settings → Skills" — names may differ). But chat has stricter rules:

Claude CodeЧат claude.aiclaude.ai chat
Поля шапкиHeader fieldsвсе, включая disable-model-invocation и argument-hintall, including disable-model-invocation and argument-hintтолько name, description, license, compatibility, metadata, allowed-toolsonly name, description, license, compatibility, metadata, allowed-tools
Лишнее полеAn extra fieldмолча пропускаетсяsilently ignoredошибка загрузкиupload error
Команды !, которые выполняются до запуска! commands run before startработаютworkне работаютdon't work
Ваши папки на дискеYour folders on diskвидитseesнет — файл прикладываете в чатno — you attach the file to the chat
Шапка для чатаHeader for chat
---
name: baseline-clean
description: Очистка базовой линии продаж по приложенному файлу — склеить коды, убрать возвраты, промо и затаривание, вернуть часть OOS по методике rules.md.
---
---
name: baseline-clean
description: Clean the sales baseline from the attached file — glue codes, drop returns, promo and stocking, add back part of OOS by the method in rules.md.
---

Источник: официальная справка Claude Code о навыках (code.claude.com/docs/en/skills), ноябрь 2026. В чате нет вашей папки data/ — шаги «проверь папку» замените на «проверь приложенный файл».

Source: the official Claude Code skills docs (code.claude.com/docs/en/skills), November 2026. Chat has no data/ folder of yours — replace "check the folder" steps with "check the attached file".

12

Тренажёр: сколько оставить в базе?Drill: how much stays in the base?

Параметры как в rules.md: oos_share = 0,5, promo_cap = 1,6. Литры.

Parameters as in rules.md: oos_share = 0.5, promo_cap = 1.6. Litres.

13

Практика: очистите два SKUPractice: clean two SKUs

Учебный файл: город Б, 2025, два SKUTraining file: city B, 2025, two SKUs
CSV с разделителем «;», открывается в ExcelCSV with ";" separator, opens in Excel
Задание 1. Подготовка.Task 1. Preparation. Приложите CSV в чат или положите в data/. Попросите Claude: «опиши файл, склей коды, убери возвраты, покажи факт по SKU с возвратами и без». Ничего пока не чистим. Attach the CSV to a chat or put it into data/. Ask Claude: "describe the file, glue the codes, drop returns, show actual by SKU with and without returns". No cleaning yet.
Задание 2. Очистка по правилам.Task 2. Cleaning by the rules. Приложите rules.md из раздела 8: «очисти базу строго по rules.md, по месяцам, и проверь тождество». Сверьте с ключом. Attach rules.md from section 8: "clean the base strictly by rules.md, month by month, and check the identity". Compare with the key.
Задание 3. Навык.Task 3. The skill. В Claude Code соберите папку навыка (разделы 6–10), попросите скрипт по запросу из раздела 9 и запустите /baseline-clean. Цифры должны совпасть с ключом и с заданием 2. In Claude Code build the skill folder (sections 6–10), ask for the script with the request from section 9 and run /baseline-clean. The numbers must match the key and task 2.
🔑 Ключ к заданиям 1–3🔑 Key to tasks 1–3
  • Ловушка кодов: «Лимонад Груша 0,5 л» в январе–апреле под старым кодом 30050, с апреля под новым 30077. В апреле две строки: 200 + 160 = 360. После склейки — один ряд 30077.
  • Возвраты: «Сок яблочный» май −20, «Лимонад» февраль −10. Факт с возвратами: сок 7 620, лимонад 4 890. Без возвратов: 7 640 и 4 900.
  • Сок, апрель, промо: обычный (500+520+540)/3 = 520; 780 / 520 = 1,5 — в пределе; блок 260, база 520.
  • Сок, июнь, OOS: обычный (540+520+560)/3 = 540; (540 − 380) × 0,5 = 80; база 460, в т.ч. OOS 80.
  • Сок, сентябрь, промо: обычный (460+640+640)/3 = 580; 1 100 / 580 ≈ 1,9 — выше 1,6. Блок не больше 0,6 × 580 = 348; база 752, строка в «проверить».
  • Сок, итог: база 7 112 − OOS 80 + промо 608 (260 + 348) = 7 640 ✓. Декабрь 820 (праздник) не чистим.
  • Лимонад, июль–август: затаривание 700 перед повышением цены, провал 300. Пара 1 000 → база 500 и 500, перенос +200 и −200.
  • Лимонад, итог: база 4 900, OOS 0, блоки 0 = 4 900 ✓. Октябрь (меньше точек), ноябрь (скидка 5 %), декабрь (праздник) — без изменений.
  • Code trap: "Pear lemonade 0.5 L" is under old code 30050 in January–April and new code 30077 from April. April has two rows: 200 + 160 = 360. After gluing — one series, 30077.
  • Returns: "Apple juice" May −20, "Lemonade" February −10. Actual with returns: juice 7,620, lemonade 4,890. Without returns: 7,640 and 4,900.
  • Juice, April, promo: ordinary (500+520+540)/3 = 520; 780 / 520 = 1.5 — within the cap; block 260, base 520.
  • Juice, June, OOS: ordinary (540+520+560)/3 = 540; (540 − 380) × 0.5 = 80; base 460, of which OOS 80.
  • Juice, September, promo: ordinary (460+640+640)/3 = 580; 1,100 / 580 ≈ 1.9 — above 1.6. Block at most 0.6 × 580 = 348; base 752, row goes to "to check".
  • Juice, total: base 7,112 − OOS 80 + promo 608 (260 + 348) = 7,640 ✓. December 820 (holiday) not cleaned.
  • Lemonade, July–August: stocking 700 before the price rise, dip 300. Pair 1,000 → base 500 and 500, transfer +200 and −200.
  • Lemonade, total: base 4,900, OOS 0, blocks 0 = 4,900 ✓. October (fewer outlets), November (5% discount), December (holiday) — unchanged.
14

Частые ошибкиCommon mistakes

ОшибкаMistakeКак правильноDo this instead
Чистят до склейки кодов — новый код выглядит новинкой, старый — проваломCleaning before gluing codes — the new code looks like a launch, the old one like a dropСклейка — правило 1, всегда первымGluing is rule 1, always first
OOS возвращают на 100 %OOS added back at 100%Только долю oos_share; база не должна получаться выше реального спросаOnly the oos_share part; the base must not exceed real demand
OOS показан отдельной строкой с минусомOOS shown as a separate minus row«в т.ч. OOS» плюсом внутри базы"of which OOS" as a positive inside the base
Всплеск затаривания просто удалилиThe stocking spike was simply deletedПара месяцев: сумма сохраняется, перенос +X и −XA pair of months: the total is kept, transfer +X and −X
Чистят Новый год и праздникиCleaning New Year and holidaysЭто сезон — оставить в базеIt's seasonality — leave it in the base
Методика только в SKILL.md словами, без скриптаThe method lives only as words in SKILL.md, no scriptСчитает скрипт, Claude проверяет и объясняетThe script calculates, Claude checks and explains
Навык для чата загрузили с disable-model-invocation — ошибка загрузкиUploaded a chat skill with disable-model-invocation — upload errorДля чата — укороченная шапка: name и descriptionFor chat — a trimmed header: name and description
Параметр поменяли «на словах»A parameter changed "verbally"Строка в журнале rules.md и повторная проверка на эталонеA line in the rules.md log and a re-test on the reference
15

Что запомнить: отметьте галочкойWhat to remember: tick it off

16

Проверьте себяCheck yourself

17

ШпаргалкаCheat sheet

ТождествоIdentityбаза − в т.ч. OOS + блоки = факт без возвратовbase − of which OOS + blocks = actual without returns
Порядок правилRule orderкоды → возвраты → OOS → промо → затаривание; праздники, скидки, точки не чистимcodes → returns → OOS → promo → stocking; holidays, discounts, outlets not cleaned
OOS(обычный − факт) × oos_share, плюсом «в т.ч.»(ordinary − actual) × oos_share, positive "of which"
ПромоPromoблок ≤ (promo_cap − 1) × обычныйblock ≤ (promo_cap − 1) × ordinary
ЗатариваниеStockingпара месяцев, сумма / 2, перенос ±Xa pair of months, total / 2, transfer ±X
ПапкаFolder.claude/skills/baseline-clean/: SKILL.md, rules.md, events.csv, checks.md, scripts/.claude/skills/baseline-clean/: SKILL.md, rules.md, events.csv, checks.md, scripts/
ЗапускRun/baseline-clean KAZ 2026-10 → $0 = KAZ, $1 = 2026-10/baseline-clean KAZ 2026-10 → $0 = KAZ, $1 = 2026-10
Чат claude.aiclaude.ai chatZIP; в шапке только name, description (+ license, compatibility, metadata, allowed-tools)ZIP; header only name, description (+ license, compatibility, metadata, allowed-tools)
Итог урокаLesson summary Очистка базовой линии — это разложение факта на базу, «в т.ч. OOS» и блоки, которые снова складываются в факт до литра. Методику записывают один раз: правила и параметры — в rules.md с журналом, расчёт — в скрипт, порядок работы с проверками «остановись, если…» — в SKILL.md. Скрипт проверяют на эталоне руками и двумя одинаковыми запусками. Для чата claude.ai шапку навыка укорачивают до разрешённых полей. Baseline cleaning splits the actual into base, "of which OOS" and blocks that add back up to the actual to the litre. The method is written once: rules and parameters into rules.md with a log, the calculation into a script, the routine with "stop if…" checks into SKILL.md. The script is tested against a hand-made reference and with two identical runs. For claude.ai chat the skill header is trimmed to the allowed fields.
Made on
Tilda