MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / getWorkflowCommands

Function getWorkflowCommands

src/workflow/namedWorkflowCommands.ts:10–34  ·  view source on GitHub ↗
(
  cwd: string = getProjectRoot(),
)

Source from the content-addressed store, hash-verified

8
9/** Scan *.ts|*.js|*.mjs under .claude/workflows/ and generate a /<name> command for each. */
10export async function getWorkflowCommands(
11 cwd: string = getProjectRoot(),
12): Promise<Command[]> {
13 const dir = join(cwd, WORKFLOW_DIR_NAME)
14 const names = await listNamedWorkflows(dir)
15 return names.map(name => ({
16 type: 'prompt',
17 name,
18 description: `Run workflow: ${name}`,
19 kind: 'workflow',
20 source: 'builtin',
21 progressMessage: `Running workflow ${name}...`,
22 contentLength: 0,
23 async getPromptForCommand(args, _context) {
24 const argText =
25 typeof args === 'string' && args ? `\n\nArguments: ${args}` : ''
26 return [
27 {
28 type: 'text',
29 text: `Run the "${name}" workflow now by calling the Workflow tool with name="${name}".${argText}`,
30 },
31 ]
32 },
33 }))
34}

Callers 1

commands.tsFile · 0.85

Calls 2

listNamedWorkflowsFunction · 0.90
getProjectRootFunction · 0.85

Tested by

no test coverage detected