Skip to content

Commit 9e72440

Browse files
feat: Add documentation for AI agents
This commit introduces a documentation framework to improve the usability of the repository for AI agents. It adds: - A root agents.md file with an overview, secret management instructions, and documentation policies. - A docs/ directory with high-level wiki pages for Spendee, Firestore, MCP, and Testing.
1 parent fe8df56 commit 9e72440

5 files changed

Lines changed: 114 additions & 0 deletions

File tree

agents.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Agents Guide (Central)
2+
3+
## Overview
4+
This document provides AI coding assistants with essential context for working with the spendee-python-client project.
5+
6+
## Development Environment Setup
7+
Please refer to the README.md for instructions on setting up the development environment.
8+
9+
## Secrets Management
10+
We use Bitwarden for managing secrets. To access secrets, you will need the `BWS_ACCESS_TOKEN` environment variable set. You can then use the `bws` CLI to fetch secrets.
11+
12+
**Example: Get a specific secret by key**
13+
```bash
14+
bws secret list | jq -r '.[] | select(.key == "spendee-password") | .value'
15+
```
16+
17+
**Example: List all secret keys**
18+
```bash
19+
bws secret list | jq -r '.[] | .key'
20+
```
21+
22+
## Living Documentation
23+
Important: The `agents.md` files are living documentation that should be updated alongside code changes. When implementing modifications:
24+
25+
* **Update Relevant Agent Files:** Consider which `agents.md` files need updates when making changes. Avoid adding to the root agents.md file and use dedicated directory related agents.md. Only add the the root, when it is really globally applicable, otherwise just reference there.
26+
* **Keep Implementation Details Current:** Ensure commands, file paths, and procedures reflect the current state
27+
* **Maintain Cross-References:** Update links between agent files and documentation
28+
* **File References Only:** Never quote file content in agent files - only reference files by path
29+
* **Consistency:** Ensure terminology and patterns remain consistent across all agent files
30+
31+
## Docs/Agents split policy
32+
* **Human docs (docs/**):** "What/Why"—architecture, domain flows, decisions, onboarding narratives, high-level troubleshooting flows.
33+
* **Agents (`agents.md` files):** "How"—exact files to touch, commands, env/secrets guidance, gotchas, safe-change checklists, Cursor-ready prompts.
34+
35+
Each agent file starts with a "Read the overview" links block to the relevant `docs/**` pages.
36+
37+
Each relevant `docs/**` page gets a small footer: "For implementation details, see `<path>/agents.md`".
38+
39+
Reduce code/text duplication as much as possible across twin docs and agents files.

docs/firestore.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Firestore
2+
3+
## High-Level Overview
4+
Firestore is a NoSQL document database from Google Firebase. It is used in this project to store and sync data in real-time.
5+
6+
## Focused Examples
7+
Here's a basic example of how we interact with Firestore:
8+
9+
```python
10+
from google.cloud import firestore
11+
12+
# Initialize the client
13+
db = firestore.Client()
14+
15+
# Get a reference to a document
16+
doc_ref = db.collection(u'users').document(u'alovelace')
17+
18+
# Set data
19+
doc_ref.set({
20+
u'first': u'Ada',
21+
u'last': u'Lovelace',
22+
u'born': 1815
23+
})
24+
```
25+
26+
## Pointers
27+
* [Official Firestore Documentation](https://firebase.google.com/docs/firestore)
28+
* [Python Client Library Documentation](https://googleapis.dev/python/firestore/latest/index.html)
29+
30+
---
31+
For implementation details, see `firestore/agents.md`.

docs/mcp.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MCP (Master Control Program)
2+
3+
## High-Level Overview
4+
MCP is the central orchestration component of this project. It is responsible for coordinating data flows between different services.
5+
6+
## Focused Examples
7+
MCP is primarily configured through YAML files. Here's a conceptual example of a task definition:
8+
9+
```yaml
10+
tasks:
11+
- name: sync-spendee-to-firestore
12+
source: spendee
13+
destination: firestore
14+
schedule: "0 * * * *"
15+
```
16+
17+
---
18+
For implementation details, see `mcp/agents.md`.

docs/spendee.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Spendee
2+
3+
## What it is
4+
Spendee is a personal finance application that helps users track their expenses and income. This client library provides a Python interface to the Spendee API.
5+
6+
## Core Concepts
7+
* **Wallets:** Wallets represent your accounts (e.g., bank account, cash).
8+
* **Transactions:** Transactions are individual expenses or incomes.
9+
* **Categories:** Categories help you classify your transactions (e.g., food, transportation).
10+
* **Labels:** Labels provide an additional way to organize your transactions.
11+
12+
---
13+
For implementation details, see `spendee/agents.md`.

docs/testing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Testing
2+
3+
## Overview
4+
This project uses a combination of unit tests and integration tests to ensure code quality. We use `pytest` as our primary testing framework.
5+
6+
## MCP Testing
7+
MCP tests are located in the `tests/mcp` directory. These tests focus on verifying the logic of the orchestration tasks.
8+
9+
## Spendee Firestore Testing
10+
Spendee Firestore tests are located in the `tests/spendee` directory. These tests focus on verifying the interaction between the Spendee client and the Firestore database.
11+
12+
---
13+
For implementation details, see `tests/agents.md`.

0 commit comments

Comments
 (0)