speccrew 0.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.
Files changed (153) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +142 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +61 -0
  3. package/.speccrew/agents/speccrew-system-designer.md +200 -0
  4. package/.speccrew/agents/speccrew-system-developer.md +238 -0
  5. package/.speccrew/agents/speccrew-task-worker.md +80 -0
  6. package/.speccrew/agents/speccrew-team-leader.md +92 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +313 -0
  8. package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
  9. package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
  10. package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
  11. package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
  12. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
  13. package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
  14. package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
  15. package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
  16. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
  17. package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
  18. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
  19. package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
  20. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
  21. package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
  22. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
  23. package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
  24. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
  25. package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
  26. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
  27. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
  28. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
  29. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
  30. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
  31. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
  32. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
  33. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
  34. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
  35. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
  36. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
  37. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
  38. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
  40. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
  41. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
  42. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
  43. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
  44. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
  45. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
  46. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
  47. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
  48. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
  49. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
  50. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
  52. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
  54. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
  56. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
  57. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
  61. package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
  62. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
  63. package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
  64. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
  65. package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
  66. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
  67. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
  68. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
  70. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
  72. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
  74. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
  75. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
  76. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
  77. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
  78. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
  79. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
  80. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
  81. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
  82. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
  83. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
  84. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
  85. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
  86. package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
  87. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
  88. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
  89. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
  90. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
  91. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
  92. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
  93. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
  94. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
  95. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
  96. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
  97. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
  98. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
  99. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
  100. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
  101. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
  102. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
  103. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
  104. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
  105. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
  106. package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
  107. package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
  108. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
  109. package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
  110. package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
  111. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
  112. package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
  113. package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
  114. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
  115. package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
  116. package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
  117. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
  118. package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
  119. package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
  120. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
  121. package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
  122. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
  123. package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
  124. package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
  125. package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
  126. package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
  127. package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
  128. package/LICENSE +21 -0
  129. package/README.ar.md +318 -0
  130. package/README.en.md +318 -0
  131. package/README.es.md +318 -0
  132. package/README.md +340 -0
  133. package/bin/cli.js +62 -0
  134. package/lib/commands/doctor.js +138 -0
  135. package/lib/commands/init.js +231 -0
  136. package/lib/commands/list.js +114 -0
  137. package/lib/commands/uninstall.js +117 -0
  138. package/lib/commands/update.js +351 -0
  139. package/lib/ide-adapters.js +73 -0
  140. package/lib/utils.js +104 -0
  141. package/package.json +28 -0
  142. package/workspace-template/docs/configs/document-templates.json +667 -0
  143. package/workspace-template/docs/configs/platform-mapping.json +194 -0
  144. package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
  145. package/workspace-template/docs/configs/validation-rules.json +87 -0
  146. package/workspace-template/docs/rules/mermaid-rule.md +114 -0
  147. package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
  148. package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
  149. package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
  150. package/workspace-template/docs/solutions/harness.md +410 -0
  151. package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
  152. package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
  153. package/workspace-template/docs/solutions/workspace-structure.md +318 -0
@@ -0,0 +1,33 @@
1
+ # {Page Type Name}
2
+
3
+ ## Pattern Overview
4
+
5
+ - **Category**: Page Type
6
+ - **Applicable Scenarios**: {描述此页面类型适用的业务场景}
7
+ - **Typical Characteristics**: {描述此页面类型的典型特征}
8
+
9
+ ## Standard Layout
10
+
11
+ {归纳后的通用 ASCII 线框图}
12
+
13
+ ## Core Component List
14
+
15
+ | Component | Type | Responsibility | Typical Interaction |
16
+ |-----------|------|---------------|---------------------|
17
+ | {组件名} | {类型} | {职责说明} | {典型交互方式} |
18
+
19
+ ## Typical Interaction Flow
20
+
21
+ {通用化的 Mermaid 流程图,展示此类页面的典型操作流}
22
+
23
+ ## Instance References
24
+
25
+ | Feature | Module | Document Path |
26
+ |---------|--------|--------------|
27
+ | {feature 名} | {模块名} | {文档相对路径} |
28
+
29
+ ## Design Recommendations
30
+
31
+ - **Best Practices**: {最佳实践}
32
+ - **Common Variants**: {常见变体}
33
+ - **Considerations**: {注意事项}
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: speccrew-knowledge-graph-query
3
+ description: Query the knowledge graph to find nodes, edges, relationships, and perform impact analysis. Used by any agent that needs cross-referencing capabilities (e.g., finding which pages call an API, tracing table dependencies).
4
+ tools: Bash
5
+ ---
6
+
7
+ # Knowledge Graph Query
8
+
9
+ Query the knowledge graph stored in `speccrew-workspace/knowledges/bizs/graph/` to find nodes, edges, and trace relationships. This skill wraps `graph-query.js` script for all read operations.
10
+
11
+ ## Trigger Scenarios
12
+
13
+ - "Find all APIs in module {module}"
14
+ - "What pages call API {apiId}?"
15
+ - "Show impact analysis for table {tableId}"
16
+ - "Search for entities related to {keyword}"
17
+ - "Trace upstream dependencies of {nodeId}"
18
+ - "Get all edges for node {nodeId}"
19
+
20
+ ## User
21
+
22
+ Any Agent (speccrew-task-worker, speccrew-knowledge-dispatch, or other agents)
23
+
24
+ ## Input Variables
25
+
26
+ | Variable | Type | Description | Example |
27
+ |----------|------|-------------|---------|
28
+ | `{{action}}` | string | Query action to perform | `"get-node"`, `"query-nodes"`, `"get-edges"`, `"search"`, `"trace-upstream"`, `"trace-downstream"` |
29
+ | `{{id}}` | string | Node ID (for get-node, trace-*) | `"api-system-user-list"` |
30
+ | `{{module}}` | string | Filter by module (for query-nodes, search) | `"system"`, `"trade"` |
31
+ | `{{type}}` | string | Filter by node type (for query-nodes, search) | `"api"`, `"page"`, `"table"` |
32
+ | `{{keyword}}` | string | Search keyword (for search) | `"user"`, `"order"` |
33
+ | `{{direction}}` | string | Edge direction (for get-edges) | `"in"`, `"out"`, `"both"` |
34
+ | `{{depth}}` | number | Trace depth (for trace-*) | `2`, `3` |
35
+ | `{{graphRoot}}` | string | Path to graph root directory | `"speccrew-workspace/knowledges/bizs/graph"` |
36
+
37
+ ## Output Variables
38
+
39
+ | Variable | Type | Description |
40
+ |----------|------|-------------|
41
+ | `{{status}}` | string | Query result: `"success"` or `"not-found"` |
42
+ | `{{resultCount}}` | number | Number of results returned |
43
+ | `{{data}}` | object/array | Query result data |
44
+
45
+ ## Output
46
+
47
+ **Return Value (JSON format):**
48
+ ```json
49
+ {
50
+ "status": "success",
51
+ "action": "query-nodes",
52
+ "resultCount": 5,
53
+ "data": [
54
+ {
55
+ "id": "api-system-user-list",
56
+ "type": "api",
57
+ "name": "List Users API",
58
+ "module": "system",
59
+ "sourcePath": "yudao-module-system/.../UserController.java",
60
+ "description": "Paginated query of system users"
61
+ }
62
+ ]
63
+ }
64
+ ```
65
+
66
+ ## Workflow
67
+
68
+ ```mermaid
69
+ graph TB
70
+ Start([Start]) --> SelectAction{Action Type}
71
+ SelectAction -->|get-node| GetNode[Run script: get-node]
72
+ SelectAction -->|query-nodes| QueryNodes[Run script: query-nodes]
73
+ SelectAction -->|get-edges| GetEdges[Run script: get-edges]
74
+ SelectAction -->|search| Search[Run script: search]
75
+ SelectAction -->|trace-upstream| TraceUp[Run script: trace-upstream]
76
+ SelectAction -->|trace-downstream| TraceDown[Run script: trace-downstream]
77
+ GetNode --> Return[Return JSON Result]
78
+ QueryNodes --> Return
79
+ GetEdges --> Return
80
+ Search --> Return
81
+ TraceUp --> Return
82
+ TraceDown --> Return
83
+ Return --> End([End])
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Actions
89
+
90
+ ### Action: get-node
91
+
92
+ Get a single node by its ID.
93
+
94
+ ```bash
95
+ node "{skill_path}/scripts/graph-query.js" --action "get-node" --id "{{id}}" --graphRoot "{{graphRoot}}"
96
+ ```
97
+
98
+ **Returns:** Single node object or empty if not found.
99
+
100
+ ### Action: query-nodes
101
+
102
+ Query nodes by module and/or type.
103
+
104
+ ```bash
105
+ # By module and type
106
+ node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --module "{{module}}" --type "{{type}}" --graphRoot "{{graphRoot}}"
107
+
108
+ # By module only
109
+ node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --module "{{module}}" --graphRoot "{{graphRoot}}"
110
+
111
+ # By type only
112
+ node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --type "{{type}}" --graphRoot "{{graphRoot}}"
113
+ ```
114
+
115
+ **Returns:** Array of matching nodes.
116
+
117
+ ### Action: get-edges
118
+
119
+ Get all edges connected to a node, filtered by direction.
120
+
121
+ ```bash
122
+ node "{skill_path}/scripts/graph-query.js" --action "get-edges" --nodeId "{{id}}" --direction "{{direction}}" --graphRoot "{{graphRoot}}"
123
+ ```
124
+
125
+ **Direction values:**
126
+ - `in` — edges where this node is the `target`
127
+ - `out` — edges where this node is the `source`
128
+ - `both` — all edges connected to this node
129
+
130
+ **Returns:** Array of matching edges.
131
+
132
+ ### Action: search
133
+
134
+ Search nodes by keyword across name, description, tags, and keywords fields.
135
+
136
+ ```bash
137
+ # Search with filters
138
+ node "{skill_path}/scripts/graph-query.js" --action "search" --keyword "{{keyword}}" --type "{{type}}" --module "{{module}}" --graphRoot "{{graphRoot}}"
139
+
140
+ # Search all
141
+ node "{skill_path}/scripts/graph-query.js" --action "search" --keyword "{{keyword}}" --graphRoot "{{graphRoot}}"
142
+ ```
143
+
144
+ **Returns:** Array of matching nodes, sorted by relevance.
145
+
146
+ ### Action: trace-upstream
147
+
148
+ Trace all upstream dependencies of a node (what depends on / calls this node).
149
+
150
+ ```bash
151
+ node "{skill_path}/scripts/graph-query.js" --action "trace-upstream" --id "{{id}}" --depth {{depth}} --graphRoot "{{graphRoot}}"
152
+ ```
153
+
154
+ **Use case:** Impact analysis — "If I change this table, what APIs and pages are affected?"
155
+
156
+ **Returns:** Tree structure of upstream nodes and edges.
157
+
158
+ ```json
159
+ {
160
+ "root": { "id": "table-system-user", "type": "table" },
161
+ "upstream": [
162
+ {
163
+ "node": { "id": "api-system-user-list", "type": "api" },
164
+ "edge": { "type": "operates", "metadata": { "operation": "SELECT" } },
165
+ "depth": 1,
166
+ "upstream": [
167
+ {
168
+ "node": { "id": "page-system-user-list", "type": "page" },
169
+ "edge": { "type": "calls", "metadata": { "trigger": "onMounted" } },
170
+ "depth": 2,
171
+ "upstream": []
172
+ }
173
+ ]
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ ### Action: trace-downstream
180
+
181
+ Trace all downstream dependencies of a node (what this node depends on / calls).
182
+
183
+ ```bash
184
+ node "{skill_path}/scripts/graph-query.js" --action "trace-downstream" --id "{{id}}" --depth {{depth}} --graphRoot "{{graphRoot}}"
185
+ ```
186
+
187
+ **Use case:** Dependency analysis — "What does this page call? What tables does this API touch?"
188
+
189
+ **Returns:** Tree structure of downstream nodes and edges (same format as trace-upstream).
190
+
191
+ ---
192
+
193
+ ## Common Query Patterns
194
+
195
+ | Scenario | Action | Parameters | Agent Use Case |
196
+ |----------|--------|-----------|---------------|
197
+ | Page → API | `get-edges` | nodeId=page-*, direction=out | UI agent: which APIs does this page use |
198
+ | API → Table | `get-edges` | nodeId=api-*, direction=out | Dev: which tables does this API touch |
199
+ | Table Impact | `trace-upstream` | id=table-*, depth=3 | Assess schema change impact |
200
+ | Module Overview | `query-nodes` | module=system | Generate module summary |
201
+ | Cross-Module Deps | `get-edges` | direction=out, filter cross-module | Inter-module dependency analysis |
202
+ | Keyword Search | `search` | keyword=user, type=api | Find all user-related APIs |
203
+
204
+ ---
205
+
206
+ ## Script Reference
207
+
208
+ Scripts location: `scripts/graph-query.js` (relative to this skill directory)
209
+
210
+ | Action | Parameters | Returns |
211
+ |--------|-----------|---------|
212
+ | `get-node` | `--id <id> --graphRoot <root>` | Single node JSON |
213
+ | `query-nodes` | `[--module <m>] [--type <t>] --graphRoot <root>` | Node array |
214
+ | `get-edges` | `--nodeId <id> --direction <in\|out\|both> --graphRoot <root>` | Edge array |
215
+ | `search` | `--keyword <kw> [--type <t>] [--module <m>] --graphRoot <root>` | Node array |
216
+ | `trace-upstream` | `--id <id> [--depth <n>] --graphRoot <root>` | Node + Edge tree |
217
+ | `trace-downstream` | `--id <id> [--depth <n>] --graphRoot <root>` | Node + Edge tree |
218
+
219
+ ---
220
+
221
+ ## Checklist
222
+
223
+ - [ ] `{{action}}` is one of: `get-node`, `query-nodes`, `get-edges`, `search`, `trace-upstream`, `trace-downstream`
224
+ - [ ] `{{graphRoot}}` path is correct (`speccrew-workspace/knowledges/bizs/graph`)
225
+ - [ ] For `get-node` / `trace-*`: `{{id}}` follows `{type}-{module}-{name}` format
226
+ - [ ] For `get-edges`: `{{direction}}` is one of `in`, `out`, `both`
227
+ - [ ] For `trace-*`: `{{depth}}` is a positive integer (default: 2)
228
+ - [ ] Script executed with Node.js (`node graph-query.js`)
229
+ - [ ] Result JSON parsed and used by calling agent