Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .autocorrectignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skills.json
21 changes: 0 additions & 21 deletions .impeccable.md

This file was deleted.

19 changes: 13 additions & 6 deletions docs/.vitepress/theme/components/Skill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { useData } from 'vitepress'
import AppNav from './AppNav.vue'
import AppFooter from './AppFooter.vue'
import type { SkillEntry } from './skill-catalog/types'
import { locale as enLocale } from './skill-catalog/en'
import { locale as zhCNLocale } from './skill-catalog/zh-CN'
import { locale as zhHKLocale } from './skill-catalog/zh-HK'
import { augmentLocale } from './skill-catalog/augment'
import { locale as _enLocale } from './skill-catalog/en'
import { locale as _zhCNLocale } from './skill-catalog/zh-CN'
import { locale as _zhHKLocale } from './skill-catalog/zh-HK'
const enLocale = augmentLocale(_enLocale)
const zhCNLocale = augmentLocale(_zhCNLocale)
const zhHKLocale = augmentLocale(_zhHKLocale)

const { lang } = useData()

Expand Down Expand Up @@ -559,6 +563,7 @@ const SKILLS = [
id: 'longbridge',
name: 'Longbridge Overview',
cat: 'Platform',
tag: 'Popular',
desc: 'Full-stack financial data and trading platform — CLI, Python/Rust SDK, MCP, and LLM integration.',
example: "What is NVDA's current price, recent news, and how does it affect my positions?",
},
Expand Down Expand Up @@ -1538,7 +1543,6 @@ function triggerRipple(event: MouseEvent, el: HTMLElement) {
<div class="sc-card-header">
<div class="sc-card-title">
<span class="sc-card-name">{{ skill.name }}</span>
<span class="sc-card-pkg">{{ skill.pkg }}</span>
<span v-if="skill.tag" class="sc-card-tag" :class="'sc-card-tag--' + (skill.tagType ?? 'default')">{{
skill.tag
}}</span>
Expand All @@ -1555,6 +1559,7 @@ function triggerRipple(event: MouseEvent, el: HTMLElement) {
<path d="M5 12h14M12 5l7 7-7 7" />
</svg>
</div>
<span class="sc-card-pkg">{{ skill.pkg }}</span>
<p class="sc-card-desc">{{ skill.desc }}</p>
<div class="sc-card-prompt">
<svg
Expand Down Expand Up @@ -3103,6 +3108,7 @@ function triggerRipple(event: MouseEvent, el: HTMLElement) {

/* Card */
.sc-card {
line-height: 16px;
position: relative;
isolation: isolate;
overflow: hidden;
Expand Down Expand Up @@ -3317,8 +3323,8 @@ function triggerRipple(event: MouseEvent, el: HTMLElement) {
min-width: 0;
}
.sc-plugin-icon {
width: 34px;
height: 34px;
width: 45px;
height: 45px;
border-radius: 8px;
background: rgba(245, 158, 11, 0.15);
display: flex;
Expand All @@ -3337,6 +3343,7 @@ function triggerRipple(event: MouseEvent, el: HTMLElement) {
}
.sc-plugin-badge {
font-size: 9px;
line-height: 14px;
padding: 1px 5px;
background: rgb(245, 158, 11);
color: #fff;
Expand Down
67 changes: 67 additions & 0 deletions docs/.vitepress/theme/components/skill-catalog/augment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import type { CatalogLocale, SkillEntry, SkillCat } from './types'
import skillsData from '../../../../../skills.json'

type SkillJsonEntry = (typeof skillsData)['skills'][0]

function inferCat(slug: string): SkillCat {
if (slug === 'longbridge') return 'meta'
if (/-(order|trade|dca)$/.test(slug) || /-order$/.test(slug)) return 'trade'
if (/-(position|portfolio|statement|profit|pnl|asset-allocation)$/.test(slug)) return 'portfolio'
if (/-(alert)$/.test(slug)) return 'trade'
if (/-(quote|depth|kline|capital-flow|fx|brokers|intraday|market-temp|candlestick|adr-premium|ah-premium|technical|chanlun|correlation)/.test(slug)) return 'quote'
if (/-(fundamental|valuation|financial|earnings|analyst|corporate|dividend|peer|consensus|coverage|dcf|buffett|moat|tearsheet|basicinfo|company|competitive|catalyst|coverage-initiation|quant|ml-strategy|behavioral|asset-allocation|risk|macro|sector|options-volatility|ark|sharelist|portfolio-analytics|benchmark|concentration|drawdown)/.test(slug)) return 'research'
if (/-(option|warrant|derivative|defi)/.test(slug)) return 'derivative'
if (/-(market|calendar|anomaly|constituent|security|watchlist|screener|discovery|search|filter|news|content|topic|business-query|insider|flows|short|institutional|ownership)/.test(slug)) return 'discovery'
return 'discovery'
}

function humanizeName(slug: string): string {
const base = slug.replace(/^longbridge-?/, '')
if (!base) return 'Longbridge'
return base
.split('-')
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(' ')
}

function extractDesc(description: string): string {
const text = description.trim()
const beforeTriggers = text.split(/\s+Triggers:/)[0].trim()
const firstSentence = beforeTriggers.split(/\.\s+/)[0].trim()
return firstSentence.endsWith('.') ? firstSentence : firstSentence + '.'
}

function makeEntry(s: SkillJsonEntry): SkillEntry {
return {
id: s.slug.replace(/^longbridge-?/, '') || 'longbridge',
pkg: s.slug,
cat: inferCat(s.slug),
tools: 1,
name: humanizeName(s.slug),
desc: extractDesc(s.description),
prompt: '',
}
}

/**
* Returns a new CatalogLocale that includes all skills from skills.json,
* appending auto-generated entries for any skill not already in the catalog.
*/
export function augmentLocale(base: CatalogLocale): CatalogLocale {
const existing = new Set(base.skills.map((s) => s.pkg))
const added: SkillEntry[] = skillsData.skills
.filter((s) => !existing.has(s.slug))
.map(makeEntry)

if (added.length === 0) return base

const total = base.skills.length + added.length
return {
...base,
skills: [...base.skills, ...added],
ui: {
...base.ui,
title: base.ui.title.replace(/\d+\s+Skills?/, `${total} Skills`),
},
}
}
1 change: 1 addition & 0 deletions docs/.vitepress/theme/components/skill-catalog/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const locale: CatalogLocale = {
pkg: 'longbridge',
cat: 'meta',
tools: 8,
tagType: 'hot',
name: 'Longbridge Overview',
desc: 'Full-stack financial data and trading platform — CLI, Python/Rust SDK, MCP, and LLM integration.',
prompt: 'What is NVDA\'s current price, recent news, and how does it affect my positions?',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const locale: CatalogLocale = {
pkg: 'longbridge',
cat: 'meta',
tools: 8,
tagType: 'hot',
name: '长桥总览',
desc: 'Longbridge 平台入口,覆盖 CLI / Python / Rust SDK / MCP / LLMs.txt 集成。',
prompt: '帮我看下 NVDA 现价、新闻和我的持仓影响。',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const locale: CatalogLocale = {
pkg: 'longbridge',
cat: 'meta',
tools: 8,
tagType: 'hot',
name: '長橋總覽',
desc: 'Longbridge 平台入口,覆蓋 CLI / Python / Rust SDK / MCP / LLMs.txt 整合。',
prompt: '幫我看下 NVDA 現價、新聞和我的持倉影響。',
Expand Down
Loading
Loading