@dtt_siye/atool 1.2.0 → 1.3.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.
Files changed (79) hide show
  1. package/README.md +30 -10
  2. package/VERSION +1 -1
  3. package/hooks/session-start +9 -12
  4. package/lib/export-analysis.sh +100 -0
  5. package/lib/install-kiro.sh +11 -6
  6. package/lib/knowledge-graph.sh +7 -2
  7. package/package.json +1 -1
  8. package/skills/doc-standards-enforcer/SKILL.md +200 -220
  9. package/skills/doc-standards-enforcer/examples/valid-document-example.md +5 -5
  10. package/skills/doc-standards-enforcer/references/101-standards-summary.md +17 -17
  11. package/skills/project-analyze/SKILL.md +138 -124
  12. package/skills/project-analyze/phases/{phase0-discovery.md → archive/phase0-discovery.md} +6 -2
  13. package/skills/project-analyze/phases/{phase1-inventory.md → archive/phase1-inventory.md} +10 -0
  14. package/skills/project-analyze/phases/{phase2-deep-analysis.md → archive/phase2-deep-analysis.md} +20 -0
  15. package/skills/project-analyze/phases/{phase3-knowledge-graph.md → archive/phase3-knowledge-graph.md} +31 -0
  16. package/skills/project-analyze/phases/{phase3a-multi-dimensional.md → archive/phase3a-multi-dimensional.md} +13 -0
  17. package/skills/project-analyze/phases/{phase5-synthesis.md → archive/phase5-synthesis.md} +20 -0
  18. package/skills/project-analyze/phases/phase1-setup.md +182 -0
  19. package/skills/project-analyze/phases/phase2-understand.md +108 -0
  20. package/skills/project-analyze/phases/phase3-graph.md +77 -0
  21. package/skills/project-analyze/phases/phase4-synthesize.md +260 -0
  22. package/skills/project-analyze/phases/phase5-export.md +161 -0
  23. package/skills/project-analyze/prompts/{deep-analysis-agent.md → archive/deep-analysis-agent.md} +14 -1
  24. package/skills/project-analyze/prompts/understand-agent.md +407 -0
  25. package/skills/requirements-writer/README.md +1 -1
  26. package/skills/requirements-writer/SKILL.md +378 -284
  27. package/skills/requirements-writer/examples/prd-outline-example.md +5 -5
  28. package/skills/requirements-writer/templates/module-prd-template.md +15 -15
  29. package/skills/requirements-writer/templates/prd-outline-template.md +3 -3
  30. package/skills/requirements-writer/templates/user-story-template.md +23 -23
  31. package/skills/software-architecture/SKILL.md +248 -17
  32. package/templates/CLAUDE.md.android +17 -0
  33. package/templates/CLAUDE.md.devops +17 -0
  34. package/templates/CLAUDE.md.generic +17 -0
  35. package/templates/CLAUDE.md.go +17 -0
  36. package/templates/CLAUDE.md.harmony +17 -0
  37. package/templates/CLAUDE.md.java +17 -0
  38. package/templates/CLAUDE.md.mobile-flutter +17 -0
  39. package/templates/CLAUDE.md.mobile-react-native +17 -0
  40. package/templates/CLAUDE.md.mobile-swift +17 -0
  41. package/templates/CLAUDE.md.python +17 -0
  42. package/templates/CLAUDE.md.rust +17 -0
  43. package/templates/CLAUDE.md.rust-tauri +17 -0
  44. package/templates/CLAUDE.md.web +17 -0
  45. package/templates/cursor-rules.android.mdc +17 -0
  46. package/templates/cursor-rules.devops.mdc +17 -0
  47. package/templates/cursor-rules.generic.mdc +17 -0
  48. package/templates/cursor-rules.go.mdc +17 -0
  49. package/templates/cursor-rules.harmony.mdc +17 -0
  50. package/templates/cursor-rules.java.mdc +17 -0
  51. package/templates/cursor-rules.mobile-flutter.mdc +17 -0
  52. package/templates/cursor-rules.mobile-react-native.mdc +17 -0
  53. package/templates/cursor-rules.mobile-swift.mdc +17 -0
  54. package/templates/cursor-rules.python.mdc +17 -0
  55. package/templates/cursor-rules.rust-tauri.mdc +17 -0
  56. package/templates/cursor-rules.rust.mdc +17 -0
  57. package/templates/cursor-rules.web.mdc +17 -0
  58. package/templates/kiro-steering.android.md +6 -0
  59. package/templates/kiro-steering.devops.md +6 -0
  60. package/templates/kiro-steering.generic.md +6 -0
  61. package/templates/kiro-steering.go.md +6 -0
  62. package/templates/kiro-steering.harmony.md +6 -0
  63. package/templates/kiro-steering.java.md +6 -0
  64. package/templates/kiro-steering.mobile-flutter.md +6 -0
  65. package/templates/kiro-steering.mobile-react-native.md +6 -0
  66. package/templates/kiro-steering.mobile-swift.md +6 -0
  67. package/templates/kiro-steering.python.md +6 -0
  68. package/templates/kiro-steering.rust-tauri.md +6 -0
  69. package/templates/kiro-steering.rust.md +6 -0
  70. package/templates/kiro-steering.web.md +6 -0
  71. package/templates/shared/hard-rules.md +21 -0
  72. /package/skills/project-analyze/phases/{phase0.5-prescan.md → archive/phase0.5-prescan.md} +0 -0
  73. /package/skills/project-analyze/phases/{phase2a-l4-analysis.md → archive/phase2a-l4-analysis.md} +0 -0
  74. /package/skills/project-analyze/phases/{phase2b-l5-analysis.md → archive/phase2b-l5-analysis.md} +0 -0
  75. /package/skills/project-analyze/phases/{phase4-code-quality.md → archive/phase4-code-quality.md} +0 -0
  76. /package/skills/project-analyze/phases/{phase6-validation.md → archive/phase6-validation.md} +0 -0
  77. /package/skills/project-analyze/prompts/{code-review-agent.md → archive/code-review-agent.md} +0 -0
  78. /package/skills/project-analyze/prompts/{inventory-agent.md → archive/inventory-agent.md} +0 -0
  79. /package/skills/project-analyze/prompts/{l4-analysis-agent.md → archive/l4-analysis-agent.md} +0 -0
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # aTool - AI 开发者工具集
2
2
 
3
- [![Version](https://img.shields.io/badge/version-0.3.0-blue.svg)](VERSION)
3
+ [![npm version](https://img.shields.io/npm/v/@dtt_siye/atool.svg)](https://www.npmjs.com/package/@dtt_siye/atool)
4
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
5
  [![Shell](https://img.shields.io/badge/shell-bash-4EAA25.svg)](install.sh)
6
6
 
7
7
  > 一键配置 AI IDE 的 Skills、MCP Servers、Hooks 和项目规则。让任何水平的开发者,通过在 IDE 中正常聊天,就能获得资深架构师的判断力、高级工程师的代码质量标准、和技术文档专家的交付质量。
8
8
 
9
- **一条命令,30 秒完成配置:**
9
+ **两种安装方式,30 秒完成配置:**
10
10
 
11
11
  ```bash
12
+ # 方式一:npm 安装(推荐,全局可用)
13
+ npx @dtt_siye/atool
14
+
15
+ # 方式二:从源码安装
12
16
  git clone --recursive https://github.com/user/atool.git && cd atool
13
17
  ./install.sh --all --yes
14
18
  ```
@@ -36,6 +40,20 @@ git clone --recursive https://github.com/user/atool.git && cd atool
36
40
 
37
41
  ## 快速开始
38
42
 
43
+ ### npm 安装(推荐)
44
+
45
+ ```bash
46
+ # 一键安装到所有 IDE
47
+ npx @dtt_siye/atool
48
+
49
+ # 或全局安装后使用
50
+ npm install -g @dtt_siye/atool
51
+ atool # 安装到所有 IDE
52
+ atool --project ./my-app # 初始化项目
53
+ ```
54
+
55
+ ### 从源码安装
56
+
39
57
  ```bash
40
58
  # 1. 安装到所有 IDE
41
59
  ./install.sh --all --yes
@@ -161,14 +179,16 @@ Java/Spring, React/Next.js, Vue/Nuxt, Svelte, Python, Go, Rust/Tauri, Android, i
161
179
  ## 更新与卸载
162
180
 
163
181
  ```bash
164
- # 更新(一步式:拉取代码 + 自动重装变更组件)
165
- ./install.sh --update
166
-
167
- # 检查更新
168
- ./install.sh --check-updates
169
-
170
- # 卸载(动态扫描并移除所有 aTool 组件)
171
- ./install.sh --uninstall
182
+ # npm 方式
183
+ npm update -g @dtt_siye/atool # 更新
184
+ atool --all --yes # 重新安装
185
+ npm uninstall -g @dtt_siye/atool # 卸载 npm 包
186
+ atool --uninstall # 移除配置
187
+
188
+ # 源码方式
189
+ ./install.sh --update # 一步式更新
190
+ ./install.sh --check-updates # 检查更新
191
+ ./install.sh --uninstall # 移除配置
172
192
  ```
173
193
 
174
194
  更新策略:Skills 按内容 checksum 增量更新,Cursor/Kiro staging 按 checksum 比较,MCP 使用 JSON 深度合并,Hooks 按 MD5 校验。详见 [docs/09-architecture.md](docs/09-architecture.md)。
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 1.3.0
@@ -190,24 +190,21 @@ if $IS_PROJECT && declare -f detect_stack &>/dev/null; then
190
190
 
191
191
  PROJECT_CONTEXT+="</ATOOL-PROJECT-CONTEXT>"
192
192
 
193
- # Doc sync reminder hard rule with skill enforcement
194
- DOC_SYNC="<ATOOL-DOC-SYNC>"
193
+ # Hard rulesnon-bypassable gates extracted from skills
194
+ # These apply in ALL modes: normal, Plan Mode, etc.
195
+ DOC_SYNC="<ATOOL-HARD-RULES>"
195
196
  DOC_SYNC+=$'\n'
196
- DOC_SYNC+="HARD RULE: Every time you modify a source file, you MUST update affected documentation BEFORE claiming the task is done."
197
+ DOC_SYNC+="Three NON-NEGOTIABLE rules that apply in ALL modes (Plan Mode, normal mode, etc.):"
197
198
  DOC_SYNC+=$'\n\n'
198
- DOC_SYNC+="Mandatory actions when source files change:"
199
+ DOC_SYNC+="1. **Doc Sync Gate**: After modifying any source file, update affected docs (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming done. If docs stale -> task NOT done."
199
200
  DOC_SYNC+=$'\n'
200
- DOC_SYNC+="1. Update affected docs: README.md (architecture/structure), COMPONENT.md (API/usage), UI_STYLE.md (styles), docs/ (knowledge base)."
201
+ DOC_SYNC+="2. **Verification Gate**: Before claiming complete: (a) tests pass, (b) docs fresh, (c) no critical issues. Any fail -> task NOT done. Invoke /verification-before-completion."
201
202
  DOC_SYNC+=$'\n'
202
- DOC_SYNC+="2. BEFORE claiming task done, invoke /verification-before-completion this skill checks doc freshness and blocks completion if docs are stale."
203
- DOC_SYNC+=$'\n'
204
- DOC_SYNC+="3. For doc writing, invoke /doc-coauthoring. For doc format validation, invoke /doc-standards-enforcer."
203
+ DOC_SYNC+="3. **Root Cause Gate**: When debugging, identify root cause BEFORE writing fix. Never guess-fix. See /systematic-debugging."
205
204
  DOC_SYNC+=$'\n\n'
206
- DOC_SYNC+="When writing plans: always include a Documentation Sync step as the final task."
207
- DOC_SYNC+=$'\n'
208
- DOC_SYNC+="Gate rule: if docs are stale, task is NOT done. No exceptions."
205
+ DOC_SYNC+="When writing plans (any mode): MUST include a final Documentation Sync task. Plans without it are INCOMPLETE."
209
206
  DOC_SYNC+=$'\n'
210
- DOC_SYNC+="</ATOOL-DOC-SYNC>"
207
+ DOC_SYNC+="</ATOOL-HARD-RULES>"
211
208
  fi
212
209
 
213
210
  # ═══════════════════════════════════════════════════════════════════════════
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env bash
2
+ # lib/export-analysis.sh — Project analysis export and registry management
3
+ #
4
+ # Manages ~/.atool/projects.json, the global registry of analyzed projects.
5
+ # Called by Phase 5 (EXPORT) of project-analyze skill.
6
+ #
7
+ # Functions:
8
+ # register_project(project_root) — Add/update project in ~/.atool/projects.json
9
+ # list_projects() — List all registered projects
10
+ # unregister_project(project_root) — Remove project from registry
11
+ set -euo pipefail
12
+
13
+ ATOOL_HOME="${HOME}/.atool"
14
+ PROJECTS_REGISTRY="${ATOOL_HOME}/projects.json"
15
+
16
+ # _init_registry: Create registry file if it doesn't exist
17
+ _init_registry() {
18
+ mkdir -p "$ATOOL_HOME"
19
+ if [ ! -f "$PROJECTS_REGISTRY" ]; then
20
+ echo '{"version":"1.0","projects":[]}' > "$PROJECTS_REGISTRY"
21
+ fi
22
+ }
23
+
24
+ # register_project: Add or update a project in the global registry
25
+ # Args: $1 = project_root (absolute path to analyzed project)
26
+ # Reads: $project_root/atool-analysis/manifest.json
27
+ register_project() {
28
+ local project_root="${1:?register_project: project_root required}"
29
+ local manifest="$project_root/atool-analysis/manifest.json"
30
+
31
+ if [ ! -f "$manifest" ]; then
32
+ echo "Warning: manifest.json not found at $manifest, skipping registry" >&2
33
+ return 0
34
+ fi
35
+
36
+ _init_registry
37
+
38
+ local name stack depth module_count file_count analyzed_at version
39
+ name=$(jq -r '.name // "unknown"' "$manifest")
40
+ stack=$(jq -r '.stack // "unknown"' "$manifest")
41
+ depth=$(jq -r '.depth // "L2"' "$manifest")
42
+ module_count=$(jq -r '.module_count // 0' "$manifest")
43
+ file_count=$(jq -r '.file_count // 0' "$manifest")
44
+ analyzed_at=$(jq -r '.analyzed_at // ""' "$manifest")
45
+ version=$(jq -r '.analysis_version // "5.1.0"' "$manifest")
46
+
47
+ # Build new entry JSON
48
+ local new_entry
49
+ new_entry=$(jq -n \
50
+ --arg path "$project_root" \
51
+ --arg name "$name" \
52
+ --arg stack "$stack" \
53
+ --arg depth "$depth" \
54
+ --argjson module_count "$module_count" \
55
+ --argjson file_count "$file_count" \
56
+ --arg analyzed_at "$analyzed_at" \
57
+ --arg version "$version" \
58
+ '{
59
+ path: $path,
60
+ name: $name,
61
+ stack: $stack,
62
+ depth: $depth,
63
+ module_count: $module_count,
64
+ file_count: $file_count,
65
+ analyzed_at: $analyzed_at,
66
+ analysis_version: $version
67
+ }')
68
+
69
+ # Upsert: remove existing entry with same path, then add new one
70
+ jq --argjson entry "$new_entry" \
71
+ '.projects = ([.projects[] | select(.path != $entry.path)] + [$entry])' \
72
+ "$PROJECTS_REGISTRY" > "${PROJECTS_REGISTRY}.tmp" \
73
+ && mv "${PROJECTS_REGISTRY}.tmp" "$PROJECTS_REGISTRY"
74
+
75
+ echo "Project registered: $name ($stack) → $PROJECTS_REGISTRY"
76
+ }
77
+
78
+ # list_projects: Print all registered projects (one per line)
79
+ list_projects() {
80
+ _init_registry
81
+ local count
82
+ count=$(jq '.projects | length' "$PROJECTS_REGISTRY" 2>/dev/null || echo 0)
83
+ if [ "$count" -eq 0 ]; then
84
+ echo "No projects registered yet"
85
+ return 0
86
+ fi
87
+ jq -r '.projects[] | "\(.name) [\(.stack)] \(.depth) — \(.path)"' "$PROJECTS_REGISTRY"
88
+ }
89
+
90
+ # unregister_project: Remove a project from the registry by path
91
+ # Args: $1 = project_root (absolute path)
92
+ unregister_project() {
93
+ local project_root="${1:?unregister_project: project_root required}"
94
+ _init_registry
95
+ jq --arg path "$project_root" \
96
+ '.projects = [.projects[] | select(.path != $path)]' \
97
+ "$PROJECTS_REGISTRY" > "${PROJECTS_REGISTRY}.tmp" \
98
+ && mv "${PROJECTS_REGISTRY}.tmp" "$PROJECTS_REGISTRY"
99
+ echo "Project unregistered: $project_root"
100
+ }
@@ -314,15 +314,20 @@ MDFRONT
314
314
  # Append skill catalog (no indentation)
315
315
  cat >> "$md_file" <<< "$skills_catalog"
316
316
 
317
- # Append doc-sync rules (clarify rules are in core-workflow's clarify-before-build skill — no duplicate)
317
+ # Append hard rules (extracted from skills, non-bypassable in all modes)
318
318
  cat >> "$md_file" <<'RULES'
319
319
 
320
- ## Document Sync (HARD RULE)
320
+ ## aTool Hard Rules (Non-bypassable)
321
321
 
322
- Every time you modify a source file (.ts/.tsx/.js/.jsx/.vue/.svelte/.rs/.py/.go/.java/.kt/.swift/.dart/.ets/.sh):
323
- 1. Check if README.md, COMPONENT.md, UI_STYLE.md, or docs/ need updating
324
- 2. If docs are stale (source files newer than docs), update them BEFORE claiming task is done
325
- 3. If docs are stale, the task is NOT complete — this is a gate, not a suggestion
322
+ Three NON-NEGOTIABLE rules that apply in ALL modes (Plan Mode, normal mode, etc.):
323
+
324
+ 1. **Doc Sync Gate**: After modifying any source file, update affected docs (README.md, COMPONENT.md, UI_STYLE.md, docs/) BEFORE claiming done. If docs stale -> task NOT done.
325
+
326
+ 2. **Verification Gate**: Before claiming complete: (a) tests pass, (b) docs fresh, (c) no critical issues. Any fail -> task NOT done. Invoke /verification-before-completion.
327
+
328
+ 3. **Root Cause Gate**: When debugging, identify root cause BEFORE writing fix. Never guess-fix. See /systematic-debugging.
329
+
330
+ When writing plans (any mode): MUST include a final Documentation Sync task. Plans without it are INCOMPLETE.
326
331
 
327
332
  ## On-Demand Skills
328
333
 
@@ -410,11 +410,16 @@ compute_edge_weights() {
410
410
  base_weights='{
411
411
  "depends_on": 1.0, "calls": 0.9, "calls_async": 0.8,
412
412
  "reads_state": 0.8, "writes_state": 0.8, "reads_from": 0.8,
413
- "writes_to": 0.8, "transforms": 0.7, "validates": 0.6,
413
+ "writes_to": 1.2, "transforms": 0.7, "validates": 0.6,
414
414
  "renders": 1.0, "routes_to": 1.0, "sends_http": 1.0,
415
415
  "receives_http": 1.0, "persists_to": 0.9, "subscribes_to": 0.8,
416
416
  "emits": 1.0, "listens_to": 1.0, "returns": 0.7,
417
- "implements": 1.0, "extends": 1.0
417
+ "implements": 1.0, "extends": 1.0,
418
+ "configures": 0.6, "imports": 0.8,
419
+ "tests": 0.4, "mocks": 0.3,
420
+ "inherits": 1.0, "delegates": 0.9,
421
+ "contains": 0.5, "layer_depends": 0.7,
422
+ "publishes": 0.8, "subscribes": 0.8
418
423
  }'
419
424
 
420
425
  local result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtt_siye/atool",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "AI Developer Toolkit - 一键配置 AI IDE 的工具集",
5
5
  "bin": {
6
6
  "atool": "bin/atool.js"