This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Validates ioBroker adapter repositories for compliance. Two main use cases:
- Repo checking — an Express/Lambda server that takes an adapter repo URL, downloads it, and runs ~100+ checks returning JSON with errors/warnings.
- Object structure validation — a standalone validator for ioBroker object dump JSON files (state schemas, hierarchy, roles).
npm run start <repo-url> [branch] [--debug] [--local] [--noinfo] [--strict] # local testing
npx @iobroker/repochecker <repo-url> [branch] [--debug] [--local] [--noinfo] [--strict] # CLI
node scripts/checkObjectStructure.js <path-to-json> # Validate object dumpNo automated test suite exists.
index.js → sequential promise chain, each stage enriches a context object:
- M0000_PackageJson — package.json validation
- M1000_IOPackageJson — io-package.json validation
- M2000_Npm — npm registry checks
- M3000_Testing — test-and-release.yml workflow, Node.js versions
- M4000_Repository — ioBroker repository presence
- M5000_Code — source code scanning (imports, timers, Sentry, env)
- M6000_Readme — README structure & language
- M7000_License — LICENSE file & copyright years
- M8000_Github — workflow files, GitHub settings
- M9000_GitNpmIgnore — .npmignore & .gitignore
- Postprocessing — severity remapping for new adapters
lib/objectStructure.js — Pure function (no I/O, no logging). Validates parsed ioBroker object dumps against schemas in lib/config_StateRoles.js. Returns { adapter, objectCount, errors: [{code, message}], warnings: [{code, message}] }. Module uses externally by github workflows.
scripts/checkObjectStructure.js — CLI wrapper.
lib/common.js— Logging, file/URL caching, GitHub API calls, semver handlinglib/config.js— Constants (languages, licenses, Node versions, schema URLs)lib/postprocessing.js— Severity remapping for new adapters
- Readable code: prefer human readable code ove high sophiticated or optimaized implementaions. Add comments where needed.
- Error codes: E#### (error), W#### (warning), S#### (suggestion). Ranges match module numbering (0000–0999 = package.json, 1000–1999 = io-package.json, etc.). Maintain consistency with existing numbering. Ensure that numbers are not duplicated and are with the range assigned to the files containing the code.
- Schema URLs: Always use
config.schemaUrls['io-package']andconfig.schemaUrls.jsonConfigfromlib/config.js— never hardcode. - Minimal changes: Make focused changes. Do not modify version numbers, or unrelated files.
- Dependencies: Only add if absolutely necessary; use exact or semver-compatible ranges.
- Changelog: always add a changelog entry into README.md.
Every PR must add a user-friendly entry in README.md under ## **WORK IN PROGRESS** using the format:
* (author) Description of user-visible change