diff --git a/cli/src/commands/init/init.ts b/cli/src/commands/init/init.ts index 807f2fb31b22b..5883967b77aad 100644 --- a/cli/src/commands/init/init.ts +++ b/cli/src/commands/init/init.ts @@ -252,6 +252,16 @@ async function initAction(opts: InitOptions) { } } + // Read nonDottedPaths from config to specialize generated skills + let nonDottedPaths = true; // default for new inits + try { + const { readConfigFile } = await import("../../core/conf.ts"); + const config = await readConfigFile(); + nonDottedPaths = config.nonDottedPaths ?? true; + } catch { + // If config can't be read, use default + } + // Create guidance files (AGENTS.md, CLAUDE.md, and Claude skills) try { // Generate skills reference section for AGENTS.md @@ -290,6 +300,20 @@ async function initAction(opts: InitOptions) { let skillContent = SKILL_CONTENT[skill.name]; if (skillContent) { + // Replace placeholders with actual suffixes based on nonDottedPaths + if (nonDottedPaths) { + skillContent = skillContent + .replaceAll("{{FLOW_SUFFIX}}", "__flow") + .replaceAll("{{APP_SUFFIX}}", "__app") + .replaceAll("{{RAW_APP_SUFFIX}}", "__raw_app") + .replaceAll("{{INLINE_SCRIPT_NAMING}}", "Inline script files should NOT include `.inline_script.` in their names (e.g. use `a.ts`, not `a.inline_script.ts`)."); + } else { + skillContent = skillContent + .replaceAll("{{FLOW_SUFFIX}}", ".flow") + .replaceAll("{{APP_SUFFIX}}", ".app") + .replaceAll("{{RAW_APP_SUFFIX}}", ".raw_app") + .replaceAll("{{INLINE_SCRIPT_NAMING}}", "Inline script files use the `.inline_script.` naming convention (e.g. `a.inline_script.ts`)."); + } // Check if this skill has schemas that need to be appended const schemaMappings = SCHEMA_MAPPINGS[skill.name]; if (schemaMappings && schemaMappings.length > 0) { diff --git a/cli/src/guidance/skills.ts b/cli/src/guidance/skills.ts index 0417dbb9dfa4b..e97d9babe2830 100644 --- a/cli/src/guidance/skills.ts +++ b/cli/src/guidance/skills.ts @@ -4236,10 +4236,10 @@ description: MUST use when creating flows. ## CLI Commands -Create a folder ending with \`.flow\` and add a YAML file with the flow definition. -For rawscript modules, use \`!inline path/to/script.ts\` for the content key. +Create a folder ending with \`{{FLOW_SUFFIX}}\` and add a \`flow.yaml\` file with the flow definition. +For rawscript modules, use \`!inline path/to/script.ts\` for the content key. {{INLINE_SCRIPT_NAMING}} After writing, tell the user they can run: -- \`wmill flow generate-locks --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow.flow --yes\`) +- \`wmill flow generate-locks --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow{{FLOW_SUFFIX}} --yes\`) - \`wmill sync push\` - Deploy to Windmill Do NOT run these commands yourself. Instead, inform the user that they should run them. @@ -4375,7 +4375,7 @@ This interactive command creates a complete app structure with your choice of fr ## App Structure \`\`\` -my_app.raw_app/ +my_app{{RAW_APP_SUFFIX}}/ ├── AGENTS.md # AI agent instructions (auto-generated) ├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh) ├── raw_app.yaml # App configuration (summary, path, data settings) diff --git a/system_prompts/auto-generated/flow.md b/system_prompts/auto-generated/flow.md index 8b00ad0a0ce90..855fa62721e04 100644 --- a/system_prompts/auto-generated/flow.md +++ b/system_prompts/auto-generated/flow.md @@ -2,10 +2,10 @@ ## CLI Commands -Create a folder ending with `.flow` and add a YAML file with the flow definition. -For rawscript modules, use `!inline path/to/script.ts` for the content key. +Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition. +For rawscript modules, use `!inline path/to/script.ts` for the content key. Inline script files should NOT include `.inline_script.` in their names (e.g. use `a.ts`, not `a.inline_script.ts`). After writing, tell the user they can run: -- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`) +- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`) - `wmill sync push` - Deploy to Windmill Do NOT run these commands yourself. Instead, inform the user that they should run them. diff --git a/system_prompts/auto-generated/prompts.ts b/system_prompts/auto-generated/prompts.ts index 7a0e30221536c..63d3a702b8c24 100644 --- a/system_prompts/auto-generated/prompts.ts +++ b/system_prompts/auto-generated/prompts.ts @@ -33,10 +33,10 @@ export const FLOW_BASE = `# Windmill Flow Building Guide ## CLI Commands -Create a folder ending with \`.flow\` and add a YAML file with the flow definition. -For rawscript modules, use \`!inline path/to/script.ts\` for the content key. +Create a folder ending with \`__flow\` and add a \`flow.yaml\` file with the flow definition. +For rawscript modules, use \`!inline path/to/script.ts\` for the content key. Inline script files should NOT include \`.inline_script.\` in their names (e.g. use \`a.ts\`, not \`a.inline_script.ts\`). After writing, tell the user they can run: -- \`wmill flow generate-locks --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow.flow --yes\`) +- \`wmill flow generate-locks --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow__flow --yes\`) - \`wmill sync push\` - Deploy to Windmill Do NOT run these commands yourself. Instead, inform the user that they should run them. diff --git a/system_prompts/auto-generated/skills/raw-app/SKILL.md b/system_prompts/auto-generated/skills/raw-app/SKILL.md index 533e5f7c3e42c..fe9d6ecca5566 100644 --- a/system_prompts/auto-generated/skills/raw-app/SKILL.md +++ b/system_prompts/auto-generated/skills/raw-app/SKILL.md @@ -18,7 +18,7 @@ This interactive command creates a complete app structure with your choice of fr ## App Structure ``` -my_app.raw_app/ +my_app__raw_app/ ├── AGENTS.md # AI agent instructions (auto-generated) ├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh) ├── raw_app.yaml # App configuration (summary, path, data settings) diff --git a/system_prompts/auto-generated/skills/write-flow/SKILL.md b/system_prompts/auto-generated/skills/write-flow/SKILL.md index f844b813bd1fe..3498502b5f55b 100644 --- a/system_prompts/auto-generated/skills/write-flow/SKILL.md +++ b/system_prompts/auto-generated/skills/write-flow/SKILL.md @@ -7,10 +7,10 @@ description: MUST use when creating flows. ## CLI Commands -Create a folder ending with `.flow` and add a YAML file with the flow definition. -For rawscript modules, use `!inline path/to/script.ts` for the content key. +Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition. +For rawscript modules, use `!inline path/to/script.ts` for the content key. Inline script files should NOT include `.inline_script.` in their names (e.g. use `a.ts`, not `a.inline_script.ts`). After writing, tell the user they can run: -- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`) +- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`) - `wmill sync push` - Deploy to Windmill Do NOT run these commands yourself. Instead, inform the user that they should run them. diff --git a/system_prompts/base/flow-base.md b/system_prompts/base/flow-base.md index 55d4c06b58837..6c02361891125 100644 --- a/system_prompts/base/flow-base.md +++ b/system_prompts/base/flow-base.md @@ -2,10 +2,10 @@ ## CLI Commands -Create a folder ending with `.flow` and add a YAML file with the flow definition. -For rawscript modules, use `!inline path/to/script.ts` for the content key. +Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition. +For rawscript modules, use `!inline path/to/script.ts` for the content key. Inline script files should NOT include `.inline_script.` in their names (e.g. use `a.ts`, not `a.inline_script.ts`). After writing, tell the user they can run: -- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`) +- `wmill flow generate-locks --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`) - `wmill sync push` - Deploy to Windmill Do NOT run these commands yourself. Instead, inform the user that they should run them. diff --git a/system_prompts/base/raw-app.md b/system_prompts/base/raw-app.md index 5d68232eda1af..7406d2db168db 100644 --- a/system_prompts/base/raw-app.md +++ b/system_prompts/base/raw-app.md @@ -13,7 +13,7 @@ This interactive command creates a complete app structure with your choice of fr ## App Structure ``` -my_app.raw_app/ +my_app__raw_app/ ├── AGENTS.md # AI agent instructions (auto-generated) ├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh) ├── raw_app.yaml # App configuration (summary, path, data settings) diff --git a/system_prompts/generate.py b/system_prompts/generate.py index 5bb40a650c93e..cf57a3cecb5dc 100644 --- a/system_prompts/generate.py +++ b/system_prompts/generate.py @@ -1094,6 +1094,20 @@ def main(): # Generate skills TypeScript export for CLI skills_ts = generate_skills_ts_export(skills, schema_yaml_content) + + # Replace hardcoded path conventions with placeholders for CLI runtime resolution. + # init.ts resolves these based on the nonDottedPaths setting in wmill.yaml. + # (Frontend auto-generated files keep the default non-dotted conventions.) + skills_ts = (skills_ts + .replace("\\`__flow\\`", "\\`{{FLOW_SUFFIX}}\\`") + .replace( + "Inline script files should NOT include \\`.inline_script.\\`" + " in their names (e.g. use \\`a.ts\\`, not \\`a.inline_script.ts\\`).", + "{{INLINE_SCRIPT_NAMING}}" + ) + .replace("my_flow__flow", "my_flow{{FLOW_SUFFIX}}") + .replace("my_app__raw_app/", "my_app{{RAW_APP_SUFFIX}}/") + ) (CLI_GUIDANCE_DIR / "skills.ts").write_text(skills_ts) print(f"\nGenerated files:")