template-engine-copier skill: initial import
Copier + Jinja template-repository design skill: reference architecture, implementation workflow, validation checklist, and a full worked example template (questionnaire, extensions, resolvers, wrapper-first .scripts). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from jinja2.ext import Extension
|
||||
|
||||
|
||||
def resolve_safe_identifier(name: str) -> str:
|
||||
return (
|
||||
name
|
||||
.replace("-", "_")
|
||||
.replace("{", "")
|
||||
.replace("}", "")
|
||||
.replace(".", "_")
|
||||
)
|
||||
|
||||
|
||||
class SafeIdentifierExtension(Extension):
|
||||
def __init__(self, environment):
|
||||
super().__init__(environment)
|
||||
environment.globals["resolve_safe_identifier"] = resolve_safe_identifier
|
||||
Reference in New Issue
Block a user