nemonix-cli 1.0.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 +186 -0
- package/dist/cli.js +6870 -0
- package/package.json +48 -0
- package/src/config/claude-code-config/.claude/commands/setup-tmux.md +0 -0
- package/src/config/claude-code-config/CHANGELOG.md +261 -0
- package/src/config/claude-code-config/README.md +1 -0
- package/src/config/claude-code-config/agents/action.md +36 -0
- package/src/config/claude-code-config/agents/clean-code-runner.md +61 -0
- package/src/config/claude-code-config/agents/code-reviewer.md +172 -0
- package/src/config/claude-code-config/agents/code-simplifier.md +49 -0
- package/src/config/claude-code-config/agents/explore-codebase.md +65 -0
- package/src/config/claude-code-config/agents/explore-docs.md +65 -0
- package/src/config/claude-code-config/agents/explore-fast.md +22 -0
- package/src/config/claude-code-config/agents/implementer.md +181 -0
- package/src/config/claude-code-config/agents/snipper.md +36 -0
- package/src/config/claude-code-config/agents/websearch.md +42 -0
- package/src/config/claude-code-config/commands/prompts/create-vitejs-app.md +272 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-project.md +200 -0
- package/src/config/claude-code-config/commands/prompts/prompt.md +55 -0
- package/src/config/claude-code-config/commands/prompts/saas-challenge-idea.md +135 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-architecture.md +242 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-headline.md +132 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-legals-docs.md +176 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-logos.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-prd.md +195 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-tasks.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-define-pricing.md +293 -0
- package/src/config/claude-code-config/commands/prompts/saas-find-domain-name.md +190 -0
- package/src/config/claude-code-config/commands/prompts/saas-implement-landing-page.md +257 -0
- package/src/config/claude-code-config/commands/prompts/setup-tmux.md +160 -0
- package/src/config/claude-code-config/commands/prompts/tools.md +148 -0
- package/src/config/claude-code-config/hooks/hook-post-file.ts +162 -0
- package/src/config/claude-code-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
- package/src/config/claude-code-config/scripts/CLAUDE.md +50 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/CLAUDE.md +59 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/shared.test.ts +185 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts +44 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-short-message.jsonl +2 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-with-title.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/index.ts +113 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/rename-all.ts +148 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/shared.ts +157 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/worker.ts +58 -0
- package/src/config/claude-code-config/scripts/biome.json +37 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/CLAUDE.md +84 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/claude.test.ts +19 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/paths.test.ts +68 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/claude.ts +56 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/cli.ts +46 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/credentials.ts +76 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/index.ts +9 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/paths.ts +51 -0
- package/src/config/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
- package/src/config/claude-code-config/scripts/command-validator/README.md +147 -0
- package/src/config/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +99 -0
- package/src/config/claude-code-config/scripts/command-validator/src/cli.ts +121 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +174 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/types.ts +34 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/validator.ts +90 -0
- package/src/config/claude-code-config/scripts/package.json +43 -0
- package/src/config/claude-code-config/scripts/statusline/CLAUDE.md +205 -0
- package/src/config/claude-code-config/scripts/statusline/README.md +193 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/context.test.ts +229 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
- package/src/config/claude-code-config/scripts/statusline/data/.gitkeep +0 -0
- package/src/config/claude-code-config/scripts/statusline/defaults.json +82 -0
- package/src/config/claude-code-config/scripts/statusline/docs/ARCHITECTURE.md +166 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/test-input.json +35 -0
- package/src/config/claude-code-config/scripts/statusline/src/analyze-daily-usage.ts +151 -0
- package/src/config/claude-code-config/scripts/statusline/src/commands/interactive-config.ts +515 -0
- package/src/config/claude-code-config/scripts/statusline/src/debug-payloads.ts +195 -0
- package/src/config/claude-code-config/scripts/statusline/src/index.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config-types.ts +110 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/context.ts +103 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/index.ts +111 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +161 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/formatters.ts +426 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/presets.ts +177 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/render-pure.ts +516 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/types.ts +36 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/utils.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/stats.ts +119 -0
- package/src/config/claude-code-config/scripts/statusline/src/tests/spend-v2.test.ts +377 -0
- package/src/config/claude-code-config/scripts/statusline/src/tools/fixed-cost-calc.ts +317 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.free.json +79 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.json +100 -0
- package/src/config/claude-code-config/scripts/statusline/test-with-fixtures.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/test.ts +20 -0
- package/src/config/claude-code-config/scripts/statusline/tsconfig.json +27 -0
- package/src/config/claude-code-config/scripts/tsconfig.json +27 -0
- package/src/config/claude-code-config/settings.json +92 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/SKILL.md +176 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/architecture-template.md +436 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/challenge-framework.md +289 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/discovery-framework.md +338 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/prd-template.md +452 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/task-template.md +263 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/tools.md +132 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/rename-project.sh +42 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/setup.sh +104 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-00-init.md +174 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-01-discovery.md +342 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-02-brainstorm.md +230 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-03-validate.md +372 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-04-prd.md +364 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-05-architecture.md +904 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-06-tasks.md +446 -0
- package/src/config/claude-code-config/skills/explore/SKILL.md +119 -0
- package/src/config/claude-code-config/skills/frontend-design/LICENSE.txt +177 -0
- package/src/config/claude-code-config/skills/frontend-design/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-commit/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-create-pr/SKILL.md +53 -0
- package/src/config/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/src/config/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/src/config/claude-code-config/skills/marketing-copywriting/SKILL.md +72 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/SKILL.md +694 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/comprehensive-example.md +175 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/project-patterns.md +334 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/prompting-techniques.md +411 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/section-templates.md +347 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/SKILL.md +357 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/command-vs-prompt.md +287 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/examples.md +689 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/hook-types.md +495 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/input-output-schemas.md +503 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/matchers.md +517 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/troubleshooting.md +653 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/SKILL.md +390 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/ask-patterns.md +225 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/prompt-engineering.md +377 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/state-management.md +275 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/step-template.md +334 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/workflow-patterns.md +300 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/SKILL.md +451 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/context-management.md +567 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/debugging-agents.md +714 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/error-handling-and-recovery.md +502 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/evaluation-and-testing.md +374 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/orchestration-patterns.md +591 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/subagents.md +599 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/writing-subagent-prompts.md +513 -0
- package/src/config/claude-code-config/skills/ralph-loop/SKILL.md +117 -0
- package/src/config/claude-code-config/skills/ralph-loop/scripts/setup.sh +278 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-00-init.md +215 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-01-interactive-prd.md +366 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-02-create-stories.md +273 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-03-finish.md +245 -0
- package/src/config/claude-code-config/skills/ralph-tasks/SKILL.md +88 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/add-task.sh +36 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/list-tasks.sh +66 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/remove-task.sh +47 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/setup.sh +201 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add-search.md +131 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-init.md +123 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-list.md +58 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-remove.md +48 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-setup.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-wake-up.md +62 -0
- package/src/config/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/src/config/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/src/config/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/src/config/claude-code-config/skills/utils-refactor/SKILL.md +89 -0
- package/src/config/claude-code-config/skills/utils-save-docs/SKILL.md +74 -0
- package/src/config/claude-code-config/skills/utils-ultrathink/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/workflow-apex/SKILL.md +116 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +144 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00-init.md +273 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +165 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-save.md +123 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +422 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02b-tasks.md +301 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute-teams.md +297 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/00-context.md +53 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/SKILL.md +127 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-01-explore.md +230 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-02-challenge.md +238 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-03-synthesize.md +337 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-04-action.md +285 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/SKILL.md +150 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/cli-commands.md +122 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/github-cli.md +243 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/troubleshooting.md +362 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/vercel-cli.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-00-init.md +157 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-01-watch-ci.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-02-analyze-errors.md +263 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-03-fix-locally.md +312 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-04-commit-push.md +206 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-05-cleanup.md +196 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/SKILL.md +129 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/general-clean-code.md +347 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/nextjs-clean-code.md +458 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/react-clean-code.md +406 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/tanstack-query-best-practices.md +516 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/zustand-best-practices.md +491 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-01-scan.md +137 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-02-apply.md +152 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-03-verify.md +143 -0
- package/src/config/claude-code-config/skills/workflow-debug/SKILL.md +126 -0
- package/src/config/claude-code-config/skills/workflow-debug/references/log-technique.md +285 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-00-init.md +94 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01-analyze.md +180 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01b-log-instrumentation.md +271 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-02-find-solutions.md +141 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-03-propose.md +142 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-04-fix.md +176 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-05-verify.md +279 -0
- package/src/config/claude-code-config/skills/workflow-review-code/SKILL.md +219 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/clean-code-principles.md +140 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md +174 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md +149 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/security-checklist.md +127 -0
- package/src/config/claude-code-config/song/finish.mp3 +0 -0
- package/src/config/claude-code-config/song/need-human.mp3 +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
interface HookInput {
|
|
5
|
+
session_id: string;
|
|
6
|
+
transcript_path: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
hook_event_name: string;
|
|
9
|
+
tool_name: string;
|
|
10
|
+
tool_input: {
|
|
11
|
+
file_path: string;
|
|
12
|
+
content: string;
|
|
13
|
+
};
|
|
14
|
+
tool_response: {
|
|
15
|
+
filePath: string;
|
|
16
|
+
success: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface HookOutput {
|
|
21
|
+
hookSpecificOutput: {
|
|
22
|
+
hookEventName: string;
|
|
23
|
+
additionalContext: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Check for debug mode
|
|
28
|
+
const DEBUG = process.argv.includes("--debug");
|
|
29
|
+
|
|
30
|
+
function log(message: string, ...args: unknown[]) {
|
|
31
|
+
if (DEBUG) {
|
|
32
|
+
console.log(message, ...args);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function runCommand(
|
|
37
|
+
command: string[],
|
|
38
|
+
): Promise<{ stdout: string; stderr: string; success: boolean }> {
|
|
39
|
+
try {
|
|
40
|
+
const proc = Bun.spawn(command, {
|
|
41
|
+
stdout: "pipe",
|
|
42
|
+
stderr: "pipe",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const stdout = await new Response(proc.stdout).text();
|
|
46
|
+
const stderr = await new Response(proc.stderr).text();
|
|
47
|
+
const success = (await proc.exited) === 0;
|
|
48
|
+
|
|
49
|
+
return { stdout, stderr, success };
|
|
50
|
+
} catch (error) {
|
|
51
|
+
return { stdout: "", stderr: String(error), success: false };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function main() {
|
|
56
|
+
log("Hook started for file processing");
|
|
57
|
+
|
|
58
|
+
// Lire l'input JSON depuis stdin
|
|
59
|
+
const input = await Bun.stdin.text();
|
|
60
|
+
log("Input received, length:", input.length);
|
|
61
|
+
|
|
62
|
+
let hookData: HookInput;
|
|
63
|
+
try {
|
|
64
|
+
hookData = JSON.parse(input);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
log("Error parsing JSON input:", error);
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const filePath = hookData.tool_input?.file_path;
|
|
71
|
+
if (!filePath) {
|
|
72
|
+
log("Unable to extract file path from input");
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Vérifier que c'est un fichier .ts ou .tsx uniquement
|
|
77
|
+
if (!filePath.endsWith(".ts") && !filePath.endsWith(".tsx")) {
|
|
78
|
+
log(`Skipping ${filePath}: not a TypeScript file`);
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
log("Processing file:", filePath);
|
|
83
|
+
|
|
84
|
+
// Vérifier que le fichier existe
|
|
85
|
+
const file = Bun.file(filePath);
|
|
86
|
+
if (!(await file.exists())) {
|
|
87
|
+
log("File not found:", filePath);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// 1. Exécuter Prettier
|
|
92
|
+
log("Running Prettier formatting");
|
|
93
|
+
const prettierResult = await runCommand([
|
|
94
|
+
"bun",
|
|
95
|
+
"x",
|
|
96
|
+
"prettier",
|
|
97
|
+
"--write",
|
|
98
|
+
filePath,
|
|
99
|
+
]);
|
|
100
|
+
if (!prettierResult.success) {
|
|
101
|
+
log("Prettier failed:", prettierResult.stderr);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 2. ESLint --fix
|
|
105
|
+
log("Running ESLint --fix");
|
|
106
|
+
await runCommand(["bun", "x", "eslint", "--fix", filePath]);
|
|
107
|
+
|
|
108
|
+
// 3. Run ESLint check and TypeScript check in parallel
|
|
109
|
+
log("Running ESLint and TypeScript checks in parallel");
|
|
110
|
+
const [eslintCheckResult, tscResult] = await Promise.all([
|
|
111
|
+
runCommand(["bun", "x", "eslint", filePath]),
|
|
112
|
+
runCommand(["bun", "x", "tsc", "--noEmit", "--pretty", "false"]),
|
|
113
|
+
]);
|
|
114
|
+
|
|
115
|
+
const eslintErrors = (
|
|
116
|
+
eslintCheckResult.stdout + eslintCheckResult.stderr
|
|
117
|
+
).trim();
|
|
118
|
+
|
|
119
|
+
const tsErrors = tscResult.stderr
|
|
120
|
+
.split("\n")
|
|
121
|
+
.filter((line) => line.includes(filePath))
|
|
122
|
+
.join("\n");
|
|
123
|
+
|
|
124
|
+
// Construire le message d'erreurs
|
|
125
|
+
let errorMessage = "";
|
|
126
|
+
|
|
127
|
+
if (tsErrors || eslintErrors) {
|
|
128
|
+
errorMessage = `Fix NOW the following errors AND warning detected in ${filePath
|
|
129
|
+
.split("/")
|
|
130
|
+
.pop()}:\\n`;
|
|
131
|
+
|
|
132
|
+
if (tsErrors) {
|
|
133
|
+
errorMessage += `\\n TypeScript errors:\\n${tsErrors}\\n`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (eslintErrors) {
|
|
137
|
+
errorMessage += `\\n ESLint errors:\\n${eslintErrors}\\n`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
log("Error message", errorMessage);
|
|
142
|
+
|
|
143
|
+
// Sortir le résultat
|
|
144
|
+
if (errorMessage) {
|
|
145
|
+
const output: HookOutput = {
|
|
146
|
+
hookSpecificOutput: {
|
|
147
|
+
hookEventName: "PostToolUse",
|
|
148
|
+
additionalContext: errorMessage,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
log("Output", JSON.stringify(output, null, 2));
|
|
153
|
+
console.log(JSON.stringify(output, null, 2));
|
|
154
|
+
} else {
|
|
155
|
+
console.error(`No errors detected in ${filePath.split("/").pop()}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
main().catch((error) => {
|
|
160
|
+
log("Error in hook:", error);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-on-my-computer
|
|
3
|
+
description: Setup wizard - verify bun, install deps, run tests, fix until ALL pass
|
|
4
|
+
allowed-tools: Bash, Read, Edit, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Setup Wizard
|
|
8
|
+
|
|
9
|
+
Make this scripts repository work PERFECTLY on this machine.
|
|
10
|
+
|
|
11
|
+
Relentless setup wizard. Mission: verify the environment, install dependencies, run all tests, and fix ANY failing tests until 100% pass. NEVER give up until every single test is green.
|
|
12
|
+
|
|
13
|
+
## Context
|
|
14
|
+
|
|
15
|
+
Current OS: !`uname -s`
|
|
16
|
+
Current directory: !`pwd`
|
|
17
|
+
Bun version: !`bun --version 2>&1 || echo "NOT_INSTALLED"`
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
|
|
21
|
+
### Phase 1: Environment Check
|
|
22
|
+
|
|
23
|
+
1. Verify Bun is installed (`bun --version`)
|
|
24
|
+
- If NOT installed → STOP and tell user: "Install Bun from https://bun.sh"
|
|
25
|
+
2. Verify in correct directory (must have package.json with "test" script)
|
|
26
|
+
3. Check OS: macOS/Linux (full support), Windows (needs WSL)
|
|
27
|
+
|
|
28
|
+
### Phase 2: Install Dependencies
|
|
29
|
+
|
|
30
|
+
4. Run `bun install`
|
|
31
|
+
- If fails: Delete `bun.lockb` and retry
|
|
32
|
+
- If still fails: Report specific error to user
|
|
33
|
+
|
|
34
|
+
### Phase 3: Run Tests
|
|
35
|
+
|
|
36
|
+
5. Run `bun run test`
|
|
37
|
+
6. Record output - note which tests pass/fail
|
|
38
|
+
|
|
39
|
+
### Phase 4: Fix Loop (NEVER STOP UNTIL GREEN)
|
|
40
|
+
|
|
41
|
+
7. While ANY tests fail:
|
|
42
|
+
- Analyze the error message
|
|
43
|
+
- Identify root cause:
|
|
44
|
+
- Missing dependency → `bun install <package>`
|
|
45
|
+
- Wrong import path → Fix the import
|
|
46
|
+
- Cross-platform issue → Use `path.join()`, `os.homedir()`
|
|
47
|
+
- Missing credentials → Check `~/.claude/.credentials.json`
|
|
48
|
+
- File not found → Verify path exists
|
|
49
|
+
- Type error → Fix TypeScript
|
|
50
|
+
- Apply minimal fix
|
|
51
|
+
- Re-run `bun run test`
|
|
52
|
+
- **REPEAT until 100% green**
|
|
53
|
+
|
|
54
|
+
### Phase 5: Final Verification
|
|
55
|
+
|
|
56
|
+
8. Run `bun run test` one final time
|
|
57
|
+
9. Run `bun run lint` (fix if needed)
|
|
58
|
+
|
|
59
|
+
### Phase 6: Victory Report
|
|
60
|
+
|
|
61
|
+
10. Report to user:
|
|
62
|
+
- Total tests passed
|
|
63
|
+
- Fixes applied (list each one)
|
|
64
|
+
- Status: READY TO USE
|
|
65
|
+
|
|
66
|
+
## Testing Commands
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
bun install
|
|
70
|
+
bun run test
|
|
71
|
+
bun run lint
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Success Criteria
|
|
75
|
+
|
|
76
|
+
Before declaring success:
|
|
77
|
+
- `bun run test` exits with code 0
|
|
78
|
+
- ALL 186+ tests pass
|
|
79
|
+
- No lint errors
|
|
80
|
+
- All package.json scripts work
|
|
81
|
+
- Repository is READY TO USE
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Scripts - Project Memory
|
|
2
|
+
|
|
3
|
+
Monorepo containing Claude Code utilities and extensions.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
scripts/
|
|
9
|
+
├── auto-rename-session/ # Auto-generates session titles via AI
|
|
10
|
+
├── claude-code-ai/ # Shared Claude API helpers
|
|
11
|
+
├── command-validator/ # Security validation for bash commands
|
|
12
|
+
├── statusline/ # Custom statusline for Claude Code
|
|
13
|
+
└── package.json # Root package with all scripts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Commands
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
bun run test # Run ALL tests (186 tests)
|
|
20
|
+
bun run lint # Lint all packages
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Per-Package Commands
|
|
24
|
+
|
|
25
|
+
| Package | Test | Start |
|
|
26
|
+
|---------|------|-------|
|
|
27
|
+
| auto-rename-session | `bun run auto-rename:test` | `bun run auto-rename:start` |
|
|
28
|
+
| claude-code-ai | `bun run ai:test` | - |
|
|
29
|
+
| command-validator | `bun run validator:test` | `bun run validator:cli` |
|
|
30
|
+
| statusline | `bun run statusline:test` | `bun run statusline:start` |
|
|
31
|
+
|
|
32
|
+
## Cross-Platform Support
|
|
33
|
+
|
|
34
|
+
All packages support macOS, Linux, and Windows (via WSL):
|
|
35
|
+
- Use `path.join()` instead of string concatenation
|
|
36
|
+
- Use `os.homedir()` instead of `process.env.HOME`
|
|
37
|
+
- Use `path.sep` or regex `[/\\]` for path splitting
|
|
38
|
+
|
|
39
|
+
## Shared Dependencies
|
|
40
|
+
|
|
41
|
+
- `@ai-sdk/anthropic` + `ai` - Claude API access
|
|
42
|
+
- `picocolors` - Terminal colors
|
|
43
|
+
- `@biomejs/biome` - Linting/formatting
|
|
44
|
+
- `bun:test` - Testing
|
|
45
|
+
|
|
46
|
+
## Credentials
|
|
47
|
+
|
|
48
|
+
Claude Code OAuth tokens are retrieved via `claude-code-ai/helper/credentials.ts`:
|
|
49
|
+
- macOS: Keychain (`security find-generic-password`)
|
|
50
|
+
- Linux/Windows: `~/.claude/.credentials.json`
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Auto-Rename Session - Project Memory
|
|
2
|
+
|
|
3
|
+
Automatically generates meaningful titles for Claude Code sessions using AI.
|
|
4
|
+
|
|
5
|
+
## How It Works
|
|
6
|
+
|
|
7
|
+
1. **Hook Trigger**: Claude Code's `Stop` hook runs `index.ts`
|
|
8
|
+
2. **Parse Transcript**: Extracts first user message and assistant response
|
|
9
|
+
3. **Skip if Titled**: Checks for existing `custom-title` in transcript
|
|
10
|
+
4. **Generate Title**: Calls Claude Haiku via `generateTextCC`
|
|
11
|
+
5. **Write to Transcript**: Appends `{"type":"custom-title","customTitle":"..."}` line
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun run auto-rename:start # Run the hook handler
|
|
17
|
+
bun run auto-rename:rename-all # Batch rename all sessions in a project
|
|
18
|
+
bun run auto-rename:test # Run tests
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Files
|
|
22
|
+
|
|
23
|
+
| File | Purpose |
|
|
24
|
+
|------|---------|
|
|
25
|
+
| `src/index.ts` | Hook entry point, spawns worker |
|
|
26
|
+
| `src/worker.ts` | Calls AI, writes title to transcript |
|
|
27
|
+
| `src/shared.ts` | `buildPrompt`, `parseTitle`, `extractTextContent` |
|
|
28
|
+
| `src/rename-all.ts` | CLI to batch-rename old sessions |
|
|
29
|
+
|
|
30
|
+
## Hook Configuration
|
|
31
|
+
|
|
32
|
+
Add to `~/.claude/settings.json`:
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"hooks": {
|
|
36
|
+
"Stop": [{
|
|
37
|
+
"command": "bun /path/to/auto-rename-session/src/index.ts"
|
|
38
|
+
}]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Title Generation Rules
|
|
44
|
+
|
|
45
|
+
- 2-5 words, starts with verb
|
|
46
|
+
- Always in English (even for non-English input)
|
|
47
|
+
- Examples: "Build React Auth", "Debug API Error", "Fix Code Bug"
|
|
48
|
+
|
|
49
|
+
## Testing
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bun test auto-rename-session/__tests__/shared.test.ts # Unit tests
|
|
53
|
+
bun test auto-rename-session/__tests__/title-generation.test.ts # Integration (real API)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Dependencies
|
|
57
|
+
|
|
58
|
+
- Uses `../../claude-code-ai/claude.ts` for API calls
|
|
59
|
+
- Uses `../../claude-code-ai/helper/paths.ts` for cross-platform paths
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
buildPrompt,
|
|
4
|
+
createCustomTitleLine,
|
|
5
|
+
extractTextContent,
|
|
6
|
+
isRealUserMessage,
|
|
7
|
+
parseTitle,
|
|
8
|
+
} from "../src/shared";
|
|
9
|
+
|
|
10
|
+
describe("extractTextContent", () => {
|
|
11
|
+
it("should extract text from string content", () => {
|
|
12
|
+
const result = extractTextContent("Hello world");
|
|
13
|
+
expect(result).toBe("Hello world");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should extract text from content blocks array", () => {
|
|
17
|
+
const content = [
|
|
18
|
+
{ type: "thinking", thinking: "I'm thinking..." },
|
|
19
|
+
{ type: "text", text: "This is the response" },
|
|
20
|
+
];
|
|
21
|
+
const result = extractTextContent(content);
|
|
22
|
+
expect(result).toBe("This is the response");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should return empty string when no text block found", () => {
|
|
26
|
+
const content = [{ type: "thinking", thinking: "Just thinking" }];
|
|
27
|
+
const result = extractTextContent(content);
|
|
28
|
+
expect(result).toBe("");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should return empty string for empty array", () => {
|
|
32
|
+
const result = extractTextContent([]);
|
|
33
|
+
expect(result).toBe("");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe("isRealUserMessage", () => {
|
|
38
|
+
it("should return true for valid user messages", () => {
|
|
39
|
+
expect(isRealUserMessage("Help me build a component")).toBe(true);
|
|
40
|
+
expect(isRealUserMessage("Fix the bug in my code")).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should return false for empty content", () => {
|
|
44
|
+
expect(isRealUserMessage("")).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("should return false for messages starting with Caveat:", () => {
|
|
48
|
+
expect(isRealUserMessage("Caveat: This is a system message")).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("should return false for command messages", () => {
|
|
52
|
+
expect(isRealUserMessage("<command-name>test</command-name>")).toBe(false);
|
|
53
|
+
expect(isRealUserMessage("<local-command>something</local-command>")).toBe(
|
|
54
|
+
false,
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("should return false for very short messages", () => {
|
|
59
|
+
expect(isRealUserMessage("hey")).toBe(false);
|
|
60
|
+
expect(isRealUserMessage("hi")).toBe(false);
|
|
61
|
+
expect(isRealUserMessage(" ")).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("should return true for messages exactly 5 characters", () => {
|
|
65
|
+
expect(isRealUserMessage("hello")).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("should return false for skill prompt expansions", () => {
|
|
69
|
+
expect(
|
|
70
|
+
isRealUserMessage("Base directory for this skill: /path/to/skill"),
|
|
71
|
+
).toBe(false);
|
|
72
|
+
expect(
|
|
73
|
+
isRealUserMessage(
|
|
74
|
+
"<objective>Execute systematic implementation workflows</objective>",
|
|
75
|
+
),
|
|
76
|
+
).toBe(false);
|
|
77
|
+
expect(
|
|
78
|
+
isRealUserMessage("Some text with <quick_start> in it"),
|
|
79
|
+
).toBe(false);
|
|
80
|
+
expect(
|
|
81
|
+
isRealUserMessage("<parameters>some params</parameters>"),
|
|
82
|
+
).toBe(false);
|
|
83
|
+
expect(
|
|
84
|
+
isRealUserMessage("Text containing <workflow> tag"),
|
|
85
|
+
).toBe(false);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("should return true for real user messages that look like but are not skill prompts", () => {
|
|
89
|
+
expect(isRealUserMessage("Help me set up a workflow")).toBe(true);
|
|
90
|
+
expect(isRealUserMessage("Add a parameter to my function")).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("parseTitle", () => {
|
|
95
|
+
it("should parse a clean title", () => {
|
|
96
|
+
expect(parseTitle("Build React Auth")).toBe("Build React Auth");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("should remove quotes and special characters", () => {
|
|
100
|
+
expect(parseTitle('"Debug API Error"')).toBe("Debug API Error");
|
|
101
|
+
expect(parseTitle("**Fix Bug**")).toBe("Fix Bug");
|
|
102
|
+
expect(parseTitle("`Code Review`")).toBe("Code Review");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("should trim whitespace", () => {
|
|
106
|
+
expect(parseTitle(" Create Component ")).toBe("Create Component");
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("should truncate long titles to 60 characters", () => {
|
|
110
|
+
const longTitle =
|
|
111
|
+
"This is a very long title that should be truncated because it exceeds sixty characters";
|
|
112
|
+
const result = parseTitle(longTitle);
|
|
113
|
+
expect(result?.length).toBeLessThanOrEqual(60);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should return null for empty or very short titles", () => {
|
|
117
|
+
expect(parseTitle("")).toBeNull();
|
|
118
|
+
expect(parseTitle("ab")).toBeNull();
|
|
119
|
+
expect(parseTitle(" ")).toBeNull();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("should return null for None responses", () => {
|
|
123
|
+
expect(parseTitle("None")).toBeNull();
|
|
124
|
+
expect(parseTitle("none")).toBeNull();
|
|
125
|
+
expect(parseTitle("NONE")).toBeNull();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("should return null for ANY title containing workflow/skill keywords", () => {
|
|
129
|
+
expect(parseTitle("Set Up APEX Skill")).toBeNull();
|
|
130
|
+
expect(parseTitle("Running Apex Workflow")).toBeNull();
|
|
131
|
+
expect(parseTitle("Execute Workflow Steps")).toBeNull();
|
|
132
|
+
expect(parseTitle("Start APEX")).toBeNull();
|
|
133
|
+
expect(parseTitle("Initialize Skill")).toBeNull();
|
|
134
|
+
expect(parseTitle("Loading APEX")).toBeNull();
|
|
135
|
+
expect(parseTitle("Build Approval Workflow")).toBeNull();
|
|
136
|
+
expect(parseTitle("Debug Skill System")).toBeNull();
|
|
137
|
+
expect(parseTitle("Add Workflow Feature")).toBeNull();
|
|
138
|
+
expect(parseTitle("Debug Brainstorm")).toBeNull();
|
|
139
|
+
expect(parseTitle("Create Subagent")).toBeNull();
|
|
140
|
+
expect(parseTitle("Setup Hook")).toBeNull();
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("should allow valid titles without forbidden keywords", () => {
|
|
144
|
+
expect(parseTitle("Build React Component")).toBe("Build React Component");
|
|
145
|
+
expect(parseTitle("Debug API Error")).toBe("Debug API Error");
|
|
146
|
+
expect(parseTitle("Add Authentication")).toBe("Add Authentication");
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
describe("buildPrompt", () => {
|
|
151
|
+
it("should include user message in prompt", () => {
|
|
152
|
+
const prompt = buildPrompt("Help me fix a bug", "");
|
|
153
|
+
expect(prompt).toContain("Help me fix a bug");
|
|
154
|
+
expect(prompt).toContain("<user_message>");
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it("should include assistant response when provided", () => {
|
|
158
|
+
const prompt = buildPrompt("Fix bug", "I'll help you debug this issue");
|
|
159
|
+
expect(prompt).toContain("<context>");
|
|
160
|
+
expect(prompt).toContain("I'll help you debug this issue");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("should not include context section when no assistant response", () => {
|
|
164
|
+
const prompt = buildPrompt("Fix bug", "");
|
|
165
|
+
expect(prompt).not.toContain("<context>");
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("should truncate long user messages", () => {
|
|
169
|
+
const longMessage = "a".repeat(500);
|
|
170
|
+
const prompt = buildPrompt(longMessage, "");
|
|
171
|
+
expect(prompt).toContain("a".repeat(400));
|
|
172
|
+
expect(prompt).not.toContain("a".repeat(500));
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe("createCustomTitleLine", () => {
|
|
177
|
+
it("should create valid JSON with custom-title type", () => {
|
|
178
|
+
const line = createCustomTitleLine("My Title", "session-123");
|
|
179
|
+
const parsed = JSON.parse(line);
|
|
180
|
+
|
|
181
|
+
expect(parsed.type).toBe("custom-title");
|
|
182
|
+
expect(parsed.customTitle).toBe("My Title");
|
|
183
|
+
expect(parsed.sessionId).toBe("session-123");
|
|
184
|
+
});
|
|
185
|
+
});
|
package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import { generateTextCC } from "../../claude-code-ai/claude";
|
|
3
|
+
import { buildPrompt, parseTitle } from "../src/shared";
|
|
4
|
+
|
|
5
|
+
describe("Title Generation (Integration)", () => {
|
|
6
|
+
it("should generate a valid title for a React component request", async () => {
|
|
7
|
+
const userMessage =
|
|
8
|
+
"Help me build a React component for user authentication";
|
|
9
|
+
const assistantResponse =
|
|
10
|
+
"I'll help you create an authentication component";
|
|
11
|
+
|
|
12
|
+
const prompt = buildPrompt(userMessage, assistantResponse);
|
|
13
|
+
const response = await generateTextCC({ prompt, model: "haiku" });
|
|
14
|
+
const title = parseTitle(response);
|
|
15
|
+
|
|
16
|
+
expect(title).toBeTruthy();
|
|
17
|
+
expect(title!.length).toBeGreaterThan(3);
|
|
18
|
+
expect(title!.length).toBeLessThanOrEqual(60);
|
|
19
|
+
}, 30000);
|
|
20
|
+
|
|
21
|
+
it("should generate a valid title for a bug fix request", async () => {
|
|
22
|
+
const userMessage = "I'm getting a TypeError when fetching from my API";
|
|
23
|
+
const assistantResponse = "Let me help you debug this issue";
|
|
24
|
+
|
|
25
|
+
const prompt = buildPrompt(userMessage, assistantResponse);
|
|
26
|
+
const response = await generateTextCC({ prompt, model: "haiku" });
|
|
27
|
+
const title = parseTitle(response);
|
|
28
|
+
|
|
29
|
+
expect(title).toBeTruthy();
|
|
30
|
+
expect(title!.length).toBeGreaterThan(3);
|
|
31
|
+
}, 30000);
|
|
32
|
+
|
|
33
|
+
it("should generate a title in English even for non-English input", async () => {
|
|
34
|
+
const userMessage = "Aide-moi à créer une fonction de tri";
|
|
35
|
+
const assistantResponse = "";
|
|
36
|
+
|
|
37
|
+
const prompt = buildPrompt(userMessage, assistantResponse);
|
|
38
|
+
const response = await generateTextCC({ prompt, model: "haiku" });
|
|
39
|
+
const title = parseTitle(response);
|
|
40
|
+
|
|
41
|
+
expect(title).toBeTruthy();
|
|
42
|
+
expect(title!.length).toBeGreaterThan(3);
|
|
43
|
+
}, 30000);
|
|
44
|
+
});
|
package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"type":"file-history-snapshot","messageId":"409fe884-7ba8-4577-93e9-e3c8f090431f","snapshot":{"messageId":"409fe884-7ba8-4577-93e9-e3c8f090431f","trackedFileBackups":{},"timestamp":"2026-01-05T13:19:37.529Z"},"isSnapshotUpdate":false}
|
|
2
|
+
{"parentUuid":null,"isSidechain":false,"userType":"external","cwd":"/Users/melvynx","sessionId":"test-session-123","version":"2.0.76","gitBranch":"main","type":"user","message":{"role":"user","content":"Help me build a React component for user authentication"},"uuid":"409fe884-7ba8-4577-93e9-e3c8f090431f","timestamp":"2026-01-05T13:19:37.521Z"}
|
|
3
|
+
{"parentUuid":"409fe884-7ba8-4577-93e9-e3c8f090431f","isSidechain":false,"userType":"external","cwd":"/Users/melvynx","sessionId":"test-session-123","version":"2.0.76","gitBranch":"main","message":{"model":"claude-opus-4-5-20251101","id":"msg_01HLwb1d4WTJpgjWPKjP2sST","type":"message","role":"assistant","content":[{"type":"text","text":"I'll help you create a React authentication component. Let me start by setting up the basic structure."}],"stop_reason":"end_turn","usage":{"input_tokens":1000,"output_tokens":200}},"requestId":"req_011CWpJGYa1vqkZBsFWUEKUj","type":"assistant","uuid":"e8ee8f5d-b970-4313-bf82-283f46700754","timestamp":"2026-01-05T13:19:41.893Z"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
{"type":"file-history-snapshot","messageId":"def456","snapshot":{}}
|
|
2
|
+
{"parentUuid":null,"isSidechain":false,"userType":"external","cwd":"/Users/melvynx","sessionId":"short-session","version":"2.0.76","gitBranch":"main","type":"user","message":{"role":"user","content":"hey"},"uuid":"def456","timestamp":"2026-01-05T13:19:37.521Z"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"type":"file-history-snapshot","messageId":"abc123","snapshot":{"messageId":"abc123","trackedFileBackups":{},"timestamp":"2026-01-05T13:19:37.529Z"},"isSnapshotUpdate":false}
|
|
2
|
+
{"parentUuid":null,"isSidechain":false,"userType":"external","cwd":"/Users/melvynx","sessionId":"titled-session","version":"2.0.76","gitBranch":"main","type":"user","message":{"role":"user","content":"Fix the bug in my code"},"uuid":"abc123","timestamp":"2026-01-05T13:19:37.521Z"}
|
|
3
|
+
{"type":"custom-title","customTitle":"Debug Code Issue","sessionId":"titled-session"}
|