Skip to content
internal-package-building logo

Internal Package Building Skill

internal-package-building

Guides adding and structuring internal Go packages: when to create a new package, import paths, cmd vs internal boundaries, and domain layout. Use when creating or refactoring code under internal/, adding a new domain, or when the user asks about internal package structure.

SKILL.md

Full skill instructions

Internal Package Building Skill

Use this skill when creating or refactoring internal Go packages.


When to create a new package

  • New domain → new directory under internal/ (e.g. new feature area or bounded context).
  • Existing domain → add or edit files in the existing package; do not split without a clear boundary.
  • Shared cross-cutting concern (DB, config, models) → use or extend existing shared packages (internal/​db, internal/​models, internal/​env) rather than creating a new one unless the concern is clearly separate.

Layout

  • One package per directory; package name = directory name (e.g. internal/​candidate_tree → package candidate_tree).
  • Entrypoints live only in cmd/​ (e.g. cmd/​api, cmd/​evaluator, cmd/​importer). All shared logic lives in internal/​.
  • internal/​ must not import cmd/​; cmd packages wire and call internal packages.

Imports

  • Import internal packages by module path: tarkov-build-optimiser/​internal/<pkg>
  • Example: import "tarkov-build-optimiser/​internal/​models"

Existing internal packages (use, don’t duplicate)

PackageRole
internal/​dbDatabase connections and pool
internal/​modelsData types and SQL access (UpsertX, GetXById, etc.)
internal/​envEnvironment/​config
internal/​helpersShared pure helpers (e.g. maths)
internal/​cacheCaching utilities
internal/​candidate_treeBuild candidate tree logic
internal/​evaluatorBuild evaluation
internal/​importersData import from external sources
internal/​routerHTTP routing and handlers
internal/​tarkovdevtarkov.dev API client

Checklist for a new internal package

  1. Create internal/<name>/ with at least one .go file; package name = <name>.
  2. Add only code that belongs to that domain; put shared DB/​config in internal/​db or internal/​env.
  3. Import other internal packages via tarkov-build-optimiser/​internal/​....
  4. Keep the package focused; if it grows into two clear domains, consider splitting into two packages only when the boundary is obvious.
  5. Add tests in the same package (*_test.go); use *_unit_test.go or *_integration_test.go per project conventions.

Boundaries to respect

  • No business logic in cmd/​ — cmd only parses flags/​env, opens DB, and calls internal packages.
  • No circular imports — internal packages may depend on each other only acyclically; if you introduce a cycle, extract a shared type or helper into a lower-level package.
  • Database access — use internal/​db for connections and internal/​models for SQL and data types; do not add new ad-hoc DB packages.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View