Skip to content

Commit 00e5c73

Browse files
sequbacursoragentmarcin-kordas-hoc
authored
Clean up in-repo dev docs (HF-65) (#1682)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ### Context The in-repo developer documentation was scattered across several files with significant duplication: - `CLAUDE.md` duplicated build/test commands (also in `docs/guide/building.md`), contributing rules (also in `CONTRIBUTING.md` / `docs/guide/contributing.md`), and translation sources (also in `DEV_DOCS.md`). - `CONTRIBUTING.md` was an almost-verbatim copy of `docs/guide/contributing.md`. - `DEV_DOCS.md` contained only a small subset of what a developer needs. - Cursor-specific guidance did not exist. This PR removes the duplication and gives both humans and AI agents a single, predictable entry point. ### New structure | File | Role | | --- | --- | | `DEV_DOCS.md` | **Canonical** dev docs. Project overview, architecture, code style, definition of done, how to add a function, translation sources, plus quick links to the build / contributing / test docs. | | `docs/guide/building.md` | Full description of build, verify, docs, test, and lint commands, including output formats. Public, for users and devs. | | `docs/guide/contributing.md` | Full contributor guide. Public, for users and devs. | | `AGENTS.md` | Pointer to `DEV_DOCS.md` plus rules specific to AI agents (attribution, response style). | | `CLAUDE.md` | Pointer to `AGENTS.md`. | | `.cursor/rules/main.mdc` | Cursor rule that points to `AGENTS.md` (always applied). | | `CONTRIBUTING.md` | Pointer to `docs/guide/contributing.md`. | ### How did you test your changes? Manual review of the resulting file set: - `DEV_DOCS.md` contains everything a developer needs and links to `docs/guide/building.md`, `docs/guide/contributing.md`, `docs/guide/code-of-conduct.md`, `test/README.md`, `docs/README.md`, `CHANGELOG.md`, and `.github/pull_request_template.md`. - `AGENTS.md` links to `DEV_DOCS.md` and only adds agent-specific rules. - `CLAUDE.md`, `.cursor/rules/main.mdc`, and `CONTRIBUTING.md` are thin pointers with no duplicated content. - `docs/guide/building.md` is the only place that lists build/test/lint commands and bundle output formats. - `docs/guide/contributing.md` is unchanged (it already covered the contributor flow in full). ### Types of changes - [ ] Breaking change (a fix or a feature because of which an existing functionality doesn't work as expected anymore) - [ ] New feature or improvement (a non-breaking change that adds functionality) - [ ] Bug fix (a non-breaking change that fixes an issue) - [ ] Additional language file, or a change to an existing language file (translations) - [x] Change to the documentation ### Related issues 1. HF-65 ### Checklist - [x] I have reviewed the guidelines about [Contributing to HyperFormula](https://hyperformula.handsontable.com/guide/contributing.html) and I confirm that my code follows the code style of this project. - [ ] I have signed the [Contributor License Agreement](https://goo.gl/forms/yuutGuN0RjsikVpM2). - [ ] My change is compliant with the [OpenDocument](https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html) standard. - [ ] My change is compatible with Microsoft Excel. - [ ] My change is compatible with Google Sheets. - [ ] I described my changes in the [CHANGELOG.md](https://github.com/handsontable/hyperformula/blob/master/CHANGELOG.md) file. - [ ] My changes require a documentation update. - [ ] My changes require a migration guide. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-0a7bf4d1-d3c8-4edd-aacd-3a9df3a69526"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-0a7bf4d1-d3c8-4edd-aacd-3a9df3a69526"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kuba Sekowski <sequba@users.noreply.github.com> Co-authored-by: marcin-kordas-hoc <marcin.kordas@handsontable.com>
1 parent c7cfc9d commit 00e5c73

6 files changed

Lines changed: 161 additions & 169 deletions

File tree

.cursor/rules/main.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: Project-wide guidance for AI agents working in this repository
3+
alwaysApply: true
4+
---
5+
6+
All guidance for AI agents working in this repository lives in [AGENTS.md](mdc:AGENTS.md) at the repository root. Read it first.

AGENTS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# AGENTS.md
2+
3+
Instructions for AI coding agents (Cursor, Claude Code, Codex, Aider, and any other AI tool) working in this repository.
4+
5+
## Start here
6+
7+
Whatever you do, start by reading entire [DEV_DOCS.md](DEV_DOCS.md). Only then proceed to your task.
8+
9+
## Other important resources
10+
11+
- the repository [README.md](README.md) &mdash; high-level project description and quick install/usage
12+
- the markdown files in [`docs/guide/`](docs/guide/) &mdash; user-facing guides (installation, configuration, built-in functions, custom functions, integrations, etc.)
13+
- the markdown files in [`docs/api/`](docs/api/) &mdash; API reference (generated from JSDoc; run `npm run docs:build` if the folder is missing)
14+
15+
Prefer reading these local files over fetching the rendered documentation from the web.
16+
17+
## Response style
18+
19+
- Be concise by default. Use as few words as possible unless the user asks for more detail.
20+
- When the user asks for specific content, lead the response with the requested information.
21+
- Structure answers with bullet lists, numbered lists, tables, or code blocks where useful.
22+
- Ask clarifying questions when the request is ambiguous rather than guessing.
23+
- If you do not know something, say so and ask for help.
24+
- When answering from project documentation, quote the exact relevant fragments to support your claim.
25+
26+
## Common ways agents fail
27+
28+
This section is maintained by the team. Whenever an AI agent makes a mistake worth flagging, an item is added here describing what the agent did wrong and what it should have done instead. Read this list before starting any non-trivial task.
29+
30+
<!-- Add new items to the top of the list. Use the format:
31+
- **Short title** &mdash; What the agent did wrong. What it should have done instead.
32+
-->
33+
34+
_No items yet._
35+
36+
## Skills, MCPs, and other agent tools
37+
38+
This section is maintained by the team. Skills, MCP servers, and other tools vetted as useful for AI agents working on this codebase are listed here.
39+
40+
<!-- Add new items here. Use the format:
41+
- **Name** &mdash; What it provides and when to use it.
42+
-->
43+
44+
_No items yet._

CLAUDE.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

CONTRIBUTING.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/guide/contributing.md

DEV_DOCS.md

Lines changed: 94 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,104 @@
1-
# Dev Docs
1+
# Developer documentation
22

3-
Random notes and things to know useful for maintainers and contributors.
3+
Canonical reference for everyone working on the HyperFormula source code: maintainers, the internal team, and AI agents triggered by them. Everything a developer needs to know lives here or is linked from here.
44

5-
## Definition of Done for the code changes
5+
## Quick links
66

7-
Each change to the production code (bugfixes, new features, improvements) must include these elements. They must be present in the pull request BEFORE requesting the code review.
7+
- **[Building, testing, and linting](docs/guide/building.md)** &mdash; all `npm` commands and build outputs
8+
- **[Test suite](test/README.md)** &mdash; smoke tests and how to attach the private test suite
9+
- **[Public docs portal](https://hyperformula.handsontable.com/docs)** &mdash; main documentation
10+
- **[Docs README](docs/README.md)** &mdash; how to run the docs portal locally
11+
- **[Changelog](CHANGELOG.md)**
12+
- **[Pull request template](.github/pull_request_template.md)**
813

9-
- changes to the production code
10-
- including changes to all supported language packs in `src/i18n/languages` directory (if applicable)
11-
- automatic tests
12-
- for bugfixes: at least one test reproducing the bug
13-
- for new features: a set of tests describing the feature specification precisely
14-
- pull requests from external contributors should include tests in `tests/` directory (they will be moved to the private repository by the internal team)
15-
- internal team adds tests directly to the private repository (through a separate pull request)
16-
- updates to documentation related to the change
14+
## Repository layout
15+
16+
```
17+
.
18+
├── src/ # Source code
19+
│ ├── HyperFormula.ts # Main engine class, public API entry point
20+
│ ├── parser/ # Formula parsing (uses Chevrotain parser generator)
21+
│ ├── interpreter/ # Formula evaluation engine
22+
│ │ └── plugin/ # Built-in spreadsheet function plugins
23+
│ ├── DependencyGraph/ # Cell dependency tracking and recalculation order
24+
│ ├── CrudOperations.ts # Create/read/update/delete operations on sheets and cells
25+
│ └── i18n/ # Function-name translations per language
26+
├── test/ # Test suite
27+
├── docs/ # Public documentation portal (VuePress)
28+
│ ├── guide/ # Markdown guides (building, contributing, usage…)
29+
│ ├── api/ # API reference (generated from JSDoc)
30+
│ ├── .vuepress/ # VuePress configuration, theme, components
31+
│ └── README.md # How to run the docs portal locally
32+
├── script/ # Maintenance and release scripts
33+
├── .github/ # CI workflows, issue and PR templates
34+
├── DEV_DOCS.md # Canonical developer documentation (this file)
35+
├── AGENTS.md # Guidance for AI agents
36+
├── CONTRIBUTING.md # Guide for external contributors
37+
├── README.md # Project overview
38+
├── CHANGELOG.md
39+
├── LICENSE.txt
40+
├── package.json
41+
└── tsconfig.json
42+
```
43+
44+
## Architecture
45+
46+
### Core modules
47+
48+
- `src/HyperFormula.ts` &mdash; main engine class, public API entry point
49+
- `src/parser/` &mdash; formula parsing (uses the [Chevrotain](https://chevrotain.io/) parser generator)
50+
- `src/interpreter/` &mdash; formula evaluation engine
51+
- `src/DependencyGraph/` &mdash; cell dependency tracking and recalculation order
52+
- `src/CrudOperations.ts` &mdash; create/read/update/delete operations on sheets and cells
53+
54+
### Function plugins (`src/interpreter/plugin/`)
55+
56+
All spreadsheet functions are implemented as plugins extending `FunctionPlugin`. Each plugin:
57+
58+
- declares an `implementedFunctions` static property mapping function names to metadata
59+
- uses the `runFunction()` helper for argument validation, coercion, and array handling
60+
- registers function translations in `src/i18n/languages/`
61+
62+
## How to add a new function
63+
64+
Adding a built-in function is similar to adding a [custom function](docs/guide/custom-functions.md), so that guide is a useful reference for the function-implementation patterns (argument metadata, return types, array handling). The built-in flow on top of that is:
65+
66+
1. Create or modify a plugin in `src/interpreter/plugin/`.
67+
2. Add function metadata to `implementedFunctions`.
68+
3. Implement the function method.
69+
4. Add translations to all language files in `src/i18n/languages/`.
70+
5. Add tests in `test/unit/interpreter/`.
71+
72+
## Code style
73+
74+
- Prefer a functional approach where possible (`filter`, `map`, `reduce`).
75+
- Write self-documenting code: use meaningful names for classes, functions, and variables. Add code comments only when they explain intent the code itself cannot.
76+
- Add JSDoc to all classes and functions.
77+
- ESLint is the source of truth for formatting and code rules. Run `npm run lint` before submitting changes (see [building](docs/guide/building.md#run-the-linter)).
78+
79+
## Definition of Done
80+
81+
Each change to the production code (bugfix, new feature, or improvement) must include the following elements **before** requesting a code review:
82+
83+
- Changes to the production code
84+
- including changes to all supported language packs in `src/i18n/languages` (if applicable)
85+
- Automatic tests
86+
- for bug fixes: at least one test reproducing the bug
87+
- for new features: a set of tests precisely describing the feature
88+
- pull requests from external contributors should include tests in the `test/` directory (they will be moved to the private repository by the internal team)
89+
- the internal team adds tests directly to the private repository (through a separate pull request)
90+
- Updates to documentation related to the change
1791
- for breaking changes: a section in the migration guide
18-
- technical documentation in the form of the jsdoc comments (high-level description of the concepts used in the more complex code fragments)
19-
- changelog entry
20-
- pull request description
92+
- Technical documentation in the form of JSDoc comments (high-level description of the concepts used in more complex code fragments)
93+
- Changelog entry
94+
- Pull request description
95+
96+
## Internationalization and function translations
97+
98+
HyperFormula supports internationalization and provides localized function names for all built-in languages. Translation files live in `src/i18n/languages/`. New functions must include translations for all built-in languages.
2199

22-
## Sources of the function translations
100+
When looking for the valid translations for new functions, try these sources:
23101

24-
HF supports internationalization and provides the localized function names for all built-in languages. When looking for the valid translations for the new functions, try these sources:
25102
- https://support.microsoft.com/en-us/office/excel-functions-translator-f262d0c0-991c-485b-89b6-32cc8d326889
26103
- http://dolf.trieschnigg.nl/excel/index.php
27104

docs/guide/building.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ The build process uses Webpack and Babel, as well as npm tasks
44
listed in package.json. During this process, the source located in
55
the `src/*` directory is transformed into the output files.
66

7+
The library is developed in TypeScript and the exact configuration
8+
options can be found in `tsconfig.json`. To run the commands you need
9+
to set up your environment to have `npm` or `yarn` properly installed.
10+
After that, navigate to the project and run `npm install`.
11+
12+
## Output formats
13+
14+
The build produces the following output formats, all declared as
15+
entry points in `package.json`:
16+
17+
* `commonjs/` - CommonJS modules (main entry, used by Node.js and bundlers)
18+
* `es/` - ES modules (`.mjs` files, used by tree-shaking bundlers)
19+
* `dist/` - UMD bundles for direct use in the browser
20+
* `typings/` - TypeScript declaration files (`.d.ts`)
21+
722
**For UMD versions which reside in CDN:**
823

924
* `./dist/hyperformula.js` - a full version which does not have
@@ -14,16 +29,6 @@ have dependencies, they need to be added manually
1429
* `./dist/hyperformula.full.min.js` - a minified version with
1530
dependencies
1631

17-
There are also versions of builds in CommonJS, ES6, and TypeScript
18-
definitions. They are marked in the package.json file. Based on
19-
the tools used (Webpack, parsers, etc.), a proper build will be
20-
respectively chosen.
21-
22-
The library is developed in TypeScript and the exact configuration
23-
options can be found in `tsconfig.json`. To run the commands you need
24-
to set up your environment to have `npm` or `yarn` properly installed.
25-
After that, navigate to the project and run `npm install`.
26-
2732
## Build the project
2833

2934
To build the project you can use the following commands:

0 commit comments

Comments
 (0)