lint#
Validate your agent.json (or a folder of manifests) against the AgentPM schema and common best practices.
Overview#
agentpm lint checks schema conformance and common pitfalls. It can print results in multiple formats, optionally treat warnings as errors, and (lightly) auto-fix a few safe issues.
Command synopsis#
agentpm lint [PATHS...] [--schema <URL|PATH>] [--strict] [--format <pretty|json|ndjson>] [--fix]Arguments#
PATHS(default:./agent.json). Files/dirs/globs to lint. Directories are scanned recursively foragent.json.--schema <URL|PATH>. Override the default schema source. By default, the CLI uses./schemas/agentpm.manifest.schema.jsonwhen it exists relative to the current working directory; otherwise it uses the bundled schema version shipped with the CLI.--strict. Treat warnings as errors (schema violations are always errors).--format <pretty|json|ndjson>(default:pretty). Choose human-readable output or machine-friendly JSON/NDJSON.--fix. Attempt non-invasive automatic fixes (currently: inject$schemaif missing).
Use --format=json or --format=ndjson in CI and parse the result for gating.
Examples#
Lint the current manifest#
agentpm lintSample output (missing description):
✗ agent.json
[ERROR] "description" is a required property
vs schema /required
Error: Lint failedLint multiple paths (file + directory + glob)#
agentpm lint agent.json .agentpm/tools/**/agent.jsonUse a custom schema#
agentpm lint --schema ./schemas/dev.agentpm.schema.jsonYou can also point --schema at a hosted URL explicitly if you need to validate against a remote schema source.
Strict mode (warnings become errors)#
agentpm lint --strictMachine-readable output#
agentpm lint --format=json[
{
"file": "agent.json",
"ok": false,
"issues": [
{
"file": "agent.json",
"level": "error",
"message": "\"description\" is a required property",
"instance_path": "",
"schema_path": "/required"
}
]
}
]
Error: Lint failedAuto-fix safe issues#
agentpm lint --fix
# currently adds a $schema field if it's missingHow lint classifies issues#
Always errors (schema violations):
- Any JSON Schema validation failure. (Example:
"description" is a required property)
Warnings (unless --strict):
- Missing
$schema. Message:Missing $schema; editors may lack IntelliSense. - Empty
description. Message:description should not be empty. - Reserved future-facing reference fields when populated. Example message:
`memory` is validated and preserved, but not resolved in Phase 3.AgentPM acceptsmemoryandprofilesso you can track future references now, but current install and runtime flows do not resolve them yet.
Semantic error checks (beyond schema):
- Interpreter mismatch between
runtime.typeandentrypoint.command. Error message example:runtime.type should match entrypoint.command (python vs node).
Lint catches issues early so installs and publishes are predictable. agentpm publish runs lint automatically and will block the publish on any lint errors.
Exit codes#
0— All checked manifests passed (no errors; warnings allowed unless--strict).1— Lint failed (any error, or any warning when--strictis set).
Recommended workflow#
- Run
agentpm lintlocally during development. - Use
agentpm lint --format=jsonin CI to gate merges. - Add
--strictfor release branches to enforce clean manifests. - Let
--fixadd$schemaautomatically; commit the change.
Notes & gotchas#
$schemafield. Including$schemaenables IDE IntelliSense and makes the schema version explicit. Lint will add it for you with--fix.- Globs & directories. When passing directories, ensure your shell doesn’t expand globs unexpectedly; quote them if needed (e.g.,
"tools/**/agent.json").