Skip to content

Commit 86c9432

Browse files
committed
fix: remove empty frontmatter from prompt rule files
- Frontmatter is now written only when description exists - Prevents cluttering prompt files with redundant metadata sections Generated-by: aiautocommit
1 parent c22f45f commit 86c9432

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
description:
3-
---
41
## React Router Client Loader
52

63
Do this in a `clientLoader` and use `loaderData` to render the component. DO NOT create mock data, new interfaces, or mock data loader functions. Instead, assume `loaderData` has all of the data you need to render the component.

.cursor/rules/secrets.mdc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
description:
3-
---
41
## Secrets
52

63
Here's how environment variables are managed in this application:
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
description:
3-
---
41
## TypeScript DocString
52

63
Add a file-level docstring with a simple description of what this file does.

explode.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,15 @@ def write_cursor_prompt(content_lines, filename, prompts_dir, section_name=None)
145145
default_description = ""
146146
description, filtered_content = extract_description_and_filter_content(content_lines, default_description)
147147

148-
frontmatter = f"""---
148+
with open(filepath, "w") as f:
149+
# Only add frontmatter if description is not empty
150+
if description:
151+
frontmatter = f"""---
149152
description: {description}
150153
---
151154
"""
152-
153-
with open(filepath, "w") as f:
154-
f.write(frontmatter)
155+
f.write(frontmatter)
156+
155157
for line in filtered_content:
156158
f.write(line)
157159

0 commit comments

Comments
 (0)