Skip to content

Commit 188fa23

Browse files
committed
feat(build): add relative link rewriting and regenerate pages
- Add rewriteRelativeLinks to spec page generator for Astro-safe links - Map assistant-adoption.md -> /assistants/ in generated pages - Map schemas/assistant-adoption.schema.json -> GitHub blob URL - Regenerate 13 spec pages and 5 assistant pages with all fixes
1 parent 597d898 commit 188fa23

9 files changed

Lines changed: 58 additions & 16 deletions

File tree

scripts/generate-spec-pages.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,21 @@ function rewriteLinks(content, crossReferences) {
238238
});
239239
}
240240

241+
/**
242+
* Rewrite relative file links using the relativeLinks map.
243+
* Handles both plain paths and paths with anchors (e.g., file.md#section).
244+
*/
245+
function rewriteRelativeLinks(content, relativeLinks) {
246+
if (!relativeLinks) return content;
247+
return content.replace(/\]\(([^)#]+?)(#[^)]+)?\)/g, (match, path, anchor) => {
248+
if (relativeLinks[path]) {
249+
const target = relativeLinks[path];
250+
return `](${target}${anchor || ""})`;
251+
}
252+
return match;
253+
});
254+
}
255+
241256
/**
242257
* Trim trailing whitespace from each line and ensure exactly one trailing newline.
243258
*/
@@ -352,6 +367,7 @@ export function generateSpecPages(outputDir) {
352367

353368
// Rewrite cross-page links
354369
body = rewriteLinks(body, config.crossReferences);
370+
body = rewriteRelativeLinks(body, config.relativeLinks);
355371

356372
// Build final file content
357373
const frontmatter = buildFrontmatter(page);

scripts/spec-mapping.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,9 @@
118118
"#lockfile-format": "/specification/lockfile#lockfile-format",
119119
"#appendix-d-future-host-integration-targets": "/specification/appendices#appendix-d-future-host-integration-targets",
120120
"#supply-chain": "/specification/security#supply-chain"
121+
},
122+
"relativeLinks": {
123+
"assistant-adoption.md": "/assistants/",
124+
"schemas/assistant-adoption.schema.json": "https://github.com/zircote/ccpkg/blob/main/spec/schemas/assistant-adoption.schema.json"
121125
}
122126
}

src/content/docs/assistants/copilot-cli.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,18 @@ command
103103
| Supported | true |
104104
| Transports | stdio |
105105
| Env Prefix | None |
106+
107+
## Configuration
108+
109+
| Scope | Path |
110+
|---|---|
111+
| user | `~/.copilot/settings.json` |
112+
| project | `.github/copilot-settings.json` |
113+
114+
## Capabilities
115+
116+
| Capability | Supported |
117+
|---|---|
118+
| Lazy Loading | false |
119+
| Hot Reload | false |
120+
| Managed Settings | false |

src/content/docs/assistants/gemini-cli.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,16 @@ command
107107
| Property | Value |
108108
|---|---|
109109
| Supported | true |
110-
| Transports | stdio, sse, http-streaming |
110+
| Transports | stdio, sse, streamable-http |
111111
| Env Prefix | None |
112112

113+
## Configuration
114+
115+
| Scope | Path |
116+
|---|---|
117+
| user | `~/.gemini/settings.json` |
118+
| project | `.gemini/settings.json` |
119+
113120
## Capabilities
114121

115122
| Capability | Supported |

src/content/docs/specification/component-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ ccpkg defines a canonical (tool-neutral) event vocabulary for portable hook defi
203203
| `pre-compact` | Before context/history compression |
204204
| `user-prompt-submit` | When user submits a prompt |
205205

206-
Not all hosts support all canonical events. The mapping from canonical names to host-native event names is defined in each host's [adoption specification](assistant-adoption.md#hook-event-mappings). Hosts MAY also define additional events beyond the canonical vocabulary; these are documented in the host's adoption spec.
206+
Not all hosts support all canonical events. The mapping from canonical names to host-native event names is defined in each host's [adoption specification](/assistants/#hook-event-mappings). Hosts MAY also define additional events beyond the canonical vocabulary; these are documented in the host's adoption spec.
207207

208208
**Usage rules:**
209209

src/content/docs/specification/install-lifecycle.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ sequenceDiagram
8585

8686
12. **Generate host plugin manifest.** The installer generates the host's expected plugin manifest inside the install directory from the ccpkg manifest metadata. The manifest path and format are defined in the host's adoption specification. See [Plugin Registration](/specification/install-lifecycle#plugin-registration) for details.
8787

88-
13. **Register with host.** The installer registers the package with the host's extension system using the adapter operations defined in the host's [adoption specification](assistant-adoption.md). This ensures the host discovers the package on next session start.
88+
13. **Register with host.** The installer registers the package with the host's extension system using the adapter operations defined in the host's [adoption specification](/assistants/). This ensures the host discovers the package on next session start.
8989

9090
14. **Update lockfile.** The installer writes or updates `ccpkg-lock.json` at the scope root (e.g., `~/.ccpkg/ccpkg-lock.json` for user scope). See [Lockfile Format](/specification/lockfile#lockfile-format).
9191

@@ -152,21 +152,21 @@ For quick one-off testing without any persistent side effects, developers can us
152152

153153
# Host Integration
154154

155-
ccpkg integrates with each host's extension or plugin system, leveraging the host's runtime for component registration and namespace isolation. The specific integration mechanism is defined in each host's [adoption specification](assistant-adoption.md).
155+
ccpkg integrates with each host's extension or plugin system, leveraging the host's runtime for component registration and namespace isolation. The specific integration mechanism is defined in each host's [adoption specification](/assistants/).
156156

157157
## Bootstrap
158158

159-
On first use, ccpkg registers itself with the host's extension discovery system. The bootstrap process varies by host — some use marketplace registration, others use directory scanning or plugin manifests. The exact mechanism is defined in the host's adoption specification under `plugin_model`.
159+
On first use, ccpkg registers itself with the host's extension discovery system. The bootstrap process varies by host — some use marketplace registration, others use directory scanning or plugin manifests. The exact mechanism is defined in the host's adoption specification under `extension_model`.
160160

161161
## Plugin Registration
162162

163163
During installation, the installer performs two host-facing steps as defined by the host's adoption specification:
164164

165-
1. **Generate host plugin manifest.** The installer creates the host's expected plugin manifest inside the install directory, mapping ccpkg manifest fields (name, version, description, author) to the host's manifest format. The manifest path and format are defined in the host's `plugin_model.manifest_path` field. Package authors SHOULD NOT include host-specific plugin manifests in their archives. If a host-specific manifest is present, the installer MUST use the generated version and MAY warn the author.
165+
1. **Generate host plugin manifest.** The installer creates the host's expected plugin manifest inside the install directory, mapping ccpkg manifest fields (name, version, description, author) to the host's manifest format. The manifest path and format are defined in the host's `extension_model.manifest.filename` field. Package authors SHOULD NOT include host-specific plugin manifests in their archives. If a host-specific manifest is present, the installer MUST use the generated version and MAY warn the author.
166166

167-
2. **Register with host.** The installer registers the package with the host's extension system as described in the host's `adapter_interface` operations. This ensures the host recognizes the package on the next session start.
167+
2. **Register with host.** The installer registers the package with the host's extension system as described in the host's `extension_model.registration` mechanism. This ensures the host recognizes the package on the next session start.
168168

169-
These two steps — generating a plugin manifest and registering with the host — are the complete integration surface. The specific files and settings keys are defined in each host's [adoption specification](assistant-adoption.md).
169+
These two steps — generating a plugin manifest and registering with the host — are the complete integration surface. The specific files and settings keys are defined in each host's [adoption specification](/assistants/).
170170

171171
## Namespacing
172172

@@ -178,7 +178,7 @@ For example, a package named `api-testing` containing `skills/run-suite/` expose
178178
179179
## Scope and Settings
180180

181-
Each installation scope maps to a different host settings location. The specific paths vary by host and are defined in the host's [adoption specification](assistant-adoption.md) under `configuration.settings_paths`.
181+
Each installation scope maps to a different host settings location. The specific paths vary by host and are defined in the host's [adoption specification](/assistants/) under `configuration.settings_paths`.
182182

183183
| Scope | Plugin Directory | Behavior |
184184
|---|---|---|

src/content/docs/specification/manifest.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The `compatibility` object declares version constraints for host tools. Each key
126126
}
127127
```
128128

129-
Keys are host identifiers as defined in individual [adoption specifications](assistant-adoption.md). Installers SHOULD warn the user if the host does not satisfy the declared compatibility constraint. Installers MUST NOT refuse installation solely based on an unrecognized tool identifier.
129+
Keys are host identifiers as defined in individual [adoption specifications](/assistants/). Installers SHOULD warn the user if the host does not satisfy the declared compatibility constraint. Installers MUST NOT refuse installation solely based on an unrecognized tool identifier.
130130

131131
## Targets Object
132132

@@ -156,7 +156,7 @@ The following standard fields are defined. Tool-specific adapters MAY define add
156156
}
157157
```
158158

159-
Each key is a host identifier matching an [adoption specification](assistant-adoption.md). The `hook_events` mapping translates canonical event names to host-native event names; the `instructions_file` declares the filename to which assembled instructions are written. Missing canonical events in a host's `hook_events` mean the host has no equivalent — hooks using those canonical names are silently skipped on that host. See individual adoption specs for the complete event mappings, instruction filenames, and MCP prefixes for each host.
159+
Each key is a host identifier matching an [adoption specification](/assistants/). The `hook_events` mapping translates canonical event names to host-native event names; the `instructions_file` declares the filename to which assembled instructions are written. Missing canonical events in a host's `hook_events` mean the host has no equivalent — hooks using those canonical names are silently skipped on that host. See individual adoption specs for the complete event mappings, instruction filenames, and MCP prefixes for each host.
160160

161161
## Example Manifest
162162

src/content/docs/specification/overview.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Introduction to the ccpkg specification, design principles, and ar
55

66
# ccpkg Specification
77

8-
**Specification Version: 2026-02-14 (Draft)**
8+
**Specification Version: 2026-02-22 (Draft)**
99

1010
## Status
1111

@@ -115,6 +115,6 @@ stateDiagram-v2
115115

116116
The ccpkg specification is structured as a layered system. This core specification defines the universal packaging format — archive structure, manifest schema, component types, install lifecycle, and security model. It is intentionally tool-agnostic: no host-specific filenames, settings paths, or plugin registration mechanisms appear in the core spec.
117117

118-
Host-specific integration details are captured in **assistant adoption specifications**, one per AI coding assistant. Each adoption spec declares how ccpkg maps to a particular host's conventions: instruction filenames, hook event names, plugin registration steps, settings paths, and component support levels. Adoption specs are machine-validated against the [Assistant Adoption Specification Schema](schemas/assistant-adoption.schema.json) and published alongside this specification in the `spec/assistants/` directory.
118+
Host-specific integration details are captured in **assistant adoption specifications**, one per AI coding assistant. Each adoption spec declares how ccpkg maps to a particular host's conventions: instruction filenames, hook event names, plugin registration steps, settings paths, and component support levels. Adoption specs are machine-validated against the [Assistant Adoption Specification Schema](https://github.com/zircote/ccpkg/blob/main/spec/schemas/assistant-adoption.schema.json) and published alongside this specification in the `spec/assistants/` directory.
119119

120-
The [Assistant Adoption Specification](assistant-adoption.md) defines the normative contract for what an adoption spec MUST contain. Installers use adoption specs at install time to perform host-specific adapter operations (generating plugin manifests, registering with the host, translating hook events). Package authors consult adoption specs to understand which components each host supports and how to structure portable packages.
120+
The [Assistant Adoption Specification](/assistants/) defines the normative contract for what an adoption spec MUST contain. Installers use adoption specs at install time to perform host-specific adapter operations (generating plugin manifests, registering with the host, translating hook events). Package authors consult adoption specs to understand which components each host supports and how to structure portable packages.

src/content/docs/specification/portability.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following components are tool-agnostic and work across any host that support
2020

2121
## Component Portability Matrix
2222

23-
The portability status of each component type is documented in each host's [adoption specification](assistant-adoption.md) under `component_support`. Consult the relevant adoption spec to determine which components a host supports and at what level.
23+
The portability status of each component type is documented in each host's [adoption specification](/assistants/) under `component_support`. Consult the relevant adoption spec to determine which components a host supports and at what level.
2424

2525
**Support levels:**
2626
- **Native**: Component type is natively supported by the host
@@ -49,7 +49,7 @@ Four mechanisms handle tool-specific differences:
4949
- Prefer MCP for tool integration over host-specific mechanisms.
5050
- Use `compatibility` to declare minimum host versions rather than excluding hosts.
5151
- Use per-component `hosts` scoping for host-specific hooks or agents alongside universal skills.
52-
- Use canonical event names for hook portability. Consult each host's [adoption specification](assistant-adoption.md) for supported events.
52+
- Use canonical event names for hook portability. Consult each host's [adoption specification](/assistants/) for supported events.
5353
- Scope agents to specific hosts via `hosts` — agent formats are not yet portable across hosts.
5454
- Scope LSP components to hosts that support them. Check each host's `component_support.lsp_servers` in its adoption spec.
5555
- When a host requires an MCP environment variable prefix, declare it via `targets.{host}.mcp_env_prefix`. See the host's adoption spec for the specific prefix value.

0 commit comments

Comments
 (0)