Skip to content

fix(rename): keep links to the template's GitHub repos and the agent's name - #156

Merged
dadachi merged 1 commit into
mainfrom
fix/protect-template-repo-links
Oct 18, 2026
Merged

dadachi merged 1 commit into
mainfrom
fix/protect-template-repo-links

Conversation

@dadachi

@dadachi dadachi commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Summary

The rename turned references to the template's own repos into dead links in generated apps (github.com/nativeapptemplate/NativeAppTemplate-iOS → github.com/orangebaton/OrangeBaton-iOS, .../nativeapptemplateapi/issues → .../orange_baton_api/issues, "nativeapptemplate-agent" → "orangebaton-agent").

  • scripts/ruby/rename.rb: PROTECTED_REFERENCE matches github.com/nativeapptemplate (also the SSH form github.com:nativeapptemplate) plus any /<repo>/<path> up to whitespace, ), ], quotes, <, > or a backtick, and the bare name nativeapptemplate-agent / nativeapptemplate-agent-mcp. rename_content swaps those spans for private-use-codepoint placeholders, runs the usual substitution, and puts them back. The spans come out byte-for-byte unchanged, including any Shop/ItemTag in a URL path. Only file contents are masked. Path renames still use rename_all and behave as before.
  • Not protected: nativeapptemplate.com domains and emails. They still become the app's own (support@orangebaton.com).
  • Layer 1 (src/validation/layer1.ts): skips matches that fall inside the same spans (src/validation/protected-references.ts, which mirrors the Ruby pattern). It allows only these exact forms, not nativeapptemplate in general. For example, github.com/nativeapptemplatefoo/... is still flagged.
  • Docs: rule 5 in docs/SUBSTRATE-CONTRACT.md and the "Rename the skeleton" step in README.

Tests

  • rename.rb: URLs with /blob/..., /issues, /pull/12, .git, SSH, Markdown and SVG contexts; the bare agent name and -mcp; mixed lines; an ItemTag path segment inside a protected URL; a nativeapptemplate.com domain and email that must still be renamed. Layer 1 must accept the output.
  • rename.rb: file and directory paths are still renamed next to a protected reference.
  • Layer 1: tokens inside protected spans are not flagged, while a bare product name, an email and a look-alike org are.
  • I broke each side on purpose (rename_all in place of rename_content, and the Layer 1 span check removed): all three new tests failed.

Sanity check

I ran rename.rb (Orange Baton plan) on temp copies of the paid API, iOS and Android substrates. All 31 github.com/nativeapptemplate/... links and the 29 nativeapptemplate-agent mentions survive unchanged. There is no orangebaton-agent and no github.com/orange... in the output, and no nativeapptemplate.com is left. On that output, Layer 1 reports 0 findings with the change and 23 without it.

Closes #155

🤖 Generated with Claude Code

https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr

…s name

The rename treated every NativeAppTemplate spelling as the product name,
including github.com/nativeapptemplate/<repo> links and the name
nativeapptemplate-agent, so generated docs pointed at dead repos such as
github.com/orangebaton/OrangeBaton-iOS and a nonexistent orangebaton-agent.

rename.rb now masks those spans (PROTECTED_REFERENCE: any
github.com/nativeapptemplate[/<repo>/...] link incl. the SSH form, and
nativeapptemplate-agent[-mcp]) with placeholders before substituting file
contents and restores them after, so nothing inside them is renamed. Path
renames are unchanged. nativeapptemplate.com domains and emails still
become the app's own. Layer 1 skips tokens inside the same spans
(src/validation/protected-references.ts) so it doesn't flag them.

Closes #155

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr
@dadachi
dadachi merged commit 9bf8f2e into main Oct 18, 2026
1 check passed
@dadachi
dadachi deleted the fix/protect-template-repo-links branch October 18, 2026 00:47
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.

Rename turns links to the template's own GitHub repos into dead links

1 participant