Skip to content

Add plugin distribution and connected Context Tree workflows - #6

Merged
ggordonhall merged 4 commits into
mainfrom
plugin
Aug 31, 2026
Merged

Add plugin distribution and connected Context Tree workflows#6
ggordonhall merged 4 commits into
mainfrom
plugin

Conversation

@ggordonhall

@ggordonhall ggordonhall commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This change packages Context Tree as a portable Agent Plugins v1.0.0 core while retaining the current Codex and Claude Code adapters, and adds an explicit, persistent connection between a project and its verified Context Tree checkout.

  • add a closed root plugin.json using the canonical Agent Plugins v1.0.0 schema, synchronized package metadata, and no client-specific component declarations
  • retain .codex-plugin/plugin.json and .claude-plugin/plugin.json as native adapters, with default-discovered skills and lifecycle hooks plus npm-backed marketplace installation
  • add the context-tree-link skill and connect, resolve, refresh, and stage CLI workflows with versioned Zod response contracts
  • resolve Git projects by normalized credential-free GitHub origin and non-Git projects by canonical directory, while keeping credentials and authenticated GitHub operations in host tools
  • centralize safe live-branch refresh and isolated-worktree staging in the CLI, then update the init, read, and write skills to consume those contracts
  • preserve fail-closed path, symlink, repository-origin, clean-checkout, and related-repository validation throughout connection and publication flows
  • expand the specification, package documentation, release notes, and automated coverage for portable and native plugin packaging, hooks, schemas, connections, CLI behavior, and skill workflows

Why

The portable manifest gives standards-conformant clients a minimal, framework-neutral package identity. Codex and Claude Code still need their native manifests, marketplace entries, and automatic lifecycle hooks, so those remain as adapters around the same packaged skills and CLI.

Previously, skills also had to repeat repository discovery and Git plumbing, and there was no durable way for a project session to identify its Context Tree. Explicit connections make resolution deterministic across sessions, while the packaged hook injects only the verified tree identity and path without fetching, cloning, or mutating state. Moving refresh and staging into the CLI gives read and write workflows one tested contract for selecting the live default branch and exact base commit.

Distribution layout

  • plugin.json is the closed Agent Plugins v1.0.0 portable manifest
  • .codex-plugin/plugin.json and .claude-plugin/plugin.json are current-client adapters
  • skills/ contains the four framework-neutral skills at the standard default location
  • hooks/hooks.json preserves the existing SessionStart and SubagentStart behavior outside the portable v1 component set
  • .agents/plugins/marketplace.json and .claude-plugin/marketplace.json preserve npm-backed installation
  • package checks synchronize all three manifest versions and skill metadata, and verify every required file in the packed tarball

Behavior and safety

  • connection state is stored outside projects in ~/.context-tree/connections.json
  • repository URLs are normalized and rejected when they could contain credentials
  • exact checkout roots, clean worktrees, expected origins, root NODE.md, and declared project relationships are verified before connecting
  • reads refresh and verify the connected tree before returning content
  • writes stage an isolated worktree at the fetched default-branch commit, verify the complete change, and retain the existing conflict-free PR fallback when direct publication is unavailable
  • session hooks are read-only and silent when no connection exists

Verification

  • pnpm install
  • pnpm check
  • pnpm typecheck
  • pnpm test (75 tests passed)
  • pnpm build
  • pnpm validate:skills
  • pnpm check:package
  • npm pack --dry-run
  • node scripts/sync-skill-versions.mjs --check
  • all four skills pass the Agent Skills reference validator
  • claude plugin validate . passes; Claude reports its expected warning that npm marketplace sources are not yet fully implemented
  • pnpm test:codex-plugin --check

@ggordonhall
ggordonhall merged commit 92afef8 into main Aug 31, 2026
3 checks passed
@ggordonhall
ggordonhall deleted the plugin branch August 31, 2026 03: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.

1 participant