Commit Graph
1620 Commits
Author SHA1 Message Date
Willie ffbf15e702 chore: release v0.19.16 v0.19.16 2026-05-21 15:34:35 +08:00
Willie caf22760b3 docs: global config sources map (Phase 7)
- CHANGELOG.md + website changelog: Unreleased entry for v0.19.16
  covering the global `sources:` map feature plus the two behavior
  changes (extras init no longer silently backfills extras_source;
  extras source command writes to whichever field the user already
  configured).
- website/docs/understand/source-and-targets.md: add "Custom Source
  Directories" section for global mode mirroring the project-mode
  writeup, with examples, backward-compat notes, and a cross-link to
  the project-skills page.
2026-05-21 15:13:36 +08:00
Willie 7de9fa4fb0 test(e2e): add global sources map ↔ legacy fields interop runbook
Six-step mdproof runbook exercising the v0.19.16 global sources map:

1. Fresh init -g writes sources: map (no legacy source/agents_source/extras_source)
2. Legacy-only config (source: + agents_source:) — ss list still works
3. New sources map (sources.skills + sources.agents) — ss list works
4. Mixed config — sources.skills wins over legacy source
5. ss sync writes to a custom target with sources.skills set
6. ss sync rejects configs that set neither source nor sources.skills

Runs in 0.9s and prevents regressions on either format.

Also: record an mdproof lessons-learned entry for `ss sync --json`
output — it has no top-level `.errors` field; assert `.linked` /
`.details` or rely on exit_code instead.
2026-05-21 15:08:40 +08:00
Willie 8e0117a29d feat(init): emit sources map for new global configs (Phase 4)
Fresh `skillshare init` (global) now writes the v0.19.16 `sources:` map
instead of the legacy top-level fields:

  sources:
    skills: ~/.config/skillshare/skills
    agents: ~/.config/skillshare/agents

What changed:
- cmd/skillshare/init.go: construct Config with Sources{Skills, Agents}
  rather than Source/ExtrasSource. The --subdir update path writes to
  cfg.Sources.Skills accordingly. The --remote re-init path uses
  cfg.EffectiveSkillsSource() for git operations so it works whichever
  shape the existing config uses.
- internal/config/config.go: add `,omitempty` to Source field so configs
  that only set sources.skills don't get a noisy `source: ""` line.
- tests/integration/extras_test.go: rename TestInit_SetsExtrasSource to
  TestInit_WritesSourcesMap and assert the new shape (sources map
  present, legacy source/extras_source/agents_source absent).

Existing configs are untouched — legacy fields keep working through
Config.Effective*Source helpers. No auto-migration on Save.
2026-05-21 14:54:24 +08:00
Willie 996d00e342 feat(config): migrate consumers to Effective*Source helpers (Phase 3+5)
Make the v0.19.16 sources map actually do something: route all path
reads through Config.EffectiveSkillsSource() / EffectiveAgentsSource() /
EffectiveExtrasSource() so users who set sources.skills / sources.agents /
sources.extras get the configured paths everywhere.

Mechanical changes (~50 files):
- cmd/skillshare/**: replace cfg.Source / cfg.ExtrasSource reads with
  cfg.EffectiveSkillsSource() / cfg.EffectiveExtrasSource()
- internal/server/**: replace s.cfg.Source / s.cfg.ExtrasSource reads
  with the same helpers; server.skillsSource() / gitignoreDir() use the
  global-mode helper
- internal/config/config_validate.go: validate using EffectiveSkillsSource
  while still rejecting configs that set neither field explicitly
- internal/config/reconcile.go, registry.go: read via helpers

Behavioral fixes (paired with the migration):
- extras init / extras source / POST /api/extras no longer silently
  backfill the legacy extras_source field — the runtime fallback inside
  EffectiveExtrasSource() handles it. This stops surprise diffs in users'
  config.yaml after running extras commands.
- extras source command writes back to whichever field the user already
  configured (sources.extras if set, otherwise legacy extras_source) so
  the update is not shadowed.
- source_type in /api/extras and extras list correctly reports "default"
  vs "extras_source" by inspecting the raw (unresolved) configured value;
  sources.extras counts as configured for this purpose.

UI:
- ui/src/lib/fieldDocs.ts: neutralize sources / sources.* descriptions
  so they describe both project and global modes (Phase 5).

Preserved (intentional):
- Direct writes to cfg.Source / cfg.AgentsSource / cfg.ExtrasSource in
  init, migrate.go, cloneForSave, and server.reloadConfig — these are
  raw-field writes, not path reads.
- Updated test expectations for the removed backfills.
2026-05-21 14:49:11 +08:00
Willie 2b802012c4 feat(config): add sources map to global config (Phase 1)
Mirror project-mode `sources:` map (v0.19.15) on the global Config:

- GlobalSources struct with Skills/Agents/Extras fields (all omitempty)
- Sources field on Config (yaml: sources, omitempty)
- EffectiveSkillsSource(), EffectiveExtrasSource() helpers
- EffectiveAgentsSource() now prefers Sources.Agents over the legacy
  AgentsSource field before falling back to <BaseDir>/agents
- Load(): expand ~ in cfg.Sources.* (and AgentsSource, previously missed)
- cloneForSave(): fold $HOME → ~ in cfg.Sources.* for tilde-preserving saves
- RegistryDir cache uses EffectiveSkillsSource() so configs with only
  sources.skills (no top-level source:) still resolve a registry root

Schema:
- Add top-level sources property with skills/agents/extras sub-keys
- Mark source/agents_source as legacy in their descriptions
- Drop required:[source] (new configs can use sources.skills only)

Legacy source/agents_source/extras_source fields are retained
unchanged for backward compatibility. Caller migration to the new
helpers is deferred to a later commit.
2026-05-21 14:30:14 +08:00
Willie a0d5b561dd docs(ui): add sources map entries to fieldDocs for ConfigPage assistant 2026-05-21 13:57:58 +08:00
Willie 8b579ef7be docs: add @aestilog to contributors
Submitted the proposal (#153) for custom project source directories
that shipped in v0.19.15.
2026-05-20 19:09:27 +08:00
Willie aba6f0c787 docs(proposal): mark #153 as shipped in v0.19.15
Adds Status block documenting what actually shipped (sources map only,
no source shorthand) and resolves the two Open Questions (external
gitignore: leave to repo; init -p --source flag: deferred).
2026-05-20 19:06:56 +08:00
Willie 9aee526ba3 chore: release v0.19.15 v0.19.15 2026-05-20 18:52:12 +08:00
Willie 1809fd491d docs(changelog): add v0.19.15 entry for custom sources feature 2026-05-20 18:42:03 +08:00
Willie b1907cd611 docs: document custom project source directories
- Add 'Custom Source Directories' section to project-skills.md covering
  the sources map, common layouts, and constraints (no target alias,
  external paths skip gitignore, .skillshare/ for ops dirs, init seeds
  default paths).
- Add troubleshooting entries for the two new error classes: malformed
  project config (fail-closed) and source/target path overlap.
2026-05-20 18:39:16 +08:00
Willie 906ede81e0 test: add integration coverage for fail-closed and source/target overlap
- 3 malformed-config tests verify uninstall/new/check abort instead of
  silently using the default .skillshare path
- 1 overlap test verifies sync rejects sources.skills aliasing a
  target path
- Fix pre-existing TestUninstall_AllProject fixture which used
  malformed targets: {} (map, not list) — now caught by fail-closed
  load
2026-05-20 18:34:45 +08:00
Willie 8731554456 fix: fail closed on config load error in agents check
Project-mode 'check agents' previously fell back to .skillshare/agents
when LoadProject failed. With custom sources.agents this could scan
the wrong directory and report green while the configured source is
unchecked. Now returns the load error instead.
2026-05-20 18:28:32 +08:00
Willie bb3745b8f5 fix: reject source/target path overlap and fail closed in check
ValidateProjectConfig now resolves each target's skills/agents path
and rejects configs where a source aliases or nests with any target
path. Without this guard, sources.skills: .claude/skills with a
claude target makes sync --force delete the source.

check -p now returns an error on LoadProject failure instead of
falling back to .skillshare/skills.
2026-05-20 18:24:41 +08:00
Willie 4f908a171e fix: fail closed on config load error in enable/disable/new commands
Project-mode disable/enable and new previously fell back to default
.skillshare/{skills,agents} when LoadProject failed. With custom
sources this could write .skillignore/.agentignore or create new
skills in the wrong directory. Now both paths return an error
instead of silently using the default path.
2026-05-20 18:02:58 +08:00
Willie 49abc19eef fix: fail closed on config load error in destructive uninstall commands
Project uninstall previously fell back to default .skillshare/skills
when config was malformed. With custom sources this could trash skills
from the wrong directory. Now both skill and agent uninstall paths
return an error instead of silently using the default path.
2026-05-20 17:09:24 +08:00
Willie 9a30a90366 fix: handle sources.skills: .skillshare producing invalid ./ gitignore pattern
Apply the same rel=="." guard to the skillshareDir branch of
ProjectGitignoreTarget, so sourcePath==.skillshare returns empty
prefix instead of dot.
2026-05-20 16:57:13 +08:00
Willie 14402dc6a5 fix: handle sources.skills: . producing invalid ./ gitignore pattern
When sourcePath equals projectRoot, filepath.Rel returns ".",
causing callers to write "./<name>/" patterns that git ignores.
Return empty entryPrefix so callers produce "/<name>" instead,
which is a valid root-anchored gitignore pattern.
2026-05-20 16:49:52 +08:00
Willie 5b7ca8ba3d fix: trash before gitignore cleanup and skip gitignore for external sources
Reorder handleUninstallRepo to move repo to trash before removing the
.gitignore entry, preventing accidental exposure of tracked content
when trashing fails.

ProjectGitignoreTarget now returns empty strings for source paths
outside projectRoot, since parent-relative patterns (../) are invalid
in .gitignore. All six callers guard on empty gitignoreDir and skip
gitignore management for external sources.
2026-05-20 16:34:02 +08:00
Willie 0c010c55f4 fix: wire custom sources into server reload and gitignore paths
reloadConfig now updates s.cfg.Source and s.cfg.AgentsSource from the
refreshed ProjectConfig so project UI handlers see the latest source
directories after a config edit.

Add ProjectGitignoreTarget helper that computes the correct .gitignore
directory and entry prefix based on whether the source path is inside
.skillshare/ or a custom location. All gitignore write and remove
operations (reconcile, install, uninstall, server handlers) now use
this helper instead of hardcoded 'skills/' prefix.

Fix nil projectCfg panics in three server tests that simulate project
mode by setting projectRoot without projectCfg.
2026-05-20 16:12:02 +08:00
Willie 68d5eadc0b feat: support custom project source directories via sources map
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.

Config example:
  sources:
    skills: ./docs/skills
    agents: ./docs/agents

Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.

Closes #153
2026-05-20 15:42:53 +08:00
wangyuhao 38317a1999 proposal: custom project source directories 2026-05-20 15:05:31 +08:00
Willie 3b9cb44be6 chore: release v0.19.14 v0.19.14 2026-05-20 14:07:51 +08:00
Willie 9a57ca4308 fix(audit): handle uppercase URI schemes in dangling-link check
isExternalOrAnchor passed the raw scheme to isURLScheme which only
accepted lowercase letters, causing uppercase schemes like VSCode://
to be misidentified as dangling links.
2026-05-20 13:56:08 +08:00
Willie 3345fd677e refactor: unify gemini and antigravity targets under antigravity
- Update antigravity global path to shared ~/.gemini/skills
- Update antigravity project path from .agent to .agents
- Add aliases: gemini, gemini-cli, antigravity-cli
- Remove standalone gemini target (now an alias)
- Update testutil.CreateTarget to match new path
2026-05-20 13:44:40 +08:00
kostaandCodex ba7191fbf8 Reduce audit false positives
Tighten publisher claim extraction, skip custom URI schemes in dangling-link checks, avoid treating bracket placeholders as markdown links, and allow common documentation domains for external-link noise reduction.

Co-authored-by: Codex <noreply@openai.com>
2026-05-20 13:10:23 +08:00
kostaandCodex ddeb8e0355 Treat Swift files as audit-scannable
Co-authored-by: Codex <noreply@openai.com>
2026-05-19 09:55:22 +08:00
Willie 3ca4d099a7 chore: release v0.19.13 v0.19.13 2026-05-17 22:35:17 +08:00
Willie 1c22cc7e7b fix(test): align agent install test with new name resolution priority
The tracked repo name resolution was changed to prefer source.Name
over TrackName() in a656e30b, but this integration test still used
TrackName() to compute the expected directory path.
2026-05-17 22:25:58 +08:00
Jason Blackburn a656e30b7e 158: retain custom name and non-default branch for tracked skills 2026-05-17 14:03:22 +08:00
Willie 15243a324b docs: update README latest note to v0.19.12 2026-05-15 00:07:41 +08:00
Willie 9307fc521c chore: release v0.19.12 v0.19.12 2026-05-14 23:43:43 +08:00
Willie 821178cb91 chore: release v0.19.11 v0.19.11 2026-05-14 13:28:11 +08:00
Willie 3b2f062cf0 docs: add v0.19.11 changelog, preserve_tilde_on_save docs, fix CI test
- Add changelog entry for v0.19.11 (preserve_tilde_on_save, backups gitignore)
- Document preserve_tilde_on_save in configuration reference, cross-machine sync, FAQ
- Fix TestFoldHomePath/unrelated-abs: use /opt/unrelated/foo instead of /tmp/foo (CI sets HOME=/tmp)
- Add iFwu to README contributors
2026-05-14 13:22:23 +08:00
iFwu 5403595120 feat(config): preserve ~ in saved config paths (opt-in)
Add PreserveTildeOnSave config flag (default false). When enabled, the
Save path folds $HOME prefixes back to ~ when serializing the in-memory
Config to YAML so the on-disk config stays portable across machines
(e.g. when shared via dotfiles).

The in-memory Config is left untouched; cloneForSave() produces a
shallow copy with path fields rewritten. Mirrors the existing
expandPath() calls performed in Load():
  - cfg.Source, cfg.ExtrasSource
  - cfg.Targets[*].Path / Skills.Path / Agents.Path
  - cfg.Extras[*].Source and Extras[*].Targets[*].Path

Adds:
  - utils.FoldHomePath() helper with unit tests (exact-home, child,
    sibling-non-home, unrelated-abs, relative, Windows case-insensitive)
  - 3 Save-path tests covering default-off, fold-on, and Load→Save
    idempotency.

Default off keeps the change backward compatible: existing users see no
behavior difference. Users who share their config via dotfiles can opt
in with:

    preserve_tilde_on_save: true
2026-05-14 13:09:56 +08:00
Willie fb821b7328 fix(project): add backups/ to .skillshare/.gitignore managed dirs
Project mode agent backup (sync --agents, backup -p) creates
.skillshare/backups/ but it was not gitignored — backup artifacts
could be accidentally committed.

Agent backup was added in 95c46ca8 (2026-04-06), after the gitignore
fix in 90c096b8 (2026-03-16) which only covered logs/ and trash/.
2026-05-13 03:49:40 +08:00
Willie 56fafb53e0 fix: preserve update metadata keys for symlinked sources v0.19.10 2026-05-12 21:10:08 +08:00
Willie 56007efa5c chore: fix lint error 2026-05-11 23:46:43 +08:00
Willie 9a7271c1ae fix: address PR #151 review feedback
- Project mode JSON sync now includes context_cost (was nil)
- Server handler respects symlink mode (skips include/exclude filters)
- checkBudget reports all targets exceeding threshold (not just worst)
- Budget warnings include target name in CLI and UI output
- ConfigPage indentation restored to original 2-space style
v0.19.9
2026-05-11 21:34:38 +08:00
Willie 786af85ae4 feat(ui): add i18n for context cost section on Sync page
All 11 locales: en, zh-TW, zh-CN, ja, ko, de, es, fr, pt-BR, id, fa.
2026-05-11 21:34:38 +08:00
Willie 1acfd4b9fe docs: add --quiet flag to sync flags table and context_cost to JSON example
Also documents context_budget config block in configuration reference
with field types, defaults, and cross-link to sync docs.
2026-05-11 21:34:38 +08:00
Willie 5bf9f839e2 docs: add v0.19.9 changelog entry
Context budget warnings (issue #150), --quiet flag, Web UI context
cost display, and HTTP protocol install fix.
2026-05-11 21:34:38 +08:00
Willie 06d2f9fefa refactor(ui): remove redundant context budget card from ConfigPage
The assistant panel already shows field documentation via JSON schema.
A static reference card is redundant and breaks the page's interaction
pattern of cursor-driven contextual help.
2026-05-11 21:34:38 +08:00
Willie 98688ac316 fix: add context_budget to JSON schema for config validation
Both global and project schemas now recognize context_budget,
resolving the 'Unknown field' warning in the Config page.
2026-05-11 21:34:38 +08:00
Willie 402fe38340 refactor: simplify budget warning code after review
- Define budgetTypeAlwaysLoaded/budgetTypeOnDemand constants
- Add showDetails param to printBudgetWarning; analyze reuses it
- Hoist buildAnalyzeEntries call to avoid duplicate computation
- Remove WHAT-comments that restate function names
2026-05-11 21:34:38 +08:00
Willie b1c29c5c9d docs: document context budget warnings and --quiet flag 2026-05-11 21:34:38 +08:00
Willie 60ed5eb857 feat(ui): add context budget reference to Config page 2026-05-11 21:34:38 +08:00
Willie 1ea07afeea feat(ui): display context cost and budget warnings on Sync page 2026-05-11 21:34:38 +08:00
Willie 9510476c45 feat(server): include context_cost in sync API response
Self-contained token estimation (chars/4) since buildAnalyzeEntries
is in main package. Returns grouped counts and budget violations.
2026-05-11 21:34:38 +08:00