Move Service struct, methods, constructors, and singleton management
to dedicated file for better code organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TimeAgo(t time.Time) for relative time strings
- Add FormatAgo(count, unit) for "N units ago" composition
- Add i18n.ago namespace pattern: T("i18n.ago", 5, "minute")
- Uses existing time.ago.{unit} keys with CLDR pluralization
- Remove local formatTimeAgo from cmd/php in favor of i18n.TimeAgo
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests for core.label, core.progress, core.count, core.done, core.fail
patterns. Also tests Raw() bypasses core.* magic.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
T() now auto-composes grammar patterns for core.* keys:
- core.label.{word} → "Status:"
- core.progress.{verb} → "Building..."
- core.count.{noun}, n → "5 files"
- core.done.{verb}, subj → "File deleted"
- core.fail.{verb}, subj → "Failed to delete file"
_() and Raw() do direct key lookup without magic.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend grammar system to support base words and punctuation rules:
- gram.word.* for base word translations
- gram.punct.label for language-specific label suffix (FR: " :")
- gram.punct.progress for progress suffix
Label() and Progress() are now language-aware:
- L("status") → EN: "Status:" / FR: "Statut :"
- P("build") → EN: "Building..." / FR: "Construction..."
This enables ~80% reduction in locale file size by composing
phrases at runtime instead of storing every variant.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename MissingKeyAction to MissingKey and add OnMissingKey() handler.
Keeps focus on missing keys only for QA - no unnecessary trace overhead.
- MissingKey: dispatched when T()/C() can't find a key in ModeCollect
- OnMissingKey(): register handler for missing key events
- SetActionHandler(): deprecated, use OnMissingKey()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move debug mode code to dedicated file for better code comprehension.
Go's package-level file globbing allows splitting functionality
across files while maintaining a single cohesive package.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move grammar data (verbs, nouns, articles) from "common" to "gram"
namespace - a tribute to Gram (grandmother) and short for grammar.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds cmd/i18n-validate that scans Go source files for i18n key usage
and validates them against locale JSON files and registered intents.
Features:
- Scans T(), C(), I(), and qualified i18n.* calls
- Expands ./... pattern to find all Go packages
- Validates message keys against locale JSON files
- Validates intent keys against registered core.* intents
- Reports missing keys with file:line locations
- Skips constant references (type-safe usage)
Usage:
go run ./cmd/i18n-validate ./...
task i18n:validate
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add SetDebug()/Debug() methods for showing key prefixes in output
- Debug mode shows: "[cli.success] Success" instead of "Success"
- Add NewSubject() as alias for S() for readability
- Both T() and C() respect debug mode
Debug mode is useful for:
- Identifying which translation keys are used where
- Verifying correct key usage during development
- QA testing of translation coverage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rewrite i18n package to handle nested JSON natively
- Remove go-i18n dependency in favour of simple custom implementation
- Flatten nested keys to dot notation internally (cli.confirm.yes)
- Support pluralisation with one/other keys
- Template interpolation with {{.Var}} syntax
- Update tests for new API and nested structure
Nested JSON is the standard format for translation tools,
making it easier to manage with external translation services.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add i18n service wrapping pkg/i18n for translations via cli.T()
- Add log service with levels (quiet/error/warn/info/debug)
- Wire cli.Init() in cmd.Execute() with explicit service names
- Fix main.go to print errors to stderr and exit with code 1
- Update runtime.go to accept additional services via Options
Services use WithName() to avoid name collision since both are
defined in pkg/cli (WithService would auto-name both "cli").
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- cli.Success(), cli.Error(), etc. now print directly
- String-returning versions renamed to cli.FmtSuccess(), etc.
- Removes App() from common usage path
- Usage: cli.Success("done") instead of fmt.Println(cli.Success("done"))
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moves shared utilities (styles, utils) from cmd/shared to pkg/cli.
Adds CLI runtime with global singleton pattern:
- cli.Init() initialises the runtime
- cli.App() returns the global instance
- OutputService for styled terminal printing
- SignalService for graceful shutdown handling
All cmd/ packages now import pkg/cli instead of cmd/shared.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the Core IPC design with four dispatch patterns:
- ACTION: fire-and-forget broadcast (existing)
- QUERY: first responder returns data
- QUERYALL: all responders return data
- PERFORM: first responder executes task
Updates git and agentic services to use Query/Task patterns.
Adds dev service for workflow orchestration.
Refactors dev work command to use worker bundles.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Aligns package name with directory structure (pkg/framework/core).
Fixes doc comment in e.go and adds core binary to gitignore.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add pkg/framework/framework.go for cleaner imports
- Add pkg/git/service.go with Core service wrapper
- Add pkg/agentic/service.go with AI/Claude service wrapper
- Services use IPC pattern with ACTION() dispatch
Usage:
import "github.com/host-uk/core/pkg/framework"
app, _ := framework.New(
framework.WithService(git.NewService(git.ServiceOptions{})),
framework.WithServiceLock(),
)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add pkg/framework/core with GUI-agnostic DI/service framework
(extracted from core-gui, Wails dependencies removed)
- Add pkg/agentic/prompts with embedded commit instructions
- Improve dev push: detect uncommitted changes, offer Claude commit
- Add claudeEditCommit for cases needing Write/Edit permissions
- Add i18n keys for diverged branches and uncommitted changes
- Fix infinite loop when only untracked files remain after commit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When push fails due to non-fast-forward rejection (local and remote
have diverged), offer to pull with rebase and retry the push instead
of just failing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduces gitInteractive() that connects stdin/stdout to the terminal,
allowing SSH to prompt for passphrases. Also adds GitError type to
improve error messages by including stderr output.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename en.json to en_GB.json (British English)
- Add en_US.json with American spellings (color, analyze, etc.)
- Add en_AU.json for Australian English
- Set BritishEnglish as the bundle default language
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Service with embedded locale files (en, de)
- Auto-detect system language from LANG/LC_* env vars
- Template support for interpolation and pluralization
- Extensible: GUI can load additional translations via LoadFS()
- Global default service with T() shorthand
- Thread-safe with sync.RWMutex
Designed to be extended by core-gui which can import this
package and add GUI-specific translations on top.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PHPUnit 11 returns exit code 1 when xdebug coverage mode isn't set,
even if all tests pass. This caused false failures in the QA pipeline.
Setting XDEBUG_MODE=coverage in the test environment resolves the
warning and ensures tests return exit code 0 on success.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move cmd/core/cmd/* to cmd/* (flatten directory structure)
- Update module path from github.com/host-uk/core/cmd/core to github.com/host-uk/core
- Remove go.mod files from pkg/* (single module now)
- Simplify pkg/mcp to file operations only (no GUI deps)
- GUI features (display, webview, process) stay in core-gui/pkg/mcp
- Fix import aliases (sdkpkg) for package name conflicts
- Remove old backup directory (cmdbk)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move CLI commands into subdirectories matching command hierarchy:
dev/, go/, php/, build/, ci/, sdk/, pkg/, vm/, docs/, setup/, doctor/, test/, ai/
- Create shared/ package for common styles and utilities
- Add new `core ai` root command with claude subcommand
- Update package declarations and imports across all files
- Create commands.go entry points for each package
- Remove GUI-related files (moved to core-gui repo)
This makes the filesystem structure match the CLI command structure,
improving context capture and code organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move SDK generation to `core build sdk` subcommand
- Make `core ci` publish-only (expects artifacts in dist/)
- Add release.Publish() for publishing pre-built artifacts
- Keep `core sdk diff` and `core sdk validate` for API validation
- Update SKILL.md documentation
This separation prevents accidental releases - running `core ci`
without first building will fail safely.
Workflow:
core build # Build binaries
core build sdk # Build SDKs
core ci # Publish what's in dist/
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all Wails-dependent packages to core-gui repo:
- pkg/core, pkg/display, pkg/docs, pkg/help, pkg/ide
- pkg/runtime, pkg/webview, pkg/workspace, pkg/ws
- pkg/plugin, pkg/config, pkg/i18n, pkg/module
- pkg/crypt, pkg/io, pkg/process
Add pkg/errors with simple E() helper for error wrapping.
Update go.work to only include CLI-relevant packages.
CLI now builds with CGO_ENABLED=0 - no linker warnings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create new pkg.go with search, install, list, update, outdated subcommands
- Remove separate search.go and install.go files
- Update root.go to use AddPkgCommands instead of individual commands
- Update skill documentation with pkg commands in quick reference, decision tree, and common mistakes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add RunSDK function that orchestrates SDK-only releases by:
- Validating config and SDK configuration
- Determining version from git tags or config override
- Running optional breaking change detection via oasdiff
- Generating SDKs for configured languages (unless dry run)
The function supports dry run mode for previewing what would be done
without actually generating SDKs.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add SDKRelease struct to hold SDK release results and toSDKConfig
helper function to convert release.SDKConfig to sdk.Config.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add version field to SDK struct and SetVersion method that updates both
the internal version and the config's Package.Version. This enables the
release system to pass version information to SDK generators.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>