Skip to content

Commit e664619

Browse files
authored
Merge pull request #417 from fastapiadmin/dev
Dev
2 parents 980aedd + 34b2d93 commit e664619

389 files changed

Lines changed: 52517 additions & 673 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CLAUDE.md‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CLAUDE.md
2+
3+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
4+
5+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
6+
7+
## 1. Think Before Coding
8+
9+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
10+
11+
Before implementing:
12+
- State your assumptions explicitly. If uncertain, ask.
13+
- If multiple interpretations exist, present them - don't pick silently.
14+
- If a simpler approach exists, say so. Push back when warranted.
15+
- If something is unclear, stop. Name what's confusing. Ask.
16+
17+
## 2. Simplicity First
18+
19+
**Minimum code that solves the problem. Nothing speculative.**
20+
21+
- No features beyond what was asked.
22+
- No abstractions for single-use code.
23+
- No "flexibility" or "configurability" that wasn't requested.
24+
- No error handling for impossible scenarios.
25+
- If you write 200 lines and it could be 50, rewrite it.
26+
27+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
28+
29+
## 3. Surgical Changes
30+
31+
**Touch only what you must. Clean up only your own mess.**
32+
33+
When editing existing code:
34+
- Don't "improve" adjacent code, comments, or formatting.
35+
- Don't refactor things that aren't broken.
36+
- Match existing style, even if you'd do it differently.
37+
- If you notice unrelated dead code, mention it - don't delete it.
38+
39+
When your changes create orphans:
40+
- Remove imports/variables/functions that YOUR changes made unused.
41+
- Don't remove pre-existing dead code unless asked.
42+
43+
The test: Every changed line should trace directly to the user's request.
44+
45+
## 4. Goal-Driven Execution
46+
47+
**Define success criteria. Loop until verified.**
48+
49+
Transform tasks into verifiable goals:
50+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
51+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
52+
- "Refactor X" → "Ensure tests pass before and after"
53+
54+
For multi-step tasks, state a brief plan:
55+
```
56+
1. [Step] → verify: [check]
57+
2. [Step] → verify: [check]
58+
3. [Step] → verify: [check]
59+
```
60+
61+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
62+
63+
---
64+
65+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.

‎CLAUDE.zh.md‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CLAUDE.md
2+
3+
用于减少常见 LLM 编码错误的行为准则。可按需与项目特定指令合并使用。
4+
5+
**权衡:** 这些准则更偏向谨慎而不是速度。对于琐碎任务,请自行判断。
6+
7+
## 1. 编码前先思考
8+
9+
**不要假设。不要掩饰困惑。明确呈现权衡。**
10+
11+
在实现之前:
12+
- 明确写出你的假设。如果不确定,就提问。
13+
- 如果存在多种解释,先把它们列出来,不要默默自行选择。
14+
- 如果有更简单的方法,就直接指出来。在有必要时提出异议。
15+
- 如果有不清楚的地方,就停下来。说清楚困惑点,并提问。
16+
17+
## 2. 简单优先
18+
19+
**只写解决问题所需的最少代码。不做任何预设性扩展。**
20+
21+
- 不要加入超出需求范围的功能。
22+
- 不要为一次性代码做抽象。
23+
- 不要加入未被要求的“灵活性”或“可配置性”。
24+
- 不要为不可能发生的场景写错误处理。
25+
- 如果你写了 200 行,但 50 行就够,就重写。
26+
27+
问问自己:“一个资深工程师会认为这太复杂了吗?” 如果答案是会,那就继续简化。
28+
29+
## 3. 外科手术式修改
30+
31+
**只改必须改的内容。只清理你自己造成的问题。**
32+
33+
编辑现有代码时:
34+
- 不要“顺手优化”相邻代码、注释或格式。
35+
- 不要重构没有坏掉的部分。
36+
- 保持现有风格,即使你个人会写成别的样子。
37+
- 如果发现无关的死代码,可以指出,但不要删除。
38+
39+
当你的改动产生遗留项时:
40+
- 删除那些因你的修改而变成未使用的 import、变量或函数。
41+
- 不要删除原本就存在的死代码,除非被明确要求。
42+
43+
检验标准:每一行改动都应当能直接追溯到用户请求。
44+
45+
## 4. 目标驱动执行
46+
47+
**先定义成功标准,再循环推进,直到验证通过。**
48+
49+
把任务转换成可验证的目标:
50+
- “添加校验” → “先为非法输入写测试,再让测试通过”
51+
- “修复这个 bug” → “先写能复现它的测试,再让测试通过”
52+
- “重构 X” → “确保改动前后测试都通过”
53+
54+
对于多步骤任务,先给出简短计划:
55+
```
56+
1. [步骤] → 验证:[检查项]
57+
2. [步骤] → 验证:[检查项]
58+
3. [步骤] → 验证:[检查项]
59+
```
60+
61+
强有力的成功标准能让你独立闭环推进。弱成功标准(“把它弄好”)则会不断需要额外澄清。
62+
63+
---
64+
65+
**如果这些准则正在发挥作用,你会看到:** diff 中不必要的改动更少,因为过度复杂而返工的次数更少,而且澄清性问题会出现在实现之前,而不是出错之后。

‎frontend/web-old/.editorconfig‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
# 表示所有文件适用
5+
[*]
6+
charset = utf-8 # 设置文件字符集为 utf-8
7+
end_of_line = lf # 控制换行类型(lf | cr | crlf)
8+
indent_style = space # 缩进风格(tab | space)
9+
indent_size = 2 # 缩进大小
10+
insert_final_newline = true # 始终在文件末尾插入一个新行
11+
12+
# 表示仅 md 文件适用以下规则
13+
[*.md]
14+
max_line_length = off # 关闭最大行长度限制
15+
trim_trailing_whitespace = false # 关闭末尾空格修剪

‎frontend/web-old/.env.development‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 环境
2+
VITE_APP_ENV=development
3+
4+
# 项目名称
5+
VITE_APP_TITLE=fastapiadmin
6+
7+
# 网络请求公用地址,根据实际部署情况修改
8+
VITE_API_BASE_URL=http://127.0.0.1:8001
9+
10+
# 代理前缀
11+
VITE_APP_BASE_API=/api/v1
12+
13+
# 应用端口
14+
VITE_APP_PORT=5180
15+
16+
# 超时时间
17+
VITE_TIMEOUT=10000
18+
19+
# WebSocket 端点(不配置则关闭),ai对话需要配置
20+
VITE_APP_WS_ENDPOINT=ws://127.0.0.1:8001

‎frontend/web-old/.env.production‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 环境
2+
VITE_APP_ENV=production
3+
4+
# 项目名称
5+
VITE_APP_TITLE=fastapiadmin
6+
7+
# 网络请求公用地址,如果没有认证可以使用http
8+
VITE_API_BASE_URL=https://your-domain.com
9+
10+
# 代理前缀
11+
VITE_APP_BASE_API=/api/v1
12+
13+
# 应用端口
14+
VITE_APP_PORT=5180
15+
16+
# 超时时间
17+
VITE_TIMEOUT=10000
18+
19+
# WebSocket 端点(不配置则关闭),ai对话需要配置,如果没有认证wss需要改为ws
20+
VITE_APP_WS_ENDPOINT=wss://your-domain.com

0 commit comments

Comments
 (0)