lc_rule_instructions
Generate step-by-step instructions for creating custom rules in your codebase to automate processes and enforce standards.
Instructions
Provides step-by-step instructions for creating custom rules. Args: root_path: Root directory path
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root_path | Yes |
Implementation Reference
- src/llm_context/mcp.py:38-47 (handler)Handler function for the lc_rule_instructions tool, registered via @mcp.tool() decorator. It creates an ExecutionEnvironment from the root_path and delegates to commands.get_focus_help(env) to retrieve the instructions.@mcp.tool() def lc_rule_instructions(root_path: str) -> str: """Provides step-by-step instructions for creating custom rules. Args: root_path: Root directory path """ env = ExecutionEnvironment.create(Path(root_path)) with env.activate(): return commands.get_focus_help(env)
- src/llm_context/commands.py:81-85 (helper)Helper function called by the tool handler. It instantiates a ContextGenerator with specific settings and returns its focus_help() output.def get_focus_help(env: ExecutionEnvironment) -> str: settings = ContextSettings.create(False, False, True, False) generator = ContextGenerator.create(env.config, env.state.file_selection, settings) return generator.focus_help()
- The core logic of the tool: retrieves the content of the 'lc/ins-rule-framework' rule, which provides the step-by-step instructions for creating custom rules.def focus_help(self) -> str: rule_provider = RuleProvider.create(self.spec.project_layout) return rule_provider.get_rule_content("lc/ins-rule-framework") or ""