Skip to content

Commit b1b9c98

Browse files
rubenfiszelclaude
andauthored
make wmill init generated skills respect nonDottedPaths config (#8377)
* docs: add nonDottedPaths convention to CLAUDE.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(cli): update generated skills to use non-dotted path conventions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(cli): make generated skills respect nonDottedPaths config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(cli): inject nonDottedPaths placeholders in generate.py for skills.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: default system prompts to non-dotted path conventions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent eb03ebb commit b1b9c98

File tree

9 files changed

+56
-18
lines changed

9 files changed

+56
-18
lines changed

cli/src/commands/init/init.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ async function initAction(opts: InitOptions) {
252252
}
253253
}
254254

255+
// Read nonDottedPaths from config to specialize generated skills
256+
let nonDottedPaths = true; // default for new inits
257+
try {
258+
const { readConfigFile } = await import("../../core/conf.ts");
259+
const config = await readConfigFile();
260+
nonDottedPaths = config.nonDottedPaths ?? true;
261+
} catch {
262+
// If config can't be read, use default
263+
}
264+
255265
// Create guidance files (AGENTS.md, CLAUDE.md, and Claude skills)
256266
try {
257267
// Generate skills reference section for AGENTS.md
@@ -290,6 +300,20 @@ async function initAction(opts: InitOptions) {
290300

291301
let skillContent = SKILL_CONTENT[skill.name];
292302
if (skillContent) {
303+
// Replace placeholders with actual suffixes based on nonDottedPaths
304+
if (nonDottedPaths) {
305+
skillContent = skillContent
306+
.replaceAll("{{FLOW_SUFFIX}}", "__flow")
307+
.replaceAll("{{APP_SUFFIX}}", "__app")
308+
.replaceAll("{{RAW_APP_SUFFIX}}", "__raw_app")
309+
.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`).");
310+
} else {
311+
skillContent = skillContent
312+
.replaceAll("{{FLOW_SUFFIX}}", ".flow")
313+
.replaceAll("{{APP_SUFFIX}}", ".app")
314+
.replaceAll("{{RAW_APP_SUFFIX}}", ".raw_app")
315+
.replaceAll("{{INLINE_SCRIPT_NAMING}}", "Inline script files use the `.inline_script.` naming convention (e.g. `a.inline_script.ts`).");
316+
}
293317
// Check if this skill has schemas that need to be appended
294318
const schemaMappings = SCHEMA_MAPPINGS[skill.name];
295319
if (schemaMappings && schemaMappings.length > 0) {

cli/src/guidance/skills.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4236,10 +4236,10 @@ description: MUST use when creating flows.
42364236
42374237
## CLI Commands
42384238
4239-
Create a folder ending with \`.flow\` and add a YAML file with the flow definition.
4240-
For rawscript modules, use \`!inline path/to/script.ts\` for the content key.
4239+
Create a folder ending with \`{{FLOW_SUFFIX}}\` and add a \`flow.yaml\` file with the flow definition.
4240+
For rawscript modules, use \`!inline path/to/script.ts\` for the content key. {{INLINE_SCRIPT_NAMING}}
42414241
After writing, tell the user they can run:
4242-
- \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow.flow --yes\`)
4242+
- \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow{{FLOW_SUFFIX}} --yes\`)
42434243
- \`wmill sync push\` - Deploy to Windmill
42444244
42454245
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
43754375
## App Structure
43764376
43774377
\`\`\`
4378-
my_app.raw_app/
4378+
my_app{{RAW_APP_SUFFIX}}/
43794379
├── AGENTS.md # AI agent instructions (auto-generated)
43804380
├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh)
43814381
├── raw_app.yaml # App configuration (summary, path, data settings)

system_prompts/auto-generated/flow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## CLI Commands
44

5-
Create a folder ending with `.flow` and add a YAML file with the flow definition.
6-
For rawscript modules, use `!inline path/to/script.ts` for the content key.
5+
Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition.
6+
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`).
77
After writing, tell the user they can run:
8-
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`)
8+
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`)
99
- `wmill sync push` - Deploy to Windmill
1010

1111
Do NOT run these commands yourself. Instead, inform the user that they should run them.

system_prompts/auto-generated/prompts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ export const FLOW_BASE = `# Windmill Flow Building Guide
3333
3434
## CLI Commands
3535
36-
Create a folder ending with \`.flow\` and add a YAML file with the flow definition.
37-
For rawscript modules, use \`!inline path/to/script.ts\` for the content key.
36+
Create a folder ending with \`__flow\` and add a \`flow.yaml\` file with the flow definition.
37+
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\`).
3838
After writing, tell the user they can run:
39-
- \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow.flow --yes\`)
39+
- \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow__flow --yes\`)
4040
- \`wmill sync push\` - Deploy to Windmill
4141
4242
Do NOT run these commands yourself. Instead, inform the user that they should run them.

system_prompts/auto-generated/skills/raw-app/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This interactive command creates a complete app structure with your choice of fr
1818
## App Structure
1919

2020
```
21-
my_app.raw_app/
21+
my_app__raw_app/
2222
├── AGENTS.md # AI agent instructions (auto-generated)
2323
├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh)
2424
├── raw_app.yaml # App configuration (summary, path, data settings)

system_prompts/auto-generated/skills/write-flow/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ description: MUST use when creating flows.
77

88
## CLI Commands
99

10-
Create a folder ending with `.flow` and add a YAML file with the flow definition.
11-
For rawscript modules, use `!inline path/to/script.ts` for the content key.
10+
Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition.
11+
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`).
1212
After writing, tell the user they can run:
13-
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`)
13+
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`)
1414
- `wmill sync push` - Deploy to Windmill
1515

1616
Do NOT run these commands yourself. Instead, inform the user that they should run them.

system_prompts/base/flow-base.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## CLI Commands
44

5-
Create a folder ending with `.flow` and add a YAML file with the flow definition.
6-
For rawscript modules, use `!inline path/to/script.ts` for the content key.
5+
Create a folder ending with `__flow` and add a `flow.yaml` file with the flow definition.
6+
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`).
77
After writing, tell the user they can run:
8-
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow.flow --yes`)
8+
- `wmill flow generate-locks <path_to_flow_folder> --yes` - Generate lock files for the specific flow you modified (e.g. `wmill flow generate-locks f/my_folder/my_flow__flow --yes`)
99
- `wmill sync push` - Deploy to Windmill
1010

1111
Do NOT run these commands yourself. Instead, inform the user that they should run them.

system_prompts/base/raw-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This interactive command creates a complete app structure with your choice of fr
1313
## App Structure
1414

1515
```
16-
my_app.raw_app/
16+
my_app__raw_app/
1717
├── AGENTS.md # AI agent instructions (auto-generated)
1818
├── DATATABLES.md # Database schemas (run 'wmill app generate-agents' to refresh)
1919
├── raw_app.yaml # App configuration (summary, path, data settings)

system_prompts/generate.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,20 @@ def main():
10941094

10951095
# Generate skills TypeScript export for CLI
10961096
skills_ts = generate_skills_ts_export(skills, schema_yaml_content)
1097+
1098+
# Replace hardcoded path conventions with placeholders for CLI runtime resolution.
1099+
# init.ts resolves these based on the nonDottedPaths setting in wmill.yaml.
1100+
# (Frontend auto-generated files keep the default non-dotted conventions.)
1101+
skills_ts = (skills_ts
1102+
.replace("\\`__flow\\`", "\\`{{FLOW_SUFFIX}}\\`")
1103+
.replace(
1104+
"Inline script files should NOT include \\`.inline_script.\\`"
1105+
" in their names (e.g. use \\`a.ts\\`, not \\`a.inline_script.ts\\`).",
1106+
"{{INLINE_SCRIPT_NAMING}}"
1107+
)
1108+
.replace("my_flow__flow", "my_flow{{FLOW_SUFFIX}}")
1109+
.replace("my_app__raw_app/", "my_app{{RAW_APP_SUFFIX}}/")
1110+
)
10971111
(CLI_GUIDANCE_DIR / "skills.ts").write_text(skills_ts)
10981112

10991113
print(f"\nGenerated files:")

0 commit comments

Comments
 (0)