Read and parse plugin.json from plugin directory.
(plugin_dir: Path)
| 24 | |
| 25 | |
| 26 | def read_plugin_json(plugin_dir: Path) -> dict: |
| 27 | """Read and parse plugin.json from plugin directory.""" |
| 28 | path = plugin_dir / ".claude-plugin" / "plugin.json" |
| 29 | try: |
| 30 | with open(path, encoding="utf-8") as f: |
| 31 | return json.load(f) |
| 32 | except (OSError, json.JSONDecodeError): |
| 33 | return {} |
| 34 | |
| 35 | |
| 36 | def parse_frontmatter(content: str) -> tuple[dict, str]: |