Compare commits
2 Commits
improve-qu
...
cfa5d4e174
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfa5d4e174 | ||
| 189e54862e |
16
README.md
16
README.md
@@ -115,6 +115,22 @@ subdirectory. Each file contains one or more related prompts or policy
|
|||||||
documents. There is no build step or runtime component; the prompts are consumed
|
documents. There is no build step or runtime component; the prompts are consumed
|
||||||
by copying them into other projects or referencing them directly.
|
by copying them into other projects or referencing them directly.
|
||||||
|
|
||||||
|
## Template Repos
|
||||||
|
|
||||||
|
These template repositories implement the policies defined in this repo and
|
||||||
|
serve as starting points for new projects. They must be kept in sync when
|
||||||
|
policies change.
|
||||||
|
|
||||||
|
- **[template-app-go](https://git.eeqj.de/sneak/template-app-go)** — Go HTTP
|
||||||
|
server template (Uber fx, chi, SQLite, session auth, Prometheus metrics)
|
||||||
|
- **[template-app-js](https://git.eeqj.de/sneak/template-app-js)** — JavaScript
|
||||||
|
SPA template (Vite, Tailwind CSS v4, nginx Docker deployment)
|
||||||
|
- **[template-app-python](https://git.eeqj.de/sneak/template-app-python)** —
|
||||||
|
Python web application template (FastAPI, uvicorn, pytest, black, ruff)
|
||||||
|
|
||||||
|
When updating policies in this repo, also update the template repos to match
|
||||||
|
(Makefile targets, Dockerfile conventions, CI workflows, required files, etc.).
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- Add more prompt templates for common development tasks
|
- Add more prompt templates for common development tasks
|
||||||
|
|||||||
@@ -429,6 +429,29 @@ last_modified: 2026-02-22
|
|||||||
releasable". "Releasable" in this context means that it builds and functions
|
releasable". "Releasable" in this context means that it builds and functions
|
||||||
as expected, and that all tests and linting passes.
|
as expected, and that all tests and linting passes.
|
||||||
|
|
||||||
|
1. Custom string types (e.g. `type ImageID string`) should implement the
|
||||||
|
`fmt.Stringer` interface by adding a `String() string` method. When passing
|
||||||
|
these types to library code or standard library functions that expect a
|
||||||
|
`string`, use the `.String()` method instead of a `string()` cast. This
|
||||||
|
keeps the code consistent with Go's interface conventions and makes it
|
||||||
|
easier to change the underlying representation later without updating every
|
||||||
|
call site.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```go
|
||||||
|
type ImageID string
|
||||||
|
|
||||||
|
// String implements fmt.Stringer.
|
||||||
|
func (id ImageID) String() string { return string(id) }
|
||||||
|
|
||||||
|
// Right:
|
||||||
|
client.RemoveImage(ctx, imageID.String())
|
||||||
|
|
||||||
|
// Wrong:
|
||||||
|
client.RemoveImage(ctx, string(imageID))
|
||||||
|
```
|
||||||
|
|
||||||
# Other Golang Tips and Best Practices (Optional)
|
# Other Golang Tips and Best Practices (Optional)
|
||||||
|
|
||||||
1. For any internet-facing http server, set appropriate timeouts and limits to
|
1. For any internet-facing http server, set appropriate timeouts and limits to
|
||||||
|
|||||||
Reference in New Issue
Block a user