Skip to content

fix(platform): make template directory NTFS-safe for Windows#92

Merged
JonZeolla merged 6 commits intomainfrom
windows-more
Apr 5, 2026
Merged

fix(platform): make template directory NTFS-safe for Windows#92
JonZeolla merged 6 commits intomainfrom
windows-more

Conversation

@JonZeolla
Copy link
Copy Markdown
Member

Summary

  • Rename template directory from {{cookiecutter.project_name|replace(" ", "")}} to {{cookiecutter.project_name}} — the pipe (|) and double-quote (") characters in the Jinja2 filter were illegal on NTFS, preventing git clone on Windows entirely
  • Add pre-gen hook validation rejecting spaces in project names (suggest hyphens instead), since the replace(" ", "") filter that previously handled spaces is gone
  • Simplify Windows CI job to use normal actions/checkout instead of the extract_template_zip.py workaround (now deleted)
  • Add Windows install instructions (winget install astral-sh.uv Task.Task) to README
  • Guard brew upgrade uv with OS check (ne OS "windows") in both root and template Taskfiles

Test plan

  • All 48 unit tests pass locally (including new space-rejection tests)
  • Windows CI smoke test should now do a normal checkout + cookiecutter generation
  • Verify the exact same uvx --with gitpython cookiecutter gh:zenable-io/ai-native-python command works on Windows after merge

🤖 Generated with Claude Code

The template directory name `{{cookiecutter.project_name|replace(" ", "")}}`
contained pipe (`|`) and double-quote (`"`) characters which are illegal on
NTFS. This prevented Windows users from cloning the repo via
`cookiecutter gh:zenable-io/ai-native-python`.

Rename to `{{cookiecutter.project_name}}` and add pre-gen hook validation
to reject spaces in project names (use hyphens instead). This eliminates
the need for the extract_template_zip.py workaround and lets Windows CI
do a normal checkout.

Also adds Windows install instructions (winget) to README and guards
`brew upgrade` commands with OS checks in Taskfiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@ai-coding-guardrails ai-coding-guardrails bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 😎

I didn't find anything of concern

Did you know we can integrate this feedback directly into 50+ IDEs? Get setup in just one command

JonZeolla and others added 5 commits April 5, 2026 12:04
Use `gh:` syntax in Windows CI to match the exact README command.
Pass github.head_ref through env var to satisfy actionlint.
Disable lint/test jobs while iterating on Windows support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cookiecutter's gh: syntax does git clone of the default branch first,
which fails on Windows when main still has NTFS-illegal paths. Pre-clone
with --no-checkout and checkout the PR branch to seed the cache. The
actual cookiecutter command remains the same as the README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cookiecutter's gh: syntax clones the default branch first. When main
still has NTFS-illegal paths, this fails on Windows. Setting
core.protectNTFS=false lets git skip path validation so the clone can
succeed, then cookiecutter checks out the PR branch which has valid paths.
This setting becomes a no-op after the PR merges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gh: command tries to clone main first which fails on Windows when
main still has NTFS-illegal paths. Add a fallback that manually clones
with --no-checkout and checks out the PR branch. After merge, the gh:
command succeeds directly and the fallback is never triggered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Windows smoke test passes with the gh: command (using local clone
fallback pre-merge). Re-enable all Linux CI jobs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JonZeolla JonZeolla merged commit 6078d29 into main Apr 5, 2026
5 checks passed
@JonZeolla JonZeolla deleted the windows-more branch April 5, 2026 23:49
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