2026-02-20 15:01:55 +00:00
# CLAUDE.md — go-scm Agent Instructions
2026-02-20 00:28:39 +00:00
2026-02-20 15:01:55 +00:00
You are a dedicated domain expert for `forge.lthn.ai/core/go-scm` . Virgil orchestrates tasks via Forgejo issues. Pick up tasks in issue order, mark complete, commit and push.
2026-02-20 00:28:39 +00:00
## What This Package Does
2026-02-21 17:13:04 +00:00
SCM integration and data collection for the Lethean ecosystem. Four packages: `forge/` (Forgejo API client), `git/` (multi-repo git ops), `gitea/` (Gitea API client), `collect/` (data collection).
**Extracted to other repos:** `agentci/` + `jobrunner/` → `core/go-agent` , `git/` → `core/go-git` .
2026-02-20 00:28:39 +00:00
## Commands
```bash
go test ./... # Run all tests
go test -v -run TestName ./... # Single test
go test -race ./... # Race detector
go vet ./... # Static analysis
```
## Local Dependencies
Resolved via `replace` in go.mod or preferably via `go.work` :
2026-02-20 15:01:55 +00:00
| Module | Local Path |
|--------|-----------|
| `forge.lthn.ai/core/go` | `../go` |
2026-02-20 00:28:39 +00:00
## Key Types
```go
// forge/client.go
2026-02-20 15:01:55 +00:00
type Client struct { api *forgejo.Client; url, token string }
2026-02-20 00:28:39 +00:00
// git/git.go
type RepoStatus struct {
Name, Path, Branch string
Modified, Untracked, Staged, Ahead, Behind int
Error error
}
```
## Coding Standards
- **UK English**: colour, organisation, centre
2026-02-20 15:01:55 +00:00
- **Tests**: testify assert/require, table-driven preferred, `_Good` /`_Bad` /`_Ugly` naming
2026-02-21 17:13:04 +00:00
- **Conventional commits**: `feat(forge):` , `fix(git):` , `test(collect):`
2026-02-20 00:28:39 +00:00
- **Co-Author**: `Co-Authored-By: Virgil <virgil@lethean.io>`
- **Licence**: EUPL-1.2
- **Imports**: stdlib → forge.lthn.ai → third-party, each group separated by blank line
2026-02-20 15:01:55 +00:00
- **Error pattern**: `"package.Func: context: %w"` — no bare `fmt.Errorf`
See `docs/development.md` for full standards and test patterns.
2026-02-20 00:28:39 +00:00
## Forge
- **Repo**: `forge.lthn.ai/core/go-scm`
- **Push via SSH**: `git push origin main` (remote: `ssh://git@forge.lthn.ai:2223/core/go-scm.git` )