The canonical, tool-agnostic guidance for this repo lives in AGENTS.md. It is imported below — treat it as the source of truth.
@AGENTS.md
- Every algorithm lives in its own module under
src/<module>/<module>.ts, extending the base insrc/core/core.ts;src/jsfeatNext.tsis only the aggregator that attaches the singletons (the old inline monolith and its type-only stubs are gone since #47). - Always run
npm test(Vitest parity suite vs a vendored original-jsfeat oracle) before claiming an algorithm change is verified; for consumer-facing changes also build (npm run build-ts) and check the relevantexamples/*.html, or ask the user to confirm. - On this Windows machine: verify formatting with
node_modules/.bin/prettierdirectly (barenpx prettiercan resolve the wrong version) and regeneratepackage-lock.jsononly withnpx npm@11. - The audit/roadmap is in
docs/jsfeat-parity-and-refactor-audit.md; the 0.9.0 API break is documented indocs/migration-0.9.md; the release runbook is inMAINTAINERS.md. - Keep numeric/behavioral parity with the original jsfeat; preserve the public
jsfeatNext.<module>API. - Every new source file needs a license header. Any file you create under
src/,tests/orexamples/must start with the LGPL header, or CI fails. Runnode scripts/check-license-headers.mjs --fixafter adding files. The header has three variants and the script picks by path: ported/derived code gets the upstream jsfeat MIT attribution appended, code original to jsfeatNext does not (it would be a false credit), and OpenCV-derived code (src/gms/,src/teblid/,src/freak/) gets the per-file attribution from the matchingATTRIBUTION-opencv-*.txtinstead of the jsfeat one: Apache-2.0 for gms and teblid (text inLICENSES/Apache-2.0.txt), BSD-3-Clause for freak (text inLICENSES/BSD-3-Clause-FREAK.txt). The check compares the applied header against its variant byte-for-byte, so the wrong one fails CI. See.agents/skills/license-header-adder/SKILL.md— and don't overwrite the existing *BSD/OpenCV notices insrc/math/math.tsandsrc/orb/bit_pattern_31.ts. - OpenCV comparisons and ports use OpenCV 4.10.0 only — the reference build PureCV measures against (
opencv-contrib-pythonpinned inscripts/requirements-fixtures.txt). Read upstream sources at that release, generate fixtures only with the pinned wheel, and state the version in any "OpenCV does X" claim. Changing it takes its own issue (plus the matching one in webarkit/purecv) and PR; see AGENTS.md, "OpenCV reference version".