cline:paper and code repos - chunhualiao/public-docs GitHub Wiki

cline

This is a great question about managing related paper and code repositories. Let me explain the best practices for using Cline in this scenario:

Approach 1: Separate Cline Sessions (Recommended)

Use separate Cline sessions for paper and code repositories because:

Distinct Contexts

  • Paper session maintains focus on academic writing, LaTeX formatting, and paper structure
  • Code session focuses on implementation, testing, and software engineering
  • Each session has its own relevant .clinerules file

Clean Memory Management

  • Paper-related memories stay with paper context
  • Code-related memories remain with code context
  • Prevents context mixing and confusion

Parallel Development

  • Can have both sessions open side-by-side in VS Code
  • Switch between them as needed
  • Each maintains its own state and history

Added cross-references to the paper repository


Approach 2: Single Cline Session

While possible, using a single session for both repos has limitations:

Context Switching Overhead

  • Need to frequently change directories
  • Mixed context in memories
  • Potential confusion in tool usage

Rule Conflicts

  • Can't have two different .clinerules active simultaneously
  • May miss repo-specific guidelines

Best Practices for Dual-Repo Development

Repository Structure

workspace/
├── paper-repo/
│   ├── .clinerules (paper-specific rules)
│   ├── main.tex
│   └── ...
└── code-repo/
    ├── .clinerules (code-specific rules)
    ├── src/
    └── ...

Cross-Repository References

In paper/.clinerules, add:

## Related Code Repository
- Location: ../code-repo
- When referencing code:
  - Use consistent naming with implementation
  - Keep code snippets in paper synchronized
  - Update paper examples when code changes

In code/.clinerules, add:

## Related Paper Repository
- Location: ../paper-repo
- Documentation practices:
  - Match variable names with paper
  - Keep API documentation aligned with paper
  - Tag versions referenced in paper

Workflow Recommendations

  • Use two VS Code windows or split view
  • Run separate Cline sessions in each
  • Coordinate version tags between repos
  • Maintain consistent terminology across both
  • Use Git tags to mark paper submission versions