Featured image of post HarnessKit Dev Log #3 — Plugin Trigger Fixes and Marketplace Recommendation System

HarnessKit Dev Log #3 — Plugin Trigger Fixes and Marketplace Recommendation System

Diagnosing and fixing plugin triggering issues in HarnessKit, then redesigning the marketplace recommendation system with validation and upgrading the tool sequence to a 3-step sliding window

Overview

Previous: #2 — Marketplace-First Pivot and v2a/v2b Design and Implementation

This sprint (#3) covered two major tracks across 12 commits. First, a full audit of plugin triggering correctness, resulting in 5 fixes. Second, a redesign of the marketplace plugin recommendation system from live search to a validated, pre-curated list, plus an upgrade of the tool sequence to a 3-step sliding window.


Full Plugin Trigger Audit

Diagnosing the Problems

A comprehensive review of plugin.json skill definitions, hooks execution paths, and internal skill logic uncovered 5 triggering issues.

Fix 1: Unify to CLAUDE_PLUGIN_ROOT

Skills and hooks were referencing the plugin directory in inconsistent ways: claude plugin path calls, hardcoded paths, and relative paths all coexisted. Everything is now unified to a CLAUDE_PLUGIN_ROOT environment variable with a dirname-based fallback.

# Before: mixed reference approaches
PLUGIN_DIR="$(claude plugin path harnesskit)"
PLUGIN_DIR="/Users/lsr/.claude/plugins/cache/harnesskit/..."

# After: unified reference
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"

Fix 2: Add Preset Check to post-edit Hooks

post-edit-lint.sh and post-edit-typecheck.sh were executing before a preset was configured, causing errors. Added a preset existence check; they now skip gracefully if no preset is set.


Marketplace Validated Recommendation System

The Original Problem

/harnesskit:init was relying on live search to recommend marketplace plugins, which was unstable and produced inconsistent results.

The Fix: Pre-Validated Recommendation List

Switched to maintaining a marketplace-recommendations.json file populated by an update-recommendations.sh script that periodically crawls and updates the list.

/harnesskit:insights also now references recommendations.json when suggesting improvements, so it only recommends validated plugins.


3-Step Sliding Window Tool Sequence

Upgraded the tool usage pattern analysis from a simple count approach to a 3-step sliding window for better precision. Tool usage is now recorded in tool:summary format, with pattern detection triggering improvement suggestions.


Plugin Installation Verification

Added installation state verification to the /harnesskit:status skill. It now reports skill file presence, hooks execution permissions, and configuration file integrity in a single view.


Commit Log

MessageArea
feat: add plugin installation verification to statusskills
feat: upgrade tool sequence to 3-step sliding windowskills
feat: add recommendations.json reference to insightsskills
feat: rewrite init marketplace discovery with verified recsskills
feat: add update-recommendations.sh for marketplace crawlingscripts
feat: add verified marketplace-recommendations.jsontemplates
refactor: migrate skills from ‘claude plugin path’ to CLAUDE_PLUGIN_ROOTskills
refactor: unify PLUGIN_DIR to CLAUDE_PLUGIN_ROOT with fallbackhooks
fix: add preset check to post-edit hooks + CLAUDE_PLUGIN_ROOT fallbackhooks
docs: add implementation plan for plugin trigger fixesdocs
docs: address spec review — fix CRITICAL and MAJOR issuesdocs
docs: add spec for plugin trigger review — 5 fixesdocs

Key Takeaways

In plugin development, “it works” and “it triggers correctly” are different problems. In a local development environment, paths are fixed and everything looks fine. In another user’s environment, the plugin cache path, environment variables, and preset state are all different. Unifying everything to CLAUDE_PLUGIN_ROOT is a small change that fundamentally improves portability. Switching marketplace recommendations from live search to a pre-validated list is driven by the same instinct — reduce uncertainty and guarantee a consistent experience.

Built with Hugo
Theme Stack designed by Jimmy