Skip to content

v0.18.0#101

Merged
runkids merged 26 commits intomainfrom
v0.18.0
Mar 26, 2026
Merged

v0.18.0#101
runkids merged 26 commits intomainfrom
v0.18.0

Conversation

@runkids
Copy link
Owner

@runkids runkids commented Mar 26, 2026

Discussion: #99

TL;DR

  1. skillshare analyze — new command to measure context window token usage per target and lint skill quality
  2. Skill quality lint — 7 built-in rules catch missing fields, short descriptions, and missing trigger phrases
  3. Analyze TUI — interactive exploration with target switching, color dots, sort cycling, and lint icons
  4. Web UI Analyze page — dashboard with chart, table, and token breakdown
  5. Update page polish — sticky search filter and SplitButton actions

runkids added 25 commits March 26, 2026 03:03
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
Use SplitButton dropdown for the update action, moving the Force
option into a dropdown menu item with confirmation step. This aligns
the Update page with the Sync and Extras page patterns.
Add a search input with sticky positioning to filter the update list
when many skills have updates. Select All now operates on filtered
results only, and uses a shared toggleAll helper with Set-based lookup.
- 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
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.
Populate LintIssues during skill discovery (collectContext path) and
propagate them through analyzeSkillEntry so JSON output includes lint
findings per skill.
- 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)
Expose per-target context-window budget analysis via the REST API.
The handler discovers source skills with context metadata (desc/body
char counts, lint issues), applies each target's filter/mode rules,
and returns aggregated always-loaded vs on-demand token estimates.
Wire up frontend infrastructure for the Analyze page:
- Add AnalyzeResponse/AnalyzeTarget/AnalyzeSkill/AnalyzeLintIssue types
- Add api.analyze() method calling GET /analyze
- Register /analyze route with lazy-loaded AnalyzePage
- Add Analyze nav item (BarChart3 icon) in SECURITY & MAINTENANCE group
- Create placeholder AnalyzePage component
Replace placeholder with complete analyze dashboard:
- PageHeader with BarChart3 icon, dynamic subtitle, refresh button
- Loading/error/empty states using shared components
- Target group merging with SegmentedControl for multi-group switching
- 4 summary cards (skills, always-loaded, on-demand, quality issues)
- Top-10 heaviest skills horizontal bar chart with P25/P75 coloring
- Lint issues summary panel with clickable rule filtering
- Full skill table with sortable columns, search, lint filter badge
- Expandable rows showing token breakdown, metadata, and description
…dals

Redesign AnalyzePage with improved visual hierarchy, accessible colors,
and consistent styling. Unify all dialog/modal components to use a shared
DialogShell with border-2 border-pencil + hard-offset shadow pattern,
removing Card wrappers that caused inconsistent appearance.

AnalyzePage improvements:
- Summary cards with Audit-style icon blocks and semantic colors
- Bar chart uses info blue (not red) with uniform opacity
- Skill detail shown in dialog instead of inline expand
- Table matches Skills page table view (dashed borders, pagination)
- Quality Issues section with readable rule names and proportion bars
- Help dialog explaining page purpose and token calculation
- All colors use CSS variables for dark mode compatibility

Dialog unification (11 files):
- DialogShell: add bg-surface, border-2 border-pencil, padding prop,
  createPortal to body, CSS shadow rules
- Migrate KeyboardShortcutsModal from inline to DialogShell
- Remove Card wrappers from ConfirmDialog, SkillPickerModal,
  HubManagerModal, SyncPreviewModal, UpdateDialog, ExtrasPage
- FileViewerModal: padding=none with manual header padding
AnalyzePage:
- Add "View Skill Detail" link in skill dialog for quick navigation
- Simplify subtitle (remove redundant useMemo with identical branches)
- Replace prevFiltered anti-pattern with useEffect for pagination reset
- Remove unused border/bg fields from summary card data

SkillDetailPage:
- Show estimated token count in stats bar with desc/body breakdown
- Hover tooltip shows full breakdown (~4 chars/token estimate)
Use percentage-based positioning (left: 50% + translateX) instead of
fixed pixel offsets (right: 18px / left: 22px) so pins stay centered
regardless of card width. Add nth-child variation at 40%/60%.
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.
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant new 'analyze' command and corresponding web UI page, empowering users to optimize their AI context window usage and improve skill quality through automated linting. It also refines the user experience in the web UI with updated components and consistent styling across various dialogs, making the application more robust and user-friendly.

Highlights

  • New skillshare analyze Command: Introduced a new CLI command to measure context window token usage for skills and lint skill quality. It calculates 'always loaded' (name + description) and 'on-demand' (skill body) token costs, with an interactive TUI, verbose output, and JSON options.
  • Skill Quality Linting: The analyze command now includes 7 built-in lint rules to check for missing fields (name, description), empty skill bodies, description length (too short/long/near limit), and missing trigger phrases. Lint issues are displayed in the TUI and JSON output.
  • Interactive TUI for Analysis: A new full-screen TUI provides an interactive way to explore skill analysis, featuring color-coded token cost indicators, target switching, filtering, sorting options, and a detailed panel showing lint findings.
  • Web UI Analyze Page: A new 'Analyze' dashboard page has been added to the web UI, offering a visual overview of per-target token usage with charts, a skill table with token breakdowns, and lint issue indicators. Skill detail pages now also show token counts.
  • Web UI Update Page Improvements: The Update page received polish with a sticky search filter that remains visible while scrolling and action buttons replaced by a SplitButton component for cleaner interaction, including a 'Force Update' option.
  • Unified Dialog Styling: All modal dialogs across the web UI (Confirm, File Viewer, Hub Manager, Keyboard Shortcuts, Skill Picker, Sync Preview, Update) now share consistent styling through a new DialogShell component, improving visual coherence.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a major new analyze command and corresponding web UI page, allowing users to analyze context window token usage for their skills and view skill quality linting issues. The analyze command provides both an interactive TUI and JSON output. The underlying internal/sync package was extended to calculate skill context and run lint checks. Additionally, several UI components were refactored to use a unified DialogShell for consistent styling, and the Update page received improvements like a sticky search filter and SplitButton actions. Feedback indicates that the yaml.Unmarshal error in internal/sync/context.go should be handled to prevent silent failures, the help text for the --verbose flag in cmd/skillshare/analyze.go should be updated to reflect the correct 'Top 10 descriptions' count, and the analysis data building logic in internal/server/handler_analyze.go should be refactored to reuse code from cmd/skillshare/analyze.go to avoid duplication.

- 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)
@runkids runkids merged commit 64ed9b0 into main Mar 26, 2026
8 checks passed
@runkids runkids deleted the v0.18.0 branch March 26, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant