Project Hub scaffold
Reuse an existing Project Hub engine: a local filesystem scanner and vanilla-JS
explorer. Find the checkout containing Hub/hub.mjs and Hub/index.html from the
user's context; ask for its location only if it cannot be found. Do not reconstruct
the engine from screenshots. Read its README and config reference.
The engine is the source of truth if this reference has drifted.
Choose the mode
- A — add a workspace (default). Add
Projects/<Name>/hub.config.json to the
existing installation. One server scans all projects and shared roots. No new
port, launcher, engine copy, or hub-switcher entry is needed.
- B — portable installation. Use when the project must carry its own engine.
Copy the complete runtime and tests into
Hub/, the launcher and example into
Project-Hub/, and create Projects/<Name>/. Each machine supplies its own
ignored configs. Independent copies need their own future engine updates.
- C — visual match. For an explicitly static page, read the
design system and reuse the actual theme and
layout from
Hub/index.html. Explain that scanning, native launch actions,
previews, and server-backed search require A or B.
Workflow
- Inspect the existing server config, project configs, and target folder. Preserve
existing work. Project display names and folders must be unique;
dir must
exist. Choose either repo groups or a path prefix ending in /, or omit scope.
- Run scripts/scaffold-hub.ps1 for A or B. It refuses
existing destinations. A writes only a project config. B copies an allowlist of
engine files, license, launchers and examples; it never copies scan output,
credentials, personal configs, screenshots, or design archives.
- In B, select an available port and
base; shared roots default to empty. Verify
the configured port is free before starting. Roots come from configuration and
user runtimes use the current home directory: do not edit source constants for
machine paths. The runtime scans supported user-scope agent folders as well as
configured roots; disclose that scope to the user.
- Run
npm test from Hub/. Fresh clones validate example shapes without needing
personal configs; installed configs are checked when present. Separately check
all configured directories exist. Tests do not prove a port is free or a page works.
- New project configs are discovered at startup. Restart the existing server
through
Project-Hub/Start-Hub.ps1 -Restart -NoBrowser when authorized by the
setup task, then check /api/health and /api/scan. Use the configured port.
Never terminate a foreign process to claim a port.
- Verify the Projects landing page, target workspace, sidebar, search, a rendered
document, and Back/Forward in a browser. Use a temporary fixture installation
for script validation; do not start a second scanner over real private roots.
- Link the skill and setup instructions from the project's README. Keep personal
roots, ports in instance inventories, and editor wiring in ignored local files.
Scheduled tasks and workspace auto-start are optional integrations, not actions
every scaffold should install. Public source publication is separate from
exposing the local server over a network.
Helper usage
PowerShell 7; use paths appropriate to the user's machine:
# A: mount another workspace in the shared process
./scripts/scaffold-hub.ps1 -HubDesignRoot C:/Tools/ProjectHub `
-Name Demo -Dir C:/Work/Projects/Demo -RepoScopePathPrefix Repos/
# B: new standalone installation (destination must not exist)
./scripts/scaffold-hub.ps1 -HubDesignRoot C:/Tools/ProjectHub `
-Name Demo -Dir C:/Work/Projects/Demo -Standalone `
-TargetDir C:/Tools/DemoHub -Base C:/Work -Port 4400
Current behavior to preserve
Read current features when extending or checking
an installation. It covers the shared Projects landing page, lazy Pictures,
sandboxed HTML/PDF report reading, search and heading routes, bookmarks and Recent,
folder sorting, Markdown reader tools, help panels, and watchdog behavior.
Read the design reference only for UI work; adding a workspace needs no UI edit.
Avoid
- Creating
Project-Hub-<Name> and a separate server per workspace: that is the retired layout.
- Copying only
hub.mjs and index.html: the runtime imports other modules.
- Hardcoding an owner's drive, user profile, scheduled-task name, or project list.
- Committing
hub.config.json, scan.json, logs, or private design exports.
- Claiming current-file sanitization also removes Git history or hosted attachments.
- Claiming browser checks, native launches, or scheduled tasks passed without executing them.
1---2name: project-hub-scaffold3description: Stand up a browsable HTML console over a folder of project documents — Project Hub is a zero-dependency Node server plus a static explorer that turns any workspace into a clickable document tree in the browser, with no build step and no install. Use when asked to add a workspace to an existing Project Hub, scaffold a fresh portable installation of the server and explorer, build a document browser or docs console for a project, or match an existing Hub page's theme, sidebar tree and navigation. Source: github.com/ai-automation-tools/project-hub (MIT).4---56# Project Hub scaffold78Reuse an existing Project Hub engine: a local filesystem scanner and vanilla-JS9explorer. Find the checkout containing `Hub/hub.mjs` and `Hub/index.html` from the10user's context; ask for its location only if it cannot be found. Do not reconstruct11the engine from screenshots. Read its README and [config reference](references/config-schema.md).12The engine is the source of truth if this reference has drifted.1314## Choose the mode1516- **A — add a workspace (default).** Add `Projects/<Name>/hub.config.json` to the17 existing installation. One server scans all projects and shared roots. No new18 port, launcher, engine copy, or hub-switcher entry is needed.19- **B — portable installation.** Use when the project must carry its own engine.20 Copy the complete runtime and tests into `Hub/`, the launcher and example into21 `Project-Hub/`, and create `Projects/<Name>/`. Each machine supplies its own22 ignored configs. Independent copies need their own future engine updates.23- **C — visual match.** For an explicitly static page, read the24 [design system](references/design-system.md) and reuse the actual theme and25 layout from `Hub/index.html`. Explain that scanning, native launch actions,26 previews, and server-backed search require A or B.2728## Workflow29301. Inspect the existing server config, project configs, and target folder. Preserve31 existing work. Project display names and folders must be unique; `dir` must32 exist. Choose either repo groups or a path prefix ending in `/`, or omit scope.332. Run [scripts/scaffold-hub.ps1](scripts/scaffold-hub.ps1) for A or B. It refuses34 existing destinations. A writes only a project config. B copies an allowlist of35 engine files, license, launchers and examples; it never copies scan output,36 credentials, personal configs, screenshots, or design archives.373. In B, select an available port and `base`; shared roots default to empty. Verify38 the configured port is free before starting. Roots come from configuration and39 user runtimes use the current home directory: do not edit source constants for40 machine paths. The runtime scans supported user-scope agent folders as well as41 configured roots; disclose that scope to the user.424. Run `npm test` from `Hub/`. Fresh clones validate example shapes without needing43 personal configs; installed configs are checked when present. Separately check44 all configured directories exist. Tests do not prove a port is free or a page works.455. New project configs are discovered at **startup**. Restart the existing server46 through `Project-Hub/Start-Hub.ps1 -Restart -NoBrowser` when authorized by the47 setup task, then check `/api/health` and `/api/scan`. Use the configured port.48 Never terminate a foreign process to claim a port.496. Verify the Projects landing page, target workspace, sidebar, search, a rendered50 document, and Back/Forward in a browser. Use a temporary fixture installation51 for script validation; do not start a second scanner over real private roots.527. Link the skill and setup instructions from the project's README. Keep personal53 roots, ports in instance inventories, and editor wiring in ignored local files.54 Scheduled tasks and workspace auto-start are optional integrations, not actions55 every scaffold should install. Public source publication is separate from56 exposing the local server over a network.5758## Helper usage5960PowerShell 7; use paths appropriate to the user's machine:6162```powershell63# A: mount another workspace in the shared process64./scripts/scaffold-hub.ps1 -HubDesignRoot C:/Tools/ProjectHub `65 -Name Demo -Dir C:/Work/Projects/Demo -RepoScopePathPrefix Repos/6667# B: new standalone installation (destination must not exist)68./scripts/scaffold-hub.ps1 -HubDesignRoot C:/Tools/ProjectHub `69 -Name Demo -Dir C:/Work/Projects/Demo -Standalone `70 -TargetDir C:/Tools/DemoHub -Base C:/Work -Port 440071```7273## Current behavior to preserve7475Read [current features](references/current-features.md) when extending or checking76an installation. It covers the shared Projects landing page, lazy Pictures,77sandboxed HTML/PDF report reading, search and heading routes, bookmarks and Recent,78folder sorting, Markdown reader tools, help panels, and watchdog behavior.79Read the design reference only for UI work; adding a workspace needs no UI edit.8081## Avoid8283- Creating `Project-Hub-<Name>` and a separate server per workspace: that is the retired layout.84- Copying only `hub.mjs` and `index.html`: the runtime imports other modules.85- Hardcoding an owner's drive, user profile, scheduled-task name, or project list.86- Committing `hub.config.json`, `scan.json`, logs, or private design exports.87- Claiming current-file sanitization also removes Git history or hosted attachments.88- Claiming browser checks, native launches, or scheduled tasks passed without executing them.