Commit Graph
525 Commits
Author SHA1 Message Date
Willie ffdded311f feat(analyze): add --filter flag with filtered_summary in JSON output
Support case-insensitive substring filter on skill relPath.
When --filter is set, JSON output includes filtered_summary with
always_loaded, on_demand, and total token counts for matched skills.

Ref: Discussion #99
2026-03-26 23:47:28 +08:00
Willie eabb556cc6 refactor(config): cache SourceRoot in Config.RegistryDir
Eliminates redundant .git/ directory walks on every LoadRegistry call.
SourceRoot() is now computed once in config.Load() and cached in
cfg.RegistryDir. All 11 call sites use the cached value.
2026-03-26 23:32:15 +08:00
Willie a7de6a3a69 feat(registry): move registry.yaml to source dir for git sync (#103)
- Add SourceRoot() helper to find git repo root from cfg.Source
- Add MigrateRegistryToSource() for one-time migration
- Update all 11 global-mode LoadRegistry/Save call sites
- registry.yaml now lives in skills/ dir and is tracked by git
2026-03-26 22:42:00 +08:00
Willie 3a978e17d2 fix(init): skip skill prompt when remote has skills (#102)
setupGitRemote now returns bool indicating remote had skills.
When true, skip installSkillIfNeeded — user will get skills
via 'skillshare pull' instead of being prompted.
2026-03-26 22:31:35 +08:00
Willie 64ed9b046e feat(analyze): add malformed-frontmatter lint rule and polish UI/TUI
- Surface YAML parse errors from calcContextFromContent as a new
  "malformed-frontmatter" lint issue instead of silently ignoring them
- Fix help text to say "Top 10" (was "Top 5") matching actual constant
- Shorten TUI list title to target name only; move skill count to
  stats line so the header no longer wraps on narrow terminals
- Truncate long skill names in TUI to keep token counts visible
- Change "All Skills" icon block to green (matches Skills summary card)
2026-03-26 19:20:52 +08:00
Willie f7e04f1961 docs: add v0.18.0 changelog, release notes, and analyze docs
Add CHANGELOG and website changelog entries for v0.18.0 covering
the new analyze command, skill quality lint, TUI, Web UI Analyze
page, and Update page improvements.

Update analyze.md with lint rules table, quality section, and
updated JSON output example. Add analyze to built-in skill
description and Quick Lookup table. Bump skill version to v0.18.0.

Fix TUI list title to show skill count in stats line instead of
title, and truncate long skill names to keep token count visible.
2026-03-26 19:20:52 +08:00
Willie d377e6bbf6 refactor(analyze): simplify lint engine and fix review findings
- Eliminate double YAML parse: extend calcContextFromContent to return
  name, remove parseFrontmatterName helper
- Pre-compute lint icons (lintIconError/lintIconWarning) to avoid
  lipgloss.NewStyle() allocation per render frame
- Use tc.Red/tc.Yellow for Quality section icons (consistency)
- Extract check type string constants (checkFieldEmpty, etc.)
- Panic on embedded rule load failure instead of silent nil return
- Rename "Targets: all" to "Restricted to" (only shown when set)
- Fix struct field alignment (gofmt)
2026-03-26 19:20:52 +08:00
Willie 10415a72f7 feat(analyze): add Quality section and lint icons to TUI 2026-03-26 19:20:52 +08:00
Willie deb834ce99 refactor(analyze): remove Context category bar from TUI 2026-03-26 19:20:52 +08:00
Willie 57ce3f507f feat(analyze): wire lint into discovery and analyze data flow
Populate LintIssues during skill discovery (collectContext path) and
propagate them through analyzeSkillEntry so JSON output includes lint
findings per skill.
2026-03-26 19:20:52 +08:00
Willie bb30924e05 refactor(analyze): merge identical targets into groups in TUI
Targets with no include/exclude filters share the same skill set, so
showing them individually is redundant and causes layout overflow.

Group targets by (SkillCount, AlwaysLoaded, OnDemandMax) into
analyzeTargetGroup entries. Title shows "N targets" instead of listing
all names. Target bar is hidden when only one group exists.
2026-03-26 19:20:52 +08:00
Willie 78ba5c7282 refactor(analyze): polish TUI rendering and add docs
- Fix nil pointer panic when WindowSizeMsg arrives before data loaded
- Fix TestAnalyze_Verbose: create 12 skills to match analyzeTopN=10
- Unify left panel with shared renderPrefixRow (▌ prefix bar style)
- Right-align token counts in skill list rows
- Pre-compute colored dots to avoid per-render lipgloss allocations
- Add category tab bar at top for future analysis categories
- Improve target bar separator (│ → ·) and footer spacing
- Extract renderFooter to eliminate viewSplit/viewVertical duplication
- Add analyze command reference page and sidebar/index entries
2026-03-26 19:20:52 +08:00
Willie 42dd4e4882 test(analyze): add sort cycling and target switch unit tests 2026-03-26 19:20:52 +08:00
Willie e88c32bcbc feat(analyze): implement interactive TUI with target switching and detail panel 2026-03-26 19:20:52 +08:00
Willie 439abbdea1 feat(analyze): add TUI list delegate with color dots and bar chart 2026-03-26 19:20:52 +08:00
Willie a636fc6f85 feat(analyze): add --no-tui flag and TUI dispatch 2026-03-26 19:20:52 +08:00
Willie 956a719c32 feat(analyze): add TUI-only fields to analyzeSkillEntry 2026-03-26 19:20:52 +08:00
Willie 620141af2b feat(analyze): add context analysis command
Analyze context window usage per target, showing always-loaded
(description) vs on-demand (body) token costs.

- Single-pass discovery with frontmatter-aware char/token counting
- Per-target filtering (include/exclude/symlink mode)
- Unified output when all targets have identical skills
- Verbose mode shows top 10 largest descriptions
- Project mode (-p) support
- JSON output (--json)
- Integration tests
2026-03-26 19:20:52 +08:00
Willie 580ad58dd3 fix(extras): remove leading whitespace from extras list output 2026-03-25 21:14:16 +08:00
Willie 6d0ba75e72 feat(extras): --flatten/--no-flatten applies to all targets when --target is omitted
For multi-target extras, ss extras agents --flatten now sets flatten
on all targets at once instead of requiring --target. Mode changes
still require --target for multi-target extras.
2026-03-25 21:14:16 +08:00
Willie 1d50d95459 feat(extras): add F flatten toggle to extras list TUI
Press F to toggle flatten on/off for a target. Single-target extras
toggle directly; multi-target extras show a target picker first.
Shows "Flatten enabled/disabled" confirmation message.
2026-03-25 21:14:16 +08:00
Willie bda34d27af docs(cli): mention flatten in extras help text 2026-03-25 21:14:16 +08:00
Willie 59675b3a3b fix(extras): shorthand dispatch recognizes --flatten/--no-flatten
extras <name> --flatten and extras <name> --no-flatten were rejected
as "unknown subcommand" because the shorthand dispatch only checked
for --mode. Now recognizes all three flags.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie 2ce1544dd1 docs: add flatten documentation, changelog, and contributor
Extras command docs, config reference, built-in skill, website
changelog, release notes. Add mk-imagine to README contributors.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie 41ffe1dfc1 feat(extras): add --flatten to CLI commands and TUI wizard
extras init --flatten, extras mode --flatten/--no-flatten, extras list
flatten indicator. TUI wizard adds flatten toggle phase after mode
selection (skipped for symlink). Back-navigation updated.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie 5d9dd0cdbb feat(extras): add flatten option to extras sync engine
When flatten=true, SyncExtra maps subdirectory files to target root
using filepath.Base(). First file wins on collision, subsequent are
skipped with warnings. Includes config validation, sync-time guard,
CheckSyncStatus collision handling, and CollectExtraFiles support.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie 5a0a8753d0 fix(test): update extras source-not-exist test for auto-create behavior
Sync now auto-creates missing extras source directories instead of
failing with "does not exist". Update the assertion to match.
2026-03-20 02:36:50 +08:00
Willie 34819c664b fix(ui): fix TypeScript build errors for tsc -b strict mode
- Add explicit undefined initial value to all useRef<setTimeout>
  calls (5 hooks) — tsc -b requires initial argument
- Remove unused ValidationError import in test file
2026-03-20 02:36:50 +08:00
Willie e276c95a04 fix(cli): add --source flag to extras init help text
The --source flag was functional but missing from the help output.
Also add source directory resolution priority to the main extras
help for discoverability.
2026-03-20 02:36:50 +08:00
Willie 5aa6ee8450 feat: configurable extras source with 3-level priority
Add extras_source (global default) and per-extra source (override)
to config.yaml. Resolution: per-extra > extras_source > default.

- Config: add ExtrasSource and ExtraConfig.Source fields with tilde expansion
- New ResolveExtrasSourceDir() replaces hardcoded ExtrasSourceDir()
- Migrate all 18 caller files to new resolver and sourceFunc signature
- CLI: extras init --source flag, help text
- TUI: source input phase in init wizard, narrower list panel
- extras list: source_type field in JSON, label in TUI detail
- Sync auto-creates missing source dirs instead of skipping
- extras init and server auto-backfill extras_source when missing
- doctor/status/diff/collect all use resolved source path
2026-03-20 02:36:50 +08:00
Willie 8c0e97ac13 feat: add remove action (R key) to target list TUI
Press R on a selected target to show a confirmation overlay.
Confirming exits the TUI and dispatches the full target remove
flow (backup + unlink + config update), matching the existing
exit-with-action pattern used by the skill list TUI.

Supports both global and project modes.
2026-03-19 16:33:24 +08:00
Willie dc82b93d05 fix: address code review findings for auto-create target dirs
- Remove early return in dry-run so linked/copied counts are populated
  correctly (P1: UI preview no longer hides Sync Now button)
- Use local quietDryRun flag instead of mutating global DiagOutput
  to suppress per-skill messages (P2: safe under parallel sync)
- Use "Will create" for dry-run, "Created" for actual sync (P3)
- Include dir_created in allUpToDate check so empty source + missing
  dir still shows Sync Now in the preview modal
2026-03-19 04:16:36 +08:00
Willie 643e3c5c07 fix: auto-create missing target directories with notification (#87)
v0.17.5 blocked sync when target directories didn't exist, which
prevented first-time users on fresh CLI installs from syncing.

Sync now auto-creates missing directories and reports what it did
in CLI output, dry-run preview, and the Web UI. Init also creates
target directories when it detects an installed CLI tool.

Web UI: Sync Preview modal stays open after sync with a success
banner instead of immediately closing, so users can review results.

Closes #87
2026-03-19 03:57:08 +08:00
Willie 2eb6a79670 fix: address code review findings from simplify pass
- Add cleanup (os.RemoveAll) on scaffold dir creation failure
- Use skill.ValidNameRe in isValidSkillName (remove duplicate regex)
- Derive canAdvance from nameError instead of re-calling validateName
- Remove redundant total param from ProgressBar (derive from steps.length)
- Fix popstate handler to read event.state.step directly
- Use Plus icon for PageHeader (icon prop is required)
2026-03-18 22:35:02 +08:00
Willie 22efeea924 refactor: extract skill templates to internal/skill package
Move pattern/category definitions and template generation logic from
cmd/skillshare/new_templates.go to internal/skill/ so both the CLI and
the web UI server can import them. The CLI file becomes thin wrappers
with type aliases to keep new_tui.go and new.go unchanged.
2026-03-18 22:35:02 +08:00
Willie 6b3858620f feat(skillignore): add .skillignore.local for local pattern overrides
Allow users to override shared .skillignore patterns without modifying
the committed file. ReadMatcher transparently merges .skillignore +
.skillignore.local (local appended last so !negation rules win).

- Matcher.HasLocal flag tracks .local presence for CLI reporting
- IgnoreStats gains RootLocalFile, RepoLocalFiles, HasLocal() method
- sync/status/doctor show ".local active" indicator
- 6 unit tests + 2 integration tests
- Docs: file-structure, sync, status, doctor, best-practices, creating-skills, org-sharing
2026-03-18 22:35:02 +08:00
Willie 93a3067c76 refactor(tui): move wizard breadcrumbs to help bar footer
Compact single-line format: "✓ reviewer → quality" appended to
the help bar instead of a multi-line header above the list.
2026-03-18 22:35:02 +08:00
Willie c9624df637 feat(tui): add header field to checklist for wizard breadcrumbs
Breadcrumbs now render as a dedicated header area above the list,
separate from the title. This prevents title truncation and keeps
the layout clean.
2026-03-18 22:35:02 +08:00
Willie efdd6366de fix(new): show wizard breadcrumbs inside TUI title instead of terminal 2026-03-18 22:35:02 +08:00
Willie 650065393e feat(new): show breadcrumbs of previous selections in wizard steps 2026-03-18 22:35:02 +08:00
Willie 4f6ae5ad33 feat(new): add wizard back-navigation (Esc returns to previous step) 2026-03-18 22:35:02 +08:00
Willie 6fa73ae91b fix(new): handle .gitkeep write error instead of ignoring it 2026-03-18 22:35:02 +08:00
Willie ffa5dba66b feat(new): add TUI prompts and integrate -P flag into new command 2026-03-18 22:35:02 +08:00
Willie 935752bfc9 feat(new): add pattern/category definitions and template generators 2026-03-18 22:35:02 +08:00
Willie f0e164ce9c refactor: simplify base path code after review
- Export NormalizeBasePath and reuse in ui.go (eliminate duplication)
- Use json.Marshal for safe __BASE_PATH__ injection (prevent XSS)
- Always cache index.html at startup (avoid per-request disk reads)
- Extract shared BASE_PATH module in frontend (single source of truth)

Ref: #85
2026-03-18 22:35:02 +08:00
Willie 04f65e5320 feat(cli): add --base-path flag and SKILLSHARE_UI_BASE_PATH env var to ui command
Allows serving the UI under a URL prefix (e.g., skillshare ui --base-path /app).
The flag value is passed through to the server constructors and used for
browser URL construction. Falls back to SKILLSHARE_UI_BASE_PATH env var
when the flag is not provided.
2026-03-18 22:35:02 +08:00
Willie 10444eef3f feat(server): add basePath support for reverse-proxy sub-path hosting (#85)
Add normalizeBasePath + wrapBasePath to Server so the UI and API can be
served under a URL prefix (e.g. /app). StripPrefix wraps outside
withConfigAutoReload; bare-path requests redirect to path + "/".
Dev mode (no uiDistDir) prints a warning and skips wrapping.

Includes HTTP routing tests for prefix routing, 404 without prefix,
bare-path redirect, multi-level paths, and empty basePath passthrough.
2026-03-18 22:35:02 +08:00
Willie 92603f5be6 feat: add config save validation and sync safety checks
Validate config semantics (source path, sync modes, target paths) at
save time (API + CLI) instead of failing at sync time with cryptic
errors. Sync no longer auto-creates missing target directories — fails
fast to catch typos like ~/.cusor/skills. Dry-run also validates paths.

- ValidateConfig / ValidateProjectConfig with warnings + errors
- handlePutConfig returns 400 for invalid configs, 200 + warnings
- handleSync pre-checks via ValidateConfig
- ensureRealTargetDir shared helper (replaces duplicated blocks)
- UI: warning toast on config save, warning banners on sync/preview
- Dashboard shows full absolute source path
2026-03-18 22:35:02 +08:00
Willie 4d2d540127 refactor: simplify ignore payload and deduplicate formatting
- Remove dead nil check in ignorePayload() (repoFiles already initialized)
- Replace manual map merge loops with maps.Copy in 3 handler sites
- Deduplicate fmt.Sprintf + ui.Success in doctor checkSkillignore
- Extract extractIgnoreSources() helper in SyncPage to DRY two identical
  state-setting blocks
2026-03-18 00:19:30 +08:00
Willie 33cc974210 style(doctor): add blank line after config directory info
Visually separate config paths from source/skillignore/git checks
for better readability in the Checking environment section.
2026-03-18 00:19:30 +08:00