CodeMachine CLI — Prompts
Excerpt 1: templates/workflows/ali.workflow.js — JavaScript workflow definition
export default {
name: 'CodeMachine Workflow Builder',
autonomousMode: 'never',
projectName: true,
tracks: {
question: 'Choose your workflow building mode:',
options: {
'expert': {
label: 'Expert Mode',
description: 'For complex or custom workflows'
},
'quick': {
label: 'Quick Mode',
description: 'Speed over customization'
},
},
},
conditionGroups: [
{
id: 'workflow_action',
question: 'What do you want to do?',
multiSelect: false,
tracks: ['quick', 'expert'],
conditions: {
'create-workflow': { label: 'Create Workflow', description: 'Build a new workflow from scratch' },
'modify-workflow': { label: 'Modify Workflow', description: 'Edit or update an existing workflow' },
},
},
{
id: 'workflow_scope',
question: 'How do you want to build your workflow?',
tracks: ['expert'],
conditions: {
'select-parts': {
label: 'Select Parts',
description: 'Choose specific phases to focus on'
},
},
children: {
'select-parts': {
question: 'What areas do you want to focus on?',
multiSelect: true,
conditions: {
brainstorming: { label: 'Brainstorming' },
'workflow-definition': { label: 'Workflow Definition' },
agents: { label: 'Agents' },
prompts: { label: 'Prompts' },
'workflow-generation': { label: 'Workflow Generation' },
},
},
},
},
],
steps: [
resolveStep('cm-workflow-builder-quick', {
engine: 'claude',
tracks: ['quick'],
}),
resolveStep('cm-workflow-builder', {
engine: 'claude',
tracks: ['expert'],
}),
],
};
Technique: JavaScript module as workflow definition — not YAML or markdown. Declarative conditionGroups with nested children for hierarchical question trees. Track-filtering: steps only run when the active track matches. resolveStep() function call connects workflow definition to prompt file.
Excerpt 2: prompts/templates/ali/ — prompt files for Ali workflow steps
The Ali workflow builder prompt files (in prompts/templates/ali/) guide Claude to help users design workflows. These are the actual prompts sent to the AI coding engine during the cm-workflow-builder step. Content not directly fetchable in this analysis, but the structure is:
cm-workflow-builder.md — expert mode multi-step builder prompt
cm-workflow-builder-quick.md — quick mode single-step builder prompt
Technique: Prompt files are separate from workflow definition files — clean separation of orchestration logic (.workflow.js) from AI instruction content (.md prompt files).
Prompting techniques observed
- JavaScript-as-config — workflow logic in JS module rather than YAML/JSON;
resolveStep() links config to prompts
- Track-conditioned steps — steps have
tracks: ['quick'] arrays; only activated for matching tracks
- Multi-select condition groups — users select multiple options; step activation is the intersection
- Nested condition children — condition groups can have sub-questions revealed based on parent selection
- Autonomous mode flag — per-workflow and per-step control over human-in-the-loop gates
- Engine selection per step —
engine: 'claude' or 'codex' at the step level