mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
chore: batch update - cleanup ghost commands, ccw-help index refresh, CLI session/orchestrator enhancements, skill minor fixes
- Add cleanup-ghost-commands.mjs script - Refresh ccw-help index files (remove stale entries) - CLI session manager: add instruction assembler and launch registry - Frontend: orchestrator plan builder, property panel, dashboard toolbar updates - Flow executor and type updates - Minor fixes across multiple skills and commands
This commit is contained in:
37
ccw/src/core/services/cli-instruction-assembler.ts
Normal file
37
ccw/src/core/services/cli-instruction-assembler.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// ========================================
|
||||
// CLI Instruction Assembler
|
||||
// ========================================
|
||||
// Assembles the final sendText string based on CLI type and instruction type.
|
||||
|
||||
export type InstructionType = 'prompt' | 'skill' | 'command';
|
||||
|
||||
/**
|
||||
* Assemble the text to send to a CLI interactive session.
|
||||
*
|
||||
* - prompt → raw content text
|
||||
* - skill → CLI-specific skill prefix (claude: /, codex: $, others: fallback to prompt)
|
||||
* - command → raw content text (CLI native command)
|
||||
*/
|
||||
export function assembleInstruction(
|
||||
cliTool: string,
|
||||
instructionType: InstructionType,
|
||||
content: string,
|
||||
skillName?: string,
|
||||
): string {
|
||||
if (instructionType === 'prompt' || instructionType === 'command') {
|
||||
return content;
|
||||
}
|
||||
|
||||
// instructionType === 'skill'
|
||||
const name = skillName ?? '';
|
||||
|
||||
switch (cliTool) {
|
||||
case 'claude':
|
||||
return `/${name} ${content}`;
|
||||
case 'codex':
|
||||
return `$${name} ${content}`;
|
||||
default:
|
||||
// Other CLIs don't support skill syntax — fallback to plain prompt
|
||||
return content;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user