llm-ide-rules 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/PKG-INFO +35 -59
  2. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/README.md +29 -56
  3. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/pyproject.toml +15 -5
  4. llm_ide_rules-0.6.0/src/llm_ide_rules/__init__.py +81 -0
  5. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/src/llm_ide_rules/__main__.py +1 -1
  6. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/__init__.py +28 -0
  7. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/base.py +283 -0
  8. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/claude.py +92 -0
  9. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/cursor.py +178 -0
  10. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/gemini.py +161 -0
  11. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/github.py +207 -0
  12. llm_ide_rules-0.6.0/src/llm_ide_rules/agents/opencode.py +126 -0
  13. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/src/llm_ide_rules/commands/delete.py +24 -34
  14. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/src/llm_ide_rules/commands/download.py +52 -56
  15. llm_ide_rules-0.6.0/src/llm_ide_rules/commands/explode.py +320 -0
  16. llm_ide_rules-0.6.0/src/llm_ide_rules/commands/implode.py +245 -0
  17. llm_ide_rules-0.6.0/src/llm_ide_rules/commands/mcp.py +119 -0
  18. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/src/llm_ide_rules/constants.py +17 -14
  19. llm_ide_rules-0.6.0/src/llm_ide_rules/log.py +9 -0
  20. llm_ide_rules-0.6.0/src/llm_ide_rules/mcp/__init__.py +7 -0
  21. llm_ide_rules-0.6.0/src/llm_ide_rules/mcp/models.py +21 -0
  22. {llm_ide_rules-0.5.0 → llm_ide_rules-0.6.0}/src/llm_ide_rules/sections.json +4 -14
  23. llm_ide_rules-0.5.0/src/llm_ide_rules/__init__.py +0 -37
  24. llm_ide_rules-0.5.0/src/llm_ide_rules/commands/explode.py +0 -428
  25. llm_ide_rules-0.5.0/src/llm_ide_rules/commands/implode.py +0 -400
@@ -1,20 +1,23 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: llm-ide-rules
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: CLI tool for managing LLM IDE prompts and rules
5
5
  Keywords: llm,ide,prompts,cursor,copilot
6
6
  Author: Michael Bianco
7
7
  Author-email: Michael Bianco <mike@mikebian.co>
8
8
  Requires-Dist: typer>=0.9.0
9
- Requires-Dist: structlog>=23.2.0
9
+ Requires-Dist: structlog-config>=0.6.0
10
10
  Requires-Dist: requests>=2.25.0
11
- Requires-Python: >=3.9
11
+ Requires-Dist: pydantic>=2.0.0
12
+ Requires-Dist: json5>=0.9.0
13
+ Requires-Dist: tomli-w>=1.0.0
14
+ Requires-Python: >=3.11
12
15
  Project-URL: Repository, https://github.com/iloveitaly/llm-ide-rules
13
16
  Description-Content-Type: text/markdown
14
17
 
15
18
  # Copilot, Cursor, Claude, Gemini, etc LLM Instructions
16
19
 
17
- Going to try to centralize all my prompts in a single place and create some scripts to help convert from copilot to cursor, etc.
20
+ This project makes it easy to download prompts and implode/explode them so they can be used by various providers.
18
21
 
19
22
  I don't want to be tied to a specific IDE and it's a pain to have to edit instructions for various languages across a ton of different files.
20
23
 
@@ -22,25 +25,28 @@ Additionally, it becomes challenging to copy these prompts into various projects
22
25
 
23
26
  Some of the glob assumptions in this repo are specific to how I've chosen to organize python and typescript [in the python starter template](https://github.com/iloveitaly/python-starter-template) and what tooling (fastapi, etc) that I've chosen to use.
24
27
 
25
- ## Installation
26
-
27
- You can run the `llm-ide-rules` CLI tool using uvx:
28
+ ## IDE Format Comparison
28
29
 
29
- ```sh
30
- uvx llm-ide-rules
31
- ```
30
+ Different AI coding assistants use different formats for instructions and commands:
32
31
 
33
- Or install from the repository:
32
+ | IDE | type | folder | Notes |
33
+ |-----|------|--------|-------|
34
+ | **Cursor** | instructions | `.cursor/rules/*.mdc` | Multiple plain markdown files |
35
+ | **Cursor** | commands | `.cursor/commands/*.md` | Plain markdown, no frontmatter |
36
+ | **Claude Code** | instructions | `CLAUDE.md` | Single markdown file at root |
37
+ | **Claude Code** | instructions | `AGENT.md` | Single markdown file at root (agent-specific) |
38
+ | **Claude Code** | commands | `.claude/commands/*.md` | Plain markdown, no frontmatter |
39
+ | **GitHub Copilot** | instructions | `.github/copilot-instructions.md` | Single markdown file |
40
+ | **GitHub Copilot** | instructions | `.github/instructions/*.instructions.md` | Multiple instruction files |
41
+ | **GitHub Copilot** | prompts | `.github/prompts/*.prompt.md` | YAML frontmatter with `mode: 'agent'` |
42
+ | **Gemini CLI** | instructions | `GEMINI.md` | Single markdown file at root |
43
+ | **Gemini CLI** | commands | `.gemini/commands/*.toml` | TOML format, supports `{{args}}` and shell commands |
44
+ | **OpenCode** | commands | `.opencode/commands/*.md` | Plain markdown, no frontmatter |
34
45
 
35
- ```sh
36
- uv tool install git+https://github.com/iloveitaly/llm-ide-rules.git
37
- ```
46
+ ## Installation
38
47
 
39
48
  ```sh
40
- git clone https://github.com/iloveitaly/llm-ide-rules.git
41
- cd llm-ide-rules
42
- uv sync
43
- source .venv/bin/activate
49
+ uvx llm-ide-rules@latest --help
44
50
  ```
45
51
 
46
52
  ## Usage
@@ -55,7 +61,10 @@ uvx llm-ide-rules explode [input_file]
55
61
 
56
62
  # Bundle rule files back into a single instruction file
57
63
  uvx llm-ide-rules implode cursor [output_file] # Bundle Cursor rules
58
- uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
64
+ uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
65
+ uvx llm-ide-rules implode claude [output_file] # Bundle Claude Code commands
66
+ uvx llm-ide-rules implode gemini [output_file] # Bundle Gemini CLI commands
67
+ uvx llm-ide-rules implode opencode [output_file] # Bundle OpenCode commands
59
68
 
60
69
  # Download instruction files from repositories
61
70
  uvx llm-ide-rules download [instruction_types] # Download everything by default
@@ -66,21 +75,26 @@ uvx llm-ide-rules download --repo other/repo # Download from different repo
66
75
  uvx llm-ide-rules delete [instruction_types] # Delete everything by default
67
76
  uvx llm-ide-rules delete cursor gemini # Delete specific types
68
77
  uvx llm-ide-rules delete --yes # Skip confirmation prompt
69
-
70
78
  ```
71
79
 
72
80
  ### Examples
73
81
 
74
82
  ```sh
75
- # Explode instructions.md into .cursor/rules/ and .github/instructions/
83
+ # Explode instructions.md into all supported formats (cursor, github, claude, gemini, opencode)
76
84
  uvx llm-ide-rules explode instructions.md
77
85
 
86
+ # Explode for a specific agent only
87
+ uvx llm-ide-rules explode instructions.md --agent opencode
88
+
78
89
  # Bundle Cursor rules back into a single file
79
90
  uvx llm-ide-rules implode cursor bundled-instructions.md
80
91
 
81
92
  # Bundle GitHub instructions with verbose logging
82
93
  uvx llm-ide-rules implode github --verbose instructions.md
83
94
 
95
+ # Bundle OpenCode commands into commands.md
96
+ uvx llm-ide-rules implode opencode
97
+
84
98
  # Download everything from default repository
85
99
  uvx llm-ide-rules download
86
100
 
@@ -100,44 +114,6 @@ uvx llm-ide-rules delete cursor gemini --target ./my-project
100
114
  uvx llm-ide-rules delete --yes
101
115
  ```
102
116
 
103
- ### IDE Command Format Comparison
104
-
105
- Different AI coding assistants use different formats for commands:
106
-
107
- | IDE | Directory | Format | Notes |
108
- |-----|-----------|--------|-------|
109
- | **Cursor** | `.cursor/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
110
- | **Claude Code** | `.claude/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
111
- | **GitHub Copilot** | `.github/prompts/` | `.prompt.md` (YAML + markdown) | Requires frontmatter with `mode: 'agent'` |
112
- | **Gemini CLI** | `.gemini/commands/` | `.toml` | Uses TOML format, supports `{{args}}` and shell commands |
113
-
114
- ## Development
115
-
116
- ### Using the CLI for Development
117
-
118
- The CLI replaces the old standalone scripts. Use the CLI commands in your development workflow:
119
-
120
- ```shell
121
- # Setup the environment
122
- uv sync
123
-
124
- # Explode instructions into separate rule files
125
- uvx llm-ide-rules explode
126
-
127
- # Bundle rules back into instructions
128
- uvx llm-ide-rules implode cursor instructions.md
129
- ```
130
-
131
- ### Building and Testing
132
-
133
- ```shell
134
- # Build the package
135
- uv build
136
-
137
- # Run tests
138
- pytest
139
- ```
140
-
141
117
  ## Extracting Changes
142
118
 
143
119
  The idea of this repo is you'll copy prompts into your various projects. Then, if you improve a prompt in a project, you can pull that change into this upstream repo.
@@ -1,6 +1,6 @@
1
1
  # Copilot, Cursor, Claude, Gemini, etc LLM Instructions
2
2
 
3
- Going to try to centralize all my prompts in a single place and create some scripts to help convert from copilot to cursor, etc.
3
+ This project makes it easy to download prompts and implode/explode them so they can be used by various providers.
4
4
 
5
5
  I don't want to be tied to a specific IDE and it's a pain to have to edit instructions for various languages across a ton of different files.
6
6
 
@@ -8,25 +8,28 @@ Additionally, it becomes challenging to copy these prompts into various projects
8
8
 
9
9
  Some of the glob assumptions in this repo are specific to how I've chosen to organize python and typescript [in the python starter template](https://github.com/iloveitaly/python-starter-template) and what tooling (fastapi, etc) that I've chosen to use.
10
10
 
11
- ## Installation
12
-
13
- You can run the `llm-ide-rules` CLI tool using uvx:
11
+ ## IDE Format Comparison
14
12
 
15
- ```sh
16
- uvx llm-ide-rules
17
- ```
13
+ Different AI coding assistants use different formats for instructions and commands:
18
14
 
19
- Or install from the repository:
15
+ | IDE | type | folder | Notes |
16
+ |-----|------|--------|-------|
17
+ | **Cursor** | instructions | `.cursor/rules/*.mdc` | Multiple plain markdown files |
18
+ | **Cursor** | commands | `.cursor/commands/*.md` | Plain markdown, no frontmatter |
19
+ | **Claude Code** | instructions | `CLAUDE.md` | Single markdown file at root |
20
+ | **Claude Code** | instructions | `AGENT.md` | Single markdown file at root (agent-specific) |
21
+ | **Claude Code** | commands | `.claude/commands/*.md` | Plain markdown, no frontmatter |
22
+ | **GitHub Copilot** | instructions | `.github/copilot-instructions.md` | Single markdown file |
23
+ | **GitHub Copilot** | instructions | `.github/instructions/*.instructions.md` | Multiple instruction files |
24
+ | **GitHub Copilot** | prompts | `.github/prompts/*.prompt.md` | YAML frontmatter with `mode: 'agent'` |
25
+ | **Gemini CLI** | instructions | `GEMINI.md` | Single markdown file at root |
26
+ | **Gemini CLI** | commands | `.gemini/commands/*.toml` | TOML format, supports `{{args}}` and shell commands |
27
+ | **OpenCode** | commands | `.opencode/commands/*.md` | Plain markdown, no frontmatter |
20
28
 
21
- ```sh
22
- uv tool install git+https://github.com/iloveitaly/llm-ide-rules.git
23
- ```
29
+ ## Installation
24
30
 
25
31
  ```sh
26
- git clone https://github.com/iloveitaly/llm-ide-rules.git
27
- cd llm-ide-rules
28
- uv sync
29
- source .venv/bin/activate
32
+ uvx llm-ide-rules@latest --help
30
33
  ```
31
34
 
32
35
  ## Usage
@@ -41,7 +44,10 @@ uvx llm-ide-rules explode [input_file]
41
44
 
42
45
  # Bundle rule files back into a single instruction file
43
46
  uvx llm-ide-rules implode cursor [output_file] # Bundle Cursor rules
44
- uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
47
+ uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
48
+ uvx llm-ide-rules implode claude [output_file] # Bundle Claude Code commands
49
+ uvx llm-ide-rules implode gemini [output_file] # Bundle Gemini CLI commands
50
+ uvx llm-ide-rules implode opencode [output_file] # Bundle OpenCode commands
45
51
 
46
52
  # Download instruction files from repositories
47
53
  uvx llm-ide-rules download [instruction_types] # Download everything by default
@@ -52,21 +58,26 @@ uvx llm-ide-rules download --repo other/repo # Download from different repo
52
58
  uvx llm-ide-rules delete [instruction_types] # Delete everything by default
53
59
  uvx llm-ide-rules delete cursor gemini # Delete specific types
54
60
  uvx llm-ide-rules delete --yes # Skip confirmation prompt
55
-
56
61
  ```
57
62
 
58
63
  ### Examples
59
64
 
60
65
  ```sh
61
- # Explode instructions.md into .cursor/rules/ and .github/instructions/
66
+ # Explode instructions.md into all supported formats (cursor, github, claude, gemini, opencode)
62
67
  uvx llm-ide-rules explode instructions.md
63
68
 
69
+ # Explode for a specific agent only
70
+ uvx llm-ide-rules explode instructions.md --agent opencode
71
+
64
72
  # Bundle Cursor rules back into a single file
65
73
  uvx llm-ide-rules implode cursor bundled-instructions.md
66
74
 
67
75
  # Bundle GitHub instructions with verbose logging
68
76
  uvx llm-ide-rules implode github --verbose instructions.md
69
77
 
78
+ # Bundle OpenCode commands into commands.md
79
+ uvx llm-ide-rules implode opencode
80
+
70
81
  # Download everything from default repository
71
82
  uvx llm-ide-rules download
72
83
 
@@ -86,44 +97,6 @@ uvx llm-ide-rules delete cursor gemini --target ./my-project
86
97
  uvx llm-ide-rules delete --yes
87
98
  ```
88
99
 
89
- ### IDE Command Format Comparison
90
-
91
- Different AI coding assistants use different formats for commands:
92
-
93
- | IDE | Directory | Format | Notes |
94
- |-----|-----------|--------|-------|
95
- | **Cursor** | `.cursor/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
96
- | **Claude Code** | `.claude/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
97
- | **GitHub Copilot** | `.github/prompts/` | `.prompt.md` (YAML + markdown) | Requires frontmatter with `mode: 'agent'` |
98
- | **Gemini CLI** | `.gemini/commands/` | `.toml` | Uses TOML format, supports `{{args}}` and shell commands |
99
-
100
- ## Development
101
-
102
- ### Using the CLI for Development
103
-
104
- The CLI replaces the old standalone scripts. Use the CLI commands in your development workflow:
105
-
106
- ```shell
107
- # Setup the environment
108
- uv sync
109
-
110
- # Explode instructions into separate rule files
111
- uvx llm-ide-rules explode
112
-
113
- # Bundle rules back into instructions
114
- uvx llm-ide-rules implode cursor instructions.md
115
- ```
116
-
117
- ### Building and Testing
118
-
119
- ```shell
120
- # Build the package
121
- uv build
122
-
123
- # Run tests
124
- pytest
125
- ```
126
-
127
100
  ## Extracting Changes
128
101
 
129
102
  The idea of this repo is you'll copy prompts into your various projects. Then, if you improve a prompt in a project, you can pull that change into this upstream repo.
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "llm-ide-rules"
3
- version = "0.5.0"
3
+ version = "0.6.0"
4
4
  description = "CLI tool for managing LLM IDE prompts and rules"
5
5
  keywords = ["llm", "ide", "prompts", "cursor", "copilot"]
6
6
  readme = "README.md"
7
- requires-python = ">=3.9"
8
- dependencies = ["typer>=0.9.0", "structlog>=23.2.0", "requests>=2.25.0"]
7
+ requires-python = ">=3.11"
8
+ dependencies = ["typer>=0.9.0", "structlog-config>=0.6.0", "requests>=2.25.0", "pydantic>=2.0.0", "json5>=0.9.0", "tomli-w>=1.0.0"]
9
9
  authors = [{ name = "Michael Bianco", email = "mike@mikebian.co" }]
10
10
  urls = { "Repository" = "https://github.com/iloveitaly/llm-ide-rules" }
11
11
 
@@ -14,8 +14,18 @@ urls = { "Repository" = "https://github.com/iloveitaly/llm-ide-rules" }
14
14
  llm-ide-rules = "llm_ide_rules:main"
15
15
 
16
16
  [build-system]
17
- requires = ["uv_build>=0.8.11,<0.9.0"]
17
+ requires = ["uv_build>=0.9.0,<0.10.0"]
18
18
  build-backend = "uv_build"
19
19
 
20
+ # [tool.uv.build-backend]
21
+ # # avoids the src/ directory structure
22
+ # module-root = ""
23
+
20
24
  [dependency-groups]
21
- dev = ["pytest>=8.3.3"]
25
+ dev = ["pytest>=8.3.3", "pyright[nodejs]>=1.1.380", "ruff>=0.8.0", "pytest-mock>=3.10.0"]
26
+
27
+ [tool.pyright]
28
+ exclude = ["examples/", "playground/", "tmp/", ".venv/", "tests/"]
29
+
30
+ [tool.ruff]
31
+ extend-exclude = ["playground.py", "playground/"]
@@ -0,0 +1,81 @@
1
+ """LLM Rules CLI package for managing IDE prompts and rules."""
2
+
3
+ import os
4
+
5
+ if "LOG_LEVEL" not in os.environ:
6
+ os.environ["LOG_LEVEL"] = "WARNING"
7
+
8
+ import typer
9
+ from typing_extensions import Annotated
10
+
11
+ from llm_ide_rules.commands.explode import explode_main
12
+ from llm_ide_rules.commands.implode import cursor, github, claude, gemini, opencode
13
+ from llm_ide_rules.commands.download import download_main
14
+ from llm_ide_rules.commands.delete import delete_main
15
+ from llm_ide_rules.commands.mcp import mcp_app
16
+
17
+ __version__ = "0.6.0"
18
+
19
+ app = typer.Typer(
20
+ name="llm_ide_rules",
21
+ help="CLI tool for managing LLM IDE prompts and rules",
22
+ no_args_is_help=True,
23
+ )
24
+
25
+
26
+ @app.callback()
27
+ def main_callback(
28
+ verbose: Annotated[
29
+ bool,
30
+ typer.Option(
31
+ "--verbose", "-v", help="Enable verbose logging (sets LOG_LEVEL=DEBUG)"
32
+ ),
33
+ ] = False,
34
+ ):
35
+ """Global CLI options."""
36
+ if verbose:
37
+ os.environ["LOG_LEVEL"] = "DEBUG"
38
+ import structlog_config
39
+
40
+ structlog_config.configure_logger()
41
+
42
+
43
+ # Add commands directly
44
+ app.command("explode", help="Convert instruction file to separate rule files")(
45
+ explode_main
46
+ )
47
+ app.command("download", help="Download LLM instruction files from GitHub repositories")(
48
+ download_main
49
+ )
50
+ app.command("delete", help="Remove downloaded LLM instruction files")(delete_main)
51
+
52
+ # Create implode sub-typer
53
+ implode_app = typer.Typer(help="Bundle rule files into a single instruction file")
54
+ implode_app.command(
55
+ "cursor", help="Bundle Cursor rules and commands into a single file"
56
+ )(cursor)
57
+ implode_app.command(
58
+ "github", help="Bundle GitHub/Copilot instructions and prompts into a single file"
59
+ )(github)
60
+ implode_app.command("claude", help="Bundle Claude Code commands into a single file")(
61
+ claude
62
+ )
63
+ implode_app.command("gemini", help="Bundle Gemini CLI commands into a single file")(
64
+ gemini
65
+ )
66
+ implode_app.command("opencode", help="Bundle OpenCode commands into a single file")(
67
+ opencode
68
+ )
69
+ app.add_typer(implode_app, name="implode")
70
+
71
+ # Add MCP configuration management
72
+ app.add_typer(mcp_app, name="mcp")
73
+
74
+
75
+ def main():
76
+ """Main entry point for the CLI."""
77
+ app()
78
+
79
+
80
+ if __name__ == "__main__":
81
+ main()
@@ -3,4 +3,4 @@
3
3
  from llm_ide_rules import main
4
4
 
5
5
  if __name__ == "__main__":
6
- main()
6
+ main()
@@ -0,0 +1,28 @@
1
+ """Agent registry for LLM IDE rules."""
2
+
3
+ from llm_ide_rules.agents.base import BaseAgent
4
+ from llm_ide_rules.agents.cursor import CursorAgent
5
+ from llm_ide_rules.agents.github import GitHubAgent
6
+ from llm_ide_rules.agents.claude import ClaudeAgent
7
+ from llm_ide_rules.agents.gemini import GeminiAgent
8
+ from llm_ide_rules.agents.opencode import OpenCodeAgent
9
+
10
+ AGENTS: dict[str, type[BaseAgent]] = {
11
+ "cursor": CursorAgent,
12
+ "github": GitHubAgent,
13
+ "claude": ClaudeAgent,
14
+ "gemini": GeminiAgent,
15
+ "opencode": OpenCodeAgent,
16
+ }
17
+
18
+
19
+ def get_agent(name: str) -> BaseAgent:
20
+ """Get an agent instance by name."""
21
+ if name not in AGENTS:
22
+ raise ValueError(f"Unknown agent: {name}. Available: {list(AGENTS.keys())}")
23
+ return AGENTS[name]()
24
+
25
+
26
+ def get_all_agents() -> list[BaseAgent]:
27
+ """Get instances of all registered agents."""
28
+ return [agent_cls() for agent_cls in AGENTS.values()]