Skip to content

Investigate: restructure two-root split to simplify absorbing upstream releases #144

@virtualian

Description

@virtualian

Context

This fork runs a two-root split: ~/.claude/ = CC config, ~/.pai/ = PAI code. Upstream (danielmiessler/PAI) runs single-root: everything under ~/.claude/.

This asymmetry creates friction every time we absorb an upstream release or cherry. References to ~/.claude/<thing> in upstream-shaped source have to be translated per-occurrence to ~/.pai/<thing> in our layout — in hooks, skills, agents, docs, installer templates, and release-tree mirrors.

Recent evidence:

Problem

The split is an invariant we impose. Upstream doesn't know about it. Each upstream release carries references written in upstream's single-root worldview, and we pay translation cost proportional to release size — not because the semantics changed, but because the path strings disagree.

We want upstream absorption to be predominantly mechanical: apply the diff, let one boundary layer handle the translation, done. Not a bespoke per-file audit every time.

Possible directions (for investigation, non-exhaustive)

  1. Canonical shape in repo = upstream's. Keep repo paths upstream-shaped under .claude/.... Installer translates to two-root at install time. Cherries apply as-is. Cost: any doc/comment text that doesn't go through the installer keeps the upstream worldview indefinitely, or we accept a post-install doc-rewrite pass.

  2. Path-indirection layer. Replace literal path strings in source with an abstraction that resolves identically on both upstream and fork. Requires a naming convention, or a rewrite step at sync time.

  3. Inverted canonical layout with sync-time rewriter. Keep .pai/... shape as source-of-truth in repo; translate upstream paths at sync time via scripted rewriter. Sync becomes automated rather than manual review. Cost: tooling to maintain and verify; round-trip cherries (upstream → us → upstream) become harder.

  4. Plugin distribution (Investigate distributing PAI as a Claude Code plugin #102). Sidesteps the whole thing by exiting the ~/.claude/ namespace entirely. Long-term answer, scoped separately.

  5. Hybrid / other framings the investigation surfaces.

Success criteria

Out of scope

Prior art

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions