anthropics / anthropics/financial-services

financial-analysis@0.1.0: hooks/hooks.json contains `[]` which fails Claude Code schema validation (expects object)

未关闭
#109 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
34.8k
派生
5.2k
平均合并
2 小时 2 分钟
30 天内合并 PR
3

描述

## Summary

The `financial-analysis` plugin (v0.1.0) fails to load in Claude Code because `hooks/hooks.json` contains a literal empty array `[]`, but Claude Code's plugin loader validates that the root of `hooks.json` must be an object.

## Steps to reproduce

```bash
claude plugin marketplace add anthropics/financial-services-plugins
claude plugin install financial-analysis@claude-for-financial-services
claude plugin list
```

## Observed behavior

```
❯ financial-analysis@claude-for-financial-services
Version: 0.1.0
Scope: user
Status: ✘ failed to load
Error: Hook load failed: [
{
"expected": "object",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected object, received array"
}
]
```

The other agents installed alongside (`pitch-agent`, `model-builder`, `market-researcher`) load fine — they don't ship a `hooks.json`.

## Root cause

`plugins/vertical-plugins/financial-analysis/hooks/hooks.json` is currently:

```json
[]
```

Working plugins (e.g., `vercel@claude-plugins-official`) use the form:

```json
{ "hooks": { /* ... */ } }
```

So the `[]` is rejected at the root by the loader's schema.

## Suggested fix

Either:

**(a)** Replace the file content with an empty hooks object:

```json
{ "hooks": {} }
```

**(b)** Remove `hooks/hooks.json` entirely if `financial-analysis` is not intended to register any hooks (the loader treats absent files as "no hooks").

I can confirm that swapping `[]` to `{}` *alone* is **not** sufficient — the loader appears to additionally require the `hooks` key, and only `{ \"hooks\": {} }` (or a populated form) lets the plugin reach `Status: ✔ enabled`.

## Environment

- Claude Code: `2.1.132`
- OS: Windows 11 (Git Bash / mingw)
- Plugin: `financial-analysis@0.1.0`
- Marketplace: `claude-for-financial-services` (cloned from `anthropics/financial-services-plugins`)

## Workaround applied locally

Edited both copies (the marketplace clone and the install cache):

- `~/.claude/plugins/cache/claude-for-financial-services/financial-analysis/0.1.0/hooks/hooks.json`
- `~/.claude/plugins/marketplaces/claude-for-financial-services/plugins/vertical-plugins/financial-analysis/hooks/hooks.json`

Both replaced with `{ "hooks": {} }`. Both edits are needed because reinstall re-copies from the marketplace tree into the cache.

Happy to send a small PR if useful.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。