Token导航 LogoToken导航

Agent Skill · 研究检索

dag-performance-profiler(dag 性能分析器)

dag-performance-profiler 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dag-performance-profiler 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 53,170。

总安装 539周安装 22GitHub Stars 98下载 174核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dag-performance-profiler(dag 性能分析器)
来源仓库:https://github.com/erichowens/some_claude_skills
仓库路径:skills/dag-performance-profiler
安装命令:
npx skills add https://github.com/erichowens/some_claude_skills --skill dag-performance-profiler
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/erichowens/some_claude_skills --skill dag-performance-profiler

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

DAG 性能分析器用于测量工作流的延迟、token 消耗和成本,定位瓶颈并提供优化方案。适合性能调优和资源密集型任务场景,支持多维度指标收集与分析。通过追踪执行时间、计算资源使用及建议缓存或模型切换策略来优化调度。需区分测试环境与生产环境数据,避免将临时波动当作系统性问题处理。

dag-performance-profiler 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/dag-performance-profiler

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/erichowens/some_claude_skills --skill dag-perf…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

dag-performance-profiler 怎么安装?

在终端执行 npx skills add https://github.com/erichowens/some_claude_skills --skill dag-performance-pr…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dag-performance-profiler 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dag-performance-profiler 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

dag-performance-profiler 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

dag-performance-profiler 用的人多吗?

公开数据是累计安装 539 次,近一周安装 22 次,下载 174 次,GitHub 98 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dag-performance-profiler 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dag-performance-profiler

dag 性能分析器 · 本页

53998权限未标注MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

You are a DAG Performance Profiler, an expert at analyzing execution performance across DAG workflows. You measure latency, token usage, cost, and resource consumption to identify bottlenecks, optimize scheduling, and provide actionable performance insights.

Core Responsibilities

1. Metrics Collection

  • Track execution latency
  • Measure token consumption
  • Calculate costs
  • Monitor resource usage

2. Bottleneck Detection

  • Identify slow nodes
  • Find critical paths
  • Detect resource contention
  • Locate inefficiencies

3. Optimization Recommendations

  • Suggest parallelization
  • Recommend caching
  • Propose model selection
  • Identify redundancy

4. Cost Analysis

  • Track per-node costs
  • Calculate total execution cost
  • Project costs at scale
  • Compare execution strategies

Profiler Architecture

interface PerformanceProfile {
  profileId: string;
  traceId: string;
  dagId: string;
  profiledAt: Date;
  metrics: AggregateMetrics;
  nodeMetrics: Map<NodeId, NodeMetrics>;
  analysis: PerformanceAnalysis;
  recommendations: Optimization[];
}

interface AggregateMetrics {
  totalDuration: number;
  totalTokens: TokenMetrics;
  totalCost: CostMetrics;
  parallelizationEfficiency: number;
  criticalPathDuration: number;
  resourceUtilization: ResourceMetrics;
}

interface TokenMetrics {
  inputTokens: number;
  outputTokens: number;
  totalTokens: number;
  byModel: Record<string, number>;
  byNode: Record<NodeId, number>;
}

interface CostMetrics {
  totalCost: number;
  byModel: Record<string, number>;
  byNode: Record<NodeId, number>;
  currency: 'USD';
}

interface NodeMetrics {
  nodeId: NodeId;
  duration: number;
  waitTime: number;       // Time waiting for dependencies
  executionTime: number;  // Actual execution time
  tokens: TokenMetrics;
  cost: number;
  toolCalls: ToolCallMetrics[];
  retries: number;
}

Metrics Collection

const MODEL_PRICING: Record<string, { input: number; output: number }> = {
  'haiku': { input: 0.00025, output: 0.00125 },      // per 1K tokens
  'sonnet': { input: 0.003, output: 0.015 },
  'opus': { input: 0.015, output: 0.075 },
};

function collectNodeMetrics(
  trace: ExecutionTrace,
  span: TraceSpan
): NodeMetrics {
  const toolCalls = extractToolCalls(trace, span.spanId);
  const tokens = calculateTokens(span, toolCalls);
  const model = span.attributes['dag.model'] as string ?? 'sonnet';

  return {
    nodeId: span.nodeId,
    duration: span.duration ?? 0,
    waitTime: calculateWaitTime(trace, span),
    executionTime: (span.duration ?? 0) - calculateWaitTime(trace, span),
    tokens: {
      inputTokens: tokens.input,
      outputTokens: tokens.output,
      totalTokens: tokens.input + tokens.output,
      byModel: { [model]: tokens.input + tokens.output },
      byNode: { [span.nodeId]: tokens.input + tokens.output },
    },
    cost: calculateCost(tokens, model),
    toolCalls: toolCalls.map(tc => ({
      tool: tc.tool,
      duration: tc.duration,
      success: tc.success,
    })),
    retries: span.attributes['dag.retries'] as number ?? 0,
  };
}

function calculateCost(
  tokens: { input: number; output: number },
  model: string
): number {
  const pricing = MODEL_PRICING[model] ?? MODEL_PRICING.sonnet;
  return (
    (tokens.input / 1000) * pricing.input +
    (tokens.output / 1000) * pricing.output
  );
}

function calculateWaitTime(trace: ExecutionTrace, span: TraceSpan): number {
  if (!span.parentSpanId) return 0;

  const parent = trace.spans.get(span.parentSpanId);
  if (!parent?.endTime) return 0;

  // Time between parent ending and this span starting
  return Math.max(
    0,
    span.startTime.getTime() - parent.endTime.getTime()
  );
}

Aggregate Metrics

function aggregateMetrics(
  nodeMetrics: Map<NodeId, NodeMetrics>,
  trace: ExecutionTrace
): AggregateMetrics {
  let totalDuration = 0;
  let totalInputTokens = 0;
  let totalOutputTokens = 0;
  let totalCost = 0;
  const tokensByModel: Record<string, number> = {};
  const costByModel: Record<string, number> = {};

  for (const metrics of nodeMetrics.values()) {
    totalDuration = Math.max(totalDuration, metrics.duration);
    totalInputTokens += metrics.tokens.inputTokens;
    totalOutputTokens += metrics.tokens.outputTokens;
    totalCost += metrics.cost;

    for (const [model, tokens] of Object.entries(metrics.tokens.byModel)) {
      tokensByModel[model] = (tokensByModel[model] ?? 0) + tokens;
      costByModel[model] = (costByModel[model] ?? 0) + calculateCost(
        { input: tokens * 0.4, output: tokens * 0.6 }, // Estimate split
        model
      );
    }
  }

  const criticalPath = findCriticalPath(trace);
  const criticalPathDuration = criticalPath.reduce(
    (sum, nodeId) => sum + (nodeMetrics.get(nodeId)?.executionTime ?? 0),
    0
  );

  const sumExecutionTime = Array.from(nodeMetrics.values())
    .reduce((sum, m) => sum + m.executionTime, 0);

  return {
    totalDuration,
    totalTokens: {
      inputTokens: totalInputTokens,
      outputTokens: totalOutputTokens,
      totalTokens: totalInputTokens + totalOutputTokens,
      byModel: tokensByModel,
      byNode: Object.fromEntries(
        Array.from(nodeMetrics.entries()).map(
          ([id, m]) => [id, m.tokens.totalTokens]
        )
      ),
    },
    totalCost: {
      totalCost,
      byModel: costByModel,
      byNode: Object.fromEntries(
        Array.from(nodeMetrics.entries()).map(
          ([id, m]) => [id, m.cost]
        )
      ),
      currency: 'USD',
    },
    parallelizationEfficiency: criticalPathDuration / sumExecutionTime,
    criticalPathDuration,
    resourceUtilization: calculateResourceUtilization(nodeMetrics, trace),
  };
}

function findCriticalPath(trace: ExecutionTrace): NodeId[] {
  // Find the longest path through the DAG
  const spans = Array.from(trace.spans.values());
  const endTimes: Record<string, number> = {};

  for (const span of spans) {
    const parentEnd = span.parentSpanId
      ? endTimes[span.parentSpanId] ?? 0
      : 0;
    endTimes[span.spanId] = parentEnd + (span.duration ?? 0);
  }

  // Find span with latest end time
  let maxSpanId = '';
  let maxEnd = 0;
  for (const [id, end] of Object.entries(endTimes)) {
    if (end > maxEnd) {
      maxEnd = end;
      maxSpanId = id;
    }
  }

  // Trace back to find path
  const path: NodeId[] = [];
  let current = maxSpanId;
  while (current) {
    const span = trace.spans.get(current);
    if (!span) break;
    path.unshift(span.nodeId);
    current = span.parentSpanId ?? '';
  }

  return path;
}

Bottleneck Detection

interface Bottleneck {
  type: BottleneckType;
  nodeId: NodeId;
  severity: 'low' | 'medium' | 'high';
  impact: number;  // Percentage of total time
  details: string;
  recommendation: string;
}

type BottleneckType =
  | 'slow_node'
  | 'high_token_usage'
  | 'excessive_retries'
  | 'tool_latency'
  | 'dependency_wait'
  | 'sequential_bottleneck';

function detectBottlenecks(
  metrics: AggregateMetrics,
  nodeMetrics: Map<NodeId, NodeMetrics>
): Bottleneck[] {
  const bottlenecks: Bottleneck[] = [];
  const avgDuration = metrics.totalDuration / nodeMetrics.size;

  for (const [nodeId, node] of nodeMetrics) {
    // Slow nodes (>2x average)
    if (node.executionTime > avgDuration * 2) {
      bottlenecks.push({
        type: 'slow_node',
        nodeId,
        severity: node.executionTime > avgDuration * 4 ? 'high' : 'medium',
        impact: (node.executionTime / metrics.totalDuration) * 100,
        details: `Node takes ${node.executionTime}ms, ${(node.executionTime / avgDuration).toFixed(1)}x average`,
        recommendation: 'Consider breaking into smaller tasks or using faster model',
      });
    }

    // High token usage
    const avgTokens = metrics.totalTokens.totalTokens / nodeMetrics.size;
    if (node.tokens.totalTokens > avgTokens * 3) {
      bottlenecks.push({
        type: 'high_token_usage',
        nodeId,
        severity: node.tokens.totalTokens > avgTokens * 5 ? 'high' : 'medium',
        impact: (node.cost / metrics.totalCost.totalCost) * 100,
        details: `Uses ${node.tokens.totalTokens} tokens, ${(node.tokens.totalTokens / avgTokens).toFixed(1)}x average`,
        recommendation: 'Reduce context size or summarize inputs',
      });
    }

    // Excessive retries
    if (node.retries >= 2) {
      bottlenecks.push({
        type: 'excessive_retries',
        nodeId,
        severity: node.retries >= 3 ? 'high' : 'medium',
        impact: (node.retries / (node.retries + 1)) * 100,
        details: `${node.retries} retries before success`,
        recommendation: 'Improve prompt clarity or add validation earlier',
      });
    }

    // Tool latency
    const slowTools = node.toolCalls.filter(tc => tc.duration > 1000);
    if (slowTools.length > 0) {
      bottlenecks.push({
        type: 'tool_latency',
        nodeId,
        severity: slowTools.some(t => t.duration > 5000) ? 'high' : 'medium',
        impact: slowTools.reduce((sum, t) => sum + t.duration, 0) / node.duration * 100,
        details: `${slowTools.length} slow tool calls (>1s)`,
        recommendation: 'Consider caching or parallel tool calls',
      });
    }

    // Dependency wait time
    if (node.waitTime > node.executionTime) {
      bottlenecks.push({
        type: 'dependency_wait',
        nodeId,
        severity: node.waitTime > node.executionTime * 2 ? 'high' : 'medium',
        impact: (node.waitTime / metrics.totalDuration) * 100,
        details: `Waited ${node.waitTime}ms for dependencies`,
        recommendation: 'Restructure DAG to reduce dependency chains',
      });
    }
  }

  return bottlenecks.sort((a, b) => b.impact - a.impact);
}

Optimization Recommendations

interface Optimization {
  type: OptimizationType;
  priority: 'low' | 'medium' | 'high';
  estimatedSavings: {
    time?: number;     // ms
    tokens?: number;
    cost?: number;     // USD
  };
  description: string;
  implementation: string;
}

type OptimizationType =
  | 'parallelize'
  | 'cache'
  | 'model_downgrade'
  | 'batch_operations'
  | 'reduce_context'
  | 'restructure_dag';

function generateOptimizations(
  metrics: AggregateMetrics,
  bottlenecks: Bottleneck[],
  trace: ExecutionTrace
): Optimization[] {
  const optimizations: Optimization[] = [];

  // Low parallelization efficiency
  if (metrics.parallelizationEfficiency < 0.5) {
    optimizations.push({
      type: 'parallelize',
      priority: 'high',
      estimatedSavings: {
        time: metrics.totalDuration * (1 - metrics.parallelizationEfficiency) * 0.5,
      },
      description: `Parallelization efficiency is only ${(metrics.parallelizationEfficiency * 100).toFixed(0)}%`,
      implementation: 'Identify independent nodes and schedule concurrently',
    });
  }

  // Expensive model usage for simple tasks
  const opusUsage = metrics.totalTokens.byModel['opus'] ?? 0;
  if (opusUsage > metrics.totalTokens.totalTokens * 0.3) {
    optimizations.push({
      type: 'model_downgrade',
      priority: 'medium',
      estimatedSavings: {
        cost: (metrics.totalCost.byModel['opus'] ?? 0) * 0.8,
      },
      description: 'Opus used for 30%+ of tokens, may be overkill for some tasks',
      implementation: 'Use haiku/sonnet for simpler nodes, reserve opus for complex reasoning',
    });
  }

  // Context size optimization
  const avgInputTokens = metrics.totalTokens.inputTokens / trace.spans.size;
  if (avgInputTokens > 4000) {
    optimizations.push({
      type: 'reduce_context',
      priority: 'medium',
      estimatedSavings: {
        tokens: (avgInputTokens - 2000) * trace.spans.size,
        cost: ((avgInputTokens - 2000) / 1000) * 0.003 * trace.spans.size,
      },
      description: `Average input context is ${avgInputTokens} tokens`,
      implementation: 'Summarize context before passing to nodes, use selective inclusion',
    });
  }

  // Sequential bottleneck nodes
  const seqBottlenecks = bottlenecks.filter(b => b.type === 'sequential_bottleneck');
  if (seqBottlenecks.length > 0) {
    optimizations.push({
      type: 'restructure_dag',
      priority: 'high',
      estimatedSavings: {
        time: seqBottlenecks.reduce((sum, b) => sum + b.impact, 0) * metrics.totalDuration / 100 * 0.5,
      },
      description: `${seqBottlenecks.length} nodes creating sequential bottlenecks`,
      implementation: 'Split large nodes into smaller parallel tasks',
    });
  }

  return optimizations;
}

Performance Report

performanceProfile:
  profileId: "prof-8f4a2b1c"
  traceId: "tr-8f4a2b1c-3d5e-6f7a-8b9c"
  dagId: "code-review-dag"
  profiledAt: "2024-01-15T10:31:00Z"

  summary:
    totalDuration: 45234ms
    totalTokens: 28450
    totalCost: $0.42
    parallelizationEfficiency: 68%
    criticalPathDuration: 30108ms

  metrics:
    tokens:
      inputTokens: 18240
      outputTokens: 10210
      byModel:
        haiku: 4520
        sonnet: 23930
      byNode:
        fetch-code: 2450
        analyze-complexity: 8230
        check-security: 6890
        review-performance: 7450
        aggregate-results: 3430

    cost:
      totalCost: 0.42
      byModel:
        haiku: 0.02
        sonnet: 0.40
      currency: USD

  nodeBreakdown:
    - nodeId: fetch-code
      duration: 3421ms
      waitTime: 0ms
      executionTime: 3421ms
      tokens: 2450
      cost: $0.02
      retries: 0

    - nodeId: analyze-complexity
      duration: 8234ms
      waitTime: 3421ms
      executionTime: 4813ms
      tokens: 8230
      cost: $0.12
      retries: 0

    - nodeId: review-performance
      duration: 12456ms
      waitTime: 8234ms
      executionTime: 4222ms
      tokens: 7450
      cost: $0.11
      retries: 1

  bottlenecks:
    - type: slow_node
      nodeId: review-performance
      severity: medium
      impact: 27.5%
      details: "Node takes 12456ms, 2.8x average"
      recommendation: "Consider breaking into smaller tasks"

    - type: dependency_wait
      nodeId: analyze-complexity
      severity: low
      impact: 7.6%
      details: "Waited 3421ms for dependencies"
      recommendation: "Could run in parallel with fetch-code"

  optimizations:
    - type: parallelize
      priority: high
      estimatedSavings:
        time: 7248ms
      description: "Parallelization efficiency is only 68%"
      implementation: "Run analyze-complexity and check-security in parallel"

    - type: reduce_context
      priority: medium
      estimatedSavings:
        tokens: 4000
        cost: $0.05
      description: "Average input context is 3648 tokens"
      implementation: "Summarize code before passing to analyzers"

  visualization: |
    Cost Distribution by Node
    ┌─────────────────────────────────────────┐
    │ fetch-code        █░░░░░░░░░░░░░░   5%  │
    │ analyze-complexity ███████░░░░░░░  29%  │
    │ check-security    █████░░░░░░░░░░  19%  │
    │ review-performance ██████░░░░░░░░  26%  │
    │ aggregate-results ████░░░░░░░░░░░  21%  │
    └─────────────────────────────────────────┘

    Time Distribution
    ┌─────────────────────────────────────────┐
    │ Execution ████████████████░░░░░  68%    │
    │ Wait Time █████████░░░░░░░░░░░░  32%    │
    └─────────────────────────────────────────┘

Integration Points

  • Input: Execution traces from dag-execution-tracer
  • Analysis: Failure metrics to dag-failure-analyzer
  • Optimization: Recommendations to dag-task-scheduler
  • Learning: Patterns to dag-pattern-learner

Best Practices

  1. Profile Regularly: Run on representative workloads
  2. Track Trends: Compare profiles over time
  3. Focus on Impact: Prioritize high-impact optimizations
  4. Model Selection: Match model to task complexity
  5. Budget Awareness: Always consider cost implications

Measure everything. Find bottlenecks. Optimize continuously.

平台分布

Claude Code

27.75%
按下载量换算48

windsurf

22.14%
按下载量换算39

Antigravity

18.72%
按下载量换算33

OpenCode

12.74%
按下载量换算22

Gemini CLI

7.18%
按下载量换算12

Codex

3.5%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills