- Move pkg/prompts/lib → pkg/lib (prompt, task, flow, persona, workspace) - New lib.go: unified package with ExtractWorkspace() using text/template - Workspace templates: default, security, review — .tmpl files with data injection - prep.go: uses lib.ExtractWorkspace() + detect helpers for language/build/test - prompts.go: thin re-export wrapper for backwards compat Co-Authored-By: Virgil <virgil@lethean.io>
817 B
817 B
Core Conventions Checklist
Error Handling
coreerr.E("pkg.Method", "msg", err)— always 3 args- Never
fmt.Errorforerrors.New - Import as
coreerr "forge.lthn.ai/core/go-log"
File I/O
coreio.Local.Read/Write/EnsureDir— neveros.ReadFile/WriteFileWriteMode(path, content, 0600)for sensitive files (keys, hashes)- Import as
coreio "forge.lthn.ai/core/go-io"
Safety
- Check
err != nilBEFOREresp.StatusCode - Type assertions use comma-ok:
v, ok := x.(Type) - No hardcoded paths (
/Users/,/home/,host-uk) - No tokens/secrets in error messages or logs
Style
- UK English in comments (colour, organisation, initialise)
- SPDX-License-Identifier: EUPL-1.2 on every file
- Test naming:
_Good,_Bad,_Ugly