Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 18, 2025

Summary

  • Migrate rules from .cursor/rules/ to .claude/rules/ as the single source of truth
  • Replace .cursor/rules/*.mdc files with symlinks to .claude/rules/*.md
  • Add paths field for Claude Code and globs field for Cursor compatibility
  • Update CLAUDE.md with rules structure documentation

What Changed

  • New location: Rules now live in .claude/rules/ with simplified YAML frontmatter
  • Symlinks: .cursor/rules/ contains symlinks for Cursor IDE compatibility
  • New rules: Added development-workflow.md and git-workflow.md
  • Removed: cursor-rules-location.mdc (obsolete with new structure)
  • Documentation: CLAUDE.md updated with rules table matching Node SDK format

Why

Aligns Python SDK structure with Node SDK for consistency across projects. Having a single source of truth in .claude/rules/ makes maintenance easier and ensures both Claude Code and Cursor use the same rule definitions.


Summary by cubic

Consolidates all project rules under .claude/rules as the single source of truth, with .cursor/rules replaced by symlinks for Cursor compatibility. Adds new workflow rules and updates CLAUDE.md to document the structure.

  • Refactors

    • Move rules to .claude/rules with simplified YAML frontmatter.
    • Add paths (Claude Code) and globs (Cursor) for rule targeting.
    • Replace .cursor/rules/.mdc with symlinks to .claude/rules/.md; remove cursor-rules-location.mdc.
    • Add development-workflow.md and git-workflow.md.
    • Update CLAUDE.md with a rules table and usage guidance.
  • Migration

    • Edit rules only in .claude/rules going forward.
    • Ensure symlinks are supported in your environment (especially on Windows) when cloning the repo.

Written for commit e703169. Summary will update automatically on new commits.

… rules

Migrate project rules from .cursor/rules/ to .claude/rules/ to establish
a single source of truth for both Claude Code and Cursor IDE.

New rules structure:
- development-workflow.md: Code style and project conventions
- git-workflow.md: Commit conventions, branch strategy, PR guidelines
- examples-standards.md: Example requirements and organisation
- no-relative-imports.md: Enforce absolute imports in Python files
- package-installation.md: UV package management standards
- release-please-standards.md: Release versioning with release-please
- uv-scripts.md: Utility script standards with UV

All rules now use simplified YAML frontmatter format compatible with
both Claude Code (via description/alwaysApply) and Cursor (via globs).
…e/rules/

Convert .cursor/rules/*.mdc files to symlinks pointing to their
corresponding .claude/rules/*.md sources. This ensures consistency
between Claude Code and Cursor IDE rule definitions.

Changes:
- Remove cursor-rules-location.mdc (obsolete with new structure)
- Add symlinks for development-workflow and git-workflow (new rules)
- Convert existing rules to symlinks (examples-standards, no-relative-imports,
  package-installation, release-please-standards, uv-scripts)

Symlink format: .cursor/rules/foo.mdc -> ../../.claude/rules/foo.md
Update CLAUDE.md to document the new rules and skills structure,
matching the Node SDK's format.

Changes:
- Add rules/skills structure explanation section
- Add table of available rules with their glob patterns
- Update references to use rule names instead of file paths
- Use UK English spelling (behaviour, organisation)
Copilot AI review requested due to automatic review settings December 18, 2025 19:11
Replace all make commands with just commands in rules and CLAUDE.md
to reflect the migration from Makefile to justfile.
@ryoppippi ryoppippi enabled auto-merge (squash) December 18, 2025 19:14
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 21 files

Prompt for AI agents (all 3 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".claude/rules/uv-scripts.md">

<violation number="1" location=".claude/rules/uv-scripts.md:20">
P2: Python version in UV script header (`&gt;=3.8`) is inconsistent with project&#39;s minimum Python version (`&gt;=3.9`). Update to match project requirements to avoid confusion.</violation>

<violation number="2" location=".claude/rules/uv-scripts.md:61">
P2: Example script doesn&#39;t follow the error handling guidelines specified earlier in this same document. Consider wrapping the HTTP call in try/except to demonstrate the recommended pattern.</violation>
</file>

<file name=".claude/rules/development-workflow.md">

<violation number="1" location=".claude/rules/development-workflow.md:20">
P2: Documentation states &#39;Use Python 3.11+ typing features&#39; but the project requires Python &gt;=3.9. This is misleading since Python 3.11+ syntax won&#39;t work on older versions. Consider updating to clarify that developers should use `typing_extensions` for features not available in Python 3.9+, or specify which syntax features are safe to use.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR


async def fetch_data() -> Dict:
async with httpx.AsyncClient() as client:
response = await client.get("https://api.example.com")
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Example script doesn't follow the error handling guidelines specified earlier in this same document. Consider wrapping the HTTP call in try/except to demonstrate the recommended pattern.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .claude/rules/uv-scripts.md, line 61:

<comment>Example script doesn&#39;t follow the error handling guidelines specified earlier in this same document. Consider wrapping the HTTP call in try/except to demonstrate the recommended pattern.</comment>

<file context>
@@ -0,0 +1,66 @@
+
+async def fetch_data() -&gt; Dict:
+    async with httpx.AsyncClient() as client:
+        response = await client.get(&quot;https://api.example.com&quot;)
+        return response.json()
+
</file context>
Fix with Cubic


```python
# /// script
# requires-python = ">=3.8"
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Python version in UV script header (>=3.8) is inconsistent with project's minimum Python version (>=3.9). Update to match project requirements to avoid confusion.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .claude/rules/uv-scripts.md, line 20:

<comment>Python version in UV script header (`&gt;=3.8`) is inconsistent with project&#39;s minimum Python version (`&gt;=3.9`). Update to match project requirements to avoid confusion.</comment>

<file context>
@@ -0,0 +1,66 @@
+
+```python
+# /// script
+# requires-python = &quot;&gt;=3.8&quot;
+# dependencies = [
+#   &quot;package1&quot;,
</file context>
Fix with Cubic

## Type Annotations

- Full type annotations required for all public APIs
- Use Python 3.11+ typing features
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Documentation states 'Use Python 3.11+ typing features' but the project requires Python >=3.9. This is misleading since Python 3.11+ syntax won't work on older versions. Consider updating to clarify that developers should use typing_extensions for features not available in Python 3.9+, or specify which syntax features are safe to use.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .claude/rules/development-workflow.md, line 20:

<comment>Documentation states &#39;Use Python 3.11+ typing features&#39; but the project requires Python &gt;=3.9. This is misleading since Python 3.11+ syntax won&#39;t work on older versions. Consider updating to clarify that developers should use `typing_extensions` for features not available in Python 3.9+, or specify which syntax features are safe to use.</comment>

<file context>
@@ -0,0 +1,63 @@
+## Type Annotations
+
+- Full type annotations required for all public APIs
+- Use Python 3.11+ typing features
+- Run `make mypy` to verify type correctness
+- Strict mypy configuration is enforced
</file context>
Fix with Cubic

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the rules structure to consolidate Claude Code and Cursor IDE rules into a single source of truth. Rules are migrated from .cursor/rules/*.mdc to .claude/rules/*.md with simplified Markdown format and YAML frontmatter, while .cursor/rules/ now contains symlinks for backward compatibility.

Key changes:

  • Migrates all rules from .cursor/rules/ to .claude/rules/ as the authoritative source
  • Converts .cursor/rules/*.mdc files to symlinks pointing to .claude/rules/*.md
  • Adds two new rules: development-workflow.md and git-workflow.md for comprehensive project guidance
  • Updates CLAUDE.md documentation with a structured rules table and improved navigation

Reviewed changes

Copilot reviewed 16 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CLAUDE.md Updated documentation structure with rules table, removed direct file references in favor of rule names, changed "Behavior" to "Behaviour" for British English consistency
.cursor/rules/*.mdc Converted all rule files to symlinks pointing to corresponding .claude/rules/*.md files
.claude/rules/uv-scripts.md New rule file with YAML frontmatter, both globs and paths fields, simplified Markdown structure
.claude/rules/release-please-standards.md New rule file using alwaysApply: true for global application
.claude/rules/package-installation.md New rule file with path-specific targeting for pyproject.toml files
.claude/rules/no-relative-imports.md New rule file targeting Python files with import standards
.claude/rules/git-workflow.md New comprehensive git workflow rule with commit conventions and PR guidelines
.claude/rules/examples-standards.md New rule file for example code standards and structure
.claude/rules/development-workflow.md New comprehensive development workflow rule covering code style and tooling
.cursor/rules/cursor-rules-location.mdc Removed as obsolete with new symlink-based structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Snapshot testing for tool parsing (`tests/snapshots/`)
- Async tests use `pytest-asyncio`
- Example validation: See @./.cursor/rules/examples-standards
- See `examples-standards` rule for example validation
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference format changed from using @./.cursor/rules/examples-standards to just examples-standards rule. However, this line should be updated to match the format used on line 102: "See examples-standards rule" instead of "See examples-standards rule for example validation". Consider making the phrasing consistent: either "See rule-name rule for..." on both lines, or use a different consistent format.

Suggested change
- See `examples-standards` rule for example validation
- See `examples-standards` rule

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Update GitHub workflow files from .yml to .yaml extension
- Enhance version update script to refresh uv.lock
- Resolve symlink conflict in cursor rules
@ryoppippi ryoppippi merged commit 225c852 into main Dec 18, 2025
7 checks passed
@ryoppippi ryoppippi deleted the refactor/reorganise-claude-cursor-rules branch December 18, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants