Skip to content

Conversation

@scaryrawr
Copy link
Owner

Summary

Adds a plugin caching system with automatic environment variable expansion for plugin configurations.

Features

  • Cache system: Copies plugins per construct instance to ~/.cache/construct/plugins/<instance-id>/
  • Environment variable expansion: Support ${VAR} and ${VAR:-default} syntax
  • Expansion scope: .mcp.json, agent frontmatter, skill frontmatter
  • CLAUDE_PLUGIN_ROOT: Special variable expands to cached plugin path
  • HTTP MCP servers: Support for type: http servers in translation
  • --clear-cache flag: CLI option to clean up orphaned caches after crashes
  • Auto-cleanup: Cache is automatically removed on process exit (normal + signals)

Files Added

  • src/cache.ts - Cache initialization, cleanup, file expansion
  • src/env-expansion.ts - Core variable expansion logic
  • src/skill-translator.ts - Skill frontmatter expansion helper
  • variable-expansion.md - Design documentation
  • Test files for cache and env-expansion

Files Modified

  • src/translator.ts - Use cache for plugin loading, HTTP server support
  • src/agent-translator.ts - Read agents from cached path
  • src/cli.ts + index.ts - Add --clear-cache flag
  • README.md + CLAUDE.md - Documentation updates

- Add cache system that copies plugins per construct instance
- Support ${VAR} and ${VAR:-default} syntax in configs
- Expand env vars in .mcp.json, agent frontmatter, skill frontmatter
- Add CLAUDE_PLUGIN_ROOT expansion to cached plugin path
- Add --clear-cache CLI flag for cleanup after crashes
- Support HTTP MCP servers in translation
- Auto-cleanup cache on process exit (including SIGINT/SIGTERM)
@scaryrawr scaryrawr force-pushed the feat/plugin-caching branch from eb2dcc3 to 15b5070 Compare January 14, 2026 16:19
@scaryrawr scaryrawr merged commit fdd9138 into main Jan 14, 2026
1 check passed
@scaryrawr scaryrawr deleted the feat/plugin-caching branch January 14, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants