MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / skills_command_call

Function skills_command_call

src/command_system/builtins.py:222–257  ·  view source on GitHub ↗

Handle /skills command - list available skills. Args: args: Command arguments context: Command context Returns: LocalCommandResult

(args: str, context: CommandContext)

Source from the content-addressed store, hash-verified

220
221
222def skills_command_call(args: str, context: CommandContext) -> LocalCommandResult:
223 """
224 Handle /skills command - list available skills.
225
226 Args:
227 args: Command arguments
228 context: Command context
229
230 Returns:
231 LocalCommandResult
232 """
233 try:
234 from ..skills.loader import get_all_skills
235 # Pass project_root to find skills in project directories
236 skills = get_all_skills(project_root=context.cwd or context.workspace_root)
237 except Exception:
238 skills = []
239
240 if not skills:
241 return LocalCommandResult(
242 type="text",
243 value="No skills available. Add skills to ~/.clawcodex/skills/ or ./.clawcodex/skills/.",
244 )
245
246 lines = ["Available skills:", ""]
247 for skill in skills:
248 lines.append(f" {skill.name}")
249 lines.append(f" {skill.description}")
250 if skill.when_to_use:
251 lines.append(f" When to use: {skill.when_to_use}")
252 lines.append("")
253
254 return LocalCommandResult(
255 type="text",
256 value="\n".join(lines),
257 )
258
259
260def exit_command_call(args: str, context: CommandContext) -> LocalCommandResult:

Callers 1

execute_command_syncFunction · 0.85

Calls 4

get_all_skillsFunction · 0.85
LocalCommandResultClass · 0.85
joinMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected