Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit f1be84b

Browse files
authored
docs: add AI agent instructions for development tools (apache#422)
1 parent c03c143 commit f1be84b

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,14 @@ nohup.out
1717
.idea/
1818

1919
.DS_Store
20+
21+
# AI Agent Configuration Files
22+
# Keep AGENTS.md as the source of truth, ignore tool-specific symlinks/configs
23+
CLAUDE.md
24+
GEMINI.md
25+
.cursorrules
26+
.cursor/
27+
.github/copilot-instructions.md
28+
.vscode/settings.json
29+
.aider*
30+
.gemini/

AGENTS.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# AI Development Agent Instructions
2+
3+
This file provides guidance to AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is the **Apache HugeGraph documentation website** repository (`hugegraph-doc`), built with Hugo static site generator using the Docsy theme. The site provides comprehensive documentation for the HugeGraph graph database system, including quickstart guides, API references, configuration guides, and contribution guidelines.
8+
9+
The documentation is multilingual, supporting both **Chinese (cn)** and **English (en)** content.
10+
11+
## Development Setup
12+
13+
### Prerequisites
14+
15+
1. **Hugo Extended** (v0.95.0 recommended, v0.102.3 used in CI)
16+
- Must be the "extended" version (includes SASS/SCSS support)
17+
- Download from: https://github.com/gohugoio/hugo/releases
18+
- Install location: `/usr/bin` or `/usr/local/bin`
19+
20+
2. **Node.js and npm** (v16+ as specified in CI)
21+
22+
### Quick Start
23+
24+
```bash
25+
# Install npm dependencies (autoprefixer, postcss, postcss-cli)
26+
npm install
27+
28+
# Start local development server (with auto-reload)
29+
hugo server
30+
31+
# Custom server with different ip/port
32+
hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0
33+
34+
# Build production site (output to ./public)
35+
hugo --minify
36+
```
37+
38+
## Project Structure
39+
40+
### Key Directories
41+
42+
- **`content/`** - All documentation content in Markdown
43+
- `content/cn/` - Chinese (simplified) documentation
44+
- `content/en/` - English documentation
45+
- Each language has parallel structure: `docs/`, `blog/`, `community/`, `about/`
46+
47+
- **`themes/docsy/`** - The Docsy Hugo theme (submodule or vendored)
48+
49+
- **`static/`** - Static assets (images, files) served directly
50+
51+
- **`assets/`** - Assets processed by Hugo pipelines (SCSS, images for processing)
52+
53+
- **`layouts/`** - Custom Hugo template overrides for the Docsy theme
54+
55+
- **`public/`** - Generated site output (gitignored, created by `hugo` build)
56+
57+
- **`dist/`** - Additional distribution files
58+
59+
### Important Files
60+
61+
- **`config.toml`** - Main site configuration
62+
- Defines language settings (cn as default, en available)
63+
- Menu structure and navigation
64+
- Theme parameters and UI settings
65+
- Currently shows version `0.13`
66+
67+
- **`package.json`** - Node.js dependencies for CSS processing (postcss, autoprefixer)
68+
69+
- **`.editorconfig`** - Code style rules (UTF-8, LF line endings, spaces for indentation)
70+
71+
- **`contribution.md`** - Contributing guide (Chinese/English mixed)
72+
73+
- **`maturity.md`** - Project maturity assessment documentation
74+
75+
## Content Organization
76+
77+
Documentation is organized into major sections:
78+
79+
- **`quickstart/`** - Getting started guides for HugeGraph components (Server, Loader, Hubble, Tools, Computer, AI)
80+
- **`config/`** - Configuration documentation
81+
- **`clients/`** - Client API documentation (Gremlin Console, RESTful API)
82+
- **`guides/`** - User guides and tutorials
83+
- **`performance/`** - Performance benchmarks and optimization
84+
- **`language/`** - Query language documentation
85+
- **`contribution-guidelines/`** - How to contribute to HugeGraph
86+
- **`changelog/`** - Release notes and version history
87+
- **`download/`** - Download links and instructions
88+
89+
## Common Tasks
90+
91+
### Building and Testing
92+
93+
```bash
94+
# Build for production (with minification)
95+
hugo --minify
96+
97+
# Clean previous build
98+
rm -rf public/
99+
100+
# Build with specific environment
101+
HUGO_ENV="production" hugo --gc
102+
```
103+
104+
### Working with Content
105+
106+
When editing documentation:
107+
108+
1. Maintain parallel structure between `content/cn/` and `content/en/`
109+
2. Use Markdown format for all documentation files
110+
3. Include front matter in each file (title, weight, description)
111+
4. For translated content, ensure both Chinese and English versions are updated
112+
113+
### Theme Customization
114+
115+
- Global site config: `config.toml` (root directory)
116+
- Theme-specific config: `themes/docsy/config.toml`
117+
- Custom layouts: Place in `layouts/` to override theme defaults
118+
- Custom styles: Modify files in `assets/` directory
119+
120+
Refer to [Docsy documentation](https://www.docsy.dev/docs/) for theme customization details.
121+
122+
## Deployment
123+
124+
The site uses GitHub Actions for CI/CD (`.github/workflows/hugo.yml`):
125+
126+
1. **Triggers**: On push to `master` branch or pull requests
127+
2. **Build process**:
128+
- Checkout with submodules (for themes)
129+
- Setup Node v16 and Hugo v0.102.3 extended
130+
- Run `npm i && hugo --minify`
131+
3. **Deployment**: Publishes to `asf-site` branch (GitHub Pages)
132+
133+
The deployed site is hosted as part of Apache HugeGraph's documentation infrastructure.
134+
135+
## HugeGraph Architecture Context
136+
137+
This documentation covers the complete HugeGraph ecosystem:
138+
139+
- **HugeGraph-Server** - Core graph database engine with REST API
140+
- **HugeGraph-Store** - Distributed storage engine with integrated computation
141+
- **HugeGraph-PD** - Placement Driver for metadata management
142+
- **HugeGraph-Toolchain**:
143+
- Client (Java RESTful API client)
144+
- Loader (data import tool)
145+
- Hubble (web visualization platform)
146+
- Tools (deployment and management utilities)
147+
- **HugeGraph-Computer** - Distributed graph processing system (OLAP)
148+
- **HugeGraph-AI** - Graph neural networks and LLM/RAG components
149+
150+
## Git Workflow
151+
152+
- **Main branch**: `master` (protected, triggers deployment)
153+
- **PR requirements**: Include screenshots showing before/after changes in documentation
154+
- **Commit messages**: Follow Apache commit conventions
155+
- Always create a new branch from `master` for changes
156+
- Deployment to `asf-site` branch is automated via GitHub Actions
157+
158+
## Troubleshooting
159+
160+
**Error: "TOCSS: failed to transform scss/main.scss"**
161+
- Cause: Using standard Hugo instead of Hugo Extended
162+
- Solution: Install Hugo Extended version
163+
164+
**Error: Module/theme not found**
165+
- Cause: Git submodules not initialized
166+
- Solution: `git submodule update --init --recursive`
167+
168+
**Build fails in CI but works locally**
169+
- Check Hugo version match (CI uses v0.102.3)
170+
- Ensure npm dependencies are installed
171+
- Verify Node.js version (CI uses v16)

0 commit comments

Comments
 (0)