Files
obrabotka_kiz/AGENTS.md
T
Igor K.andClaude Opus 5.5 a6a3d5d6cd feat: обрезка КИЗ до 31 символа, README, инструкции для AI-агентов
- VBS и Python: в итоговом CSV код КИЗ обрезается до первых 31 символа
  (код без криптохвоста: 01 + GTIN + 21 + серийный номер); более короткий
  код остаётся как есть, с замечанием в отчёте. Копия kiz_to_csv.py в
  портативном комплекте обновлена так же.
- README.md: инструкция на русском, переписана проще и яснее;
  Инструкция_экспорт_CSV.docx пересобрана из того же текста, с настоящими
  заголовками и списками.
- AGENTS.md, CLAUDE.md, .agents/ (скилл kiz-testing, папки plans и reports).
- .gitignore для .DS_Store; .gitattributes хранит файлы без изменения
  концов строк (.bat и .vbs нужны CRLF).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 06:38:47 -04:00

40 lines
3.0 KiB
Markdown

# Project Rules
These rules apply to every AI agent working in this repository, whatever the tool or model. The global rules in `~/.agents/AGENTS.md` apply too; the rules below are additional to them.
## What this repo is
Scripts that turn two Excel files into a CSV for upload to «Честный знак» (the Russian product-marking system), to take goods out of market turnover:
- file 1 — the supplier's goods invoice (ТОРГ-12): goods from row 19, column B = product name + GTIN after the last space, K = quantity, L = price, N = VAT rate;
- file 2 — the sheet of scanned КИЗ codes (DataMatrix marking codes) in its last filled column.
The script matches each КИЗ to an invoice row by GTIN (`01` + 14 digits at the start of the code), fills columns B..G (name, price, `1`, `796`, VAT with `%`, `КИЗ`), cuts each КИЗ to its first 31 characters (the code without the crypto tail), checks quantities against column K, and writes `<name>.csv` and `<name>_report.txt` next to file 2. The Excel files themselves are never changed.
User-facing instructions (Russian): `README.md`, and the same text in `Инструкция_экспорт_CSV.docx`. Keep both in sync.
## Layout
- `obrabotka_kiz_vb/xlsx_to_csv_utf8.vbs` — VBS version for Windows + Excel (uses Excel through COM). The file is **UTF-16 LE with BOM and CRLF line ends** — keep that encoding, otherwise Windows Script Host breaks the Cyrillic text. Edit it by decoding/encoding explicitly, not with tools that assume UTF-8.
- `obrabotka_kiz_python/kiz_to_csv.py` — Python port of the same algorithm (openpyxl), with launchers `kiz_to_csv.bat` (Windows) and `kiz_to_csv.command` (Mac/Linux).
- `obrabotka_kiz_python/KIZ_portable_Win7/` — portable kit for Windows without admin rights: embedded Python 3.8.10 + openpyxl, a copy of `kiz_to_csv.py` and `KIZ_CSV.bat`. Its `kiz_to_csv.py` must stay identical to `obrabotka_kiz_python/kiz_to_csv.py`.
- Repo root `*.xlsx` — real sample files (`Куропятник.xlsx` is an invoice, `Книга1.xlsx` a КИЗ file, `УПД № 3602 ...xlsx` a УПД invoice). They are samples only; do not use them as test fixtures.
## Rules
1. The VBS and Python versions must behave the same and produce the same CSV. Every algorithm change goes into both (and into the portable copy of the Python script).
2. The Python script must keep working on Python 3.8 (Windows 7 limit) — no newer syntax or libraries.
3. Do not commit generated `.csv` / `_report.txt` files or test fixtures.
## Where agent material lives
- `.agents/skills/<name>/SKILL.md` — skills.
- `.agents/plans/` — implementation plans. Name each file after what the plan implements.
- `.agents/reports/` — reports and findings produced by executing a plan.
## Testing
When testing, always use the testing skill in `.agents/skills/kiz-testing/SKILL.md`.
Whenever a plan is written, it must include a request to all AI agents implementing it to follow `AGENTS.md` principles (global and project) and to use the `kiz-testing` skill (`.agents/skills/kiz-testing/SKILL.md`) for all test work.