Skip to content

Add an upstream Segment to the Repo Layout Convention - #733

Merged
ptr727 merged 3 commits into
developfrom
upstream-clone-layout
Aug 15, 2026
Merged

Add an upstream Segment to the Repo Layout Convention#733
ptr727 merged 3 commits into
developfrom
upstream-clone-layout

Conversation

@ptr727

@ptr727 ptr727 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What this does

Addresses #725. The layout block in the repo-worktree skill carried a clause from #699 reasoning that no owner segment is needed "since every repo here is under one owner". A machine that also keeps third-party clones falsifies that, and what it produces is a collision rather than an untidy name.

The collision is caused by the fork naming rule, which #699 mentioned only in passing and nothing wrote down: a fork is named <upstream-owner>-<upstream-repo> at fork time, so ptr727/home-assistant-core already occupies home-assistant-core. A clone of home-assistant/core joined the same way lands on it, and reduced to a bare core it names no project and collides with the next core cloned from any other owner.

The layout

~/repos/<Repo>                          base clone, on its default/working branch
~/repos/worktrees/<Repo>-<task-slug>    one worktree per in-flight task, own branch
~/repos/upstream/<owner>-<repo>         clone of a repo under another owner, not a fork

upstream/ is flat rather than nested by owner, so one ls reads every reference checkout, the same reasoning that already keeps worktrees/ flat. Naming a clone by the same <owner>-<repo> join a fork uses means forking it later moves the directory up one level under the name it already has, and a worktree off it needs no new rule: ~/repos/worktrees/<owner>-<repo>-<task-slug>.

The two naming rules the flat namespace depends on

Both were practice, neither was written down, and the collision is only explicable with them stated:

  • A fork carries the upstream owner in its name at fork time, esphome-esphome for esphome/esphome. 15 of the 17 existing forks already do this.
  • A repository adopted as the owner's own work is detached from its parent and keeps a plain name, aiopurpleair rather than bachya-aiopurpleair, since it tracks nothing upstream. The fleet already has both of those repos side by side, which is what makes this the existing rule rather than a new one.

The section also notes that contributing from an upstream/ clone is never a push out of it, routing to the upstream-contribution-workflow skill, which fixes the layout back to the flat namespace once a fork exists.

Testing

  • python3 scripts/build_dist.py regenerated the plugin tree, and --check reports it current.
  • python3 scripts/prose_lint.py clean over the whole tree (195 files).
  • python3 scripts/repo_gate.py clean (eol, eol-coverage, sha-pin).
  • The cspell gate covers README and HISTORY only, so this file is out of its scope and no dictionary entry is needed.

Follow-up, not in this PR

Two existing repos are off the convention this PR writes down, and renaming a repository is outward-facing, so the list is the maintainer's to run:

  • ptr727-jellyfin -> jellyfin-jellyfin (parent jellyfin/jellyfin). The live upstream makes this a real future collision.
  • esphome-esphome-docs -> esphome-esphome.io (parent esphome/esphome.io). A hand-name for a dotted upstream, where the sibling home-assistant-home-assistant.io keeps its dot.
  • Postfix-Relay (parent juanluisbaptiste/docker-postfix) deliberately keeps its name. It is an adopted product rather than a tracked fork, so under the rule above it is a candidate to detach on GitHub, not to rename.

The layout block in the repo-worktree skill reasoned that no owner segment
is needed because every repo on a fleet machine is under one owner. A host
that also keeps third-party clones falsifies that, and the failure is a
collision rather than an untidy name: a fork is named
<upstream-owner>-<upstream-repo>, so a clone of home-assistant/core joined
the same way is the fork home-assistant-core, while reduced to a bare core
it names no project and collides with the next core cloned from anywhere
else.

Third-party clones now live at ~/repos/upstream/<owner>-<repo>, flat under
one segment that states the relationship rather than the owner. The block
also writes down the two naming rules the flat namespace above it depends
on: a fork carries the upstream owner in its name at fork time, and a
repository adopted as the owner's own work is detached from its parent and
keeps a plain name.

Closes #725.
Copilot AI lite review requested due to automatic review settings August 15, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repo-worktree skill’s layout convention to explicitly account for third-party (non-fork) upstream clones by introducing an upstream/ segment, preventing name collisions on machines that host both fleet repos/forks and external reference checkouts.

Changes:

  • Extend the documented repo layout with ~/repos/upstream/<owner>-<repo> for upstream (non-fork) clones.
  • Add rationale explaining why forks remain in the flat top-level namespace while upstream clones are placed under upstream/.
  • Refresh the generated fleet-skills source digest to reflect the updated skill content.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md Document upstream clone placement under ~/repos/upstream/ and explain the naming rationale and contribution workflow implication.
.agents/skills/repo-worktree/SKILL.md Mirror the same layout + rationale updates in the agents skill source.
.claude-plugin/fleet-skills/.source-digest Update digest to reflect regenerated plugin content.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .agents/skills/repo-worktree/SKILL.md Outdated
Comment thread .claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md Outdated
A hyphen in either half means foo-bar/baz and foo/bar-baz produce one
directory name. The join is kept because it is the fork convention's own,
so the ambiguity is inherited from the flat namespace rather than
introduced by the upstream segment, and the section now says so and says
what a second clone does about it.
Copilot AI review requested due to automatic review settings August 15, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

The section illustrated the fork and clone naming rules with repositories
observed on the maintainer's machine. A constructed case demonstrates the
same collision and any reader can follow it, so acme/core, initech/widget,
and acme-labs/core replace them.
Copilot AI review requested due to automatic review settings August 15, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 505e67d into develop Aug 15, 2026
7 checks passed
@ptr727
ptr727 deleted the upstream-clone-layout branch August 15, 2026 16:17
ptr727 added a commit that referenced this pull request Aug 15, 2026
… the Upstream Repo-Layout Segment (#734)

Closes #719
Closes #720
Closes #721
Closes #722

Promotes six merged `develop` PRs to `main`:

- #732 -- Reconcile the PlexCleaner registry entry and audit report
after the 2026-08-15 resync (closes #719).
- #731 -- Exempt hub-hosted paths from the prose gate's `dead-path` rule
(closes #721).
- #730 -- Fix the hub slug and the dead anchor in the canonical
`copilot-instructions.md` (closes #720, #722).
- #723 -- Refresh the PhotoCleaner audit report after the 0e84805
resync.
- #733 -- Add an `upstream/` segment to the repo layout convention
(addresses #725, not closed -- the fork-naming variant differs from the
issue's proposal).
- #724 -- Add the HomeAutomation-Config audit report and reconcile its
registry entry.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants