Skip to content

process: Add forkable docs workflow plan spec#167

Merged
jlevy merged 11 commits into
mainfrom
claude/nifty-cray-gtgnfw
Jun 12, 2026
Merged

process: Add forkable docs workflow plan spec#167
jlevy merged 11 commits into
mainfrom
claude/nifty-cray-gtgnfw

Conversation

@jlevy

@jlevy jlevy commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Adds docs/project/specs/active/plan-2026-06-11-eject-forkable-docs.md: a plan spec for a minimal, shadcn-style fork/unfork/update workflow that makes built-in and external guidelines, shortcuts, and templates visible, forkable, git-tracked files in the user's repo — the lightweight alternative to the full docs-config redesign explored in #117. (Terminology evolved during review from eject/uneject to fork/unfork, matching the multi-origin reality once docref sources arrived; "eject" remains a skill-routing synonym.)

Core design (deliberately the smallest forward-compatible slice of #117):

  • A tbd docs command group (matching tbd's dep/label/attic noun-verb convention) owns the doc layer: fork, unfork, update, status, diff, sync (absorbing tbd sync --docs), add <docref>, kind-agnostic list/show, manual. Bare tbd docs = status overview. A "three kinds of sync" table fixes the taxonomy: tbd sync = issues; tbd setup = integrations; tbd docs sync/update = doc layer — a universal sync was explicitly rejected (doc updates can involve merges).
  • tbd docs fork <name> | --pack=<lang> | --relevant | --all copies docs verbatim into a git-tracked docs/tbd/ folder (setup-editable, persisted to docs_cache.fork_dir), shadowing upstream copies via the existing DocCache lookup. A generated README index explains the folder.
  • tbd docs update reconciles forks after upgrades via git merge-file: unmodified copies refresh, clean three-way merges apply automatically; conflicting docs are listed until you choose a strategy — --merge (combine with conflict markers) or --rebase (keep yours, advance the fork point). Sync is grouped by source root (one fetch per git repo+ref, per-group failure isolation; a vanished source never aborts the rest and never prunes cache).
  • Committed provenance under one directory: .tbd/doc-forks/forks.yml (manifest: source docref, hashes, and source_revision/source_tag for git-hosted sources) plus base/ (verbatim merge-base snapshots, the universal fallback for revision-less sources). A new layout-contract section plus a generated .tbd/README.md document every .tbd/ entry; .tbd/docs/ keeps its f04 gitignored-cache mechanics verbatim.
  • docref everywhere, as a hard rule: every document reference (config, manifest, CLI args, JSON output, docs) is a docref string; parser ported from the process: Add docs config redesign plan spec #117 branch. docmap is distilled to a minimal standalone inventory format (docmap/0.1 — identity, location, metadata; no bundles/lockfiles/sync) adopted as the --json contract; both ship as reference-kind docs (docmap's spec authored fresh, citing process: Add docs config redesign plan spec #117 only as exploratory). docs_cache.local_dirs serves docs from other in-repo directories.
  • Format bump to f05 with a metadata-only migration; the upgrade gate (older CLIs refuse newer config dirs) is what makes the command/layout reorganization safe to ship together. (process: Add docs config redesign plan spec #117's draft "f05" shifts to f06+.)
  • Agent-first setup, no interactivity: the unused --interactive flag is removed; setup --auto prints a self-documenting menu with a read-only --relevant detection preview; agents offer the choice conversationally.
  • Upstream loop as a playbook: a bundled shortcut walks the agent from docs status --jsondocs diff → filing a GitHub issue on jlevy/tbd; convergence after upstream adoption makes unfork a plain tbd docs unfork.

The spec includes the doc-state model (upstream/forked/customized/stale/conflicted/local/missing/orphaned), the update decision table (default/--merge/--rebase), full CLI surface, backward-compatibility requirements, alternatives considered, 15 resolved decisions, 2 remaining open questions, a 5-phase 20-bead implementation plan, and a testing strategy.

Relationship to #117

Positioned as the implementable kernel: docref adopted wholesale, docmap redefined and reduced to its inventory essence, manifest+bases map to the framework's override edges, and the passive-cache/explicit-update split maps to its sync/source update contract. Nothing constrains its open questions Q15–Q19.

Test plan

  • Spec read for clarity and completeness
  • Resolve the 2 remaining open questions (--relevant as fresh-setup default; pack definitions in code vs frontmatter tags)
  • Confirm phase/bead breakdown, then create beads from the implementation plan

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS

Plan spec for a minimal shadcn-style eject/uneject workflow: copy bundled
guidelines/shortcuts/templates into a visible, git-tracked docs/tbd/ folder,
shadow the bundled copies via existing DocCache precedence, track provenance
in a committed .tbd/ejected.yml manifest, add setup opt-ins and an
upstream-contribution playbook. Deliberately the forward-compatible kernel
of the larger PR #117 docs-config redesign, with no f04 format break.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
@deepsource-io

deepsource-io Bot commented Jun 11, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in cd8784a...d316f30 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Secrets Jun 11, 2026 11:30p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Generated by tbd setup at session start; the v0.2.3 release did not
regenerate these pinned fallback scripts.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Coverage Report for packages/tbd

Status Category Percentage Covered / Total
🔵 Lines 32.41% 2374 / 7323
🔵 Statements 32.47% 2458 / 7569
🔵 Functions 37.46% 369 / 985
🔵 Branches 27.84% 1038 / 3728
File CoverageNo changed files found.
Generated in workflow #975 for commit d316f30 by the Vitest Coverage Report Action

claude added 9 commits June 11, 2026 18:26
Fills the gap around upgrading tbd after ejecting: tbd eject --update
refreshes unmodified copies and applies clean git three-way merges by
default; conflicting docs are listed and only merged (with standard
conflict markers) via opt-in --merge. Requires storing committed merge
bases (.tbd/eject-base/) since a hash alone cannot drive a three-way
merge; adds --rebase, conflicted-state tracking with marker auto-clear,
and updates goals, states, CLI surface, phases, and tests accordingly.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
Replaces the top-level eject/uneject commands and verb-flags (--update,
--status, --rebase) with a noun-scoped tbd docs group per design review:
docs eject/uneject/update/rebase/status/diff plus docs sync (absorbing
tbd sync --docs as a deprecated alias) and kind-agnostic docs list/show.
tbd self-docs join the system under a reserved tbd- name prefix as
reference-kind docs (manual becomes tbd docs show tbd-docs; bare tbd docs
is now the status overview). Records resolved decisions, renumbers open
questions, and updates plan phases and tests to match.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
…y flags

Records resolutions from design review: docs/tbd default eject dir
(setup-editable, persisted to config), README index with npx get-tbd
pointer, .tbd/eject-base placement, tbd docs manual alias with no compat
for the old bare-docs viewer, and eject/uneject verbs. Folds the
standalone rebase subcommand into mutually exclusive update strategy
flags (--merge combines with conflict markers; --rebase keeps local
content and advances the fork point). Adopts a proper f04->f05 format
bump with metadata-only migration, following the f04 precedent; notes
PR #117's draft format id shifts to f06+. Two questions remain open
(--relevant as setup default; packs in code vs frontmatter tags).

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
Generalizes beyond bundled/ejected locations by adopting two conventions
from the PR #117 branch: docref becomes the universal source-address
grammar now (parser ported as-is; internal: and URLs already conform;
replaces ad-hoc blob-URL conversion), and docmap's generated-map schema
becomes the --json output contract for docs list/status (the read side),
while its manifest/lockfile/sync write side stays in the f06 framework.
Adds docs_cache.local_dirs for serving docs from other in-repo
directories and tbd docs add <docref> consolidating per-kind --add.
Both format docs ship as bundled reference-kind docs with status
banners.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
Per design review: docref-everywhere is recorded as a hard rule (every
document reference in config, manifests, CLI args, JSON output, and docs
is a docref string). docmap is redefined as just the essential concept -
a machine-readable inventory of a doc collection (identity, location,
provenance docref, metadata per entry) - producer-agnostic and
hand-authorable, with an inline v0.1 schema example. The shipped
docmap-format reference doc will be authored fresh rather than adapted,
citing the speculative PR #117 draft only as exploratory background;
manifests/lockfiles/sync are deferred as future operations over docmaps.
Drops the provisional bundle field from v1 JSON output.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
Foreign docref sources sharpen three areas: the eject manifest now
records source_revision (and source_tag when applicable) for git-hosted
sources at every base advance, with stored base snapshots remaining the
universal fallback for revision-less sources; docs sync groups files
entries by source root (one fetch per git repo+ref, internal: as one
group, standalone URLs individually) with per-group failure isolation so
a vanished source or bad doc never aborts the rest and cache is never
pruned on fetch failure; update stays offline against the cache so
unreachable sources only affect staleness freshness, surfaced in status
and doctor. Adds the eject-vs-fork terminology question (with a
recommendation to adopt fork/unfork + upstream) as open question 1.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
…st design

Adds a 'three kinds of sync' design section with a scope table: tbd sync
(issues), tbd setup (installation/integrations, may invoke a docs-cache
sync), tbd docs sync (cache, grouped + failure-isolated), and tbd docs
update (the only doc command that writes tracked files; offline). A
universal sync command is explicitly rejected since doc updates can
involve merges. Removes the interactive setup plan: the never-prompting
--interactive flag is dropped, and setup --auto becomes self-documenting
(eject options as copy-paste commands with a read-only --relevant
detection preview), with agent-led conversational onboarding as the
choice mechanism. Recorded as decisions 12-13.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
Adopts the fork vocabulary throughout (the eject terms fit the
all-inside-tbd world; with docref sources docs are multi-origin and the
fork lifecycle - fork point, merge, rebase, unfork, contribute - is the
accurate model): verbs fork/unfork, state forked, docs_cache.fork_dir,
and the former bundled state renamed upstream, with bundled/built-in
reserved for tbd-shipped internal: docs. Eject remains a skill routing
synonym. All fork state consolidates under one committed .tbd/doc-forks/
directory (forks.yml manifest + base/ snapshots), and a new layout-
contract section plus a generated .tbd/README.md document the exact
contract of every .tbd entry: docs/ keeps its f04 cache mechanics
verbatim (gitignored, regenerated, disposable) while doc-forks/ is the
committed, precious fork state. Records that the f05 upgrade gate is
what makes the reorganization and CLI-semantics changes safe to ship
together. Resolved decisions 14-15; open questions down to two.

https://claude.ai/code/session_017S2YnirprCMG8ihkGdRBsS
@jlevy jlevy changed the title process: Add eject workflow plan spec for forkable docs process: Add forkable docs workflow plan spec Jun 11, 2026
@jlevy jlevy marked this pull request as ready for review June 12, 2026 00:54
@jlevy jlevy merged commit 64b2831 into main Jun 12, 2026
6 checks passed
@jlevy jlevy deleted the claude/nifty-cray-gtgnfw branch June 12, 2026 00:57
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