Skip to main content

Module rule_file

Module rule_file 

Source
Expand description

Read / render / merge generated skillify rule files (.cursor/rules/<slug>.mdc).

Generated rules are namespaced with a skillify- prefix so they never collide with hand-written rules. Each file embeds a machine-readable provenance comment (version, created, …) that lets a re-run MERGE — bumping the version only when the distilled body actually changes (idempotent otherwise).

Structs§

ExistingRule
The fields parsed back out of an existing generated rule.

Enums§

WriteOutcome
Result of writing a candidate to disk.

Constants§

SLUG_PREFIX
Namespace prefix for generated rule slugs/files.

Functions§

extract_description
Read the description: value from a generated rule’s frontmatter.
full_slug
Full namespaced slug for a candidate slug (stop-before-buildskillify-stop-before-build).
parse_existing
Parse the provenance + body out of an existing generated rule.
render
Render a complete .mdc document for a candidate at version.
rule_path
File path for a full (already-namespaced) slug.
rules_dir
<output_root>/.cursor/rules.
write_candidate
Write a candidate, creating a new file or merging into an existing one. Idempotent: an unchanged body is left untouched.