AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
93/100
Scores the file, not the repository.Length
764 words
14 headings · 2 code blocksRepository
1.6k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# HASH Development Guide23## Repository Structure and Navigation45The HASH repository is organized into several key directories:67- `/apps` - Core applications powering HASH8 - `/hash-api` - Backend API service9 - `/hash-frontend` - Web frontend application10 - `/hash-graph` - Graph database service11 - `/hash-ai-worker-ts` - AI worker services12 - `/hash-integration-worker` - Integration worker services1314- `/infra/compose` - Docker Compose stack for external services (Postgres, Kratos, Hydra, Temporal, observability)1516- `/blocks` - Block Protocol components (each subfolder contains a self-contained block)1718- `/libs` - Shared libraries and packages19 - `/@blockprotocol` - Block Protocol related libraries20 - `/@hashintel` - HASH-specific libraries21 - `/@local` - Internal libraries for the monorepo22 - Other core libraries (e.g., `error-stack`)2324- `/infra` - Deployment and infrastructure code25 - `/docker` - Docker configurations26 - `/terraform` - Terraform infrastructure as code2728- `/tests` - Test suites spanning multiple components2930**Navigation Tips:**3132- When exploring a new feature, first identify which app or lib it belongs to33- Related code is typically co-located within the same directory34- Check existing implementations before creating new ones35- For understanding cross-component interactions, look for integration tests in `/tests`3637## Common Commands3839### Development4041- Main development: `yarn dev` (starts API and frontend)42- Backend only: `yarn dev:backend` or `yarn dev:backend:api`43- Frontend only: `yarn dev:frontend`4445### Starting Services4647- Start all services: `yarn start`48- Start graph only: `yarn start:graph`49- Start backend only: `yarn start:backend`50- Start frontend only: `yarn start:frontend`51- Start workers: `yarn start:worker`5253### Testing5455- Unit tests: `yarn test:unit`56- Integration tests: `yarn test:integration`5758### Linting and Fixing5960- Lint everything: `yarn lint`61- TypeScript type check: `yarn lint:tsc`62- ESLint: `yarn lint:eslint`63- Formatting check: `yarn lint:format`6465- Fix ESLint issues: `yarn fix:eslint`66- Fix formatting: `yarn fix:format`6768### For Specific Packages6970When working on a specific package, use:7172```bash73# For TypeScript/JavaScript packages74turbo run <command> --filter '<package-name>'7576# For Rust packages77cargo nextest run --package <package-name>78cargo test --package <package-name> --doc # For doc tests79cargo clippy --all-features --package <package-name>80```8182For Rust packages, you can add features as needed with `--all-features`, specific features like `--features=foo,bar`, or use `cargo-hack` with `--feature-powerset` for comprehensive feature testing.8384### Monorepo wiring for Rust crates8586Each Rust crate has a `package.json` whose **identity and workspace-dependency wiring** — its `@rust/<name>` name, version, and the `dependencies` mirroring its `Cargo.toml` — is generated from `Cargo.toml`. After **adding, removing, or renaming a Rust crate**, or changing its `Cargo.toml` dependencies, re-sync that wiring:8788```bash89mise run sync:turborepo # sync package.json identity + deps from Cargo.toml metadata90```9192`sync:turborepo` only manages that generated wiring — the `scripts` section is hand-maintained and is used by CI and Turborepo (e.g. `test:unit`, `lint:clippy`, `doc:dependency-diagram`), so add or edit scripts by hand. The task wraps the `repo-chores` CLI; the equivalent direct invocation is `cargo run --package hash-repo-chores --bin repo-chores-cli -- sync-turborepo`. A related task, `mise run fix:package-json`, sorts `package.json` keys consistently.9394## Documentation Maintenance9596### Petrinaut user-facing docs9798The Petrinaut user guide lives at `libs/@hashintel/petrinaut/docs/*.md` and is the source of truth for end-user behaviour. The in-app AI assistant reads these pages at runtime via the `readPetrinautDoc` tool, so stale docs lead directly to wrong advice in the product.99100When you change UI or behaviour in the petrinaut packages (`libs/@hashintel/petrinaut`, `libs/@hashintel/petrinaut-core`), you MUST:1011021. Review the user-facing docs that mention the affected feature and update them in the same change.1032. If you add a brand-new user-facing surface (panel, view, mode, tool, settings dialog, ...), add a corresponding page and link it from `libs/@hashintel/petrinaut/docs/README.md`.1043. When you add a new doc page, also register it in `petrinautDocNames` and `petrinautDocSummaries` in `libs/@hashintel/petrinaut-core/src/ai.ts`, and add a `?raw` import in `libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/petrinaut-docs-content.ts`. The tests in `libs/@hashintel/petrinaut-core/src/ai.test.ts` and `petrinaut-docs-content.test.ts` enforce that every enum value has a summary and a content entry.1054. Keep the docs end-user-focused: describe what the user sees, what they click, what happens. Do not document Storybook, internal modules, or test setup in the user guide.1065. If UI are changes that may make screenshots in the docs outdated, you MUST prompt your user to replace the screenshots.107108If a change ships without doc updates, call that out in your summary so the user can decide whether to follow up.109110## Contextual Rules111112CRITICAL: For the files referenced below, use your Read tool to load it on a need-to-know basis, ONLY when relevant to the SPECIFIC task at hand:113114- .config/agents/rules/\*.md115116Instructions:117118- Do NOT preemptively load all references - use lazy loading based on actual need119- When loaded, treat content as mandatory instructions that override defaults120- Follow references recursively when needed121
Also in hashintel/hash
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hashintel/hash.cursor/rules/ai-assistant-guidelines.mdc · 1.6k | Cursor rules | do-not | 51/100 | 3 days ago | |
| hashintel/hash.cursor/rules/git-commit-conventions.mdc · 1.6k | Cursor rules | lint-formatstylegitdo-not | 51/100 | 3 days ago | |
| hashintel/hash.cursor/rules/meaningful-identifiers.mdc · 1.6k | Cursor rules | do-not | 32/100 | 3 days ago | |
| hashintel/hash.cursor/rules/rust-coding-style.mdc · 1.6k | Cursor rules | lint-formatstyletypesdependencies+2 | 69/100 | 3 days ago | |
| hashintel/hash.cursor/rules/rust-documentation.mdc · 1.6k | Cursor rules | docs | 33/100 | 3 days ago | |
| hashintel/hash.cursor/rules/rust-error-handling.mdc · 1.6k | Cursor rules | no sections | 31/100 | 3 days ago | |
| hashintel/hash.cursor/rules/rust-testing-strategy.mdc · 1.6k | Cursor rules | testlint-formatstyletesting-strategy | 81/100 | 3 days ago | |
| hashintel/hash.cursor/rules/rust-tracing-practices.mdc · 1.6k | Cursor rules | no sections | 45/100 | 3 days ago | |
| hashintel/hash.cursor/rules/update-rules.mdc · 1.6k | Cursor rules | no sections | 4/100 | 3 days ago | |
| hashintel/hash.github/instructions/code-review.instructions.md · 1.6k | Copilot instructions | lint-formatstylegitdo-not+1 | 78/100 | 3 days ago | |
| hashintel/hash.github/instructions/rust-review.instructions.md · 1.6k | Copilot instructions | lint-formatstylegitdo-not | 73/100 | 3 days ago | |
| hashintel/hash.github/instructions/typescript-review.instructions.md · 1.6k | Copilot instructions | testlint-formatstyletypes+2 | 66/100 | 3 days ago | |
| hashintel/hashlibs/@hashintel/ds-components/AGENTS.md · 1.6k | AGENTS.md | buildtestlint-formatstyle+5 | 97/100 | 3 days ago | |
| hashintel/hashlibs/@hashintel/ds-helpers/AGENTS.md · 1.6k | AGENTS.md | archdependenciesagent-behaviour | 62/100 | 3 days ago | |
| hashintel/hashlibs/@hashintel/petrinaut/AGENTS.md · 1.6k | AGENTS.md | buildtestlint-formatstyle | 80/100 | 3 days ago | |
| hashintel/hash.cursor/rules/typescript-coding-guidelines.mdc · 1.6k | Cursor rules | styletypesdo-not | 65/100 | 3 days ago |
Diff against .cursor/rules/ai-assistant-guidelines.mdc Diff against .cursor/rules/git-commit-conventions.mdc Diff against .cursor/rules/meaningful-identifiers.mdc Diff against .cursor/rules/rust-coding-style.mdc Diff against .cursor/rules/rust-documentation.mdc Diff against .cursor/rules/rust-error-handling.mdc Diff against .cursor/rules/rust-testing-strategy.mdc Diff against .cursor/rules/rust-tracing-practices.mdc Diff against .cursor/rules/update-rules.mdc Diff against .github/instructions/code-review.instructions.md Diff against .github/instructions/rust-review.instructions.md Diff against .github/instructions/typescript-review.instructions.md Diff against libs/@hashintel/ds-components/AGENTS.md Diff against libs/@hashintel/ds-helpers/AGENTS.md Diff against libs/@hashintel/petrinaut/AGENTS.md Diff against .cursor/rules/typescript-coding-guidelines.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 3 days ago | |
| elastic/elasticsearchx-pack/plugin/inference/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+3 | 100/100 | 3 days ago |
