Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tommcd
Copy link
Owner

@tommcd tommcd commented Nov 18, 2025

Add detailed CLAUDE.md documentation covering:

  • Project overview and philosophy
  • Complete repository structure
  • Development workflows and setup
  • Code conventions and style guidelines
  • Testing strategy and coverage
  • Key technologies and dependencies
  • Common development tasks
  • Important patterns and anti-patterns
  • External tools plugin system
  • Quick reference guide

This guide provides AI assistants with everything needed to understand the codebase structure, development workflows, and conventions for contributing to doctk.

Add detailed CLAUDE.md documentation covering:
- Project overview and philosophy
- Complete repository structure
- Development workflows and setup
- Code conventions and style guidelines
- Testing strategy and coverage
- Key technologies and dependencies
- Common development tasks
- Important patterns and anti-patterns
- External tools plugin system
- Quick reference guide

This guide provides AI assistants with everything needed to
understand the codebase structure, development workflows, and
conventions for contributing to doctk.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tommcd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, extensive CLAUDE.md documentation file to the doctk project. The primary purpose of this document is to provide AI assistants with a detailed and structured guide to understand the project's philosophy, codebase architecture, development workflows, and established conventions. By centralizing this critical information, the PR aims to enhance the efficiency and consistency of contributions from automated agents, ensuring they are well-equipped to interact with and evolve the doctk toolkit.

Highlights

  • New AI Assistant Documentation: A comprehensive CLAUDE.md file has been added, specifically designed to guide AI assistants through the doctk project's codebase and development practices.
  • Detailed Project Guidance: The new document covers a wide array of topics including project overview, repository structure, development workflows, code conventions (Python, Shell, Markdown, TOML), and the testing strategy.
  • Key Development Patterns and Tools: It outlines important design patterns like immutability, functors, and the visitor pattern, details anti-patterns to avoid, and explains the novel Markdown-driven external tools system.
  • Quick Reference and Onboarding: The guide includes a quick reference section with essential commands, file locations for common tasks, and core abstraction references to facilitate rapid onboarding and understanding for contributors.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive CLAUDE.md guide for AI assistants, which is an excellent initiative for improving collaboration with AI on this project. The document is thorough and well-structured. I've provided a few review comments to correct some commands in the development workflow, fix minor typos, and improve the clarity of a code example to ensure the guide is as accurate and helpful as possible.

Fix technical inaccuracies and improve documentation clarity:

1. Fix uv sync command syntax
   - Change from `uv sync --all-groups` to `uv sync --group dev --group docs`
   - Matches current uv CLI syntax for dependency groups

2. Fix pytest command for running slow tests
   - Replace non-standard `--run-slow` flag with proper marker syntax
   - Use `pytest -m slow` or `pytest -m "slow or not slow"`
   - Aligns with pytest marker configuration in pyproject.toml

3. Use relative path instead of absolute path
   - Change `/home/user/doctk/` to `doctk/`
   - Makes documentation more generic and less user-specific

4. Fix file extension typo in repository structure
   - Correct `markdown.md` to `markdown.py` in writers directory
   - Matches actual file in src/doctk/writers/

5. Add missing imports to code example
   - Include `Callable`, `Document`, `Node` imports
   - Define `Operation` type alias
   - Makes code example complete and runnable

All changes based on gemini-code-assist review:
#1 (review)
After investigating gemini-code-assist review feedback, determined that
--all-groups is actually valid and preferable:

- `uv sync --all-groups` was added in uv 0.5.4 (Nov 2024)
- See: astral-sh/uv#8892
- It's cleaner, matches setup-environment.sh, and is more maintainable
- Added clarifying comments "(dev and docs)" to show what groups exist

Changes kept from previous commit (df36f34):
✅ Fix pytest -m slow marker syntax (was incorrectly --run-slow)
✅ Use relative path doctk/ instead of /home/user/doctk/
✅ Fix markdown.py typo in writers directory (was markdown.md)
✅ Add missing imports to code example (Callable, Document, Node, Operation)

Changes reverted:
↩️  Restore --all-groups instead of --group dev --group docs

The explicit --group syntax was the reviewer's suggestion, but --all-groups
is simpler, matches actual implementation, and is now well-established.
Reduce GitHub Actions test jobs from 15 to 6:

Before:
- 3 OS × 5 Python versions = 15 jobs
- Ubuntu, macOS, Windows all tested with Python 3.10-3.14

After:
- Ubuntu: All Python versions (3.10, 3.11, 3.12, 3.13, 3.14) - 5 jobs
- Windows: Only Python 3.14 (compatibility check) - 1 job
- macOS: Removed (not critical for this project)
- Total: 6 jobs (60% reduction)

Rationale:
- Few tests in the suite don't justify extensive cross-platform matrix
- Ubuntu is primary development/deployment platform
- Windows 3.14 provides basic cross-platform validation
- Codecov still uploads from Ubuntu 3.11

Additional fix:
- Change uv sync --all-extras to --all-groups (correct flag)
- Update CLAUDE.md CI/CD documentation to reflect optimized matrix
Focus on actively maintained Python versions only.

Changes:
- Require Python 3.12+ (was 3.10+)
- CI: Test only 3.12, 3.13, 3.14 on Ubuntu + 3.14 on Windows
- Reduce CI jobs from 6 to 4 (33% faster)

Rationale:
- Python 3.10 and 3.11 are in security-fix-only mode
- For a new project (v0.1.0), supporting only actively maintained
  versions reduces maintenance burden
- 3 Python versions provides adequate coverage
- Users on older Python can stay on doctk v0.0.x if needed

Updated files:
- pyproject.toml: requires-python = ">=3.12"
- .github/workflows/tests.yml: Remove 3.10, 3.11 from matrix
- README.md: Update badge to Python 3.12+
- CLAUDE.md: Update all references to Python versions
- CONTRIBUTING.md: Update prerequisites
- scripts/setup-environment.sh: Check for 3.12+ with updated regex
- scripts/check-environment.sh: Check for 3.12+ (was 3.10+)
- docs/: Update installation and development guides
- examples/sample.md: Update Python version requirement

Codecov now uploads from Ubuntu 3.13 (was 3.11).
Further optimize CI by removing Windows builds.

Changes:
- Remove Windows job from CI matrix
- Reduce from 4 jobs to 3 jobs (25% faster)
- Simplify matrix syntax (no more include blocks)

Rationale:
- Windows builds are significantly slower in GitHub Actions
- Project is early stage (v0.1.0) with limited test suite
- Document processing is primarily Unix/Linux focused
- Can add Windows back later if users report issues
- 3 Python versions on Ubuntu provides adequate coverage

New matrix:
- Ubuntu: Python 3.12, 3.13, 3.14
- Total: 3 jobs

This saves ~2-5 minutes per CI run and simplifies maintenance.
@tommcd tommcd merged commit 787265e into master Nov 18, 2025
3 checks passed
tommcd pushed a commit that referenced this pull request Nov 18, 2025
Add detailed design and implementation plan for 2 remaining PR #6 review issues:

1. CRITICAL: Granular document edits (Issue #1)
   - Added 'Optimized Edits (CRITICAL IMPROVEMENT)' section to design.md
   - Explains problem: full document replacement clears undo/redo, loses cursor
   - Solution: Backend computes ModifiedRange[], frontend applies granular edits
   - Added 5 subtasks (22.5.1-22.5.5) to tasks.md with implementation steps

2. MEDIUM: Centralize ID generation (Issue #5)
   - Added 'Centralized Node ID Generation' section to design.md
   - Explains problem: Duplicate ID logic in frontend and backend
   - Solution: Backend as single source of truth for tree structure & IDs
   - Added 4 subtasks (22.6.1-22.6.4) to tasks.md with implementation steps

Both sections include:
- Problem statement and impact
- Proposed solution with code examples
- Design rationale
- Backend and frontend changes
- Testing requirements

This provides clear roadmap for addressing the remaining architectural issues
identified in #6 (review)
tommcd pushed a commit that referenced this pull request Nov 18, 2025
Implement ModifiedRange-based edits to preserve cursor position and undo/redo
stack. This addresses the CRITICAL issue from PR #6 review.

Backend changes:
- Add ModifiedRange dataclass to protocols.py with line/column positions
- Implement DiffComputer class to compute changed text ranges
- Update all operations (promote, demote, move_up, move_down, nest, unnest)
  to return modified_ranges in addition to full document
- Update bridge.py to serialize ModifiedRange objects to JSON

Frontend changes:
- Add ModifiedRange interface to types.ts
- Update extension.ts executeOperation() to use granular edits when available
- Fall back to full document replacement if modified_ranges not provided
- This preserves cursor position and undo/redo stack

Design changes:
- Remove Approach 2 (Backend ID Service) from design.md
- Keep only Backend-Driven Tree Structure approach for centralized IDs

All 34 existing tests pass. Granular edits improve UX by:
- Preserving cursor position during operations
- Maintaining VS Code undo/redo stack
- Better performance for large documents

Related: PR #6 review issue #1 (CRITICAL)
@tommcd tommcd deleted the claude/claude-md-mi3u3ez3w7nirl7w-015sdXDRQchBWgCwqgd1ATZe branch November 22, 2025 13:51
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