Thanks for contributing to github.com/kaptinlin/template.
This project is intentionally small on the surface and strict about API focus. The main rule is simple: keep the public model centered on Engine, Format, and Feature.
Common commands:
task test
task lint
task verify
go test ./...Before opening a PR, check these invariants:
Enginemust remain the only public entry point.- Layout features must stay behind
FeatureLayout. - HTML auto-escape must remain opt-in through
FormatHTML. - New tags and filters must belong to an engine instance, not mutable package-global APIs.
- Cache identity must continue to be based on loader
resolvednames.
If a change widens the public surface area, call that out explicitly in the PR and justify why the existing engine model is not enough.
For any new tag, filter, loader behavior, or execution change, answer these questions before merging:
- Does this fit naturally inside
Engine,Format, orFeature? - Should this be global, or should it live only inside an engine feature?
- Does this affect HTML escaping or
SafeStringsemantics? - Does this need a new sentinel error or better wrapped context?
- Should registration use
Register,Replace, orMustRegister? - What regression test proves the design boundary still holds?
Follow the conventions already used in the repository:
- Keep package APIs small and explicit.
- Prefer sentinel errors wrapped with context.
- Use table-driven tests with clear case names.
- Keep exported docs short and direct.
- Preserve the separation between built-in registries and engine-local registries.
- Prefer explicit registry intent:
Registerfor new names,Replacefor overrides,MustRegisterfor bootstrap code.
Documentation changes are first-class contributions.
When you add or change behavior:
- Update
README.mdif the user-facing entry points changed. - Update package docs in
doc.goif the public contract changed. - Update focused docs in
docs/for syntax, security, or loader behavior. - Update
ARCHITECTURE.mdwhen cache identity, execution context inheritance, or execution flow changes.
Prefer explaining when to use a feature and when not to use it. This library aims to make the correct path obvious.
When submitting a PR:
- Describe the user-visible change in one short paragraph.
- Call out whether
Engine,Format, orFeatureLayoutbehavior is affected. - Mention the tests you added or updated.
- Mention any security or escaping implications.
- Mention whether cache identity, loop scope, or child-context inheritance changed.
Conventional commit style is used in history:
feat: descriptionfix: descriptionrefactor: descriptiontest: descriptiondocs: description
If something is unclear, open an issue or draft PR with the design question first. For this project, preserving a small and coherent engine model is usually more important than adding one more feature quickly.