|
| 1 | +--- |
| 2 | +name: ask |
| 3 | +description: Documentation Graph Query & Exploration - Find, investigate, and answer questions about the graph. |
| 4 | +--- |
| 5 | + |
| 6 | +# Documentation Graph Query & Exploration |
| 7 | + |
| 8 | +This skill provides a structured methodology for exploring the documentation graph and answering specific questions |
| 9 | +about its contents, relationships, and structure. It emphasizes using `docgraph` specific tools over general text search |
| 10 | +(grep) to leverage the semantic structure of the graph. |
| 11 | + |
| 12 | +> [!TIP] Use this skill whenever you need to understand "how things are connected", "where a requirement is defined", or |
| 13 | +> "what is the impact of a change". |
| 14 | +
|
| 15 | +## Exploration Tools |
| 16 | + |
| 17 | +### 1. `docgraph list` (Discovery) |
| 18 | + |
| 19 | +Use to find nodes matching a pattern or within a scope. |
| 20 | + |
| 21 | +- **Usage**: `docgraph list "<ID_PATTERN>"` |
| 22 | +- **Example**: `docgraph list "FR_LOGIN_*"` |
| 23 | +- **Benefit**: Quickly identifies relevant IDs without wading through raw file content. |
| 24 | + |
| 25 | +### 2. `docgraph type` (Structural Context) |
| 26 | + |
| 27 | +Use to understand the expected schema and constraints of a specific node type. |
| 28 | + |
| 29 | +- **Usage**: `docgraph type <TYPE>` |
| 30 | +- **Example**: `docgraph type FR` |
| 31 | +- **Benefit**: Reveals what sections and dependencies are mandatory or optional. |
| 32 | + |
| 33 | +### 3. `docgraph describe` (Deep Dive) |
| 34 | + |
| 35 | +Use to retrieve the full content and immediate relations of a specific node. |
| 36 | + |
| 37 | +- **Usage**: `docgraph describe <ID>` |
| 38 | +- **Example**: `docgraph describe FR_LOGIN_001` |
| 39 | +- **Benefit**: Provides a unified view of the node's text and its incoming/outgoing edges. |
| 40 | + |
| 41 | +### 4. `docgraph trace` (Impact & Lineage) |
| 42 | + |
| 43 | +Use to follow a chain of relationships (e.g., from requirement to code, or dependency tree). |
| 44 | + |
| 45 | +- **Usage**: `docgraph trace <START_ID> --direction <up|down>` |
| 46 | +- **Example**: `docgraph trace FR_LOGIN_001 --direction down` |
| 47 | +- **Benefit**: Visualizes the full path of derivation or satisfaction. |
| 48 | + |
| 49 | +### 6. Semantic Inference & Terminology Deduction (Cognitive Tool) |
| 50 | + |
| 51 | +Don't just look for matches; analyze how terms are used. |
| 52 | + |
| 53 | +- **Contextual Deduction**: If a term is used in multiple `FR` nodes related to "Auth", it likely refers to an |
| 54 | + authentication concept. |
| 55 | +- **ID Mnemonics**: Use the prefix and mnemonic structure (e.g., `API-BILL-*`) to infer the scope of a term. |
| 56 | +- **Relational Meaning**: A node that "realizes" an `IF` (Interface) is likely an implementation detail (Module). |
| 57 | + |
| 58 | +### 5. `grep` (Keyword Fallback) |
| 59 | + |
| 60 | +Use only when you don't have a specific ID or node type to start with. |
| 61 | + |
| 62 | +- **Usage**: `grep -r "keyword" doc/` |
| 63 | +- **Benefit**: Finds mentions of terms that aren't formal IDs. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Workflow Steps |
| 68 | + |
| 69 | +### 1. Intent Clarification |
| 70 | + |
| 71 | +Identify the core of the question: |
| 72 | + |
| 73 | +- **Structural**: "What is required for a Functional Requirement?" -> Use `type`. |
| 74 | +- **Existence**: "Do we have a requirement for SSO?" -> Use `list` or `grep`. |
| 75 | +- **Relationship**: "What modules implement the billing interface?" -> Use `describe` or `trace`. |
| 76 | + |
| 77 | +### 2. Multi-Layer Exploration |
| 78 | + |
| 79 | +Don't stop at the first finding. Follow the links: |
| 80 | + |
| 81 | +1. **Find** the starting node (`list`). |
| 82 | +2. **Understand** the starting node (`describe`). |
| 83 | +3. **Trace** the connections (`trace`) to see how it fits into the broader system. |
| 84 | + |
| 85 | +### 3. Contextual Synthesis & Inference |
| 86 | + |
| 87 | +Combine findings from the graph logic with the actual Markdown content. |
| 88 | + |
| 89 | +- Use `docgraph describe` to see the semantic links. |
| 90 | +- Use `view_file` to read the narrative context. |
| 91 | +- **Inference**: If a term is mentioned in the text but has no ID, search for related concepts using `list` or `grep` to |
| 92 | + see if it's an alias or a broader system component. |
| 93 | + |
| 94 | +## Query Resolution Report |
| 95 | + |
| 96 | +When answering, structure your response as follows: |
| 97 | + |
| 98 | +### Findings Summary |
| 99 | + |
| 100 | +- **Primary Node(s)**: [ID(s) found] |
| 101 | +- **Key Relationships**: [e.g., "Satisfies ADR_001", "Realized by MOD_AUTH"] |
| 102 | + |
| 103 | +### Detailed Analysis |
| 104 | + |
| 105 | +Provide the detailed answer built from the gathered context. |
| 106 | + |
| 107 | +### Navigation Trace (optional) |
| 108 | + |
| 109 | +If relevant, show the path taken: `FR_001` -> `IF_001` -> `MOD_001` |
0 commit comments