magic-need
Capture what your AI agent wishes it had. Let your agent spec your product for you.
Overview
When an AI agent is executing a task and hits a wall because it lacks data or tools, instead of just failing or working around it, this skill lets the agent register exactly what it's missing. Over time, this builds a prioritized roadmap of integrations and features.
Inspired by Sonarly's magic_fetch concept — give the agent a "tool that does nothing" and let it tell you what it actually needs.
Usage
As an Agent (During Task Execution)
When you realize you need something you don't have:
CODEBLOCK0
The CLI will:
- 1. Save the need to INLINECODE1
- Auto-categorize it (integration, observability, devops, auth, database, storage)
- Return a confirmation with the need ID
As a Human (Reviewing Needs)
CODEBLOCK1
Auto-Categorization
Needs are automatically categorized based on description keywords:
| Category | Keywords | Example Need |
|---|
| INLINECODE2 | api, endpoint | "API for fetching user data" |
| INLINECODE3 |
metric, log, monitor | "Error logs from last hour" |
|
devops | deploy, pipeline, ci | "Recent deployments of service X" |
|
auth | user, auth, login, permission | "Auth tokens for service Y" |
|
database | database, db, query, schema | "Query to get active users" |
|
storage | file, storage, upload, s3 | "Upload files to cloud storage" |
|
general | (default) | Other needs |
Data Format
Needs are stored as JSON in ~/.magic-need/needs.json:
CODEBLOCK2
Report Format
The report command outputs a formatted summary:
CODEBLOCK3
Best Practices
Good Need Descriptions
Be specific about what you need:
- - ✅ "API endpoint for deploys in the last 2 hours, filtered by service name"
- ✅ "CPU and memory metrics for upstream auth-service pods"
- ✅ "Feature flags that changed in the last 24h for api-gateway"
- ✅ "Sentry errors grouped by affected user segment"
Bad Need Descriptions
Avoid vague descriptions:
- - ❌ "need more data"
- ❌ "can't do this without tools"
- ❌ "would be nice to have logs"
Integration Roadmap
Periodically review the generated reports to:
- 1. Identify patterns (which categories have the most needs?)
- Prioritize integrations (which needs block the most tasks?)
- Build the most impactful tools first
CLI Reference
See scripts/cli.js for the full implementation.
Commands
| Command | Description |
|---|
| INLINECODE12 | Register a new need |
| INLINECODE13 |
List all needs |
|
cli.js report | Generate formatted report |
|
cli.js clear | Archive pending needs |
Cron Integration
To receive daily reports, set up a cronjob:
CODEBLOCK4
Or use OpenClaw's cron system to send reports to a Discord channel.
magic-need
捕捉你的AI智能体所渴望拥有的能力。让你的智能体为你规划产品需求。
概述
当AI智能体在执行任务时因缺乏数据或工具而受阻,该技能允许智能体精确记录所缺失的内容,而非直接失败或绕道而行。久而久之,这将构建出一份按优先级排序的集成与功能路线图。
灵感源自Sonarly的magic_fetch概念——为智能体提供一个无所作为的工具,让它告诉你真正需要什么。
使用方法
作为智能体(任务执行期间)
当你意识到需要某些尚未拥有的东西时:
bash
选项1:直接使用CLI
node ~/.openclaw/skills/magic-need/scripts/cli.js 服务X近期部署的API
选项2:通过shell执行
exec({
command: node ~/.openclaw/skills/magic-need/scripts/cli.js 上游服务的CPU指标
})
CLI将执行以下操作:
- 1. 将需求保存至~/.magic-need/needs.json
- 自动分类(集成、可观测性、运维、认证、数据库、存储)
- 返回包含需求ID的确认信息
作为人类(审查需求)
bash
列出所有需求
node scripts/cli.js list
生成报告(按类别分组)
node scripts/cli.js report
归档已解决的需求
node scripts/cli.js clear
自动分类
需求根据描述关键词自动分类:
| 类别 | 关键词 | 示例需求 |
|---|
| 集成 | api, endpoint | 获取用户数据的API |
| 可观测性 |
metric, log, monitor | 过去一小时的错误日志 |
| 运维 | deploy, pipeline, ci | 服务X的近期部署 |
| 认证 | user, auth, login, permission | 服务Y的认证令牌 |
| 数据库 | database, db, query, schema | 获取活跃用户的查询 |
| 存储 | file, storage, upload, s3 | 上传文件至云存储 |
| 通用 | (默认) | 其他需求 |
数据格式
需求以JSON格式存储在~/.magic-need/needs.json中:
json
[
{
id: j8ldlr,
description: 近期部署的API,
createdAt: 2026-03-07T18:09:18.123Z,
status: pending,
category: integration
}
]
报告格式
report命令输出格式化摘要:
🪄 魔法需求报告 — 4个待处理
🔌 集成 (2)
• 认证服务的近期部署API
• 近期切换的功能标志
📊 可观测性 (1)
• 上游数据库的CPU指标
📝 通用 (1)
• 可视化数据流的工具
最佳实践
良好的需求描述
具体说明你的需求:
- - ✅ 过去2小时内按服务名称筛选的部署API端点
- ✅ 上游认证服务Pod的CPU和内存指标
- ✅ 过去24小时内API网关变更的功能标志
- ✅ 按受影响用户分组的Sentry错误
不良的需求描述
避免模糊描述:
- - ❌ 需要更多数据
- ❌ 没有工具无法完成
- ❌ 有日志就好了
集成路线图
定期审查生成的报告以:
- 1. 识别模式(哪些类别需求最多?)
- 确定集成优先级(哪些需求阻碍了最多任务?)
- 优先构建最具影响力的工具
CLI参考
完整实现见scripts/cli.js。
命令
| 命令 | 描述 |
|---|
| cli.js 描述 | 注册新需求 |
| cli.js list |
列出所有需求 |
| cli.js report | 生成格式化报告 |
| cli.js clear | 归档待处理需求 |
定时任务集成
如需接收每日报告,设置定时任务:
bash
每日晚上10点
0 22
* node ~/.openclaw/skills/magic-need/scripts/cli.js report | your-notification-script
或使用OpenClaw的定时任务系统将报告发送至Discord频道。