Commit graph

269 commits

Author SHA1 Message Date
Snider
4fa0e0310b refactor(shared): add git status styles and check helpers
Add to shared package:
- Git status styles (dirty/ahead/behind/clean/conflict)
- CheckMark() helper for presence indicators (✓/—)
- Label() helper for key-value labels
- CheckResult() helper for environment check output

Update packages to use new shared utilities:
- cmd/dev: use shared git styles for table cells
- cmd/docs: use CheckMark() and Label() helpers
- cmd/doctor: use CheckResult() and Success()/Error() helpers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 01:09:03 +00:00
Snider
1b76d4c145 refactor(shared): consolidate coverage, priority, and severity styles
Add reusable styles and helpers to shared package:
- Coverage styles (high/med/low) with FormatCoverage() helper
- Priority styles (high/medium/low) with FormatPriority() helper
- Severity styles (critical/high/medium/low) with FormatSeverity() helper

Update packages to use shared styles:
- cmd/test: use shared coverage styles and FormatCoverage()
- cmd/php: use shared status, QA, and severity styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 01:04:29 +00:00
Snider
27a5b948a3 feat(shared): enhance CLI styling with lipgloss utilities
Add comprehensive styling system for consistent DX across commands:

- Tailwind colour palette as named constants (30+ colours)
- Unicode symbols for status indicators, arrows, tree chars
- New styles: InfoStyle, AccentStyle, CodeStyle, NumberStyle, etc.
- Box styles with rounded borders for panels
- Helper functions: Success(), Error(), StatusLine(), KeyValue(), etc.
- Table struct with auto-width column rendering

Also:
- Fix cmd/build to use shared styles instead of duplicating
- Update cmd/dev/dev_health to use StatusLine() helper

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:58:34 +00:00
Snider
a2bad1c0aa refactor(cmd): migrate CLI from clir to cobra
Replace leaanthony/clir with spf13/cobra across all command packages.
This provides better subcommand handling, built-in shell completion,
and a more widely-used CLI framework.

Changes:
- Update cmd/core.go with cobra root command and completion support
- Convert all subcommand packages to use *cobra.Command
- Use init() functions for flag registration instead of inline setup
- Maintain all existing functionality and flag behaviors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:47:54 +00:00
Snider
6d8edeb89c fix(php): set XDEBUG_MODE=coverage for PHPUnit 11 compatibility
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>
2026-01-30 00:28:47 +00:00
Snider
cdf74d9f30 refactor(cmd): split command packages into smaller files
Split all cmd/* packages for maintainability, following the pattern
established in cmd/php. Each package now has:
- Main file with styles (using cmd/shared) and Add*Commands function
- Separate files for logical command groupings

Packages refactored:
- cmd/dev: 13 files (was 2779 lines in one file)
- cmd/build: 5 files (was 913 lines)
- cmd/setup: 6 files (was 961 lines)
- cmd/go: 5 files (was 655 lines)
- cmd/pkg: 5 files (was 634 lines)
- cmd/vm: 4 files (was 717 lines)
- cmd/ai: 5 files (was 800 lines)
- cmd/docs: 5 files (was 379 lines)
- cmd/doctor: 5 files (was 301 lines)
- cmd/test: 3 files (was 429 lines)
- cmd/ci: 5 files (was 272 lines)

All packages now import shared styles from cmd/shared instead of
redefining them locally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:22:47 +00:00
Snider
e4d79ce952 feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing

Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands

QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
Snider
e687dc189c chore: clean up .gitignore by removing unnecessary build artifacts 2026-01-29 23:57:11 +00:00
Snider
b9c5cc52a0 chore: clean up .gitignore by removing unnecessary build artifacts 2026-01-29 20:01:34 +00:00
Snider
654f8df1ad docs: add guides and fix documentation issues
New documentation:
- getting-started.md: installation, first build, first release
- troubleshooting.md: common errors and fixes
- workflows.md: end-to-end task sequences
- glossary.md: term definitions
- migration.md: upgrading from legacy tools

Fixes:
- Command examples: core dev task* → core ai task*
- CI flag: --were-go-for-launch → --we-are-go-for-launch
- Setup commands: core health → core dev health
- Installation: circular core go install reference
- Cross-references: broken fragment links

Improvements:
- Added complete repos.yaml documentation
- Added comprehensive environment variables reference
- Added multiple installation methods (go install, binary, source)
- Moved TODO.md to docs/.internal/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:59:49 +00:00
Snider
363f12f4da docs: move inline YAML to example.md files with fragment links
- Remove inline YAML from all index.md files
- Add fragment links to corresponding example.md sections
- Create ai/example.md for workflow examples
- Add missing configs to example.md files (test.yaml, php.yaml, etc)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:20:34 +00:00
Snider
f44ffe6f11 docs: add generated config examples to setup docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:13:22 +00:00
Snider
4f15b304fa docs: update TODO.md with recent changes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:10:15 +00:00
Snider
9565122fdc feat(cli): implement setup wizard, fix ai examples, ci dry-run flag
Setup command now has three modes:
- Registry mode: interactive wizard to select packages
- Bootstrap mode: clones core-devops first, then wizard
- Repo setup mode: generates .core/{build,release,test}.yaml

Changes:
- setup: add interactive package selection with charmbracelet/huh
- setup: detect project type (go/php/node/wails) and generate configs
- setup: auto-detect GitHub repo from git remote
- ai: fix command examples (core dev -> core ai)
- ci: rename flag to --we-are-go-for-launch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 19:09:51 +00:00
Snider
996fae70f4 docs: sync php, pkg, vm with CLI, update coverage tracking
- php: comprehensive rewrite with all 20+ subcommands documented
- pkg: added full documentation with flags and examples
- vm: added examples and detail for all commands
- TODO.md: updated to show current coverage (12/13 at 100%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:39:10 +00:00
Snider
61cbf2bded docs: add ai command docs, update CLI structure
- Create docs/cmd/ai/index.md with full task management documentation
- Add ai command to main docs/cmd/index.md command list
- Update docs/cmd/dev/index.md to point to ai for task commands
- Update TODO.md to reflect current documentation state

Task commands (tasks, task, task:update, task:complete, task:commit, task:pr)
have moved from dev to ai package.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:34:49 +00:00
Snider
1f452c6602 docs: update package docblocks across all cmd/ packages
Add comprehensive package-level documentation to all CLI command packages:
- cmd/core.go, core_ci.go, core_dev.go: Main CLI entry points
- cmd/shared: Lipgloss styles and utility functions
- cmd/ai: AI agent task management and Claude integration
- cmd/dev: Multi-repo git workflows and GitHub integration
- cmd/build, cmd/ci: Build and release automation
- cmd/sdk: OpenAPI validation and compatibility
- cmd/go: Go development tools with enhanced output
- cmd/php: Laravel development, build, and deployment
- cmd/docs: Documentation sync across repos
- cmd/doctor: Environment validation
- cmd/test: Test runner with coverage
- cmd/pkg: GitHub package management
- cmd/setup: Workspace initialisation
- cmd/vm: LinuxKit VM management

Each docblock now describes:
- Package purpose and commands
- Key features and configuration
- Package naming notes where relevant (gocmd, testcmd)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:27:33 +00:00
Snider
f128f79536 refactor: rename root.go to core.go, commands_*.go to core_*.go
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:16:48 +00:00
Snider
d71dc3c935 chore: update CLI description to 'CLI tool for development and production'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:15:22 +00:00
Snider
d2c0553b6d refactor: flatten CLI to root, simplify pkg/mcp for CLI-only use
- 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>
2026-01-29 18:13:51 +00:00
Snider
9add6cf2ee refactor(cli): restructure cmd packages into subdirectories
- 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>
2026-01-29 18:02:43 +00:00
Snider
76872efbd7 docs: complete CLI documentation sync
- pkg search: add --pattern, --type, --refresh, --limit, --org flags
- sdk: remove generate (use core build sdk), keep only diff/validate
- vm run: add --ssh-port, --name, fix defaults
- TODO.md: all gaps resolved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:27:39 +00:00
Snider
78cb2b3507 docs: sync php, pkg, setup, doctor, test with CLI
- php: add serve flags, packages subcommands, all commands
- pkg: fix description (GitHub repos not Go modules), add --add flag
- setup: replace --path/--ssh with --dry-run/--only
- doctor: add --verbose flag
- test: full documentation with all flags and JSON output
- Cleaned up TODO.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:26:27 +00:00
Snider
ea9d735a99 chore: remove binaries from tracking, update gitignore
bin/ should never be committed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:19:28 +00:00
Snider
a92df56fd1 docs: sync core build with CLI
- Added from-path and pwa subcommands
- Added missing flags (--archive, --checksum, --config, --format, --push)
- Updated build sdk with --dry-run and --version flags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:17:00 +00:00
Snider
dea8f59c10 docs: sync core dev and core go with CLI
Updated by technical writer agents:
- core dev: added task management, api, sync, ci commands
- core dev: fixed all flag discrepancies
- core go: added work subcommands (init, sync, use)
- core go: added missing flags (--json, --check, --open, --threshold)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:10:23 +00:00
Snider
ab1a808657 docs: add TODO.md with CLI vs documentation gaps
Generated by comparing `core --help` output against docs.
Lists missing commands, flags, and discrepancies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:03:06 +00:00
Snider
32c465b67f docs: add templates vars section and --wait flag
- Document core vm templates vars command
- Add --wait flag example for php deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:58:00 +00:00
Snider
b51d85e3dd docs: fix sdk description to include generation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:54:20 +00:00
Snider
03ab4c1704 docs: add missing commands and fix sdk release integration
- Add vars command to vm/templates
- Add ssl command to php
- Fix sdk release integration (remove non-existent --target flag)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:51:51 +00:00
Snider
bdfb089fd3 docs: fix --dir to --path in setup example
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:48:07 +00:00
Snider
13561b1de6 docs: fix command prefixes across documentation
- core search → core pkg search
- core install → core pkg install
- core templates → core vm templates
- core run → core vm run
- --target → --output in docs sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:46:24 +00:00
Snider
cf843d59de docs: remove ambiguous core dev ci from example
core ci is for releases, not CI status checking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:42:43 +00:00
Snider
c34b256aaf docs: fix core dev prefixes in setup After Setup section
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:41:33 +00:00
Snider
5652b6b508 docs: fix command prefixes - use 'core dev' not 'core'
Multi-repo commands are under 'core dev':
- core dev work, core dev health, core dev commit, etc.

Not root-level commands.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:40:13 +00:00
Snider
c3d85eb948 docs: clarify dev command scope
- dev is for portable LinuxKit environment, not multi-repo commands
- Multi-repo commands (work, health, commit, etc.) are root-level
- Added See Also link to work/ for multi-repo docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:35:06 +00:00
Snider
5c4b8dd8c1 docs: fix broken subcommand links in pkg and dev indexes
Commands documented inline don't need directory links.
Only link to directories that actually exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:30:50 +00:00
Snider
059a0ba897 docs: fix broken links and update command references
- Update docs/index.md with correct directory links
- Fix relative path errors in subcommand docs
- Update core release → core ci references
- Expand vm/index.md with full command documentation
- Fix See Also sections across all docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:18:13 +00:00
Snider
01d34e1525 docs: add Claude Code skill installation guide
Hidden knowledge = dead code + bad DX

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:10:25 +00:00
Snider
124a36935c fix(skill): update install.sh echo from release to ci
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:08:50 +00:00
Snider
77a7237d71 refactor: move plans to tasks/, framework docs to core-gui
- plans/ → tasks/plans/ (planning documents)
- framework/ → core-gui/docs/framework/ (GUI framework docs)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:01:46 +00:00
Snider
8601e5b355 docs: add example.md files for all CLI commands
Each command directory now has both index.md (reference) and
example.md (usage examples and configuration samples).

Also adds exception for docs/cmd/build in .gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:58:54 +00:00
Snider
eed8a030f1 docs: add example.md files and ci subcommands
- Add example.md alongside index.md for config/usage samples
- Add ci subcommands: init, changelog, version
- Fix ci/index.md to reference correct commands (was release)
- Update references from config.md to example.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:54:44 +00:00
Snider
ace6306233 docs: restructure cmd docs to mirror CLI hierarchy
- Convert flat .md files to index.md in subdirectories
- Add subcommand directories (go/test, go/cov, build/sdk, etc.)
- Update dev/index.md to include multi-repo commands
- Structure now mirrors: core <cmd> [subcmd] → docs/cmd/<cmd>/<subcmd>/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:46:31 +00:00
Snider
c9ebb7c781 test: increase coverage to 63.8% across packages
Coverage improvements:
- pkg/build: 89.4%
- pkg/release: 86.7% (from 36.7%)
- pkg/container: 85.7%
- pkg/php: 62.1% (from 26%)
- pkg/devops: 56.7% (from 33.1%)
- pkg/release/publishers: 54.7%

Also:
- Add GEMINI.md for Gemini agent guidance
- Update .gitignore to exclude coverage files
- Remove stray core.go at root
- Add core go cov command for coverage reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:28:23 +00:00
Snider
50f6839c51 test: increase coverage across packages
- pkg/container: 65.6% → 85.7% (hypervisor, linuxkit, templates tests)
- pkg/release/publishers: 13.3% → 41.7% (homebrew, aur, npm, scoop, chocolatey tests)
- Fix flaky test cleanup in TestLinuxKitManager_Stop_Good_ContextCancelled

Overall coverage: 29.2% → 40.6%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:19:08 +00:00
Snider
a7ee58d29e feat(cli): add core go cov command
- Add `core go cov` for coverage reports
- Generate HTML report with --html
- Open in browser with --open
- Fail on threshold with --threshold 80
- Colour-coded coverage output
- Update SKILL.md documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:07:46 +00:00
Snider
5b0a0eac7c feat(cli): add core go install command
- Add `core go install` for installing Go binaries
- Auto-detects cmd/ subdirectories
- Optional --no-cgo flag for pure Go builds
- Shows install location on success
- Update SKILL.md documentation

Dogfood the CLI daily for better DX.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:01:54 +00:00
Snider
f887c4b049 feat(cli): make core ci dry-run by default
- Default behavior is now dry-run (safe)
- Add --were-go-for-launch flag to actually publish
- Update help text to make this clear
- Update SKILL.md documentation

Now you must explicitly opt-in to publishing:
  core ci                        # Preview (dry-run)
  core ci --were-go-for-launch   # Actually publish

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:50:41 +00:00
Snider
331032cd57 refactor(cli): separate build and publish concerns
- 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>
2026-01-29 12:48:28 +00:00