shubhjn commited on
Commit
5a0b87c
·
0 Parent(s):
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .agent/AGENT_MEMORY.md +174 -0
  2. .agent/Backend/API_Versioning.md +23 -0
  3. .agent/Backend/ApiDesign.md +21 -0
  4. .agent/Backend/Authentication_Strategies.md +21 -0
  5. .agent/Backend/CachingStrategies.md +23 -0
  6. .agent/Backend/DatabaseNormalization.md +25 -0
  7. .agent/Backend/DatabaseOptimization.md +19 -0
  8. .agent/Backend/DatabaseScalability.md +22 -0
  9. .agent/Backend/DenoRuntime.md +21 -0
  10. .agent/Backend/Microservices_Communication.md +21 -0
  11. .agent/Backend/Nodejs_Cluster.md +21 -0
  12. .agent/Backend/ORM_BestPractices.md +21 -0
  13. .agent/Backend/PubSub_Architecture.md +21 -0
  14. .agent/Backend/ServerActions.md +14 -0
  15. .agent/Backend/WebSockets.md +13 -0
  16. .agent/Design/Animations.md +14 -0
  17. .agent/Design/ColorPalettes.md +21 -0
  18. .agent/Design/ColorTheory.md +25 -0
  19. .agent/Design/DesignSystem.md +18 -0
  20. .agent/Design/Glassmorphism.md +21 -0
  21. .agent/Design/Glassmorphism_Advanced.md +21 -0
  22. .agent/Design/Layout_Grid.md +21 -0
  23. .agent/Design/Layout_Pillars.md +27 -0
  24. .agent/Design/MicroAnimations.md +21 -0
  25. .agent/Design/Typography_Advanced.md +25 -0
  26. .agent/Design/Typography_Scales.md +21 -0
  27. .agent/DevOps/CiCd.md +20 -0
  28. .agent/DevOps/ContinuousDeployment.md +25 -0
  29. .agent/DevOps/DockerBestPractices.md +21 -0
  30. .agent/DevOps/IaC.md +13 -0
  31. .agent/DevOps/InfrastructureAsCode.md +25 -0
  32. .agent/DevOps/Kubernetes.md +23 -0
  33. .agent/DevOps/Logging_Monitoring.md +22 -0
  34. .agent/DevOps/MonitoringPerformance.md +23 -0
  35. .agent/DevOps/Monitoring_Alerting.md +21 -0
  36. .agent/Engineering/API_First_Development.md +23 -0
  37. .agent/Engineering/BigO_Notation.md +25 -0
  38. .agent/Engineering/CI_CD_Philosophy.md +21 -0
  39. .agent/Engineering/CleanCode.md +20 -0
  40. .agent/Engineering/CodeReviewGuidelines.md +28 -0
  41. .agent/Engineering/Concurrency_Patterns.md +27 -0
  42. .agent/Engineering/Constants.md +23 -0
  43. .agent/Engineering/DRY_KISS_YAGNI.md +16 -0
  44. .agent/Engineering/DataStructures.md +27 -0
  45. .agent/Engineering/Debugging.md +21 -0
  46. .agent/Engineering/DependencyInjection.md +17 -0
  47. .agent/Engineering/DesignPatterns_Behavioral.md +41 -0
  48. .agent/Engineering/DesignPatterns_Creational.md +24 -0
  49. .agent/Engineering/DesignPatterns_Structural.md +30 -0
  50. .agent/Engineering/E2ETesting.md +21 -0
.agent/AGENT_MEMORY.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AGENT_MEMORY.md — Unified Agent Memory System
2
+ <!-- trigger: always_on -->
3
+ <!-- priority: P0 — Read this BEFORE any other file -->
4
+
5
+ > **MANDATORY:** Every AI agent (Antigravity, Gemini, Claude, Codex, any terminal script)
6
+ > **MUST** read this file at the **start of every conversation or session** when the `.Agent`
7
+ > folder is present in the workspace. This is the highest-priority initialization step.
8
+
9
+ ---
10
+
11
+ ## 🧠 What is the Agent Memory System?
12
+
13
+ A locally-running, filesystem-based shared memory layer for all AI agents. It persists:
14
+ - **Tasks** — current work, status, description, and which agent owns it
15
+ - **Checkpoints** — compressed mid-task snapshots so you can resume without context loss
16
+ - **Knowledge** — reusable facts and architecture decisions
17
+ - **Usage** — per-agent token consumption for optimization
18
+
19
+ All data lives in `.Agent/memory/` as plain JSON. No server. No cloud. No dependencies.
20
+
21
+ ---
22
+
23
+ ## 📋 Step 1: Load Current Context (MANDATORY at session start)
24
+
25
+ Run this at the beginning of **every** conversation to get your current task context:
26
+
27
+ ```bash
28
+ python .Agent/scripts/memory_engine.py --context --agent <YOUR_AGENT_NAME> --max-tokens 4000
29
+ ```
30
+
31
+ This returns a `<MEMORY_CONTEXT>` block. **Inject it into your first response** so you
32
+ know what task is in progress without the user having to repeat themselves.
33
+
34
+ **Agent name examples** (use any string — fully dynamic):
35
+ - `antigravity`, `gemini`, `claude`, `codex`, `terminal`, `my_script`, `claude-code`
36
+
37
+ ---
38
+
39
+ ## 📝 Step 2: Register Your Task (when starting or resuming work)
40
+
41
+ ```bash
42
+ # New task
43
+ python .Agent/scripts/memory_engine.py --write \
44
+ --task "Build auth module" \
45
+ --agent "antigravity" \
46
+ --status "in_progress" \
47
+ --description "Implementing JWT + refresh token flow for the API"
48
+
49
+ # Resume existing task
50
+ python .Agent/scripts/memory_engine.py --write \
51
+ --task-id <ID_FROM_CONTEXT> \
52
+ --task "Build auth module" \
53
+ --agent "antigravity" \
54
+ --status "in_progress"
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 💾 Step 3: Save Checkpoints (CRITICAL — before context grows large)
60
+
61
+ Save a checkpoint **proactively** every ~30,000 tokens or at the end of a major step:
62
+
63
+ ```bash
64
+ python .Agent/scripts/memory_engine.py --checkpoint \
65
+ --task-id <TASK_ID> \
66
+ --agent "antigravity" \
67
+ --summary "Completed DB schema design. Next: implement routes." \
68
+ --content "Schema: users(id, email, hash), tokens(id, user_id, expires_at)..."
69
+ ```
70
+
71
+ The context will be auto-compressed before saving, so it stays small.
72
+
73
+ ---
74
+
75
+ ## ⚡ Step 4: Check & Optimize Token Usage
76
+
77
+ ```bash
78
+ # Check your token usage
79
+ python .Agent/scripts/usage_tracker.py --report
80
+
81
+ # Get optimization tips
82
+ python .Agent/scripts/usage_tracker.py --tips
83
+
84
+ # Log what you just used (call this after a long session)
85
+ python .Agent/scripts/usage_tracker.py --log \
86
+ --agent "antigravity" \
87
+ --model "gemini-2.5-pro" \
88
+ --input 15000 \
89
+ --output 8000 \
90
+ --task-id <TASK_ID>
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 🔍 Step 5: Search Past Memory (when unsure what was done)
96
+
97
+ ```bash
98
+ python .Agent/scripts/memory_engine.py --search "auth module"
99
+ python .Agent/scripts/memory_engine.py --search "database schema"
100
+ ```
101
+
102
+ ---
103
+
104
+ ## ✅ Step 6: Complete a Task
105
+
106
+ ```bash
107
+ python .Agent/scripts/memory_engine.py --complete \
108
+ --task-id <TASK_ID> \
109
+ --summary "Auth module complete. JWT + refresh + middleware all working."
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 🚨 Context Window Emergency Protocol
115
+
116
+ If you are **near your context limit**, do this immediately:
117
+
118
+ ```bash
119
+ # 1. Auto-compress and checkpoint everything
120
+ python .Agent/scripts/context_optimizer.py --auto-checkpoint \
121
+ --task-id <TASK_ID> --agent <NAME> --input context_dump.txt --threshold 60000
122
+
123
+ # 2. Start a fresh conversation
124
+ # 3. At the start of the new conversation, run Step 1 above to reload context
125
+ ```
126
+
127
+ ---
128
+
129
+ ## 📊 Live Dashboard
130
+
131
+ Open the local dashboard in any browser (no server needed):
132
+ ```
133
+ d:\Code\.Agent\dashboard\index.html
134
+ ```
135
+
136
+ Or via PowerShell aliases (after running `setup_memory_hook.ps1`):
137
+ ```powershell
138
+ agent-status # Current session + task
139
+ agent-report # Token usage per agent
140
+ agent-tips # Optimization recommendations
141
+ agent-watch # Live watch for changes
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 🔌 Cross-Agent Compatibility
147
+
148
+ | Agent | How to inject AGENT_MEMORY.md |
149
+ |-----------------|-------------------------------|
150
+ | **Antigravity** | Add to `.gemini/GEMINI.md`: `always_on` trigger |
151
+ | **Gemini CLI** | Add `@.Agent/AGENT_MEMORY.md` to your prompt |
152
+ | **Claude** | Add to `CLAUDE.md` or system prompt |
153
+ | **Codex / GPT** | Include in `system_prompt.txt` |
154
+ | **Terminal** | `python .Agent/scripts/activate.py` on shell start |
155
+ | **Custom** | `python .Agent/scripts/memory_engine.py --context --agent <name>` |
156
+
157
+ See **MEMORY_PROTOCOL.md** for the full JSON schema and integration spec.
158
+
159
+ ---
160
+
161
+ ## 📁 File Reference
162
+
163
+ | File | Purpose |
164
+ |------|---------|
165
+ | `memory/memory-store.json` | Tasks, checkpoints, knowledge (persistent) |
166
+ | `memory/usage-tracker.json` | Per-agent token usage log |
167
+ | `memory/session.json` | Hot session state (fast read) |
168
+ | `scripts/memory_engine.py` | Core read/write/compress/search |
169
+ | `scripts/usage_tracker.py` | Token usage logging and reports |
170
+ | `scripts/context_optimizer.py` | Token budget + auto-compress |
171
+ | `scripts/activate.py` | Session initializer |
172
+ | `scripts/workspace_watcher.py` | Live status watcher |
173
+ | `dashboard/index.html` | Local web dashboard |
174
+ | `setup_memory_hook.ps1` | PowerShell auto-activation installer |
.agent/Backend/API_Versioning.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API Versioning Strategies
2
+
3
+ ## 1. URL Versioning
4
+
5
+ Include the version number in the URL (e.g., `/v1/users`). This is the most common and visible strategy.
6
+
7
+ ## 2. Header Versioning
8
+
9
+ Define the version in a custom header (e.g., `X-API-Version: 1`). This keeps URLs clean and avoids breaking existing links.
10
+
11
+ ## 3. Query Parameter Versioning
12
+
13
+ Include the version in a query parameter (e.g., `/users?v=1`). This is similar to URL versioning but can be more flexible.
14
+
15
+ ## 4. Media Type Versioning
16
+
17
+ Define the version in the `Accept` header's media type (e.g., `Accept: application/vnd.myapi.v1+json`). This follows RESTful principles but can be more complex.
18
+
19
+ ## 5. Compatibility
20
+
21
+ Ensure that your API versioning strategy supports backward compatibility as much as possible to avoid breaking client applications.
22
+
23
+ Jonas
.agent/Backend/ApiDesign.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API Design Principles
2
+
3
+ ## Core Standards
4
+
5
+ 1. **Statelessness**: Every request must contain all information needed to fulfill it.
6
+ 2. **Versioning**: Use URL versioning (e.g., `/api/v1/...`) to prevent breaking changes.
7
+ 3. **Consistency**: Consistent naming (camelCase), status codes, and error formats.
8
+
9
+ ## Resource-Oriented Design
10
+
11
+ - `GET /items`: List items.
12
+ - `POST /items`: Create item.
13
+ - `GET /items/:id`: Get specific item.
14
+ - `PUT /items/:id`: Replace item.
15
+ - `PATCH /items/:id`: Update item partially.
16
+ - `DELETE /items/:id`: Remove item.
17
+
18
+ ## Documentation
19
+
20
+ - Self-document using Swagger/OpenAPI or TSON (Type-Safe Object Notation).
21
+ - Include examples for request bodies and response schemas.
.agent/Backend/Authentication_Strategies.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Authentication Strategies
2
+
3
+ ## 1. JWT (JSON Web Tokens)
4
+
5
+ Stateless authentication using tokens. Good for scalability, but requires careful management of token expiration and revocation.
6
+
7
+ ## 2. Session-Based
8
+
9
+ Traditional stateful authentication where the server stores session data and the client holds a session ID in a cookie.
10
+
11
+ ## 3. OAuth2 / OpenID Connect
12
+
13
+ Standards for delegated authorization and authentication, often used for third-party logins (e.g., Google, GitHub).
14
+
15
+ ## 4. Multi-Factor Authentication (MFA)
16
+
17
+ Enhance security by requiring more than one form of verification.
18
+
19
+ ## 5. Password Hashing
20
+
21
+ Always use strong, salted hashing algorithms like Argon2 or BCrypt to store passwords.
.agent/Backend/CachingStrategies.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Caching Strategies for Backend Performance
2
+
3
+ ## 1. Identifying Cacheable Data
4
+
5
+ Cache data that is frequently accessed and relatively static, such as configuration settings or product catalogs.
6
+
7
+ ## 2. Cache Levels
8
+
9
+ Implement caching at multiple levels, including in-memory (e.g., Redis, Memcached) and at the application level.
10
+
11
+ ## 3. Cache Invalidation
12
+
13
+ Establish clear strategies for invalidating the cache when the underlying data changes to ensure consistency.
14
+
15
+ ## 4. Cache Expiration (TTL)
16
+
17
+ Set appropriate Time-To-Live (TTL) values for cached data to prevent it from becoming stale.
18
+
19
+ ## 5. Monitoring
20
+
21
+ Monitor cache hit rates and performance to ensure your caching strategy is effective.
22
+
23
+ Jonas
.agent/Backend/DatabaseNormalization.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Database Normalization Principles
2
+
3
+ ## 1. Goal
4
+
5
+ The primary goal of database normalization is to reduce data redundancy and improve data integrity by organizing data into related tables.
6
+
7
+ ## 2. Normal Forms (1NF, 2NF, 3NF)
8
+
9
+ Understand and apply the different normal forms to ensure your database design is efficient and robust.
10
+
11
+ ## 3. Benefits
12
+
13
+ - Reduced data anomalies.
14
+ - Improved data consistency.
15
+ - More efficient data storage and retrieval.
16
+
17
+ ## 4. Trade-offs
18
+
19
+ In some cases, over-normalization can lead to complex queries and performance issues. Be mindful of the trade-offs.
20
+
21
+ ## 5. Practical Application
22
+
23
+ Apply normalization principles during the database design phase to create a solid foundation for your application.
24
+
25
+ Jonas
.agent/Backend/DatabaseOptimization.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Database Optimization & Schema Design
2
+
3
+ ## Schema Rules
4
+
5
+ 1. **Normalization**: Aim for 3NF to reduce redundancy.
6
+ 2. **Indexing**: Index frequently queried columns (IDs, Slugs, Timestamps). Avoid over-indexing.
7
+ 3. **Foreign Keys**: Enforce data integrity with proper relational constraints.
8
+
9
+ ## Query Performance
10
+
11
+ - **Selectivity**: Only SELECT the columns you need. Avoid `SELECT *`.
12
+ - **Joins**: Optimize JOIN operations; avoid N+1 query problems using eager loading.
13
+ - **Pagination**: Use cursor-based pagination for large datasets.
14
+
15
+ ## Migration Standards
16
+
17
+ - Use a robust migration tool (e.g., Prisma, Knex).
18
+ - Never modify existing migrations; always create a new one.
19
+ - Migration scripts must be reversible (Up/Down).
.agent/Backend/DatabaseScalability.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Database Scalability: Sharding & Replication
2
+
3
+ ## 1. Read Replication
4
+
5
+ - Direct read queries to "read-only" replicas to scale out read heavy workloads.
6
+ - The master node handles all writes.
7
+
8
+ ## 2. Horizontal Sharding
9
+
10
+ - Splitting data across multiple database instances based on a shard key (e.g., `user_id`, `region`).
11
+
12
+ ## 3. Data Consistency
13
+
14
+ - Understand the trade-offs between strictly consistent systems and eventually consistent systems.
15
+
16
+ ## 4. Failover & High Availability
17
+
18
+ - Configure automatic failover to a standby node if the master node goes down.
19
+
20
+ ## 5. Partitioning
21
+
22
+ - Use database-level partitioning to split large tables into smaller, more manageable pieces within a single instance.
.agent/Backend/DenoRuntime.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deno Runtime vs Node.js
2
+
3
+ ## 1. Security by Default
4
+
5
+ - No file, network, or environment access unless explicitly enabled via flags (e.g., `--allow-net`).
6
+
7
+ ## 2. TypeScript Support
8
+
9
+ - Deno has built-in TypeScript support; no separate compiler or config needed.
10
+
11
+ ## 3. Standard Library
12
+
13
+ - Comprehensive, audited standard library following Go's model.
14
+
15
+ ## 4. ES Modules Only
16
+
17
+ - No `require()`; all modules must be imported via URLs or file paths.
18
+
19
+ ## 5. Built-in Utilities
20
+
21
+ - Includes a test runner, linter, and formatter out of the box.
.agent/Backend/Microservices_Communication.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Microservices Communication
2
+
3
+ ## 1. Synchronous vs Asynchronous
4
+
5
+ Understand when to use REST/gRPC (synchronous) versus Message Queues/Pub-Sub (asynchronous).
6
+
7
+ ## 2. API Gateways
8
+
9
+ Use an API gateway to centralize authentication, rate limiting, and request routing.
10
+
11
+ ## 3. Service Discovery
12
+
13
+ Implement a mechanism for services to find each other dynamically (e.g., Consul, Kubernetes DNS).
14
+
15
+ ## 4. Resiliency
16
+
17
+ Use patterns like circuit breakers and retries to handle transient failures between services.
18
+
19
+ ## 5. Message Serialization
20
+
21
+ Choose efficient serialization formats like Protocol Buffers (protobuf) for inter-service communication.
.agent/Backend/Nodejs_Cluster.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Node.js Cluster Module & Multi-threading
2
+
3
+ ## 1. Scaling to Multiple Cores
4
+
5
+ - Since Node.js is single-threaded, use the `cluster` module to spawn worker processes that share the same server port.
6
+
7
+ ## 2. Master & Worker Processes
8
+
9
+ - The Master process manages workers and distributes incoming connections.
10
+
11
+ ## 3. IPC (Inter-Process Communication)
12
+
13
+ - Use `process.send()` and `on('message')` to communicate between master and worker processes.
14
+
15
+ ## 4. Zero-Downtime Reloads
16
+
17
+ - Restart workers one by one when releasing new code to ensure the server stays active.
18
+
19
+ ## 5. PM2 Process Manager
20
+
21
+ - In most production environments, prefer an external manager like **PM2** which handles clustering and automatic restarts out of the box.
.agent/Backend/ORM_BestPractices.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ORM Best Practices (Prisma/Drizzle)
2
+
3
+ ## 1. Type Safety
4
+
5
+ - Leverage auto-generated types from your schema to ensure end-to-end type safety.
6
+
7
+ ## 2. Efficient Joins
8
+
9
+ - Use `include` or `select` (Prisma) or explicit joins (Drizzle) to fetch exactly what you need. Avoid over-fetching.
10
+
11
+ ## 3. Batching & Transaction
12
+
13
+ - Use `$transaction` to ensure atomic operations (either all succeed or all fail).
14
+
15
+ ## 4. Middleware/Hooks
16
+
17
+ - Use ORM-level middleware for cross-cutting concerns like logging or soft deletes (marking as deleted instead of removing).
18
+
19
+ ## 5. Connection Pooling
20
+
21
+ - Use tools like `accelerate` (Prisma) or standard pg-pool to manage database connections in serverless environments.
.agent/Backend/PubSub_Architecture.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Pub-Sub Architecture & Message Queues
2
+
3
+ ## 1. Decoupling Services
4
+
5
+ - Use Publisher-Subscriber patterns to allow services to communicate without knowing about each other.
6
+
7
+ ## 2. Message Brokers
8
+
9
+ - Use Redis (BullMQ), RabbitMQ, or Amazon SQS for reliable message delivery.
10
+
11
+ ## 3. Idempotency
12
+
13
+ - Ensure that message consumers can handle the same message multiple times without unintended side effects.
14
+
15
+ ## 4. Retries & Dead Letter Queues (DLQ)
16
+
17
+ - Automatically retry failed tasks. Move persistently failing tasks to a DLQ for manual inspection.
18
+
19
+ ## 5. Event-Driven Workflows
20
+
21
+ - Trigger long-running tasks (e.g., report generation, bulk email) asynchronously via the queue.
.agent/Backend/ServerActions.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Backend & Server Actions
2
+
3
+ ## Server Actions (`lib/actions`)
4
+
5
+ 1. **Async Synchronization**: Use `Promise.all` for parallel tasks and proper `await` for sequential ones.
6
+ 2. **Validation**: Validate all inputs using `Zod` before processing.
7
+ 3. **Error Handling**: Use try-catch blocks and return structured error objects.
8
+ 4. **Security**: Ensure user session/permission check at the start of every action.
9
+
10
+ ## API Integration
11
+
12
+ - Keep server-side logic strictly in `lib/actions`.
13
+ - Avoid leaking database schemas to the client; use DTOs (Data Transfer Objects).
14
+ - Implement rate limiting and input sanitization.
.agent/Backend/WebSockets.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WebSockets & Real-time Communication
2
+
3
+ ## Logic Standards
4
+
5
+ 1. **Connection Management**: Implement robust auto-reconnect logic with exponential backoff.
6
+ 2. **Event Naming**: Use a clear `namespace:action` format (e.g., `billing:invoice_updated`).
7
+ 3. **Security**: Authenticate the socket connection using JWT or session tokens during the handshake.
8
+
9
+ ## Performance
10
+
11
+ - **Throttling**: Limit the rate of outgoing messages for high-frequency data (e.g., mouse positions, typing).
12
+ - **Binary Format**: Use `Protocol Buffers` or `MsgPack` for large binary data to reduce payload size.
13
+ - **Heartbeats**: Send regular ping/pong messages to keep the connection alive and detect dead links.
.agent/Design/Animations.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Animation Principles & Motion
2
+
3
+ ## Core Rules
4
+
5
+ 1. **Purpose-Driven**: Every animation must serve a purpose (e.g., feedback, hierarchy, entry).
6
+ 2. **Smooth Transitions**: Standard durations: `200ms` for small transitions, `400-600ms` for larger layout shifts.
7
+ 3. **Easing**: Use `cubic-bezier(0.4, 0, 0.2, 1)` for natural motion. Avoid linear timing.
8
+ 4. **Staggering**: Stagger entry of list items to create a flow effect.
9
+
10
+ ## Library Standards
11
+
12
+ - **Framer Motion**: Default for complex UI transitions.
13
+ - **GSAP**: Use for high-performance timeline-based animations.
14
+ - **CSS Transitions**: Preferred for simple hover and focus states.
.agent/Design/ColorPalettes.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Color Palettes for Modern UI
2
+
3
+ ## 1. Sourcing Inspiration
4
+
5
+ Draw inspiration for your color palettes from nature, art, and successful designs.
6
+
7
+ ## 2. Creating a Palette
8
+
9
+ Create a cohesive color palette with a primary color, secondary colors, and accent colors.
10
+
11
+ ## 3. Contrast and Accessibility
12
+
13
+ Ensure your color palette provides sufficient contrast for readability and accessibility.
14
+
15
+ ## 4. Consistency
16
+
17
+ Use your color palette consistently throughout your application to create a sense of unity.
18
+
19
+ ## 5. Testing
20
+
21
+ Test your color palette with real users to ensure it's visually appealing and easy to use.
.agent/Design/ColorTheory.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Color Theory for Premium UI
2
+
3
+ ## 1. Visual Hierarchy
4
+
5
+ - Use bold, varied colors for primary actions and soft, neutral colors for background elements.
6
+ - **60-30-10 Rule**: 60% dominant (neutral), 30% secondary, 10% accent (bright/vibrant).
7
+
8
+ ## 2. HSL over HEX
9
+
10
+ - Prefer HSL (Hue, Saturation, Lightness) for easier adjustments and programmatic color generation.
11
+ - **Consistent Tonal Variations**: Build a palette based on different lightness levels of a few core hues.
12
+
13
+ ## 3. Contrast & Accessibility (WCAG)
14
+
15
+ - Ensure a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text.
16
+ - Use tools like Lighthouse to verify accessibility.
17
+
18
+ ## 4. Semantic Colors
19
+
20
+ - Define standardized names: `primary`, `secondary`, `success`, `warning`, `danger`, `info`.
21
+
22
+ ## 5. Dark Mode Strategies
23
+
24
+ - Use deep grays/navy instead of pure black (`#000000`) for backgrounds to reduce eye strain.
25
+ - Invert lightness while maintaining hue and saturation for icons and accents.
.agent/Design/DesignSystem.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Design System & Aesthetics
2
+
3
+ ## Visual Identity
4
+
5
+ - **Glassmorphism**: Use subtle backgrounds with `backdrop-filter: blur()`, thin borders, and low-opacity fills.
6
+ - **Color Palette**: Curated HSL colors. Avoid generic primary colors. Use deep bolds and soft pastels.
7
+ - **Typography**: Primary: `Inter` or `Outfit`. Secondary: `Roboto Mono` for data.
8
+
9
+ ## UI Components
10
+
11
+ - **Buttons**: Smooth transitions, hover scaling (1.02x), and active state indentation.
12
+ - **Inputs**: Clear focus rings, animated labels, and inline validation.
13
+ - **Micro-animations**: Use GSAP or Framer Motion for subtle entry/exit effects.
14
+
15
+ ## Layout
16
+
17
+ - Grid/Flexbox for responsiveness.
18
+ - Consistent spacing (8px base unit).
.agent/Design/Glassmorphism.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Glassmorphism & Modern UI Style
2
+
3
+ ## Visual Standards
4
+
5
+ 1. **Backgrounds**: Transparent, high-blur (10-20px) layers with a white or tinted overlay (10-20% opacity).
6
+ 2. **Borders**: Thin (0.5-1px), semi-transparent borders to define edges.
7
+ 3. **Lighting**: Subtle inner shadows or gradients to simulate 3D depth and light source.
8
+ 4. **Saturation**: Boost the background saturation behind blurred elements for a premium feel.
9
+
10
+ ## Implementation (CSS)
11
+
12
+ ```css
13
+ .glass-container {
14
+ background: rgba(255, 255, 255, 0.1);
15
+ backdrop-filter: blur(12px);
16
+ -webkit-backdrop-filter: blur(12px);
17
+ border: 1px solid rgba(255, 255, 255, 0.2);
18
+ border-radius: 16px;
19
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
20
+ }
21
+ ```
.agent/Design/Glassmorphism_Advanced.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Advanced Glassmorphism Techniques
2
+
3
+ ## 1. Layered Blurs
4
+
5
+ - Use multiple stacked containers with varying `backdrop-filter: blur()` and boarder opacities to simulate depth.
6
+
7
+ ## 2. Noise & Texture
8
+
9
+ - Add a subtle noise texture (`svg` or `png`) as a low-opacity background layer to give the glass a material feel.
10
+
11
+ ## 3. Dynamic Refraction
12
+
13
+ - Use subtle gradients that move with the mouse cursor to simulate light refraction on a glass surface.
14
+
15
+ ## 4. Inner Glow (Inner Shadow)
16
+
17
+ - Use `box-shadow: inset ...` to highlight edges and make the glass element "pop" from its background.
18
+
19
+ ## 5. Saturation Boost
20
+
21
+ - Use `backdrop-filter: blur(12px) saturate(180%)` to make the colors behind the glass look more vibrant and expensive.
.agent/Design/Layout_Grid.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Layout Grids in UI Design
2
+
3
+ ## 1. Importance
4
+
5
+ Layout grids provide a framework for organizing content and creating a consistent visual hierarchy.
6
+
7
+ ## 2. Common Grid Systems
8
+
9
+ Common grid systems include the 12-column grid and the modular grid.
10
+
11
+ ## 3. Responsive Design
12
+
13
+ Use responsive grids that adapt to different screen sizes and orientations.
14
+
15
+ ## 4. Consistency
16
+
17
+ Use a consistent grid system throughout your application to create a sense of order.
18
+
19
+ ## 5. Breaking the Grid
20
+
21
+ Don't be afraid to occasionally break the grid for visual interest or to highlight important content.
.agent/Design/Layout_Pillars.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Holy Grail Layout & Modern Grids
2
+
3
+ ## 1. The Holy Grail Layout
4
+
5
+ - Header, Main Content (with sidebars), and Footer.
6
+ - Use CSS Grid for the most robust implementation.
7
+
8
+ ## 2. Flexbox for Micro-Layouts
9
+
10
+ - Perfect for navbars, card headers, and button groups.
11
+
12
+ ## 3. Subgrid & Nested Grids
13
+
14
+ - Use `grid-template-columns: subgrid` to align nested elements with the parent grid.
15
+
16
+ ## 4. Aspect Ratio Control
17
+
18
+ - Use `aspect-ratio` property to reserve space for images and videos, preventing Layout Shift (CLS).
19
+
20
+ ## 5. Container Queries
21
+
22
+ - Favor `@container` over `@media` for components that need to respond to their parent container's size rather than the viewport.
23
+
24
+ ## 6. Sticky & Overlay Elements
25
+
26
+ - Use `position: sticky` for persistent navs and sidebars.
27
+ - Implementation of glassmorphism on sticky headers for a premium floating feel.
.agent/Design/MicroAnimations.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Micro-Animations in UI Design
2
+
3
+ ## 1. Purpose
4
+
5
+ Micro-animations are small, subtle animations that provide feedback and enhance the user experience.
6
+
7
+ ## 2. Feedback
8
+
9
+ Use micro-animations to provide feedback when a user interacts with an element, such as a button click or form submission.
10
+
11
+ ## 3. Guiding the User
12
+
13
+ Use micro-animations to guide the user's attention to important parts of the interface.
14
+
15
+ ## 4. Transitions
16
+
17
+ Use smooth transitions to make the interface feel more fluid and natural.
18
+
19
+ ## 5. Overusing
20
+
21
+ Avoid overusing micro-animations, as they can become distracting and even frustrating for users.
.agent/Design/Typography_Advanced.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Advanced Typography Standards
2
+
3
+ ## 1. Typographic Scale
4
+
5
+ - Use a consistent ratio (e.g., 1.25 Modular Scale) to define sizes for `h1` through `h6`.
6
+ - Root size: `16px` (1rem).
7
+
8
+ ## 2. Line Heights & Spacing
9
+
10
+ - Body text: `1.5` to `1.6` for optimal readability.
11
+ - Headings: `1.1` to `1.3` for a compact, authoritative look.
12
+ - Letter spacing: `-0.01em` to `-0.02em` for headings to increase "tightness."
13
+
14
+ ## 3. Font Loading & Performance
15
+
16
+ - Use `font-display: swap` to prevent FOUT (Flash of Unstyled Text).
17
+ - Prefer variable fonts to reduce bundle size if multiple weights are needed.
18
+
19
+ ## 4. Optical Sizing
20
+
21
+ - Enable `font-optical-sizing: auto` when available for better legibility at small sizes.
22
+
23
+ ## 5. System Fonts Fallback
24
+
25
+ - Always include a reliable system font stack as a fallback (e.g., `-apple-system, BlinkMacSystemFont, "Segoe UI", ...`).
.agent/Design/Typography_Scales.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Typography Scales in UI Design
2
+
3
+ ## 1. Definition
4
+
5
+ A typography scale is a set of predefined font sizes used consistently throughout a design.
6
+
7
+ ## 2. Creating a Scale
8
+
9
+ Create a typography scale with sizes for headings, body text, and captions.
10
+
11
+ ## 3. Consistency
12
+
13
+ Use your typography scale consistently throughout your application to create a sense of hierarchy and rhythm.
14
+
15
+ ## 4. Legibility
16
+
17
+ Ensure your typography scale provides sufficient legibility for all users.
18
+
19
+ ## 5. Testing
20
+
21
+ Test your typography scale with real users to ensure it's easy to read and provides clear visual hierarchy.
.agent/DevOps/CiCd.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DevOps & CI/CD Pipelines
2
+
3
+ ## Core Principles
4
+
5
+ 1. **Automate Everything**: From testing to deployments.
6
+ 2. **Shift Left**: Catch bugs as early as possible (Git hooks).
7
+ 3. **Immutable Infrastructure**: Changes should be applied through code, not manual tweaks.
8
+
9
+ ## GitHub Actions Standards
10
+
11
+ - **Pull Request**: Trigger lint, typecheck, and unit tests.
12
+ - **Merge to Main**: Trigger build and staging deployment.
13
+ - **Tag/Release**: Trigger production deployment.
14
+ - **Fail Fast**: Cancel previous runs if a new commit is pushed.
15
+
16
+ ## Secret Management
17
+
18
+ - Never commit secrets to the repository.
19
+ - Use GitHub Secrets or AWS Secrets Manager.
20
+ - Use `.env.template` for developer onboarding.
.agent/DevOps/ContinuousDeployment.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Continuous Deployment (CD)
2
+
3
+ ## 1. Definition
4
+
5
+ Continuous Deployment is the practice of automatically deploying code changes to production after they have passed a suite of automated tests.
6
+
7
+ ## 2. Benefits
8
+
9
+ - Faster delivery of new features and fixes.
10
+ - Reduced risk of human error during deployment.
11
+ - Improved collaboration and communication.
12
+
13
+ ## 3. Automation
14
+
15
+ Automate your entire deployment process, from building and testing to deploying and monitoring.
16
+
17
+ ## 4. Rollback
18
+
19
+ Establish a mechanism for automatically rolling back a deployment if it fails.
20
+
21
+ ## 5. Monitoring
22
+
23
+ Continuously monitor your production environment for potential issues after a deployment.
24
+
25
+ Jonas
.agent/DevOps/DockerBestPractices.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Docker Best Practices for Production
2
+
3
+ ## 1. Use Small Base Images
4
+
5
+ - Prefer `alpine` or `distroless` images to reduce attack surface and build time.
6
+
7
+ ## 2. Multi-Stage Builds
8
+
9
+ - Separate your build environment from your runtime environment to keep final images small.
10
+
11
+ ## 3. Don't Run as Root
12
+
13
+ - Use the `USER` instruction to run your application as a non-privileged user.
14
+
15
+ ## 4. Use .dockerignore
16
+
17
+ - Exclude `node_modules`, logs, and local configuration files from the build context.
18
+
19
+ ## 5. Layer Caching
20
+
21
+ - Order your Dockerfile instructions from least-to-most frequently changed to optimize build caching.
.agent/DevOps/IaC.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Infrastructure as Code (IaC)
2
+
3
+ ## Standards
4
+
5
+ 1. **Declarative**: Use Terraform or AWS CloudFormation to describe your infrastructure.
6
+ 2. **Version Control**: Infrastructure code must reside in the same repo as the application.
7
+ 3. **Modularity**: Create reusable modules for VPCs, S3 buckets, and RDS instances.
8
+
9
+ ## Cloud Strategy
10
+
11
+ - **AWS/Google Cloud**: Scale based on traffic.
12
+ - **Edge Computing**: Use Cloudflare Workers for caching and security at the edge.
13
+ - **Serverless**: Prefer serverless functions for cost efficiency on low-traffic modules.
.agent/DevOps/InfrastructureAsCode.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Infrastructure as Code (IaC)
2
+
3
+ ## 1. Definition
4
+
5
+ IaC is the process of managing and provisioning your infrastructure using machine-readable definition files, rather than manual configuration.
6
+
7
+ ## 2. Benefits
8
+
9
+ - Increased efficiency and speed.
10
+ - Improved consistency and reliability.
11
+ - Better collaboration and version control.
12
+
13
+ ## 3. Tooling
14
+
15
+ Use tools like Terraform, Ansible, or CloudFormation to define and manage your infrastructure as code.
16
+
17
+ ## 4. Version Control
18
+
19
+ Store your IaC files in a version control system like Git to track changes and collaborate with others.
20
+
21
+ ## 5. Testing
22
+
23
+ Test your IaC code to ensure it correctly provisions your infrastructure as expected.
24
+
25
+ Jonas
.agent/DevOps/Kubernetes.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Kubernetes Orchestration Basics
2
+
3
+ ## 1. Pods & Services
4
+
5
+ - Understand that Pods are logically grouped containers.
6
+ - Use Services to provide a stable IP/DNS name for a group of Pods.
7
+
8
+ ## 2. Deployments & Rollouts
9
+
10
+ - Use Deployments to manage stateless applications.
11
+ - Implement Rolling Updates to replace old pods with new ones without downtime.
12
+
13
+ ## 3. ConfigMaps & Secrets
14
+
15
+ - Store configuration and sensitive data externally from the pod image.
16
+
17
+ ## 4. Ingress Controllers
18
+
19
+ - Use Ingress (like Nginx) to route external HTTP/S traffic to internal services.
20
+
21
+ ## 5. Autoscaling (HPA)
22
+
23
+ - Automatically scale the number of pods based on CPU or memory usage.
.agent/DevOps/Logging_Monitoring.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Logging & Monitoring: Prometheus & Grafana
2
+
3
+ ## 1. Structured Logging
4
+
5
+ - Log in JSON format to make it easy for log collectors (like Fluentd, ELK) to parse and index.
6
+
7
+ ## 2. Redaction of PII
8
+
9
+ - Automatically strip sensitive info (email, phone, credit card) from logs.
10
+
11
+ ## 3. Correlation IDs
12
+
13
+ - Append a unique Request-ID to every log message in a single request flow to trace it across services.
14
+
15
+ ## 4. Key Metrics
16
+
17
+ - Track the "Four Golden Signals": Latency, Traffic, Errors, and Saturation.
18
+
19
+ ## 5. Dashboards and Alerts
20
+
21
+ - Use Grafana to visualize metrics.
22
+ - Set up alerts for high error rates or unusual latency spikes.
.agent/DevOps/MonitoringPerformance.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Monitoring Performance in Production
2
+
3
+ ## 1. Key Performance Indicators (KPIs)
4
+
5
+ Identify the key performance indicators for your application, such as response time, error rate, and throughput.
6
+
7
+ ## 2. Real-Time Monitoring
8
+
9
+ Monitor your application in real-time to detect performance issues as they happen.
10
+
11
+ ## 3. Alerting and Notification
12
+
13
+ Set up alerts for when KPIs exceed predefined thresholds.
14
+
15
+ ## 4. Performance Analysis
16
+
17
+ Analyze your performance data to identify trends and potential optimizations.
18
+
19
+ ## 5. Capacity Planning
20
+
21
+ Use your performance data to plan for future growth and ensure your infrastructure can handle it.
22
+
23
+ Jonas
.agent/DevOps/Monitoring_Alerting.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Monitoring and Alerting
2
+
3
+ ## 1. Purpose
4
+
5
+ Monitoring provides visibility into the health and performance of your application, while alerting notifies you of critical issues in real-time.
6
+
7
+ ## 2. Key Metrics to Monitor
8
+
9
+ Monitor vital signs like CPU usage, memory consumption, request latency, and error rates.
10
+
11
+ ## 3. Setting Up Alerts
12
+
13
+ Define threshold-based alerts for critical metrics and configure notifications through channels like email, Slack, or PagerDuty.
14
+
15
+ ## 4. Log Aggregation
16
+
17
+ Centralize logs from all your services into a single searchable location (e.g., ELK stack, Datadog, or CloudWatch Logs).
18
+
19
+ ## 5. Automated Response
20
+
21
+ Consider implementing automated responses to certain alerts, such as auto-scaling resources or restarting services.
.agent/Engineering/API_First_Development.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API-First Development
2
+
3
+ ## 1. Principle
4
+
5
+ Design the API first, before any implementation. This ensures the API meets the needs of its consumers and provides a stable contract.
6
+
7
+ ## 2. Benefits
8
+
9
+ - Improved developer experience for API consumers.
10
+ - Reduced development time through parallel frontend and backend development.
11
+ - Higher quality and better-designed APIs.
12
+
13
+ ## 3. Tooling
14
+
15
+ Use tools like Swagger or Stoplight to design and document your APIs using the OpenAPI Specification.
16
+
17
+ ## 4. Collaborative Design
18
+
19
+ Involve stakeholders and API consumers in the design process to ensure the API meets their needs.
20
+
21
+ ## 5. Implementation
22
+
23
+ Once the API is designed, implement the backend and frontend in parallel, using the API contract as a guide.
.agent/Engineering/BigO_Notation.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Big O Notation & Algorithmic Complexity
2
+
3
+ ## 1. O(1) - Constant Time
4
+
5
+ - Execution time is independent of the input size (e.g., accessing an array element by index).
6
+
7
+ ## 2. O(log n) - Logarithmic Time
8
+
9
+ - Execution time grows logarithmically with input size (e.g., Binary Search).
10
+
11
+ ## 3. O(n) - Linear Time
12
+
13
+ - Execution time grows linearly with input size (e.g., iterating through a list).
14
+
15
+ ## 4. O(n log n) - Linearithmic Time
16
+
17
+ - Common in efficient sorting algorithms like Merge Sort and Quick Sort.
18
+
19
+ ## 5. O(n²) - Quadratic Time
20
+
21
+ - Execution time is proportional to the square of input size (e.g., nested loops).
22
+
23
+ ## 6. O(2ⁿ) - Exponential Time
24
+
25
+ - Execution time doubles with each addition to the input (e.g., recursive Fibonacci).
.agent/Engineering/CI_CD_Philosophy.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CI/CD Philosophy
2
+
3
+ ## 1. Automation
4
+
5
+ Automate every aspect of the software delivery process, from testing to deployment.
6
+
7
+ ## 2. Small, Frequent Updates
8
+
9
+ Ship smaller changes more frequently to reduce risk and get faster feedback.
10
+
11
+ ## 3. Continuous Feedback
12
+
13
+ Incorporate automated tests and quality checks at every step to catch issues early.
14
+
15
+ ## 4. Reproducibility
16
+
17
+ Ensure that every build and deployment is reproducible, with clear versioning and configuration management.
18
+
19
+ ## 5. Deployment Pipelines
20
+
21
+ Define clear pipelines for moving code from development to production, with appropriate manual approvals if necessary.
.agent/Engineering/CleanCode.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clean Code Standards
2
+
3
+ ## Core Principles
4
+
5
+ 1. **Readable > Clever**: Code should be self-documenting.
6
+ 2. **DRY (Don't Repeat Yourself)**: Abstract logic into reusable hooks or utilities.
7
+ 3. **KISS (Keep It Simple, Stupid)**: Avoid over-engineering.
8
+ 4. **Single Responsibility**: Each function/component should do ONE thing well.
9
+
10
+ ## Naming Conventions
11
+
12
+ - **Files**: `PascalCase` for components, `camelCase` for hooks/utils.
13
+ - **Variables**: Descriptive `camelCase`.
14
+ - **Booleans**: Prefix with `is`, `has`, `should`.
15
+
16
+ ## Formatting
17
+
18
+ - Use Prettier/ESLint configs.
19
+ - Limit line length to 80-100 characters.
20
+ - Consistent indentation (2 spaces).
.agent/Engineering/CodeReviewGuidelines.md ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code Review Guidelines
2
+
3
+ ## 1. Purpose
4
+
5
+ Code reviews are a collaborative process intended to improve code quality, share knowledge, and ensure consistency.
6
+
7
+ ## 2. Review Checklist
8
+
9
+ - **Functionality**: Does the code do what it's supposed to do?
10
+ - **Readability**: Is the code easy to understand and maintain?
11
+ - **Performance**: Are there any potential performance issues?
12
+ - **Security**: Are there any security vulnerabilities?
13
+ - **Testing**: Is the code properly tested?
14
+
15
+ ## 3. Best Practices
16
+
17
+ - Keep reviews small and focused.
18
+ - Provide constructive feedback.
19
+ - Be respectful and professional.
20
+ - Use tools to automate parts of the review process.
21
+
22
+ ## 4. Code Ownership
23
+
24
+ Everyone on the team is responsible for the quality of the codebase.
25
+
26
+ ## 5. Continuous Improvement
27
+
28
+ Use code reviews as an opportunity to learn and improve your coding skills.
.agent/Engineering/Concurrency_Patterns.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Concurrency Patterns & Async Flow
2
+
3
+ ## 1. Single Threaded Event Loop
4
+
5
+ - Understand how the Node.js/Browser event loop handles asynchronous operations using the task and microtask queues.
6
+
7
+ ## 2. Promises & Async/Await
8
+
9
+ - Use for multi-step asynchronous processes.
10
+ - Handle multiple promises with `Promise.all` (parallel), `Promise.allSettled` (robust), and `Promise.race` (timeout).
11
+
12
+ ## 3. Web Workers
13
+
14
+ - Use to run CPU-intensive tasks in a background thread to prevent blocking the UI/main thread.
15
+
16
+ ## 4. Generators & Iterators
17
+
18
+ - Use for custom iteration behavior and lazy data streams.
19
+
20
+ ## 5. Streams (Node.js)
21
+
22
+ - Use for processing large datasets chunk by chunk rather than loading everything into memory.
23
+ - `Readable`, `Writable`, and `Transform` streams.
24
+
25
+ ## 6. Sagas & Side Effect Management
26
+
27
+ - In large applications, use structured side effect management (e.g., Redux-Saga or custom event-based handlers).
.agent/Engineering/Constants.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Single Source of Truth: Constants & Configuration
2
+
3
+ ## Rules
4
+
5
+ 1. **Centralization**: All non-changeable text, magic numbers, and config must reside in `constants/` or `.env`.
6
+ 2. **PascalCase for Constants**: Use `UPPER_SNAKE_CASE` for global constants.
7
+ 3. **No Hardcoded Strings**: Even UI labels should be pulled from a constants file or i18n store.
8
+
9
+ ## Implementation
10
+
11
+ ```typescript
12
+ // constants/billing.ts
13
+ export const INVOICE_STATUS = {
14
+ PAID: 'paid',
15
+ PENDING: 'pending',
16
+ OVERDUE: 'overdue',
17
+ } as const;
18
+
19
+ export const TAX_RATES = {
20
+ GST: 0.18,
21
+ VAT: 0.05,
22
+ } as const;
23
+ ```
.agent/Engineering/DRY_KISS_YAGNI.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DRY, KISS, and YAGNI
2
+
3
+ ## DRY (Don't Repeat Yourself)
4
+
5
+ - Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
6
+ - Avoid copy-pasting code; use functions, hooks, or shared components.
7
+
8
+ ## KISS (Keep It Simple, Stupid)
9
+
10
+ - Most systems work best if they are kept simple rather than made complicated.
11
+ - Avoid over-engineering and unnecessary abstractions.
12
+
13
+ ## YAGNI (You Ain't Gonna Need It)
14
+
15
+ - Always implement things when you actually need them, never when you just foresee that you need them.
16
+ - Avoid "just-in-case" coding features that add complexity without immediate value.
.agent/Engineering/DataStructures.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Essential Data Structures
2
+
3
+ ## 1. Arrays & Linked Lists
4
+
5
+ - O(1) access for arrays, O(n) for linked lists.
6
+ - O(1) insertion at the head for linked lists.
7
+
8
+ ## 2. Stacks & Queues
9
+
10
+ - **Stack**: LIFO (Last-In-First-Out).
11
+ - **Queue**: FIFO (First-In-First-Out).
12
+
13
+ ## 3. Hash Tables (Maps/Objects)
14
+
15
+ - Provides average O(1) lookup, insertion, and deletion.
16
+
17
+ ## 4. Trees (Binary Search Trees)
18
+
19
+ - Allow for O(log n) searching and sorted traversal.
20
+
21
+ ## 5. Graphs
22
+
23
+ - Represent relationships between objects. Used for social networks, maps, and dependency tracking.
24
+
25
+ ## 6. Heaps
26
+
27
+ - Specialized tree-based data structure used for priority queues.
.agent/Engineering/Debugging.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Debugging Techniques for Complex Systems
2
+
3
+ ## 1. Rubber Duck Debugging
4
+
5
+ - Explain your code and logic to a surrogate (a literal rubber duck or a colleague) to find logical flaws.
6
+
7
+ ## 2. Binary Search Debugging
8
+
9
+ - Comment out halves of your code to isolate the specific section causing the error.
10
+
11
+ ## 3. Logpoints over Breakpoints
12
+
13
+ - In production or complex async environments, use conditional logpoints to trace state without pausing execution.
14
+
15
+ ## 4. Time Travel Debugging
16
+
17
+ - Use tools like Redux DevTools or specialized IDE features to step backwards through state changes.
18
+
19
+ ## 5. Network & Performance Profiling
20
+
21
+ - Use browser DevTools to identify slow API calls, memory leaks, and unnecessary layout shifts.
.agent/Engineering/DependencyInjection.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dependency Injection & Inversion of Control
2
+
3
+ ## IoC (Inversion of Control)
4
+
5
+ - Design principle in which a software component's dependencies are provided by an external framework or container, rather than the component managing them itself.
6
+
7
+ ## Dependency Injection (DI)
8
+
9
+ - Pattern that implements IoC by injecting dependencies into a class's constructor, properties, or methods.
10
+ - **Constructor Injection**: Preferred method for mandatory dependencies.
11
+ - **Setter Injection**: Used for optional dependencies.
12
+
13
+ ## Advantages
14
+
15
+ - **Decoupling**: Components are less tethered to specific implementations.
16
+ - **Testability**: Dependencies can be easily mocked or stubbed.
17
+ - **Maintainability**: Swapping implementations requires minimal code changes.
.agent/Engineering/DesignPatterns_Behavioral.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Behavioral Design Patterns
2
+
3
+ ## Chain of Responsibility
4
+
5
+ - Lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.
6
+
7
+ ## Command
8
+
9
+ - Turns a request into a stand-alone object that contains all information about the request. This transformation lets you pass requests as a method arguments, delay or queue a request’s execution, and support undoable operations.
10
+
11
+ ## Iterator
12
+
13
+ - Lets you traverse elements of a collection without exposing its underlying representation (list, stack, tree, etc.).
14
+
15
+ ## Mediator
16
+
17
+ - Lets you reduce chaotic dependencies between classes. The pattern restricts direct communications between the classes and forces them to collaborate only via a mediator object.
18
+
19
+ ## Memento
20
+
21
+ - Lets you save and restore the previous state of an object without revealing the details of its implementation.
22
+
23
+ ## Observer
24
+
25
+ - Lets you define a subscription mechanism to notify multiple objects about any events that happen to the object they’re observing.
26
+
27
+ ## State
28
+
29
+ - Lets an object alter its behavior when its internal state changes. It appears as if the object changed its class.
30
+
31
+ ## Strategy
32
+
33
+ - Lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
34
+
35
+ ## Template Method
36
+
37
+ - Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.
38
+
39
+ ## Visitor
40
+
41
+ - Lets you separate algorithms from the objects on which they operate.
.agent/Engineering/DesignPatterns_Creational.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Creational Design Patterns
2
+
3
+ ## Singleton
4
+
5
+ - Ensures a class has only one instance and provides a global point of access to it.
6
+ - Use for database connections or shared configuration managers.
7
+
8
+ ## Factory Method
9
+
10
+ - Defines an interface for creating an object, but lets subclasses decide which class to instantiate.
11
+ - Useful for dynamic instantiation based on runtime conditions.
12
+
13
+ ## Abstract Factory
14
+
15
+ - Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
16
+
17
+ ## Builder
18
+
19
+ - Separates the construction of a complex object from its representation.
20
+ - Excellent for objects with many optional parameters.
21
+
22
+ ## Prototype
23
+
24
+ - Specifies the kinds of objects to create using a prototypical instance, and creates new objects by copying this prototype.
.agent/Engineering/DesignPatterns_Structural.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Structural Design Patterns
2
+
3
+ ## Adapter
4
+
5
+ - Allows objects with incompatible interfaces to collaborate.
6
+ - Acts as a wrapper between two objects.
7
+
8
+ ## Bridge
9
+
10
+ - Lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently.
11
+
12
+ ## Composite
13
+
14
+ - Lets you compose objects into tree structures and then work with these structures as if they were individual objects.
15
+
16
+ ## Decorator
17
+
18
+ - Lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.
19
+
20
+ ## Facade
21
+
22
+ - Provides a simplified interface to a library, a framework, or any other complex set of classes.
23
+
24
+ ## Flyweight
25
+
26
+ - Lets you fit more objects into the available amount of RAM by sharing common parts of state between multiple objects instead of keeping all of the data in each object.
27
+
28
+ ## Proxy
29
+
30
+ - Provides a substitute or placeholder for another object. A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.
.agent/Engineering/E2ETesting.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # End-to-End (E2E) Testing Guidelines
2
+
3
+ ## 1. Scope
4
+
5
+ E2E tests simulate real user scenarios from start to finish, exercising the entire application stack.
6
+
7
+ ## 2. Tooling
8
+
9
+ Use Playwright or Cypress for reliable, cross-browser E2E testing.
10
+
11
+ ## 3. Key Workflows
12
+
13
+ Focus on critical paths such as login, user registration, and checkout processes.
14
+
15
+ ## 4. Environment
16
+
17
+ Run E2E tests against a production-like environment (Staging) before deploying to production.
18
+
19
+ ## 5. Maintenance
20
+
21
+ E2E tests can be fragile. Design them to be as robust as possible, but be prepared to update them as the UI evolves.