@ia-ccun/code-agent-cli 0.0.2 → 0.0.4-8.beta.1

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.
Files changed (189) hide show
  1. package/README.md +92 -11
  2. package/bin/cli.js +212 -59
  3. package/config/agent/APPEND_SYSTEM.md +46 -5
  4. package/config/agent/bin/fd +0 -0
  5. package/config/agent/bin/rg +0 -0
  6. package/config/agent/dangerous-patterns.json +106 -0
  7. package/config/agent/extensions/aicode-tips.ts +191 -0
  8. package/config/agent/extensions/bash-check.ts +227 -0
  9. package/config/agent/extensions/context-monitor.ts +275 -0
  10. package/config/agent/extensions/context.ts +1 -0
  11. package/config/agent/extensions/custom-footer.ts +33 -2
  12. package/config/agent/extensions/custom.ts +24 -91
  13. package/config/agent/extensions/error-monitor.ts +142 -0
  14. package/config/agent/extensions/msg-debug.ts +185 -0
  15. package/config/agent/extensions/review.ts +4 -0
  16. package/config/agent/extensions/working-msg.ts +39 -20
  17. package/config/agent/mcp.json +4 -0
  18. package/config/agent/models.json +16 -43
  19. package/config/agent/prompts/code-simplifier.md +51 -0
  20. package/config/agent/prompts/feat.md +2 -2
  21. package/config/agent/prompts/git-commit.md +9 -15
  22. package/config/agent/prompts/init-project.md +2 -1
  23. package/config/agent/prompts/workflow.md +3 -2
  24. package/config/agent/settings.json +17 -5
  25. package/config/agent/skills/brainstorming/SKILL.md +167 -0
  26. package/config/agent/skills/brainstorming/scripts/frame-template.html +214 -0
  27. package/config/agent/skills/brainstorming/scripts/helper.js +88 -0
  28. package/config/agent/skills/brainstorming/scripts/server.cjs +338 -0
  29. package/config/agent/skills/brainstorming/scripts/start-server.sh +153 -0
  30. package/config/agent/skills/brainstorming/scripts/stop-server.sh +55 -0
  31. package/config/agent/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  32. package/config/agent/skills/brainstorming/visual-companion.md +286 -0
  33. package/config/agent/skills/code-review/SKILL.md +4 -2
  34. package/config/agent/skills/commit/SKILL.md +10 -5
  35. package/config/agent/skills/csv-data-summarizer/SKILL.md +2 -1
  36. package/config/agent/skills/design-md/README.md +34 -0
  37. package/config/agent/skills/design-md/SKILL.md +172 -0
  38. package/config/agent/skills/design-md/examples/DESIGN.md +154 -0
  39. package/config/agent/skills/dispatching-parallel-agents/SKILL.md +185 -0
  40. package/config/agent/skills/executing-plans/SKILL.md +73 -0
  41. package/config/agent/skills/find-skills/SKILL.md +5 -1
  42. package/config/agent/skills/finishing-a-development-branch/SKILL.md +204 -0
  43. package/config/agent/skills/fireworks-tech-graph/LICENSE +21 -0
  44. package/config/agent/skills/fireworks-tech-graph/README.md +528 -0
  45. package/config/agent/skills/fireworks-tech-graph/README.zh.md +499 -0
  46. package/config/agent/skills/fireworks-tech-graph/SKILL.md +537 -0
  47. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +101 -0
  48. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +4 -0
  49. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  50. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  51. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  52. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  53. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  54. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  55. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  56. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +181 -0
  57. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +40 -0
  58. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +297 -0
  59. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +64 -0
  60. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +45 -0
  61. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +48 -0
  62. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +182 -0
  63. package/config/agent/skills/fireworks-tech-graph/package.json +42 -0
  64. package/config/agent/skills/fireworks-tech-graph/references/icons.md +406 -0
  65. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +108 -0
  66. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +107 -0
  67. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +113 -0
  68. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +94 -0
  69. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +125 -0
  70. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +209 -0
  71. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +215 -0
  72. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +135 -0
  73. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +100 -0
  74. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +244 -0
  75. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +157 -0
  76. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +1556 -0
  77. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +135 -0
  78. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +292 -0
  79. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +28 -0
  80. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +23 -0
  81. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +14 -0
  82. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +28 -0
  83. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +21 -0
  84. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +21 -0
  85. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +20 -0
  86. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +20 -0
  87. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +19 -0
  88. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +21 -0
  89. package/config/agent/skills/frontend-design/SKILL.md +4 -1
  90. package/config/agent/skills/hello/SKILL.md +5 -2
  91. package/config/agent/skills/impeccable/adapt/SKILL.md +204 -0
  92. package/config/agent/skills/impeccable/animate/SKILL.md +177 -0
  93. package/config/agent/skills/impeccable/arrange/SKILL.md +127 -0
  94. package/config/agent/skills/impeccable/audit/SKILL.md +128 -0
  95. package/config/agent/skills/impeccable/bolder/SKILL.md +119 -0
  96. package/config/agent/skills/impeccable/clarify/SKILL.md +185 -0
  97. package/config/agent/skills/impeccable/colorize/SKILL.md +145 -0
  98. package/config/agent/skills/impeccable/critique/SKILL.md +122 -0
  99. package/config/agent/skills/impeccable/delight/SKILL.md +306 -0
  100. package/config/agent/skills/impeccable/distill/SKILL.md +124 -0
  101. package/config/agent/skills/impeccable/extract/SKILL.md +94 -0
  102. package/config/agent/skills/impeccable/frontend-design/reference/color-and-contrast.md +132 -0
  103. package/config/agent/skills/impeccable/frontend-design/reference/interaction-design.md +123 -0
  104. package/config/agent/skills/impeccable/frontend-design/reference/motion-design.md +99 -0
  105. package/config/agent/skills/impeccable/frontend-design/reference/responsive-design.md +114 -0
  106. package/config/agent/skills/impeccable/frontend-design/reference/spatial-design.md +100 -0
  107. package/config/agent/skills/impeccable/frontend-design/reference/typography.md +133 -0
  108. package/config/agent/skills/impeccable/frontend-design/reference/ux-writing.md +107 -0
  109. package/config/agent/skills/impeccable/harden/SKILL.md +357 -0
  110. package/config/agent/skills/impeccable/normalize/SKILL.md +73 -0
  111. package/config/agent/skills/impeccable/onboard/SKILL.md +248 -0
  112. package/config/agent/skills/impeccable/optimize/SKILL.md +268 -0
  113. package/config/agent/skills/impeccable/overdrive/SKILL.md +144 -0
  114. package/config/agent/skills/impeccable/polish/SKILL.md +205 -0
  115. package/config/agent/skills/impeccable/quieter/SKILL.md +105 -0
  116. package/config/agent/skills/impeccable/teach-impeccable/SKILL.md +71 -0
  117. package/config/agent/skills/impeccable/typeset/SKILL.md +118 -0
  118. package/config/agent/skills/librarian/SKILL.md +5 -1
  119. package/config/agent/skills/markdown-to-html/SKILL.md +5 -2
  120. package/config/agent/skills/owasp-security/SKILL.md +539 -0
  121. package/config/agent/skills/pr/SKILL.md +5 -2
  122. package/config/agent/skills/receiving-code-review/SKILL.md +216 -0
  123. package/config/agent/skills/refactor/SKILL.md +5 -2
  124. package/config/agent/skills/requesting-code-review/SKILL.md +108 -0
  125. package/config/agent/skills/requesting-code-review/code-reviewer.md +146 -0
  126. package/config/agent/skills/session-learning/SKILL.md +185 -0
  127. package/config/agent/skills/skill-creator/SKILL.md +339 -213
  128. package/config/agent/skills/skill-creator/agents/analyzer.md +274 -0
  129. package/config/agent/skills/skill-creator/agents/comparator.md +202 -0
  130. package/config/agent/skills/skill-creator/agents/grader.md +223 -0
  131. package/config/agent/skills/skill-creator/assets/eval_review.html +146 -0
  132. package/config/agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  133. package/config/agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  134. package/config/agent/skills/skill-creator/references/schemas.md +430 -0
  135. package/config/agent/skills/skill-creator/scripts/__init__.py +0 -0
  136. package/config/agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  137. package/config/agent/skills/skill-creator/scripts/generate_report.py +326 -0
  138. package/config/agent/skills/skill-creator/scripts/improve_description.py +248 -0
  139. package/config/agent/skills/skill-creator/scripts/package_skill.py +33 -7
  140. package/config/agent/skills/skill-creator/scripts/quick_validate.py +11 -3
  141. package/config/agent/skills/skill-creator/scripts/run_eval.py +310 -0
  142. package/config/agent/skills/skill-creator/scripts/run_loop.py +332 -0
  143. package/config/agent/skills/skill-creator/scripts/utils.py +47 -0
  144. package/config/agent/skills/subagent-driven-development/SKILL.md +280 -0
  145. package/config/agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  146. package/config/agent/skills/subagent-driven-development/implementer-prompt.md +113 -0
  147. package/config/agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  148. package/config/agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
  149. package/config/agent/skills/systematic-debugging/SKILL.md +300 -0
  150. package/config/agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  151. package/config/agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
  152. package/config/agent/skills/systematic-debugging/defense-in-depth.md +122 -0
  153. package/config/agent/skills/systematic-debugging/find-polluter.sh +63 -0
  154. package/config/agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
  155. package/config/agent/skills/systematic-debugging/test-academic.md +14 -0
  156. package/config/agent/skills/systematic-debugging/test-pressure-1.md +58 -0
  157. package/config/agent/skills/systematic-debugging/test-pressure-2.md +68 -0
  158. package/config/agent/skills/systematic-debugging/test-pressure-3.md +69 -0
  159. package/config/agent/skills/test-driven-development/SKILL.md +375 -0
  160. package/config/agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
  161. package/config/agent/skills/ui-ux-pro-max/SKILL.md +4 -1
  162. package/config/agent/skills/unit-test/SKILL.md +4 -2
  163. package/config/agent/skills/using-git-worktrees/SKILL.md +222 -0
  164. package/config/agent/skills/using-superpowers/SKILL.md +118 -0
  165. package/config/agent/skills/using-superpowers/references/codex-tools.md +25 -0
  166. package/config/agent/skills/using-superpowers/references/gemini-tools.md +33 -0
  167. package/config/agent/skills/verification-before-completion/SKILL.md +142 -0
  168. package/config/agent/skills/writing-plans/SKILL.md +148 -0
  169. package/config/agent/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  170. package/config/agent/skills/writing-skills/SKILL.md +669 -0
  171. package/config/agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
  172. package/config/agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  173. package/config/agent/skills/writing-skills/graphviz-conventions.dot +172 -0
  174. package/config/agent/skills/writing-skills/persuasion-principles.md +187 -0
  175. package/config/agent/skills/writing-skills/render-graphs.js +168 -0
  176. package/config/agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  177. package/config.json +23 -2
  178. package/dist/banner.js +3 -3
  179. package/dist/banner.js.map +1 -1
  180. package/package.json +20 -15
  181. package/scripts/banner.txt +6 -0
  182. package/scripts/postinstall.js +203 -11
  183. package/config/agent/prompts/git-rollback.md +0 -91
  184. package/config/agent/prompts/git-worktree.md +0 -277
  185. package/config/agent/prompts/help.md +0 -10
  186. package/config/agent/skills/github/SKILL.md +0 -47
  187. package/config/agent/skills/skill-creator/references/output-patterns.md +0 -82
  188. package/config/agent/skills/skill-creator/references/workflows.md +0 -28
  189. package/config/agent/skills/skill-creator/scripts/init_skill.py +0 -303
@@ -1,53 +1,26 @@
1
1
  {
2
2
  "providers": {
3
- "openai": {
4
- "name": "OpenAI",
5
- "baseUrl": "https://api.openai.com/v1",
6
- "api": "chat-completions",
7
- "apiKey": "YOUR_API_KEY_HERE",
3
+ "local": {
4
+ "name": "local",
5
+ "baseUrl": "https://ai-llm.cc.com/v1",
6
+ "api": "openai-completions",
7
+ "apiKey": "你自己的APIKEY",
8
+ "headers": {
9
+ "User-Agent": "${VERSION}"
10
+ },
8
11
  "models": [
9
12
  {
10
- "id": "gpt-4o",
11
- "name": "GPT-4o",
12
- "contextWindow": 128000,
13
- "maxTokens": 16384,
14
- "reasoning": false,
15
- "input": ["text"],
16
- "cost": {
17
- "input": 2.5,
18
- "output": 10
19
- }
20
- },
21
- {
22
- "id": "gpt-4o-mini",
23
- "name": "GPT-4o Mini",
24
- "contextWindow": 128000,
25
- "maxTokens": 16384,
26
- "reasoning": false,
27
- "input": ["text"],
28
- "cost": {
29
- "input": 0.075,
30
- "output": 0.3
31
- }
32
- }
33
- ]
34
- },
35
- "anthropic": {
36
- "name": "Anthropic",
37
- "baseUrl": "https://api.anthropic.com",
38
- "api": "anthropic-messages",
39
- "apiKey": "YOUR_API_KEY_HERE",
40
- "models": [
41
- {
42
- "id": "claude-sonnet-4-20250514",
43
- "name": "Claude Sonnet 4",
44
- "contextWindow": 200000,
45
- "maxTokens": 8192,
13
+ "id": "GLM-4.7-W8A8",
14
+ "name": "GLM4.7",
15
+ "contextWindow": 120000,
16
+ "maxTokens": 100000,
46
17
  "reasoning": true,
47
18
  "input": ["text"],
48
19
  "cost": {
49
- "input": 3,
50
- "output": 15
20
+ "input": 5,
21
+ "output": 5,
22
+ "cacheRead": 0,
23
+ "cacheWrite": 0
51
24
  }
52
25
  }
53
26
  ]
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: code-simplifier
3
+ description: "Simplifies and refines code for clarity and maintainability while preserving functionality."
4
+ ---
5
+
6
+ You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer.
7
+
8
+ You will analyze recently modified code and apply refinements that:
9
+
10
+ 1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.
11
+
12
+ 2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including:
13
+
14
+ - Use ES modules with proper import sorting and extensions
15
+ - Prefer `function` keyword over arrow functions
16
+ - Use explicit return type annotations for top-level functions
17
+ - Follow proper React component patterns with explicit Props types
18
+ - Use proper error handling patterns (avoid try/catch when possible)
19
+ - Maintain consistent naming conventions
20
+
21
+ 3. **Enhance Clarity**: Simplify code structure by:
22
+
23
+ - Reducing unnecessary complexity and nesting
24
+ - Eliminating redundant code and abstractions
25
+ - Improving readability through clear variable and function names
26
+ - Consolidating related logic
27
+ - Removing unnecessary comments that describe obvious code
28
+ - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
29
+ - Choose clarity over brevity - explicit code is often better than overly compact code
30
+
31
+ 4. **Maintain Balance**: Avoid over-simplification that could:
32
+
33
+ - Reduce code clarity or maintainability
34
+ - Create overly clever solutions that are hard to understand
35
+ - Combine too many concerns into single functions or components
36
+ - Remove helpful abstractions that improve code organization
37
+ - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners)
38
+ - Make the code harder to debug or extend
39
+
40
+ 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
41
+
42
+ Your refinement process:
43
+
44
+ 1. Identify the recently modified code sections
45
+ 2. Analyze for opportunities to improve elegance and consistency
46
+ 3. Apply project-specific best practices and coding standards
47
+ 4. Ensure all functionality remains unchanged
48
+ 5. Verify the refined code is simpler and more maintainable
49
+ 6. Document only significant changes that affect understanding
50
+
51
+ You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: feat
3
- description: '用于新增功能开发的命令,支持完整的开发流程和工具集成'
3
+ description: "用于新增功能开发的命令,支持完整的开发流程和工具集成"
4
4
  ---
5
5
 
6
6
  $ARGUMENTS
@@ -31,7 +31,7 @@ $ARGUMENTS
31
31
 
32
32
  - 生成详细的 markdown 规划文档
33
33
 
34
- - 将文档存储至 `./.aicode/plan` 目录,并以 plan/xxx.md 的格式命名
34
+ - 将文档存储至 `./.aicode-cli/plan` 目录,并以 plan/xxx.md 的格式命名
35
35
 
36
36
  - 包含:目标定义、功能分解、实施步骤、验收标准
37
37
 
@@ -1,18 +1,9 @@
1
1
  ---
2
- description: 仅用 Git 分析改动并自动生成 conventional commit 信息(可选 emoji);必要时建议拆分提交,默认运行本地 Git 钩子(可 --no-verify 跳过)
3
- allowed-tools: Read(**), Exec(git status, git diff, git add, git restore --staged, git commit, git rev-parse, git config), Write(.git/COMMIT_EDITMSG)
4
- argument-hint: "[--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <scope>] [--type <type>]"
2
+ name: git-commit
3
+ description: "分析 Git 改动并生成 conventional commit 信息,支持 emoji、提交拆分和 Git 钩子控制"
5
4
  ---
6
5
 
7
- # examples:
8
- # - /git-commit # 分析当前改动,生成提交信息
9
- # - /git-commit --all # 暂存所有改动并提交
10
- # - /git-commit --no-verify # 跳过 Git 钩子检查
11
- # - /git-commit --emoji # 在提交信息中包含 emoji
12
- # - /git-commit --scope ui --type feat # 指定作用域和类型
13
- # - /git-commit --amend --signoff # 修补上次提交并签名
14
-
15
- # Claude Command: Commit (Git-only)
6
+ # Command: Commit (Git-only)
16
7
 
17
8
  该命令在**不依赖任何包管理器/构建工具**的前提下,仅通过 **Git**:
18
9
 
@@ -26,8 +17,7 @@ argument-hint: "[--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <
26
17
  ## Usage
27
18
 
28
19
  ```bash
29
- /git-commit
30
- /git-commit --no-verify
20
+ /git-commit
31
21
  /git-commit --emoji
32
22
  /git-commit --all --signoff
33
23
  /git-commit --amend
@@ -36,7 +26,7 @@ argument-hint: "[--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <
36
26
 
37
27
  ### Options
38
28
 
39
- - `--no-verify`:跳过本地 Git 钩子(`pre-commit`/`commit-msg` 等)。
29
+
40
30
  - `--all`:当暂存区为空时,自动 `git add -A` 将所有改动纳入本次提交。
41
31
  - `--amend`:在不创建新提交的情况下**修补**上一次提交(保持提交作者与时间,除非本地 Git 配置另有指定)。
42
32
  - `--signoff`:附加 `Signed-off-by` 行(遵循 DCO 流程时使用)。
@@ -69,6 +59,10 @@ argument-hint: "[--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <
69
59
  - 生成消息头:`[<emoji>] <type>(<scope>)?: <subject>`(首行 ≤ 72 字符,祈使语气,仅在使用 `--emoji` 时包含 emoji)。
70
60
  - 生成消息体:要点列表(动机、实现要点、影响范围、BREAKING CHANGE 如有)。
71
61
  - 根据 Git 历史提交的主要语言选择提交信息语言。优先检查最近提交主题(例如 `git log -n 50 --pretty=%s`)判断中文/英文;若无法判断,则回退到仓库主要语言或英文。
62
+ - **必须添加 AI 署名块**,用于标识 AI 参与贡献:
63
+ ```
64
+ Co-Authored-By: AICode CLI <noreply@aicode-cli>
65
+ ```
72
66
  - 将草稿写入 `.git/COMMIT_EDITMSG`,并用于 `git commit`。
73
67
 
74
68
  5. **执行提交**
@@ -1,5 +1,6 @@
1
1
  ---
2
- description: 初始化项目 AI 上下文,生成/更新根级与模块级 CLAUDE.md 索引
2
+ name: init-project
3
+ description: "初始化项目 AI 上下文,生成/更新根级与模块级 CLAUDE.md 索引"
3
4
  allowed-tools: Read(**), Write(CLAUDE.md, **/CLAUDE.md)
4
5
  argument-hint: <项目摘要或名称>
5
6
  ---
@@ -1,5 +1,6 @@
1
1
  ---
2
- description: '专业AI编程助手,提供结构化六阶段开发工作流(研究→构思→计划→执行→优化→评审),适用于专业开发者'
2
+ name: workflow
3
+ description: "专业AI编程助手,提供结构化六阶段开发工作流(研究→构思→计划→执行→优化→评审),适用于专业开发者"
3
4
  ---
4
5
 
5
6
  # Workflow - 专业开发助手
@@ -176,7 +177,7 @@ description: '专业AI编程助手,提供结构化六阶段开发工作流(
176
177
 
177
178
  ```
178
179
  project/ # 项目根目录
179
- ├── .claude/
180
+ ├── .aicode-cli/
180
181
  │ └── plan/
181
182
  │ └── 任务名.md # 执行计划和上下文(在项目根目录)
182
183
  ├── src/
@@ -1,7 +1,19 @@
1
1
  {
2
- "defaultProvider": "minimax-custom",
3
- "defaultModel": "MiniMax-M2.5",
4
- "quietStartup": true,
5
-
6
- "theme": "light"
2
+ "quietStartup":true,
3
+ "theme":"light",
4
+ "extensions":[
5
+ "~/.aicode-cli/agent/extensions/bash-check.ts",
6
+ "~/.aicode-cli/agent/extensions/context-monitor.ts",
7
+ "~/.aicode-cli/agent/extensions/context.ts",
8
+ "~/.aicode-cli/agent/extensions/custom-footer.ts",
9
+ "~/.aicode-cli/agent/extensions/custom.ts",
10
+ "~/.aicode-cli/agent/extensions/review.ts",
11
+ "~/.aicode-cli/agent/extensions/working-msg.ts"
12
+ ],
13
+ "packages":[
14
+ "npm:pi-subagents",
15
+ "npm:pi-rewind",
16
+ "npm:pi-btw",
17
+ "npm:pi-mcp-adapter"
18
+ ]
7
19
  }
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: brainstorming
3
+ description: "Explore user intent, requirements and design before any creative work or implementation. Use when brainstorming ideas, designing features, analyzing requirements, or figuring out how to implement something."
4
+ metadata:
5
+ version: "1.0.0"
6
+ author: "xujianjiang"
7
+ ---
8
+
9
+ # Brainstorming Ideas Into Designs
10
+
11
+ Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
12
+
13
+ Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
14
+
15
+ <HARD-GATE>
16
+ Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
17
+ </HARD-GATE>
18
+
19
+ ## Anti-Pattern: "This Is Too Simple To Need A Design"
20
+
21
+ Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
22
+
23
+ ## Checklist
24
+
25
+ You MUST create a task for each of these items and complete them in order:
26
+
27
+ 1. **Explore project context** — check files, docs, recent commits
28
+ 2. **Offer visual companion** (if topic will involve visual questions) — this is its own message, not combined with a clarifying question. See the Visual Companion section below.
29
+ 3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
30
+ 4. **Propose 2-3 approaches** — with trade-offs and your recommendation
31
+ 5. **Present design** — in sections scaled to their complexity, get user approval after each section
32
+ 6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit
33
+ 7. **Spec review loop** — dispatch spec-document-reviewer subagent with precisely crafted review context (never your session history); fix issues and re-dispatch until approved (max 3 iterations, then surface to human)
34
+ 8. **User reviews written spec** — ask user to review the spec file before proceeding
35
+ 9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
36
+
37
+ ## Process Flow
38
+
39
+ ```dot
40
+ digraph brainstorming {
41
+ "Explore project context" [shape=box];
42
+ "Visual questions ahead?" [shape=diamond];
43
+ "Offer Visual Companion\n(own message, no other content)" [shape=box];
44
+ "Ask clarifying questions" [shape=box];
45
+ "Propose 2-3 approaches" [shape=box];
46
+ "Present design sections" [shape=box];
47
+ "User approves design?" [shape=diamond];
48
+ "Write design doc" [shape=box];
49
+ "Spec review loop" [shape=box];
50
+ "Spec review passed?" [shape=diamond];
51
+ "User reviews spec?" [shape=diamond];
52
+ "Invoke writing-plans skill" [shape=doublecircle];
53
+
54
+ "Explore project context" -> "Visual questions ahead?";
55
+ "Visual questions ahead?" -> "Offer Visual Companion\n(own message, no other content)" [label="yes"];
56
+ "Visual questions ahead?" -> "Ask clarifying questions" [label="no"];
57
+ "Offer Visual Companion\n(own message, no other content)" -> "Ask clarifying questions";
58
+ "Ask clarifying questions" -> "Propose 2-3 approaches";
59
+ "Propose 2-3 approaches" -> "Present design sections";
60
+ "Present design sections" -> "User approves design?";
61
+ "User approves design?" -> "Present design sections" [label="no, revise"];
62
+ "User approves design?" -> "Write design doc" [label="yes"];
63
+ "Write design doc" -> "Spec review loop";
64
+ "Spec review loop" -> "Spec review passed?";
65
+ "Spec review passed?" -> "Spec review loop" [label="issues found,\nfix and re-dispatch"];
66
+ "Spec review passed?" -> "User reviews spec?" [label="approved"];
67
+ "User reviews spec?" -> "Write design doc" [label="changes requested"];
68
+ "User reviews spec?" -> "Invoke writing-plans skill" [label="approved"];
69
+ }
70
+ ```
71
+
72
+ **The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
73
+
74
+ ## The Process
75
+
76
+ **Understanding the idea:**
77
+
78
+ - Check out the current project state first (files, docs, recent commits)
79
+ - Before asking detailed questions, assess scope: if the request describes multiple independent subsystems (e.g., "build a platform with chat, file storage, billing, and analytics"), flag this immediately. Don't spend questions refining details of a project that needs to be decomposed first.
80
+ - If the project is too large for a single spec, help the user decompose into sub-projects: what are the independent pieces, how do they relate, what order should they be built? Then brainstorm the first sub-project through the normal design flow. Each sub-project gets its own spec → plan → implementation cycle.
81
+ - For appropriately-scoped projects, ask questions one at a time to refine the idea
82
+ - Prefer multiple choice questions when possible, but open-ended is fine too
83
+ - Only one question per message - if a topic needs more exploration, break it into multiple questions
84
+ - Focus on understanding: purpose, constraints, success criteria
85
+
86
+ **Exploring approaches:**
87
+
88
+ - Propose 2-3 different approaches with trade-offs
89
+ - Present options conversationally with your recommendation and reasoning
90
+ - Lead with your recommended option and explain why
91
+
92
+ **Presenting the design:**
93
+
94
+ - Once you believe you understand what you're building, present the design
95
+ - Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
96
+ - Ask after each section whether it looks right so far
97
+ - Cover: architecture, components, data flow, error handling, testing
98
+ - Be ready to go back and clarify if something doesn't make sense
99
+
100
+ **Design for isolation and clarity:**
101
+
102
+ - Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
103
+ - For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
104
+ - Can someone understand what a unit does without reading its internals? Can you change the internals without breaking consumers? If not, the boundaries need work.
105
+ - Smaller, well-bounded units are also easier for you to work with - you reason better about code you can hold in context at once, and your edits are more reliable when files are focused. When a file grows large, that's often a signal that it's doing too much.
106
+
107
+ **Working in existing codebases:**
108
+
109
+ - Explore the current structure before proposing changes. Follow existing patterns.
110
+ - Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
111
+ - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
112
+
113
+ ## After the Design
114
+
115
+ **Documentation:**
116
+
117
+ - Write the validated design (spec) to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
118
+ - (User preferences for spec location override this default)
119
+ - Use elements-of-style:writing-clearly-and-concisely skill if available
120
+ - Commit the design document to git
121
+
122
+ **Spec Review Loop:**
123
+ After writing the spec document:
124
+
125
+ 1. Dispatch spec-document-reviewer subagent (see spec-document-reviewer-prompt.md)
126
+ 2. If Issues Found: fix, re-dispatch, repeat until Approved
127
+ 3. If loop exceeds 3 iterations, surface to human for guidance
128
+
129
+ **User Review Gate:**
130
+ After the spec review loop passes, ask the user to review the written spec before proceeding:
131
+
132
+ > "Spec written and committed to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
133
+
134
+ Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
135
+
136
+ **Implementation:**
137
+
138
+ - Invoke the writing-plans skill to create a detailed implementation plan
139
+ - Do NOT invoke any other skill. writing-plans is the next step.
140
+
141
+ ## Key Principles
142
+
143
+ - **One question at a time** - Don't overwhelm with multiple questions
144
+ - **Multiple choice preferred** - Easier to answer than open-ended when possible
145
+ - **YAGNI ruthlessly** - Remove unnecessary features from all designs
146
+ - **Explore alternatives** - Always propose 2-3 approaches before settling
147
+ - **Incremental validation** - Present design, get approval before moving on
148
+ - **Be flexible** - Go back and clarify when something doesn't make sense
149
+
150
+ ## Visual Companion
151
+
152
+ A browser-based companion for showing mockups, diagrams, and visual options during brainstorming. Available as a tool — not a mode. Accepting the companion means it's available for questions that benefit from visual treatment; it does NOT mean every question goes through the browser.
153
+
154
+ **Offering the companion:** When you anticipate that upcoming questions will involve visual content (mockups, layouts, diagrams), offer it once for consent:
155
+ > "Some of what we're working on might be easier to explain if I can show it to you in a web browser. I can put together mockups, diagrams, comparisons, and other visuals as we go. This feature is still new and can be token-intensive. Want to try it? (Requires opening a local URL)"
156
+
157
+ **This offer MUST be its own message.** Do not combine it with clarifying questions, context summaries, or any other content. The message should contain ONLY the offer above and nothing else. Wait for the user's response before continuing. If they decline, proceed with text-only brainstorming.
158
+
159
+ **Per-question decision:** Even after the user accepts, decide FOR EACH QUESTION whether to use the browser or the terminal. The test: **would the user understand this better by seeing it than reading it?**
160
+
161
+ - **Use the browser** for content that IS visual — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
162
+ - **Use the terminal** for content that is text — requirements questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
163
+
164
+ A question about a UI topic is not automatically a visual question. "What does personality mean in this context?" is a conceptual question — use the terminal. "Which wizard layout works better?" is a visual question — use the browser.
165
+
166
+ If they agree to the companion, read the detailed guide before proceeding:
167
+ `skills/brainstorming/visual-companion.md`
@@ -0,0 +1,214 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Superpowers Brainstorming</title>
6
+ <style>
7
+ /*
8
+ * BRAINSTORM COMPANION FRAME TEMPLATE
9
+ *
10
+ * This template provides a consistent frame with:
11
+ * - OS-aware light/dark theming
12
+ * - Fixed header and selection indicator bar
13
+ * - Scrollable main content area
14
+ * - CSS helpers for common UI patterns
15
+ *
16
+ * Content is injected via placeholder comment in #claude-content.
17
+ */
18
+
19
+ * { box-sizing: border-box; margin: 0; padding: 0; }
20
+ html, body { height: 100%; overflow: hidden; }
21
+
22
+ /* ===== THEME VARIABLES ===== */
23
+ :root {
24
+ --bg-primary: #f5f5f7;
25
+ --bg-secondary: #ffffff;
26
+ --bg-tertiary: #e5e5e7;
27
+ --border: #d1d1d6;
28
+ --text-primary: #1d1d1f;
29
+ --text-secondary: #86868b;
30
+ --text-tertiary: #aeaeb2;
31
+ --accent: #0071e3;
32
+ --accent-hover: #0077ed;
33
+ --success: #34c759;
34
+ --warning: #ff9f0a;
35
+ --error: #ff3b30;
36
+ --selected-bg: #e8f4fd;
37
+ --selected-border: #0071e3;
38
+ }
39
+
40
+ @media (prefers-color-scheme: dark) {
41
+ :root {
42
+ --bg-primary: #1d1d1f;
43
+ --bg-secondary: #2d2d2f;
44
+ --bg-tertiary: #3d3d3f;
45
+ --border: #424245;
46
+ --text-primary: #f5f5f7;
47
+ --text-secondary: #86868b;
48
+ --text-tertiary: #636366;
49
+ --accent: #0a84ff;
50
+ --accent-hover: #409cff;
51
+ --selected-bg: rgba(10, 132, 255, 0.15);
52
+ --selected-border: #0a84ff;
53
+ }
54
+ }
55
+
56
+ body {
57
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
58
+ background: var(--bg-primary);
59
+ color: var(--text-primary);
60
+ display: flex;
61
+ flex-direction: column;
62
+ line-height: 1.5;
63
+ }
64
+
65
+ /* ===== FRAME STRUCTURE ===== */
66
+ .header {
67
+ background: var(--bg-secondary);
68
+ padding: 0.5rem 1.5rem;
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ border-bottom: 1px solid var(--border);
73
+ flex-shrink: 0;
74
+ }
75
+ .header h1 { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
76
+ .header .status { font-size: 0.7rem; color: var(--success); display: flex; align-items: center; gap: 0.4rem; }
77
+ .header .status::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
78
+
79
+ .main { flex: 1; overflow-y: auto; }
80
+ #claude-content { padding: 2rem; min-height: 100%; }
81
+
82
+ .indicator-bar {
83
+ background: var(--bg-secondary);
84
+ border-top: 1px solid var(--border);
85
+ padding: 0.5rem 1.5rem;
86
+ flex-shrink: 0;
87
+ text-align: center;
88
+ }
89
+ .indicator-bar span {
90
+ font-size: 0.75rem;
91
+ color: var(--text-secondary);
92
+ }
93
+ .indicator-bar .selected-text {
94
+ color: var(--accent);
95
+ font-weight: 500;
96
+ }
97
+
98
+ /* ===== TYPOGRAPHY ===== */
99
+ h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
100
+ h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
101
+ .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
102
+ .section { margin-bottom: 2rem; }
103
+ .label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
104
+
105
+ /* ===== OPTIONS (for A/B/C choices) ===== */
106
+ .options { display: flex; flex-direction: column; gap: 0.75rem; }
107
+ .option {
108
+ background: var(--bg-secondary);
109
+ border: 2px solid var(--border);
110
+ border-radius: 12px;
111
+ padding: 1rem 1.25rem;
112
+ cursor: pointer;
113
+ transition: all 0.15s ease;
114
+ display: flex;
115
+ align-items: flex-start;
116
+ gap: 1rem;
117
+ }
118
+ .option:hover { border-color: var(--accent); }
119
+ .option.selected { background: var(--selected-bg); border-color: var(--selected-border); }
120
+ .option .letter {
121
+ background: var(--bg-tertiary);
122
+ color: var(--text-secondary);
123
+ width: 1.75rem; height: 1.75rem;
124
+ border-radius: 6px;
125
+ display: flex; align-items: center; justify-content: center;
126
+ font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
127
+ }
128
+ .option.selected .letter { background: var(--accent); color: white; }
129
+ .option .content { flex: 1; }
130
+ .option .content h3 { font-size: 0.95rem; margin-bottom: 0.15rem; }
131
+ .option .content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
132
+
133
+ /* ===== CARDS (for showing designs/mockups) ===== */
134
+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
135
+ .card {
136
+ background: var(--bg-secondary);
137
+ border: 1px solid var(--border);
138
+ border-radius: 12px;
139
+ overflow: hidden;
140
+ cursor: pointer;
141
+ transition: all 0.15s ease;
142
+ }
143
+ .card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
144
+ .card.selected { border-color: var(--selected-border); border-width: 2px; }
145
+ .card-image { background: var(--bg-tertiary); aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
146
+ .card-body { padding: 1rem; }
147
+ .card-body h3 { margin-bottom: 0.25rem; }
148
+ .card-body p { color: var(--text-secondary); font-size: 0.85rem; }
149
+
150
+ /* ===== MOCKUP CONTAINER ===== */
151
+ .mockup {
152
+ background: var(--bg-secondary);
153
+ border: 1px solid var(--border);
154
+ border-radius: 12px;
155
+ overflow: hidden;
156
+ margin-bottom: 1.5rem;
157
+ }
158
+ .mockup-header {
159
+ background: var(--bg-tertiary);
160
+ padding: 0.5rem 1rem;
161
+ font-size: 0.75rem;
162
+ color: var(--text-secondary);
163
+ border-bottom: 1px solid var(--border);
164
+ }
165
+ .mockup-body { padding: 1.5rem; }
166
+
167
+ /* ===== SPLIT VIEW (side-by-side comparison) ===== */
168
+ .split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
169
+ @media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
170
+
171
+ /* ===== PROS/CONS ===== */
172
+ .pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
173
+ .pros, .cons { background: var(--bg-secondary); border-radius: 8px; padding: 1rem; }
174
+ .pros h4 { color: var(--success); font-size: 0.85rem; margin-bottom: 0.5rem; }
175
+ .cons h4 { color: var(--error); font-size: 0.85rem; margin-bottom: 0.5rem; }
176
+ .pros ul, .cons ul { margin-left: 1.25rem; font-size: 0.85rem; color: var(--text-secondary); }
177
+ .pros li, .cons li { margin-bottom: 0.25rem; }
178
+
179
+ /* ===== PLACEHOLDER (for mockup areas) ===== */
180
+ .placeholder {
181
+ background: var(--bg-tertiary);
182
+ border: 2px dashed var(--border);
183
+ border-radius: 8px;
184
+ padding: 2rem;
185
+ text-align: center;
186
+ color: var(--text-tertiary);
187
+ }
188
+
189
+ /* ===== INLINE MOCKUP ELEMENTS ===== */
190
+ .mock-nav { background: var(--accent); color: white; padding: 0.75rem 1rem; display: flex; gap: 1.5rem; font-size: 0.9rem; }
191
+ .mock-sidebar { background: var(--bg-tertiary); padding: 1rem; min-width: 180px; }
192
+ .mock-content { padding: 1.5rem; flex: 1; }
193
+ .mock-button { background: var(--accent); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; }
194
+ .mock-input { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; width: 100%; }
195
+ </style>
196
+ </head>
197
+ <body>
198
+ <div class="header">
199
+ <h1><a href="https://github.com/obra/superpowers" style="color: inherit; text-decoration: none;">Superpowers Brainstorming</a></h1>
200
+ <div class="status">Connected</div>
201
+ </div>
202
+
203
+ <div class="main">
204
+ <div id="claude-content">
205
+ <!-- CONTENT -->
206
+ </div>
207
+ </div>
208
+
209
+ <div class="indicator-bar">
210
+ <span id="indicator-text">Click an option above, then return to the terminal</span>
211
+ </div>
212
+
213
+ </body>
214
+ </html>