cognitive/docs/tools/git_workflow.md
Daniel Ari Friedman 6caa1a7cb1 Update
2025-02-07 08:16:25 -08:00

3.8 KiB

Git Workflow Guide

Overview

This guide outlines our Git workflow for managing cognitive modeling projects, integrating with both cursor_integration and obsidian_usage.

Repository Structure

Core Branches

  • main - Stable production code
  • develop - Integration branch
  • feature/* - Feature branches
  • release/* - Release preparation
  • hotfix/* - Production fixes

Workflow Patterns

Feature Development

  1. Create feature branch from develop:

    git checkout develop
    git pull origin develop
    git checkout -b feature/new-feature
    
  2. Develop with cursor_integration:

  3. Commit changes:

    git add .
    git commit -m "feat: add new feature
    
    - Added X functionality
    - Updated Y components
    - Related to #issue"
    

Knowledge Base Changes

Working with Obsidian

  1. Create knowledge branch:

    git checkout -b kb/topic-name
    
  2. Update content:

  3. Commit changes:

    git add knowledge_base/
    git commit -m "kb: update topic structure
    
    - Added new nodes
    - Updated relationships
    - Fixed broken links"
    

Commit Conventions

Message Structure

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • kb: Knowledge base
  • refactor: Code refactoring
  • test: Testing
  • chore: Maintenance

Scopes

  • agent: Agent-related changes
  • belief: Belief network updates
  • model: Model implementation
  • docs: Documentation
  • kb: Knowledge base

Integration Practices

With Obsidian

  • Track .obsidian/ selectively
  • Include templates
  • Exclude personal settings
  • See obsidian_usage

With Cursor

Branching Strategy

Feature Branches

  • Branch from: develop
  • Merge to: develop
  • Naming: feature/description

Knowledge Base Branches

  • Branch from: main
  • Merge to: main
  • Naming: kb/topic

Release Branches

  • Branch from: develop
  • Merge to: main and develop
  • Naming: release/version

Code Review

Process

  1. Create Pull Request
  2. Use cursor_integration for review
  3. Check code_style compliance
  4. Verify testing_guide coverage
  5. Update documentation_guide

Checklist

  • Code follows style guide
  • Tests added/updated
  • Documentation updated
  • Knowledge base links valid
  • CI/CD passes

Conflict Resolution

Strategy

  1. Keep local branch updated:

    git fetch origin
    git rebase origin/develop
    
  2. Resolve conflicts:

Best Practices

Repository Maintenance

Knowledge Management

  • Consistent structure
  • Clear relationships
  • Updated metadata
  • See obsidian_usage

Collaboration

  • Clear communication
  • Regular updates
  • Proper documentation
  • Follow workflow_guides

Automation

Git Hooks

#!/bin/sh
# pre-commit hook
npm run lint
npm run test

CI/CD Integration

  • Automated testing
  • Documentation generation
  • Knowledge base validation
  • See deployment_guide

Troubleshooting

Common Issues

  • Merge conflicts
  • Lost changes
  • Broken links See troubleshooting for solutions.

References