leniu-dev 2.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/.claude/agents/auto-test-generator.md +315 -0
- package/.claude/agents/bug-analyzer.md +103 -0
- package/.claude/agents/code-reviewer.md +122 -0
- package/.claude/agents/code-scanner.md +145 -0
- package/.claude/agents/image-reader.md +154 -0
- package/.claude/agents/loki-runner.md +80 -0
- package/.claude/agents/mysql-runner.md +81 -0
- package/.claude/agents/project-manager.md +159 -0
- package/.claude/agents/requirements-analyzer.md +175 -0
- package/.claude/agents/task-fetcher.md +75 -0
- package/.claude/audio/completed.wav +0 -0
- package/.claude/commands/add-todo.md +255 -0
- package/.claude/commands/auto-test.md +252 -0
- package/.claude/commands/check.md +210 -0
- package/.claude/commands/crud.md +454 -0
- package/.claude/commands/dev.md +532 -0
- package/.claude/commands/init-config.md +154 -0
- package/.claude/commands/init-docs.md +681 -0
- package/.claude/commands/next.md +281 -0
- package/.claude/commands/opsx-apply.md +147 -0
- package/.claude/commands/opsx-archive.md +105 -0
- package/.claude/commands/opsx-bulk-archive.md +237 -0
- package/.claude/commands/opsx-continue.md +109 -0
- package/.claude/commands/opsx-explore.md +281 -0
- package/.claude/commands/opsx-ff.md +92 -0
- package/.claude/commands/opsx-new.md +65 -0
- package/.claude/commands/opsx-onboard.md +397 -0
- package/.claude/commands/opsx-sync.md +129 -0
- package/.claude/commands/opsx-verify.md +159 -0
- package/.claude/commands/progress.md +264 -0
- package/.claude/commands/release.md +109 -0
- package/.claude/commands/start.md +199 -0
- package/.claude/commands/sync.md +307 -0
- package/.claude/commands/update-status.md +428 -0
- package/.claude/docs/Mixin/344/275/277/347/224/250/346/214/207/345/215/227.md +299 -0
- package/.claude/docs/README.md +167 -0
- package/.claude/docs//345/211/215/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +599 -0
- package/.claude/docs//345/220/216/347/253/257/345/274/200/345/217/221/346/214/207/345/215/227.md +726 -0
- package/.claude/docs//345/267/245/344/275/234/346/265/201/345/274/200/345/217/221/346/214/207/345/215/227.md +714 -0
- package/.claude/docs//345/267/245/345/205/267/347/261/273/344/275/277/347/224/250/346/214/207/345/215/227.md +463 -0
- package/.claude/docs//346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/350/247/204/350/214/203.md +390 -0
- package/.claude/docs//346/226/260/345/212/237/350/203/275/345/274/200/345/217/221/346/265/201/347/250/213/350/247/204/350/214/203.md +688 -0
- package/.claude/docs//346/226/260/351/241/271/347/233/256/345/274/200/345/217/221/346/265/201/347/250/213.md +365 -0
- package/.claude/docs//346/241/206/346/236/266/350/257/264/346/230/216.md +393 -0
- package/.claude/docs//350/267/257/347/224/261/351/205/215/347/275/256/346/214/207/345/215/227.md +246 -0
- package/.claude/framework-config.json +73 -0
- package/.claude/hooks/lib/notify.js +310 -0
- package/.claude/hooks/pre-tool-use.js +117 -0
- package/.claude/hooks/skill-forced-eval.js +161 -0
- package/.claude/hooks/stop.js +55 -0
- package/.claude/notify-config.json +9 -0
- package/.claude/settings.json +57 -0
- package/.claude/skills/add-skill/SKILL.md +488 -0
- package/.claude/skills/analyze-requirements/SKILL.md +112 -0
- package/.claude/skills/api-development/SKILL.md +315 -0
- package/.claude/skills/architecture-design/SKILL.md +152 -0
- package/.claude/skills/auto-test/SKILL.md +625 -0
- package/.claude/skills/auto-test/references/api-conventions.md +260 -0
- package/.claude/skills/backend-annotations/SKILL.md +248 -0
- package/.claude/skills/banana-image/CHANGELOG.md +37 -0
- package/.claude/skills/banana-image/README.md +146 -0
- package/.claude/skills/banana-image/SKILL.md +171 -0
- package/.claude/skills/banana-image/assets/logo.png +0 -0
- package/.claude/skills/banana-image/references/advanced-usage.md +189 -0
- package/.claude/skills/banana-image/scripts/apply_template.py +125 -0
- package/.claude/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.claude/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.claude/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.claude/skills/banana-image/scripts/package.json +18 -0
- package/.claude/skills/banana-image/scripts/requirements.txt +10 -0
- package/.claude/skills/banana-image/templates/poster.json +22 -0
- package/.claude/skills/banana-image/templates/product.json +17 -0
- package/.claude/skills/banana-image/templates/social.json +22 -0
- package/.claude/skills/banana-image/templates/thumbnail.json +17 -0
- package/.claude/skills/brainstorm/SKILL.md +216 -0
- package/.claude/skills/bug-detective/SKILL.md +295 -0
- package/.claude/skills/bug-detective/references/error-patterns.md +242 -0
- package/.claude/skills/chrome-cdp/SKILL.md +81 -0
- package/.claude/skills/chrome-cdp/scripts/cdp.mjs +838 -0
- package/.claude/skills/chrome-cdp/scripts/run-cdp.sh +7 -0
- package/.claude/skills/code-patterns/SKILL.md +163 -0
- package/.claude/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.claude/skills/codex-code-review/SKILL.md +327 -0
- package/.claude/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.claude/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.claude/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.claude/skills/crud-development/SKILL.md +328 -0
- package/.claude/skills/data-permission/SKILL.md +221 -0
- package/.claude/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.claude/skills/database-ops/SKILL.md +210 -0
- package/.claude/skills/error-handler/SKILL.md +310 -0
- package/.claude/skills/file-oss-management/SKILL.md +260 -0
- package/.claude/skills/file-oss-management/references/entities.md +105 -0
- package/.claude/skills/file-oss-management/references/service-impl.md +104 -0
- package/.claude/skills/fix-bug/SKILL.md +269 -0
- package/.claude/skills/git-workflow/SKILL.md +179 -0
- package/.claude/skills/jenkins-deploy/SKILL.md +134 -0
- package/.claude/skills/jenkins-deploy/assets/env_param.template.json +51 -0
- package/.claude/skills/jenkins-deploy/assets/jk_build.py +400 -0
- package/.claude/skills/json-serialization/SKILL.md +341 -0
- package/.claude/skills/lanhu-design/SKILL.md +99 -0
- package/.claude/skills/leniu-api-development/SKILL.md +319 -0
- package/.claude/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.claude/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.claude/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.claude/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.claude/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +404 -0
- package/.claude/skills/leniu-crud-development/references/templates.md +597 -0
- package/.claude/skills/leniu-customization-location/SKILL.md +410 -0
- package/.claude/skills/leniu-data-permission/SKILL.md +341 -0
- package/.claude/skills/leniu-database-ops/SKILL.md +426 -0
- package/.claude/skills/leniu-error-handler/SKILL.md +462 -0
- package/.claude/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +237 -0
- package/.claude/skills/leniu-java-entity/references/templates.md +237 -0
- package/.claude/skills/leniu-java-logging/SKILL.md +229 -0
- package/.claude/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.claude/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.claude/skills/leniu-java-mq/SKILL.md +338 -0
- package/.claude/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.claude/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.claude/skills/leniu-java-task/SKILL.md +367 -0
- package/.claude/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.claude/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.claude/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.claude/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.claude/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.claude/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.claude/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.claude/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.claude/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.claude/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.claude/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.claude/skills/leniu-report-scenario/references/export.md +553 -0
- package/.claude/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.claude/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.claude/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.claude/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.claude/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.claude/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +306 -0
- package/.claude/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.claude/skills/loki-log-query/SKILL.md +430 -0
- package/.claude/skills/mysql-debug/SKILL.md +406 -0
- package/.claude/skills/performance-doctor/SKILL.md +297 -0
- package/.claude/skills/project-navigator/SKILL.md +211 -0
- package/.claude/skills/redis-cache/SKILL.md +282 -0
- package/.claude/skills/redis-cache/references/listeners.md +23 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +277 -0
- package/.claude/skills/security-guard/SKILL.md +245 -0
- package/.claude/skills/security-guard/references/encrypt-config.md +103 -0
- package/.claude/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.claude/skills/sms-mail/SKILL.md +346 -0
- package/.claude/skills/sms-mail/references/mail-config.md +88 -0
- package/.claude/skills/sms-mail/references/sms-config.md +74 -0
- package/.claude/skills/social-login/SKILL.md +328 -0
- package/.claude/skills/social-login/references/provider-configs.md +118 -0
- package/.claude/skills/store-pc/SKILL.md +366 -0
- package/.claude/skills/sync-back-merge/SKILL.md +66 -0
- package/.claude/skills/task-tracker/SKILL.md +307 -0
- package/.claude/skills/tech-decision/SKILL.md +393 -0
- package/.claude/skills/tenant-management/SKILL.md +272 -0
- package/.claude/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.claude/skills/test-development/SKILL.md +301 -0
- package/.claude/skills/test-development/references/parameterized-examples.md +119 -0
- package/.claude/skills/ui-pc/SKILL.md +438 -0
- package/.claude/skills/utils-toolkit/SKILL.md +354 -0
- package/.claude/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.claude/skills/websocket-sse/SKILL.md +350 -0
- package/.claude/skills/workflow-engine/SKILL.md +249 -0
- package/.claude/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.claude/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.claude/templates/env-config.md +27 -0
- package/.claude/templates//345/276/205/345/212/236/346/270/205/345/215/225/346/250/241/346/235/277.md +56 -0
- package/.claude/templates//351/234/200/346/261/202/346/226/207/346/241/243/346/250/241/346/235/277.md +85 -0
- package/.claude/templates//351/241/271/347/233/256/347/212/266/346/200/201/346/250/241/346/235/277.md +43 -0
- package/.codex/skills/add-skill/SKILL.md +488 -0
- package/.codex/skills/add-todo/SKILL.md +269 -0
- package/.codex/skills/analyze-requirements/SKILL.md +112 -0
- package/.codex/skills/api-development/SKILL.md +315 -0
- package/.codex/skills/architecture-design/SKILL.md +152 -0
- package/.codex/skills/auto-test/SKILL.md +453 -0
- package/.codex/skills/auto-test/references/api-conventions.md +260 -0
- package/.codex/skills/backend-annotations/SKILL.md +248 -0
- package/.codex/skills/banana-image/CHANGELOG.md +37 -0
- package/.codex/skills/banana-image/README.md +146 -0
- package/.codex/skills/banana-image/SKILL.md +171 -0
- package/.codex/skills/banana-image/assets/logo.png +0 -0
- package/.codex/skills/banana-image/references/advanced-usage.md +189 -0
- package/.codex/skills/banana-image/scripts/apply_template.py +125 -0
- package/.codex/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.codex/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.codex/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.codex/skills/banana-image/scripts/package.json +18 -0
- package/.codex/skills/banana-image/scripts/requirements.txt +10 -0
- package/.codex/skills/banana-image/templates/poster.json +22 -0
- package/.codex/skills/banana-image/templates/product.json +17 -0
- package/.codex/skills/banana-image/templates/social.json +22 -0
- package/.codex/skills/banana-image/templates/thumbnail.json +17 -0
- package/.codex/skills/brainstorm/SKILL.md +216 -0
- package/.codex/skills/bug-detective/SKILL.md +295 -0
- package/.codex/skills/bug-detective/references/error-patterns.md +242 -0
- package/.codex/skills/check/SKILL.md +367 -0
- package/.codex/skills/code-patterns/SKILL.md +163 -0
- package/.codex/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.codex/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.codex/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.codex/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.codex/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.codex/skills/crud/SKILL.md +265 -0
- package/.codex/skills/crud-development/SKILL.md +328 -0
- package/.codex/skills/data-permission/SKILL.md +221 -0
- package/.codex/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.codex/skills/database-ops/SKILL.md +210 -0
- package/.codex/skills/dev/SKILL.md +187 -0
- package/.codex/skills/error-handler/SKILL.md +310 -0
- package/.codex/skills/file-oss-management/SKILL.md +260 -0
- package/.codex/skills/file-oss-management/references/entities.md +105 -0
- package/.codex/skills/file-oss-management/references/service-impl.md +104 -0
- package/.codex/skills/fix-bug/SKILL.md +269 -0
- package/.codex/skills/git-workflow/SKILL.md +179 -0
- package/.codex/skills/init-docs/SKILL.md +194 -0
- package/.codex/skills/jenkins-deploy/SKILL.md +134 -0
- package/.codex/skills/json-serialization/SKILL.md +341 -0
- package/.codex/skills/lanhu-design/SKILL.md +99 -0
- package/.codex/skills/leniu-api-development/SKILL.md +319 -0
- package/.codex/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.codex/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.codex/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.codex/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.codex/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +404 -0
- package/.codex/skills/leniu-crud-development/references/templates.md +597 -0
- package/.codex/skills/leniu-customization-location/SKILL.md +410 -0
- package/.codex/skills/leniu-data-permission/SKILL.md +341 -0
- package/.codex/skills/leniu-database-ops/SKILL.md +426 -0
- package/.codex/skills/leniu-error-handler/SKILL.md +462 -0
- package/.codex/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.codex/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.codex/skills/leniu-java-entity/SKILL.md +237 -0
- package/.codex/skills/leniu-java-entity/references/templates.md +237 -0
- package/.codex/skills/leniu-java-logging/SKILL.md +229 -0
- package/.codex/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.codex/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.codex/skills/leniu-java-mq/SKILL.md +338 -0
- package/.codex/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.codex/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.codex/skills/leniu-java-task/SKILL.md +367 -0
- package/.codex/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.codex/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.codex/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.codex/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.codex/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.codex/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.codex/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.codex/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.codex/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.codex/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.codex/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.codex/skills/leniu-report-scenario/references/export.md +553 -0
- package/.codex/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.codex/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.codex/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.codex/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.codex/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.codex/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +306 -0
- package/.codex/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.codex/skills/loki-log-query/SKILL.md +430 -0
- package/.codex/skills/loki-log-query/environments.json +45 -0
- package/.codex/skills/mysql-debug/SKILL.md +406 -0
- package/.codex/skills/next/SKILL.md +137 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +165 -0
- package/.codex/skills/openspec-archive-change/SKILL.md +122 -0
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/.codex/skills/openspec-continue-change/SKILL.md +126 -0
- package/.codex/skills/openspec-explore/SKILL.md +299 -0
- package/.codex/skills/openspec-ff-change/SKILL.md +109 -0
- package/.codex/skills/openspec-new-change/SKILL.md +82 -0
- package/.codex/skills/openspec-onboard/SKILL.md +414 -0
- package/.codex/skills/openspec-sync-specs/SKILL.md +146 -0
- package/.codex/skills/openspec-verify-change/SKILL.md +176 -0
- package/.codex/skills/performance-doctor/SKILL.md +297 -0
- package/.codex/skills/progress/SKILL.md +193 -0
- package/.codex/skills/project-navigator/SKILL.md +211 -0
- package/.codex/skills/redis-cache/SKILL.md +282 -0
- package/.codex/skills/redis-cache/references/listeners.md +23 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +277 -0
- package/.codex/skills/security-guard/SKILL.md +245 -0
- package/.codex/skills/security-guard/references/encrypt-config.md +103 -0
- package/.codex/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.codex/skills/skill-creator/LICENSE.txt +202 -0
- package/.codex/skills/skill-creator/SKILL.md +479 -0
- package/.codex/skills/skill-creator/agents/analyzer.md +274 -0
- package/.codex/skills/skill-creator/agents/comparator.md +202 -0
- package/.codex/skills/skill-creator/agents/grader.md +223 -0
- package/.codex/skills/skill-creator/assets/eval_review.html +146 -0
- package/.codex/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.codex/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.codex/skills/skill-creator/references/schemas.md +430 -0
- package/.codex/skills/skill-creator/scripts/__init__.py +0 -0
- package/.codex/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.codex/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.codex/skills/skill-creator/scripts/improve_description.py +248 -0
- package/.codex/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.codex/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.codex/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.codex/skills/skill-creator/scripts/run_loop.py +332 -0
- package/.codex/skills/skill-creator/scripts/utils.py +47 -0
- package/.codex/skills/sms-mail/SKILL.md +346 -0
- package/.codex/skills/sms-mail/references/mail-config.md +88 -0
- package/.codex/skills/sms-mail/references/sms-config.md +74 -0
- package/.codex/skills/social-login/SKILL.md +328 -0
- package/.codex/skills/social-login/references/provider-configs.md +118 -0
- package/.codex/skills/start/SKILL.md +154 -0
- package/.codex/skills/store-pc/SKILL.md +366 -0
- package/.codex/skills/sync/SKILL.md +149 -0
- package/.codex/skills/sync-back-merge/SKILL.md +66 -0
- package/.codex/skills/task-tracker/SKILL.md +307 -0
- package/.codex/skills/tech-decision/SKILL.md +393 -0
- package/.codex/skills/tenant-management/SKILL.md +272 -0
- package/.codex/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.codex/skills/test-development/SKILL.md +301 -0
- package/.codex/skills/test-development/references/parameterized-examples.md +119 -0
- package/.codex/skills/ui-pc/SKILL.md +438 -0
- package/.codex/skills/update-status/SKILL.md +159 -0
- package/.codex/skills/utils-toolkit/SKILL.md +354 -0
- package/.codex/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.codex/skills/websocket-sse/SKILL.md +350 -0
- package/.codex/skills/workflow-engine/SKILL.md +249 -0
- package/.codex/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.codex/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.cursor/agents/bug-analyzer.md +102 -0
- package/.cursor/agents/code-reviewer.md +122 -0
- package/.cursor/agents/code-scanner.md +145 -0
- package/.cursor/agents/image-reader.md +154 -0
- package/.cursor/agents/loki-runner.md +80 -0
- package/.cursor/agents/mysql-runner.md +81 -0
- package/.cursor/agents/project-manager.md +159 -0
- package/.cursor/agents/requirements-analyzer.md +141 -0
- package/.cursor/agents/task-fetcher.md +75 -0
- package/.cursor/audio/completed.wav +0 -0
- package/.cursor/commands/opsx-apply.md +152 -0
- package/.cursor/commands/opsx-archive.md +157 -0
- package/.cursor/commands/opsx-bulk-archive.md +242 -0
- package/.cursor/commands/opsx-continue.md +114 -0
- package/.cursor/commands/opsx-explore.md +174 -0
- package/.cursor/commands/opsx-ff.md +94 -0
- package/.cursor/commands/opsx-new.md +69 -0
- package/.cursor/commands/opsx-onboard.md +525 -0
- package/.cursor/commands/opsx-sync.md +134 -0
- package/.cursor/commands/opsx-verify.md +164 -0
- package/.cursor/hooks/cursor-pre-tool-use.js +122 -0
- package/.cursor/hooks/cursor-skill-eval.js +466 -0
- package/.cursor/hooks/lib/notify.js +310 -0
- package/.cursor/hooks/stop.js +55 -0
- package/.cursor/hooks.json +23 -0
- package/.cursor/mcp.json +22 -0
- package/.cursor/rules/skill-activation.mdc +99 -0
- package/.cursor/skills/add-skill/SKILL.md +488 -0
- package/.cursor/skills/analyze-requirements/SKILL.md +112 -0
- package/.cursor/skills/api-development/SKILL.md +315 -0
- package/.cursor/skills/architecture-design/SKILL.md +152 -0
- package/.cursor/skills/auto-test/SKILL.md +453 -0
- package/.cursor/skills/auto-test/references/api-conventions.md +260 -0
- package/.cursor/skills/backend-annotations/SKILL.md +248 -0
- package/.cursor/skills/banana-image/CHANGELOG.md +37 -0
- package/.cursor/skills/banana-image/README.md +146 -0
- package/.cursor/skills/banana-image/SKILL.md +171 -0
- package/.cursor/skills/banana-image/assets/logo.png +0 -0
- package/.cursor/skills/banana-image/references/advanced-usage.md +189 -0
- package/.cursor/skills/banana-image/scripts/apply_template.py +125 -0
- package/.cursor/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/.cursor/skills/banana-image/scripts/batch_prep.py +82 -0
- package/.cursor/skills/banana-image/scripts/package-lock.json +1437 -0
- package/.cursor/skills/banana-image/scripts/package.json +18 -0
- package/.cursor/skills/banana-image/scripts/requirements.txt +10 -0
- package/.cursor/skills/banana-image/templates/poster.json +22 -0
- package/.cursor/skills/banana-image/templates/product.json +17 -0
- package/.cursor/skills/banana-image/templates/social.json +22 -0
- package/.cursor/skills/banana-image/templates/thumbnail.json +17 -0
- package/.cursor/skills/brainstorm/SKILL.md +216 -0
- package/.cursor/skills/bug-detective/SKILL.md +295 -0
- package/.cursor/skills/bug-detective/references/error-patterns.md +242 -0
- package/.cursor/skills/code-patterns/SKILL.md +163 -0
- package/.cursor/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.cursor/skills/collaborating-with-codex/SKILL.md +180 -0
- package/.cursor/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/.cursor/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/.cursor/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/.cursor/skills/crud-development/SKILL.md +328 -0
- package/.cursor/skills/data-permission/SKILL.md +221 -0
- package/.cursor/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.cursor/skills/database-ops/SKILL.md +210 -0
- package/.cursor/skills/error-handler/SKILL.md +310 -0
- package/.cursor/skills/file-oss-management/SKILL.md +260 -0
- package/.cursor/skills/file-oss-management/references/entities.md +105 -0
- package/.cursor/skills/file-oss-management/references/service-impl.md +104 -0
- package/.cursor/skills/fix-bug/SKILL.md +269 -0
- package/.cursor/skills/git-workflow/SKILL.md +179 -0
- package/.cursor/skills/jenkins-deploy/SKILL.md +134 -0
- package/.cursor/skills/json-serialization/SKILL.md +341 -0
- package/.cursor/skills/lanhu-design/SKILL.md +99 -0
- package/.cursor/skills/leniu-api-development/SKILL.md +319 -0
- package/.cursor/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +383 -0
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/.cursor/skills/leniu-brainstorm/SKILL.md +242 -0
- package/.cursor/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.cursor/skills/leniu-code-patterns/SKILL.md +411 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +404 -0
- package/.cursor/skills/leniu-crud-development/references/templates.md +597 -0
- package/.cursor/skills/leniu-customization-location/SKILL.md +410 -0
- package/.cursor/skills/leniu-data-permission/SKILL.md +341 -0
- package/.cursor/skills/leniu-database-ops/SKILL.md +426 -0
- package/.cursor/skills/leniu-error-handler/SKILL.md +462 -0
- package/.cursor/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.cursor/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.cursor/skills/leniu-java-entity/SKILL.md +237 -0
- package/.cursor/skills/leniu-java-entity/references/templates.md +237 -0
- package/.cursor/skills/leniu-java-logging/SKILL.md +229 -0
- package/.cursor/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.cursor/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.cursor/skills/leniu-java-mq/SKILL.md +338 -0
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/.cursor/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.cursor/skills/leniu-java-task/SKILL.md +367 -0
- package/.cursor/skills/leniu-marketing-scenario/SKILL.md +448 -0
- package/.cursor/skills/leniu-marketing-scenario/references/pay-meal-rules.md +197 -0
- package/.cursor/skills/leniu-marketing-scenario/references/price-rules.md +286 -0
- package/.cursor/skills/leniu-marketing-scenario/references/recharge-rules.md +188 -0
- package/.cursor/skills/leniu-redis-cache/SKILL.md +331 -0
- package/.cursor/skills/leniu-report-scenario/SKILL.md +508 -0
- package/.cursor/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.cursor/skills/leniu-report-scenario/references/analysis-module.md +64 -0
- package/.cursor/skills/leniu-report-scenario/references/customization-table-fields.md +93 -0
- package/.cursor/skills/leniu-report-scenario/references/customization.md +356 -0
- package/.cursor/skills/leniu-report-scenario/references/data-permission.md +182 -0
- package/.cursor/skills/leniu-report-scenario/references/export.md +553 -0
- package/.cursor/skills/leniu-report-scenario/references/mealtime.md +197 -0
- package/.cursor/skills/leniu-report-scenario/references/query-param.md +274 -0
- package/.cursor/skills/leniu-report-scenario/references/report-tables.md +162 -0
- package/.cursor/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/.cursor/skills/leniu-report-scenario/references/standard-table-fields.md +113 -0
- package/.cursor/skills/leniu-report-scenario/references/total-line.md +179 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +306 -0
- package/.cursor/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.cursor/skills/loki-log-query/SKILL.md +430 -0
- package/.cursor/skills/loki-log-query/environments.json +45 -0
- package/.cursor/skills/mysql-debug/SKILL.md +406 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +165 -0
- package/.cursor/skills/openspec-archive-change/SKILL.md +122 -0
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/.cursor/skills/openspec-continue-change/SKILL.md +126 -0
- package/.cursor/skills/openspec-explore/SKILL.md +299 -0
- package/.cursor/skills/openspec-ff-change/SKILL.md +109 -0
- package/.cursor/skills/openspec-new-change/SKILL.md +82 -0
- package/.cursor/skills/openspec-onboard/SKILL.md +414 -0
- package/.cursor/skills/openspec-sync-specs/SKILL.md +146 -0
- package/.cursor/skills/openspec-verify-change/SKILL.md +176 -0
- package/.cursor/skills/performance-doctor/SKILL.md +297 -0
- package/.cursor/skills/project-navigator/SKILL.md +211 -0
- package/.cursor/skills/redis-cache/SKILL.md +282 -0
- package/.cursor/skills/redis-cache/references/listeners.md +23 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +277 -0
- package/.cursor/skills/security-guard/SKILL.md +245 -0
- package/.cursor/skills/security-guard/references/encrypt-config.md +103 -0
- package/.cursor/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/.cursor/skills/skill-creator/SKILL.md +479 -0
- package/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/.cursor/skills/skill-creator/scripts/improve_description.py +248 -0
- package/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/.cursor/skills/skill-creator/scripts/run_loop.py +332 -0
- package/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/.cursor/skills/sms-mail/SKILL.md +346 -0
- package/.cursor/skills/sms-mail/references/mail-config.md +88 -0
- package/.cursor/skills/sms-mail/references/sms-config.md +74 -0
- package/.cursor/skills/social-login/SKILL.md +328 -0
- package/.cursor/skills/social-login/references/provider-configs.md +118 -0
- package/.cursor/skills/store-pc/SKILL.md +366 -0
- package/.cursor/skills/sync-back-merge/SKILL.md +66 -0
- package/.cursor/skills/task-tracker/SKILL.md +307 -0
- package/.cursor/skills/tech-decision/SKILL.md +393 -0
- package/.cursor/skills/tenant-management/SKILL.md +272 -0
- package/.cursor/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.cursor/skills/test-development/SKILL.md +301 -0
- package/.cursor/skills/test-development/references/parameterized-examples.md +119 -0
- package/.cursor/skills/ui-pc/SKILL.md +438 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +354 -0
- package/.cursor/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.cursor/skills/websocket-sse/SKILL.md +350 -0
- package/.cursor/skills/workflow-engine/SKILL.md +249 -0
- package/.cursor/skills/yunxiao-task-management/SKILL.md +401 -0
- package/.cursor/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
- package/.cursor/templates/env-config.md +27 -0
- package/AGENTS.md +275 -0
- package/CLAUDE.md +285 -0
- package/README.md +104 -0
- package/bin/index.js +3069 -0
- package/init.sh +178 -0
- package/package.json +40 -0
- package/scripts/build-skills.js +180 -0
- package/src/platform-map.json +100 -0
- package/src/skills/add-skill/SKILL.md +488 -0
- package/src/skills/add-todo/SKILL.md +269 -0
- package/src/skills/analyze-requirements/SKILL.md +112 -0
- package/src/skills/api-development/SKILL.md +315 -0
- package/src/skills/architecture-design/SKILL.md +152 -0
- package/src/skills/backend-annotations/SKILL.md +248 -0
- package/src/skills/banana-image/CHANGELOG.md +37 -0
- package/src/skills/banana-image/README.md +146 -0
- package/src/skills/banana-image/SKILL.md +171 -0
- package/src/skills/banana-image/assets/logo.png +0 -0
- package/src/skills/banana-image/references/advanced-usage.md +189 -0
- package/src/skills/banana-image/scripts/apply_template.py +125 -0
- package/src/skills/banana-image/scripts/banana_image_exec.ts +412 -0
- package/src/skills/banana-image/scripts/batch_prep.py +82 -0
- package/src/skills/banana-image/scripts/package-lock.json +1437 -0
- package/src/skills/banana-image/scripts/package.json +18 -0
- package/src/skills/banana-image/scripts/requirements.txt +10 -0
- package/src/skills/banana-image/templates/poster.json +22 -0
- package/src/skills/banana-image/templates/product.json +17 -0
- package/src/skills/banana-image/templates/social.json +22 -0
- package/src/skills/banana-image/templates/thumbnail.json +17 -0
- package/src/skills/brainstorm/SKILL.md +216 -0
- package/src/skills/bug-detective/SKILL.md +295 -0
- package/src/skills/bug-detective/references/error-patterns.md +242 -0
- package/src/skills/check/SKILL.md +367 -0
- package/src/skills/code-patterns/SKILL.md +163 -0
- package/src/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/src/skills/codex-code-review/SKILL.md +327 -0
- package/src/skills/collaborating-with-codex/SKILL.md +180 -0
- package/src/skills/collaborating-with-codex/scripts/codex_bridge.py +275 -0
- package/src/skills/collaborating-with-gemini/SKILL.md +194 -0
- package/src/skills/collaborating-with-gemini/scripts/gemini_bridge.py +275 -0
- package/src/skills/crud/SKILL.md +265 -0
- package/src/skills/crud-development/SKILL.md +328 -0
- package/src/skills/data-permission/SKILL.md +221 -0
- package/src/skills/data-permission/references/custom-data-scope.md +90 -0
- package/src/skills/database-ops/SKILL.md +210 -0
- package/src/skills/dev/SKILL.md +187 -0
- package/src/skills/error-handler/SKILL.md +310 -0
- package/src/skills/file-oss-management/SKILL.md +260 -0
- package/src/skills/file-oss-management/references/entities.md +105 -0
- package/src/skills/file-oss-management/references/service-impl.md +104 -0
- package/src/skills/fix-bug/SKILL.md +269 -0
- package/src/skills/git-workflow/SKILL.md +179 -0
- package/src/skills/init-docs/SKILL.md +194 -0
- package/src/skills/json-serialization/SKILL.md +341 -0
- package/src/skills/leniu-api-development/SKILL.md +319 -0
- package/src/skills/leniu-api-development/references/real-examples.md +273 -0
- package/src/skills/leniu-architecture-design/SKILL.md +383 -0
- package/src/skills/leniu-backend-annotations/SKILL.md +277 -0
- package/src/skills/leniu-brainstorm/SKILL.md +242 -0
- package/src/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/src/skills/leniu-code-patterns/SKILL.md +411 -0
- package/src/skills/leniu-crud-development/SKILL.md +404 -0
- package/src/skills/leniu-crud-development/references/templates.md +597 -0
- package/src/skills/leniu-customization-location/SKILL.md +410 -0
- package/src/skills/leniu-data-permission/SKILL.md +341 -0
- package/src/skills/leniu-database-ops/SKILL.md +426 -0
- package/src/skills/leniu-error-handler/SKILL.md +462 -0
- package/src/skills/leniu-java-amount-handling/SKILL.md +461 -0
- package/src/skills/leniu-java-code-style/SKILL.md +510 -0
- package/src/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/src/skills/leniu-java-entity/SKILL.md +237 -0
- package/src/skills/leniu-java-entity/references/templates.md +237 -0
- package/src/skills/leniu-java-export/SKILL.md +570 -0
- package/src/skills/leniu-java-logging/SKILL.md +229 -0
- package/src/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/src/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/src/skills/leniu-java-mq/SKILL.md +338 -0
- package/src/skills/leniu-java-mybatis/SKILL.md +267 -0
- package/src/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/src/skills/leniu-java-report-query-param/SKILL.md +291 -0
- package/src/skills/leniu-java-task/SKILL.md +367 -0
- package/src/skills/leniu-java-total-line/SKILL.md +196 -0
- package/src/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
- package/src/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
- package/src/skills/leniu-mealtime/SKILL.md +215 -0
- package/src/skills/leniu-redis-cache/SKILL.md +331 -0
- package/src/skills/leniu-report-customization/SKILL.md +415 -0
- package/src/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/src/skills/leniu-report-standard-customization/SKILL.md +391 -0
- package/src/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/src/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/src/skills/leniu-security-guard/SKILL.md +306 -0
- package/src/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/src/skills/loki-log-query/SKILL.md +400 -0
- package/src/skills/loki-log-query/environments.json +45 -0
- package/src/skills/mysql-debug/SKILL.md +400 -0
- package/src/skills/next/SKILL.md +137 -0
- package/src/skills/openspec-apply-change/SKILL.md +165 -0
- package/src/skills/openspec-archive-change/SKILL.md +122 -0
- package/src/skills/openspec-bulk-archive-change/SKILL.md +254 -0
- package/src/skills/openspec-continue-change/SKILL.md +126 -0
- package/src/skills/openspec-explore/SKILL.md +299 -0
- package/src/skills/openspec-ff-change/SKILL.md +109 -0
- package/src/skills/openspec-new-change/SKILL.md +82 -0
- package/src/skills/openspec-onboard/SKILL.md +414 -0
- package/src/skills/openspec-sync-specs/SKILL.md +146 -0
- package/src/skills/openspec-verify-change/SKILL.md +176 -0
- package/src/skills/performance-doctor/SKILL.md +297 -0
- package/src/skills/progress/SKILL.md +193 -0
- package/src/skills/project-navigator/SKILL.md +211 -0
- package/src/skills/redis-cache/SKILL.md +282 -0
- package/src/skills/redis-cache/references/listeners.md +23 -0
- package/src/skills/scheduled-jobs/SKILL.md +277 -0
- package/src/skills/security-guard/SKILL.md +245 -0
- package/src/skills/security-guard/references/encrypt-config.md +103 -0
- package/src/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/src/skills/skill-creator/LICENSE.txt +202 -0
- package/src/skills/skill-creator/SKILL.md +479 -0
- package/src/skills/skill-creator/agents/analyzer.md +274 -0
- package/src/skills/skill-creator/agents/comparator.md +202 -0
- package/src/skills/skill-creator/agents/grader.md +223 -0
- package/src/skills/skill-creator/assets/eval_review.html +146 -0
- package/src/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/src/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/src/skills/skill-creator/references/schemas.md +430 -0
- package/src/skills/skill-creator/scripts/__init__.py +0 -0
- package/src/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/src/skills/skill-creator/scripts/generate_report.py +326 -0
- package/src/skills/skill-creator/scripts/improve_description.py +248 -0
- package/src/skills/skill-creator/scripts/package_skill.py +136 -0
- package/src/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/src/skills/skill-creator/scripts/run_eval.py +310 -0
- package/src/skills/skill-creator/scripts/run_loop.py +332 -0
- package/src/skills/skill-creator/scripts/utils.py +47 -0
- package/src/skills/sms-mail/SKILL.md +346 -0
- package/src/skills/sms-mail/references/mail-config.md +88 -0
- package/src/skills/sms-mail/references/sms-config.md +74 -0
- package/src/skills/social-login/SKILL.md +328 -0
- package/src/skills/social-login/references/provider-configs.md +118 -0
- package/src/skills/start/SKILL.md +154 -0
- package/src/skills/store-pc/SKILL.md +366 -0
- package/src/skills/sync/SKILL.md +149 -0
- package/src/skills/sync-back-merge/SKILL.md +66 -0
- package/src/skills/task-tracker/SKILL.md +307 -0
- package/src/skills/tech-decision/SKILL.md +393 -0
- package/src/skills/tenant-management/SKILL.md +272 -0
- package/src/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/src/skills/test-development/SKILL.md +301 -0
- package/src/skills/test-development/references/parameterized-examples.md +119 -0
- package/src/skills/ui-pc/SKILL.md +438 -0
- package/src/skills/update-status/SKILL.md +159 -0
- package/src/skills/utils-toolkit/SKILL.md +354 -0
- package/src/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/src/skills/websocket-sse/SKILL.md +350 -0
- package/src/skills/workflow-engine/SKILL.md +249 -0
- package/src/skills/yunxiao-task-management/SKILL.md +401 -0
- package/src/skills/yunxiao-task-management/templates//346/217/220/346/265/213/345/215/225/346/250/241/346/235/277.html +17 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init-docs
|
|
3
|
+
description: |
|
|
4
|
+
当需要为项目初始化文档体系、创建项目文档时自动使用此 Skill。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- 新项目第一次初始化文档体系
|
|
8
|
+
- 现有文档丢失或需要重新组织
|
|
9
|
+
- 新成员加入,需要统一文档格式
|
|
10
|
+
- 根据最新代码重新生成文档
|
|
11
|
+
|
|
12
|
+
触发词:初始化文档、init-docs、文档初始化、创建文档、项目文档、文档体系
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /init-docs - 项目文档初始化
|
|
16
|
+
|
|
17
|
+
为纯后端 RuoYi-Vue-Plus 项目初始化完整的项目文档体系。支持空白模板或基于现有代码智能生成。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🎯 适用场景
|
|
22
|
+
|
|
23
|
+
| 场景 | 说明 |
|
|
24
|
+
|------|------|
|
|
25
|
+
| **项目启动** | 新项目第一次初始化文档体系 |
|
|
26
|
+
| **文档重建** | 现有文档丢失或需要重新组织 |
|
|
27
|
+
| **团队协作** | 新成员加入,需要统一文档格式 |
|
|
28
|
+
| **定期整理** | 根据最新代码重新生成文档 |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 📋 执行模式
|
|
33
|
+
|
|
34
|
+
### 模式 1:空白模板(默认)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
/init-docs
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
创建空白文档结构,适合新项目或想从零开始规划的项目。
|
|
41
|
+
|
|
42
|
+
### 模式 2:智能扫描
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
/init-docs --scan
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
扫描现有代码并智能生成文档,自动分析项目结构和代码完整度。
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 🚀 执行流程
|
|
53
|
+
|
|
54
|
+
### 第一步:确认初始化模式
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
请选择初始化方式:
|
|
58
|
+
1. 空白模板(推荐新项目)
|
|
59
|
+
2. 扫描现有代码(推荐已有代码)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 第二步:创建目录结构
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
mkdir -p docs
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**生成的目录结构**:
|
|
69
|
+
```
|
|
70
|
+
项目根目录/
|
|
71
|
+
└── docs/
|
|
72
|
+
├── README.md # 项目简介
|
|
73
|
+
├── ARCHITECTURE.md # 架构说明
|
|
74
|
+
├── PROJECT_STATUS.md # 项目进度
|
|
75
|
+
├── TODO.md # 待办清单
|
|
76
|
+
└── CHANGELOG.md # 变更日志
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 第三步:扫描代码(仅在 --scan 模式)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# 查找所有业务模块
|
|
83
|
+
Glob pattern: "ruoyi-modules/ruoyi-*/src/main/java/**/controller/*Controller.java"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 第四步:生成文档内容
|
|
87
|
+
|
|
88
|
+
根据扫描或手动输入的信息生成文档。
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 生成的文档模板
|
|
93
|
+
|
|
94
|
+
### docs/README.md
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# 项目名称
|
|
98
|
+
|
|
99
|
+
## 📋 项目简介
|
|
100
|
+
|
|
101
|
+
**项目名**:RuoYi-Vue-Plus 纯后端版
|
|
102
|
+
**技术栈**:
|
|
103
|
+
- **后端框架**:Spring Boot 3.x
|
|
104
|
+
- **ORM框架**:MyBatis-Plus 3.x
|
|
105
|
+
- **权限框架**:Sa-Token
|
|
106
|
+
- **数据库**:MySQL 8.0+
|
|
107
|
+
|
|
108
|
+
## 🚀 快速开始
|
|
109
|
+
|
|
110
|
+
1. 克隆项目
|
|
111
|
+
2. 导入数据库
|
|
112
|
+
3. 修改数据库配置
|
|
113
|
+
4. 运行后端服务
|
|
114
|
+
|
|
115
|
+
## 📖 文档导航
|
|
116
|
+
|
|
117
|
+
- [📊 项目进度](./PROJECT_STATUS.md)
|
|
118
|
+
- [🏗️ 架构说明](./ARCHITECTURE.md)
|
|
119
|
+
- [📝 待办清单](./TODO.md)
|
|
120
|
+
- [📝 变更日志](./CHANGELOG.md)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### docs/PROJECT_STATUS.md
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
# 📊 项目进度报告
|
|
127
|
+
|
|
128
|
+
**报告生成时间**:YYYY-MM-DD
|
|
129
|
+
**项目状态**:🟢 开发中
|
|
130
|
+
|
|
131
|
+
## 概览
|
|
132
|
+
|
|
133
|
+
| 指标 | 值 | 说明 |
|
|
134
|
+
|------|-----|------|
|
|
135
|
+
| 总功能数 | X | 规划的功能总数 |
|
|
136
|
+
| 已完成 | X | 100% 完成的功能 |
|
|
137
|
+
| 进行中 | X | 50-99% 的功能 |
|
|
138
|
+
| 待开发 | X | 0% 的功能 |
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### docs/TODO.md
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
# 📝 待办清单
|
|
145
|
+
|
|
146
|
+
**最后更新**:YYYY-MM-DD
|
|
147
|
+
|
|
148
|
+
## 🔴 高优先级(本周必做)
|
|
149
|
+
|
|
150
|
+
- [ ] [任务描述]
|
|
151
|
+
|
|
152
|
+
## 🟡 中优先级(本月完成)
|
|
153
|
+
|
|
154
|
+
- [ ] [任务描述]
|
|
155
|
+
|
|
156
|
+
## 🟢 低优先级(有时间做)
|
|
157
|
+
|
|
158
|
+
- [ ] [任务描述]
|
|
159
|
+
|
|
160
|
+
## ✅ 已完成
|
|
161
|
+
|
|
162
|
+
- [x] [任务描述] - 完成于 YYYY-MM-DD
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 第五步:输出初始化报告
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
# ✅ 项目文档初始化完成!
|
|
171
|
+
|
|
172
|
+
**初始化时间**:YYYY-MM-DD HH:mm
|
|
173
|
+
|
|
174
|
+
## 📂 已创建的文件
|
|
175
|
+
|
|
176
|
+
| 文件 | 说明 | 位置 |
|
|
177
|
+
|------|------|------|
|
|
178
|
+
| README.md | 项目简介 | docs/README.md |
|
|
179
|
+
| PROJECT_STATUS.md | 项目进度 | docs/PROJECT_STATUS.md |
|
|
180
|
+
| ARCHITECTURE.md | 架构说明 | docs/ARCHITECTURE.md |
|
|
181
|
+
| TODO.md | 待办清单 | docs/TODO.md |
|
|
182
|
+
| CHANGELOG.md | 变更日志 | docs/CHANGELOG.md |
|
|
183
|
+
|
|
184
|
+
## 🎯 下一步建议
|
|
185
|
+
|
|
186
|
+
### 1️⃣ 快速了解项目
|
|
187
|
+
\`/start\`
|
|
188
|
+
|
|
189
|
+
### 2️⃣ 查看详细进度
|
|
190
|
+
\`/progress\`
|
|
191
|
+
|
|
192
|
+
### 3️⃣ 检查代码规范
|
|
193
|
+
\`/check\`
|
|
194
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jenkins-deploy
|
|
3
|
+
description: |
|
|
4
|
+
Jenkins + Portainer 自动打包部署技能。通过 Python 脚本调用 Jenkins API 构建项目,并触发 Portainer Webhook/Update 完成容器更新。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- 需要将代码打包部署到 dev/test 环境
|
|
8
|
+
- 需要触发 Jenkins 构建 core 或 api 项目
|
|
9
|
+
- 需要更新 Portainer 容器服务
|
|
10
|
+
- 需要查看或修改构建配置(分支、环境、模式)
|
|
11
|
+
- 定制项目的打包部署
|
|
12
|
+
|
|
13
|
+
触发词:打包、部署、Jenkins、构建、Portainer、发布到dev、发布到test、更新环境、自动部署
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Jenkins + Portainer 自动打包部署
|
|
17
|
+
|
|
18
|
+
## 架构
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
技能目录(随框架更新,不复制到项目):
|
|
22
|
+
~/.claude/skills/jenkins-deploy/assets/jk_build.py ← 构建脚本
|
|
23
|
+
|
|
24
|
+
全局配置(一次性配置,所有项目共享):
|
|
25
|
+
~/.claude/jenkins-config.json ← 凭证(Jenkins/Portainer)
|
|
26
|
+
|
|
27
|
+
项目本地(自动生成):
|
|
28
|
+
jenkins/last_cd_env.json ← 构建状态(环境、分支、模式)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
脚本按 **本地 `.claude/` > 全局 `~/.claude/`** 优先级查找 `jenkins-config.json`。
|
|
32
|
+
|
|
33
|
+
## 构建模式
|
|
34
|
+
|
|
35
|
+
| 模式 | 说明 | 执行步骤 |
|
|
36
|
+
|------|------|---------|
|
|
37
|
+
| `0` | 只构建 | 构建 core + api,不更新 Portainer |
|
|
38
|
+
| `1` | 全构建+更新 | 构建 core + api → 触发 Portainer 更新 |
|
|
39
|
+
| `2` | 构建 api+更新 | 跳过 core,构建 api → 触发 Portainer 更新 |
|
|
40
|
+
| `3` | 只更新 | 不构建,直接触发 Portainer 更新 |
|
|
41
|
+
|
|
42
|
+
## 环境支持
|
|
43
|
+
|
|
44
|
+
| 环境 | 前缀 | Portainer 更新方式 |
|
|
45
|
+
|------|------|-------------------|
|
|
46
|
+
| dev1~15 | `dev` | Webhook 触发 |
|
|
47
|
+
| dev16~43 | `dev` | Force Update(xnzn-dev.xnzn.net) |
|
|
48
|
+
| dev44+ | `dev` | 只支持模式 0(手动更新) |
|
|
49
|
+
| test | `test` | Webhook 触发 |
|
|
50
|
+
|
|
51
|
+
## 使用方式
|
|
52
|
+
|
|
53
|
+
### 运行构建脚本
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python ~/.claude/skills/jenkins-deploy/assets/jk_build.py
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
脚本交互式询问:模式 → 环境 → core 分支 → api 分支 → 定制工程文件夹
|
|
60
|
+
|
|
61
|
+
### 通过 AI 辅助部署
|
|
62
|
+
|
|
63
|
+
当用户说"打包到 devX"时:
|
|
64
|
+
|
|
65
|
+
1. 读取 `jenkins/last_cd_env.json` 获取上次参数
|
|
66
|
+
2. 确认参数:环境、分支、模式
|
|
67
|
+
3. 修改 `jenkins/last_cd_env.json` 写入新参数
|
|
68
|
+
4. 执行 `python ~/.claude/skills/jenkins-deploy/assets/jk_build.py`
|
|
69
|
+
|
|
70
|
+
## 配置文件
|
|
71
|
+
|
|
72
|
+
### jenkins-config.json(凭证,全局)
|
|
73
|
+
|
|
74
|
+
位置:`~/.claude/jenkins-config.json`(或本地 `.claude/jenkins-config.json`)
|
|
75
|
+
|
|
76
|
+
模板:`.claude/skills/jenkins-deploy/assets/env_param.template.json`
|
|
77
|
+
|
|
78
|
+
> **注意**:此文件包含敏感凭证,不要将内容输出到对话中。
|
|
79
|
+
|
|
80
|
+
### last_cd_env.json(构建状态,项目本地)
|
|
81
|
+
|
|
82
|
+
位置:`jenkins/last_cd_env.json`(脚本自动创建,无需手动初始化)
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"build_mode": "1",
|
|
87
|
+
"cd_env": "dev1",
|
|
88
|
+
"core_param_branch": "master",
|
|
89
|
+
"api_param_branch": "master",
|
|
90
|
+
"api_param_folder": null
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 定制项目
|
|
95
|
+
|
|
96
|
+
指定 `api_param_folder` 后,Jenkins Job 路径变为:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
{folder_name}/dev-后端-core
|
|
100
|
+
{folder_name}/dev-后端-api
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 首次初始化(团队成员)
|
|
104
|
+
|
|
105
|
+
只需一步:配置全局凭证文件。
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# 方式 1:从团队成员拷贝
|
|
109
|
+
cp /path/to/teammate/jenkins-config.json ~/.claude/jenkins-config.json
|
|
110
|
+
|
|
111
|
+
# 方式 2:从模板创建,手动填写凭证
|
|
112
|
+
cp ~/.claude/skills/jenkins-deploy/assets/env_param.template.json ~/.claude/jenkins-config.json
|
|
113
|
+
# 然后替换 __JENKINS_*__ 和 __PORTAINER_*__ 占位符
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### AI 初始化行为
|
|
117
|
+
|
|
118
|
+
当技能被触发但 `jenkins-config.json` 不存在时:
|
|
119
|
+
1. 提示"检测到尚未配置 Jenkins 凭证"
|
|
120
|
+
2. 询问是否从模板创建
|
|
121
|
+
3. 复制模板到 `~/.claude/jenkins-config.json`
|
|
122
|
+
4. 提示用户填写凭证(或拷贝已有配置)
|
|
123
|
+
|
|
124
|
+
## 依赖
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pip install python-jenkins requests
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 注意
|
|
131
|
+
|
|
132
|
+
- 本技能用于 dev/test 环境部署,**不涉及生产环境**
|
|
133
|
+
- 如果是 Git 提交/分支管理,请使用 `git-workflow` 技能
|
|
134
|
+
- 如果是代码构建错误排查,请使用 `bug-detective` 技能
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: json-serialization
|
|
3
|
+
description: |
|
|
4
|
+
当需要处理 JSON 序列化、反序列化、数据类型转换、日期处理、大数字精度保护时自动使用此 Skill。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- JSON 序列化/反序列化操作
|
|
8
|
+
- 大数字精度问题(Long/BigInteger/BigDecimal)
|
|
9
|
+
- 日期时间格式化与转换
|
|
10
|
+
- 复杂泛型类型转换
|
|
11
|
+
- JSON 格式验证
|
|
12
|
+
- 数据类型映射与转换
|
|
13
|
+
|
|
14
|
+
触发词:JSON、序列化、反序列化、JsonUtils、日期格式、精度、BigDecimal、Long、类型转换、JSON验证、ObjectMapper、Jackson
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# JSON 序列化与数据转换指南
|
|
18
|
+
|
|
19
|
+
> 基于 Jackson(Spring Boot 默认 JSON 处理库)
|
|
20
|
+
|
|
21
|
+
## 快速索引
|
|
22
|
+
|
|
23
|
+
| 功能 | 方法/类 | 说明 |
|
|
24
|
+
|------|---------|------|
|
|
25
|
+
| 对象转 JSON | `JsonUtils.toJsonString()` | null 返回 null |
|
|
26
|
+
| JSON 转对象 | `JsonUtils.parseObject()` | 空返回 null |
|
|
27
|
+
| JSON 转 List | `JsonUtils.parseArray()` | 空返回空 ArrayList |
|
|
28
|
+
| JSON 转 Map | `JsonUtils.parseMap()` | 非 JSON 返回 null |
|
|
29
|
+
| 复杂类型转换 | `JsonUtils.parseObject(text, TypeReference)` | 支持泛型 |
|
|
30
|
+
| JSON 验证 | `JsonUtils.isJson()` / `isJsonObject()` / `isJsonArray()` | |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 核心工具类 JsonUtils(通用实现)
|
|
35
|
+
|
|
36
|
+
> 推荐封装一个项目级的 `JsonUtils`,内部使用 Jackson `ObjectMapper` 单例。
|
|
37
|
+
|
|
38
|
+
```java
|
|
39
|
+
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
40
|
+
import com.fasterxml.jackson.core.type.TypeReference;
|
|
41
|
+
|
|
42
|
+
public class JsonUtils {
|
|
43
|
+
|
|
44
|
+
private static final ObjectMapper MAPPER = SpringUtil.getBean(ObjectMapper.class);
|
|
45
|
+
// 或者:private static final ObjectMapper MAPPER = new ObjectMapper();
|
|
46
|
+
|
|
47
|
+
public static String toJsonString(Object obj) {
|
|
48
|
+
if (obj == null) return null;
|
|
49
|
+
try {
|
|
50
|
+
return MAPPER.writeValueAsString(obj);
|
|
51
|
+
} catch (Exception e) {
|
|
52
|
+
throw new RuntimeException("JSON序列化失败", e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public static <T> T parseObject(String json, Class<T> clazz) {
|
|
57
|
+
if (json == null || json.isBlank()) return null;
|
|
58
|
+
try {
|
|
59
|
+
return MAPPER.readValue(json, clazz);
|
|
60
|
+
} catch (Exception e) {
|
|
61
|
+
throw new RuntimeException("JSON反序列化失败", e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public static <T> T parseObject(String json, TypeReference<T> typeRef) {
|
|
66
|
+
if (json == null || json.isBlank()) return null;
|
|
67
|
+
try {
|
|
68
|
+
return MAPPER.readValue(json, typeRef);
|
|
69
|
+
} catch (Exception e) {
|
|
70
|
+
throw new RuntimeException("JSON反序列化失败", e);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static <T> List<T> parseArray(String json, Class<T> clazz) {
|
|
75
|
+
if (json == null || json.isBlank()) return new ArrayList<>();
|
|
76
|
+
try {
|
|
77
|
+
return MAPPER.readValue(json,
|
|
78
|
+
MAPPER.getTypeFactory().constructCollectionType(ArrayList.class, clazz));
|
|
79
|
+
} catch (Exception e) {
|
|
80
|
+
throw new RuntimeException("JSON反序列化失败", e);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public static boolean isJson(String str) {
|
|
85
|
+
return isJsonObject(str) || isJsonArray(str);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public static boolean isJsonObject(String str) {
|
|
89
|
+
if (str == null || str.isBlank()) return false;
|
|
90
|
+
return str.trim().startsWith("{") && str.trim().endsWith("}");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public static boolean isJsonArray(String str) {
|
|
94
|
+
if (str == null || str.isBlank()) return false;
|
|
95
|
+
return str.trim().startsWith("[") && str.trim().endsWith("]");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public static ObjectMapper getObjectMapper() {
|
|
99
|
+
return MAPPER;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 序列化与反序列化
|
|
107
|
+
|
|
108
|
+
### 基本用法
|
|
109
|
+
|
|
110
|
+
```java
|
|
111
|
+
// 对象转 JSON 字符串
|
|
112
|
+
String json = JsonUtils.toJsonString(user);
|
|
113
|
+
|
|
114
|
+
// JSON 转简单对象
|
|
115
|
+
User user = JsonUtils.parseObject(json, User.class);
|
|
116
|
+
|
|
117
|
+
// JSON 数组转 List
|
|
118
|
+
List<User> users = JsonUtils.parseArray(json, User.class);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 复杂泛型类型
|
|
122
|
+
|
|
123
|
+
```java
|
|
124
|
+
import com.fasterxml.jackson.core.type.TypeReference;
|
|
125
|
+
|
|
126
|
+
// Map 类型
|
|
127
|
+
Map<String, User> map = JsonUtils.parseObject(json,
|
|
128
|
+
new TypeReference<Map<String, User>>(){});
|
|
129
|
+
|
|
130
|
+
// 嵌套泛型
|
|
131
|
+
Map<String, List<User>> data = JsonUtils.parseObject(json,
|
|
132
|
+
new TypeReference<Map<String, List<User>>>(){});
|
|
133
|
+
|
|
134
|
+
// 性能优化:缓存 TypeReference
|
|
135
|
+
private static final TypeReference<List<User>> USER_LIST_TYPE =
|
|
136
|
+
new TypeReference<List<User>>(){};
|
|
137
|
+
List<User> users = JsonUtils.parseObject(json, USER_LIST_TYPE);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### JSON 验证
|
|
141
|
+
|
|
142
|
+
```java
|
|
143
|
+
JsonUtils.isJson("{\"name\":\"test\"}"); // true
|
|
144
|
+
JsonUtils.isJson("[1,2,3]"); // true
|
|
145
|
+
JsonUtils.isJson("not json"); // false
|
|
146
|
+
|
|
147
|
+
JsonUtils.isJsonObject("{\"a\":1}"); // true
|
|
148
|
+
JsonUtils.isJsonArray("[1,2,3]"); // true
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Jackson 自动配置
|
|
154
|
+
|
|
155
|
+
### 推荐配置类
|
|
156
|
+
|
|
157
|
+
```java
|
|
158
|
+
@Configuration
|
|
159
|
+
public class JacksonConfig {
|
|
160
|
+
|
|
161
|
+
@Bean
|
|
162
|
+
public Jackson2ObjectMapperBuilderCustomizer customizer() {
|
|
163
|
+
return builder -> {
|
|
164
|
+
// LocalDateTime 格式化
|
|
165
|
+
builder.simpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
166
|
+
builder.serializers(new LocalDateTimeSerializer(
|
|
167
|
+
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
168
|
+
builder.deserializers(new LocalDateTimeDeserializer(
|
|
169
|
+
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
170
|
+
|
|
171
|
+
// 大数字精度保护
|
|
172
|
+
SimpleModule module = new SimpleModule();
|
|
173
|
+
module.addSerializer(Long.class, new BigNumberSerializer());
|
|
174
|
+
module.addSerializer(Long.TYPE, new BigNumberSerializer());
|
|
175
|
+
module.addSerializer(BigInteger.class, new BigNumberSerializer());
|
|
176
|
+
module.addSerializer(BigDecimal.class, ToStringSerializer.instance);
|
|
177
|
+
builder.modules(module);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 大数字处理(BigNumberSerializer)
|
|
184
|
+
|
|
185
|
+
**问题**:JavaScript 最大安全整数为 `2^53 - 1`(9007199254740991),超出范围会丢失精度。
|
|
186
|
+
|
|
187
|
+
**解决方案**:自动将超出 JS 安全范围的数字序列化为字符串。
|
|
188
|
+
|
|
189
|
+
```java
|
|
190
|
+
// 安全范围内 -> 保持数字
|
|
191
|
+
Long id = 123456L;
|
|
192
|
+
// 序列化结果:{"id": 123456}
|
|
193
|
+
|
|
194
|
+
// 超出安全范围 -> 转为字符串
|
|
195
|
+
Long id = 9007199254740992L;
|
|
196
|
+
// 序列化结果:{"id": "9007199254740992"}
|
|
197
|
+
|
|
198
|
+
// BigDecimal 始终转为字符串
|
|
199
|
+
BigDecimal amount = new BigDecimal("123.45");
|
|
200
|
+
// 序列化结果:{"amount": "123.45"}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**处理规则**:
|
|
204
|
+
|
|
205
|
+
| 类型 | 范围内 | 超出范围 |
|
|
206
|
+
|------|--------|----------|
|
|
207
|
+
| `Long` | 数字 | 字符串 |
|
|
208
|
+
| `long` | 数字 | 字符串 |
|
|
209
|
+
| `BigInteger` | 数字 | 字符串 |
|
|
210
|
+
| `BigDecimal` | 字符串 | 字符串 |
|
|
211
|
+
|
|
212
|
+
> **安全范围**:`-9007199254740991` ~ `9007199254740991`
|
|
213
|
+
|
|
214
|
+
### LocalDateTime 格式化
|
|
215
|
+
|
|
216
|
+
统一格式:`yyyy-MM-dd HH:mm:ss`
|
|
217
|
+
|
|
218
|
+
```java
|
|
219
|
+
LocalDateTime now = LocalDateTime.now();
|
|
220
|
+
String json = JsonUtils.toJsonString(now);
|
|
221
|
+
// 输出:"2026-02-06 14:30:45"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 使用示例
|
|
227
|
+
|
|
228
|
+
### Service 中的 JSON 操作
|
|
229
|
+
|
|
230
|
+
```java
|
|
231
|
+
@Service
|
|
232
|
+
@RequiredArgsConstructor
|
|
233
|
+
public class ConfigServiceImpl {
|
|
234
|
+
|
|
235
|
+
private final ConfigMapper configMapper;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* 获取配置为对象
|
|
239
|
+
*/
|
|
240
|
+
public <T> T getConfig(String configKey, Class<T> clazz) {
|
|
241
|
+
Config config = configMapper.selectOne(
|
|
242
|
+
Wrappers.<Config>lambdaQuery()
|
|
243
|
+
.eq(Config::getConfigKey, configKey));
|
|
244
|
+
if (config == null) {
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
return JsonUtils.parseObject(config.getConfigValue(), clazz);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* 保存配置
|
|
252
|
+
*/
|
|
253
|
+
public void saveConfig(String configKey, Object value) {
|
|
254
|
+
Config config = new Config();
|
|
255
|
+
config.setConfigKey(configKey);
|
|
256
|
+
config.setConfigValue(JsonUtils.toJsonString(value));
|
|
257
|
+
configMapper.insert(config);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* 导入 JSON 数据
|
|
262
|
+
*/
|
|
263
|
+
public void importData(String jsonData) {
|
|
264
|
+
if (!JsonUtils.isJsonArray(jsonData)) {
|
|
265
|
+
throw new [你的异常类]("数据格式不正确,应为 JSON 数组");
|
|
266
|
+
}
|
|
267
|
+
List<DataBo> list = JsonUtils.parseArray(jsonData, DataBo.class);
|
|
268
|
+
// 处理数据...
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 常见问题
|
|
276
|
+
|
|
277
|
+
### 1. 什么时候用 parseObject vs parseArray?
|
|
278
|
+
|
|
279
|
+
```java
|
|
280
|
+
// JSON 对象 -> parseObject
|
|
281
|
+
String json = "{\"name\":\"test\"}";
|
|
282
|
+
User user = JsonUtils.parseObject(json, User.class);
|
|
283
|
+
|
|
284
|
+
// JSON 数组 -> parseArray
|
|
285
|
+
String json = "[{\"name\":\"test1\"},{\"name\":\"test2\"}]";
|
|
286
|
+
List<User> users = JsonUtils.parseArray(json, User.class);
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### 2. 泛型类型怎么处理?
|
|
290
|
+
|
|
291
|
+
```java
|
|
292
|
+
// ❌ 错误:泛型擦除,无法正确转换
|
|
293
|
+
Map<String, User> map = JsonUtils.parseObject(json, Map.class);
|
|
294
|
+
|
|
295
|
+
// ✅ 正确:使用 TypeReference
|
|
296
|
+
Map<String, User> map = JsonUtils.parseObject(json,
|
|
297
|
+
new TypeReference<Map<String, User>>(){});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 3. null 和空字符串的处理?
|
|
301
|
+
|
|
302
|
+
```java
|
|
303
|
+
// toJsonString
|
|
304
|
+
JsonUtils.toJsonString(null); // 返回 null
|
|
305
|
+
|
|
306
|
+
// parseObject
|
|
307
|
+
JsonUtils.parseObject(null, User.class); // 返回 null
|
|
308
|
+
JsonUtils.parseObject("", User.class); // 返回 null
|
|
309
|
+
|
|
310
|
+
// parseArray
|
|
311
|
+
JsonUtils.parseArray(null, User.class); // 返回空 ArrayList
|
|
312
|
+
JsonUtils.parseArray("", User.class); // 返回空 ArrayList
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## 禁止事项
|
|
318
|
+
|
|
319
|
+
```java
|
|
320
|
+
// ❌ 禁止:频繁创建 ObjectMapper
|
|
321
|
+
ObjectMapper mapper = new ObjectMapper();
|
|
322
|
+
String json = mapper.writeValueAsString(user);
|
|
323
|
+
|
|
324
|
+
// ✅ 正确:使用项目统一的 JsonUtils
|
|
325
|
+
String json = JsonUtils.toJsonString(user);
|
|
326
|
+
|
|
327
|
+
// ❌ 禁止:不验证直接解析(可能报错)
|
|
328
|
+
List<User> users = JsonUtils.parseArray(data, User.class);
|
|
329
|
+
|
|
330
|
+
// ✅ 正确:先验证再解析
|
|
331
|
+
if (JsonUtils.isJsonArray(data)) {
|
|
332
|
+
List<User> users = JsonUtils.parseArray(data, User.class);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ❌ 禁止:泛型不使用 TypeReference
|
|
336
|
+
Map map = JsonUtils.parseObject(json, Map.class);
|
|
337
|
+
|
|
338
|
+
// ✅ 正确:使用 TypeReference
|
|
339
|
+
Map<String, User> map = JsonUtils.parseObject(json,
|
|
340
|
+
new TypeReference<Map<String, User>>(){});
|
|
341
|
+
```
|