twg-context-discovery

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

twg-context-discovery

twg-上下文发现

Use the root
twg
skill. Get command grammar from live
twg help
,
twg help <terms>
, or
twg help describe <path>
.
使用根技能
twg
。可通过实时命令
twg help
、
twg help <terms>
或
twg help describe <path>
获取命令语法。

CLI launcher fallback

CLI启动器备选方案

Run
twg <command>
. On shell
command not found
, use
$HOME/.local/bin/twg
(macOS/Linux) /
$env:LOCALAPPDATA\Programs\twg\bin\twg.exe
(PowerShell), then tell user to add that directory to PATH. Do not treat auth or command errors as PATH failures.
运行
twg <command>
。若shell提示
command not found
,请使用
$HOME/.local/bin/twg
(macOS/Linux系统)或
$env:LOCALAPPDATA\Programs\twg\bin\twg.exe
(PowerShell环境),然后告知用户需将该目录添加至PATH环境变量。请勿将认证错误或命令错误视为PATH配置问题。

First Move

初始步骤

Resolve the anchor before widening:
  • Stable key, URL, or ARI: use directly when the family is clear.
  • Fuzzy topic or name: classify scope; hydrate 2-5 anchors before ranking.
  • Multiple same-kind anchors: batch them in one context call when supported.
  • Unknown command shape: inspect focused help before calling data.
For fuzzy topics, group high-signal candidates by scope using explicit charter, roadmap, project, product, or service evidence. Keep same-named feature, platform, domain, team, and initiative clusters separate. Compare scope fit, centrality, breadth, and recency before selecting one. If ambiguity remains, show alternatives or ask. Set the boundary before inferring experts or ownership; nearby authorship or activity does not prove broader responsibility.
If context is not advertised for an anchor type, use product-native hydration and search evidence instead of inventing paths.
For ownership, expertise, approval authority, leadership reach-outs, or escalation, load
../twg-responsibility-routing/SKILL.md
. Return here only when that workflow needs relationship or dependency expansion.
在扩展范围前先解析锚点:
  • 稳定密钥、URL或ARI:当所属类别明确时直接使用。
  • 模糊主题或名称:先分类范围;在排名前生成2-5个锚点。
  • 多个同类锚点:若支持,在一次上下文调用中批量处理。
  • 未知命令格式:在调用数据前查看针对性帮助文档。
对于模糊主题,利用明确的章程、路线图、项目、产品或服务证据,按范围对高信号候选者进行分组。将同名的功能、平台、领域、团队和计划集群分开。在选择前比较范围适配度、核心性、广度和时效性。若仍存在歧义,展示备选方案或询问用户。在推断专家或归属权前先设定边界;附近的作者或活动记录并不代表更广泛的职责。
若某类锚点未公开上下文信息,请使用产品原生的生成方式和搜索证据,而非自行创建路径。
若涉及归属权、专业能力、审批权限、领导层沟通或升级处理,请加载
../twg-responsibility-routing/SKILL.md
。仅当该工作流需要扩展关系或依赖时,才返回当前流程。

Route Selection

路径选择

  • Known Jira work items usually need native workitem details plus relationship context.
  • Projects and goals need native details plus Jira, docs, search, PR, and meeting evidence.
  • For topic onboarding, search knowledge and product-native work once. Compare formal epic, project, goal, and page anchors across same-named scopes; source-defined hierarchy distinguishes the central program/platform from a feature, migration, or adoption effort. Prefer the anchor linking current delivery work and code. Hydrate it, then use context and responsibility once each only if they add dependencies or people. Hydrate at most three items. Never refetch a source with another projection or try more synonyms after resolution. Target 6-10 calls; stop once the categories are supported.
  • For restart, handoff, or OOO catch-up, load
    ../twg-status-rollups/references/personal-work-summary.md
    and follow its restart guidance. Infer priority across connected evidence and hydrate only anchors that change the user's next action.
  • Dependency map and page/topic prompts need hydrated anchors before broad search is evidence. Map broad subdomains before assigning owners/experts.
  • Raw graph-query/debugging surfaces are not the default dependency-map route. Use them only when the user explicitly asks for that query language or typed commands cannot express the required edge.
  • 已知的Jira工作项通常需要原生工作项详情加上关系上下文。
  • 项目和目标需要原生详情加上Jira、文档、搜索、PR和会议证据。
  • 对于主题入门,仅搜索一次知识库和产品原生工作内容。在同名范围内比较正式的史诗、项目、目标和页面锚点;源定义的层级可区分核心项目/平台与功能、迁移或推广工作。优先选择关联当前交付工作和代码的锚点。生成该锚点后,仅当上下文和责任信息能补充依赖或人员信息时,才各调用一次。最多生成3个项目。解析完成后,请勿使用其他投影方式重新获取源数据或尝试更多同义词。目标调用次数为6-10次;一旦类别覆盖需求,立即停止。
  • 对于重启工作、交接或休假跟进,请加载
    ../twg-status-rollups/references/personal-work-summary.md
    并遵循其重启指南。通过关联证据推断优先级,仅生成能改变用户下一步行动的锚点。
  • 依赖关系图和页面/主题请求需要先生成锚点,再进行广泛搜索作为证据。在分配所有者/专家前,先映射广泛的子域。
  • 原始图查询/调试界面并非依赖关系图的默认路径。仅当用户明确要求使用该查询语言,或已有的命令无法表达所需的关联关系时,才使用这些界面。

Evidence Policy

证据规则

For central candidates, use a bounded source and relationship fan-out:
  • Source fetch: fields, owner, status, body, comments, and URLs.
  • Context: graph edges, formal external links, related people, teams, projects, goals, docs, PRs, commits, and branches.
Use summary detail first. Escalate to full only for the central anchor or up to 3 high-signal related anchors when URLs, comments, body content, or provenance are missing.
Treat third-party URLs as graph nodes. Collect remote links, context edges, descriptions, comments, ADF links, bare URLs, and linked bodies; retain provenance for relationship direction.
对于核心候选者,使用有限的源数据和关系扩展:
  • 源数据获取:字段、所有者、状态、正文、评论和URL。
  • 上下文:图关联、正式外部链接、相关人员、团队、项目、目标、文档、PR、提交记录和分支。
优先使用摘要详情。仅当核心锚点或最多3个高信号关联锚点缺少URL、评论、正文内容或来源信息时,才获取完整数据。
将第三方URL视为图节点。收集远程链接、上下文关联、描述、评论、ADF链接、纯URL和链接正文;保留来源信息以明确关系方向。

Expansion Rules

扩展规则

  • Expand by relationship role, not raw count.
  • Hydrate parent, epic, inbound peer, blocker, consumer, central page, external design, PR, commit, branch, assignee, reporter, contributor, and reviewer signals when they change direction, risk, ownership, or next action.
  • Fetch known older links directly by URL, key, ID, or ARI instead of widening the whole graph blindly.
  • Use strong query variants rather than many synonyms.
  • After the first source fetch plus context/search pass, pause and compare the evidence against the requested output. If owner, status, relation, recency, and evidence URL/key are present, synthesize instead of widening.
  • If a context or graph-backed command returns the same backend/coverage error twice, do not keep probing adjacent graph paths. Record the coverage gap and continue with product-native hydrated evidence.
  • Stop when the next candidate would not add new entities, links, contributors, teams, decisions, ownership, risk, or next action.
  • 按关系角色扩展,而非单纯按数量扩展。
  • 当父项、史诗、入站对等项、阻塞项、消费者、核心页面、外部设计、PR、提交记录、分支、经办人、报告人、贡献者和审核者等信号会改变方向、风险、归属权或下一步行动时,生成这些信号的详情。
  • 通过URL、密钥、ID或ARI直接获取已知的旧链接,而非盲目扩展整个图。
  • 使用精准的查询变体,而非大量同义词。
  • 在第一次源数据获取加上上下文/搜索后,暂停并将证据与请求的输出进行对比。若所有者、状态、关系、时效性和证据URL/密钥均已存在,则进行合成而非继续扩展。
  • 若上下文或基于图的命令两次返回相同的后端/覆盖范围错误,请不要再继续探测相邻的图路径。记录覆盖范围缺口,继续使用产品原生生成的证据。
  • 当下一个候选者无法添加新的实体、链接、贡献者、团队、决策、归属权、风险或下一步行动时,停止扩展。

Graph Visualization

图形可视化

For graph requests, pipe typed context output to
twg visualize
. Keep entities that change direction, ownership, risk, or next action; collapse duplicates.
对于图形请求,将格式化的上下文输出传递给
twg visualize
。保留会改变方向、归属权、风险或下一步行动的实体;合并重复项。

Output Shape

输出格式

  • Anchor snapshot: what it is and why it matters.
  • For OOO catch-ups, synthesize by priority workstream and next action; do not add a relationship table. For other context work, include entity, relationship, owner, importance, and evidence.
  • Risks and dependencies, separating confirmed edges from inferred relationships.
  • Suggested next actions.
  • Confidence and gaps when evidence is incomplete, access-limited, stale, or sampled.
  • 锚点快照:锚点内容及其重要性。
  • 对于休假跟进,按优先级工作流和下一步行动进行合成;无需添加关系表。对于其他上下文工作,需包含实体、关系、所有者、重要性和证据。
  • 风险和依赖关系,区分已确认的关联与推断的关系。
  • 建议的下一步行动。
  • 当证据不完整、受访问限制、过时或为抽样数据时,标注置信度和缺口。

Anti-Patterns

反模式

  • Do not stop at search results without hydrating anchors.
  • Do not treat
    stdout_shape
    as a complete entity or URL inventory.
  • Do not skip peer expansion for graph/dependency prompts because peers look "Done".
  • Do not dismiss a 1-hop candidate by title alone.
  • Do not hand-roll graph HTML.
  • 请勿在未生成锚点的情况下就停留在搜索结果阶段。
  • 请勿将
    stdout_shape
    视为完整的实体或URL清单。
  • 请勿因对等项显示「已完成」就跳过其扩展,尤其是在处理图形/依赖请求时。
  • 请勿仅通过标题就否定1级关联的候选者。
  • 请勿手动编写图形HTML。