/harness-claude:js-observer-patternfrom harness-claude
Notifies subscribers automatically when an observable object's state changes. Implements the Observer pattern in JavaScript for decoupled event systems, reactive UIs, and real-time data feeds.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:js-observer-pattern still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Notify subscribers automatically when an observable object's state changes
observers array and subscribe / unsubscribe / notify methods.notify(data) whenever the observable's state changes — it invokes all subscribed callbacks.unsubscribe — failing to unsubscribe causes memory leaks in long-lived apps.EventTarget or EventEmitter (Node.js) over hand-rolled implementations.class Observable {
constructor() {
this.observers = [];
}
subscribe(fn) {
this.observers.push(fn);
return () => this.unsubscribe(fn); // return cleanup function
}
unsubscribe(fn) {
this.observers = this.observers.filter((obs) => obs !== fn);
}
notify(data) {
this.observers.forEach((fn) => fn(data));
}
}
const store = new Observable();
const cleanup = store.subscribe((data) => console.log('Received:', data));
store.notify({ type: 'UPDATE', payload: 42 });
cleanup(); // unsubscribe
subscribe — consumers call it to remove the handler.The Observer pattern (also called pub/sub) separates the emitter (subject/observable) from its consumers (observers/subscribers). This decoupling is fundamental to event-driven architectures, reactive state systems, and streams.
Trade-offs:
notify() during developmentWhen NOT to use:
https://patterns.dev/javascript/observer-pattern
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job