에이전트 태그
/// 문서 주석의 태그는 코드만으로는 전달할 수 없는 내용을 추가해요. 모두 선택 사항이에요.
<!---
Adds a task and saves the list.
@llm Append a task and save; returns the new list.
@prefer @add_task($tasks, title: 'x') over $tasks->push(), which doesn't save.
@avoid Calling it in a loop: it saves each time. Build the list, then call @save_tasks once.
@pitfall title is trimmed, and an empty title throws Validation.
@example @add_task($tasks, title: 'Buy milk')
-->
<fn name="add_task" params="tasks: list, title: string">
<!-- … -->
</fn>
<!---
Only for the tests.
@agent hide
-->
<fn name="reset_store">
<!-- … -->
</fn>/// Adds a task and saves the list.
/// @llm Append a task and save; returns the new list.
/// @prefer @add_task($tasks, title: 'x') over $tasks->push(), which doesn't save.
/// @avoid Calling it in a loop: it saves each time. Build the list, then call @save_tasks once.
/// @pitfall title is trimmed, and an empty title throws Validation.
/// @example @add_task($tasks, title: 'Buy milk')
fn add_task(tasks: list, title: string) {
// …
}
/// Only for the tests.
/// @agent hide
fn reset_store() {
// …
}| 태그 | 기능 |
|---|---|
@llm |
에이전트가 요약 대신 읽는 줄이에요. 없으면 요약의 첫 문장을 사용해요. 두 가지 모두 120자로 잘려요. |
@prefer |
에이전트가 선택하도록 하고 싶은 사용 방법이에요. |
@avoid |
에이전트가 선택하지 않아야 할 사용 방법이에요. |
@pitfall |
쉽게 저지르는 실수예요. |
@example |
한 줄 100자 이내에 들어갈 때 표시돼요. |
@agent hide |
에이전트 문서에서 해당 심볼을 제외해요. |
편집기는 호버에서도 @prefer, @avoid, @pitfall을 표시하므로 사람에게도 도움이 돼요. XML에서는 요소 앞의 <!--- ... --> 주석에 같은 태그를 작성하세요.