Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Description

Brief description of the changes in this PR.

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
- [ ] CI/CD improvement

## Quality Gates

Before submitting, ensure all quality gates pass:

```bash
make check
```

Or run individually:
- [ ] `make test` - All tests pass with ≥90% coverage
- [ ] `make lint` - No linting errors
- [ ] `make format` - Code is properly formatted
- [ ] `make typecheck` - Type checking passes
- [ ] `make doccheck` - Documentation is synced with DocC (if docs changed)

## Documentation Sync

If you modified files in `docs/`, ensure corresponding DocC files are also updated:

| docs/ file | DocC file |
|------------|-----------|
| `docs/installation.md` | `mcpbridge-wrapper.docc/Installation.md` |
| `docs/cursor-setup.md` | `mcpbridge-wrapper.docc/CursorSetup.md` |
| `docs/claude-setup.md` | `mcpbridge-wrapper.docc/ClaudeCodeSetup.md` |
| `docs/codex-setup.md` | `mcpbridge-wrapper.docc/CodexCLISetup.md` |
| `docs/troubleshooting.md` | `mcpbridge-wrapper.docc/Troubleshooting.md` |
| `docs/architecture.md` | `mcpbridge-wrapper.docc/Architecture.md` |
| `docs/environment-variables.md` | `mcpbridge-wrapper.docc/EnvironmentVariables.md` |
| `README.md` | `mcpbridge-wrapper.docc/mcpbridge-wrapper.md` |

- [ ] Documentation changes are synced with DocC catalog (or N/A)

## Testing

- [ ] Added/updated tests for new functionality
- [ ] All tests pass locally
- [ ] Manually tested the changes

## Checklist

- [ ] Code follows the project's style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated (if needed)
- [ ] No new warnings generated
- [ ] PR title is descriptive
114 changes: 114 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Allow manual trigger

jobs:
doc-sync:
name: Doc Sync Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for branch comparison

- name: Check DocC sync
run: python scripts/check_doc_sync.py --branch
lint:
name: Lint & Type Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy

- name: Run ruff linter
run: ruff check src/

- name: Run ruff formatter check
run: ruff format --check src/ tests/

- name: Run mypy type checker
run: mypy src/

test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests with coverage
run: |
pytest tests/ -v --cov=src --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true

build:
name: Build Package
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: python -m build

- name: Check package with twine
run: twine check dist/*

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ Before submitting a PR, ensure:
- Linting passes: `ruff check src/`
- Type checking passes: `mypy src/`

See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development setup and quality gate commands.

## References

- [Apple Official Documentation](https://developer.apple.com/documentation/xcode/giving-external-agentic-coding-tools-access-to-xcode)
Expand Down
167 changes: 167 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Contributing to mcpbridge-wrapper

Thank you for your interest in contributing! This document outlines the development workflow and quality gates.

## Development Setup

```bash
# Clone the repository
git clone https://github.com/SoundBlaster/XcodeMCPWrapper.git
cd XcodeMCPWrapper

# Install in editable mode with dev dependencies
pip install -e ".[dev]"
```

## Quality Gates

All code must pass the following quality gates before being merged:

### 1. Tests (pytest)

Run all tests with coverage:

```bash
pytest tests/ -v --cov=src --cov-report=term
```

Requirements:
- All tests must pass
- Coverage must remain ≥90%

### 2. Linting (ruff)

Check for code issues:

```bash
ruff check src/ tests/
```

Auto-fix issues where possible:

```bash
ruff check src/ tests/ --fix
```

### 3. Formatting (ruff)

Check code formatting:

```bash
ruff format --check src/ tests/
```

Apply formatting:

```bash
ruff format src/ tests/
```

### 4. Type Checking (mypy)

```bash
mypy src/
```

### 5. Doc Sync Check

Ensure documentation changes are synced with DocC catalog:

```bash
make doccheck
# or
python scripts/check_doc_sync.py
```

This checks that changes to `docs/*.md` files are also reflected in the DocC catalog (`mcpbridge-wrapper.docc/`).

### 6. Build Verification

Ensure the package builds correctly:

```bash
python -m build
twine check dist/*
```

## Quick Check Script

Run all quality gates at once:

```bash
make test && make lint && make typecheck
```

Or use this bash script (save as `check.sh`):

```bash
#!/bin/bash
set -e

echo "=== Running Quality Gates ==="

echo "1. Running tests..."
pytest tests/ -v --cov=src --cov-report=term

echo "2. Running linter..."
ruff check src/ tests/

echo "3. Checking format..."
ruff format --check src/ tests/

echo "4. Running type checker..."
mypy src/

echo "5. Checking doc sync..."
python scripts/check_doc_sync.py

echo "6. Building package..."
python -m build && twine check dist/*

echo "=== All Quality Gates Passed ==="
```

Make it executable and run:

```bash
chmod +x check.sh
./check.sh
```

## Workflow

We follow the [FLOW.md](SPECS/COMMANDS/FLOW.md) workflow:

1. **BRANCH** - Create a feature branch from `main`
2. **SELECT** - Pick a task from the workplan
3. **PLAN** - Create a PRD for the task
4. **EXECUTE** - Implement and run quality gates
5. **ARCHIVE** - Move completed task to archive

## Pull Request Process

1. Create a feature branch: `git checkout -b feature/TASK-ID-description`
2. Make your changes and run quality gates
3. Commit with clear messages
4. Push to your fork
5. Create a Pull Request against `main`

## CI/CD

All PRs trigger GitHub Actions CI which runs:
- Lint & Type Check (Python 3.11)
- Tests (Python 3.9, 3.10, 3.11, 3.12)
- Package Build

See [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for details.

## Code Style

- Follow PEP 8 guidelines
- Use type hints where possible
- Write docstrings for public functions
- Keep functions focused and small

## Questions?

Open an issue or check the [troubleshooting guide](docs/troubleshooting.md).
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for mcpbridge-wrapper

.PHONY: help install test lint format typecheck clean
.PHONY: help install test lint format typecheck doccheck clean

help:
@echo "Available targets:"
Expand All @@ -9,7 +9,9 @@ help:
@echo " lint - Run ruff linter"
@echo " format - Run ruff formatter"
@echo " typecheck - Run mypy type checker"
@echo " doccheck - Check docs/ are synced with DocC catalog"
@echo " clean - Clean build artifacts"
@echo " check - Run all quality gates (test, lint, format, typecheck, doccheck)"

install:
pip install -e .
Expand All @@ -26,6 +28,11 @@ format:
typecheck:
mypy src/

doccheck:
python scripts/check_doc_sync.py

check: test lint format typecheck doccheck

clean:
rm -rf build/ dist/ *.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} +
Expand Down
Loading