anthropics / anthropics/financial-services

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

Abierto
#109 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
34.8k
Forks
5.2k
Merge medio
2 h 2 min
PR fusionados (30 d)
3

Descripción

## 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.