specialist-agent 2.13.0 → 3.3.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 +1 -1
- package/README.md +36 -206
- package/dist/catalog.json +16677 -0
- package/dist/hw-worker.mjs +288 -0
- package/dist/icones/icone.ico +0 -0
- package/dist/icones/icone.png +0 -0
- package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
- package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
- package/dist/interface/assets/index-BltVv7tb.js +24 -0
- package/dist/interface/assets/index-Cpa6kApK.css +1 -0
- package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
- package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
- package/dist/interface/icones/apple-touch-icon.png +0 -0
- package/dist/interface/icones/favicon-32.png +0 -0
- package/dist/interface/icones/icone-192.png +0 -0
- package/dist/interface/icones/icone-512.png +0 -0
- package/dist/interface/icones/icone-mascara-512.png +0 -0
- package/dist/interface/index.html +19 -0
- package/dist/interface/manifest.webmanifest +19 -0
- package/dist/interface/sw.js +64 -0
- package/dist/licencas/BRAND.md +22 -0
- package/dist/licencas/LICENSE-CONTENT.md +44 -0
- package/dist/licencas/OFL-Figtree.txt +93 -0
- package/dist/licencas/OFL-JetBrainsMono.txt +93 -0
- package/dist/licencas/OFL-Unbounded.txt +93 -0
- package/dist/licencas/TERCEIROS.txt +104 -0
- package/dist/specialist-agent.mjs +14515 -0
- package/dist/usage-worker.mjs +1077 -0
- package/package.json +34 -58
- package/.claude-plugin/marketplace.json +0 -52
- package/.claude-plugin/plugin.json +0 -37
- package/.codex/INSTALL.md +0 -145
- package/.cursor-plugin/marketplace.json +0 -52
- package/.cursor-plugin/plugin.json +0 -37
- package/.opencode/INSTALL.md +0 -127
- package/.opencode/opencode.json +0 -186
- package/agents/analyst-lite.md +0 -48
- package/agents/analyst.md +0 -396
- package/agents/api-lite.md +0 -43
- package/agents/api.md +0 -427
- package/agents/architect-lite.md +0 -104
- package/agents/architect.md +0 -571
- package/agents/autopilot-lite.md +0 -46
- package/agents/autopilot.md +0 -196
- package/agents/cloud-lite.md +0 -75
- package/agents/cloud.md +0 -213
- package/agents/data-lite.md +0 -67
- package/agents/data.md +0 -306
- package/agents/debugger-lite.md +0 -46
- package/agents/debugger.md +0 -410
- package/agents/deps-lite.md +0 -41
- package/agents/deps.md +0 -363
- package/agents/designer-lite.md +0 -67
- package/agents/designer.md +0 -195
- package/agents/devops-lite.md +0 -67
- package/agents/devops.md +0 -205
- package/agents/docs-lite.md +0 -42
- package/agents/docs.md +0 -454
- package/agents/executor-lite.md +0 -61
- package/agents/executor.md +0 -695
- package/agents/explorer-lite.md +0 -55
- package/agents/explorer.md +0 -152
- package/agents/finance-lite.md +0 -66
- package/agents/finance.md +0 -255
- package/agents/i18n-lite.md +0 -44
- package/agents/i18n.md +0 -594
- package/agents/legal-lite.md +0 -113
- package/agents/legal.md +0 -302
- package/agents/marketing-lite.md +0 -25
- package/agents/marketing.md +0 -188
- package/agents/memory.md +0 -166
- package/agents/orchestrator-lite.md +0 -40
- package/agents/orchestrator.md +0 -512
- package/agents/pair-lite.md +0 -38
- package/agents/pair.md +0 -310
- package/agents/perf-lite.md +0 -42
- package/agents/perf.md +0 -320
- package/agents/planner-lite.md +0 -59
- package/agents/planner.md +0 -272
- package/agents/product-lite.md +0 -25
- package/agents/product.md +0 -195
- package/agents/refactor-lite.md +0 -42
- package/agents/refactor.md +0 -467
- package/agents/ripple-lite.md +0 -106
- package/agents/ripple.md +0 -166
- package/agents/scout-lite.md +0 -37
- package/agents/scout.md +0 -224
- package/agents/security-lite.md +0 -66
- package/agents/security.md +0 -252
- package/agents/sentry-triage-lite.md +0 -54
- package/agents/sentry-triage.md +0 -217
- package/agents/starter-lite.md +0 -80
- package/agents/starter.md +0 -300
- package/agents/support-lite.md +0 -24
- package/agents/support.md +0 -191
- package/agents/tdd-lite.md +0 -43
- package/agents/tdd.md +0 -329
- package/agents/tester-lite.md +0 -71
- package/agents/tester.md +0 -237
- package/cli/architectures.mjs +0 -713
- package/cli/detect-architecture.mjs +0 -752
- package/cli/generate-architecture.mjs +0 -1096
- package/cli/index.mjs +0 -1217
- package/cli/recommend-architecture.mjs +0 -870
- package/hooks/after-review.mjs +0 -130
- package/hooks/after-task.mjs +0 -117
- package/hooks/before-plan.mjs +0 -155
- package/hooks/before-review.mjs +0 -139
- package/hooks/hooks.json +0 -66
- package/hooks/lifecycle.json +0 -91
- package/hooks/native/auto-dispatch.mjs +0 -207
- package/hooks/native/auto-format.mjs +0 -176
- package/hooks/native/mcp-discovery.mjs +0 -168
- package/hooks/native/security-config.json +0 -38
- package/hooks/native/security-guard.mjs +0 -323
- package/hooks/native/session-context.mjs +0 -179
- package/hooks/native/session-end.mjs +0 -42
- package/hooks/native/utils.mjs +0 -62
- package/hooks/on-error.mjs +0 -129
- package/hooks/session-end.mjs +0 -185
- package/hooks/session-start.mjs +0 -154
- package/packs/angular/ARCHITECTURE.md +0 -814
- package/packs/angular/CLAUDE.md +0 -105
- package/packs/angular/agents/builder.md +0 -113
- package/packs/angular/agents/doctor.md +0 -187
- package/packs/angular/agents/migrator.md +0 -101
- package/packs/angular/agents/reviewer.md +0 -252
- package/packs/angular/agents-lite/builder.md +0 -65
- package/packs/angular/agents-lite/doctor.md +0 -64
- package/packs/angular/agents-lite/migrator.md +0 -75
- package/packs/angular/agents-lite/reviewer.md +0 -69
- package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
- package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
- package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
- package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
- package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
- package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
- package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
- package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
- package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/angular/skills/review-review/SKILL.md +0 -43
- package/packs/astro/ARCHITECTURE.md +0 -718
- package/packs/astro/CLAUDE.md +0 -106
- package/packs/astro/agents/builder.md +0 -123
- package/packs/astro/agents/doctor.md +0 -200
- package/packs/astro/agents/migrator.md +0 -105
- package/packs/astro/agents/reviewer.md +0 -253
- package/packs/astro/agents-lite/builder.md +0 -71
- package/packs/astro/agents-lite/doctor.md +0 -66
- package/packs/astro/agents-lite/migrator.md +0 -71
- package/packs/astro/agents-lite/reviewer.md +0 -70
- package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
- package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
- package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
- package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
- package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
- package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
- package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
- package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
- package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/astro/skills/review-review/SKILL.md +0 -45
- package/packs/nextjs/ARCHITECTURE.md +0 -1033
- package/packs/nextjs/CLAUDE.md +0 -106
- package/packs/nextjs/agents/builder.md +0 -132
- package/packs/nextjs/agents/doctor.md +0 -226
- package/packs/nextjs/agents/migrator.md +0 -101
- package/packs/nextjs/agents/reviewer.md +0 -243
- package/packs/nextjs/agents-lite/builder.md +0 -74
- package/packs/nextjs/agents-lite/doctor.md +0 -74
- package/packs/nextjs/agents-lite/migrator.md +0 -75
- package/packs/nextjs/agents-lite/reviewer.md +0 -73
- package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
- package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
- package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
- package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
- package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
- package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
- package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
- package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
- package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
- package/packs/nextjs/skills/review-review/SKILL.md +0 -47
- package/packs/nuxt/ARCHITECTURE.md +0 -831
- package/packs/nuxt/CLAUDE.md +0 -111
- package/packs/nuxt/agents/builder.md +0 -120
- package/packs/nuxt/agents/doctor.md +0 -198
- package/packs/nuxt/agents/migrator.md +0 -101
- package/packs/nuxt/agents/reviewer.md +0 -255
- package/packs/nuxt/agents-lite/builder.md +0 -67
- package/packs/nuxt/agents-lite/doctor.md +0 -67
- package/packs/nuxt/agents-lite/migrator.md +0 -80
- package/packs/nuxt/agents-lite/reviewer.md +0 -71
- package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
- package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
- package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
- package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
- package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
- package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
- package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
- package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
- package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
- package/packs/nuxt/skills/review-review/SKILL.md +0 -45
- package/packs/react/ARCHITECTURE.md +0 -991
- package/packs/react/CLAUDE.md +0 -102
- package/packs/react/agents/builder.md +0 -113
- package/packs/react/agents/doctor.md +0 -203
- package/packs/react/agents/migrator.md +0 -101
- package/packs/react/agents/reviewer.md +0 -252
- package/packs/react/agents-lite/builder.md +0 -65
- package/packs/react/agents-lite/doctor.md +0 -64
- package/packs/react/agents-lite/migrator.md +0 -74
- package/packs/react/agents-lite/reviewer.md +0 -69
- package/packs/react/skills/dev-create-component/SKILL.md +0 -53
- package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
- package/packs/react/skills/dev-create-module/SKILL.md +0 -51
- package/packs/react/skills/dev-create-service/SKILL.md +0 -34
- package/packs/react/skills/dev-create-test/SKILL.md +0 -92
- package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/react/skills/docs-onboard/SKILL.md +0 -42
- package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
- package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
- package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
- package/packs/react/skills/review-review/SKILL.md +0 -44
- package/packs/svelte/ARCHITECTURE.md +0 -975
- package/packs/svelte/CLAUDE.md +0 -102
- package/packs/svelte/agents/builder.md +0 -114
- package/packs/svelte/agents/doctor.md +0 -174
- package/packs/svelte/agents/migrator.md +0 -101
- package/packs/svelte/agents/reviewer.md +0 -238
- package/packs/svelte/agents-lite/builder.md +0 -66
- package/packs/svelte/agents-lite/doctor.md +0 -67
- package/packs/svelte/agents-lite/migrator.md +0 -82
- package/packs/svelte/agents-lite/reviewer.md +0 -70
- package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
- package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
- package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
- package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
- package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
- package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
- package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
- package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
- package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
- package/packs/svelte/skills/review-review/SKILL.md +0 -45
- package/packs/vue/ARCHITECTURE.md +0 -798
- package/packs/vue/CLAUDE.md +0 -102
- package/packs/vue/agents/builder.md +0 -112
- package/packs/vue/agents/doctor.md +0 -185
- package/packs/vue/agents/migrator.md +0 -101
- package/packs/vue/agents/reviewer.md +0 -249
- package/packs/vue/agents-lite/builder.md +0 -65
- package/packs/vue/agents-lite/doctor.md +0 -63
- package/packs/vue/agents-lite/migrator.md +0 -73
- package/packs/vue/agents-lite/reviewer.md +0 -68
- package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
- package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
- package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
- package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
- package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
- package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
- package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
- package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
- package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
- package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
- package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
- package/packs/vue/skills/review-review/SKILL.md +0 -43
- package/skills/audit/SKILL.md +0 -231
- package/skills/autofix/SKILL.md +0 -166
- package/skills/autopilot/SKILL.md +0 -286
- package/skills/brainstorm/SKILL.md +0 -298
- package/skills/checkpoint/SKILL.md +0 -217
- package/skills/codereview/SKILL.md +0 -268
- package/skills/commit/SKILL.md +0 -150
- package/skills/copywriting/SKILL.md +0 -218
- package/skills/cro/SKILL.md +0 -234
- package/skills/debug/SKILL.md +0 -210
- package/skills/design-review/SKILL.md +0 -217
- package/skills/discovery/SKILL.md +0 -218
- package/skills/estimate/SKILL.md +0 -154
- package/skills/finish/SKILL.md +0 -220
- package/skills/grill/SKILL.md +0 -270
- package/skills/health/SKILL.md +0 -251
- package/skills/improve-architecture/SKILL.md +0 -205
- package/skills/learn/SKILL.md +0 -260
- package/skills/lint/SKILL.md +0 -126
- package/skills/migrate-architecture/SKILL.md +0 -242
- package/skills/migrate-framework/SKILL.md +0 -172
- package/skills/onboard/SKILL.md +0 -168
- package/skills/plan/SKILL.md +0 -141
- package/skills/prd/SKILL.md +0 -241
- package/skills/recall/SKILL.md +0 -112
- package/skills/remember/SKILL.md +0 -108
- package/skills/seo-audit/SKILL.md +0 -240
- package/skills/tdd/SKILL.md +0 -201
- package/skills/tutorial/SKILL.md +0 -346
- package/skills/verify/SKILL.md +0 -168
- package/skills/worktree/SKILL.md +0 -168
- package/skills/write-skill/SKILL.md +0 -225
- package/templates/autopilot/PROMPT.md +0 -39
- package/templates/autopilot/README.md +0 -122
- package/templates/autopilot/devcontainer.json +0 -21
- package/templates/industry/ecommerce.md +0 -127
- package/templates/industry/fintech.md +0 -161
- package/templates/industry/saas.md +0 -134
- package/templates/session-memory.json +0 -48
- package/templates/skill-template/SKILL.md +0 -90
package/hooks/on-error.mjs
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* On Error Hook
|
|
5
|
-
*
|
|
6
|
-
* Runs when an agent encounters an error.
|
|
7
|
-
*
|
|
8
|
-
* Actions:
|
|
9
|
-
* - Logs error to metrics
|
|
10
|
-
* - Suggests recovery options
|
|
11
|
-
* - Optionally notifies external services
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
15
|
-
import { execSync } from 'child_process';
|
|
16
|
-
|
|
17
|
-
const SESSION_FILE = '.claude/metrics/current-session.json';
|
|
18
|
-
|
|
19
|
-
// Error data passed via environment or args
|
|
20
|
-
const errorData = {
|
|
21
|
-
agent: process.env.ERROR_AGENT || process.argv[2] || 'unknown',
|
|
22
|
-
message: process.env.ERROR_MESSAGE || process.argv[3] || 'Unknown error',
|
|
23
|
-
file: process.env.ERROR_FILE || process.argv[4] || '',
|
|
24
|
-
line: process.env.ERROR_LINE || process.argv[5] || '',
|
|
25
|
-
task: process.env.ERROR_TASK || process.argv[6] || '',
|
|
26
|
-
stack: process.env.ERROR_STACK || ''
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
async function main() {
|
|
30
|
-
console.log('\n──── Error Detected ────');
|
|
31
|
-
console.log(`Agent: ${errorData.agent}`);
|
|
32
|
-
console.log(`Message: ${errorData.message}`);
|
|
33
|
-
|
|
34
|
-
if (errorData.file) {
|
|
35
|
-
console.log(`Location: ${errorData.file}${errorData.line ? ':' + errorData.line : ''}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 1. Log to metrics
|
|
39
|
-
logErrorToMetrics(errorData);
|
|
40
|
-
|
|
41
|
-
// 2. Check for checkpoints
|
|
42
|
-
suggestRecovery();
|
|
43
|
-
|
|
44
|
-
// 3. Provide guidance
|
|
45
|
-
provideGuidance(errorData);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function logErrorToMetrics(error) {
|
|
49
|
-
if (!existsSync(SESSION_FILE)) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const session = JSON.parse(readFileSync(SESSION_FILE, 'utf-8'));
|
|
55
|
-
|
|
56
|
-
session.errors.push({
|
|
57
|
-
agent: error.agent,
|
|
58
|
-
message: error.message,
|
|
59
|
-
file: error.file,
|
|
60
|
-
line: error.line,
|
|
61
|
-
task: error.task,
|
|
62
|
-
timestamp: new Date().toISOString()
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
writeFileSync(SESSION_FILE, JSON.stringify(session, null, 2));
|
|
66
|
-
console.log('\n✓ Error logged to session metrics');
|
|
67
|
-
} catch {
|
|
68
|
-
// Ignore logging errors
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function suggestRecovery() {
|
|
73
|
-
try {
|
|
74
|
-
// Check for checkpoints
|
|
75
|
-
const checkpoints = execSync('git tag -l "checkpoint/*" 2>/dev/null || true', {
|
|
76
|
-
encoding: 'utf-8'
|
|
77
|
-
}).trim().split('\n').filter(Boolean);
|
|
78
|
-
|
|
79
|
-
if (checkpoints.length > 0) {
|
|
80
|
-
console.log('\n──── Recovery Options ────');
|
|
81
|
-
console.log('Available checkpoints:');
|
|
82
|
-
checkpoints.slice(-3).forEach(cp => {
|
|
83
|
-
console.log(` • ${cp}`);
|
|
84
|
-
});
|
|
85
|
-
console.log('\nTo rollback:');
|
|
86
|
-
console.log(` git reset --hard ${checkpoints[checkpoints.length - 1]}`);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Check for restore points
|
|
90
|
-
const restorePoints = execSync('git tag -l "restore-point/*" 2>/dev/null || true', {
|
|
91
|
-
encoding: 'utf-8'
|
|
92
|
-
}).trim().split('\n').filter(Boolean);
|
|
93
|
-
|
|
94
|
-
if (restorePoints.length > 0) {
|
|
95
|
-
console.log('\nFull session rollback:');
|
|
96
|
-
console.log(` git reset --hard ${restorePoints[restorePoints.length - 1]}`);
|
|
97
|
-
}
|
|
98
|
-
} catch {
|
|
99
|
-
console.log('\nℹ Git checkpoints not available');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function provideGuidance(error) {
|
|
104
|
-
console.log('\n──── Suggestions ────');
|
|
105
|
-
|
|
106
|
-
// Error-specific guidance
|
|
107
|
-
if (error.message.includes('TypeScript') || error.message.includes('tsc')) {
|
|
108
|
-
console.log('• Run "npx tsc --noEmit" to see all type errors');
|
|
109
|
-
console.log('• Check imports and type definitions');
|
|
110
|
-
} else if (error.message.includes('test') || error.message.includes('jest')) {
|
|
111
|
-
console.log('• Run "npm test" to see full test output');
|
|
112
|
-
console.log('• Check test assertions and mocks');
|
|
113
|
-
} else if (error.message.includes('syntax') || error.message.includes('parse')) {
|
|
114
|
-
console.log('• Check for missing brackets or semicolons');
|
|
115
|
-
console.log('• Validate JSON/YAML files');
|
|
116
|
-
} else if (error.message.includes('module') || error.message.includes('import')) {
|
|
117
|
-
console.log('• Run "npm install" to ensure dependencies');
|
|
118
|
-
console.log('• Check import paths and exports');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// General suggestions
|
|
122
|
-
console.log('\nGeneral:');
|
|
123
|
-
console.log('• Use @debugger for systematic investigation');
|
|
124
|
-
console.log('• Use /checkpoint restore [name] to rollback');
|
|
125
|
-
console.log('• Check recent changes: git diff HEAD~1');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Run
|
|
129
|
-
main().catch(console.error);
|
package/hooks/session-end.mjs
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Session End Hook
|
|
5
|
-
*
|
|
6
|
-
* Runs when a session ends (manually triggered or detected).
|
|
7
|
-
*
|
|
8
|
-
* Actions:
|
|
9
|
-
* - Generates session summary
|
|
10
|
-
* - Saves metrics to history
|
|
11
|
-
* - Cleans up temporary data
|
|
12
|
-
* - Updates session memory
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
16
|
-
import { join } from 'path';
|
|
17
|
-
|
|
18
|
-
const SESSION_FILE = '.claude/metrics/current-session.json';
|
|
19
|
-
const HISTORY_DIR = '.claude/metrics/history';
|
|
20
|
-
const MEMORY_FILE = '.claude/session-memory.json';
|
|
21
|
-
|
|
22
|
-
async function main() {
|
|
23
|
-
console.log('\n════════════════════════════════════════');
|
|
24
|
-
console.log(' SESSION SUMMARY ');
|
|
25
|
-
console.log('════════════════════════════════════════\n');
|
|
26
|
-
|
|
27
|
-
// 1. Load session data
|
|
28
|
-
const session = loadSession();
|
|
29
|
-
if (!session) {
|
|
30
|
-
console.log('No active session to summarize.');
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 2. Calculate final metrics
|
|
35
|
-
const metrics = calculateMetrics(session);
|
|
36
|
-
|
|
37
|
-
// 3. Display summary
|
|
38
|
-
displaySummary(session, metrics);
|
|
39
|
-
|
|
40
|
-
// 4. Compare with competitors
|
|
41
|
-
displayComparison(metrics);
|
|
42
|
-
|
|
43
|
-
// 5. Save to history
|
|
44
|
-
saveToHistory(session, metrics);
|
|
45
|
-
|
|
46
|
-
// 6. Clean up
|
|
47
|
-
cleanup();
|
|
48
|
-
|
|
49
|
-
console.log('\n════════════════════════════════════════\n');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function loadSession() {
|
|
53
|
-
if (!existsSync(SESSION_FILE)) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
const session = JSON.parse(readFileSync(SESSION_FILE, 'utf-8'));
|
|
59
|
-
session.endTime = new Date().toISOString();
|
|
60
|
-
return session;
|
|
61
|
-
} catch {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function calculateMetrics(session) {
|
|
67
|
-
const startTime = new Date(session.startTime);
|
|
68
|
-
const endTime = new Date(session.endTime);
|
|
69
|
-
const durationMs = endTime - startTime;
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
duration: formatDuration(durationMs),
|
|
73
|
-
durationMs,
|
|
74
|
-
tasksCompleted: session.tasks.length,
|
|
75
|
-
tasksFailed: session.errors.length,
|
|
76
|
-
totalTokens: session.tokens.estimated,
|
|
77
|
-
estimatedCost: session.tokens.estimated * 0.000015, // ~Sonnet pricing
|
|
78
|
-
filesCreated: [...new Set(session.files.created)].length,
|
|
79
|
-
filesModified: [...new Set(session.files.modified)].length,
|
|
80
|
-
agentsUsed: session.agents.length,
|
|
81
|
-
skillsUsed: session.skills.length,
|
|
82
|
-
checkpointsCreated: session.checkpoints.length,
|
|
83
|
-
tokensPerTask: session.tasks.length > 0
|
|
84
|
-
? Math.round(session.tokens.estimated / session.tasks.length)
|
|
85
|
-
: 0
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function formatDuration(ms) {
|
|
90
|
-
const seconds = Math.floor(ms / 1000);
|
|
91
|
-
const minutes = Math.floor(seconds / 60);
|
|
92
|
-
const hours = Math.floor(minutes / 60);
|
|
93
|
-
|
|
94
|
-
if (hours > 0) {
|
|
95
|
-
return `${hours}h ${minutes % 60}m`;
|
|
96
|
-
} else if (minutes > 0) {
|
|
97
|
-
return `${minutes}m ${seconds % 60}s`;
|
|
98
|
-
} else {
|
|
99
|
-
return `${seconds}s`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function displaySummary(session, metrics) {
|
|
104
|
-
console.log('──── Overview ────');
|
|
105
|
-
console.log(`Session ID: ${session.sessionId}`);
|
|
106
|
-
console.log(`Duration: ${metrics.duration}`);
|
|
107
|
-
console.log(`Status: ${metrics.tasksFailed > 0 ? '⚠ Completed with errors' : '✓ Completed successfully'}`);
|
|
108
|
-
|
|
109
|
-
console.log('\n──── Tasks ────');
|
|
110
|
-
console.log(`Completed: ${metrics.tasksCompleted}`);
|
|
111
|
-
console.log(`Errors: ${metrics.tasksFailed}`);
|
|
112
|
-
|
|
113
|
-
console.log('\n──── Files ────');
|
|
114
|
-
console.log(`Created: ${metrics.filesCreated}`);
|
|
115
|
-
console.log(`Modified: ${metrics.filesModified}`);
|
|
116
|
-
|
|
117
|
-
console.log('\n──── Token Usage ────');
|
|
118
|
-
console.log(`Total tokens: ~${metrics.totalTokens.toLocaleString()}`);
|
|
119
|
-
console.log(`Per task avg: ~${metrics.tokensPerTask.toLocaleString()}`);
|
|
120
|
-
console.log(`Estimated cost: ~$${metrics.estimatedCost.toFixed(2)}`);
|
|
121
|
-
|
|
122
|
-
console.log('\n──── Agents & Skills ────');
|
|
123
|
-
if (session.agents.length > 0) {
|
|
124
|
-
console.log(`Agents: ${session.agents.join(', ')}`);
|
|
125
|
-
}
|
|
126
|
-
if (session.skills.length > 0) {
|
|
127
|
-
console.log(`Skills: ${session.skills.join(', ')}`);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (session.checkpoints.length > 0) {
|
|
131
|
-
console.log(`\nCheckpoints: ${session.checkpoints.length} created`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (session.errors.length > 0) {
|
|
135
|
-
console.log('\n──── Errors ────');
|
|
136
|
-
session.errors.forEach((err, i) => {
|
|
137
|
-
console.log(`${i + 1}. [${err.agent}] ${err.message}`);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function displayComparison(metrics) {
|
|
143
|
-
// Estimate what Superpowers would cost for same work
|
|
144
|
-
// They use O(n²) scaling, we use linear
|
|
145
|
-
const superpowersEstimate = metrics.tasksCompleted > 1
|
|
146
|
-
? metrics.estimatedCost * Math.pow(metrics.tasksCompleted, 1.5)
|
|
147
|
-
: metrics.estimatedCost * 1.5;
|
|
148
|
-
|
|
149
|
-
const savings = ((superpowersEstimate - metrics.estimatedCost) / superpowersEstimate * 100).toFixed(0);
|
|
150
|
-
|
|
151
|
-
console.log('\n──── Cost Comparison ────');
|
|
152
|
-
console.log(`Specialist Agent: ~$${metrics.estimatedCost.toFixed(2)}`);
|
|
153
|
-
console.log(`Superpowers (est): ~$${superpowersEstimate.toFixed(2)}`);
|
|
154
|
-
console.log(`Savings: ~${savings}%`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function saveToHistory(session, metrics) {
|
|
158
|
-
if (!existsSync(HISTORY_DIR)) {
|
|
159
|
-
mkdirSync(HISTORY_DIR, { recursive: true });
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const historyFile = join(HISTORY_DIR, `${session.sessionId}.json`);
|
|
163
|
-
const historyData = {
|
|
164
|
-
...session,
|
|
165
|
-
metrics
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
writeFileSync(historyFile, JSON.stringify(historyData, null, 2));
|
|
169
|
-
console.log(`\n✓ Session saved to ${historyFile}`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function cleanup() {
|
|
173
|
-
// Remove current session file
|
|
174
|
-
try {
|
|
175
|
-
if (existsSync(SESSION_FILE)) {
|
|
176
|
-
// Keep it for now, can be deleted manually
|
|
177
|
-
console.log('ℹ Session file preserved for review');
|
|
178
|
-
}
|
|
179
|
-
} catch {
|
|
180
|
-
// Ignore cleanup errors
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Run
|
|
185
|
-
main().catch(console.error);
|
package/hooks/session-start.mjs
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Session Start Hook
|
|
5
|
-
*
|
|
6
|
-
* Runs when a new Claude Code session starts.
|
|
7
|
-
*
|
|
8
|
-
* Actions:
|
|
9
|
-
* - Validates project setup
|
|
10
|
-
* - Initializes metrics tracking
|
|
11
|
-
* - Creates session restore point
|
|
12
|
-
* - Loads session memory (if enabled)
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { execSync } from 'child_process';
|
|
16
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
17
|
-
import { join } from 'path';
|
|
18
|
-
|
|
19
|
-
const METRICS_DIR = '.claude/metrics';
|
|
20
|
-
const SESSION_FILE = '.claude/metrics/current-session.json';
|
|
21
|
-
|
|
22
|
-
async function main() {
|
|
23
|
-
const startTime = new Date().toISOString();
|
|
24
|
-
const sessionId = `session-${Date.now()}`;
|
|
25
|
-
|
|
26
|
-
console.log('──── Session Start ────');
|
|
27
|
-
|
|
28
|
-
// 1. Validate project setup
|
|
29
|
-
validateSetup();
|
|
30
|
-
|
|
31
|
-
// 2. Initialize metrics directory
|
|
32
|
-
initializeMetrics(sessionId, startTime);
|
|
33
|
-
|
|
34
|
-
// 3. Create session restore point
|
|
35
|
-
createRestorePoint(sessionId);
|
|
36
|
-
|
|
37
|
-
// 4. Load previous session memory (if exists)
|
|
38
|
-
loadSessionMemory();
|
|
39
|
-
|
|
40
|
-
// 5. Display session info
|
|
41
|
-
displaySessionInfo(sessionId, startTime);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function validateSetup() {
|
|
45
|
-
const checks = [
|
|
46
|
-
{ path: '.claude', name: 'Claude directory' },
|
|
47
|
-
{ path: 'CLAUDE.md', name: 'CLAUDE.md config' },
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
let allValid = true;
|
|
51
|
-
|
|
52
|
-
for (const check of checks) {
|
|
53
|
-
if (existsSync(check.path)) {
|
|
54
|
-
console.log(`✓ ${check.name}`);
|
|
55
|
-
} else {
|
|
56
|
-
console.log(`✗ ${check.name} missing`);
|
|
57
|
-
allValid = false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!allValid) {
|
|
62
|
-
console.log('\nRun "npx specialist-agent init" to set up.');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function initializeMetrics(sessionId, startTime) {
|
|
67
|
-
if (!existsSync(METRICS_DIR)) {
|
|
68
|
-
mkdirSync(METRICS_DIR, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const sessionData = {
|
|
72
|
-
sessionId,
|
|
73
|
-
startTime,
|
|
74
|
-
endTime: null,
|
|
75
|
-
duration: null,
|
|
76
|
-
agents: [],
|
|
77
|
-
skills: [],
|
|
78
|
-
tasks: [],
|
|
79
|
-
tokens: {
|
|
80
|
-
estimated: 0,
|
|
81
|
-
input: 0,
|
|
82
|
-
output: 0
|
|
83
|
-
},
|
|
84
|
-
files: {
|
|
85
|
-
created: [],
|
|
86
|
-
modified: [],
|
|
87
|
-
deleted: []
|
|
88
|
-
},
|
|
89
|
-
checkpoints: [],
|
|
90
|
-
errors: []
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
writeFileSync(SESSION_FILE, JSON.stringify(sessionData, null, 2));
|
|
94
|
-
console.log(`✓ Metrics initialized`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function createRestorePoint(sessionId) {
|
|
98
|
-
try {
|
|
99
|
-
// Check if in git repo
|
|
100
|
-
execSync('git rev-parse --git-dir', { stdio: 'pipe' });
|
|
101
|
-
|
|
102
|
-
// Check for uncommitted changes
|
|
103
|
-
const status = execSync('git status --porcelain', { encoding: 'utf-8' });
|
|
104
|
-
|
|
105
|
-
if (status.trim()) {
|
|
106
|
-
console.log('⚠ Uncommitted changes detected');
|
|
107
|
-
console.log(' Consider committing before major changes');
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Create restore point tag
|
|
111
|
-
const tagName = `restore-point/${sessionId}`;
|
|
112
|
-
try {
|
|
113
|
-
execSync(`git tag ${tagName}`, { stdio: 'pipe' });
|
|
114
|
-
console.log(`✓ Restore point: ${tagName}`);
|
|
115
|
-
} catch {
|
|
116
|
-
// Tag might already exist or no commits yet
|
|
117
|
-
console.log('ℹ Restore point not created (no commits or already exists)');
|
|
118
|
-
}
|
|
119
|
-
} catch {
|
|
120
|
-
console.log('ℹ Not a git repository');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function loadSessionMemory() {
|
|
125
|
-
const memoryFile = '.claude/session-memory.json';
|
|
126
|
-
|
|
127
|
-
if (existsSync(memoryFile)) {
|
|
128
|
-
try {
|
|
129
|
-
const memory = JSON.parse(readFileSync(memoryFile, 'utf-8'));
|
|
130
|
-
const decisions = memory.decisions || [];
|
|
131
|
-
|
|
132
|
-
if (decisions.length > 0) {
|
|
133
|
-
console.log(`\n📝 Session Memory (${decisions.length} decisions):`);
|
|
134
|
-
// Show last 3 decisions
|
|
135
|
-
decisions.slice(-3).forEach(d => {
|
|
136
|
-
console.log(` • ${d.topic}: ${d.decision}`);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
} catch {
|
|
140
|
-
// Invalid memory file, ignore
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function displaySessionInfo(sessionId, startTime) {
|
|
146
|
-
console.log('\n──── Ready ────');
|
|
147
|
-
console.log(`Session: ${sessionId}`);
|
|
148
|
-
console.log(`Started: ${new Date(startTime).toLocaleString()}`);
|
|
149
|
-
console.log('\nAvailable agents: @planner @builder @reviewer @tdd @debugger');
|
|
150
|
-
console.log('Available skills: /plan /tdd /debug /checkpoint /estimate /finish');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Run
|
|
154
|
-
main().catch(console.error);
|