Skip to content

Commit 1c72675

Browse files
committed
feat(slackbot): add research skill for behavior triage
1 parent 5c66f49 commit 1c72675

2 files changed

Lines changed: 50 additions & 4 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: prefect-behavior-triage
3+
description: Use when a Prefect question hinges on whether observed behavior is expected, a documentation gap, or a real bug. Inspect docs and source first, then build and run a minimal reproduction only when needed.
4+
---
5+
6+
# Prefect Behavior Triage
7+
8+
Use this skill when a user reports surprising Prefect behavior or asks whether something is a bug.
9+
10+
## Workflow
11+
12+
1. Read the relevant docs and implementation before making claims.
13+
2. If docs and source code already answer the question, do not reproduce unnecessarily.
14+
3. If runtime behavior still matters, create the smallest possible reproduction and run it.
15+
4. Compare four things explicitly:
16+
- what the user observed
17+
- what the docs say
18+
- what the source code does
19+
- what the reproduction actually did
20+
5. End with a clear classification:
21+
- expected behavior
22+
- docs unclear or outdated
23+
- likely bug
24+
- still inconclusive
25+
26+
## Reproduction Rules
27+
28+
- Prefer tiny standalone scripts over modifying existing project files.
29+
- Write repros under `.research_cache/repros/` and reuse them if they already fit.
30+
- Keep the repro focused on one claim or edge case.
31+
- Use `uv run python <script>` or `uv run python - <<'PY'` for quick checks.
32+
- If the question involves the Prefect API, use the real client or real flow/task execution rather than simulating behavior.
33+
- If the behavior depends on configuration, log the exact assumptions in the final answer.
34+
35+
## Reporting Rules
36+
37+
- Do not call something a bug unless docs, source, and observed behavior are materially misaligned.
38+
- If docs and source agree, treat that as intended behavior even if it is surprising.
39+
- If source and runtime agree but docs do not, call out the documentation mismatch separately.
40+
- Cite the specific files or commands you used to reach the conclusion.

examples/slackbot/src/slackbot/research_agent.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
from prefect import task
1313
from prefect.cache_policies import INPUTS
1414

15+
SLACKBOT_ROOT = Path(__file__).resolve().parents[2]
16+
REPO_ROOT = Path(__file__).resolve().parents[4]
17+
1518

1619
async def research_topic_with_code_access(question: str, version: str = "3.x") -> str:
1720
"""
@@ -30,7 +33,7 @@ async def research_topic_with_code_access(question: str, version: str = "3.x") -
3033
# Use current working directory for cache
3134
# Locally: <wherever you run from>/.research_cache/prefect
3235
# Docker: /app/.research_cache/prefect (since WORKDIR is /app)
33-
cache_dir = Path.cwd() / ".research_cache"
36+
cache_dir = SLACKBOT_ROOT / ".research_cache"
3437
prefect_repo = cache_dir / "prefect"
3538

3639
version_context = "Prefect 3.x" if version.startswith("3") else "Prefect 2.x"
@@ -71,12 +74,15 @@ async def research_topic_with_code_access(question: str, version: str = "3.x") -
7174
7275
Remember: You are the research specialist. The main agent relies on you for accurate, comprehensive information.
7376
Be thorough - use tools repeatedly until you have complete information.
74-
Do not use any Prefect syntax you have not verified by reading the actual source code."""
77+
Do not use any Prefect syntax you have not verified by reading the actual source code.
78+
Use relevant Claude Code skills when they match the task, especially for behavior-vs-bug reproduction."""
7579

7680
options = ClaudeAgentOptions(
77-
allowed_tools=["Read", "Grep", "Glob", "Bash"],
78-
cwd=str(Path.cwd()),
81+
allowed_tools=["Skill", "Read", "Grep", "Glob", "Bash"],
82+
cwd=str(SLACKBOT_ROOT),
83+
add_dirs=[str(REPO_ROOT)],
7984
model="claude-haiku-4-5-20251001",
85+
setting_sources=["project"],
8086
system_prompt=system_prompt,
8187
)
8288

0 commit comments

Comments
 (0)