AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
80/100
Scores the file, not the repository.Length
898 words
15 headings · 0 code blocksRepository
20
— · pushed 7 days agoLast changed
3 days ago
First indexed 3 days ago.1# HubSpot Local Dev Lib Agent Instructions23This repository is `@hubspot/local-dev-lib` — a shared TypeScript library that provides core functionality for HubSpot local development tooling. It is consumed by the HubSpot CLI and VS Code extension.45## Stack67- Language: TypeScript in strict mode, ESM modules8- Testing: Vitest (not Jest, not jasmine)9- Package manager: Yarn10- Build: `yarn build`11- Lint: `yarn lint`12- Format: `yarn prettier:write`1314Do not use Java, Maven, CHIRP, Bend, Trellis, or HubSpot backend/frontend platform workflows for normal work in this repo.1516## This is a Library, Not a CLI1718This repo is consumed via `@hubspot/local-dev-lib` by the CLI and other tools. Key implications:1920- No `process.exit()` — throw errors and let consumers handle them.21- No direct user prompts — return data and let the CLI prompt.22- No default exports — named exports only (enforced by ESLint).23- All exports must be declared in `package.json` `exports` field.2425Key consumers:2627- `hubspot-cli` — the primary consumer28- VS Code extension — uses config and API functions2930Changes here affect all consumers. Be careful with breaking changes to exported function signatures.3132## Start Here3334Before creating or modifying code, study how the repo already does the same kind of work.3536- Search for similar files and read at least two comparable examples before adding a new file.37- Check `lib/`, `config/`, `api/`, or `utils/` before adding a new function.38- Check `types/` before adding a new shared type.39- Follow the discriminated union pattern used for account types.40- Check `lang/en.json` before adding user-facing strings. Use the `i18n()` function with `{{ variable }}` interpolation.41- If existing implementations disagree in a meaningful way, stop and surface the discrepancy instead of silently choosing one pattern.4243## Code Organization4445- `api/` — HTTP calls to HubSpot services. Return `HubSpotPromise<T>`.46- `config/` — Config file read/write (YAML). Core account resolution logic.47- `constants/` — Shared constants.48- `errors/` — Custom error classes (`HubSpotHttpError`, `HubSpotConfigError`, `FileSystemError`).49- `http/` — Axios wrapper with HubSpot auth.50- `lang/` — i18n strings (`en.json`).51- `lib/` — Exported functions and modules. Anything exported from the repo should live here (excluding special cases like `config/`).52- `utils/` — Internal helper functions that are NOT exported.53- `models/` — Business logic classes.54- `types/` — TypeScript type definitions.5556## Error Handling5758- Throw custom error classes from `errors/`, never return error objects.59- Use `HubSpotHttpError` for API failures, `HubSpotConfigError` for config issues, `FileSystemError` for FS operations.60- Never call `process.exit()` — that is the consumer's responsibility.6162## Code Style6364- Prefer functions over classes.65- Use early returns to keep control flow readable.66- Use descriptive variable names.67- Do not introduce `any` unless there is a narrow, well-justified reason.68- Do not add comments unless the code would otherwise be hard to follow.69- Follow the repo formatter for single quotes, 2-space indentation, trailing commas, and 80-character line length.70- Do not use the word `comprehensive` in repo copy or generated docs.7172## Tests7374- Tests live in co-located `__tests__/` directories.75- Test files are named `<source-file>.test.ts`.76- Use Vitest globals and existing mocks.77- No try/catch blocks in tests — use `expect().toThrow()`.78- All cleanup in `afterEach()` using `vi.restoreAllMocks()`.79- Never skip tests — fix or remove them.8081## Validation8283After code changes, run the smallest useful validation set:84851. `yarn prettier:write`862. `yarn build`873. `yarn test <path>` for changed or closely related tests8889Run broader checks when the change touches shared behavior or foundational modules.9091Additional checks:9293- Circular deps: `yarn circular-deps`9495## Testing Changes Against the CLI9697### Option 1: Local linking (for active development)98991. In this repo: `yarn local-dev` — builds, runs `yarn link`, and watches for changes.1002. In CLI: `yarn local-link` — interactive prompt to symlink local packages.1013. Changes here are reflected in the CLI after `yarn build`.102103To stop: run `yarn unlink` here, then `yarn install --force` in CLI.104105### Option 2: Experimental NPM release (for CI testing or sharing)1061071. In this repo: `yarn release -v=prerelease -t=experimental`1082. In CLI: update `package.json` to the experimental version and run `yarn install --force`.109110## Git And PR Workflow111112- Use Conventional Commits for all commit messages and PR titles. Format: `<type>: <short description>`. Types: `feat`, `fix`, `chore`, `refactor`, `test`, `docs`, `perf`, `ci`, `build`.113- Do not amend commits on an existing PR unless the user explicitly asks for an amend, rebase, squash, or history rewrite.114- When addressing review feedback on a PR, create a new follow-up commit by default.115- For stacked PRs, prefer merging parent branch updates into the child branch over rebasing, because PRs are squash-merged into `main`.116- Ask before committing, pushing, force-pushing, creating PRs, posting comments, merging, closing, or otherwise mutating GitHub state.117118## Shared Skills119120Portable project skills are exposed under `.agents/skills/`. When a task matches one of these workflows, read that skill before proceeding:121122- `code-check`: review branch changes against repo conventions.123- `push-changes`: run pre-commit checks, commit, and push to remote.124- `create-pull-request`: commit, push, and create a draft PR.125126Claude-specific skills and orchestration workflows may still live only under `.claude/skills/`.127128## Agent-Specific Config129130`AGENTS.md` is the canonical behavioral entry point. Agent-specific permission or runtime configuration should stay in that agent's own local config, such as `.claude/settings.local.json` for Claude or `.codex/rules/*.rules` for Codex command execution policy. Do not duplicate behavioral rules into permission files.131
Also in HubSpot/hubspot-local-dev-lib
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 |
|---|---|---|---|---|---|
| HubSpot/hubspot-local-dev-lib.claude/CLAUDE.md · 20 | CLAUDE.md | agent-behaviour | 4/100 | 3 days ago | |
| HubSpot/hubspot-local-dev-lib.cursor/rules/agent-entrypoint.mdc · 20 | Cursor rules | styleagent-behaviour | 49/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| 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 | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
