Files
smeta-railway/.claude/rules/ai.md
T
anorandClaude Opus 4.6 f7b9400163 feat: web API модули + структурированные ошибки + few-shot промпты
Новые модули:
- errors.py — классификация ошибок (transient/validation/business)
- web/chat_api.py — поиск ГЭСН, НР/СП lookup
- web/generator_api.py — 3-шаговая генерация сметы
- .claude/rules/ — конвенции для calc/ai/output/web

Улучшения:
- generator.py: few-shot примеры, retry при невалидном JSON, предусловия
- bot.py: структурированные ошибки вместо голых Exception
- wizard_api.py: структурированные ошибки в HTTP-ответах

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 07:23:00 +10:00

568 B

paths
paths
src/smeta_railway/ai/**

AI Module Rules

  • All LLM prompts MUST include few-shot examples for structured output
  • Never trust raw LLM JSON output — always validate with try/except + retry
  • CAG context (~4K tokens) is pre-built; do not load full tables at runtime
  • When adding new prompts: include 2-3 input/output examples
  • System prompts must cite normative sources (document, paragraph, column)
  • Test prompt changes with real questions before committing
  • GLM-5 is primary provider; Anthropic/OpenAI are alternatives — keep all working