v0.3.1 1e04dbb

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. Start with hexcheck init, which writes a starter config from detected folders, then refine it.

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-usecase-imports-in-core: error
  no-infra-imports-in-usecase: error
  no-infra-imports-in-ports: error
  no-entrypoint-imports-in-adapter: 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 -config .hexcheck.yaml -root . ./...   # exit 3 on error-level findings
hexcheck -fail-on warn ./...                     # also fail on warn-level findings

The config is strict: unknown keys or rule names fail the run. For a single justified exception, use an inline directive with a reason: //hexcheck:ignore <rule>[,<rule>] <reason>.

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, and prefer allow entries or inline directives with reasons over turning rules off.

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. Start with `hexcheck init`, which writes a starter config from detected folders, then refine it.
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-usecase-imports-in-core: error
39  no-infra-imports-in-usecase: error
40  no-infra-imports-in-ports: error
41  no-entrypoint-imports-in-adapter: error
42  no-framework-types-in-core: error
43  no-infra-types-in-ports: error
44  no-adapter-to-adapter-imports: warn
45  suspicious-business-logic-in-adapter: warn
46  no-local-fakes-for-ports: warn
47  missing-generated-mock-for-port: warn
48  prefer-generated-mocks: warn
49```
50
51Business-logic mode:
52
53```yaml
54heuristics:
55  businessLogicMode: audit # audit|ci
56  businessLogicMinConfidence: medium # low|medium|high
57```
58
59Use `audit` for refactor discovery. Use `ci` when heuristic findings must stay high-confidence. Prefer tuning confidence before adding broad `excludePaths`.
60
61Mock config:
62
63```yaml
64mocking:
65  generatedMockPaths: [internal/mocks/**, internal/application/mocks/**, internal/application/port/mocks/**]
66  generatedMockNamePatterns: ['Mock{{Interface}}', '{{Interface}}Mock']
67```
68
69Run:
70
71```bash
72hexcheck -config .hexcheck.yaml -root . ./...   # exit 3 on error-level findings
73hexcheck -fail-on warn ./...                     # also fail on warn-level findings
74```
75
76The config is strict: unknown keys or rule names fail the run. For a single justified exception, use an inline directive with a reason: `//hexcheck:ignore <rule>[,<rule>] <reason>`.
77
78Agent checklist: read repo architecture docs, map paths to roles, ignore generated/mocks, configure mock paths, run once, tune `ruleSettings.*.excludePaths` only after inspecting examples, and prefer `allow` entries or inline directives with reasons over turning rules off.

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