* fix(project): refuse to re-init a project that lost its config.yaml
Every project-mode command auto-initializes when .skillshare/config.yaml
is missing. That is right for a repository with no project directory at
all, and for the shared skills repo produced by 'init -p --config local',
which gitignores config.yaml so each developer regenerates their own.
It was wrong for the case in between. A .skillshare/ that already held
skills or agents, whose config.yaml was simply gone, was re-initialized
into an empty config. Every configured target was dropped, the target
symlinks were left behind pointing at a project the config no longer
described, and the command exited 0. Nothing said anything had happened.
Add ensureProjectConfig, which replaces the open-coded auto-init at every
project command entry point. It initializes as before when there is no
project directory, and when config.yaml is gitignored, so both intentional
cases keep working untouched. When the directory holds skills or agents
and its config is neither present nor gitignored, it now returns an error
pointing at version control or an explicit 'skillshare init -p' instead of
writing over the project.
The gitignore check is treated as inconclusive on error, so a repository
that cannot be inspected is guarded rather than overwritten.
* feat(project): support a visible skillshare/ project directory
Project mode is identified only by .skillshare/config.yaml, and trash,
backups, logs and audit-rules.yaml anchor to that same hidden directory.
The sources option (#153) made project content relocatable, but the
marker and operational state stay hidden, so repositories that treat
skills as reviewable content still carry a hidden directory whose only
job is to hold config.yaml.
Resolve the project directory through a new leaf package that checks
.skillshare/config.yaml first and skillshare/config.yaml second, and
derive every config, state, source-default and gitignore path from the
result. The hidden name wins whenever both exist, so an existing project
never moves and no migration is needed. The package imports nothing else
internal because internal/audit cannot import internal/config without a
cycle.
Add init -p --visible to create the visible layout. Default init -p
behaviour and output are unchanged.
Two ambiguities the visible name introduces:
- The global config directory is also called skillshare
(<config-home>/skillshare), so the two places that infer scope from a
config path now exclude the global location by full path rather than
by directory name. TestLogDir_Global asserted a fixture path without
declaring a config home, which hid this; it now sets XDG_CONFIG_HOME.
- An unrelated directory named skillshare/ must not be adopted as a
partially initialized project, so the visible name is only claimed
when it carries a marker of its own: a skills/ or agents/ directory,
or a .gitignore that ignores config.yaml.
The missing-config guard added in the previous commit is generalized to
resolve through the new package, so it covers both layouts. The
gitignored-config marker matters there too. A repository shared by
'init -p --visible --config local' before any skill was committed clones
with nothing but that .gitignore, because git drops the empty skills/
and agents/ directories; recognizing it keeps the repair pointed at the
visible directory instead of writing a hidden one beside it.
Refs #256
* fix(project): reconcile visible directory support with main
Consolidate the missing-config guard and regression tests already merged in #260. Preserve both directory layouts and document and test resyncing target links after a rename. Follow-up for #258.
---------
Co-authored-by: Willie <egg358358@gmail.com>
Tier and cross-skill findings are generated programmatically rather than
compiled from the rule list, so they bypassed the disabled-ID filter applied
at rule-compile time. Setting enabled:false in audit-rules.yaml marked the
rule disabled in the listing but the scan still fired it at full severity.
Filter synthetic findings against the disabled-ID set in both the skill-scan
and single-file paths, threading the set through the cross-skill call sites
(analyzer, cmd, server). Fixes#204.
Labels use dim style while values use bold semantic colors, making
counts visually prominent. Threat category breakdown now colors each
category independently (injection=red, exfiltration=orange, etc.)
instead of uniform yellow, so users can distinguish threat types at
a glance.
P1: mergeYAMLRules Phase 2 used full-object replacement for overlays
without Enabled set, causing severity-only entries ({id, severity}) to
wipe regex/pattern/message from the base rule. compileRules then failed
with "empty regex". Now uses field-level merge: only entries with Regex
do full replacement; otherwise Enabled and Severity are patched
individually.
P2: TogglePattern enable only removed pattern-level disable entries,
leaving ID-level {id: "x", enabled: false} untouched — both builtin
and custom rules. Now clearDisableForPattern matches by builtin ID set
OR by r.Pattern == pattern, covering custom rules in the same group.
Implement a full bubbletea TUI with two navigation levels:
- Level 1 (patterns): shows pattern categories with rule count, disabled
count, and max severity; press Enter to drill in, d to toggle pattern
- Level 2 (rules): shows individual rules with severity and status; detail
panel shows full ID, regex, message, source; d toggles single rule,
D toggles entire pattern, Esc returns to Level 1
Also adds audit.ResetGlobalCache() to clear cached rules after YAML
mutations, enabling live-reload within the TUI session.
Extend mergeYAMLRules to handle overlay entries that specify a pattern
but no id — these apply to all base rules sharing that pattern name.
Processing uses two phases:
1. Pattern-level overlays (bulk disable / severity override)
2. ID-level overlays (can override pattern-level, e.g. re-enable
an individual rule after a pattern-level disable)
An explicit enabled:true in an id-level overlay clears a disabled flag
set by a pattern-level overlay.
Scan .md files in skill directories for broken relative links during
audit. Targets that don't exist on disk produce a LOW severity finding
(pattern: dangling-link). External URLs, anchors, and fragments are
skipped.
Integrated into the existing walk (zero extra IO) and disableable via
audit-rules.yaml (- id: dangling-link / enabled: false). The init-rules
template, built-in skill reference, and website docs are updated.
Add REST API (GET/PUT/POST /api/audit/rules) for managing custom
audit-rules.yaml through the web dashboard. Extract template and
validation logic from CLI into reusable audit package functions
(ValidateRulesYAML, InitRulesFile, DefaultRulesTemplate). Frontend
provides CodeMirror YAML editor with dirty tracking, file creation
flow, and mode-aware path display. Sidebar nav gains overflow scroll.
Move 17 hardcoded audit rules from Go structs to embedded rules.yaml,
enabling community PRs on rule definitions without recompilation.
Add user-customizable audit rules at two levels:
- Global: ~/.config/skillshare/audit-rules.yaml
- Project: .skillshare/audit-rules.yaml
Merge semantics: built-in → global → project. Users can append new
rules, override existing ones by id, or disable them (enabled: false).
Replace hardcoded localhostURL check with generic exclude regex field
on rules. Add --init-rules flag to scaffold a starter rules file.
Public API (ScanSkill, ScanContent, Finding, Result) unchanged —
callers require zero modifications.