Skip to content

Conversation

@Miyamura80
Copy link
Owner

No description provided.

This workflow automatically updates documentation in /docs when significant
codebase changes are detected (>50 lines changed outside docs).

Features:
- Triggers on pushes to main or merged PRs
- Detects significant code changes (excluding docs)
- Uses Cursor agent to update documentation
- Strict restrictions: agent can ONLY modify files in /docs
- Creates PR with documentation updates

The agent is explicitly prevented from modifying:
- Any code files (.py, .js, .ts, etc.)
- Configuration files (pyproject.toml, etc.)
- CI/CD files (.github/workflows/)
- Any files outside /docs directory
Implements a comprehensive system to distinguish between public-facing
APIs (which need comprehensive docs) and private/internal code (which
only needs docstrings).

Changes:
1. Added .cursor/docs-scope.yml - Configuration defining:
   - public_modules: Code requiring comprehensive /docs (e.g., common/)
   - private_modules: Internal code needing only docstrings (e.g., utils/, tests/)
   - Documentation triggers and requirements

2. Added .cursor/rules/documentation.mdc - Cursor rules for:
   - Public vs private API identification
   - Documentation quality standards
   - When to document in /docs vs just docstrings
   - Explicit markers (# Public API, # Internal only)

3. Updated .github/workflows/cursor_update_docs.yml to:
   - Check if public modules changed (not just line count)
   - Detect critical file patterns (__init__.py, global_config.*, etc.)
   - Enforce documentation scope in agent prompt
   - Only document PUBLIC-FACING changes
   - Skip private/internal code documentation

4. Added docs/api/api-visibility-guide.md:
   - Guide for marking code as public vs private
   - Examples of proper documentation
   - Quick reference table

5. Added docs/DOCUMENTATION_SYSTEM.md:
   - Overview of the automated documentation system
   - How it works and when it triggers
   - Configuration guide
   - Best practices

Benefits:
- Prevents over-documentation of internal utilities
- Focuses documentation effort on user-facing APIs
- Clear system for determining what needs docs
- Automated enforcement via workflow
- Easy to extend with new public modules
Significantly reduced verbosity while preserving all essential information:

- Workflow prompt: ~100 lines → ~25 lines (75% reduction)
- documentation.mdc: ~280 lines → ~90 lines (68% reduction)
- docs-scope.yml: ~180 lines → ~85 lines (53% reduction)

Changes maintain all critical information:
- Scope rules (public vs private)
- Restrictions (only modify /docs)
- Workflow steps
- Configuration structure

Benefits:
- Faster to read and understand
- Lower token usage for LLM agents
- Easier to maintain
- Core information now more visible
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