4. Cursor¶
pconfigs includes a tool to install Cursor rules and skills into your project. These rules teach Cursor how to write pconfigs code. Users may wish to modify some coding conventions by copying and customizing the rules.
4.1. Installation¶
Install the rules and skills to your project:
$ python -m pconfigs.cursor install
Pass -y to skip confirmation prompts (useful in scripts):
$ python -m pconfigs.cursor install -y
This creates:
.cursor/rules/pconfigs/— Rule files (.mdc) that teach Cursor pconfigs conventions.cursor/rules/environment.mdc— Project environment configuration (with[FILL IN]placeholders).cursor/skills/pconfigs-*/— Skills for printing and testing configs.cursor/installation_test/— Test suite to verify rule installation
Configure your environment¶
After installation, open .cursor/rules/environment.mdc and replace the [FILL IN] placeholders with your project’s conda environment name:
- Conda environment: `my_project`
- Before running any Python commands, activate the conda environment:
```bash
conda activate my_project
```
This tells Cursor how to run pconfigs commands in your project. Since environment.mdc has alwaysApply: true, the environment information will be available in every conversation.
To install to a different directory, pass the path: python -m pconfigs.cursor install /path/to/project.
4.2. Installation test¶
The installer includes a test suite to verify the agent has learned the rules correctly. Run the test in two conversations:
Conversation A — send:
Take the test. @.cursor/installation_test/INSTRUCTIONS.mdConversation B — send:
Score the test. @.cursor/installation_test/INSTRUCTIONS.mdOpen
TEST_SCORE.mdto review.
To re-run the test, delete the answers/, scores/, and TEST_SCORE.md from .cursor/installation_test/ and re-run the installer to restore the test files.
4.3. What gets installed¶
Rules¶
The installer copies these rule files to .cursor/rules/pconfigs/ as .mdc files with Cursor-specific frontmatter:
File |
Activation |
Description |
|---|---|---|
|
Always apply |
Repo-wide coding policies and pconfig modification rules |
|
Always apply |
Core pconfigs usage patterns and conventions |
|
Always apply |
Naming conventions for classes, configs, and variables |
|
|
Rules for wrapping external libraries |
|
|
Patterns for computed config fields |
The installer also creates .cursor/rules/environment.mdc (project-specific, not under pconfigs/) with [FILL IN] placeholders for your conda environment.
Rules with alwaysApply: true are active in every conversation. Rules with globs are active only when matching files are open.
Skills¶
The installer creates these skill directories in .cursor/skills/:
Skill |
Description |
|---|---|
|
Print resolved config values |
|
Test pconfig files |
4.4. Differences from Claude¶
Cursor and Claude use the same underlying rule and skill content, but the installation layout differs:
Cursor |
Claude |
|
|---|---|---|
Command |
|
|
Rules location |
|
|
Rule format |
|
|
Rule activation |
Frontmatter ( |
|
Entry point |
None needed |
|
Skills location |
|
|
4.5. Other commands¶
List available rules and skills¶
$ python -m pconfigs.cursor list
Available rules:
external_libs
naming
pconfigs
policies
pproperty
Available skills:
pconfigs-print
pconfigs-test
View a specific rule or skill¶
$ python -m pconfigs.cursor show pconfigs
$ python -m pconfigs.cursor show pconfigs-print
Print paths to bundled assets¶
$ python -m pconfigs.cursor path
Rules: /path/to/site-packages/pconfigs/cursor_assets/rules
Skills: /path/to/site-packages/pconfigs/cursor_assets/skills
4.6. Existing projects¶
When your project already has .cursor/rules/pconfigs/, the installer overwrites existing pconfigs rule files and leaves other rules untouched. The environment.mdc file is only created if it doesn’t already exist, so re-running the installer won’t overwrite your environment configuration.
4.7. Manual installation¶
If you prefer not to use the installer, you can manually:
Copy rules from the package location (
python -m pconfigs.cursor path)Rename each
.mdfile to.mdcand add the appropriate frontmatter (seepython -m pconfigs.cursor show <name>for the expected format)Place them in
.cursor/rules/pconfigs/