feat: add initial skill authoring workspace

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
木炎
2026-04-02 18:34:56 +08:00
parent a461b0734e
commit 51913555ad
30 changed files with 7114 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
# Routes And Targets
This skill is derived from the remote navigation catalog in `assets/zhihu_navigation_pages.source.json`.
## Current Scope
- Routes: 13
- Components: 53
- Flows: 16
- Targets: 69
## Model
- `route`: direct page destination with a known URL
- `component`: clickable entry, tab, button, or menu control
- `flow`: multi-step sequence composed from routes and components
- `target`: user-facing entry point that resolves to exactly one route, component, or flow
## Representative Routes
- `home`
- `hot_list`
- `notifications_page`
- `messages_page`
- `search_results_page`
- `creator_home`
- `write_article`
## Representative Components
- `top_nav_home`
- `top_nav_hot`
- `top_nav_creator`
- `top_nav_notifications`
- `top_nav_avatar_menu`
- `notifications_tab_replies`
- `messages_all_tab`
## Representative Flows
- `open_avatar_menu`
- `open_notifications_menu`
- `open_creator_from_home`
- `open_profile_from_avatar_menu`
- `open_profile_answers_tab`
- `open_profile_articles_tab`
- `open_security_settings_from_avatar_menu`
## Confirmed Alias Conflicts
These aliases currently resolve to more than one target and must not be guessed:
| Alias | Conflicting targets |
| --- | --- |
| `关注分栏` | `home_feed_following_tab`, `profile_following_tab` |
| `回答排序菜单` | `answer_sort_menu`, `question_sort_menu` |
## Preferred Disambiguation Wording
When the user uses an ambiguous alias, ask for the missing context directly:
- `你说的“关注分栏”是首页关注流,还是个人主页里的关注分栏?`
- `你说的“回答排序菜单”是问题页的排序菜单,还是回答列表的排序菜单?`
## Practical Routing Rule
Prefer the most explicit phrase in this order:
1. exact target name
2. exact alias
3. explicit page + area combination
4. generic area noun only
If step 3 or 4 still matches more than one target, ask before acting.

View File

@@ -0,0 +1,59 @@
# Selector Strategy
The source catalog already mixes stable and brittle selectors. Use this order when validating or refreshing selectors.
## Preferred Order
1. Stable `href` selectors for direct links
2. `aria-label` and `role` selectors for tabs, menus, and buttons
3. `data-testid` selectors when available
4. Stable semantic class names tied to product structure
5. Generic class selectors only as a last resort
6. CSS hash classes only when no better hook exists
## Good Patterns In The Current Catalog
- `a[href='/']`
- `a[href='/hot']`
- `a[href='/creator']`
- `button[aria-label='通知']`
- `[role='tab'][aria-label*='回复']`
- `[data-testid='sort-button']`
These are relatively resilient because they describe user-facing semantics instead of transient layout implementation.
## Known Brittle Or Weak Patterns
- `div.css-1q62b6s > div.css-byu4by`
- `button:has(img)`
- `.MoreButton`
- `.Popover`
- `.Tooltip`
- `.floating-menu`
- `.Modal`
- `.Dialog`
Risks:
- hash classes can change on any frontend build
- generic popup selectors can match the wrong layer
- image-based button matching is vulnerable to layout and icon changes
## Revalidation Rule
Before relying on a weak selector:
1. Check whether an `href`, `aria-label`, `role`, or `data-testid` selector now exists.
2. Confirm the selector matches exactly one intended element.
3. Confirm the element is visible and actionable in the current page state.
4. If the selector is still generic, pair it with a stronger page-context check before acting.
## Failure Handling
If a weak selector stops working:
- do not silently substitute another generic selector
- report which selector failed
- describe the page context where it failed
- request a selector refresh or DOM inspection before retrying