Commit Graph
511 Commits
Author SHA1 Message Date
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
Willie e54d469d63 style(doctor): add visual break before skill validation checks
Separate the environment checks (config, source, skillignore, git)
from the skill validation checks (integrity, targets) with a blank
line for better readability.
2026-03-18 00:19:30 +08:00
Willie af143a3330 fix(doctor): add CLI text output for skillignore check
checkSkillignore only wrote to the JSON result but never printed
to the terminal, so skillignore status was invisible in CLI output.
2026-03-18 00:19:30 +08:00
Willie 49cd7c8433 fix(sync): truncate duplicate skill names to first 5 + count
The collision report dumped all 14000+ duplicate names on a single
line, making the sync output unreadable. Show the first 5 names
with "... and N more" so users can see examples without the flood.
2026-03-18 00:19:30 +08:00
Willie 8f19fb098a fix(server): force -g flag on doctor subprocess in global mode
The doctor handler shells out to the CLI binary. In global mode it
did not pass -g, so the subprocess auto-detected project mode when
the server's cwd contained .skillshare/config.yaml. This caused
the doctor to check the project source instead of the global source.
2026-03-18 00:19:30 +08:00
Willie d8b1323123 fix(sync): use correct plural for repo-level .skillignore file count 2026-03-18 00:19:30 +08:00
Willie a8dc4972ac fix(sync): show .skillignore source hint in CLI output
Extract printIgnoredSkills helper that shows whether ignores come from
root-level, repo-level, or both .skillignore files. Helps users
understand why skills are excluded when they haven't configured the
root .skillignore.
2026-03-18 00:19:30 +08:00
Willie 071731485e feat(sync): show .skillignore ignored skills in CLI text and JSON output
Switch DiscoverSourceSkills → DiscoverSourceSkillsWithStats at both
global and project sync entry points. Thread IgnoreStats through to
text output (dim-styled list) and JSON output (ignored_count +
ignored_skills fields).
2026-03-18 00:19:30 +08:00
Willie f64fffef08 feat(status): show .skillignore info in text and JSON output
Surface .skillignore visibility in the status command so users can
see active patterns and how many skills are being ignored without
needing to run doctor.

Text output shows an indented line under Source when .skillignore
exists; JSON output adds a skillignore object inside source with
active flag, file paths, patterns, and ignored skill details.
2026-03-18 00:19:30 +08:00
Willie 13a82e335e feat(doctor): add info status and skillignore check
Add checkInfo status constant for informational (non-pass/warn/error)
doctor checks. Info checks count toward total but are tracked separately
in the summary.

Add checkSkillignore to doctor: reports .skillignore state as either
info (no .skillignore found) or pass (active with pattern/ignored counts
and details). Switches discovery from DiscoverSourceSkills to
DiscoverSourceSkillsWithStats to collect .skillignore statistics in the
same walk.
2026-03-18 00:19:30 +08:00
Willie 9c0a13734c fix(doctor): skip local skills silently, only warn on incomplete meta
Skills without .skillshare-meta.json are local/manual — silently skip
instead of warning. Only warn when meta exists but file_hashes is
missing (old installs). List affected skill names in the warning.
2026-03-18 00:19:30 +08:00
Willie 63370dfdea refactor(doctor): extract finalizeDoctorJSON helper and add status constants
- Extract 14-line duplicated JSON output block from cmdDoctorGlobal and
  cmdDoctorProject into shared finalizeDoctorJSON() function
- Define checkPass/checkWarning/checkError constants replacing 42 string
  literals across all addCheck() call sites
- Add TODO comment in server handler noting intent to move check logic
  into internal/ package
2026-03-18 00:19:30 +08:00
Willie ce707455fa feat(doctor): add --json structured output for CI pipeline consumption
Add `--json` flag to `skillshare doctor` that outputs structured JSON with
per-check results, summary counts, and version info. Errors produce exit 1,
warnings exit 0. Uses suppressUIToDevnull() to silence text output in JSON mode.
2026-03-18 00:19:30 +08:00
Willie 11f696cffe fix(server): upgrade Mutex to RWMutex for concurrent read safety
Addresses PR #82 review: read-only handlers accessed s.cfg without
synchronization, risking data races with concurrent config reloads.

- Upgrade sync.Mutex → sync.RWMutex (drop-in compatible)
- Add RLock to 26 non-streaming read handlers
- Keep exclusive Lock for write handlers (unchanged)
- Skip SSE streaming handlers to avoid blocking writes during streams
- Fix isConfigGitignored to propagate GitignoreContains errors
2026-03-17 04:48:42 +08:00
Willie f7866b44ef fix(tui): reorder help bar to match convention — navigate, filter, scroll, actions, quit 2026-03-17 04:48:42 +08:00