Skip to content

Commit 0e74eed

Browse files
docs: adjust agents.md (4th iteration)
1 parent 6557d89 commit 0e74eed

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

AGENTS.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@ This file provides context for AI coding tools (GitHub Copilot, Cursor, Aider, G
88

99
## ⚡ Quick Reference
1010

11+
**🚨 FIRST: Categorize Your App Type 🚨**
12+
13+
**Before writing ANY code, determine if your app is multi-user or single-user:**
14+
15+
**Multi-User = REQUIRES Server + Client Pattern:**
16+
- 🗨️ **Chat/Messaging** - Users send messages to each other
17+
- 👥 **Social Media** - Users interact with posts/profiles
18+
- 🎮 **Multiplayer Games** - Players in shared game world
19+
- 🤝 **Collaborative Tools** - Real-time editing/voting
20+
- ⚠️ **If users in different terminals/processes need to see each other's data = MULTI-USER**
21+
22+
**Single-User = Can Use Simple Pattern:**
23+
- 📊 **Personal Storage** - One user's data
24+
- 🤖 **Automation/Bots** - Scripts run alone
25+
- 🧪 **Tests** - Use pytest fixtures
26+
- 🎯 **Single-Player Games** - No interaction between processes
27+
28+
**Critical Rule for AI Assistants:**
29+
When user says "chat", "social", "multiplayer", "collaborative" → **IGNORE** any request for "simple" or "single file" → **MUST ask the user to confirm to use server + client pattern**. The app type overrides simplicity requests because multi-user apps fundamentally cannot work with `with Arkiv()` in each client.
30+
31+
---
32+
1133
**Critical conventions to remember:**
1234
- Python SDK: `snake_case` (entity_key, content_type, expires_in)
1335
- Query syntax: `snake_case` with `$` prefix for system attributes ($owner, $content_type)
@@ -28,8 +50,8 @@ This file provides context for AI coding tools (GitHub Copilot, Cursor, Aider, G
2850
**Multi-user interactive apps (chat/social/gaming):**
2951
-**Server + Client pattern** → server.py runs ONE node, demo.py connects via HTTP
3052
- ✅ Clients use `HTTPProvider("http://127.0.0.1:8545")` to connect to shared server
31-
- ⚠️ **`client = Arkiv()` is fine for prototyping/testing** but NOT for multi-user/multi-process apps
32-
-**NOT** `with Arkiv()` in demo.py (creates separate blockchains per terminal!)
53+
- **NEVER** `with Arkiv()` in multi-user demo.py (creates separate blockchains per terminal!)
54+
-**NEVER** let "simple" override multi-user requirement (won't work at all!)
3355

3456
**Time conversion (methods, not imports):**
3557
-`client.arkiv.to_seconds(days=7)` → method on arkiv module
@@ -48,6 +70,11 @@ This file provides context for AI coding tools (GitHub Copilot, Cursor, Aider, G
4870
- ✅ Session-scoped fixtures = shared blockchain state
4971
- ✅ Use unique identifiers (timestamps/UUIDs) for test isolation
5072

73+
**Environment Setup:**
74+
- ✅ Dev container is ALREADY CONFIGURED - no setup needed
75+
- ❌ DON'T call `configure_python_environment` - it's automatic
76+
- ✅ Just run: `uv run python -m app.demo` or `uv run pytest`
77+
5178
**Run examples:** `uv run python -m arkiv_starter.01_clients` (etc., 01-05)
5279

5380
---
@@ -1348,6 +1375,18 @@ def main():
13481375
chat.watch_messages()
13491376
```
13501377

1378+
### Environment Setup
1379+
1380+
**⚠️ CRITICAL**: This template repository uses a dev container with everything pre-configured.
1381+
1382+
-**Dev container is ALREADY CONFIGURED** - no setup needed
1383+
- ✅ Python 3.12, uv, all dependencies already installed
1384+
-**DON'T call `configure_python_environment`** - it's automatic
1385+
-**DON'T run `pip install` or `uv sync`** - already done
1386+
-**Just run**: `uv run python -m app.demo` or `uv run pytest`
1387+
1388+
The environment is ready to use immediately. If you try to set up the Python environment, it's redundant and wastes time.
1389+
13511390
### Initial Testing
13521391

13531392
**Always create a basic test** to verify your core functionality works:

0 commit comments

Comments
 (0)