ralphflow 0.5.0 → 0.5.2

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.
package/README.md CHANGED
@@ -8,6 +8,8 @@ Multi-agent AI workflow orchestration for [Claude Code](https://docs.anthropic.c
8
8
 
9
9
  Define pipelines as loops, coordinate parallel agents via file-based trackers, and ship structured work — from single-agent interactive sessions to multi-agent autonomous execution.
10
10
 
11
+ **[Documentation](https://rahulthakur319.github.io/ralph-flow/)** | **[npm](https://www.npmjs.com/package/ralphflow)** | **[GitHub](https://github.com/rahulthakur319/ralph-flow)**
12
+
11
13
  ## Quick Start
12
14
 
13
15
  ```bash
@@ -138,6 +138,12 @@ function createCustomTemplate(cwd, definition) {
138
138
  model: loopDef.model || "claude-sonnet-4-6",
139
139
  cadence: loopDef.cadence ?? 0
140
140
  };
141
+ if (loopDef.claude_args && loopDef.claude_args.length > 0) {
142
+ loopConfig.claude_args = loopDef.claude_args;
143
+ }
144
+ if (loopDef.skip_permissions !== void 0) {
145
+ loopConfig.skip_permissions = loopDef.skip_permissions;
146
+ }
141
147
  if (loopDef.data_files && loopDef.data_files.length > 0) {
142
148
  loopConfig.data_files = loopDef.data_files.map((f) => `${loopDirName}/${f}`);
143
149
  }
@@ -173,10 +179,11 @@ function createCustomTemplate(cwd, definition) {
173
179
  const loopDirName = `${dirPrefix}-${loopKey}`;
174
180
  const loopDir = join(loopsDir, loopDirName);
175
181
  mkdirSync(loopDir, { recursive: true });
176
- writeFileSync(join(loopDir, "prompt.md"), `# ${loopDef.name} \u2014 Prompt
182
+ const promptContent = loopDef.prompt && loopDef.prompt.trim() ? loopDef.prompt : `# ${loopDef.name} \u2014 Prompt
177
183
 
178
184
  <!-- Add your prompt here -->
179
- `, "utf-8");
185
+ `;
186
+ writeFileSync(join(loopDir, "prompt.md"), promptContent, "utf-8");
180
187
  writeFileSync(join(loopDir, "tracker.md"), `# ${loopDef.name} \u2014 Tracker
181
188
 
182
189
  - stage: ${loopDef.stages[0] || "init"}
@@ -198,6 +205,28 @@ function createCustomTemplate(cwd, definition) {
198
205
  }
199
206
  });
200
207
  }
208
+ function cloneBuiltInTemplate(cwd, sourceName, newName) {
209
+ if (!BUILT_IN_TEMPLATES.includes(sourceName)) {
210
+ throw new Error(`"${sourceName}" is not a built-in template. Only built-in templates can be cloned.`);
211
+ }
212
+ const validation = validateTemplateName(newName);
213
+ if (!validation.valid) {
214
+ throw new Error(validation.error);
215
+ }
216
+ const customDir = join(cwd, ".ralph-flow", ".templates", newName);
217
+ if (existsSync(customDir)) {
218
+ throw new Error(`Template "${newName}" already exists`);
219
+ }
220
+ const sourceDir = resolveTemplatePath(sourceName);
221
+ mkdirSync(customDir, { recursive: true });
222
+ cpSync(sourceDir, customDir, { recursive: true });
223
+ const yamlPath = join(customDir, "ralphflow.yaml");
224
+ if (existsSync(yamlPath)) {
225
+ const content = readFileSync(yamlPath, "utf-8");
226
+ const patched = content.replace(/^name:\s*.+$/m, `name: ${newName}`);
227
+ writeFileSync(yamlPath, patched, "utf-8");
228
+ }
229
+ }
201
230
  function deleteCustomTemplate(cwd, name) {
202
231
  if (BUILT_IN_TEMPLATES.includes(name)) {
203
232
  throw new Error("Cannot delete built-in templates");
@@ -487,6 +516,7 @@ export {
487
516
  listCustomTemplates,
488
517
  getAvailableTemplates,
489
518
  createCustomTemplate,
519
+ cloneBuiltInTemplate,
490
520
  deleteCustomTemplate,
491
521
  listFlows,
492
522
  resolveFlowDir,