Skip to content

Commit 317e7f2

Browse files
committed
docs: add upstream-sync playbook for agents
1 parent fa45ace commit 317e7f2

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Upstream sync playbook
2+
3+
This fork tracks `perplexityai/modelcontextprotocol`. The workflow at `.github/workflows/upstream-sync.yml` opens/updates a single issue (label `upstream-sync`, typically #1) whenever upstream lands new commits. When that issue is open, follow the steps below.
4+
5+
## Rules of engagement
6+
7+
- **Do not merge, push to `main`, or close the sync issue without explicit per-step approval from the user.** "Let's address that" is approval to investigate and propose a plan — not to execute. Show the plan, wait for go-ahead, then execute one step at a time.
8+
- This repo prefers **rebase merge**, never merge commits.
9+
- The sync ships as a **PR against the fork** — do not push directly to `main`. Even though the auto-generated issue body literally says `git push origin main`, ignore that line.
10+
- No AI attribution (`Co-Authored-By: Claude…`, etc.) in commits or PR bodies.
11+
12+
## Workflow
13+
14+
1. Read the open `upstream-sync` issue:
15+
```bash
16+
gh issue list --repo tqtensor/modelcontextprotocol --label upstream-sync
17+
gh issue view <n> --repo tqtensor/modelcontextprotocol
18+
```
19+
2. Inspect divergence:
20+
```bash
21+
git fetch upstream main
22+
git log upstream/main ^main --oneline
23+
git diff main...upstream/main --stat
24+
```
25+
3. Decide what to bring in. Apply this fork's established filters (confirm with the user before deviating):
26+
- **No install badges** (Cursor / VS Code / Kiro / …). They hardcode `@perplexity-ai/mcp-server` + `PERPLEXITY_API_KEY` and would launch the upstream server, not this fork.
27+
- **No npm version badge.** The fork installs from GitHub, not npm.
28+
- **Keep the separate "VS Code" section** with the `servers` / `type: stdio` schema. Don't accept upstream's consolidation that folds VS Code into the `mcpServers` table.
29+
- Adapt all commands and JSON to fork conventions: package `github:tqtensor/modelcontextprotocol`, env var `OPENROUTER_API_KEY`.
30+
4. Pick a strategy and confirm with the user:
31+
- **Single-commit PR (preferred when most upstream content is filtered out).** Branch from `main`, make only the changes you actually want, open one PR. Loses upstream commit attribution but yields the cleanest history.
32+
- **Rebase then PR.** `git rebase upstream/main`, resolve conflicts per the filters above, push the branch, open the PR. Use this only when most upstream commits should land verbatim.
33+
5. Open the PR **against the fork**, not upstream. `gh pr create` defaults to the parent repo from a fork checkout, so always pass `--repo` and `--head` explicitly:
34+
```bash
35+
gh pr create --repo tqtensor/modelcontextprotocol \
36+
--base main --head tqtensor:<branch> \
37+
--title "<conventional commit title>" \
38+
--body "$(cat <<'EOF'
39+
## Summary
40+
- …
41+
Closes #<sync-issue-number>.
42+
43+
## Test plan
44+
- [ ] …
45+
EOF
46+
)"
47+
```
48+
**Verify the printed URL starts with `tqtensor/`** before declaring the PR opened. If it starts with `perplexityai/`, close it immediately and re-open against the fork.
49+
6. Include `Closes #<n>` in the PR body so the sync issue auto-closes on rebase-merge.
50+
7. Leave the actual rebase-merge to the user via the GitHub UI.
51+
52+
## Pitfalls observed in past sessions
53+
54+
- Pushing the merge directly to `origin/main` instead of opening a PR. Caused a force-push reset.
55+
- Opening the PR against `perplexityai/modelcontextprotocol` because `gh pr create` was run without `--repo`. The PR was externally visible upstream before being closed.
56+
- Treating "let's address the issue" as authorization for the full pipeline (merge + push + close). It's not. Each remote-visible step needs its own approval.

0 commit comments

Comments
 (0)