ima-claude 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +463 -0
- package/dist/cli.js +1064 -0
- package/package.json +49 -0
- package/platforms/claude/adapter.ts +115 -0
- package/platforms/junie/adapter.ts +254 -0
- package/platforms/junie/agents-template.md +113 -0
- package/platforms/junie/hook-translations.md +84 -0
- package/platforms/shared/detector.ts +27 -0
- package/platforms/shared/installer.ts +202 -0
- package/platforms/shared/types.ts +78 -0
- package/plugins/ima-claude/.claude-plugin/plugin.json +25 -0
- package/plugins/ima-claude/agents/explorer.md +30 -0
- package/plugins/ima-claude/agents/implementer.md +30 -0
- package/plugins/ima-claude/agents/memory.md +42 -0
- package/plugins/ima-claude/agents/reviewer.md +53 -0
- package/plugins/ima-claude/agents/tester.md +33 -0
- package/plugins/ima-claude/agents/wp-developer.md +46 -0
- package/plugins/ima-claude/hooks/README.md +145 -0
- package/plugins/ima-claude/hooks/atlassian_prereqs.py +112 -0
- package/plugins/ima-claude/hooks/block_sed_edits.py +59 -0
- package/plugins/ima-claude/hooks/bootstrap.sh +90 -0
- package/plugins/ima-claude/hooks/bootstrap_utility_check.py +94 -0
- package/plugins/ima-claude/hooks/composer_autoload_check.py +70 -0
- package/plugins/ima-claude/hooks/docs_organization.py +104 -0
- package/plugins/ima-claude/hooks/enforce_rg_over_grep.py +56 -0
- package/plugins/ima-claude/hooks/fp_utility_check.py +90 -0
- package/plugins/ima-claude/hooks/hook_logger.py +69 -0
- package/plugins/ima-claude/hooks/hooks.json +239 -0
- package/plugins/ima-claude/hooks/jira_issue_fetch.py +79 -0
- package/plugins/ima-claude/hooks/jquery_in_wordpress.py +92 -0
- package/plugins/ima-claude/hooks/memory_bootstrap.py +79 -0
- package/plugins/ima-claude/hooks/memory_store_reminder.py +75 -0
- package/plugins/ima-claude/hooks/prompt_coach.py +125 -0
- package/plugins/ima-claude/hooks/prompt_coach_digest.md +48 -0
- package/plugins/ima-claude/hooks/prompt_coach_system.md +30 -0
- package/plugins/ima-claude/hooks/sequential_thinking_check.py +81 -0
- package/plugins/ima-claude/hooks/serena_over_grep.py +96 -0
- package/plugins/ima-claude/hooks/serena_over_read.py +66 -0
- package/plugins/ima-claude/hooks/serena_project_check.py +133 -0
- package/plugins/ima-claude/hooks/sql_injection_check.py +73 -0
- package/plugins/ima-claude/hooks/task_master_after_plan.py +31 -0
- package/plugins/ima-claude/hooks/task_master_before_impl.py +93 -0
- package/plugins/ima-claude/hooks/tavily_extract_advanced.py +48 -0
- package/plugins/ima-claude/hooks/vestige_before_external.py +86 -0
- package/plugins/ima-claude/hooks/webfetch_to_tavily.py +42 -0
- package/plugins/ima-claude/hooks/websearch_to_tavily.py +41 -0
- package/plugins/ima-claude/hooks/wp_security_check.py +150 -0
- package/plugins/ima-claude/personalities/README.md +45 -0
- package/plugins/ima-claude/personalities/enable-40k.md +69 -0
- package/plugins/ima-claude/personalities/enable-templars.md +69 -0
- package/plugins/ima-claude/skills/.research-summary.md +340 -0
- package/plugins/ima-claude/skills/architect/SKILL.md +304 -0
- package/plugins/ima-claude/skills/compound-bridge/SKILL.md +200 -0
- package/plugins/ima-claude/skills/discourse/SKILL.md +440 -0
- package/plugins/ima-claude/skills/discourse-admin/SKILL.md +192 -0
- package/plugins/ima-claude/skills/discourse-admin/references/api-endpoints.md +441 -0
- package/plugins/ima-claude/skills/discourse-admin/references/gotchas.md +107 -0
- package/plugins/ima-claude/skills/discourse-admin/references/staging-defaults.md +98 -0
- package/plugins/ima-claude/skills/discourse-admin/scripts/discourse-admin.py +319 -0
- package/plugins/ima-claude/skills/docs-organize/SKILL.md +254 -0
- package/plugins/ima-claude/skills/docs-organize/templates/active-README.md +50 -0
- package/plugins/ima-claude/skills/docs-organize/templates/archive-README.md +57 -0
- package/plugins/ima-claude/skills/docs-organize/templates/docs-README.md +43 -0
- package/plugins/ima-claude/skills/docs-organize/templates/phase-archive-README.md +83 -0
- package/plugins/ima-claude/skills/docs-organize/templates/section-README.md +48 -0
- package/plugins/ima-claude/skills/docs-organize/templates/transient-README.md +79 -0
- package/plugins/ima-claude/skills/docs-organize/templates/transient-gitignore +9 -0
- package/plugins/ima-claude/skills/ember-discourse/SKILL.md +496 -0
- package/plugins/ima-claude/skills/functional-programmer/SKILL.md +258 -0
- package/plugins/ima-claude/skills/ima-bootstrap/SKILL.md +278 -0
- package/plugins/ima-claude/skills/ima-bootstrap/references/bootstrap-patterns.md +356 -0
- package/plugins/ima-claude/skills/ima-bootstrap/references/ima-brand.md +273 -0
- package/plugins/ima-claude/skills/ima-bootstrap/references/theme-integration.md +212 -0
- package/plugins/ima-claude/skills/ima-brand/SKILL.md +108 -0
- package/plugins/ima-claude/skills/ima-brand/references/brand-identity.md +140 -0
- package/plugins/ima-claude/skills/ima-brand/references/digital-standards.md +180 -0
- package/plugins/ima-claude/skills/ima-brand/references/visual-system.md +173 -0
- package/plugins/ima-claude/skills/ima-forms-expert/SKILL.md +175 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/container-components.md +154 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/examples.md +328 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/field-components.md +298 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/form-factory.md +193 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/quick-reference.md +153 -0
- package/plugins/ima-claude/skills/ima-forms-expert/references/validation-engine.md +336 -0
- package/plugins/ima-claude/skills/jira-checkpoint/SKILL.md +178 -0
- package/plugins/ima-claude/skills/jquery/SKILL.md +413 -0
- package/plugins/ima-claude/skills/js-fp/SKILL.md +463 -0
- package/plugins/ima-claude/skills/js-fp/core-principles.md +487 -0
- package/plugins/ima-claude/skills/js-fp/examples/pure-functions.js +260 -0
- package/plugins/ima-claude/skills/js-fp/examples/tests/pure-functions.test.js +262 -0
- package/plugins/ima-claude/skills/js-fp/references/anti-patterns.md +120 -0
- package/plugins/ima-claude/skills/js-fp/references/performance-patterns.md +116 -0
- package/plugins/ima-claude/skills/js-fp/references/testing-patterns.md +134 -0
- package/plugins/ima-claude/skills/js-fp-api/SKILL.md +280 -0
- package/plugins/ima-claude/skills/js-fp-api/examples/crud-endpoint.js +258 -0
- package/plugins/ima-claude/skills/js-fp-api/references/middleware-patterns.md +134 -0
- package/plugins/ima-claude/skills/js-fp-api/references/security-sql.md +110 -0
- package/plugins/ima-claude/skills/js-fp-api/references/validation-patterns.md +165 -0
- package/plugins/ima-claude/skills/js-fp-react/SKILL.md +447 -0
- package/plugins/ima-claude/skills/js-fp-react/examples/ProductCard.tsx +65 -0
- package/plugins/ima-claude/skills/js-fp-react/references/hooks-advanced.md +136 -0
- package/plugins/ima-claude/skills/js-fp-react/references/performance-patterns.md +175 -0
- package/plugins/ima-claude/skills/js-fp-vue/SKILL.md +322 -0
- package/plugins/ima-claude/skills/js-fp-vue/references/complete-examples.md +397 -0
- package/plugins/ima-claude/skills/js-fp-vue/references/composables-advanced.md +282 -0
- package/plugins/ima-claude/skills/js-fp-vue/references/reactivity-patterns.md +348 -0
- package/plugins/ima-claude/skills/js-fp-vue/references/testing.md +314 -0
- package/plugins/ima-claude/skills/js-fp-wordpress/SKILL.md +301 -0
- package/plugins/ima-claude/skills/js-fp-wordpress/references/ajax-patterns.md +192 -0
- package/plugins/ima-claude/skills/js-fp-wordpress/references/event-patterns.md +136 -0
- package/plugins/ima-claude/skills/js-fp-wordpress/references/wp-integration.md +248 -0
- package/plugins/ima-claude/skills/livecanvas/SKILL.md +209 -0
- package/plugins/ima-claude/skills/livecanvas/references/livecanvas-features.md +311 -0
- package/plugins/ima-claude/skills/livecanvas/references/loops-and-logic.md +730 -0
- package/plugins/ima-claude/skills/livecanvas/references/picostrap.md +227 -0
- package/plugins/ima-claude/skills/mcp-atlassian/SKILL.md +339 -0
- package/plugins/ima-claude/skills/mcp-context7/SKILL.md +109 -0
- package/plugins/ima-claude/skills/mcp-memory/SKILL.md +182 -0
- package/plugins/ima-claude/skills/mcp-qdrant/SKILL.md +233 -0
- package/plugins/ima-claude/skills/mcp-sequential/SKILL.md +149 -0
- package/plugins/ima-claude/skills/mcp-serena/SKILL.md +174 -0
- package/plugins/ima-claude/skills/mcp-tavily/SKILL.md +118 -0
- package/plugins/ima-claude/skills/mcp-vestige/SKILL.md +259 -0
- package/plugins/ima-claude/skills/php-authnet/SKILL.md +275 -0
- package/plugins/ima-claude/skills/php-authnet/references/api-reference.md +624 -0
- package/plugins/ima-claude/skills/php-authnet/references/sandbox-testing.md +424 -0
- package/plugins/ima-claude/skills/php-fp/SKILL.md +333 -0
- package/plugins/ima-claude/skills/php-fp/examples/pure-functions.php +403 -0
- package/plugins/ima-claude/skills/php-fp/examples/tests/PureFunctionsTest.php +515 -0
- package/plugins/ima-claude/skills/php-fp/references/core-principles.md +277 -0
- package/plugins/ima-claude/skills/php-fp/references/testing-patterns.md +374 -0
- package/plugins/ima-claude/skills/php-fp-wordpress/SKILL.md +216 -0
- package/plugins/ima-claude/skills/php-fp-wordpress/references/fp-patterns.md +275 -0
- package/plugins/ima-claude/skills/php-fp-wordpress/references/plugin-architecture.md +295 -0
- package/plugins/ima-claude/skills/php-fp-wordpress/references/security-examples.md +203 -0
- package/plugins/ima-claude/skills/php-fp-wordpress/references/testing-strategy.md +259 -0
- package/plugins/ima-claude/skills/phpunit-wp/SKILL.md +716 -0
- package/plugins/ima-claude/skills/playwright/SKILL.md +434 -0
- package/plugins/ima-claude/skills/playwright/references/accessibility-testing.md +153 -0
- package/plugins/ima-claude/skills/playwright/references/ci-cd.md +268 -0
- package/plugins/ima-claude/skills/playwright/references/network-mocking.md +270 -0
- package/plugins/ima-claude/skills/playwright/references/visual-regression.md +215 -0
- package/plugins/ima-claude/skills/py-fp/SKILL.md +663 -0
- package/plugins/ima-claude/skills/py-fp/examples/pure-functions.py +185 -0
- package/plugins/ima-claude/skills/py-fp/examples/tests/test_pure_functions.py +244 -0
- package/plugins/ima-claude/skills/py-fp/references/core-principles.md +381 -0
- package/plugins/ima-claude/skills/py-fp/references/testing-patterns.md +283 -0
- package/plugins/ima-claude/skills/quasar-fp/SKILL.md +327 -0
- package/plugins/ima-claude/skills/quasar-fp/metadata.json +85 -0
- package/plugins/ima-claude/skills/quasar-fp/references/component-patterns.md +257 -0
- package/plugins/ima-claude/skills/quasar-fp/references/theme-integration.md +233 -0
- package/plugins/ima-claude/skills/quasar-fp/references/utility-classes.md +237 -0
- package/plugins/ima-claude/skills/quickstart/SKILL.md +129 -0
- package/plugins/ima-claude/skills/rails/SKILL.md +359 -0
- package/plugins/ima-claude/skills/resume-session/SKILL.md +68 -0
- package/plugins/ima-claude/skills/rg/SKILL.md +205 -0
- package/plugins/ima-claude/skills/ruby-fp/SKILL.md +336 -0
- package/plugins/ima-claude/skills/save-session/SKILL.md +81 -0
- package/plugins/ima-claude/skills/scorecard/SKILL.md +96 -0
- package/plugins/ima-claude/skills/skill-analyzer/SKILL.md +127 -0
- package/plugins/ima-claude/skills/skill-analyzer/references/advanced-checklist.md +44 -0
- package/plugins/ima-claude/skills/skill-analyzer/references/core-checklist.md +60 -0
- package/plugins/ima-claude/skills/skill-analyzer/scripts/analyze_skill.py +418 -0
- package/plugins/ima-claude/skills/skill-creator/LICENSE.txt +202 -0
- package/plugins/ima-claude/skills/skill-creator/SKILL.md +343 -0
- package/plugins/ima-claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/plugins/ima-claude/skills/skill-creator/references/workflows.md +28 -0
- package/plugins/ima-claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/plugins/ima-claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/plugins/ima-claude/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/plugins/ima-claude/skills/task-master/SKILL.md +51 -0
- package/plugins/ima-claude/skills/task-planner/SKILL.md +228 -0
- package/plugins/ima-claude/skills/task-runner/SKILL.md +192 -0
- package/plugins/ima-claude/skills/unit-testing/SKILL.md +198 -0
- package/plugins/ima-claude/skills/unit-testing/references/mock-patterns.md +181 -0
- package/plugins/ima-claude/skills/unit-testing/references/tdd-workflow.md +177 -0
- package/plugins/ima-claude/skills/unit-testing/references/test-strategy.md +126 -0
- package/plugins/ima-claude/skills/wp-local/SKILL.md +246 -0
- package/plugins/ima-claude/skills/wp-local/references/configuration.md +198 -0
- package/plugins/ima-claude/skills/wp-local/references/wp-cli-reference.md +406 -0
- package/plugins/ima-claude/skills/wp-local/scripts/wp-local.sh +61 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { join } from "path";
|
|
2
|
+
import type { PlatformAdapter, InstallFilter, InstallItem, InstallOptions } from "./types";
|
|
3
|
+
import { PLUGIN_SOURCE } from "./types";
|
|
4
|
+
import { colors, log, prompt, promptYesNo } from "../../scripts/utils";
|
|
5
|
+
|
|
6
|
+
function formatItemList(items: InstallItem[], category: string): string {
|
|
7
|
+
const filtered = items.filter((i) => i.category === category);
|
|
8
|
+
if (filtered.length === 0) return "";
|
|
9
|
+
|
|
10
|
+
const overrideCount = filtered.filter((i) => i.exists).length;
|
|
11
|
+
const overrideNote = overrideCount > 0
|
|
12
|
+
? ` ${colors.yellow}(${overrideCount} existing will be overwritten)${colors.reset}`
|
|
13
|
+
: "";
|
|
14
|
+
|
|
15
|
+
const names = filtered.map((i) => {
|
|
16
|
+
const marker = i.exists ? `${colors.yellow}*${colors.reset}` : " ";
|
|
17
|
+
return `${marker} ${i.name}`;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const label = category.charAt(0).toUpperCase() + category.slice(1) + "s";
|
|
21
|
+
return ` ${colors.bright}${label} (${filtered.length})${colors.reset}${overrideNote}\n${names.map((n) => ` ${n}`).join("\n")}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function showPreview(adapter: PlatformAdapter, items: InstallItem[]): void {
|
|
25
|
+
console.log(
|
|
26
|
+
`\n${colors.bright}Install preview for ${adapter.displayName}${colors.reset}`
|
|
27
|
+
);
|
|
28
|
+
console.log(` Target: ${adapter.configDir}\n`);
|
|
29
|
+
|
|
30
|
+
const categories = ["skill", "agent", "hook", "guideline"] as const;
|
|
31
|
+
for (const cat of categories) {
|
|
32
|
+
const section = formatItemList(items, cat);
|
|
33
|
+
if (section) console.log(section + "\n");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const existingCount = items.filter((i) => i.exists).length;
|
|
37
|
+
if (existingCount > 0) {
|
|
38
|
+
console.log(
|
|
39
|
+
` ${colors.yellow}*${colors.reset} = exists and will be overwritten (${existingCount} files)\n`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function promptExclusions(items: InstallItem[]): Promise<InstallFilter> {
|
|
45
|
+
const filter: InstallFilter = {};
|
|
46
|
+
|
|
47
|
+
console.log(`${colors.cyan}Options:${colors.reset}`);
|
|
48
|
+
console.log(` [Enter] Install all`);
|
|
49
|
+
console.log(` [e] Exclude specific items`);
|
|
50
|
+
console.log(` [c] Cancel\n`);
|
|
51
|
+
|
|
52
|
+
const choice = await prompt("Selection: ");
|
|
53
|
+
|
|
54
|
+
if (choice.toLowerCase() === "c") {
|
|
55
|
+
return { excludeSkills: items.filter((i) => i.category === "skill").map((i) => i.name) };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (choice.toLowerCase() !== "e") {
|
|
59
|
+
return filter;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Interactive exclusion
|
|
63
|
+
const skills = items.filter((i) => i.category === "skill");
|
|
64
|
+
const agents = items.filter((i) => i.category === "agent");
|
|
65
|
+
const hooks = items.filter((i) => i.category === "hook");
|
|
66
|
+
const guidelines = items.filter((i) => i.category === "guideline");
|
|
67
|
+
|
|
68
|
+
if (skills.length > 0) {
|
|
69
|
+
console.log(
|
|
70
|
+
`\n${colors.bright}Skills${colors.reset} (${skills.length} total)`
|
|
71
|
+
);
|
|
72
|
+
console.log(
|
|
73
|
+
` Enter names to EXCLUDE (comma-separated), or press Enter to keep all:`
|
|
74
|
+
);
|
|
75
|
+
console.log(
|
|
76
|
+
` ${colors.cyan}Available:${colors.reset} ${skills.map((s) => s.name).join(", ")}\n`
|
|
77
|
+
);
|
|
78
|
+
const excluded = await prompt(" Exclude: ");
|
|
79
|
+
if (excluded) {
|
|
80
|
+
filter.excludeSkills = excluded.split(",").map((s) => s.trim()).filter(Boolean);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (agents.length > 0) {
|
|
85
|
+
console.log(
|
|
86
|
+
`\n${colors.bright}Agents${colors.reset} (${agents.length} total)`
|
|
87
|
+
);
|
|
88
|
+
console.log(
|
|
89
|
+
` Enter names to EXCLUDE (comma-separated), or press Enter to keep all:`
|
|
90
|
+
);
|
|
91
|
+
console.log(
|
|
92
|
+
` ${colors.cyan}Available:${colors.reset} ${agents.map((a) => a.name).join(", ")}\n`
|
|
93
|
+
);
|
|
94
|
+
const excluded = await prompt(" Exclude: ");
|
|
95
|
+
if (excluded) {
|
|
96
|
+
filter.excludeAgents = excluded.split(",").map((s) => s.trim()).filter(Boolean);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (hooks.length > 0) {
|
|
101
|
+
console.log(
|
|
102
|
+
`\n${colors.bright}Hooks${colors.reset} (${hooks.length} total)`
|
|
103
|
+
);
|
|
104
|
+
console.log(
|
|
105
|
+
` Enter names to EXCLUDE (comma-separated), or press Enter to keep all:`
|
|
106
|
+
);
|
|
107
|
+
console.log(
|
|
108
|
+
` ${colors.cyan}Available:${colors.reset} ${hooks.map((h) => h.name).join(", ")}\n`
|
|
109
|
+
);
|
|
110
|
+
const excluded = await prompt(" Exclude: ");
|
|
111
|
+
if (excluded) {
|
|
112
|
+
filter.excludeHooks = excluded.split(",").map((s) => s.trim()).filter(Boolean);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (guidelines.length > 0) {
|
|
117
|
+
const skip = !(await promptYesNo("\n Install guidelines?", true));
|
|
118
|
+
filter.skipGuidelines = skip;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return filter;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export async function installForPlatform(
|
|
125
|
+
adapter: PlatformAdapter,
|
|
126
|
+
options: InstallOptions = {}
|
|
127
|
+
): Promise<void> {
|
|
128
|
+
const skillsSource = join(PLUGIN_SOURCE, "skills");
|
|
129
|
+
const agentsSource = join(PLUGIN_SOURCE, "agents");
|
|
130
|
+
const hooksSource = join(PLUGIN_SOURCE, "hooks");
|
|
131
|
+
|
|
132
|
+
// Preview
|
|
133
|
+
const preview = adapter.preview(PLUGIN_SOURCE);
|
|
134
|
+
showPreview(adapter, preview.items);
|
|
135
|
+
|
|
136
|
+
// Exclusion selection
|
|
137
|
+
const filter = await promptExclusions(preview.items);
|
|
138
|
+
|
|
139
|
+
// Check if everything was cancelled
|
|
140
|
+
const allSkills = preview.items.filter((i) => i.category === "skill");
|
|
141
|
+
if (
|
|
142
|
+
filter.excludeSkills &&
|
|
143
|
+
filter.excludeSkills.length >= allSkills.length
|
|
144
|
+
) {
|
|
145
|
+
console.log("\nInstallation cancelled.\n");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Confirm
|
|
150
|
+
const excludedCount =
|
|
151
|
+
(filter.excludeSkills?.length ?? 0) +
|
|
152
|
+
(filter.excludeAgents?.length ?? 0) +
|
|
153
|
+
(filter.excludeHooks?.length ?? 0) +
|
|
154
|
+
(filter.skipGuidelines ? 1 : 0);
|
|
155
|
+
const totalItems = preview.items.length - excludedCount;
|
|
156
|
+
|
|
157
|
+
const proceed = await promptYesNo(
|
|
158
|
+
`\nInstall ${totalItems} items to ${adapter.configDir}?`
|
|
159
|
+
);
|
|
160
|
+
if (!proceed) {
|
|
161
|
+
console.log("\nInstallation cancelled.\n");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
console.log(
|
|
166
|
+
`\n${colors.bright}Installing for ${adapter.displayName}${colors.reset}\n`
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
log.step(`Installing skills...`);
|
|
170
|
+
adapter.installSkills(skillsSource, filter.excludeSkills);
|
|
171
|
+
log.success(`Skills installed`);
|
|
172
|
+
|
|
173
|
+
log.step(`Installing agents...`);
|
|
174
|
+
adapter.installAgents(agentsSource, filter.excludeAgents);
|
|
175
|
+
log.success(`Agents installed`);
|
|
176
|
+
|
|
177
|
+
if (!filter.skipGuidelines) {
|
|
178
|
+
log.step(`Installing guidelines...`);
|
|
179
|
+
adapter.installGuidelines(PLUGIN_SOURCE);
|
|
180
|
+
log.success(`Guidelines installed`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (adapter.installHooks) {
|
|
184
|
+
log.step(`Installing hooks...`);
|
|
185
|
+
adapter.installHooks(hooksSource, filter.excludeHooks);
|
|
186
|
+
log.success(`Hooks installed`);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (adapter.configureMcp && !options.skipMcp) {
|
|
190
|
+
log.step(`Configuring MCP servers...`);
|
|
191
|
+
await adapter.configureMcp();
|
|
192
|
+
log.success(`MCP configured`);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (adapter.postInstall) {
|
|
196
|
+
adapter.postInstall();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
console.log(
|
|
200
|
+
`\n${colors.green}Done!${colors.reset} ${adapter.displayName} installation complete.\n`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { homedir } from "os";
|
|
2
|
+
import { join, resolve, dirname } from "path";
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
|
|
6
|
+
export interface InstallItem {
|
|
7
|
+
name: string;
|
|
8
|
+
category: "skill" | "agent" | "hook" | "guideline";
|
|
9
|
+
destPath: string;
|
|
10
|
+
exists: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface InstallPreview {
|
|
14
|
+
platform: string;
|
|
15
|
+
targetDir: string;
|
|
16
|
+
items: InstallItem[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface InstallFilter {
|
|
20
|
+
excludeSkills?: string[];
|
|
21
|
+
excludeAgents?: string[];
|
|
22
|
+
excludeHooks?: string[];
|
|
23
|
+
skipGuidelines?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface PlatformAdapter {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly displayName: string;
|
|
29
|
+
readonly configDir: string;
|
|
30
|
+
|
|
31
|
+
detect(): boolean;
|
|
32
|
+
preview(sourceDir: string): InstallPreview;
|
|
33
|
+
installSkills(sourceDir: string, exclude?: string[]): void;
|
|
34
|
+
installAgents(sourceDir: string, exclude?: string[]): void;
|
|
35
|
+
installGuidelines(pluginRoot: string): void;
|
|
36
|
+
installHooks?(sourceDir: string, exclude?: string[]): void;
|
|
37
|
+
configureMcp?(): Promise<void>;
|
|
38
|
+
postInstall?(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DetectedPlatform {
|
|
42
|
+
adapter: PlatformAdapter;
|
|
43
|
+
detected: boolean;
|
|
44
|
+
note?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface InstallOptions {
|
|
48
|
+
targets?: string[];
|
|
49
|
+
verbose?: boolean;
|
|
50
|
+
skipMcp?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function findPackageRoot(): string {
|
|
54
|
+
let dir: string;
|
|
55
|
+
try {
|
|
56
|
+
dir = dirname(fileURLToPath(import.meta.url));
|
|
57
|
+
} catch {
|
|
58
|
+
dir = typeof __dirname !== "undefined" ? __dirname : resolve(".");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
for (let i = 0; i < 10; i++) {
|
|
62
|
+
if (existsSync(join(dir, "package.json"))) return dir;
|
|
63
|
+
const parent = join(dir, "..");
|
|
64
|
+
if (parent === dir) break;
|
|
65
|
+
dir = parent;
|
|
66
|
+
}
|
|
67
|
+
return process.cwd();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const PLUGIN_SOURCE = join(
|
|
71
|
+
findPackageRoot(),
|
|
72
|
+
"plugins",
|
|
73
|
+
"ima-claude"
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export function platformConfigDir(platformDir: string): string {
|
|
77
|
+
return join(homedir(), platformDir);
|
|
78
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ima-claude",
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "IMA's Claude Code skills for functional programming, architecture, and team standards. 47 skills, 24 hooks, default persona, 3-tier memory system.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "IMA",
|
|
7
|
+
"url": "https://github.com/Soabirw/ima-claude"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Soabirw/ima-claude",
|
|
10
|
+
"repository": "https://github.com/Soabirw/ima-claude",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"functional-programming",
|
|
14
|
+
"architecture",
|
|
15
|
+
"wordpress",
|
|
16
|
+
"skills",
|
|
17
|
+
"hooks",
|
|
18
|
+
"memory",
|
|
19
|
+
"fp-patterns",
|
|
20
|
+
"team-standards",
|
|
21
|
+
"ruby",
|
|
22
|
+
"rails",
|
|
23
|
+
"discourse"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explorer
|
|
3
|
+
description: "Fast, read-only codebase exploration. Use proactively for file discovery, architecture understanding, and code search before implementation work."
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Grep, Glob, LS, Bash
|
|
6
|
+
permissionMode: plan
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a codebase explorer. Your job is to quickly find files, understand structure, and report back with specific paths and relevant code snippets.
|
|
10
|
+
|
|
11
|
+
## How to work
|
|
12
|
+
|
|
13
|
+
1. Start with broad searches (Glob for file patterns, Grep for keywords)
|
|
14
|
+
2. Narrow down to specific files and symbols
|
|
15
|
+
3. Report findings with exact file paths and line numbers
|
|
16
|
+
4. Summarize architecture and patterns you discover
|
|
17
|
+
|
|
18
|
+
## What to report
|
|
19
|
+
|
|
20
|
+
- File paths and their purposes
|
|
21
|
+
- Key symbols (classes, functions, exports) with locations
|
|
22
|
+
- Patterns and conventions observed
|
|
23
|
+
- Dependencies and relationships between files
|
|
24
|
+
|
|
25
|
+
## What NOT to do
|
|
26
|
+
|
|
27
|
+
- Do not modify any files
|
|
28
|
+
- Do not suggest implementations (that's the implementer's job)
|
|
29
|
+
- Do not over-read — scan structure first, read bodies only when needed
|
|
30
|
+
- Do not speculate — report what you find, flag what's uncertain
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementer
|
|
3
|
+
description: "Standard implementation worker for coding tasks. Default delegation target for feature development, bug fixes, refactoring, and test writing."
|
|
4
|
+
model: sonnet
|
|
5
|
+
skills:
|
|
6
|
+
- functional-programmer
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are an implementation specialist. You write clean, functional, production-ready code.
|
|
10
|
+
|
|
11
|
+
## Principles
|
|
12
|
+
|
|
13
|
+
- **Simple > Complex** — YAGNI strictly, boring code wins
|
|
14
|
+
- **FP-first** — pure functions, composition, immutability where practical
|
|
15
|
+
- **Native patterns** — use language idioms, not custom FP utilities
|
|
16
|
+
- **Minimal changes** — only modify what's needed for the task
|
|
17
|
+
|
|
18
|
+
## How to work
|
|
19
|
+
|
|
20
|
+
1. Read the specific files you need to modify
|
|
21
|
+
2. Understand existing patterns before writing new code
|
|
22
|
+
3. Make the change with minimal blast radius
|
|
23
|
+
4. Verify the change is complete and consistent
|
|
24
|
+
|
|
25
|
+
## What to avoid
|
|
26
|
+
|
|
27
|
+
- Over-engineering: no abstractions for one-time operations
|
|
28
|
+
- Feature creep: only implement what was asked
|
|
29
|
+
- Unnecessary comments: code should be self-documenting
|
|
30
|
+
- Breaking existing patterns: match the codebase style
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory
|
|
3
|
+
description: "Memory operations across Vestige, Qdrant, and Serena. Search, store, consolidate, and manage persistent knowledge."
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Grep, Glob, LS, Bash
|
|
6
|
+
permissionMode: default
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a memory specialist. Your job is to search, store, and consolidate knowledge across three memory systems:
|
|
10
|
+
|
|
11
|
+
- **Vestige**: Cognitive memory with spaced repetition — decisions, preferences, patterns, bugs
|
|
12
|
+
- **Qdrant**: Permanent library — standards, PRDs, architecture docs, code samples
|
|
13
|
+
- **Serena**: Project-scoped session state and task progress
|
|
14
|
+
|
|
15
|
+
## How to work
|
|
16
|
+
|
|
17
|
+
1. **Search before storing** — always check for existing memories to avoid duplicates
|
|
18
|
+
2. **Route to the right store** — ephemeral decisions → Vestige, reference material → Qdrant, session state → Serena
|
|
19
|
+
3. **Use smart_ingest for Vestige** — it handles dedup and categorization
|
|
20
|
+
4. **Be concise** — store the essence, not the full conversation
|
|
21
|
+
|
|
22
|
+
## Memory routing
|
|
23
|
+
|
|
24
|
+
| What | Where | Why |
|
|
25
|
+
|------|-------|-----|
|
|
26
|
+
| Decisions, preferences, patterns | Vestige `smart_ingest` | Fades naturally if not referenced |
|
|
27
|
+
| Reference material, docs, standards | Qdrant `qdrant-store` | Permanent, never forgotten |
|
|
28
|
+
| Session state, task progress | Serena `write_memory` | Project-scoped workbench |
|
|
29
|
+
| Future reminders | Vestige `intention` | Surfaces at next session |
|
|
30
|
+
|
|
31
|
+
## What to report
|
|
32
|
+
|
|
33
|
+
- What was found or stored, with enough context to be useful
|
|
34
|
+
- Conflicts or duplicates discovered
|
|
35
|
+
- Suggestions for consolidation if memory is fragmented
|
|
36
|
+
|
|
37
|
+
## What NOT to do
|
|
38
|
+
|
|
39
|
+
- Do not store session-specific noise (temp vars, in-progress debugging)
|
|
40
|
+
- Do not store secrets or API keys
|
|
41
|
+
- Do not overwrite existing memories without checking them first
|
|
42
|
+
- Do not speculate about what *should* be remembered — store what was explicitly decided or requested
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
description: "Code quality review specialist. Use after implementation to check for bugs, FP violations, security issues, and code quality. Read-only — reports findings without modifying code."
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Grep, Glob, LS, Bash
|
|
6
|
+
permissionMode: plan
|
|
7
|
+
skills:
|
|
8
|
+
- functional-programmer
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are a code reviewer with 25 years of experience and a functional programming mindset.
|
|
12
|
+
|
|
13
|
+
## Review checklist
|
|
14
|
+
|
|
15
|
+
### Correctness
|
|
16
|
+
- Logic errors, off-by-one, null/undefined paths
|
|
17
|
+
- Edge cases and error handling
|
|
18
|
+
- Type safety and contract violations
|
|
19
|
+
|
|
20
|
+
### FP principles
|
|
21
|
+
- Unnecessary mutation where pure alternatives exist
|
|
22
|
+
- Side effects mixed with business logic
|
|
23
|
+
- Missing composition opportunities
|
|
24
|
+
- Custom FP utilities that should use native patterns
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
- Input validation at system boundaries
|
|
28
|
+
- SQL injection, XSS, command injection
|
|
29
|
+
- Exposed secrets or credentials
|
|
30
|
+
- Improper auth/authz checks
|
|
31
|
+
|
|
32
|
+
### Code quality
|
|
33
|
+
- Naming clarity and consistency
|
|
34
|
+
- Over-engineering and premature abstraction
|
|
35
|
+
- Dead code and unused imports
|
|
36
|
+
- Pattern consistency with surrounding code
|
|
37
|
+
|
|
38
|
+
## Output format
|
|
39
|
+
|
|
40
|
+
Organize findings by severity:
|
|
41
|
+
|
|
42
|
+
**Critical** — Must fix before merge (bugs, security issues)
|
|
43
|
+
**Warning** — Should fix (FP violations, potential issues)
|
|
44
|
+
**Suggestion** — Consider improving (style, minor simplifications)
|
|
45
|
+
|
|
46
|
+
For each finding: file path, line number, what's wrong, and a specific fix.
|
|
47
|
+
|
|
48
|
+
## What NOT to do
|
|
49
|
+
|
|
50
|
+
- Do not modify any files
|
|
51
|
+
- Do not flag style preferences that don't affect correctness
|
|
52
|
+
- Do not suggest adding comments, docstrings, or type annotations to unchanged code
|
|
53
|
+
- Do not report more than 10 findings — prioritize ruthlessly
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tester
|
|
3
|
+
description: "Testing specialist for test creation, TDD, running test suites, and debugging test failures. Routes to domain-specific testing patterns via unit-testing skill."
|
|
4
|
+
model: sonnet
|
|
5
|
+
skills:
|
|
6
|
+
- unit-testing
|
|
7
|
+
- functional-programmer
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are a testing specialist with deep expertise in test strategy, TDD, and debugging test failures.
|
|
11
|
+
|
|
12
|
+
## Principles
|
|
13
|
+
|
|
14
|
+
- **Test pure core, not impure shell** — FP makes testing easy; leverage it
|
|
15
|
+
- **Bottom-heavy pyramid** — pure function unit tests are cheap and fast; write many
|
|
16
|
+
- **Minimal mocking** — prefer extracting pure logic over mocking dependencies
|
|
17
|
+
- **Tests as documentation** — test names describe behavior, not implementation
|
|
18
|
+
|
|
19
|
+
## How to work
|
|
20
|
+
|
|
21
|
+
1. Analyze the code under test — identify pure vs impure boundaries
|
|
22
|
+
2. Classify what type of tests are needed (unit/integration/E2E)
|
|
23
|
+
3. Structure test files following project conventions
|
|
24
|
+
4. Write tests that verify behavior, not implementation details
|
|
25
|
+
5. Run the suite and verify all tests pass
|
|
26
|
+
|
|
27
|
+
## What to avoid
|
|
28
|
+
|
|
29
|
+
- Testing implementation details (private methods, internal state)
|
|
30
|
+
- Deep mock chains — if you need 3+ mocks, refactor the code instead
|
|
31
|
+
- Over-testing: don't test framework behavior or trivial getters/setters
|
|
32
|
+
- Flaky tests: no timers, no network calls, no filesystem in unit tests
|
|
33
|
+
- Duplicating test patterns already in domain skills (phpunit-wp, playwright, etc.)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-developer
|
|
3
|
+
description: "WordPress development specialist. Use for plugin development, theme work, WP-CLI operations, IMA Forms, and Bootstrap integration in WordPress projects."
|
|
4
|
+
model: sonnet
|
|
5
|
+
skills:
|
|
6
|
+
- php-fp
|
|
7
|
+
- php-fp-wordpress
|
|
8
|
+
- wp-local
|
|
9
|
+
- ima-forms-expert
|
|
10
|
+
- ima-bootstrap
|
|
11
|
+
- jquery
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
You are a WordPress development specialist with deep knowledge of the WordPress ecosystem, PHP FP patterns, and the IMA toolchain.
|
|
15
|
+
|
|
16
|
+
## Principles
|
|
17
|
+
|
|
18
|
+
- **Security first** — nonce verification, capability checks, prepared statements, output escaping
|
|
19
|
+
- **FP in WordPress** — pure business logic, WordPress as the integration shell
|
|
20
|
+
- **Native WordPress** — use core APIs and hooks, avoid reinventing what WordPress provides
|
|
21
|
+
- **Bootstrap utility-first** — use Bootstrap classes, not custom CSS
|
|
22
|
+
|
|
23
|
+
## Capabilities
|
|
24
|
+
|
|
25
|
+
- Plugin and theme development with WordPress coding standards
|
|
26
|
+
- WP-CLI operations via Local WP environments
|
|
27
|
+
- IMA Forms component library (ima_forms_* functions)
|
|
28
|
+
- Bootstrap 5.3 integration with IMA brand system
|
|
29
|
+
- jQuery patterns for WordPress DOM manipulation
|
|
30
|
+
- Database operations with $wpdb and prepared statements
|
|
31
|
+
|
|
32
|
+
## How to work
|
|
33
|
+
|
|
34
|
+
1. Understand the WordPress context (plugin, theme, mu-plugin, etc.)
|
|
35
|
+
2. Follow WordPress hooks architecture (actions and filters)
|
|
36
|
+
3. Separate pure business logic from WordPress integration
|
|
37
|
+
4. Use proper escaping: esc_html(), esc_attr(), wp_kses() for output
|
|
38
|
+
5. Use proper sanitization: sanitize_text_field(), absint() for input
|
|
39
|
+
|
|
40
|
+
## What to avoid
|
|
41
|
+
|
|
42
|
+
- Direct database queries when WordPress API exists
|
|
43
|
+
- Skipping nonce verification on form handlers
|
|
44
|
+
- Mixing business logic with rendering
|
|
45
|
+
- Custom CSS when Bootstrap utilities work
|
|
46
|
+
- Raw jQuery when WordPress-native patterns exist
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Claude Code Hooks
|
|
2
|
+
|
|
3
|
+
Pre-tool-use hooks that enhance Claude Code's behavior with soft warnings and suggestions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Copy hooks to your Claude Code hooks directory:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cp hooks/*.py ~/.claude/hooks/
|
|
11
|
+
cp hooks/*.md ~/.claude/hooks/
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
For the Prompt Coach hook, also copy and configure the API key:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp hooks/prompt_coach_config.json.template ~/.claude/hooks/prompt_coach_config.json
|
|
18
|
+
# Edit ~/.claude/hooks/prompt_coach_config.json with your API key
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or the installer will do this automatically when you run `bun run scripts/install.ts`.
|
|
22
|
+
|
|
23
|
+
## Available Hooks
|
|
24
|
+
|
|
25
|
+
### `enforce_rg_over_grep.py`
|
|
26
|
+
|
|
27
|
+
**Type**: PreToolUse (Bash)
|
|
28
|
+
|
|
29
|
+
Warns about suboptimal search tools (allows command to proceed):
|
|
30
|
+
- Warns on `grep` → suggests `rg` (ripgrep) for better performance
|
|
31
|
+
- Warns on `find -name` → suggests `rg --files -g pattern`
|
|
32
|
+
|
|
33
|
+
The warning is shown to Claude, encouraging use of `rg` for the rest of the session. See the `/rg` skill for usage patterns.
|
|
34
|
+
|
|
35
|
+
### `websearch_to_tavily.py`
|
|
36
|
+
|
|
37
|
+
**Type**: PreToolUse (WebSearch)
|
|
38
|
+
|
|
39
|
+
Suggests using Tavily search instead of WebSearch (allows command to proceed):
|
|
40
|
+
- Provides correct Airis gateway syntax for Tavily search
|
|
41
|
+
- Includes query from original request in the suggestion
|
|
42
|
+
- References `/mcp-tavily` skill for full documentation
|
|
43
|
+
|
|
44
|
+
Best for: Research tasks, current information, comparisons.
|
|
45
|
+
|
|
46
|
+
### `webfetch_to_tavily.py`
|
|
47
|
+
|
|
48
|
+
**Type**: PreToolUse (WebFetch)
|
|
49
|
+
|
|
50
|
+
Suggests considering Tavily extract for complex pages (allows command to proceed):
|
|
51
|
+
- Notes that Tavily often extracts cleaner content
|
|
52
|
+
- Provides correct Airis gateway syntax
|
|
53
|
+
- References `/mcp-tavily` skill for full documentation
|
|
54
|
+
|
|
55
|
+
Note: WebFetch is fine for simple pages; Tavily shines on complex/dynamic content.
|
|
56
|
+
|
|
57
|
+
### `tavily_extract_advanced.py`
|
|
58
|
+
|
|
59
|
+
**Type**: PreToolUse (mcp__tavily__*)
|
|
60
|
+
|
|
61
|
+
Informational hook for direct Tavily tool usage:
|
|
62
|
+
- Reminds about the correct Airis gateway pattern if using old `mcp__tavily__*` tool names
|
|
63
|
+
- References `/mcp-tavily` skill
|
|
64
|
+
|
|
65
|
+
### `prompt_coach.py`
|
|
66
|
+
|
|
67
|
+
**Type**: UserPromptSubmit
|
|
68
|
+
|
|
69
|
+
Evaluates user prompts against team standards using Haiku:
|
|
70
|
+
- Provides inline feedback when prompts could be improved
|
|
71
|
+
- Stays silent when prompts are well-formed
|
|
72
|
+
- Skips short prompts and common follow-ups (yes/no/ok)
|
|
73
|
+
- Uses skills digest for context-aware evaluation
|
|
74
|
+
|
|
75
|
+
**Configuration:**
|
|
76
|
+
1. Copy config template: `cp hooks/prompt_coach_config.json.template ~/.claude/hooks/prompt_coach_config.json`
|
|
77
|
+
2. Add your Anthropic API key to the config file
|
|
78
|
+
3. Set environment variables:
|
|
79
|
+
- `PROMPT_COACH_ENABLED=true` - Enable evaluation
|
|
80
|
+
- `PROMPT_COACH_LOG=true` - Optional: Log to `~/.claude/prompt_coach.log`
|
|
81
|
+
|
|
82
|
+
**Note:** The API key is isolated in the hook's config file and does not affect Claude Code's OAuth authentication.
|
|
83
|
+
|
|
84
|
+
## Hook Behavior
|
|
85
|
+
|
|
86
|
+
All hooks use **soft warnings** (exit code 0) that:
|
|
87
|
+
1. Print helpful suggestions to stderr (shown to Claude)
|
|
88
|
+
2. Allow the original command to proceed
|
|
89
|
+
3. Reference relevant skills for detailed usage patterns
|
|
90
|
+
|
|
91
|
+
This approach teaches the LLM better patterns without breaking workflows.
|
|
92
|
+
|
|
93
|
+
## Hook Configuration
|
|
94
|
+
|
|
95
|
+
Hooks are configured in `~/.claude/settings.json`:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"hooks": {
|
|
100
|
+
"PreToolUse": [
|
|
101
|
+
{
|
|
102
|
+
"matcher": "Bash",
|
|
103
|
+
"hooks": [
|
|
104
|
+
{ "type": "command", "command": "python3 ~/.claude/hooks/enforce_rg_over_grep.py" }
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"matcher": "mcp__tavily__tavily-extract",
|
|
109
|
+
"hooks": [
|
|
110
|
+
{ "type": "command", "command": "python3 ~/.claude/hooks/tavily_extract_advanced.py" }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"matcher": "WebFetch",
|
|
115
|
+
"hooks": [
|
|
116
|
+
{ "type": "command", "command": "python3 ~/.claude/hooks/webfetch_to_tavily.py" }
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"matcher": "WebSearch",
|
|
121
|
+
"hooks": [
|
|
122
|
+
{ "type": "command", "command": "python3 ~/.claude/hooks/websearch_to_tavily.py" }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"UserPromptSubmit": [
|
|
127
|
+
{
|
|
128
|
+
"type": "command",
|
|
129
|
+
"command": "python3 ~/.claude/hooks/prompt_coach.py"
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Requirements
|
|
137
|
+
|
|
138
|
+
- Python 3.8+
|
|
139
|
+
- Tavily MCP server via Airis gateway (for Tavily-related suggestions)
|
|
140
|
+
- ripgrep (`rg`) installed (for rg enforcement hook)
|
|
141
|
+
|
|
142
|
+
## Related Skills
|
|
143
|
+
|
|
144
|
+
- `/rg` - Ripgrep usage patterns and examples
|
|
145
|
+
- `/mcp-tavily` - Tavily search and extract via Airis gateway
|