Skip to content

fix: Add missing yaml dependency for hooks#636

Closed
m4nt0de4 wants to merge 1 commit intodanielmiessler:mainfrom
m4nt0de4:fix/missing-yaml-dependency
Closed

fix: Add missing yaml dependency for hooks#636
m4nt0de4 wants to merge 1 commit intodanielmiessler:mainfrom
m4nt0de4:fix/missing-yaml-dependency

Conversation

@m4nt0de4
Copy link
Copy Markdown
Contributor

Summary

  • SecurityValidator.hook.ts imports from 'yaml', but there is no root package.json in ~/.claude/
  • The yaml package only exists in subdirectory package.json files (skills/Agents/Tools/, skills/Prompting/Templates/Tools/)
  • Fresh installs will fail with Cannot find package 'yaml' when SecurityValidator triggers
  • Adds a root package.json with the yaml dependency and a bun install step to INSTALL.ts

Affected files

Files that import from yaml at the root resolution scope:

  • hooks/SecurityValidator.hook.ts (line 66)
  • skills/PAI/Tools/LoadSkillConfig.ts (line 20)
  • skills/Evals/Tools/SuiteManager.ts (line 10)
  • skills/Evals/Tools/AlgorithmBridge.ts (line 13)
  • skills/Evals/Tools/FailureToTask.ts (line 11)

Reproduction

  1. Fresh clone and install of PAI v2.5
  2. Launch a session with default hooks enabled
  3. Trigger any tool use (Bash, Edit, Write, Read) to fire SecurityValidator
  4. Hook fails with: Cannot find package 'yaml'

Fix

  1. Added Releases/v2.5/.claude/package.json with yaml dependency
  2. Added bun install step to INSTALL.ts after directory creation

Test plan

  • Fresh install completes without errors
  • SecurityValidator hook fires successfully on tool use
  • LoadSkillConfig.ts can parse YAML frontmatter
  • No regressions in existing hook behavior

🤖 Generated with Claude Code

SecurityValidator.hook.ts imports from 'yaml', but there is no root
package.json in ~/.claude/. The yaml package only exists in subdirectory
package.json files (Agents/Tools, Prompting/Templates/Tools), which
don't resolve for hooks running from the root.

This adds a root package.json with the yaml dependency and a bun install
step to INSTALL.ts so fresh installs don't fail with
"Cannot find package 'yaml'" when SecurityValidator triggers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kaimagnus
Copy link
Copy Markdown
Collaborator

Thank you for catching the missing yaml dependency, @m4nt0de4! Good catch — hooks that parse YAML need the dependency available.

The target path (Releases/v2.5/) has been superseded by v3.0's restructured installer. Closing as the paths no longer match. Appreciate the fix!

@kaimagnus kaimagnus closed this Feb 15, 2026
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