CLAUDE.md — правила проекта cyb-ts

Рабочий процесс

Для проверки после коммита — запускать deno task build (как CI), а не dev server. Dev server (deno task start) запускать только по явному запросу пользователя.

Проверка после изменений

После каждого изменения кода — обязательно пересобирать и проверять результат:

  • Web (cyb-ts): deno task build — полный production билд
  • Desktop (cyb-shell): cd cyb && make dmg — release билд + DMG
  • Не оставлять только cargo check — нужен полный make dmg чтобы убедиться что артефакт обновился
  • DMG находится в cyb/target/release/cyb.dmg

Git

  • Push только по запросу — никогда не пушить без явного указания пользователя
  • Атомарные коммиты — один коммит на одну функцию/изменение, не смешивать несвязанные правки

Планы и решения

Все утверждённые планы сохраняются в .claude/plans/, а не во временные папки. Файл reference/roadmap.md — общий roadmap проекта.

Стек

  • Runtime: Deno 2 (task runner, build, dev server, lint)
  • Bundler: Rspack 1.7 (Rust-based)
  • Package manager: Deno (deno install для node_modules)
  • Test runner: отсутствует (Jest удалён, тесты в src/ временно не запускаются)
  • Framework: React 18, TypeScript 5

Сборка

# Установка зависимостей:
deno install

# Все команды через Deno:
deno task start        # dev server (HTTPS, HMR)
deno task build        # production build
deno task build-ipfs   # IPFS production build
deno task lint         # eslint
deno task serve        # serve production build

Важно:

  • DENO_NO_PACKAGE_JSON=1 используется во всех deno tasks чтобы Deno не парсил package.json
  • package.json scripts удалены (кроме generate-graphql-types) — всё в deno.json
  • Yarn больше не нужен — react-force-graph заменён на react-force-graph-3d (без aframe/VR/AR)

Структура

  • src/components/ — переиспользуемые UI компоненты
  • src/containers/ — контейнеры страниц (legacy, мигрировать в pages/features)
  • src/pages/ — страницы
  • src/features/ — фичи (feature-sliced подход)
  • src/services/ — сервисы (IPFS, backend, scripting, etc.)
  • src/redux/ — Redux store
  • src/utils/ — утилиты (encoding.ts — замена Buffer для Web APIs)
  • src/contexts/ — React context providers
  • src/hooks/ — кастомные хуки
  • src/generated/ — сгенерированные GraphQL типы

Безопасность

  • Iframe: sandbox атрибут обязателен для любого IPFS/gateway контента
  • CSP: Content-Security-Policy задана в src/index.html
  • Scripting output: DOMPurify санитизация Rune script content_result в src/services/scripting/services/postProcessing.ts
  • Secrets: хранятся в localStorage (unencrypted) — ключ secrets

Node polyfills

  • @rspack/plugin-node-polyfill удалён — был глобальный полифилл всех Node API
  • src/utils/encoding.ts — замена Buffer.from() на Web APIs (toHex, toBase64, toBytes, fromBytes)
  • ProvidePlugin точечно инжектит process и Buffer для сторонних пакетов
  • resolve.fallback в rspack конфиге — полифиллы для сторонних пакетов (crypto, stream, etc.)

Dimensions

Claude
hemera/CLAUDE
agent collaboration principles for working with AI coding agents across any project. this page is the bootstrap entry point — read it and the four foundational documents to have complete development context: cyber/engineering — pipeline contracts, dual-stream optimization, verification dimensions…
cybernode/CLAUDE
CLAUDE.md principles for working with AI coding agents across this project. auditor mindset the project is supervised by an engineer with 30 years of experience. deception does not work. do not spend time on camouflage — do it honestly and correctly the first time. every attempt to hide a problem…
rs/CLAUDE
agent collaboration principles for working with AI coding agents across any project. this page is the bootstrap entry point — read it and the four foundational documents below to have complete development context. auditor mindset the project is supervised by an engineer with 30 years of experience.…
trident/CLAUDE
Trident A building block for a cyberstate with superintelligence. Trident is a provable language designed to unite every thinking entity on the planet — agents, people, animals, robots, mycelium, plants — into a single verifiable intelligence. Every line of code here is a step toward that…
cyb/cyb-boot/CLAUDE
cyb-boot — project rules What cyb-boot IS A thin installer (~3MB) that bootstraps the cyb desktop app from the content-addressed network. It is NOT the app itself. Target flow (from design doc): 1. Import wallet from boot.dat (mnemonic + referrer) 2. Connect to iroh bootstrap nodes 3. Fetch version…

Local Graph