| name | update-tool-plugin |
| description | Update an existing LNAI tool plugin |
Update Tool Plugin
Guide for modifying an existing plugin to support new features or fix issues.
Before You Start
Search the official documentation for the target tool to understand:
- Has the configuration format changed?
- Are there new features to support?
- What is the expected output format?
Plugin Locations
All plugins are in packages/core/src/plugins/:
claude-code/ - Claude Code
cursor/ - Cursor IDE
copilot/ - GitHub Copilot
windsurf/ - Windsurf IDE
opencode/ - OpenCode
gemini/ - Gemini CLI
codex/ - Codex
Common Update Scenarios
Adding Support for a New Feature
- Search official docs for the feature's config format
- Update
export() method to generate new output files
- Remove from
skipped in validate() if feature was previously skipped
- Add tests for the new export behavior
Fixing Transformation Issues
- Check
transforms.ts for transformation logic
- Update transformation functions as needed
- Verify with tests that output matches expected format
Updating Output Format
- Review tool's official docs for current format requirements
- Update
export() to match new format requirements
- Update tests to verify new output structure
Testing Changes
pnpm test packages/core/src/plugins/<tool-name>/
pnpm test
lnai sync --dry-run -t <tool-name>
Key Files to Review
| File | Purpose |
|---|
index.ts | Main plugin implementation |
types.ts | Tool-specific type definitions |
transforms.ts | Format transformation functions |
../types.ts | Plugin interface definition |
../../utils/transforms.ts | Shared transform utilities |
Validation Patterns
skipped.push({
feature: "permissions",
reason: "Tool uses global permissions only",
});
warnings.push({
message: "MCP servers require manual setup",
path: ["settings", "mcpServers"],
});
After Making Changes
- Run
pnpm typecheck to verify types
- Run
pnpm test to verify tests pass
- Run
lnai sync --dry-run to preview output
- Update documentation if behavior changed
Reference Documentation
- Existing plugins in
packages/core/src/plugins/ as examples
- The Plugin interface in
packages/core/src/plugins/types.ts
- Transform utilities in
packages/core/src/utils/transforms.ts