Skip to content

#1177 Rewrite links, tokens, and template variables in a Markdown file support entry - #1273

Merged
williamthorsen merged 3 commits into
mainfrom
1177
Aug 10, 2026
Merged

#1177 Rewrite links, tokens, and template variables in a Markdown file support entry#1273
williamthorsen merged 3 commits into
mainfrom
1177

Conversation

@williamthorsen

@williamthorsen williamthorsen commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What

Fixes an issue where a Markdown file placed directly in a package's skills directory, rather than in a subdirectory, was installed with its relative links pointing nowhere and its placeholder tokens left as literal text. Such a file now fails when it carries an unsupported rulebook reference.

Why

A package following the producer contract may ship a loose Markdown file under skills/, and until now that file reached the harness home unusable: its links led nowhere and its tokens read as literal text, while the same file one directory deeper worked. The gap was invisible in the library's own content, which ships no such file, so it would have surfaced first on a third-party package.

Details

🐛 Bug fixes

  • renderSupportEntry sent a Markdown file through include expansion, the guidance-hook strip, the anchor gate, and the tool-name rewrite alone, skipping link rewriting, invocation-token rewriting, and template expansion. Both branches now render through the same chain, so an entry's shape decides how it is walked and never which rewrites apply to the Markdown it holds. The narrow chain was validate-shaped, inherited from a checking pass that cared only about the transforms that can fail; install adopted it later and shipped its output.
  • The unification reaches both delivery paths, the library's install and a declared source's sync, because each already routed through the shared render.

♻️ Refactoring

  • renderMarkdown takes one fileRelPath in place of the relPath and slug pair it composed into a link-anchor path at render time. The single parameter is expressible by a caller with no slug/relPath split, which is what lets a Markdown file entry share the render.

🧪 Tests

  • Added coverage at each of the three surfaces: the render itself, a declared source's support delivery, and the installed file in the harness home.
  • Corrected two existing cases that paired a source path inside _data/ with a destination name of _data, a combination no caller produces and one that would have masked a defect now that the destination name anchors link resolution.
  • Both suites in the skill-transform tests build their deploy context from a single module-scoped buildContext.

Closes #1177

Relative Markdown links in a skill's files resolve against one caller-supplied path rather than a directory name and a file name composed at render time, which is what lets a flat support file share the same render.
A Markdown file placed directly under a package's `skills/` directory now deploys with its relative links, invocation tokens, and template variables resolved, matching what a file inside a support directory receives.

Such a file carrying a `{rulebook:…}` token now fails the run, the same way one inside a support directory does.
Both suites in the skill-transform tests build their deploy context from a single module-scoped `buildContext`, so a new field on the context needs one edit rather than two.
@github-actions

Copy link
Copy Markdown

Dependency audit

Production dependency audit passed.

@williamthorsen williamthorsen self-assigned this Aug 10, 2026
@williamthorsen
williamthorsen marked this pull request as ready for review August 10, 2026 09:47
@williamthorsen
williamthorsen merged commit 2388cc9 into main Aug 10, 2026
3 checks passed
@williamthorsen
williamthorsen deleted the 1177 branch August 10, 2026 09:51
williamthorsen added a commit that referenced this pull request Aug 13, 2026
…e-v0.3.0 codeassembly-v0.9.0 factory-v0.2.6 codeassembly-mcp-v0.2.5

codeassembly-v0.9.0
- #1288 feat: State mutability and name the lede reader at the artifact type lists (#1303)
- #1285 fix: Require plain bullets for checklists on both update-jira-ticket paths (#1302)
- deps: Upgrade all deps to latest version
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- #1294 feat: Specify artifact mutability and its sanctioned exceptions (#1297)
- #1293 fix: Present and classify discretionary findings as actionable (#1295)
- #1289 tooling: Remove shelled nmr calls from package manifests (#1291)
- #1280 feat: Add a refresh path that edits an existing AGENTS.md instead of redrafting it (#1287)
- #1055 feat: Replace the lede doctrine with corpus-derived guidance and retire the changelog-writer (#1286)
- deps: Upgrade all deps to latest version
- #1264 refactor: Consolidate error-message extraction on toolbelt.errors' describeError (#1284)
- #1263 refactor: Retire the deferred-lint mechanism and adopt toolbelt.errors in agents (#1279)
- #1262 refactor: Hoist unreadable for-of expressions and promote the lint rule to an error (#1276)
- #1267 fix: Extend the no-hard-wrapping instruction to every GitHub composer (#1275)
- #1177 fix: Rewrite links, tokens, and template variables in a Markdown file support entry (#1273)
- #1176 feat: Add a ticketing-preferences hook to the skills that split and create tickets (#1268)
- #1252 fix: Keep a skill's own sections out of injected guidance (#1266)
- #1260 refactor: Fix lint and retire rule deferrals (#1265)
- #1247 feat: Add a personal tooling-preferences rulebook (#1257)
- #1251 feat: Let a rulebook declare that a guidance hook is how it is reached (#1259)
- #1246 feat: Guard home-domain writes and record their provenance (#1254)
- #1175 feat: Link new tickets to their blockers and parents (#1249)

factory-v0.2.6
- deps: Upgrade all deps to latest version
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- deps: Upgrade all deps to latest version
- deps: Upgrade all deps to latest version
- #1264 refactor: Consolidate error-message extraction on toolbelt.errors' describeError (#1284)

kb-v0.6.0
- deps: Upgrade all deps to latest version
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- #1289 tooling: Remove shelled nmr calls from package manifests (#1291)
- #1264 refactor: Consolidate error-message extraction on toolbelt.errors' describeError (#1284)
- #1261 feat: Attach causes to kb's loader errors and retire its lint deferral (#1272)
- #1260 refactor: Fix lint and retire rule deferrals (#1265)

codeassembly-lifecycle-v0.4.0
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- #1289 tooling: Remove shelled nmr calls from package manifests (#1291)
- #1261 feat: Attach causes to kb's loader errors and retire its lint deferral (#1272)
- #1260 refactor: Fix lint and retire rule deferrals (#1265)

codeassembly-mcp-v0.2.5
- deps: Upgrade all deps to latest version
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- #1289 tooling: Remove shelled nmr calls from package manifests (#1291)
- #1264 refactor: Consolidate error-message extraction on toolbelt.errors' describeError (#1284)

codeassembly-run-core-v0.3.0
- deps: Upgrade all deps to latest version
- #1290 tooling: Upgrade eslint-config-typescript to 10 and complete manifest metadata (#1301)
- #1289 tooling: Remove shelled nmr calls from package manifests (#1291)
- #1264 refactor: Consolidate error-message extraction on toolbelt.errors' describeError (#1284)
- #1261 feat: Attach causes to kb's loader errors and retire its lint deferral (#1272)
- #1260 refactor: Fix lint and retire rule deferrals (#1265)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Markdown file support entry skips link, token, and template rewriting

1 participant