home / skills / cacr92 / wereply / project-overview

project-overview skill

/.trae/skills/project-overview

This skill provides an auto-loaded project overview to help developers understand architecture, core technologies, and module relationships.

npx playbooks add skill cacr92/wereply --skill project-overview

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.8 KB
---
name: project-overview
description: 项目背景知识,自动加载,不可手动调用。
---

# CaCrFeedFormula 项目概览

## 项目简介
**饲料配方优化系统** - Tauri + Rust + React TypeScript 桌面应用

## 核心技术栈

### 后端 (Rust 2021)
- Tauri 2.9.0 + Tokio 1.37(异步运行时)
- SQLite + SQLx 0.7(编译时类型安全)
- HiGHS 1.12(工业级线性规划求解器)
- Moka 0.12(高性能缓存)
- specta 2.0 + tauri-specta 2.0(自动类型生成)
- Rayon 1.8(并行计算)

### 前端 (React 19.1 + TypeScript 5.8)
- Ant Design 5.26 + Tailwind CSS 4.1
- TanStack Query 5.17(状态管理)
- Vite 7.0(构建工具)
- Recharts 2.15(可视化)

## 项目结构
```
src/                    # Rust 后端
├── ai/                 # AI 服务
├── formula/            # 配方优化核心
├── material/           # 原料管理
├── species/            # 品种管理
├── premix/             # 预混料设计
├── profit/             # 盈亏测算
├── prediction/         # 营养预测
└── production_batch/   # 生产批次管理

frontend/               # React 前端
└── src/
    ├── components/     # React 组件
    └── bindings.ts     # 自动生成的类型绑定
```

## 核心功能
1. **配方优化系统**:线性规划优化、手工配方设计、预混料反向计算
2. **数据管理**:原料、品种、工厂、生产批次、库存管理
3. **分析决策**:盈亏测算、营养预测、敏感性分析
4. **AI 助手**:流式响应、多轮对话、支持多平台

## 项目特点
- **桌面应用**:非 Web 应用,跨平台桌面应用
- **高性能计算**:Rust 后端保证速度和稳定性
- **类型安全**:specta 自动生成 TypeScript 类型
- **异步优先**:全面使用 Tokio 异步运行时
- **工业级优化**:HiGHS 求解器支持大规模配方优化
- **167 个 Tauri 命令**:覆盖 10 个模块

## 开发场景
- **配方引擎**:实现复杂线性规划算法
- **原料数据库**:管理大规模数据集
- **桌面 UI**:构建响应式 Ant Design 界面
- **Tauri 命令**:创建类型安全的 Rust ↔ TypeScript 通信
- **AI 功能**:集成流式 AI 响应
- **批次处理**:处理生产批次计算和调度

## 关键集成点
- **Rust ↔ TypeScript**:specta 生成 bindings.ts
- **数据库 ↔ 业务逻辑**:SQLx 宏提供编译时 SQL 验证
- **前端 ↔ 后端**:TanStack Query 管理服务器状态
- **AI ↔ 用户**:流式 SSE 响应实时更新 UI

## 开发规范
详见 `.claude/rules/` 目录:
- 02-rust-backend-standards.md
- 03-react-frontend-standards.md
- 04-database-standards.md
- 05-lsp-usage-standards.md
- 06-security-standards.md
- 07-testing-standards.md
- 08-performance-standards.md

Overview

This skill provides a concise, structured project overview for a desktop feed-formulation application built with Tauri, Rust, and React. It highlights core architecture, main modules, key integrations, and development scenarios to onboard engineers and stakeholders quickly. The content is optimized for clarity and practical decision-making.

How this skill works

The skill inspects the codebase layout and technology stack, summarizing backend and frontend responsibilities, major modules, and integration points. It extracts core features like linear-programming optimization, data management, AI assistant capabilities, and the development best practices used across the project. The output focuses on actionable insights for developers, product managers, and architects.

When to use it

  • Onboarding new engineers to the project
  • Preparing technical overviews for architecture reviews
  • Planning integrations between Rust backend and TypeScript frontend
  • Prioritizing work for performance-critical modules
  • Documenting key modules for cross-team collaboration

Best practices

  • Emphasize type-safe boundaries: use automatic type generation between Rust and TypeScript
  • Keep async-first patterns: centralize Tokio-based tasks and avoid blocking calls in the backend
  • Leverage SQLx compile-time checks for database queries to reduce runtime errors
  • Isolate heavy numerical work: run optimization in dedicated threads or Rayon pools
  • Design API contracts with specta-generated bindings to prevent drift between frontend and backend

Example use cases

  • Quickly understand where formula optimization, material management, and production-batch logic live
  • Identify which modules to extend when adding a new AI-driven feature or streaming response
  • Plan a migration or upgrades for Tauri, Tokio, or HiGHS components with minimal cross-module impact
  • Prepare a testing strategy for performance-sensitive paths like linear-programming and batch processing
  • Map dependencies when integrating a new visualization or state-management feature into the React frontend

FAQ

What are the primary languages and frameworks used?

Backend is Rust (async Tokio, SQLx, HiGHS, Rayon); frontend is React + TypeScript with Ant Design and Tailwind; Tauri provides the desktop shell.

How is type safety maintained across the stack?

specta generates TypeScript bindings from Rust types so frontend and backend share consistent type definitions.

Where should optimization logic run?

Place heavy linear-programming and numerical tasks in the Rust backend, using HiGHS for solver work and Rayon for parallelism; expose results via typed Tauri commands.