v0.2.0 92ac699

SKILL.md RawHistoryFolder


name: hexcheck description: Use when configuring or running hexcheck in a Go repo for hexagonal architecture boundaries, adapter business-logic warnings, and mock discipline.

Hexcheck

Configure .hexcheck.yaml by mapping repo paths to roles. Folder names do not matter; roles do.

Roles:

  • core: domain/core business logic
  • usecase: application use cases/orchestration
  • ports: interfaces/contracts
  • adapter: infra, persistence, external services, outbound adapters
  • entrypoint: CLI/HTTP/UI/bootstrap
  • ignore: generated code, mocks, vendor

Minimal shape:

version: 1
components:
  core: { role: core, paths: [internal/domain/**, internal/core/**] }
  usecases: { role: usecase, paths: [internal/application/usecase/**, internal/application/usecases/**, internal/usecases/**] }
  ports: { role: ports, paths: [internal/application/port/**, internal/domain/repository/**] }
  adapters: { role: adapter, paths: [internal/infrastructure/**, internal/adapters/**] }
  entrypoints: { role: entrypoint, paths: [cmd/**] }
  generated: { role: ignore, paths: ['**/mocks/**', '**/generated/**', '**/*_templ.go', '**/*_gen.go'] }

For repos using boundaries, map by role, e.g. boundaries/in -> entrypoint, boundaries/out -> adapter, boundaries/ports -> ports.

Recommended rules:

rules:
  no-adapter-imports-in-core: error
  no-infra-imports-in-usecase: error
  no-framework-types-in-core: error
  no-infra-types-in-ports: error
  no-adapter-to-adapter-imports: warn
  suspicious-business-logic-in-adapter: warn
  no-local-fakes-for-ports: warn
  missing-generated-mock-for-port: warn
  prefer-generated-mocks: warn

Business-logic mode:

heuristics:
  businessLogicMode: audit # audit|ci
  businessLogicMinConfidence: medium # low|medium|high

Use audit for refactor discovery. Use ci when heuristic findings must stay high-confidence. Prefer tuning confidence before adding broad excludePaths.

Mock config:

mocking:
  generatedMockPaths: [internal/mocks/**, internal/application/mocks/**, internal/application/port/mocks/**]
  generatedMockNamePatterns: ['Mock{{Interface}}', '{{Interface}}Mock']

Run:

hexcheck -hexcheck.config .hexcheck.yaml -hexcheck.root . ./...

Agent checklist: read repo architecture docs, map paths to roles, ignore generated/mocks, configure mock paths, run once, tune ruleSettings.*.excludePaths only after inspecting examples.

source
1---
2name: hexcheck
3description: Use when configuring or running hexcheck in a Go repo for hexagonal architecture boundaries, adapter business-logic warnings, and mock discipline.
4---
5
6# Hexcheck
7
8Configure `.hexcheck.yaml` by mapping repo paths to roles. Folder names do not matter; roles do.
9
10Roles:
11- `core`: domain/core business logic
12- `usecase`: application use cases/orchestration
13- `ports`: interfaces/contracts
14- `adapter`: infra, persistence, external services, outbound adapters
15- `entrypoint`: CLI/HTTP/UI/bootstrap
16- `ignore`: generated code, mocks, vendor
17
18Minimal shape:
19
20```yaml
21version: 1
22components:
23  core: { role: core, paths: [internal/domain/**, internal/core/**] }
24  usecases: { role: usecase, paths: [internal/application/usecase/**, internal/application/usecases/**, internal/usecases/**] }
25  ports: { role: ports, paths: [internal/application/port/**, internal/domain/repository/**] }
26  adapters: { role: adapter, paths: [internal/infrastructure/**, internal/adapters/**] }
27  entrypoints: { role: entrypoint, paths: [cmd/**] }
28  generated: { role: ignore, paths: ['**/mocks/**', '**/generated/**', '**/*_templ.go', '**/*_gen.go'] }
29```
30
31For repos using `boundaries`, map by role, e.g. `boundaries/in -> entrypoint`, `boundaries/out -> adapter`, `boundaries/ports -> ports`.
32
33Recommended rules:
34
35```yaml
36rules:
37  no-adapter-imports-in-core: error
38  no-infra-imports-in-usecase: error
39  no-framework-types-in-core: error
40  no-infra-types-in-ports: error
41  no-adapter-to-adapter-imports: warn
42  suspicious-business-logic-in-adapter: warn
43  no-local-fakes-for-ports: warn
44  missing-generated-mock-for-port: warn
45  prefer-generated-mocks: warn
46```
47
48Business-logic mode:
49
50```yaml
51heuristics:
52  businessLogicMode: audit # audit|ci
53  businessLogicMinConfidence: medium # low|medium|high
54```
55
56Use `audit` for refactor discovery. Use `ci` when heuristic findings must stay high-confidence. Prefer tuning confidence before adding broad `excludePaths`.
57
58Mock config:
59
60```yaml
61mocking:
62  generatedMockPaths: [internal/mocks/**, internal/application/mocks/**, internal/application/port/mocks/**]
63  generatedMockNamePatterns: ['Mock{{Interface}}', '{{Interface}}Mock']
64```
65
66Run:
67
68```bash
69hexcheck -hexcheck.config .hexcheck.yaml -hexcheck.root . ./...
70```
71
72Agent checklist: read repo architecture docs, map paths to roles, ignore generated/mocks, configure mock paths, run once, tune `ruleSettings.*.excludePaths` only after inspecting examples.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 5

↑↓ moveenter openesc close