geqintan commited on
Commit
292d9af
·
1 Parent(s): 899fb0b
.clinerules ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 自定义指令
2
+ CUSTOM_INSTRUCTIONS = """
3
+ # 必须遵守的约束
4
+ - 所有交流均采用中文
5
+
6
+ # 实现目标
7
+ - 根据用户需要决定
8
+ - 如果有问题,请向用户进行调研,调研时,每次只允许提问一个问题
9
+ - 追求最小完整功能模式,并提供完整测试
10
+ - 采用逐步迭代模式开发
11
+
12
+ # 知识参考
13
+ - 暂无
14
+
15
+ """
16
+
17
+
18
+ ---
19
+ description: Describes Cline's Memory Bank system, its structure, and workflows for maintaining project knowledge across sessions.
20
+ author: https://github.com/nickbaumann98
21
+ version: 1.0
22
+ tags: ["memory-bank", "knowledge-base", "core-behavior", "documentation-protocol"]
23
+ globs: ["memory-bank/**/*.md", "*"]
24
+ ---
25
+ # Cline's Memory Bank
26
+
27
+ I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
28
+
29
+ ## Memory Bank Structure
30
+
31
+ The Memory Bank consists of core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
32
+
33
+ ```mermaid
34
+ flowchart TD
35
+ PB[projectbrief.md] --> PC[productContext.md]
36
+ PB --> SP[systemPatterns.md]
37
+ PB --> TC[techContext.md]
38
+
39
+ PC --> AC[activeContext.md]
40
+ SP --> AC
41
+ TC --> AC
42
+
43
+ AC --> P[progress.md]
44
+ ```
45
+
46
+ ### Core Files (Required)
47
+ 1. `projectbrief.md`
48
+ - Foundation document that shapes all other files
49
+ - Created at project start if it doesn't exist
50
+ - Defines core requirements and goals
51
+ - Source of truth for project scope
52
+
53
+ 2. `productContext.md`
54
+ - Why this project exists
55
+ - Problems it solves
56
+ - How it should work
57
+ - User experience goals
58
+
59
+ 3. `activeContext.md`
60
+ - Current work focus
61
+ - Recent changes
62
+ - Next steps
63
+ - Active decisions and considerations
64
+ - Important patterns and preferences
65
+ - Learnings and project insights
66
+
67
+ 4. `systemPatterns.md`
68
+ - System architecture
69
+ - Key technical decisions
70
+ - Design patterns in use
71
+ - Component relationships
72
+ - Critical implementation paths
73
+
74
+ 5. `techContext.md`
75
+ - Technologies used
76
+ - Development setup
77
+ - Technical constraints
78
+ - Dependencies
79
+ - Tool usage patterns
80
+
81
+ 6. `progress.md`
82
+ - What works
83
+ - What's left to build
84
+ - Current status
85
+ - Known issues
86
+ - Evolution of project decisions
87
+
88
+ ### Additional Context
89
+ Create additional files/folders within memory-bank/ when they help organize:
90
+ - Complex feature documentation
91
+ - Integration specifications
92
+ - API documentation
93
+ - Testing strategies
94
+ - Deployment procedures
95
+
96
+ ## Core Workflows
97
+
98
+ ### Plan Mode
99
+ ```mermaid
100
+ flowchart TD
101
+ Start[Start] --> ReadFiles[Read Memory Bank]
102
+ ReadFiles --> CheckFiles{Files Complete?}
103
+
104
+ CheckFiles -->|No| Plan[Create Plan]
105
+ Plan --> Document[Document in Chat]
106
+
107
+ CheckFiles -->|Yes| Verify[Verify Context]
108
+ Verify --> Strategy[Develop Strategy]
109
+ Strategy --> Present[Present Approach]
110
+ ```
111
+
112
+ ### Act Mode
113
+ ```mermaid
114
+ flowchart TD
115
+ Start[Start] --> Context[Check Memory Bank]
116
+ Context --> Update[Update Documentation]
117
+ Update --> Execute[Execute Task]
118
+ Execute --> Document[Document Changes]
119
+ ```
120
+
121
+ ## Documentation Updates
122
+
123
+ Memory Bank updates occur when:
124
+ 1. Discovering new project patterns
125
+ 2. After implementing significant changes
126
+ 3. When user requests with **update memory bank** (MUST review ALL files)
127
+ 4. When context needs clarification
128
+
129
+ ```mermaid
130
+ flowchart TD
131
+ Start[Update Process]
132
+
133
+ subgraph Process
134
+ P1[Review ALL Files]
135
+ P2[Document Current State]
136
+ P3[Clarify Next Steps]
137
+ P4[Document Insights & Patterns]
138
+
139
+ P1 --> P2 --> P3 --> P4
140
+ end
141
+
142
+ Start --> Process
143
+ ```
144
+
145
+ Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
146
+
147
+ REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.
148
+
149
+ """
150
+ # 自动批准规则
151
+ AUTO_APPROVE = true
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.12
5
+
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV PATH="/home/user/.local/bin:$PATH"
9
+
10
+ WORKDIR /app
11
+
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ COPY --chown=user . /app
16
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
__pycache__/app.cpython-39.pyc ADDED
Binary file (352 Bytes). View file
 
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # uvicorn app:app --host 0.0.0.0 --port 7860 reload
2
+
3
+ from fastapi import FastAPI
4
+
5
+ app = FastAPI()
6
+
7
+ @app.get("/")
8
+ def greet_json():
9
+ return {"Hello": "World!"}
memory-bank/activeContext.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 活跃背景 (activeContext.md)
2
+
3
+ ## 当前工作焦点
4
+ - **当前任务**: 规划FastAPI项目结构和Hugging Face Space Docker部署。
5
+ - **最近更改**: 更新了`projectbrief.md`, `techContext.md`, `systemPatterns.md`以反映FastAPI和Docker部署信息。
6
+
7
+ ## 下一步计划
8
+ - 制定详细的项目结构和文件清单。
9
+ - 编写FastAPI应用的基础代码。
10
+ - 准备Dockerfile和requirements.txt文件。
11
+ - 确认API功能需求。
12
+
13
+ ## 活跃决策与考量
14
+ - 确保Memory Bank文件结构完整。
15
+ - 保持文档的清晰和简洁。
16
+
17
+ ## 学习与项目洞察
18
+ - Memory Bank是项目持续开发的关键。
19
+ - 初始阶段的文档建立对后续工作至关重要。
memory-bank/productContext.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 产品背景 (productContext.md)
2
+
3
+ ## 项目存在的意义
4
+ - **解决的问题**:
5
+ - **用户价值**:
6
+
7
+ ## 功能概述
8
+ - **核心功能**:
9
+ - **非核心功能**:
10
+
11
+ ## 用户体验目标
12
+ - **目标用户**:
13
+ - **用户旅程**:
14
+ - **设计原则**:
memory-bank/progress.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 进度 (progress.md)
2
+
3
+ ## 已完成的工作
4
+ - 初始化了项目记忆库,创建了所有核心记忆文件。
5
+ - 根据用户反馈,更新了`projectbrief.md`、`techContext.md`和`systemPatterns.md`,明确了项目将基于FastAPI和Hugging Face Space Docker进行部署。
6
+
7
+ ## 待完成的工作
8
+ - 确定FastAPI API的具体功能和端点。
9
+ - 创建FastAPI应用的基础文件结构。
10
+ - 编写`requirements.txt`和`Dockerfile`。
11
+ - 实现API逻辑。
12
+ - 测试API功能。
13
+ - 部署到Hugging Face Space。
14
+
15
+ ## 当前状态
16
+ - 项目记忆库已更新,明确了技术栈和部署方式。
17
+ - 正在进行项目结构和API功能的规划。
18
+
19
+ ## 已知问题
20
+ - 暂无。
21
+
22
+ ## 项目决策演变
23
+ - 暂无。
memory-bank/projectbrief.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 项目简报 (projectbrief.md)
2
+
3
+ ## 核心需求与目标
4
+ - **项目名称**: airs-team
5
+ - **项目目标**: 构建一个基于FastAPI的轻量级服务器接口,并部署到Hugging Face Space Docker环境。
6
+ - **项目范围**: 实现核心API功能,确保Docker部署流程顺畅。
7
+
8
+ ## 初始设定
9
+ - **开发语言**: Python
10
+ - **主要框架/库**: FastAPI
11
+ - **数据库**: 待定 (根据具体需求决定,目前可能不需要)
12
+ - **部署环境**: Hugging Face Space Docker
13
+
14
+ ## 待定事项
15
+ - 详细的产品需求
16
+ - 技术栈的最终确定
17
+ - 部署流程的定义
memory-bank/systemPatterns.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 系统模式 (systemPatterns.md)
2
+
3
+ ## 系统架构
4
+ - **整体架构**: 轻量级RESTful API服务
5
+ - **模块划分**: 核心FastAPI应用,可能包含路由、模型、服务等模块。
6
+
7
+ ## 关键技术决策
8
+ - **设计模式**: MVC/MVP (根据FastAPI的结构进行调整)
9
+ - **数据流**: HTTP请求 -> FastAPI路由 -> 业务逻辑 -> HTTP响应
10
+ - **通信机制**: HTTP/HTTPS
11
+
12
+ ## 组件关系
13
+ - **核心组件**: FastAPI应用
14
+ - **依赖关系**: Uvicorn (ASGI服务器), Docker (部署容器)
15
+
16
+ ## 关键实现路径
17
+ - **认证/授权**: 待定 (根据具体需求,可能使用OAuth2/JWT)
18
+ - **数据存储**: 待定 (如果需要持久化数据)
19
+ - **业务逻辑**: 根据API功能定义具体实现
memory-bank/techContext.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 技术背景 (techContext.md)
2
+
3
+ ## 使用的技术
4
+ - **编程语言**: Python
5
+ - **前端技术**: 无 (纯后端API)
6
+ - **后端技术**: FastAPI
7
+ - **数据库技术**: 无 (或待定,根据具体需求)
8
+ - **其他工具/服务**: Docker, Hugging Face Spaces
9
+
10
+ ## 开发环境设置
11
+ - **操作系统**:
12
+ - **IDE/编辑器**:
13
+ - **版本控制**:
14
+ - **包管理工具**:
15
+
16
+ ## 技术约束与挑战
17
+ - **性能要求**:
18
+ - **安全考虑**:
19
+ - **可扩展性**:
20
+ - **兼容性**:
21
+
22
+ ## 依赖项
23
+ - **第三方库/API**:
24
+ - **内部服务依赖**:
25
+
26
+ ## 工具使用模式
27
+ - **构建工具**:
28
+ - **测试工具**:
29
+ - **部署工具**:
push.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ git add .
2
+ git commit -m "update"
3
+ git push
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastapi
2
+ uvicorn[standard]