xtrm-tools 0.5.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/CHANGELOG.md +504 -0
- package/README.md +201 -0
- package/cli/dist/index.cjs +57378 -0
- package/cli/dist/index.cjs.map +1 -0
- package/cli/dist/index.d.cts +2 -0
- package/cli/package.json +47 -0
- package/config/.env.example +40 -0
- package/config/hooks.json +72 -0
- package/config/instructions/agents-top.md +30 -0
- package/config/instructions/claude-top.md +30 -0
- package/config/mcp_servers.json +57 -0
- package/config/mcp_servers_optional.json +53 -0
- package/config/pi/auth.json.template +14 -0
- package/config/pi/extensions/auto-session-name/index.ts +29 -0
- package/config/pi/extensions/auto-session-name/package.json +16 -0
- package/config/pi/extensions/auto-update/index.ts +71 -0
- package/config/pi/extensions/auto-update/package.json +16 -0
- package/config/pi/extensions/beads/index.ts +166 -0
- package/config/pi/extensions/beads/package.json +16 -0
- package/config/pi/extensions/bg-process/index.ts +230 -0
- package/config/pi/extensions/bg-process/package.json +16 -0
- package/config/pi/extensions/compact-header/index.ts +69 -0
- package/config/pi/extensions/compact-header/package.json +16 -0
- package/config/pi/extensions/core/adapter.ts +52 -0
- package/config/pi/extensions/core/guard-rules.ts +102 -0
- package/config/pi/extensions/core/lib.ts +3 -0
- package/config/pi/extensions/core/logger.ts +45 -0
- package/config/pi/extensions/core/runner.ts +71 -0
- package/config/pi/extensions/core/session-state.ts +59 -0
- package/config/pi/extensions/custom-footer/index.ts +160 -0
- package/config/pi/extensions/custom-footer/package.json +16 -0
- package/config/pi/extensions/custom-provider-qwen-cli/index.ts +363 -0
- package/config/pi/extensions/custom-provider-qwen-cli/package.json +1 -0
- package/config/pi/extensions/git-checkpoint/index.ts +53 -0
- package/config/pi/extensions/git-checkpoint/package.json +16 -0
- package/config/pi/extensions/minimal-mode/index.ts +201 -0
- package/config/pi/extensions/minimal-mode/package.json +16 -0
- package/config/pi/extensions/plan-mode/README.md +65 -0
- package/config/pi/extensions/plan-mode/index.ts +417 -0
- package/config/pi/extensions/plan-mode/package.json +12 -0
- package/config/pi/extensions/plan-mode/utils.ts +324 -0
- package/config/pi/extensions/quality-gates/index.ts +67 -0
- package/config/pi/extensions/quality-gates/package.json +16 -0
- package/config/pi/extensions/service-skills/index.ts +108 -0
- package/config/pi/extensions/service-skills/package.json +16 -0
- package/config/pi/extensions/session-flow/index.ts +131 -0
- package/config/pi/extensions/session-flow/package.json +16 -0
- package/config/pi/extensions/todo/index.ts +299 -0
- package/config/pi/extensions/todo/package.json +16 -0
- package/config/pi/extensions/xtrm-loader/index.ts +89 -0
- package/config/pi/extensions/xtrm-loader/package.json +16 -0
- package/config/pi/install-schema.json +44 -0
- package/config/pi/models.json.template +76 -0
- package/config/pi/pi-worktrees-settings.json +6 -0
- package/config/pi/settings.json.template +16 -0
- package/config/settings.json +70 -0
- package/hooks/README.md +75 -0
- package/hooks/agent_context.py +105 -0
- package/hooks/beads-claim-sync.mjs +166 -0
- package/hooks/beads-commit-gate.mjs +55 -0
- package/hooks/beads-compact-restore.mjs +69 -0
- package/hooks/beads-compact-save.mjs +51 -0
- package/hooks/beads-edit-gate.mjs +45 -0
- package/hooks/beads-gate-core.mjs +215 -0
- package/hooks/beads-gate-messages.mjs +87 -0
- package/hooks/beads-gate-utils.mjs +185 -0
- package/hooks/beads-memory-gate.mjs +61 -0
- package/hooks/beads-stop-gate.mjs +32 -0
- package/hooks/branch-state.mjs +39 -0
- package/hooks/gitnexus/gitnexus-hook.cjs +222 -0
- package/hooks/guard-rules.mjs +118 -0
- package/hooks/hooks.json +116 -0
- package/hooks/main-guard-post-push.mjs +71 -0
- package/hooks/main-guard.mjs +119 -0
- package/hooks/quality-check.cjs +1286 -0
- package/hooks/quality-check.py +345 -0
- package/hooks/serena-workflow-reminder.py +74 -0
- package/package.json +77 -0
- package/project-skills/quality-gates/.claude/hooks/hook-config.json +66 -0
- package/project-skills/quality-gates/.claude/hooks/quality-check.cjs +1286 -0
- package/project-skills/quality-gates/.claude/hooks/quality-check.py +334 -0
- package/project-skills/quality-gates/.claude/settings.json +3 -0
- package/project-skills/quality-gates/.claude/skills/using-quality-gates/SKILL.md +254 -0
- package/project-skills/quality-gates/README.md +109 -0
- package/project-skills/quality-gates/evals/evals.json +181 -0
- package/project-skills/quality-gates/workspace/iteration-1/FINAL-EVAL-SUMMARY.md +75 -0
- package/project-skills/quality-gates/workspace/iteration-1/edge-case-auto-fix-verification/with_skill/outputs/response.md +59 -0
- package/project-skills/quality-gates/workspace/iteration-1/edge-case-mixed-language-project/with_skill/outputs/response.md +60 -0
- package/project-skills/quality-gates/workspace/iteration-1/eval-summary.md +105 -0
- package/project-skills/quality-gates/workspace/iteration-1/partial-install-python-only/with_skill/outputs/response.md +93 -0
- package/project-skills/quality-gates/workspace/iteration-1/python-refactor-request/with_skill/outputs/response.md +104 -0
- package/project-skills/quality-gates/workspace/iteration-1/quality-gate-error-fix/with_skill/outputs/response.md +74 -0
- package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-general-chat/with_skill/outputs/response.md +18 -0
- package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-math-question/with_skill/outputs/response.md +18 -0
- package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-unrelated-coding/with_skill/outputs/response.md +56 -0
- package/project-skills/quality-gates/workspace/iteration-1/tdd-guard-blocking-confusion/with_skill/outputs/response.md +67 -0
- package/project-skills/quality-gates/workspace/iteration-1/typescript-feature-with-tests/with_skill/outputs/response.md +97 -0
- package/project-skills/service-skills-set/.claude/git-hooks/doc_reminder.py +67 -0
- package/project-skills/service-skills-set/.claude/git-hooks/skill_staleness.py +194 -0
- package/project-skills/service-skills-set/.claude/service-registry.json +4 -0
- package/project-skills/service-skills-set/.claude/settings.json +37 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/SKILL.md +433 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/script_quality_standards.md +425 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/service_skill_system_guide.md +278 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/bootstrap.py +308 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/deep_dive.py +304 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/scaffolder.py +482 -0
- package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/SKILL.md +231 -0
- package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/scripts/scope.py +74 -0
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/SKILL.md +136 -0
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/scripts/drift_detector.py +222 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/SKILL.md +108 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/cataloger.py +74 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/skill_activator.py +152 -0
- package/project-skills/service-skills-set/README.md +93 -0
- package/project-skills/service-skills-set/install-service-skills.py +193 -0
- package/project-skills/service-skills-set/service-skills-readme.md +236 -0
- package/skills/README.txt +31 -0
- package/skills/clean-code/SKILL.md +201 -0
- package/skills/creating-service-skills/SKILL.md +433 -0
- package/skills/creating-service-skills/references/script_quality_standards.md +425 -0
- package/skills/creating-service-skills/references/service_skill_system_guide.md +278 -0
- package/skills/creating-service-skills/scripts/bootstrap.py +326 -0
- package/skills/creating-service-skills/scripts/deep_dive.py +304 -0
- package/skills/creating-service-skills/scripts/scaffolder.py +482 -0
- package/skills/delegating/SKILL.md +196 -0
- package/skills/delegating/config.yaml +210 -0
- package/skills/delegating/references/orchestration-protocols.md +41 -0
- package/skills/docker-expert/SKILL.md +409 -0
- package/skills/documenting/CHANGELOG.md +23 -0
- package/skills/documenting/README.md +148 -0
- package/skills/documenting/SKILL.md +113 -0
- package/skills/documenting/examples/example_pattern.md +70 -0
- package/skills/documenting/examples/example_reference.md +70 -0
- package/skills/documenting/examples/example_ssot_analytics.md +64 -0
- package/skills/documenting/examples/example_workflow.md +141 -0
- package/skills/documenting/references/changelog-format.md +97 -0
- package/skills/documenting/references/metadata-schema.md +136 -0
- package/skills/documenting/references/taxonomy.md +81 -0
- package/skills/documenting/references/versioning-rules.md +78 -0
- package/skills/documenting/scripts/bump_version.sh +60 -0
- package/skills/documenting/scripts/changelog/__init__.py +0 -0
- package/skills/documenting/scripts/changelog/add_entry.py +216 -0
- package/skills/documenting/scripts/changelog/bump_release.py +117 -0
- package/skills/documenting/scripts/changelog/init_changelog.py +54 -0
- package/skills/documenting/scripts/changelog/validate_changelog.py +128 -0
- package/skills/documenting/scripts/drift_detector.py +266 -0
- package/skills/documenting/scripts/generate_template.py +311 -0
- package/skills/documenting/scripts/list_by_category.sh +84 -0
- package/skills/documenting/scripts/orchestrator.py +255 -0
- package/skills/documenting/scripts/validate_metadata.py +242 -0
- package/skills/documenting/templates/CHANGELOG.md.template +13 -0
- package/skills/find-skills/SKILL.md +133 -0
- package/skills/gitnexus-debugging/SKILL.md +85 -0
- package/skills/gitnexus-exploring/SKILL.md +75 -0
- package/skills/gitnexus-impact-analysis/SKILL.md +94 -0
- package/skills/gitnexus-refactoring/SKILL.md +113 -0
- package/skills/hook-development/SKILL.md +797 -0
- package/skills/hook-development/examples/load-context.sh +55 -0
- package/skills/hook-development/examples/quality-check.js +1168 -0
- package/skills/hook-development/examples/validate-bash.sh +43 -0
- package/skills/hook-development/examples/validate-write.sh +38 -0
- package/skills/hook-development/references/advanced.md +527 -0
- package/skills/hook-development/references/migration.md +369 -0
- package/skills/hook-development/references/patterns.md +412 -0
- package/skills/hook-development/scripts/README.md +164 -0
- package/skills/hook-development/scripts/hook-linter.sh +153 -0
- package/skills/hook-development/scripts/test-hook.sh +252 -0
- package/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
- package/skills/obsidian-cli/SKILL.md +106 -0
- package/skills/orchestrating-agents/SKILL.md +135 -0
- package/skills/orchestrating-agents/config.yaml +45 -0
- package/skills/orchestrating-agents/references/agent-context-integration.md +37 -0
- package/skills/orchestrating-agents/references/examples.md +45 -0
- package/skills/orchestrating-agents/references/handover-protocol.md +31 -0
- package/skills/orchestrating-agents/references/workflows.md +42 -0
- package/skills/orchestrating-agents/scripts/detect_neighbors.py +23 -0
- package/skills/prompt-improving/README.md +162 -0
- package/skills/prompt-improving/SKILL.md +74 -0
- package/skills/prompt-improving/references/analysis_commands.md +24 -0
- package/skills/prompt-improving/references/chain_of_thought.md +24 -0
- package/skills/prompt-improving/references/mcp_definitions.md +20 -0
- package/skills/prompt-improving/references/multishot.md +23 -0
- package/skills/prompt-improving/references/xml_core.md +60 -0
- package/skills/python-testing/SKILL.md +815 -0
- package/skills/scoping-service-skills/SKILL.md +231 -0
- package/skills/scoping-service-skills/scripts/scope.py +74 -0
- package/skills/senior-backend/SKILL.md +209 -0
- package/skills/senior-backend/references/api_design_patterns.md +103 -0
- package/skills/senior-backend/references/backend_security_practices.md +103 -0
- package/skills/senior-backend/references/database_optimization_guide.md +103 -0
- package/skills/senior-backend/scripts/api_load_tester.py +114 -0
- package/skills/senior-backend/scripts/api_scaffolder.py +114 -0
- package/skills/senior-backend/scripts/database_migration_tool.py +114 -0
- package/skills/senior-data-scientist/SKILL.md +226 -0
- package/skills/senior-data-scientist/references/experiment_design_frameworks.md +80 -0
- package/skills/senior-data-scientist/references/feature_engineering_patterns.md +80 -0
- package/skills/senior-data-scientist/references/statistical_methods_advanced.md +80 -0
- package/skills/senior-data-scientist/scripts/experiment_designer.py +100 -0
- package/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +100 -0
- package/skills/senior-data-scientist/scripts/model_evaluation_suite.py +100 -0
- package/skills/senior-devops/SKILL.md +209 -0
- package/skills/senior-devops/references/cicd_pipeline_guide.md +103 -0
- package/skills/senior-devops/references/deployment_strategies.md +103 -0
- package/skills/senior-devops/references/infrastructure_as_code.md +103 -0
- package/skills/senior-devops/scripts/deployment_manager.py +114 -0
- package/skills/senior-devops/scripts/pipeline_generator.py +114 -0
- package/skills/senior-devops/scripts/terraform_scaffolder.py +114 -0
- package/skills/senior-security/SKILL.md +209 -0
- package/skills/senior-security/references/cryptography_implementation.md +103 -0
- package/skills/senior-security/references/penetration_testing_guide.md +103 -0
- package/skills/senior-security/references/security_architecture_patterns.md +103 -0
- package/skills/senior-security/scripts/pentest_automator.py +114 -0
- package/skills/senior-security/scripts/security_auditor.py +114 -0
- package/skills/senior-security/scripts/threat_modeler.py +114 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +479 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +248 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +332 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/skills/sync-docs/SKILL.md +132 -0
- package/skills/sync-docs/evals/evals.json +89 -0
- package/skills/sync-docs/references/doc-structure.md +99 -0
- package/skills/sync-docs/references/schema.md +103 -0
- package/skills/sync-docs/scripts/changelog/add_entry.py +216 -0
- package/skills/sync-docs/scripts/context_gatherer.py +240 -0
- package/skills/sync-docs/scripts/doc_structure_analyzer.py +495 -0
- package/skills/sync-docs/scripts/drift_detector.py +327 -0
- package/skills/sync-docs/scripts/validate_doc.py +365 -0
- package/skills/sync-docs/scripts/validate_metadata.py +185 -0
- package/skills/sync-docs-workspace/iteration-1/benchmark.json +293 -0
- package/skills/sync-docs-workspace/iteration-1/benchmark.md +13 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/outputs/result.md +210 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/outputs/result.md +101 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/outputs/result.md +198 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/outputs/result.md +94 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/outputs/result.md +237 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/outputs/result.md +134 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/grading.json +28 -0
- package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-2/benchmark.json +297 -0
- package/skills/sync-docs-workspace/iteration-2/benchmark.md +13 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/outputs/result.md +137 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/grading.json +92 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/outputs/result.md +134 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/grading.json +86 -0
- package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/outputs/result.md +193 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/grading.json +72 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/outputs/result.md +211 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/grading.json +91 -0
- package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/outputs/result.md +182 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/outputs/result.md +222 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/grading.json +88 -0
- package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/benchmark.json +298 -0
- package/skills/sync-docs-workspace/iteration-3/benchmark.md +13 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/outputs/result.md +125 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/grading.json +97 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/outputs/result.md +144 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/grading.json +78 -0
- package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/outputs/result.md +104 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/grading.json +91 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/outputs/result.md +79 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/grading.json +82 -0
- package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/eval_metadata.json +27 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase1_context.json +302 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase2_drift.txt +33 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase3_analysis.json +114 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase4_fix.txt +118 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase5_validate.txt +38 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/result.md +158 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/timing.json +5 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/outputs/result.md +71 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/grading.json +90 -0
- package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
- package/skills/test-planning/SKILL.md +208 -0
- package/skills/test-planning/evals/evals.json +23 -0
- package/skills/updating-service-skills/SKILL.md +136 -0
- package/skills/updating-service-skills/scripts/drift_detector.py +222 -0
- package/skills/using-TDD/SKILL.md +410 -0
- package/skills/using-quality-gates/SKILL.md +254 -0
- package/skills/using-serena-lsp/README.md +8 -0
- package/skills/using-serena-lsp/REFERENCE.md +194 -0
- package/skills/using-serena-lsp/SKILL.md +82 -0
- package/skills/using-service-skills/SKILL.md +108 -0
- package/skills/using-service-skills/scripts/cataloger.py +74 -0
- package/skills/using-service-skills/scripts/skill_activator.py +152 -0
- package/skills/using-service-skills/scripts/test_skill_activator.py +58 -0
- package/skills/using-xtrm/SKILL.md +245 -0
- package/skills/xt-end/SKILL.md +128 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-quality-gates
|
|
3
|
+
description: 'Quality Gates workflow for Claude Code. Use when editing code in projects with quality enforcement. Covers the full cycle: TDD guard (write failing test first) → implement → auto-lint/typecheck. Activates on code edits, quality issues, or when user asks about testing/linting workflow.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using Quality Gates
|
|
7
|
+
|
|
8
|
+
**Quality Gates** provides automated code quality enforcement through PostToolUse hooks:
|
|
9
|
+
|
|
10
|
+
1. **TypeScript Quality Gate** — Runs after TS/JS edits: TypeScript + ESLint + Prettier
|
|
11
|
+
2. **Python Quality Gate** — Runs after Python edits: Ruff + Mypy
|
|
12
|
+
|
|
13
|
+
**Separate Installation Required for TDD:**
|
|
14
|
+
- **TDD Guard** is a separate tool (not included) — See "TDD Guard Setup" below
|
|
15
|
+
|
|
16
|
+
## Architecture Overview
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
20
|
+
│ QUALITY GATES (this skill) │
|
|
21
|
+
│ ───────────────────────────── │
|
|
22
|
+
│ PostToolUse Hooks (installed by this skill): │
|
|
23
|
+
│ • .claude/hooks/quality-check.cjs → TS/JS files │
|
|
24
|
+
│ • .claude/hooks/quality-check.py → Python files │
|
|
25
|
+
│ • .claude/settings.json → Hook registration │
|
|
26
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
27
|
+
|
|
28
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
29
|
+
│ TDD GUARD (separate installation) │
|
|
30
|
+
│ ─────────────────────────────────── │
|
|
31
|
+
│ PreToolUse Hook (requires xtrm install project tdd-guard): │
|
|
32
|
+
│ • Global CLI: npm install -g tdd-guard │
|
|
33
|
+
│ • Test reporter: tdd-guard-vitest / tdd-guard-pytest / etc. │
|
|
34
|
+
│ • Hook: .claude/hooks/tdd-guard-pretool-bridge.cjs │
|
|
35
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
### Step 1: Install This Skill
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
xtrm install project quality-gates
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This installs:
|
|
47
|
+
- `.claude/hooks/quality-check.cjs` — TypeScript/JavaScript checks
|
|
48
|
+
- `.claude/hooks/quality-check.py` — Python checks
|
|
49
|
+
- `.claude/settings.json` — PostToolUse hook registration
|
|
50
|
+
- `.claude/skills/using-quality-gates/` — This documentation
|
|
51
|
+
|
|
52
|
+
### Step 2: Install Language Dependencies
|
|
53
|
+
|
|
54
|
+
**TypeScript Projects:**
|
|
55
|
+
```bash
|
|
56
|
+
npm install --save-dev typescript eslint prettier
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Python Projects:**
|
|
60
|
+
```bash
|
|
61
|
+
pip install ruff mypy
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 3: (Optional) Install TDD Guard
|
|
65
|
+
|
|
66
|
+
For test-first enforcement, install TDD Guard separately:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 1. Install global CLI
|
|
70
|
+
npm install -g tdd-guard
|
|
71
|
+
|
|
72
|
+
# 2. Install project-skill for hook wiring
|
|
73
|
+
xtrm install project tdd-guard
|
|
74
|
+
|
|
75
|
+
# 3. Install test reporter (choose one)
|
|
76
|
+
npm install --save-dev tdd-guard-vitest # Vitest
|
|
77
|
+
npm install --save-dev tdd-guard-jest # Jest
|
|
78
|
+
pip install tdd-guard-pytest # pytest
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Configure test reporter** (see https://github.com/nizos/tdd-guard):
|
|
82
|
+
|
|
83
|
+
**Vitest:**
|
|
84
|
+
```typescript
|
|
85
|
+
// vitest.config.ts
|
|
86
|
+
import { defineConfig } from 'vitest/config'
|
|
87
|
+
import { VitestReporter } from 'tdd-guard-vitest'
|
|
88
|
+
|
|
89
|
+
export default defineConfig({
|
|
90
|
+
test: {
|
|
91
|
+
reporters: ['default', new VitestReporter('/path/to/project')],
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**pytest:**
|
|
97
|
+
```toml
|
|
98
|
+
# pyproject.toml
|
|
99
|
+
[tool.pytest.ini_options]
|
|
100
|
+
tdd_guard_project_root = "/path/to/project"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## How Quality Gates Work
|
|
104
|
+
|
|
105
|
+
### TypeScript Quality Gate (PostToolUse)
|
|
106
|
+
|
|
107
|
+
**Runs after:** Every `.ts`, `.tsx`, `.js`, `.jsx` file edit
|
|
108
|
+
|
|
109
|
+
**Checks:**
|
|
110
|
+
1. TypeScript compilation (type errors)
|
|
111
|
+
2. ESLint validation (style, best practices)
|
|
112
|
+
3. Prettier formatting (consistency)
|
|
113
|
+
|
|
114
|
+
**Configuration** (`.claude/hooks/hook-config.json`):
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"typescript": { "enabled": true, "showDependencyErrors": false },
|
|
118
|
+
"eslint": { "enabled": true, "autofix": true },
|
|
119
|
+
"prettier": { "enabled": true, "autofix": true },
|
|
120
|
+
"general": { "autofixSilent": true }
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Python Quality Gate (PostToolUse)
|
|
125
|
+
|
|
126
|
+
**Runs after:** Every `.py` file edit
|
|
127
|
+
|
|
128
|
+
**Checks:**
|
|
129
|
+
1. Ruff linting (errors, style, best practices)
|
|
130
|
+
2. Ruff formatting (Black-compatible)
|
|
131
|
+
3. Mypy type checking (static types)
|
|
132
|
+
|
|
133
|
+
**Configuration** (environment variables):
|
|
134
|
+
```bash
|
|
135
|
+
CLAUDE_HOOKS_RUFF_ENABLED=true
|
|
136
|
+
CLAUDE_HOOKS_MYPY_ENABLED=true
|
|
137
|
+
CLAUDE_HOOKS_AUTOFIX=true
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Exit Codes
|
|
141
|
+
|
|
142
|
+
| Code | Meaning | Action |
|
|
143
|
+
|------|---------|--------|
|
|
144
|
+
| 0 | All checks passed | Continue |
|
|
145
|
+
| 1 | Fatal error (missing deps) | Install missing tool |
|
|
146
|
+
| 2 | Blocking errors | Claude must fix |
|
|
147
|
+
|
|
148
|
+
## Handling Quality Gate Errors
|
|
149
|
+
|
|
150
|
+
When blocked with exit code 2:
|
|
151
|
+
|
|
152
|
+
1. **Read the error output** — Specific issues listed
|
|
153
|
+
2. **Auto-fix applies automatically** — ESLint/Prettier/Ruff fix what they can
|
|
154
|
+
3. **Fix remaining issues manually** — Type errors, complex violations
|
|
155
|
+
4. **Gate re-runs on next edit** — No manual trigger needed
|
|
156
|
+
|
|
157
|
+
**Example:**
|
|
158
|
+
```
|
|
159
|
+
[ERROR] TypeScript compilation failed:
|
|
160
|
+
src/auth.ts:42:5 - error TS2322: Type 'string' is not assignable to type 'number'
|
|
161
|
+
|
|
162
|
+
[WARN] Auto-fix applied: 2 issues fixed
|
|
163
|
+
[BLOCK] 1 issue remains - fix before continuing
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## TDD Guard Integration
|
|
167
|
+
|
|
168
|
+
When TDD Guard is installed alongside Quality Gates:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
User Request: "Add feature X"
|
|
172
|
+
↓
|
|
173
|
+
┌───────────────────────────────────┐
|
|
174
|
+
│ TDD Guard (PreToolUse) │
|
|
175
|
+
│ Checks: Failing test exists? │
|
|
176
|
+
│ • NO → BLOCK: "Write test first" │
|
|
177
|
+
│ • YES → Allow implementation │
|
|
178
|
+
└───────────────────────────────────┘
|
|
179
|
+
↓
|
|
180
|
+
Implementation (Write/Edit)
|
|
181
|
+
↓
|
|
182
|
+
┌───────────────────────────────────┐
|
|
183
|
+
│ Quality Gates (PostToolUse) │
|
|
184
|
+
│ Runs: Lint + Typecheck + Format │
|
|
185
|
+
│ • Errors → BLOCK, fix issues │
|
|
186
|
+
│ • Pass → Continue │
|
|
187
|
+
└───────────────────────────────────┘
|
|
188
|
+
↓
|
|
189
|
+
Tests pass → Commit
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Troubleshooting
|
|
193
|
+
|
|
194
|
+
**"ESLint not found" / "Prettier not found"**
|
|
195
|
+
```bash
|
|
196
|
+
npm install --save-dev eslint prettier
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**"Ruff not found" / "Mypy not found"**
|
|
200
|
+
```bash
|
|
201
|
+
pip install ruff mypy
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**"tdd-guard: command not found"**
|
|
205
|
+
```bash
|
|
206
|
+
npm install -g tdd-guard
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**"TDD Guard: No failing test found"**
|
|
210
|
+
- Write a failing test first
|
|
211
|
+
- Ensure test reporter is configured
|
|
212
|
+
- Run tests to generate reporter JSON
|
|
213
|
+
|
|
214
|
+
**Hook not running**
|
|
215
|
+
- Verify `.claude/settings.json` exists
|
|
216
|
+
- Check hook script paths are correct
|
|
217
|
+
- Ensure file extension matches (`.ts`/`.py`)
|
|
218
|
+
|
|
219
|
+
## When This Skill Activates
|
|
220
|
+
|
|
221
|
+
**Triggers:**
|
|
222
|
+
- Quality gate reports errors
|
|
223
|
+
- User asks about linting, type checking, or quality workflow
|
|
224
|
+
- Session starts in a project with quality gates installed
|
|
225
|
+
|
|
226
|
+
**Response Modes:**
|
|
227
|
+
|
|
228
|
+
**Full Workflow Mode** (user mentions quality/testing, blocked by gate errors):
|
|
229
|
+
- Explain complete quality pipeline
|
|
230
|
+
- Provide troubleshooting guidance
|
|
231
|
+
|
|
232
|
+
**Minimal Mode** (general coding tasks without quality context):
|
|
233
|
+
- Complete the task directly
|
|
234
|
+
- Brief note: "Consider adding tests. If TDD Guard is installed, write failing test first."
|
|
235
|
+
|
|
236
|
+
## Files Installed
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
.claude/
|
|
240
|
+
├── settings.json # PostToolUse hook registration
|
|
241
|
+
├── hooks/
|
|
242
|
+
│ ├── quality-check.cjs # TypeScript/JavaScript checks
|
|
243
|
+
│ ├── quality-check.py # Python checks
|
|
244
|
+
│ └── hook-config.json # TS hook configuration
|
|
245
|
+
├── skills/
|
|
246
|
+
│ └── using-quality-gates/ # This skill
|
|
247
|
+
└── docs/
|
|
248
|
+
└── quality-gates-readme.md
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Related
|
|
252
|
+
|
|
253
|
+
- **TDD Guard**: https://github.com/nizos/tdd-guard
|
|
254
|
+
- **xtrm install project tdd-guard**: Install TDD Guard hooks
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Serena Tool Reference
|
|
2
|
+
|
|
3
|
+
Detailed documentation for Serena MCP semantic tools.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
- [1. Exploration & Navigation](#1-exploration--navigation-tools)
|
|
7
|
+
- [2. Editing Tools](#2-editing-tools)
|
|
8
|
+
- [3. Memory Management](#3-memory-management-tools)
|
|
9
|
+
- [4. Meta & Thinking](#4-meta--thinking-tools)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Exploration & Navigation Tools
|
|
14
|
+
|
|
15
|
+
### `list_dir`
|
|
16
|
+
List files and directories with optional recursion.
|
|
17
|
+
```python
|
|
18
|
+
mcp__serena__list_dir(
|
|
19
|
+
relative_path=".", # or "src/analysis"
|
|
20
|
+
recursive=true,
|
|
21
|
+
skip_ignored_files=true
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### `find_file`
|
|
26
|
+
Find files by name pattern (wildcards supported).
|
|
27
|
+
```python
|
|
28
|
+
mcp__serena__find_file(
|
|
29
|
+
file_mask="*volatility*.py",
|
|
30
|
+
relative_path="scripts"
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### `get_symbols_overview`
|
|
35
|
+
Get high-level code structure (symbol tree) without reading the file body.
|
|
36
|
+
```python
|
|
37
|
+
mcp__serena__get_symbols_overview(
|
|
38
|
+
relative_path="scripts/core/analytics.py",
|
|
39
|
+
depth=1 # 0=top-level, 1=include children (methods)
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `find_symbol`
|
|
44
|
+
Locate specific symbols (functions, classes, methods) semantically.
|
|
45
|
+
```python
|
|
46
|
+
mcp__serena__find_symbol(
|
|
47
|
+
name_path_pattern="VolatilityCalculator/analyze_rv_trend",
|
|
48
|
+
relative_path="scripts/core/volatility_suite.py",
|
|
49
|
+
depth=1,
|
|
50
|
+
include_body=true, # Set true only when needing source code
|
|
51
|
+
substring_matching=true,
|
|
52
|
+
include_kinds=[5, 6, 12] # 5=Class, 6=Method, 12=Function
|
|
53
|
+
)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**LSP Symbol Kinds Reference**:
|
|
57
|
+
```
|
|
58
|
+
1=file, 2=module, 3=namespace, 4=package, 5=class, 6=method,
|
|
59
|
+
7=property, 8=field, 9=constructor, 10=enum, 11=interface,
|
|
60
|
+
12=function, 13=variable, 14=constant, 15=string, 16=number,
|
|
61
|
+
17=boolean, 18=array, 19=object, 20=key, 21=null,
|
|
62
|
+
22=enum member, 23=struct, 24=event, 25=operator, 26=type parameter
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `find_referencing_symbols`
|
|
66
|
+
Find all places that reference a symbol. Essential before editing.
|
|
67
|
+
```python
|
|
68
|
+
mcp__serena__find_referencing_symbols(
|
|
69
|
+
name_path="calculate_volatility",
|
|
70
|
+
relative_path="scripts/core/analytics.py"
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `search_for_pattern`
|
|
75
|
+
Flexible regex/substring search in code.
|
|
76
|
+
```python
|
|
77
|
+
mcp__serena__search_for_pattern(
|
|
78
|
+
substring_pattern="def.*volatility", # Regex (DOTALL enabled)
|
|
79
|
+
relative_path="scripts/core",
|
|
80
|
+
restrict_search_to_code_files=true,
|
|
81
|
+
context_lines_before=2,
|
|
82
|
+
context_lines_after=2
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 2. Editing Tools
|
|
89
|
+
|
|
90
|
+
### `replace_symbol_body`
|
|
91
|
+
Replace entire symbol definition atomically.
|
|
92
|
+
```python
|
|
93
|
+
mcp__serena__replace_symbol_body(
|
|
94
|
+
name_path="get_db_engine",
|
|
95
|
+
relative_path="scripts/core/volatility_suite.py",
|
|
96
|
+
body="def get_db_engine(): ..."
|
|
97
|
+
)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### `insert_after_symbol`
|
|
101
|
+
Insert code after a symbol's definition ends.
|
|
102
|
+
```python
|
|
103
|
+
mcp__serena__insert_after_symbol(
|
|
104
|
+
name_path="VolatilityCalculator",
|
|
105
|
+
relative_path="scripts/core/analytics.py",
|
|
106
|
+
body="
|
|
107
|
+
|
|
108
|
+
class RiskCalculator: ..."
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `insert_before_symbol`
|
|
113
|
+
Insert code before a symbol's definition starts (e.g., imports).
|
|
114
|
+
```python
|
|
115
|
+
mcp__serena__insert_before_symbol(
|
|
116
|
+
name_path="VolatilityCalculator",
|
|
117
|
+
relative_path="scripts/core/analytics.py",
|
|
118
|
+
body="from typing import Protocol
|
|
119
|
+
|
|
120
|
+
"
|
|
121
|
+
)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `rename_symbol`
|
|
125
|
+
Rename symbol across entire codebase using LSP.
|
|
126
|
+
```python
|
|
127
|
+
mcp__serena__rename_symbol(
|
|
128
|
+
name_path="calculate_volatility",
|
|
129
|
+
relative_path="scripts/core/analytics.py",
|
|
130
|
+
new_name="compute_volatility"
|
|
131
|
+
)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 3. Memory Management Tools
|
|
137
|
+
|
|
138
|
+
### `write_memory`
|
|
139
|
+
Store project decisions, patterns, architecture notes.
|
|
140
|
+
```python
|
|
141
|
+
mcp__serena__write_memory(
|
|
142
|
+
memory_file_name="architecture_decision_auth",
|
|
143
|
+
content="# Auth Pattern
|
|
144
|
+
..."
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### `read_memory`
|
|
149
|
+
Retrieve stored project knowledge.
|
|
150
|
+
```python
|
|
151
|
+
mcp__serena__read_memory(memory_file_name="architecture_decision_auth")
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### `list_memories`
|
|
155
|
+
Discover available project knowledge.
|
|
156
|
+
```python
|
|
157
|
+
mcp__serena__list_memories()
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `edit_memory`
|
|
161
|
+
Update existing memory files.
|
|
162
|
+
```python
|
|
163
|
+
mcp__serena__edit_memory(
|
|
164
|
+
memory_file_name="architecture_decision_auth",
|
|
165
|
+
mode="regex",
|
|
166
|
+
needle="Old",
|
|
167
|
+
repl="New"
|
|
168
|
+
)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `delete_memory`
|
|
172
|
+
Remove obsolete memory files.
|
|
173
|
+
```python
|
|
174
|
+
mcp__serena__delete_memory(memory_file_name="deprecated_pattern")
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 4. Meta & Thinking Tools
|
|
180
|
+
|
|
181
|
+
### `check_onboarding_performed`
|
|
182
|
+
Check if project onboarding was completed.
|
|
183
|
+
|
|
184
|
+
### `onboarding`
|
|
185
|
+
Get instructions for project onboarding.
|
|
186
|
+
|
|
187
|
+
### `think_about_collected_information`
|
|
188
|
+
Reflect after exploration/search operations.
|
|
189
|
+
|
|
190
|
+
### `think_about_task_adherence`
|
|
191
|
+
Verify you're still on track for the task.
|
|
192
|
+
|
|
193
|
+
### `think_about_whether_you_are_done`
|
|
194
|
+
Assess task completion.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-serena-lsp
|
|
3
|
+
description: Explores and edits code using semantic tools and LSP plugins. Use when reading code, understanding structure, finding symbols, or performing surgical edits to functions and classes.
|
|
4
|
+
allowed-tools: mcp__serena__*, Read, Edit, Bash
|
|
5
|
+
priority: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Using Serena LSP Workflow
|
|
9
|
+
|
|
10
|
+
**Core Principle**: Use semantic, symbol-level access to understand and edit code without reading entire files. Combine with LSP plugins for real-time analysis.
|
|
11
|
+
|
|
12
|
+
## Tools Reference
|
|
13
|
+
|
|
14
|
+
**Full Tool Documentation**: See [REFERENCE.md](REFERENCE.md)
|
|
15
|
+
|
|
16
|
+
| Tool | Purpose |
|
|
17
|
+
|------|---------|
|
|
18
|
+
| `get_symbols_overview` | **Start here.** See high-level structure of a file. |
|
|
19
|
+
| `find_symbol` | Read specific functions/classes (set `include_body=true`). |
|
|
20
|
+
| `find_referencing_symbols` | Find usages before editing. |
|
|
21
|
+
| `replace_symbol_body` | Surgically replace a function/class. |
|
|
22
|
+
| `insert_after_symbol` | Add new code after an existing symbol. |
|
|
23
|
+
| `search_for_pattern` | Regex search when symbol names are unknown. |
|
|
24
|
+
|
|
25
|
+
## Standard Workflows
|
|
26
|
+
|
|
27
|
+
**🚨 MANDATORY FIRST STEP FOR ALL WORKFLOWS:**
|
|
28
|
+
|
|
29
|
+
Before using ANY Serena semantic tools (`get_symbols_overview`, `find_symbol`, `replace_symbol_body`, etc.), you MUST activate the project:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
mcp__plugin_serena_serena__activate_project({ project: "/path/to/current/working/directory" })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Why this is critical**: Without project activation, Serena cannot locate code symbols and will fail or loop indefinitely. This step establishes the working context for all symbolic operations.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### 1. Explore Code (The "Overview First" Pattern)
|
|
40
|
+
|
|
41
|
+
Avoid reading full files >300 LOC.
|
|
42
|
+
|
|
43
|
+
1. **Activate Project**: `mcp__plugin_serena_serena__activate_project()`
|
|
44
|
+
2. **Understand Structure**: `get_symbols_overview(depth=1)`
|
|
45
|
+
3. **Drill Down**: `find_symbol(name_path="...", include_body=true)`
|
|
46
|
+
4. **Reflect**: `think_about_collected_information()`
|
|
47
|
+
|
|
48
|
+
### 2. Surgical Editing
|
|
49
|
+
|
|
50
|
+
1. **Activate Project**: `mcp__plugin_serena_serena__activate_project()` (if not already done)
|
|
51
|
+
2. **Locate**: `find_symbol(include_body=true)` to get current code.
|
|
52
|
+
3. **Check Impact**: `find_referencing_symbols()` to find usages.
|
|
53
|
+
4. **Edit**: `replace_symbol_body(...)` to update.
|
|
54
|
+
5. **Verify**: Run tests or syntax checks (e.g., `python -m py_compile`).
|
|
55
|
+
|
|
56
|
+
### 3. Adding Features
|
|
57
|
+
|
|
58
|
+
1. **Activate Project**: `mcp__plugin_serena_serena__activate_project()` (if not already done)
|
|
59
|
+
2. **Context**: `read_memory()` or `get_symbols_overview()` to understand patterns.
|
|
60
|
+
3. **Locate Anchor**: `find_symbol()` to find where to insert.
|
|
61
|
+
4. **Insert**: `insert_after_symbol(...)` to add new class/function.
|
|
62
|
+
|
|
63
|
+
## File Size Guidelines
|
|
64
|
+
|
|
65
|
+
| Lines of Code | Recommended Approach |
|
|
66
|
+
|---------------|----------------------|
|
|
67
|
+
| < 100 LOC | `Read` is acceptable. |
|
|
68
|
+
| 100-300 LOC | `get_symbols_overview` → `find_symbol`. |
|
|
69
|
+
| > 300 LOC | **Semantic only.** Do not read full file. |
|
|
70
|
+
|
|
71
|
+
## Quick Tips
|
|
72
|
+
|
|
73
|
+
* **LSP Integration**: `Read()` on a Python file automatically triggers Pyright analysis. Use the feedback to fix type errors surgically.
|
|
74
|
+
* **Symbol Names**: Use `substring_matching=true` if you aren't sure of the exact name.
|
|
75
|
+
* **Safety**: Always find references before renaming or changing signatures.
|
|
76
|
+
|
|
77
|
+
## ⚠️ Critical Constraints
|
|
78
|
+
|
|
79
|
+
1. **NEVER skip project activation** - It must be the first Serena operation in any workflow
|
|
80
|
+
2. **Use the current working directory** - Pass the actual project path, not a placeholder
|
|
81
|
+
3. **Activate once per session** - After activation, all subsequent Serena tools will work correctly
|
|
82
|
+
4. **Check activation status** - If Serena tools fail with "symbol not found" errors, you likely forgot to activate
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-service-skills
|
|
3
|
+
description: >-
|
|
4
|
+
Service catalog discovery and expert persona activation.
|
|
5
|
+
At session start, a catalog of registered expert personas is injected
|
|
6
|
+
automatically. Use this skill to discover, understand, and activate
|
|
7
|
+
the right expert for any task.
|
|
8
|
+
allowed-tools: Read, Glob
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Using Service Skills
|
|
12
|
+
|
|
13
|
+
## Role: The Concierge
|
|
14
|
+
|
|
15
|
+
You are the **Service Skills Concierge**. Your job is to help users discover and
|
|
16
|
+
activate expert personas registered in `.claude/skills/service-registry.json`.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## How the Catalog Works
|
|
21
|
+
|
|
22
|
+
At session start, the `SessionStart` hook (configured in `.claude/settings.json`)
|
|
23
|
+
runs `cataloger.py` and injects a lightweight XML block into your context:
|
|
24
|
+
|
|
25
|
+
```xml
|
|
26
|
+
<project_service_catalog>
|
|
27
|
+
Available expert personas:
|
|
28
|
+
- db-expert: SQL & schema optimization (Path: .claude/skills/db-expert/SKILL.md)
|
|
29
|
+
- auth-service: JWT authentication expert (Path: .claude/skills/auth-service/SKILL.md)
|
|
30
|
+
</project_service_catalog>
|
|
31
|
+
<instruction>To activate an expert, read its SKILL.md from the provided path.</instruction>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This costs ~150 tokens per session regardless of how many experts are registered
|
|
35
|
+
(Progressive Disclosure: full skill bodies are loaded only when needed).
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
### 1. Check the Injected Catalog
|
|
42
|
+
|
|
43
|
+
When a user asks about a service or starts a related task, check whether a
|
|
44
|
+
`<project_service_catalog>` block is present in your context.
|
|
45
|
+
|
|
46
|
+
If no catalog was injected (e.g. first run, no services registered), generate one:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
python3 "$CLAUDE_PROJECT_DIR/.claude/skills/using-service-skills/scripts/cataloger.py"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Activate an Expert Persona
|
|
53
|
+
|
|
54
|
+
When a task matches an expert's domain, read that skill's SKILL.md:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Read: .claude/skills/<service-id>/SKILL.md
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then adopt the expert's persona, constraints, and knowledge for the duration
|
|
61
|
+
of the task.
|
|
62
|
+
|
|
63
|
+
**Example:**
|
|
64
|
+
```
|
|
65
|
+
User: "Optimize this database query"
|
|
66
|
+
You: [Catalog shows db-expert matches]
|
|
67
|
+
[Read .claude/skills/db-expert/SKILL.md]
|
|
68
|
+
[Apply Senior Database Engineer persona and expertise]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Handle Missing Experts
|
|
72
|
+
|
|
73
|
+
If no registered expert covers the user's need:
|
|
74
|
+
1. Inform the user no expert exists for this domain
|
|
75
|
+
2. Offer to create one: "I can create a service skill using `/creating-service-skills`"
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Session Start Hook
|
|
80
|
+
|
|
81
|
+
The catalog injection is not handled by skill frontmatter hooks. Configure it in
|
|
82
|
+
`.claude/settings.json` using `SessionStart`:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"hooks": {
|
|
87
|
+
"SessionStart": [{
|
|
88
|
+
"hooks": [{
|
|
89
|
+
"type": "command",
|
|
90
|
+
"command": "python3 \"$CLAUDE_PROJECT_DIR/.claude/skills/using-service-skills/scripts/cataloger.py\""
|
|
91
|
+
}]
|
|
92
|
+
}]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Tool Restrictions
|
|
100
|
+
|
|
101
|
+
Read-only — no write access:
|
|
102
|
+
- ✅ `Read` — read SKILL.md files to activate expert personas
|
|
103
|
+
- ✅ `Glob` — browse `.claude/skills/` directory
|
|
104
|
+
|
|
105
|
+
## Related Skills
|
|
106
|
+
|
|
107
|
+
- `/creating-service-skills` — Scaffold new expert personas
|
|
108
|
+
- `/updating-service-skills` — Sync skills when implementation drifts
|