Skip to content

Commit 80e2607

Browse files
authored
Add AGENTS files (#7765)
* Add AGENTS files * Fix for linters * Cleanup AGENTS files
1 parent eea9678 commit 80e2607

File tree

6 files changed

+417
-322
lines changed

6 files changed

+417
-322
lines changed

.vale/styles/spelling-exceptions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ cron
3939
Cron
4040
cypher
4141
Dagster
42+
Diataxis
4243
datacenter
4344
dataloader
4445
datastore
@@ -216,6 +217,7 @@ towncrier
216217
Towncrier
217218
UIs
218219
uncheck
220+
unoptimized
219221
uniqueness_constraints
220222
upsert
221223
upserting

AGENTS.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# AGENTS.md
2+
3+
## Project Overview
4+
5+
Infrahub is a graph-based infrastructure data management platform by OpsMill. It combines Git-like branching and version control with a flexible graph database (Neo4j) and a modern UI/API layer.
6+
7+
## Tech Stack
8+
9+
- **Backend:** Python 3.12, FastAPI 0.121.1, Neo4j 5.28, Pydantic 2.10
10+
- **Frontend:** TypeScript 5.9, React 19.2, Vite 7.2, Tailwind CSS 4.1
11+
- **Testing:** pytest 7.4, Vitest 4.0, Playwright 1.56
12+
- **Linting:** ruff 0.14.5, mypy 1.15, Biome 2.3
13+
- **Package Managers:** uv (Python), npm (Frontend)
14+
- **Task Runner:** Invoke 2.2.0
15+
16+
## File Structure
17+
18+
- `backend/` – Python backend (FastAPI, GraphQL, core logic) - see [backend/AGENTS.md](backend/AGENTS.md)
19+
- `frontend/app/` – React frontend - see [frontend/app/AGENTS.md](frontend/app/AGENTS.md)
20+
- `docs/` – Docusaurus documentation - see [docs/AGENTS.md](docs/AGENTS.md)
21+
- `python_sdk/` – Python SDK (Git submodule)
22+
- `tasks/` – Invoke task definitions
23+
- `schema/` – JSON/GraphQL schema definitions
24+
- `changelog/` – Towncrier changelog fragments
25+
26+
## Commands
27+
28+
### Setup
29+
30+
```bash
31+
uv sync --all-groups # Install Python dependencies
32+
cd frontend/app && npm install # Install frontend dependencies
33+
```
34+
35+
### Testing
36+
37+
```bash
38+
uv run invoke backend.test-unit # Backend unit tests
39+
uv run invoke backend.test-integration # Backend integration tests
40+
cd frontend/app && npm run test # Frontend unit tests
41+
cd frontend/app && npm run test:e2e # Frontend E2E tests
42+
```
43+
44+
### Linting & Formatting
45+
46+
```bash
47+
uv run invoke format # Format all Python code
48+
uv run invoke lint # Lint all Python code
49+
cd frontend/app && npm run biome:fix # Format/lint frontend
50+
uv run invoke docs.lint # Lint documentation
51+
```
52+
53+
### Build
54+
55+
```bash
56+
uv run invoke dev.build # Build Docker containers
57+
cd frontend/app && npm run build # Build frontend
58+
cd docs && npm run build # Build documentation
59+
```
60+
61+
## Generated Files (Do Not Edit)
62+
63+
- `backend/infrahub/core/schema/generated/` – Schema definitions
64+
- `backend/infrahub/core/protocols.py` – Protocol definitions
65+
- `frontend/app/src/shared/api/graphql/generated/` – GraphQL types
66+
- `frontend/app/src/shared/api/rest/types.generated.ts` – REST types
67+
- `schema/schema.graphql` - GraphQL schema of the Core Schema
68+
- `schema/openapi.json` - OpenAPI schema for the REST API
69+
70+
Regenerate with: `uv run invoke backend.generate` or `cd frontend/app && npm run codegen`
71+
72+
## Markdown Formatting
73+
74+
When editing markdown files (enforced by markdownlint):
75+
76+
- Use `-` for unordered lists
77+
- Add blank line before/after headings, code blocks, and lists
78+
- Use fenced code blocks with language identifier
79+
- No trailing spaces or multiple consecutive blank lines
80+
- No bare URLs (use `[text](url)` format)
81+
82+
## Git Workflow
83+
84+
- **Main branches:** `stable` (production), `develop` (development), `release-*` (releases)
85+
- **Commit messages:** Conventional commits; include issue references
86+
- **Changelog:** Add fragment to `changelog/` using Towncrier format
87+
88+
## Boundaries
89+
90+
### Always Do
91+
92+
- Run formatters before committing (`uv run invoke format`, `npm run biome:fix`)
93+
- Write tests for new functionality
94+
- Use type hints for Python (backend) and TypeScript types (frontend)
95+
96+
### Ask First
97+
98+
- Database schema or migration changes
99+
- GraphQL schema modifications
100+
- New dependencies
101+
- CI/CD workflow changes
102+
- Authentication/authorization changes
103+
104+
### Never Do
105+
106+
- Commit secrets, API keys, or credentials
107+
- Edit generated files manually
108+
- Skip linting in CI
109+
- Force push to `stable` or `develop`

0 commit comments

Comments
 (0)