> For the complete documentation index, see [llms.txt](https://ai-native-development.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-native-development.gitbook.io/docs/general/quick-qna.md).

# Quick Q\&A

Getting the quick answer to your question.

[![](https://img.shields.io/badge/Lv3-Mature_Best_Practice-brightgreen)](https://github.com/orgs/AI-Native-Development/projects/1/)

## Description

In the collaborative coding environment, quick interactions and clarifications are often key to efficient development. While GitHub has the "GitHub Copilot Chat" product for more structured and extensive conversations, the "Quick Q\&A" technique serves as a lightweight alternative. It enables developers to rapidly engage with Copilot in the code editor for brief one-liner answers and insights. It's not a distinct feature but a method that leverages commenting for quick interactions with Copilot, making it an agile and handy tool for on-the-spot guidance.

### Example

Using the Quick Chat technique, you can pose questions directly in your code and get brief responses from Copilot:

```rb
# me: What's the best way to optimize this loop?
# copilot: 
```

Then GitHub Copilot will answer to the question

```rb
# me: What's the best way to optimize this loop?
# copilot: Consider using a vectorized approach or caching intermediate results. 
```

It can be just "q:" and "a:"

```javascript
// q: How do I get the current time in milliseconds?
// a: 
```

For more context-based dialogue, roles can be defined:

```rb
# Roles: copilot
#   Expert in Python with 15+ years of experience
# Role: me
#   Mid-level engineer
#
# me: What's the best way to optimize this loop?
# copilot: Consider using a vectorized approach or caching intermediate results. 
```

## Exercise

* **Exercise 1**: Compare Quick Chat with "copilot chat" by engaging with both and noting the differences.
* **Exercise 2**: Use Quick Chat to get one-liner answers to three different coding questions.
* **Exercise 3**: Define roles within Quick Chat and observe how contextual information affects Copilot's responses.

## Checklist for Further Learning

* How does Quick Chat differ from the "copilot chat" product, and when might one be preferred over the other?
* How can the Quick Chat technique be integrated into various stages of the development process?
* What are the potential drawbacks or limitations of using Quick Chat, and how might they be mitigated?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ai-native-development.gitbook.io/docs/general/quick-qna.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
