Commit Graph
1 Commits
Author SHA1 Message Date
Cursor AgentandTom Huang 729ef2ebb5 feat(plugins): od plugin validate <folder> author-side lint (Phase 4)
Plan W1 / spec §11.5 / §16 Phase 4.

apps/daemon/src/plugins/validate.ts ships the pre-install lint
helper:

  validatePluginFolder({ folder, registry?, connectorProbe? })
    \u2192 { ok, resolveErrors, resolveWarnings, doctor?, folder }

Reads the folder via the same resolvePluginFolder() the installer
uses (so manifest parsing is byte-equal), then runs doctorPlugin()
against the supplied registry view. Without a registry, ref-bound
checks skip cleanly (offline mode); with an empty/full registry,
unresolved skill / DS / atom refs surface as warnings.

  flattenValidationDiagnostics(result) \u2192 Diagnostic[]

Convenience flattener for renderers that don't want to special-case
resolve vs. doctor diagnostics.

apps/daemon/src/cli.ts `od plugin validate <folder>`:

  Usage: od plugin validate <folder> [--json] [--no-daemon] [--daemon-url <url>]

  Optional --no-daemon skips the registry fetch (works fully
  offline). When the daemon is reachable, the registry view is
  fetched from /api/skills + /api/design-systems + /api/atoms so
  ref checks happen against the operator's actual library.

Exit codes:
  0  doctor.ok = true
  4  doctor.ok = false (errors present)
  2  CLI usage error / folder unreadable

Help block in printPluginHelp() updated.

Daemon tests: 1666 \u2192 1674 (+8 cases on plugins-validate: clean
manifest passes, empty folder errors at resolve, malformed JSON
parse error, unknown atom id error, unparseable until expression
error, missing skill ref no-op without registry, missing skill ref
flagged with empty registry, flatten ordering).

Co-authored-by: Tom Huang <1043269994@qq.com>
2026-05-09 16:21:57 +00:00