|
| 1 | +--- |
| 2 | +name: tinkerpop-dev |
| 3 | +description: > |
| 4 | + Development guidance for the Apache TinkerPop monorepo. Use when building, |
| 5 | + testing, or contributing to TinkerPop's graph computing framework and its |
| 6 | + multi-language Gremlin ecosystem (Java, Python, JavaScript, .NET, Go). |
| 7 | + Covers coding conventions, build recipes, test evaluation, documentation, |
| 8 | + development environment setup, and Gremlin MCP server usage. |
| 9 | +license: Apache-2.0 |
| 10 | +compatibility: Requires Java 11+, Maven 3.5.3+, Docker. Individual GLVs may need Python, Node.js, .NET SDK, or Go. |
| 11 | +metadata: |
| 12 | + version: 1.0.0 |
| 13 | + project: Apache TinkerPop |
| 14 | +--- |
| 15 | + |
| 16 | +# TinkerPop Development Skill |
| 17 | + |
| 18 | +## Project Overview |
| 19 | + |
| 20 | +Apache TinkerPop is a graph computing framework providing a standard API (the Gremlin graph |
| 21 | +traversal language) for graph databases and processors. The repository is a Maven multi-module |
| 22 | +monorepo that wraps JVM code, Python, JavaScript/TypeScript, .NET, and Go under a single build. |
| 23 | + |
| 24 | +Canonical project documentation (prefer local files over external URLs): |
| 25 | + |
| 26 | +- `README.md` and `CONTRIBUTING.md` at the repo root |
| 27 | +- Reference docs: `docs/src/reference/` |
| 28 | +- Developer docs: `docs/src/dev/developer/` |
| 29 | +- Provider docs and Gremlin Semantics: `docs/src/dev/provider/` |
| 30 | +- IO and Serialization: `docs/src/dev/io/` |
| 31 | +- Recipes: `docs/src/recipes/` |
| 32 | +- Upgrade docs: `docs/src/upgrade/` |
| 33 | +- Future plans: `docs/src/dev/future/` |
| 34 | + |
| 35 | +## Repository Structure |
| 36 | + |
| 37 | +``` |
| 38 | +tinkerpop/ |
| 39 | +├── gremlin-core/ Core graph API and traversal engine (Java) |
| 40 | +├── gremlin-server/ Gremlin Server (Java) |
| 41 | +├── tinkergraph-gremlin/ In-memory reference graph (Java) |
| 42 | +├── gremlin-python/ Python GLV |
| 43 | +├── gremlin-js/ JavaScript/TypeScript workspace root |
| 44 | +│ ├── gremlin-javascript/ JS driver (npm: "gremlin") |
| 45 | +│ ├── gremlin-mcp/ Gremlin MCP server (npm: "gremlin-mcp") |
| 46 | +│ └── gremlint/ Gremlin query formatter (npm: "gremlint") |
| 47 | +├── gremlin-dotnet/ .NET GLV |
| 48 | +├── gremlin-go/ Go GLV |
| 49 | +├── gremlin-test/ Shared test resources and Gherkin features |
| 50 | +├── gremlin-tools/ Benchmarks, coverage, socket server |
| 51 | +├── docs/src/ AsciiDoc documentation |
| 52 | +├── docker/ Docker build scripts and configs |
| 53 | +├── bin/ Utility scripts |
| 54 | +└── CHANGELOG.asciidoc Changelog |
| 55 | +``` |
| 56 | + |
| 57 | +Maven is the build orchestration tool for all modules, including non-JVM ones. |
| 58 | + |
| 59 | +## Basic Build Commands |
| 60 | + |
| 61 | +Build everything: |
| 62 | +```bash |
| 63 | +mvn clean install |
| 64 | +``` |
| 65 | + |
| 66 | +Build a specific module: |
| 67 | +```bash |
| 68 | +mvn clean install -pl <module-name> |
| 69 | +``` |
| 70 | + |
| 71 | +For GLV-specific builds, test execution, and advanced workflows, see the appropriate |
| 72 | +reference file under `references/`. |
| 73 | + |
| 74 | +## Coding Conventions |
| 75 | + |
| 76 | +- All files must include the Apache Software Foundation license header. Canonical text |
| 77 | + is at `bin/asf-license-header.txt`. |
| 78 | +- Do not use import wildcards (e.g., avoid `import org.apache.tinkerpop.gremlin.structure.*`). |
| 79 | + Use explicit imports. |
| 80 | +- Define variables as `final` whenever possible, except for loop variables. |
| 81 | +- Respect existing naming patterns and package organization. |
| 82 | +- Use `@/` path aliases for JavaScript/TypeScript imports where the project uses them. |
| 83 | + |
| 84 | +## Test Conventions |
| 85 | + |
| 86 | +- Prefer SLF4J `Logger` over `System.out.println` or `println` in tests. |
| 87 | +- Use `TestHelper` utilities for temporary directories and file structures instead of |
| 88 | + hard-coding paths. |
| 89 | +- Always close `Graph` instances that are manually constructed in tests. |
| 90 | +- Tests using a `GraphProvider` with `AbstractGremlinTest` should be suffixed `Check`, |
| 91 | + not `Test`. |
| 92 | +- Prefer Hamcrest matchers for boolean assertions (e.g., `assertThat(..., is(true))`) |
| 93 | + instead of manually checking booleans. |
| 94 | +- Gremlin language tests use Gherkin features under: |
| 95 | + `gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/` |
| 96 | + See `docs/src/dev/developer/for-committers.asciidoc` for details. |
| 97 | + |
| 98 | +## Documentation Conventions |
| 99 | + |
| 100 | +- TinkerPop documentation is AsciiDoc-based under `docs/src/`. Do not use Markdown in |
| 101 | + the main docs tree. |
| 102 | +- Place new content in the appropriate book (reference, dev, recipes, etc.). |
| 103 | +- Update the relevant `index.asciidoc` so new content is included in the build. |
| 104 | +- For detailed documentation generation instructions, see `references/documentation.md`. |
| 105 | + |
| 106 | +## Changelog, License, and Checks |
| 107 | + |
| 108 | +When changes affect behavior, APIs, or user-visible features: |
| 109 | + |
| 110 | +- Add or update entries in `CHANGELOG.asciidoc` in the correct version section. |
| 111 | +- Do not invent new version numbers or release names; follow the existing pattern. |
| 112 | +- Preserve and respect license headers and notices in all files. |
| 113 | +- Avoid adding third-party code or dependencies with incompatible licenses. |
| 114 | + |
| 115 | +## Agent Guardrails |
| 116 | + |
| 117 | +### Do |
| 118 | + |
| 119 | +- Make small, focused changes that are easy to review. |
| 120 | +- Run the relevant build and test commands before suggesting a change is complete. |
| 121 | +- Update or add tests when behavior changes. |
| 122 | +- Update documentation and/or changelog when changing public behavior or APIs. |
| 123 | +- Follow existing patterns for code structure, documentation layout, and naming. |
| 124 | +- Point maintainers to relevant documentation or issues when proposing non-trivial changes. |
| 125 | + |
| 126 | +### Don't |
| 127 | + |
| 128 | +- Don't perform large, sweeping refactors unless explicitly requested. |
| 129 | +- Don't change public APIs, configuration formats, or network protocols without explicit |
| 130 | + human approval and an associated design/issue. |
| 131 | +- Don't switch documentation formats (e.g., AsciiDoc to Markdown) in the main docs tree. |
| 132 | +- Don't introduce new external dependencies, modules, or build plugins without an |
| 133 | + associated discussion and issue. |
| 134 | +- Don't invent project policies, version numbers, or release names. |
| 135 | +- Don't remove or weaken tests to "fix" failures; adjust the implementation or test |
| 136 | + data instead. |
| 137 | + |
| 138 | +If uncertain about the impact of a change, prefer to make a minimal patch, add comments |
| 139 | +for reviewers, and ask for clarification. |
| 140 | + |
| 141 | +## When In Doubt |
| 142 | + |
| 143 | +1. Check `CONTRIBUTING.md`, developer docs under `docs/src/dev/developer/`, and reference docs. |
| 144 | +2. Prefer no change over an unsafe or speculative change. |
| 145 | +3. Surface the question to human maintainers. |
| 146 | + |
| 147 | +## Reference Guides |
| 148 | + |
| 149 | +For deeper, task-specific guidance, see the reference files in this skill: |
| 150 | + |
| 151 | +- [Development Environment Setup](references/dev-environment-setup.md) — fresh clone to working environment |
| 152 | +- [Java / Core Builds](references/build-java.md) — Java modules, gremlin-server, integration tests |
| 153 | +- [Python GLV](references/build-python.md) — build, test, result evaluation |
| 154 | +- [JavaScript GLV](references/build-javascript.md) — npm workspace, build, test, evaluation |
| 155 | +- [.NET GLV](references/build-dotnet.md) — build, test, Docker setup |
| 156 | +- [Go GLV](references/build-go.md) — build, test, Docker setup |
| 157 | +- [Documentation](references/documentation.md) — AsciiDoc generation, website |
| 158 | +- [Gremlin MCP Server](references/gremlin-mcp.md) — translation, formatting, querying via MCP |
0 commit comments