ai-engineering-init 1.1.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/code-reviewer.md +139 -0
- package/.claude/agents/project-manager.md +159 -0
- package/.claude/audio/completed.wav +0 -0
- package/.claude/commands/add-todo.md +255 -0
- package/.claude/commands/check.md +210 -0
- package/.claude/commands/crud.md +454 -0
- package/.claude/commands/dev.md +503 -0
- package/.claude/commands/init-docs.md +681 -0
- package/.claude/commands/next.md +251 -0
- package/.claude/commands/progress.md +242 -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/pre-tool-use.js +117 -0
- package/.claude/hooks/skill-forced-eval.js +167 -0
- package/.claude/hooks/stop.js +58 -0
- package/.claude/settings.json +41 -0
- package/.claude/skills/add-skill/SKILL.md +352 -0
- package/.claude/skills/api-development/SKILL.md +560 -0
- package/.claude/skills/architecture-design/SKILL.md +756 -0
- package/.claude/skills/backend-annotations/SKILL.md +674 -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 +164 -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 +648 -0
- package/.claude/skills/bug-detective/SKILL.md +1206 -0
- package/.claude/skills/code-patterns/SKILL.md +590 -0
- package/.claude/skills/collaborating-with-codex/SKILL.md +174 -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 +649 -0
- package/.claude/skills/data-permission/SKILL.md +599 -0
- package/.claude/skills/database-ops/SKILL.md +407 -0
- package/.claude/skills/error-handler/SKILL.md +371 -0
- package/.claude/skills/file-oss-management/SKILL.md +863 -0
- package/.claude/skills/git-workflow/SKILL.md +375 -0
- package/.claude/skills/json-serialization/SKILL.md +357 -0
- package/.claude/skills/leniu-api-development/SKILL.md +803 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +598 -0
- package/.claude/skills/leniu-backend-annotations/SKILL.md +664 -0
- package/.claude/skills/leniu-code-patterns/SKILL.md +365 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +1110 -0
- package/.claude/skills/leniu-data-permission/SKILL.md +256 -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-amount-handling/SKILL.md +461 -0
- package/.claude/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.claude/skills/leniu-java-concurrent/SKILL.md +400 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +751 -0
- package/.claude/skills/leniu-java-export/SKILL.md +560 -0
- package/.claude/skills/leniu-java-logging/SKILL.md +832 -0
- package/.claude/skills/leniu-java-mq/SKILL.md +338 -0
- package/.claude/skills/leniu-java-mybatis/SKILL.md +640 -0
- package/.claude/skills/leniu-java-report-query-param/SKILL.md +291 -0
- package/.claude/skills/leniu-java-task/SKILL.md +367 -0
- package/.claude/skills/leniu-java-total-line/SKILL.md +195 -0
- package/.claude/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
- package/.claude/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
- package/.claude/skills/leniu-mealtime/SKILL.md +215 -0
- package/.claude/skills/leniu-redis-cache/SKILL.md +316 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +520 -0
- package/.claude/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +156 -0
- package/.claude/skills/openspec-archive-change/SKILL.md +114 -0
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
- package/.claude/skills/openspec-continue-change/SKILL.md +118 -0
- package/.claude/skills/openspec-explore/SKILL.md +290 -0
- package/.claude/skills/openspec-ff-change/SKILL.md +101 -0
- package/.claude/skills/openspec-new-change/SKILL.md +74 -0
- package/.claude/skills/openspec-onboard/SKILL.md +529 -0
- package/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
- package/.claude/skills/openspec-verify-change/SKILL.md +168 -0
- package/.claude/skills/performance-doctor/SKILL.md +627 -0
- package/.claude/skills/project-navigator/SKILL.md +305 -0
- package/.claude/skills/redis-cache/SKILL.md +839 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +633 -0
- package/.claude/skills/security-guard/SKILL.md +748 -0
- package/.claude/skills/sms-mail/SKILL.md +766 -0
- package/.claude/skills/social-login/SKILL.md +668 -0
- package/.claude/skills/store-pc/SKILL.md +366 -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 +603 -0
- package/.claude/skills/test-development/SKILL.md +755 -0
- package/.claude/skills/ui-pc/SKILL.md +438 -0
- package/.claude/skills/utils-toolkit/SKILL.md +615 -0
- package/.claude/skills/websocket-sse/SKILL.md +716 -0
- package/.claude/skills/workflow-engine/SKILL.md +676 -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 +352 -0
- package/.codex/skills/add-todo/SKILL.md +269 -0
- package/.codex/skills/api-development/SKILL.md +693 -0
- package/.codex/skills/architecture-design/SKILL.md +628 -0
- package/.codex/skills/backend-annotations/SKILL.md +664 -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 +164 -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 +648 -0
- package/.codex/skills/bug-detective/SKILL.md +1206 -0
- package/.codex/skills/check/SKILL.md +367 -0
- package/.codex/skills/code-patterns/SKILL.md +442 -0
- package/.codex/skills/collaborating-with-codex/SKILL.md +174 -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 +637 -0
- package/.codex/skills/data-permission/SKILL.md +591 -0
- package/.codex/skills/database-ops/SKILL.md +553 -0
- package/.codex/skills/dev/SKILL.md +187 -0
- package/.codex/skills/error-handler/SKILL.md +361 -0
- package/.codex/skills/file-oss-management/SKILL.md +863 -0
- package/.codex/skills/git-workflow/SKILL.md +375 -0
- package/.codex/skills/init-docs/SKILL.md +194 -0
- package/.codex/skills/json-serialization/SKILL.md +357 -0
- package/.codex/skills/leniu-api-development/SKILL.md +803 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +594 -0
- package/.codex/skills/leniu-backend-annotations/SKILL.md +662 -0
- package/.codex/skills/leniu-code-patterns/SKILL.md +365 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +1110 -0
- package/.codex/skills/leniu-data-permission/SKILL.md +256 -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 +751 -0
- package/.codex/skills/leniu-java-export/SKILL.md +560 -0
- package/.codex/skills/leniu-java-logging/SKILL.md +832 -0
- package/.codex/skills/leniu-java-mq/SKILL.md +338 -0
- package/.codex/skills/leniu-java-mybatis/SKILL.md +640 -0
- package/.codex/skills/leniu-java-report-query-param/SKILL.md +291 -0
- package/.codex/skills/leniu-java-task/SKILL.md +367 -0
- package/.codex/skills/leniu-java-total-line/SKILL.md +195 -0
- package/.codex/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
- package/.codex/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
- package/.codex/skills/leniu-mealtime/SKILL.md +215 -0
- package/.codex/skills/leniu-redis-cache/SKILL.md +316 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +520 -0
- package/.codex/skills/leniu-utils-toolkit/SKILL.md +378 -0
- package/.codex/skills/next/SKILL.md +137 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +156 -0
- package/.codex/skills/openspec-archive-change/SKILL.md +114 -0
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +246 -0
- package/.codex/skills/openspec-continue-change/SKILL.md +118 -0
- package/.codex/skills/openspec-explore/SKILL.md +290 -0
- package/.codex/skills/openspec-ff-change/SKILL.md +101 -0
- package/.codex/skills/openspec-new-change/SKILL.md +74 -0
- package/.codex/skills/openspec-onboard/SKILL.md +529 -0
- package/.codex/skills/openspec-sync-specs/SKILL.md +138 -0
- package/.codex/skills/openspec-verify-change/SKILL.md +168 -0
- package/.codex/skills/performance-doctor/SKILL.md +627 -0
- package/.codex/skills/progress/SKILL.md +193 -0
- package/.codex/skills/project-navigator/SKILL.md +286 -0
- package/.codex/skills/redis-cache/SKILL.md +829 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +633 -0
- package/.codex/skills/security-guard/SKILL.md +739 -0
- package/.codex/skills/sms-mail/SKILL.md +766 -0
- package/.codex/skills/social-login/SKILL.md +668 -0
- package/.codex/skills/start/SKILL.md +154 -0
- package/.codex/skills/store-pc/SKILL.md +491 -0
- package/.codex/skills/sync/SKILL.md +149 -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 +603 -0
- package/.codex/skills/test-development/SKILL.md +755 -0
- package/.codex/skills/ui-pc/SKILL.md +475 -0
- package/.codex/skills/update-status/SKILL.md +159 -0
- package/.codex/skills/utils-toolkit/SKILL.md +593 -0
- package/.codex/skills/websocket-sse/SKILL.md +716 -0
- package/.codex/skills/workflow-engine/SKILL.md +676 -0
- package/.cursor/agents/code-reviewer.md +139 -0
- package/.cursor/agents/project-manager.md +159 -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/mcp.json +22 -0
- package/.cursor/skills/add-skill/SKILL.md +352 -0
- package/.cursor/skills/api-development/SKILL.md +560 -0
- package/.cursor/skills/architecture-design/SKILL.md +756 -0
- package/.cursor/skills/backend-annotations/SKILL.md +674 -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 +164 -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 +648 -0
- package/.cursor/skills/bug-detective/SKILL.md +1206 -0
- package/.cursor/skills/code-patterns/SKILL.md +590 -0
- package/.cursor/skills/collaborating-with-codex/SKILL.md +174 -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 +649 -0
- package/.cursor/skills/data-permission/SKILL.md +599 -0
- package/.cursor/skills/database-ops/SKILL.md +407 -0
- package/.cursor/skills/error-handler/SKILL.md +371 -0
- package/.cursor/skills/file-oss-management/SKILL.md +863 -0
- package/.cursor/skills/git-workflow/SKILL.md +375 -0
- package/.cursor/skills/json-serialization/SKILL.md +357 -0
- package/.cursor/skills/leniu-api-development/SKILL.md +803 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +598 -0
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +664 -0
- package/.cursor/skills/leniu-code-patterns/SKILL.md +365 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +1110 -0
- package/.cursor/skills/leniu-data-permission/SKILL.md +256 -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 +751 -0
- package/.cursor/skills/leniu-java-export/SKILL.md +560 -0
- package/.cursor/skills/leniu-java-logging/SKILL.md +832 -0
- package/.cursor/skills/leniu-java-mq/SKILL.md +338 -0
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +640 -0
- package/.cursor/skills/leniu-java-report-query-param/SKILL.md +291 -0
- package/.cursor/skills/leniu-java-task/SKILL.md +367 -0
- package/.cursor/skills/leniu-java-total-line/SKILL.md +195 -0
- package/.cursor/skills/leniu-marketing-price-rule-customizer/SKILL.md +301 -0
- package/.cursor/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +285 -0
- package/.cursor/skills/leniu-mealtime/SKILL.md +215 -0
- package/.cursor/skills/leniu-redis-cache/SKILL.md +316 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +520 -0
- package/.cursor/skills/leniu-utils-toolkit/SKILL.md +380 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
- package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +246 -0
- package/.cursor/skills/openspec-continue-change/SKILL.md +118 -0
- package/.cursor/skills/openspec-explore/SKILL.md +290 -0
- package/.cursor/skills/openspec-ff-change/SKILL.md +101 -0
- package/.cursor/skills/openspec-new-change/SKILL.md +74 -0
- package/.cursor/skills/openspec-onboard/SKILL.md +529 -0
- package/.cursor/skills/openspec-sync-specs/SKILL.md +138 -0
- package/.cursor/skills/openspec-verify-change/SKILL.md +168 -0
- package/.cursor/skills/performance-doctor/SKILL.md +627 -0
- package/.cursor/skills/project-navigator/SKILL.md +305 -0
- package/.cursor/skills/redis-cache/SKILL.md +839 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +633 -0
- package/.cursor/skills/security-guard/SKILL.md +748 -0
- package/.cursor/skills/sms-mail/SKILL.md +766 -0
- package/.cursor/skills/social-login/SKILL.md +668 -0
- package/.cursor/skills/store-pc/SKILL.md +366 -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 +603 -0
- package/.cursor/skills/test-development/SKILL.md +755 -0
- package/.cursor/skills/ui-pc/SKILL.md +438 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +615 -0
- package/.cursor/skills/websocket-sse/SKILL.md +716 -0
- package/.cursor/skills/workflow-engine/SKILL.md +676 -0
- package/AGENTS.md +669 -0
- package/CLAUDE.md +205 -0
- package/README.md +205 -0
- package/bin/index.js +179 -0
- package/init.sh +178 -0
- package/package.json +27 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: leniu-utils-toolkit
|
|
3
|
+
description: |
|
|
4
|
+
leniu-yunshitang-core 项目工具类使用指南。包含 BeanUtil、CollUtil、ObjectUtil、StrUtil、RedisUtil、JacksonUtil、LeBeanUtil 等核心工具类。
|
|
5
|
+
|
|
6
|
+
触发场景:
|
|
7
|
+
- 对象转换(DTO/VO/Entity)
|
|
8
|
+
- 字符串处理
|
|
9
|
+
- 集合操作
|
|
10
|
+
- 日期时间处理
|
|
11
|
+
- Redis 缓存操作
|
|
12
|
+
- JSON 序列化
|
|
13
|
+
- 模糊查询处理
|
|
14
|
+
|
|
15
|
+
适用项目:
|
|
16
|
+
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
17
|
+
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
18
|
+
|
|
19
|
+
触发词:leniu-工具类、leniu-BeanUtil、leniu-StrUtil、leniu-CollUtil、leniu-ObjectUtil、leniu-RedisUtil、leniu-JacksonUtil、leniu-LeBeanUtil、net.xnzn、leniu-yunshitang、leniu-yunshitang-core、云食堂工具类
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# leniu-yunshitang-core 工具类大全
|
|
24
|
+
|
|
25
|
+
> 本文档专注于 leniu-tengyun-core 项目的 Java 后端工具类。
|
|
26
|
+
|
|
27
|
+
## 快速索引
|
|
28
|
+
|
|
29
|
+
| 功能 | 工具类 | 包路径 | 常用方法 |
|
|
30
|
+
|------|--------|--------|---------|
|
|
31
|
+
| **对象转换** | `BeanUtil` | `cn.hutool.core.bean` | `copyProperties()`, `copyToList()` |
|
|
32
|
+
| 字符串 | `StrUtil` | `cn.hutool.core.util` | `isBlank()`, `format()` |
|
|
33
|
+
| 集合 | `CollUtil` | `cn.hutool.core.collection` | `isEmpty()`, `newArrayList()` |
|
|
34
|
+
| 对象 | `ObjectUtil` | `cn.hutool.core.util` | `isNull()`, `isEmpty()` |
|
|
35
|
+
| Redis缓存 | `RedisUtil` | `net.xnzn.core.base.redis` | `setString()`, `getString()` |
|
|
36
|
+
| JSON | `JacksonUtil` | `net.xnzn.core.common.utils` | `writeValueAsString()`, `readValue()` |
|
|
37
|
+
| 模糊查询 | `LeBeanUtil` | `net.xnzn.core.common.utils` | `fieldLikeHandle()` |
|
|
38
|
+
| 租户上下文 | `TenantContextHolder` | `net.xnzn.framework.data.tenant` | `getTenantId()` |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 1. 对象转换 - BeanUtil(Hutool)
|
|
43
|
+
|
|
44
|
+
> ⚠️ **强制规范**: leniu 项目使用 Hutool 的 `BeanUtil`,不是 MapstructUtils
|
|
45
|
+
|
|
46
|
+
```java
|
|
47
|
+
import cn.hutool.core.bean.BeanUtil;
|
|
48
|
+
|
|
49
|
+
// ✅ 单个对象转换
|
|
50
|
+
XxxVO vo = BeanUtil.copyProperties(entity, XxxVO.class);
|
|
51
|
+
XxxEntity entity = BeanUtil.copyProperties(dto, XxxEntity.class);
|
|
52
|
+
|
|
53
|
+
// ✅ 集合转换
|
|
54
|
+
List<XxxVO> voList = BeanUtil.copyToList(entityList, XxxVO.class);
|
|
55
|
+
List<XxxEntity> entityList = BeanUtil.copyToList(dtoList, XxxEntity.class);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 2. 字符串操作 - StrUtil(Hutool)
|
|
61
|
+
|
|
62
|
+
```java
|
|
63
|
+
import cn.hutool.core.util.StrUtil;
|
|
64
|
+
|
|
65
|
+
// 判空
|
|
66
|
+
StrUtil.isBlank(str); // null / "" / 空白 都返回 true
|
|
67
|
+
StrUtil.isNotBlank(str);
|
|
68
|
+
StrUtil.isEmpty(str); // null / "" 返回 true
|
|
69
|
+
StrUtil.isNotEmpty(str);
|
|
70
|
+
|
|
71
|
+
// 字符串拼接
|
|
72
|
+
String str = StrUtil.join(",", list); // "1,2,3"
|
|
73
|
+
|
|
74
|
+
// 常量
|
|
75
|
+
StrUtil.COMMA // ","
|
|
76
|
+
StrUtil.DOT // "."
|
|
77
|
+
StrUtil.SLASH // "/"
|
|
78
|
+
|
|
79
|
+
// 截取
|
|
80
|
+
String str = StrUtil.sub(s, 0, 10);
|
|
81
|
+
|
|
82
|
+
// 去除前后缀
|
|
83
|
+
StrUtil.removePrefix(str, "prefix_");
|
|
84
|
+
StrUtil.removeSuffix(str, "_suffix");
|
|
85
|
+
|
|
86
|
+
// 判断前后缀
|
|
87
|
+
StrUtil.startWith(str, "prefix_");
|
|
88
|
+
StrUtil.endWith(str, "_suffix");
|
|
89
|
+
|
|
90
|
+
// 大小写转换
|
|
91
|
+
StrUtil.upperCase(str);
|
|
92
|
+
StrUtil.lowerCase(str);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 3. 集合操作 - CollUtil(Hutool)
|
|
98
|
+
|
|
99
|
+
```java
|
|
100
|
+
import cn.hutool.core.collection.CollUtil;
|
|
101
|
+
|
|
102
|
+
// 判空
|
|
103
|
+
CollUtil.isEmpty(list);
|
|
104
|
+
CollUtil.isNotEmpty(list);
|
|
105
|
+
|
|
106
|
+
// 创建集合
|
|
107
|
+
CollUtil.newArrayList(1, 2, 3);
|
|
108
|
+
CollUtil.newHashSet("a", "b");
|
|
109
|
+
|
|
110
|
+
// 集合转数组
|
|
111
|
+
String[] array = CollUtil.toArray(list, String.class);
|
|
112
|
+
|
|
113
|
+
// 集合转字符串
|
|
114
|
+
String str = CollUtil.join(list, ",");
|
|
115
|
+
|
|
116
|
+
// 分割
|
|
117
|
+
List<String> list = CollUtil.split("1,2,3", ",");
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 4. 对象操作 - ObjectUtil(Hutool)
|
|
123
|
+
|
|
124
|
+
```java
|
|
125
|
+
import cn.hutool.core.util.ObjectUtil;
|
|
126
|
+
|
|
127
|
+
// 判空
|
|
128
|
+
ObjectUtil.isNull(obj);
|
|
129
|
+
ObjectUtil.isNotNull(obj);
|
|
130
|
+
ObjectUtil.isEmpty(obj); // null / 空字符串 / 空集合
|
|
131
|
+
ObjectUtil.isNotEmpty(obj);
|
|
132
|
+
|
|
133
|
+
// 默认值
|
|
134
|
+
ObjectUtil.defaultIfNull(obj, defaultValue);
|
|
135
|
+
|
|
136
|
+
// 相等比较
|
|
137
|
+
ObjectUtil.equal(a, b);
|
|
138
|
+
|
|
139
|
+
// 克隆
|
|
140
|
+
ObjectUtil.clone(obj);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 5. Redis 缓存 - RedisUtil
|
|
146
|
+
|
|
147
|
+
```java
|
|
148
|
+
import net.xnzn.core.base.redis.RedisUtil;
|
|
149
|
+
import org.redisson.api.RLock;
|
|
150
|
+
|
|
151
|
+
// ========== String 操作 ==========
|
|
152
|
+
RedisUtil.setString(key, value); // 存字符串
|
|
153
|
+
RedisUtil.setString(key, value, timeout); // 存字符串(秒)
|
|
154
|
+
RedisUtil.getString(key); // 取字符串
|
|
155
|
+
|
|
156
|
+
// ========== Object 操作 ==========
|
|
157
|
+
RedisUtil.setObj(key, obj); // 存对象
|
|
158
|
+
RedisUtil.setObj(key, obj, timeout); // 存对象(秒)
|
|
159
|
+
RedisUtil.getObj(key); // 取对象
|
|
160
|
+
RedisUtil.getObjOrNull(key); // 取对象(异常返回null)
|
|
161
|
+
|
|
162
|
+
// ========== 删除操作 ==========
|
|
163
|
+
RedisUtil.delete(key); // 删除单个key
|
|
164
|
+
RedisUtil.delete(keys); // 批量删除
|
|
165
|
+
RedisUtil.deleteByPattern("cache:user:*"); // 模式匹配删除
|
|
166
|
+
RedisUtil.deleteKeysInPipeline(keys); // 管道批量删除
|
|
167
|
+
|
|
168
|
+
// ========== 分布式锁 ==========
|
|
169
|
+
RLock lock = RedisUtil.getLock(key); // 获取普通锁
|
|
170
|
+
RLock lock = RedisUtil.getFairLock(key); // 获取公平锁
|
|
171
|
+
RedisUtil.safeUnLock(lock); // 安全解锁
|
|
172
|
+
RedisUtil.isLock(key); // 检查是否锁定
|
|
173
|
+
|
|
174
|
+
// ========== 其他操作 ==========
|
|
175
|
+
RedisUtil.setNx(key, value, expireTime); // SETNX
|
|
176
|
+
RedisUtil.hasKey(key); // 判断key存在
|
|
177
|
+
RedisUtil.incr(key, liveTime); // 自增
|
|
178
|
+
RedisUtil.decr(key, liveTime); // 自减
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 6. JSON 操作 - JacksonUtil
|
|
184
|
+
|
|
185
|
+
```java
|
|
186
|
+
import net.xnzn.core.common.utils.JacksonUtil;
|
|
187
|
+
|
|
188
|
+
// 序列化
|
|
189
|
+
String json = JacksonUtil.writeValueAsString(obj); // 对象->JSON字符串
|
|
190
|
+
String json = JacksonUtil.writeValueAsStringIgnoreNull(obj); // 忽略null字段
|
|
191
|
+
|
|
192
|
+
// 反序列化
|
|
193
|
+
User user = JacksonUtil.readValue(json, User.class); // JSON->对象
|
|
194
|
+
List<User> list = JacksonUtil.readList(json, User.class); // JSON->List
|
|
195
|
+
Map<String, Object> map = JacksonUtil.readValue(json, Map.class);
|
|
196
|
+
|
|
197
|
+
// JsonNode 操作
|
|
198
|
+
JsonNode node = JacksonUtil.readTree(json); // JSON->JsonNode
|
|
199
|
+
User user = JacksonUtil.treeToValue(node, User.class); // JsonNode->对象
|
|
200
|
+
String value = JacksonUtil.getByPath(node, "data.user.name"); // 路径获取
|
|
201
|
+
String str = JacksonUtil.getString(node, "key"); // 取String
|
|
202
|
+
Integer num = JacksonUtil.getInt(node, "key"); // 取Integer
|
|
203
|
+
|
|
204
|
+
// 节点创建
|
|
205
|
+
ObjectNode objectNode = JacksonUtil.objectNode(); // 创建ObjectNode
|
|
206
|
+
ArrayNode arrayNode = JacksonUtil.arrayNode(); // 创建ArrayNode
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 7. 模糊查询处理 - LeBeanUtil
|
|
212
|
+
|
|
213
|
+
```java
|
|
214
|
+
import net.xnzn.core.common.utils.LeBeanUtil;
|
|
215
|
+
|
|
216
|
+
// 字段模糊查询处理(自动添加 %前后缀)
|
|
217
|
+
param.setName(LeBeanUtil.fieldLikeHandle(param.getName()));
|
|
218
|
+
// 效果: "张" -> "%张%"
|
|
219
|
+
|
|
220
|
+
// 常用于 Service 层查询条件处理
|
|
221
|
+
param.setCanteenName(LeBeanUtil.fieldLikeHandle(param.getCanteenName()));
|
|
222
|
+
param.setStallName(LeBeanUtil.fieldLikeHandle(param.getStallName()));
|
|
223
|
+
param.setDishName(LeBeanUtil.fieldLikeHandle(param.getDishName()));
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 8. 租户上下文 - TenantContextHolder
|
|
229
|
+
|
|
230
|
+
```java
|
|
231
|
+
import net.xnzn.framework.data.tenant.TenantContextHolder;
|
|
232
|
+
|
|
233
|
+
// 获取当前租户ID
|
|
234
|
+
Long tenantId = TenantContextHolder.getTenantId();
|
|
235
|
+
|
|
236
|
+
// 常用于 Redis key 构建
|
|
237
|
+
String key = "cache:" + TenantContextHolder.getTenantId() + ":data";
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 9. 日期时间工具
|
|
243
|
+
|
|
244
|
+
```java
|
|
245
|
+
import java.time.LocalDateTime;
|
|
246
|
+
import java.time.format.DateTimeFormatter;
|
|
247
|
+
|
|
248
|
+
// 当前时间
|
|
249
|
+
LocalDateTime now = LocalDateTime.now();
|
|
250
|
+
|
|
251
|
+
// 格式化
|
|
252
|
+
String format = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
253
|
+
|
|
254
|
+
// 解析
|
|
255
|
+
LocalDateTime time = LocalDateTime.parse(str, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 10. 常用正则表达式
|
|
261
|
+
|
|
262
|
+
```java
|
|
263
|
+
// 手机号
|
|
264
|
+
String phoneReg = "^1[3-9]\\d{9}$";
|
|
265
|
+
|
|
266
|
+
// 邮箱
|
|
267
|
+
String emailReg = "^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$";
|
|
268
|
+
|
|
269
|
+
// 身份证
|
|
270
|
+
String idCardReg = "^[1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]$";
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 工具类选择速查
|
|
276
|
+
|
|
277
|
+
| 需求 | 推荐工具 | 说明 |
|
|
278
|
+
|------|---------|------|
|
|
279
|
+
| 对象转换 | `BeanUtil.copyProperties()` | **leniu 必用** |
|
|
280
|
+
| 集合判空 | `CollUtil.isEmpty()` | Hutool |
|
|
281
|
+
| 对象判空 | `ObjectUtil.isNull()` | Hutool |
|
|
282
|
+
| 字符串判空 | `StrUtil.isBlank()` | Hutool |
|
|
283
|
+
| JSON序列化 | `JacksonUtil.writeValueAsString()` | leniu |
|
|
284
|
+
| Redis缓存 | `RedisUtil.setString()` | leniu |
|
|
285
|
+
| 模糊查询 | `LeBeanUtil.fieldLikeHandle()` | leniu |
|
|
286
|
+
| 租户ID | `TenantContextHolder.getTenantId()` | leniu |
|
|
287
|
+
| 字符串拼接 | `StrUtil.join()` | Hutool |
|
|
288
|
+
| 日期格式化 | `DateTimeFormatter` | JDK 8 |
|
|
289
|
+
| ID 生成 | `IdUtil.getSnowflakeNextId()` | Hutool |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 禁止事项
|
|
294
|
+
|
|
295
|
+
```java
|
|
296
|
+
// ❌ 禁止使用 MapstructUtils(leniu 使用 BeanUtil)
|
|
297
|
+
// MapstructUtils.convert(source, Target.class); // 禁止!
|
|
298
|
+
|
|
299
|
+
// ❌ 禁止使用 Map 传递业务数据
|
|
300
|
+
public Map<String, Object> getXxx() { ... } // 禁止!
|
|
301
|
+
|
|
302
|
+
// ❌ 禁止手写 stream 转换(应使用 BeanUtil.copyToList)
|
|
303
|
+
list.stream().map(item -> BeanUtil.copyProperties(item, XxxVO.class)).collect(Collectors.toList());
|
|
304
|
+
// ✅ 推荐
|
|
305
|
+
BeanUtil.copyToList(list, XxxVO.class);
|
|
306
|
+
|
|
307
|
+
// ❌ 禁止使用完整类型引用
|
|
308
|
+
public net.xnzn.core.common.util.LeResponse<XxxVo> getXxx() // 禁止!
|
|
309
|
+
// ✅ 正确:先 import,再使用短类名
|
|
310
|
+
import net.xnzn.core.common.util.LeResponse;
|
|
311
|
+
public LeResponse<XxxVo> getXxx()
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 常见错误对比
|
|
317
|
+
|
|
318
|
+
### ❌ 错误写法
|
|
319
|
+
|
|
320
|
+
```java
|
|
321
|
+
// 错误 1: 使用 RuoYi 的 MapstructUtils
|
|
322
|
+
MapstructUtils.convert(source, Target.class); // ❌ leniu 用 BeanUtil
|
|
323
|
+
|
|
324
|
+
// 错误 2: 使用 RuoYi 的 StringUtils
|
|
325
|
+
StringUtils.isBlank(str); // ❌ leniu 用 StrUtil
|
|
326
|
+
|
|
327
|
+
// 错误 3: 使用 RuoYi 的 RedisUtils
|
|
328
|
+
RedisUtils.setCacheObject(key, value); // ❌ leniu 用 RedisUtil
|
|
329
|
+
|
|
330
|
+
// 错误 4: 使用 RuoYi 的 JsonUtils
|
|
331
|
+
JsonUtils.toJsonString(obj); // ❌ leniu 用 JacksonUtil
|
|
332
|
+
|
|
333
|
+
// 错误 5: 使用 RuoYi 的 TenantHelper
|
|
334
|
+
TenantHelper.getTenantId(); // ❌ leniu 用 TenantContextHolder
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### ✅ 正确写法
|
|
338
|
+
|
|
339
|
+
```java
|
|
340
|
+
// 正确 1: 使用 leniu 的 BeanUtil
|
|
341
|
+
BeanUtil.copyProperties(source, Target.class); // ✅
|
|
342
|
+
|
|
343
|
+
// 正确 2: 使用 Hutool 的 StrUtil
|
|
344
|
+
StrUtil.isBlank(str); // ✅
|
|
345
|
+
|
|
346
|
+
// 正确 3: 使用 leniu 的 RedisUtil
|
|
347
|
+
RedisUtil.setString(key, value); // ✅
|
|
348
|
+
|
|
349
|
+
// 正确 4: 使用 leniu 的 JacksonUtil
|
|
350
|
+
JacksonUtil.writeValueAsString(obj); // ✅
|
|
351
|
+
|
|
352
|
+
// 正确 5: 使用 leniu 的 TenantContextHolder
|
|
353
|
+
TenantContextHolder.getTenantId(); // ✅
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 工具类选择决策
|
|
359
|
+
|
|
360
|
+
| 场景 | RuoYi-Vue-Plus | leniu-tengyun-core |
|
|
361
|
+
|------|----------------|-------------------|
|
|
362
|
+
| 对象转换 | `MapstructUtils.convert()` | `BeanUtil.copyProperties()` |
|
|
363
|
+
| 集合判空 | `CollUtil.isEmpty()` | `CollUtil.isEmpty()` |
|
|
364
|
+
| 对象判空 | `ObjectUtil.isNull()` | `ObjectUtil.isNull()` |
|
|
365
|
+
| 字符串判空 | `StringUtils.isBlank()` | `StrUtil.isBlank()` |
|
|
366
|
+
| JSON序列化 | `JsonUtils.toJsonString()` | `JacksonUtil.writeValueAsString()` |
|
|
367
|
+
| Redis缓存 | `RedisUtils.setCacheObject()` | `RedisUtil.setString()` |
|
|
368
|
+
| 模糊查询 | `"%" + keyword + "%"` | `LeBeanUtil.fieldLikeHandle()` |
|
|
369
|
+
| 租户ID | `LoginHelper.getTenantId()` | `TenantContextHolder.getTenantId()` |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## 相关技能
|
|
374
|
+
|
|
375
|
+
| 需要了解 | 激活 Skill |
|
|
376
|
+
|---------|-----------|
|
|
377
|
+
| Entity/VO/DTO 设计 | `leniu-java-entity` |
|
|
378
|
+
| MyBatis 使用 | `leniu-java-mybatis` |
|
|
379
|
+
| 异常处理 | `leniu-error-handler` |
|
|
380
|
+
| 数据库设计 | `leniu-database-ops` |
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-apply-change
|
|
3
|
+
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.1.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Implement tasks from an OpenSpec change.
|
|
13
|
+
|
|
14
|
+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **Select the change**
|
|
19
|
+
|
|
20
|
+
If a name is provided, use it. Otherwise:
|
|
21
|
+
- Infer from conversation context if the user mentioned a change
|
|
22
|
+
- Auto-select if only one active change exists
|
|
23
|
+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
24
|
+
|
|
25
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
26
|
+
|
|
27
|
+
2. **Check status to understand the schema**
|
|
28
|
+
```bash
|
|
29
|
+
openspec status --change "<name>" --json
|
|
30
|
+
```
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
33
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
34
|
+
|
|
35
|
+
3. **Get apply instructions**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openspec instructions apply --change "<name>" --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This returns:
|
|
42
|
+
- Context file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
43
|
+
- Progress (total, complete, remaining)
|
|
44
|
+
- Task list with status
|
|
45
|
+
- Dynamic instruction based on current state
|
|
46
|
+
|
|
47
|
+
**Handle states:**
|
|
48
|
+
- If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
|
|
49
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
50
|
+
- Otherwise: proceed to implementation
|
|
51
|
+
|
|
52
|
+
4. **Read context files**
|
|
53
|
+
|
|
54
|
+
Read the files listed in `contextFiles` from the apply instructions output.
|
|
55
|
+
The files depend on the schema being used:
|
|
56
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
57
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
58
|
+
|
|
59
|
+
5. **Show current progress**
|
|
60
|
+
|
|
61
|
+
Display:
|
|
62
|
+
- Schema being used
|
|
63
|
+
- Progress: "N/M tasks complete"
|
|
64
|
+
- Remaining tasks overview
|
|
65
|
+
- Dynamic instruction from CLI
|
|
66
|
+
|
|
67
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
68
|
+
|
|
69
|
+
For each pending task:
|
|
70
|
+
- Show which task is being worked on
|
|
71
|
+
- Make the code changes required
|
|
72
|
+
- Keep changes minimal and focused
|
|
73
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
74
|
+
- Continue to next task
|
|
75
|
+
|
|
76
|
+
**Pause if:**
|
|
77
|
+
- Task is unclear → ask for clarification
|
|
78
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
79
|
+
- Error or blocker encountered → report and wait for guidance
|
|
80
|
+
- User interrupts
|
|
81
|
+
|
|
82
|
+
7. **On completion or pause, show status**
|
|
83
|
+
|
|
84
|
+
Display:
|
|
85
|
+
- Tasks completed this session
|
|
86
|
+
- Overall progress: "N/M tasks complete"
|
|
87
|
+
- If all done: suggest archive
|
|
88
|
+
- If paused: explain why and wait for guidance
|
|
89
|
+
|
|
90
|
+
**Output During Implementation**
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
94
|
+
|
|
95
|
+
Working on task 3/7: <task description>
|
|
96
|
+
[...implementation happening...]
|
|
97
|
+
✓ Task complete
|
|
98
|
+
|
|
99
|
+
Working on task 4/7: <task description>
|
|
100
|
+
[...implementation happening...]
|
|
101
|
+
✓ Task complete
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Output On Completion**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
## Implementation Complete
|
|
108
|
+
|
|
109
|
+
**Change:** <change-name>
|
|
110
|
+
**Schema:** <schema-name>
|
|
111
|
+
**Progress:** 7/7 tasks complete ✓
|
|
112
|
+
|
|
113
|
+
### Completed This Session
|
|
114
|
+
- [x] Task 1
|
|
115
|
+
- [x] Task 2
|
|
116
|
+
...
|
|
117
|
+
|
|
118
|
+
All tasks complete! Ready to archive this change.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Output On Pause (Issue Encountered)**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
## Implementation Paused
|
|
125
|
+
|
|
126
|
+
**Change:** <change-name>
|
|
127
|
+
**Schema:** <schema-name>
|
|
128
|
+
**Progress:** 4/7 tasks complete
|
|
129
|
+
|
|
130
|
+
### Issue Encountered
|
|
131
|
+
<description of the issue>
|
|
132
|
+
|
|
133
|
+
**Options:**
|
|
134
|
+
1. <option 1>
|
|
135
|
+
2. <option 2>
|
|
136
|
+
3. Other approach
|
|
137
|
+
|
|
138
|
+
What would you like to do?
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Guardrails**
|
|
142
|
+
- Keep going through tasks until done or blocked
|
|
143
|
+
- Always read context files before starting (from the apply instructions output)
|
|
144
|
+
- If task is ambiguous, pause and ask before implementing
|
|
145
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
146
|
+
- Keep code changes minimal and scoped to each task
|
|
147
|
+
- Update task checkbox immediately after completing each task
|
|
148
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
149
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
150
|
+
|
|
151
|
+
**Fluid Workflow Integration**
|
|
152
|
+
|
|
153
|
+
This skill supports the "actions on a change" model:
|
|
154
|
+
|
|
155
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
156
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-archive-change
|
|
3
|
+
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.1.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive a completed change in the experimental workflow.
|
|
13
|
+
|
|
14
|
+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **If no change name provided, prompt for selection**
|
|
19
|
+
|
|
20
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
21
|
+
|
|
22
|
+
Show only active changes (not already archived).
|
|
23
|
+
Include the schema used for each change if available.
|
|
24
|
+
|
|
25
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
26
|
+
|
|
27
|
+
2. **Check artifact completion status**
|
|
28
|
+
|
|
29
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
30
|
+
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used
|
|
33
|
+
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
34
|
+
|
|
35
|
+
**If any artifacts are not `done`:**
|
|
36
|
+
- Display warning listing incomplete artifacts
|
|
37
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
38
|
+
- Proceed if user confirms
|
|
39
|
+
|
|
40
|
+
3. **Check task completion status**
|
|
41
|
+
|
|
42
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
43
|
+
|
|
44
|
+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
45
|
+
|
|
46
|
+
**If incomplete tasks found:**
|
|
47
|
+
- Display warning showing count of incomplete tasks
|
|
48
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
49
|
+
- Proceed if user confirms
|
|
50
|
+
|
|
51
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
52
|
+
|
|
53
|
+
4. **Assess delta spec sync state**
|
|
54
|
+
|
|
55
|
+
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
|
|
56
|
+
|
|
57
|
+
**If delta specs exist:**
|
|
58
|
+
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
|
|
59
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
60
|
+
- Show a combined summary before prompting
|
|
61
|
+
|
|
62
|
+
**Prompt options:**
|
|
63
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
64
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
65
|
+
|
|
66
|
+
If user chooses sync, execute /opsx:sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of choice.
|
|
67
|
+
|
|
68
|
+
5. **Perform the archive**
|
|
69
|
+
|
|
70
|
+
Create the archive directory if it doesn't exist:
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p openspec/changes/archive
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Generate target name using current date: `YYYY-MM-DD-<change-name>`
|
|
76
|
+
|
|
77
|
+
**Check if target already exists:**
|
|
78
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
79
|
+
- If no: Move the change directory to archive
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
6. **Display summary**
|
|
86
|
+
|
|
87
|
+
Show archive completion summary including:
|
|
88
|
+
- Change name
|
|
89
|
+
- Schema that was used
|
|
90
|
+
- Archive location
|
|
91
|
+
- Whether specs were synced (if applicable)
|
|
92
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
93
|
+
|
|
94
|
+
**Output On Success**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
## Archive Complete
|
|
98
|
+
|
|
99
|
+
**Change:** <change-name>
|
|
100
|
+
**Schema:** <schema-name>
|
|
101
|
+
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
102
|
+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
103
|
+
|
|
104
|
+
All artifacts complete. All tasks complete.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Guardrails**
|
|
108
|
+
- Always prompt for change selection if not provided
|
|
109
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
110
|
+
- Don't block archive on warnings - just inform and confirm
|
|
111
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
112
|
+
- Show clear summary of what happened
|
|
113
|
+
- If sync is requested, use openspec-sync-specs approach (agent-driven)
|
|
114
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|