xiaohongshu
xiaohongshu
jj-graft-third-party
Integrate third-party repository history into the monorepo by adding remotes and creating workspaces. Use when testing patches to upstream projects, making local modifications to dependencies, or maintaining forks that need to track upstream changes. (project)
Full skill instructions
Integrate third-party repository history into the monorepo by adding git remotes and creating workspaces that point to upstream branches. This connects external repository history to the main repo through jj's virtual root() commit, enabling local modifications and patch testing while maintaining the relationship with upstream.
Use this skill when:
Do not use when: Simply examining source code without modifications (use jj-clone-third-party instead).
Add a git remote for the upstream repository:
jj git remote add <remote-name> <repository-url>
Examples:
# Add tokio as a remote
jj git remote add tokio https://github.com/tokio-rs/tokio
# Add serde as a remote
jj git remote add serde https://github.com/serde-rs/serde
# Add custom library
jj git remote add mylib https://github.com/someorg/mylib
Best practice: Use descriptive remote names that match the project name for clarity.
Fetch the remote repository's history:
jj git fetch --remote=<remote-name>
Examples:
jj git fetch --remote=tokio
jj git fetch --remote=serde
This imports the remote's git history into the jj repository. The history becomes accessible but doesn't affect working copies yet.
Create a workspace in work/ that points to the remote's main branch:
jj workspace add \
--name=<workspace-name> \
-r <branch>@<remote-name> \
work/<directory-name>
Examples:
# Create workspace for tokio's main branch
jj workspace add \
--name=tokio \
-r main@tokio \
work/tokio
# Create workspace for serde's master branch
jj workspace add \
--name=serde \
-r master@serde \
work/serde
# Create workspace for a specific tag or commit
jj workspace add \
--name=mylib-v2 \
-r v2.0.0@mylib \
work/mylib
Important: The branch name must match what the upstream repository uses (commonly main, master, or trunk). Use jj git fetch --remote=<name> output to see available branches.
Navigate to the workspace and make changes:
cd work/<directory-name>
# Make modifications to the code
# Test changes
# Create commits as normal with jj
# View the integrated history
jj log
The workspace is a full working copy with the third-party history connected to the main repository. Changes made here create new commits on top of the upstream history.
Update the workspace with latest upstream changes:
# Fetch latest changes from remote
jj git fetch --remote=<remote-name>
# From within the workspace, rebase onto latest upstream
cd work/<directory-name>
jj rebase -d <branch>@<remote-name>
When finished with the workspace:
# Forget the workspace (keeps commits in the main repo)
jj workspace forget <workspace-name>
# Remove the directory
rm -rf work/<directory-name>
# Optionally remove the remote if no longer needed
jj git remote remove <remote-name>
Important: jj workspace forget removes the workspace reference but preserves all commits. The commits remain in the repository's history and can be accessed via jj log.
cd work/<directory-name>
jj git export # Export to git format if needed
cd work/<directory-name>
jj branch create <fork-branch-name>
View differences between local modifications and upstream:
cd work/<directory-name>
jj diff -r <branch>@<remote-name>
Use descriptive remote names matching the project:
tokio for tokio-rs/tokioserde for serde-rs/serdebuck2 for facebook/buck2Match workspace names to remote names for consistency:
jj workspace add --name=tokio -r main@tokio work/tokio
Check available branches after fetching:
jj git fetch --remote=<remote-name>
# Look for "remote: <remote-name>/branch-name" in output
Common branch names: main, master, trunk, develop
Keep local modifications in separate, well-documented commits on top of upstream to make patch generation easier.
See references/troubleshooting.md for common issues and solutions.
jj-clone-third-party - For simple examination without history integrationjj-workspace-experiments - For creating isolated experimental workspacesxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience