Skip to content

Commit 8aa6bb5

Browse files
committed
chore: add ai agents instructions file
1 parent 556bf65 commit 8aa6bb5

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

AGENTS.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copilot Instructions for cuinixam.github.io
2+
3+
This is a personal website/blog project built with Sphinx, hosted on GitHub Pages at [maxiniuc.com](https://maxiniuc.com).
4+
5+
## Architecture Overview
6+
7+
**Core Components:**
8+
- `jarvis`: Python CLI tool for content generation (blogs, timelines)
9+
- `docs/`: Sphinx documentation source (Markdown with MyST parser)
10+
- `docs/presentations/`: Reveal.js slide decks built from Markdown (`slides.md``presentation.html`)
11+
- `src/jarvis/notebooks/`: Marimo interactive notebooks exported as HTML to `docs/notebooks/`
12+
- `build/docs/`: Generated static site (deployed to GitHub Pages)
13+
14+
**Build System:** Uses [pypeline](https://github.com/cuinixam/pypeline) orchestrator with UV package manager. The `pypeline.yaml` defines all build steps.
15+
16+
## Development Workflows
17+
18+
### Quick Start
19+
```powershell
20+
# Bootstrap project (creates venv with UV, runs all steps)
21+
pypeline run
22+
23+
# Use the jarvis CLI via PowerShell wrapper
24+
.\jarvis.ps1 --help
25+
26+
# Alternative: Use VS Code tasks for common operations
27+
# - "run tests" (pytest)
28+
# - "generate docs" (sphinx-build)
29+
# - "autobuild docs" (sphinx-autobuild with live reload)
30+
```
31+
32+
### Running Individual Steps
33+
```powershell
34+
pypeline run --step CreateVEnv --step PyTest # Run specific steps
35+
pypeline run --step BuildDocs --single # Skip dependencies
36+
```
37+
38+
### Documentation Development
39+
- **Edit:** Modify `.md` files in `docs/`
40+
- **Build:** `pypeline run --step BuildDocs --single` or use "generate docs" task
41+
- **Preview:** Run "autobuild docs" task, opens live-reloading server at http://127.0.0.1:8000
42+
- **View:** Open `build/docs/index.html` or use "open docs index.html" task
43+
44+
## Key Conventions
45+
46+
### Blog Posts
47+
- Created via `jarvis blog --title "Post Title" --category tech --tags python,sphinx`
48+
- Auto-generates file at `docs/blogs/<YEAR>/<title_snake_case>.md` with frontmatter
49+
- Uses [ABlog](https://ablog.readthedocs.io/) Sphinx extension for blog functionality
50+
- Post pattern: `blog_post_pattern = "blogs/*/*"` in `docs/conf.py`
51+
52+
### Timeline Feature
53+
- Defined as JSON in `docs/timeline.json` with `TimelineEntry` objects (year, title, description)
54+
- Converted to Sphinx grid-based Markdown via `jarvis timeline` command
55+
- Uses custom CSS classes (`.timeline`, `.entry.left`, `.entry.right`) in `docs/_static/lessons.css`
56+
- Outputs to `docs/timeline.md` with alternating left/right grid layout
57+
58+
### Presentations
59+
- Source: `docs/presentations/<name>/slides.md` (Reveal.js Markdown)
60+
- Output: `docs/presentations/<name>/presentation.html` (built externally, copied to `docs/`)
61+
- Excluded from Sphinx processing via `exclude_patterns` but included in final output via `html_extra_path`
62+
- Linked from `docs/presentations.md` using Sphinx Design grid cards
63+
64+
### Notebooks
65+
- Source: `src/jarvis/notebooks/<name>.py` (Marimo Python apps)
66+
- Export as HTML via: `marimo export html <name>.py -o docs/notebooks/<name>/index.html`
67+
- Marimo notebooks are reactive Python notebooks with `marimo.App()` structure
68+
- Excluded from mypy checking: `[[tool.mypy.overrides]]` for `jarvis.notebooks.*`
69+
70+
### Sphinx Configuration Patterns
71+
- **Theme:** pydata-sphinx-theme with custom sidebar configs per page type
72+
- **Extensions:** MyST Parser (Markdown), ABlog (blog), sphinx-design (grids/cards), sphinxcontrib-mermaid
73+
- **Static paths:** Custom CSS in `docs/_static/` auto-added via `setup(app)` function
74+
- **MyST features:** Colon fences, definition lists, HTML admonitions, inline attributes
75+
76+
## Testing & Quality
77+
78+
```powershell
79+
pytest # Run tests
80+
pre-commit run --all-files # Linters, formatters (ruff, codespell, etc.)
81+
```
82+
83+
## Python Environment
84+
85+
- **Package manager:** UV (not pip/poetry)
86+
- **Python version:** >=3.10, <4.0
87+
- **Dev dependencies:** All in `[dependency-groups.dev]` section
88+
- **Editable install:** Via `setup.py` shim (required for GitHub package detection)
89+
- **Entry point:** `jarvis.main:main()` via Typer CLI
90+
91+
## Common Pitfalls
92+
93+
1. **Don't run `pip install` directly** - use UV or `pypeline run --step CreateVEnv`
94+
2. **Presentations/notebooks are pre-built** - HTML files are committed, not generated during Sphinx build
95+
3. **PowerShell commands use `;` not `&&`** - e.g., `cd docs ; sphinx-build ...`
96+
4. **Jarvis CLI from repo root** - use `.\jarvis.ps1` not `python -m jarvis` (requires special `_run.py` path setup)
97+
5. **Timeline JSON must match dataclass** - Fields: year (int), title (str), description (str)
98+
99+
## File/Directory Purposes
100+
101+
- `jarvis.ps1`: PowerShell wrapper to run jarvis CLI with correct venv/paths
102+
- `src/jarvis/_run.py`: Bootstrap script for running jarvis module from repo (adds `src/` to path)
103+
- `setup.py`: Minimal shim for GitHub package detection (actual build uses UV)
104+
- `pypeline.yaml`: Build orchestration config (steps: CreateVEnv, PreCommit, PyTest, BuildDocs)
105+
- `docs/conf.py`: Sphinx configuration with ABlog, MyST, and custom sidebar layouts
106+
- `build/CreateVEnv.deps.json`: Pypeline dependency tracking (auto-generated)

0 commit comments

Comments
 (0)