speccrew 0.7.24 → 0.7.25

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.
@@ -100,6 +100,13 @@ Receive from the calling Agent:
100
100
 
101
101
  If the skill file is not found, report an error with the attempted paths.
102
102
 
103
+ ### Skill Path Resolution
104
+
105
+ When Worker loads a skill (via `skill_name` or `skill_path` parameter):
106
+ 1. Resolve the skill directory path (e.g., `.qoder/skills/speccrew-pm-requirement-clarify/`)
107
+ 2. Set `skill_path` variable to the resolved directory path (NOT the SKILL.md file path)
108
+ 3. This `skill_path` is passed to the skill's workflow execution context, enabling the skill to reference templates, scripts, and other resources within the skill directory using `${skill_path}/templates/...` syntax
109
+
103
110
  ### 3. Execute Task
104
111
 
105
112
  **If `skill_path` or `skill_name` is provided:**
@@ -82,8 +82,24 @@
82
82
  </branch>
83
83
  </block>
84
84
 
85
- <!-- === Phase 3: 执行任务 === -->
86
- <block type="event" id="E5" action="log" desc="开始执行任务">📋 Phase 3: Execute Task</block>
85
+ <!-- === Phase 3: 设置 skill_path 变量 === -->
86
+ <block type="event" id="E5" action="log" desc="设置 skill_path 变量">📋 Phase 3: Set skill_path Variable</block>
87
+
88
+ <block type="gateway" id="G5b" mode="exclusive" desc="设置 skill_path 目录路径">
89
+ <branch test="${resolved_skill_path} != null" name="从 resolved_skill_path 推导">
90
+ <block type="task" id="T5b" action="run-script" desc="提取 skill 目录路径">
91
+ <field name="command">node -e "const path = require('path'); const skillFilePath = process.env.SKILL_FILE_PATH || '${resolved_skill_path}'; const skillDir = path.dirname(skillFilePath); console.log(skillDir);"</field>
92
+ <field name="output" var="skill_path"/>
93
+ </block>
94
+ <block type="event" id="E5b" action="log" desc="skill_path 已设置">📁 skill_path set to: ${skill_path}</block>
95
+ </branch>
96
+ <branch test="true" name="无 skill 路径">
97
+ <block type="event" id="E5c" action="log" desc="无 skill_path">ℹ️ No skill_path to set</block>
98
+ </branch>
99
+ </block>
100
+
101
+ <!-- === Phase 4: 执行任务 === -->
102
+ <block type="event" id="E6" action="log" desc="开始执行任务">📋 Phase 4: Execute Task</block>
87
103
 
88
104
  <block type="rule" id="R1" level="mandatory" desc="技能执行强制约束">
89
105
  如果技能指定通过 run_in_terminal 或 Bash 执行脚本 → 必须通过终端执行
@@ -130,13 +146,14 @@
130
146
  <block type="task" id="T8" action="run-skill" desc="执行技能工作流">
131
147
  <field name="skill">${resolved_skill_path}</field>
132
148
  <field name="context">${context}</field>
149
+ <field name="skill_path">${skill_path}</field>
133
150
  </block>
134
151
  <field name="execution_status" value="success"/>
135
152
  </branch>
136
153
  </block>
137
154
 
138
- <!-- === Phase 4: 报告结果 === -->
139
- <block type="event" id="E10" action="log" desc="开始报告结果">📋 Phase 4: Report Results</block>
155
+ <!-- === Phase 5: 报告结果 === -->
156
+ <block type="event" id="E10" action="log" desc="开始报告结果">📋 Phase 5: Report Results</block>
140
157
 
141
158
  <block type="gateway" id="G7" mode="exclusive" desc="选择报告格式">
142
159
  <branch test="${execution_status} == success" name="成功报告">
@@ -163,7 +180,7 @@
163
180
  </branch>
164
181
  </block>
165
182
 
166
- <!-- === Phase 5: 完成报告输出 === -->
183
+ <!-- === Phase 6: 完成报告输出 === -->
167
184
  <block type="event" id="E11" action="log" desc="输出结构化完成报告">
168
185
  ## Task Completion Report
169
186
  - **Status**: ${status}
@@ -211,16 +211,18 @@ function updateSkillsRecursive(srcDir, destDir, stats, currentRelPath = '', ideC
211
211
  const relPath = currentRelPath ? path.join(currentRelPath, entry.name) : entry.name;
212
212
 
213
213
  if (entry.isDirectory()) {
214
- // Only process directories with speccrew-* prefix
215
- if (!isSpeccrewFile(entry.name)) continue;
216
-
217
- const dirStats = { added: 0, updated: 0 };
214
+ // Only check speccrew-* prefix at skills directory level (when currentRelPath is empty)
215
+ // Once inside a skill directory, all subdirectories should be processed unconditionally
216
+ if (!currentRelPath && !isSpeccrewFile(entry.name)) continue;
217
+
218
218
  updateSkillsRecursive(srcPath, destPath, stats, relPath, ideConfig);
219
219
  } else {
220
- // Files under speccrew-* directory
221
- // Check if under speccrew-* parent directory
222
- const parentDir = path.basename(srcDir);
223
- if (!isSpeccrewFile(parentDir)) continue;
220
+ // Files - only check speccrew-* prefix at skills directory level
221
+ // Once inside a skill directory, all files should be processed unconditionally
222
+ if (!currentRelPath) {
223
+ const parentDir = path.basename(srcDir);
224
+ if (!isSpeccrewFile(parentDir)) continue;
225
+ }
224
226
 
225
227
  // Apply frontmatter transformation to SKILL.md files (if needed)
226
228
  const isSkillMd = entry.name === 'SKILL.md';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.24",
3
+ "version": "0.7.25",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {