python-flask-json-guide-cursorrules-prompt-file — Cursor rule
Guides Cursor on using the drawscape_factorio module. Helps parse exported-entities.json and generate SVG blueprints.
.cursor/rules/python-flask-json-guide-cursorrules-prompt-file.mdcWhat python-flask-json-guide-cursorrules-prompt-file does
This rule provides Cursor with an integration pattern for the internal drawscape_factorio library. It demonstrates loading entity structures from exported-entities.json, processing them with importFUE5, and converting them into vector drawings.
The output is written as an SVG string (result['svg_string']) into a destination file. Configuration parameters pass options for themes, the main color scheme, and specific layer toggles such as belts, rails, walls, and electrical.
Execution depends directly on having drawscape_factorio available in your Python environment. Because alwaysApply is set to false, Cursor does not inject these instructions into every prompt automatically.
What it helps with
- parse Factorio JSON exports with
importFUE5 - render base layouts into SVG output
- configure active layer rendering in
createFactorio
Example prompts for the agent
- Write a script to load
exported-entities.jsonand exportbeltsandwallsas SVG - Show how to pass custom layers to
createFactoriousingdrawscape_factorio
How to install python-flask-json-guide-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/python-flask-json-guide-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/python-flask-json-guide-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/python-flask-json-guide-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/python-flask-json-guide-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/python-flask-json-guide-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about python-flask-json-guide-cursorrules-prompt-file
How to install python-flask-json-guide-cursorrules-prompt-file in Cursor?
Save the rule file to .cursor/rules/python-flask-json-guide-cursorrules-prompt-file.mdc in your project root.
What does this rule do?
It instructs Cursor on how to interact with drawscape_factorio to convert Factorio map data into SVG graphics.
What layers can be displayed in the output?
The reference snippet includes assets, belts, walls, rails, electrical, and spaceship.
Source text
python-flask-json-guide-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Python Flask development with JSON guide."
globs: **/*
alwaysApply: false
---
This project is heavily reliant on our custom Drawscape Factorio python module.
Here is code examples of how to use the module:
```python
from drawscape_factorio import create as createFactorio
from drawscape_factorio import importFUE5
with open('/path/to/exported-entities.json', 'r') as file:
json_data = json.load(file)
data = importFUE5(json_data)
result = createFactorio(data, {
'theme_name': 'default',
'color_scheme': 'main',
'show_layers': ['assets', 'belts', 'walls', 'rails', 'electrical', 'spaceship']
})
with open(output_file_name, 'w') as f:
f.write(result['svg_string'])
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules