This is an automated email from the ASF dual-hosted git repository. jin pushed a commit to branch add-ai-agent-instructions in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git
commit 979a94207b4367dc34991f34f5e20b4e3953cc0a Author: imbajin <[email protected]> AuthorDate: Mon Oct 20 18:16:58 2025 +0800 [38;5;15mdocs[39m[38;5;15m:[39m[38;5;15m [39m[38;5;15madd[39m[38;5;15m [39m[38;5;15mAI[39m[38;5;15m [39m[38;5;15magent[39m[38;5;15m [39m[38;5;15minstructions[39m[38;5;15m [39m[38;5;81mfor[39m[38;5;15m [39m[38;5;15mdevelopment[39m[38;5;15m [39m[38;5;15mtools[39m [38;5;15mAdd[39m[38;5;15m [39m[38;5;15mAGENTS[39m[38;5;15m.[39m[38;5;15mmd[39m[38;5;15m [39m[38;5;15mwith[39m[38;5;15m [39m[38;5;15mcomprehensive[39m[38;5;15m [39m[38;5;15mproject[39m[38;5;15m [39m[38;5;15mdocumentation[39m[38;5;15m [39m[38;5;15mand[39m[38;5;15m [39m[38;5;15mdevelopment[39m[38;5;15m [39m[38;5;15mguidelines[39m[38;5;15m [39m[38;5;81mfor[39m[38;5;15m [39m[38;5;15mAI[39m[38;5;15m [39m[38;5;15mcoding[39m[38;5;15m [39m[3 [...] [38;5;15mKey[39m[38;5;15m [39m[38;5;15madditions[39m[38;5;204m:[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mProject[39m[38;5;15m [39m[38;5;15moverview[39m[38;5;15m [39m[38;5;15mand[39m[38;5;15m [39m[38;5;15mHugo[39m[38;5;15m [39m[38;5;81mstatic[39m[38;5;15m [39m[38;5;15msite[39m[38;5;15m [39m[38;5;15msetup[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mDevelopment[39m[38;5;15m [39m[38;5;15mcommands[39m[38;5;15m [39m[38;5;15mand[39m[38;5;15m [39m[38;5;15mworkflows[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mProject[39m[38;5;15m [39m[38;5;15mstructure[39m[38;5;15m [39m[38;5;15mand[39m[38;5;15m [39m[38;5;15mcontent[39m[38;5;15m [39m[38;5;15morganization[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mDeployment[39m[38;5;15m [39m[38;5;15mand[39m[38;5;15m [39m[38;5;15mCI[39m[38;5;204m/[39m[38;5;15mCD[39m[38;5;15m [39m[38;5;15minformation[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mHugeGraph[39m[38;5;15m [39m[38;5;15marchitecture[39m[38;5;15m [39m[38;5;15mcontext[39m [38;5;204m-[39m[38;5;15m [39m[38;5;15mCommon[39m[38;5;15m [39m[38;5;15mtroubleshooting[39m[38;5;15m [39m[38;5;15mscenarios[39m [38;5;198;48;5;233m🤖[39;49m[38;5;15m [39m[38;5;15mGenerated[39m[38;5;15m [39m[38;5;15mwith[39m[38;5;15m [39m[38;5;15m[[39m[38;5;15mClaude[39m[38;5;15m [39m[38;5;15mCode[39m[38;5;15m][39m[38;5;15m([39m[38;5;15mhttps[39m[38;5;204m:[39m[38;5;245m//claude.com/claude-code)[39m [38;5;15mCo[39m[38;5;204m-[39m[38;5;15mAuthored[39m[38;5;204m-[39m[38;5;15mBy[39m[38;5;204m:[39m[38;5;15m [39m[38;5;15mClaude[39m[38;5;15m [39m[38;5;204m<[39m[38;5;15mnoreply[39m[38;5;15m@[39m[38;5;15manthropic[39m[38;5;15m.[39m[38;5;15mcom[39m[38;5;204m>[39m --- AGENTS.md | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CLAUDE.md | 1 + 2 files changed, 172 insertions(+) diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..9108afe5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,171 @@ +# AI Development Agent Instructions + +This file provides guidance to AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) when working with code in this repository. + +## Project Overview + +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. + +The documentation is multilingual, supporting both **Chinese (cn)** and **English (en)** content. + +## Development Setup + +### Prerequisites + +1. **Hugo Extended** (v0.95.0 recommended, v0.102.3 used in CI) + - Must be the "extended" version (includes SASS/SCSS support) + - Download from: https://github.com/gohugoio/hugo/releases + - Install location: `/usr/bin` or `/usr/local/bin` + +2. **Node.js and npm** (v16+ as specified in CI) + +### Quick Start + +```bash +# Install npm dependencies (autoprefixer, postcss, postcss-cli) +npm install + +# Start local development server (with auto-reload) +hugo server + +# Custom server with different ip/port +hugo server -b http://127.0.0.1 -p 80 --bind=0.0.0.0 + +# Build production site (output to ./public) +hugo --minify +``` + +## Project Structure + +### Key Directories + +- **`content/`** - All documentation content in Markdown + - `content/cn/` - Chinese (simplified) documentation + - `content/en/` - English documentation + - Each language has parallel structure: `docs/`, `blog/`, `community/`, `about/` + +- **`themes/docsy/`** - The Docsy Hugo theme (submodule or vendored) + +- **`static/`** - Static assets (images, files) served directly + +- **`assets/`** - Assets processed by Hugo pipelines (SCSS, images for processing) + +- **`layouts/`** - Custom Hugo template overrides for the Docsy theme + +- **`public/`** - Generated site output (gitignored, created by `hugo` build) + +- **`dist/`** - Additional distribution files + +### Important Files + +- **`config.toml`** - Main site configuration + - Defines language settings (cn as default, en available) + - Menu structure and navigation + - Theme parameters and UI settings + - Currently shows version `0.13` + +- **`package.json`** - Node.js dependencies for CSS processing (postcss, autoprefixer) + +- **`.editorconfig`** - Code style rules (UTF-8, LF line endings, spaces for indentation) + +- **`contribution.md`** - Contributing guide (Chinese/English mixed) + +- **`maturity.md`** - Project maturity assessment documentation + +## Content Organization + +Documentation is organized into major sections: + +- **`quickstart/`** - Getting started guides for HugeGraph components (Server, Loader, Hubble, Tools, Computer, AI) +- **`config/`** - Configuration documentation +- **`clients/`** - Client API documentation (Gremlin Console, RESTful API) +- **`guides/`** - User guides and tutorials +- **`performance/`** - Performance benchmarks and optimization +- **`language/`** - Query language documentation +- **`contribution-guidelines/`** - How to contribute to HugeGraph +- **`changelog/`** - Release notes and version history +- **`download/`** - Download links and instructions + +## Common Tasks + +### Building and Testing + +```bash +# Build for production (with minification) +hugo --minify + +# Clean previous build +rm -rf public/ + +# Build with specific environment +HUGO_ENV="production" hugo --gc +``` + +### Working with Content + +When editing documentation: + +1. Maintain parallel structure between `content/cn/` and `content/en/` +2. Use Markdown format for all documentation files +3. Include front matter in each file (title, weight, description) +4. For translated content, ensure both Chinese and English versions are updated + +### Theme Customization + +- Global site config: `config.toml` (root directory) +- Theme-specific config: `themes/docsy/config.toml` +- Custom layouts: Place in `layouts/` to override theme defaults +- Custom styles: Modify files in `assets/` directory + +Refer to [Docsy documentation](https://www.docsy.dev/docs/) for theme customization details. + +## Deployment + +The site uses GitHub Actions for CI/CD (`.github/workflows/hugo.yml`): + +1. **Triggers**: On push to `master` branch or pull requests +2. **Build process**: + - Checkout with submodules (for themes) + - Setup Node v16 and Hugo v0.102.3 extended + - Run `npm i && hugo --minify` +3. **Deployment**: Publishes to `asf-site` branch (GitHub Pages) + +The deployed site is hosted as part of Apache HugeGraph's documentation infrastructure. + +## HugeGraph Architecture Context + +This documentation covers the complete HugeGraph ecosystem: + +- **HugeGraph-Server** - Core graph database engine with REST API +- **HugeGraph-Store** - Distributed storage engine with integrated computation +- **HugeGraph-PD** - Placement Driver for metadata management +- **HugeGraph-Toolchain**: + - Client (Java RESTful API client) + - Loader (data import tool) + - Hubble (web visualization platform) + - Tools (deployment and management utilities) +- **HugeGraph-Computer** - Distributed graph processing system (OLAP) +- **HugeGraph-AI** - Graph neural networks and LLM/RAG components + +## Git Workflow + +- **Main branch**: `master` (protected, triggers deployment) +- **PR requirements**: Include screenshots showing before/after changes in documentation +- **Commit messages**: Follow Apache commit conventions +- Always create a new branch from `master` for changes +- Deployment to `asf-site` branch is automated via GitHub Actions + +## Troubleshooting + +**Error: "TOCSS: failed to transform scss/main.scss"** +- Cause: Using standard Hugo instead of Hugo Extended +- Solution: Install Hugo Extended version + +**Error: Module/theme not found** +- Cause: Git submodules not initialized +- Solution: `git submodule update --init --recursive` + +**Build fails in CI but works locally** +- Check Hugo version match (CI uses v0.102.3) +- Ensure npm dependencies are installed +- Verify Node.js version (CI uses v16) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 00000000..47dc3e3d --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file
