Aiditor-Settings-Plugin-Contributions
Design Log #173 — AIditor Settings Plugin Contributions
Written for AI agents. See Log Methodology Note below for details.
Background
AIditor Project settings tabs are discovered from materialized YAML under agent-kit/aiditor/settings/*.yaml after jay-stack agent-kit. Plugins opt in by shipping a template in the npm package and copying (or generating) project-local discovery files from the agentkit handler.
Related: Design Log #130 (plugin routes), #171 (devOnly on routes), #154 (shipping agent-kit/ in package files), plugin-validator validateAiditorSettings.
A production bug in design-system-validator showed that fixed parent-directory hops from import.meta.url fail when handler code is bundled to dist/index.js — the template was never materialized and the tab never appeared.
Problem
- No canonical agent-kit guide for plugin authors — settings steps were scattered in aiditor-add-menu.md and DL#171 consumer notes.
- Inconsistent path resolution —
wix-mediaused one..;design-system-validatorused two..(broken when bundled). - AI agents and humans need a checklist (template path,
files, agentkit, route +devOnly, resolver pattern) to ship tabs consistently.
Questions and Answers
Q: Should settings YAML be written in setup?
A: No. Materialize in agentkit — same lifecycle as Add Menu catalogs.
Q: Where does the template live?
A: agent-kit/aiditor/settings.template.yaml in the plugin package (validator-enforced path).
Q: Where does materialized YAML live?
A: <projectRoot>/agent-kit/aiditor/settings/<plugin>.yaml — project-owned discovery, not inside node_modules.
Q: Must the route be devOnly?
A: Yes for settings UIs — plugin-validator warns otherwise (Design Log #171). Dev server still serves the URL; AIditor loads by explicit path.
Q: Shared npm utility for resolvePackagedAgentKitPath?
A: Deferred. Copy the ~15-line walk-up helper into each plugin until a third consumer needs changes (design-system-validator, wix-media today). No new package.
Design
Materialization flow
Path resolution convention
Handlers MUST use walk-up from import.meta.url until agent-kit/aiditor/settings.template.yaml exists (max 4 levels). Do NOT assume dist/ vs lib/ depth.
Documented in agent-kit: plugin/aiditor-settings-guide.md.
Schema (validator-owned)
Types in @jay-framework/plugin-validator: AiditorSettingsFile, validateAiditorSettingsFile.
| Field | Required | Notes |
|---|---|---|
label |
yes | Tab title |
route |
yes | Must match plugin.yaml routes[].path |
pluginName |
no | Defaults from output filename |
requires |
no | { plugin, status: "configured" }[] |
Settings page boundaries
- Actions / jay-commands for mutations
- Project-generated paths only (
*.generated.yaml,agent-kit/references/) postMessagefor catalog refresh and optional agent handoff- No secrets in forms —
setupowns credentials
Implementation Plan
- Add
aiditor-settings-guide.mdto stack-cli agent-kit-template - Cross-link from
INSTRUCTIONS.md,setup-guide.md,add-menu-guide.md,plugin-routes.md - Expand aiditor
aiditor-add-menu.mdProject settings section with resolver link - Update
validate-aiditor-settingssuggestions to point at new guide - Reference implementations:
design-system-validator,wix-media
Examples
✅ Materialize with walk-up resolver (see guide).
✅ Route declaration:
routes:
- path: /my-plugin/settings
jayHtml: ./lib/pages/settings/page.jay-html
component: settingsPage
devOnly: true
❌ Fixed hop from bundled module:
path.join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'agent-kit', ...);
Trade-offs
- Per-plugin copy of resolver — avoids premature shared package; duplicate ~15 lines acceptable until pattern stabilizes.
- Validator warnings not errors for
devOnly/route mismatch — allows gradual adoption; AIditor-facing plugins should treat warnings as blocking. - Consumer runtime spec stays in AIditor docs (
aiditor-add-menu.md); jay owns plugin author materialization.
Verification Criteria
-
aiditor-settings-guide.mdin agent-kit-template with checklist and resolver - Plugin INSTRUCTIONS workflow mentions settings surface
- DL#171 consumer notes reference DL#173
-
validate-pluginsuggestions referenceaiditor-settings-guide.md - design-system-validator materializes settings after
yarn agent-kitin a consumer project
Log Methodology Note
Note: These design logs are written primarily for AI agents as part of the Design Log methodology and made accessible here for human readers. The language and structure are optimized for machine consumption — expect precise, specification-style prose rather than narrative documentation.