Skip to content

Project: a built-in plugin that shows the spec folder's code repository on its own tab - #548

Merged
vydra merged 2 commits into
mainfrom
claude/project-plugin-code-repo-efd9a4
Dec 5, 2026
Merged

vydra merged 2 commits into
mainfrom
claude/project-plugin-code-repo-efd9a4

Conversation

@vydra

@vydra vydra commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

What changes

A new built-in plugin, Project. Switched on, a specifications folder gets a Project tab beside Specs that shows the files of its default code repo (Project settings), the way a code repository opened directly shows them:

  • the tree, without .git and without what the repository ignores
  • the code editor, with autosave, ⌘S and the "changed on disk" notice
  • Open in IntelliJ, Git Pull, find a file by name (palette) and search in files (⇧⌘F)

Its urls are /project (the repository's README.md) and /project/<path>; g f reaches the tab.

How it behaves

  • Off by default. It is listed under Plugins as "Project — Built-in".
  • Which repository: the default code repo. With several listed, only the default shows.
  • No code repository, no tab. A folder that names none, or whose code repo is not on disk, has no Project tab — as with Issues. The tab comes, goes or moves to another repository as soon as Project settings is saved.
  • Not in the demo, a hosted worker or the read-only site.
  • Code repository mode is unchanged. A code repository opened directly still shows its own Files tab and no Project tab.

How it is built

  • src/plugins/builtin/project/ — manifest, route, host half and browser half. The routes (/api/project/root, /api/project/files/*) exist only while the plugin is on, so a switched-off tab answers 404.
  • src/server/filesRoutes.ts — the files handlers, moved out of api.ts unchanged. The core's /api/files/* and the plugin's routes are built from the same handlers, each with its own way of finding the folder.
  • src/frontend/files/ — the sidebar, pane and search results take the tab's urls and name as props; the stores read from whichever set of routes the mounted tab names (files/api.ts). The two tabs are never mounted together.
  • src/plugins/client/tabs.ts, App.tsx — a new client event, project/changed, emitted when Project settings saves.

Not done

A file open on the Project tab is not attached to a coding agent message the way the Files tab's open file is. That attachment is resolved against the open specifications folder, so a code-repository path would name the wrong file.

Checks

  • bun test: 4,172 pass, 0 fail. 19 of them are new (tests/projectPlugin.test.ts, tests/projectTab.test.tsx); three existing tests list the new plugin row.
  • bun run typecheck: clean.
  • Live, in a sandboxed app with a throwaway specifications folder and code repository: the tree, a file opened and edited with the autosave landing on disk, a search result opening its file at the line, Open in IntelliJ against a fake idea, the tab going and returning as the code repo was removed and added in Project settings, and the tab and its routes going when the plugin was switched off.

Spec

specs/app/project-plugin.feature.md in the spec repository: six proposed scenarios, every new test linked. It is a separate repository and not part of this PR.

vydra added 2 commits December 4, 2026 15:55
…ry on its own tab

Switched on, a specifications folder gets a Project tab beside Specs with
the files of its default code repo (Project settings): the tree, the code
editor with autosave and the "changed on disk" notice, Open in IntelliJ,
Git Pull, the name search and the text search. Everything on the tab is
the Files tab of code repository mode, pointed at that repository.

- src/plugins/builtin/project: the plugin. Its routes, /api/project/root
  and /api/project/files/*, exist only while it is on, and refuse in a
  hosted worker, the demo and the read-only site. Its urls are /project
  and /project/<path>. Off by default.
- The tab is there only while the folder has a code repository on disk,
  and follows Project settings at once: a new client event,
  "project/changed", is emitted when that page saves.
- src/server/filesRoutes.ts: the files handlers moved out of api.ts, so
  the core's /api/files/* and the plugin's routes are one implementation.
- src/frontend/files: the sidebar, pane and search take the tab's urls
  and name; the stores read from whichever set of routes the mounted tab
  names (files/api.ts). A code repository opened directly is unchanged.

Not done: a file open on the Project tab is not attached to a coding
agent message, since that attachment is resolved against the open
specifications folder.
…-code-repo-efd9a4

# Conflicts:
#	src/server/api.ts
@vydra
vydra merged commit 19bce4a into main Dec 5, 2026
6 checks passed
@vydra
vydra deleted the claude/project-plugin-code-repo-efd9a4 branch December 5, 2026 01:05
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