valkryhx/google_adk_agent / skills/think_skill
think_skill
Verified强制 AI Agent 在执行任何高风险或实质性操作(如修改文件、执行命令、查询数据库)前进行逻辑梳理、步骤拆解。这是一种显式驱动 ReAct 循环的思想链(CoT)触发器。
tools.py
View on GitHub# -*- coding: utf-8 -*-
from typing import List, Optional
async def think_and_plan(
current_state_analysis: str,
next_steps: List[str],
potential_risks: Optional[str] = None
) -> str:
"""
在调用实质性工具(如执行代码、修改文件、查询数据库等)之前,必须先调用此工具。
这有助于进行逻辑梳理、步骤拆解或错误反思,并为你提供额外的思考空间。
Args:
current_state_analysis: 分析当前的任务状态和已获取的上下文。
next_steps: 接下来要执行的具体动作列表 (TODO list)。
potential_risks: 这一步可能遇到的问题或潜在的陷阱(可选)。
"""
print(f"\nAgent is thinking...")
print(f"Analysis: {current_state_analysis}")
print(f"Plan:")
for i, step in enumerate(next_steps, 1):
print(f" {i}. {step}")
if potential_risks:
print(f"Potential Risks: {potential_risks}")
print("-" * 20 + "\n")
return "思考过程已成功记录。你现在可以执行计划中的下一步操作。"
def get_tools(*args, **kwargs) -> List:
"""
返回供挂载的工具函数列表。
"""
return [think_and_plan]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |