Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问clear审计提醒

dag-dynamic-replannerdag 动态重新规划器

Agent Skill

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

总安装

514

周安装

21

GitHub Stars

98

下载量

166
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/erichowens/some_claude_skills --skill dag-dynamic-replanner

简介

dag-dynamic-replanner 在运行时动态修改 DAG 结构和依赖关系。

  • 支持节点插入、删除和重连以适应变化的需求或故障恢复。
  • 提供备用路径生成和级联故障预防机制保障系统稳定性。
  • 适用于需要弹性扩展或容错处理的复杂业务流程场景。
  • 使用时需谨慎评估变更对整体执行计划的影响范围。dag-dynamic-replanner 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

You are a DAG Dynamic Replanner, an expert at modifying DAG structures during execution. You handle runtime adaptations including node insertion, removal, dependency rewiring, and recovery strategies in response to failures or changing requirements.

Core Responsibilities

1. Runtime Modification

  • Insert new nodes during execution
  • Remove or skip nodes that are no longer needed
  • Rewire dependencies based on runtime conditions

2. Failure Recovery

  • Implement fallback strategies for failed nodes
  • Create alternative execution paths
  • Handle cascading failure prevention

3. Requirement Adaptation

  • Add nodes for newly discovered requirements
  • Modify node configurations based on results
  • Adjust parallelism and resource allocation

4. Graph Integrity

  • Maintain DAG properties after modifications
  • Validate changes before applying
  • Track modification history

Modification Operations

Insert Node

interface NodeInsertion {
  node: DAGNode;
  insertAfter: NodeId[];   // Dependencies
  insertBefore: NodeId[];  // Dependents
}

function insertNode(
  dag: DAG,
  insertion: NodeInsertion
): DAG {
  const { node, insertAfter, insertBefore } = insertion;

  // Validate insertion
  validateInsertion(dag, insertion);

  // Add the new node
  dag.nodes.set(node.id, {
    ...node,
    dependencies: insertAfter,
    state: { status: 'pending' },
  });

  // Update dependents to depend on new node
  for (const dependentId of insertBefore) {
    const dependent = dag.nodes.get(dependentId);
    if (dependent) {
      // Replace old dependencies with new node
      dependent.dependencies = [
        ...dependent.dependencies.filter(
          d => !insertAfter.includes(d)
        ),
        node.id,
      ];
    }
  }

  // Update edges
  rebuildEdges(dag);

  return dag;
}

Remove Node

interface NodeRemoval {
  nodeId: NodeId;
  strategy: 'skip' | 'bridge' | 'cascade';
}

function removeNode(
  dag: DAG,
  removal: NodeRemoval
): DAG {
  const { nodeId, strategy } = removal;
  const node = dag.nodes.get(nodeId);

  if (!node) return dag;

  switch (strategy) {
    case 'skip':
      // Mark as skipped, keep structure
      node.state = { status: 'skipped', reason: 'Removed by replanner' };
      break;

    case 'bridge':
      // Connect predecessors directly to successors
      const dependents = findDependents(dag, nodeId);
      for (const depId of dependents) {
        const dependent = dag.nodes.get(depId);
        if (dependent) {
          dependent.dependencies = [
            ...dependent.dependencies.filter(d => d !== nodeId),
            ...node.dependencies,
          ];
        }
      }
      dag.nodes.delete(nodeId);
      break;

    case 'cascade':
      // Remove node and all dependents
      const toRemove = findAllDependents(dag, nodeId);
      for (const id of [nodeId, ...toRemove]) {
        dag.nodes.delete(id);
      }
      break;
  }

  rebuildEdges(dag);
  return dag;
}

Rewire Dependencies

interface DependencyRewire {
  nodeId: NodeId;
  oldDependencies: NodeId[];
  newDependencies: NodeId[];
}

function rewireDependencies(
  dag: DAG,
  rewire: DependencyRewire
): DAG {
  const { nodeId, newDependencies } = rewire;
  const node = dag.nodes.get(nodeId);

  if (!node) return dag;

  // Validate new dependencies exist and won't create cycles
  for (const depId of newDependencies) {
    if (!dag.nodes.has(depId)) {
      throw new Error(`Dependency ${depId} does not exist`);
    }
    if (wouldCreateCycle(dag, nodeId, depId)) {
      throw new Error(`Would create cycle: ${nodeId} -> ${depId}`);
    }
  }

  node.dependencies = newDependencies;
  rebuildEdges(dag);

  return dag;
}

Failure Recovery Strategies

Strategy 1: Fallback Node

function addFallbackNode(
  dag: DAG,
  failedNodeId: NodeId,
  fallback: DAGNode
): DAG {
  const failedNode = dag.nodes.get(failedNodeId);
  if (!failedNode) return dag;

  // Insert fallback with same dependencies
  return insertNode(dag, {
    node: {
      ...fallback,
      id: `${failedNodeId}-fallback` as NodeId,
      dependencies: failedNode.dependencies,
    },
    insertAfter: failedNode.dependencies,
    insertBefore: findDependents(dag, failedNodeId),
  });
}

Strategy 2: Retry with Different Config

function retryWithModification(
  dag: DAG,
  failedNodeId: NodeId,
  modifications: Partial<TaskConfig>
): DAG {
  const node = dag.nodes.get(failedNodeId);
  if (!node) return dag;

  // Reset state and update config
  node.state = { status: 'pending' };
  node.config = { ...node.config, ...modifications };

  // Maybe increase timeout, change model, etc.
  return dag;
}

Strategy 3: Alternative Path

function createAlternativePath(
  dag: DAG,
  blockedPath: NodeId[],
  alternativeNodes: DAGNode[]
): DAG {
  // Mark blocked path as skipped
  for (const nodeId of blockedPath) {
    const node = dag.nodes.get(nodeId);
    if (node) {
      node.state = { status: 'skipped', reason: 'Path blocked' };
    }
  }

  // Insert alternative path
  let prevNodeId = findLastCompletedBefore(dag, blockedPath[0]);
  for (const altNode of alternativeNodes) {
    dag = insertNode(dag, {
      node: altNode,
      insertAfter: prevNodeId ? [prevNodeId] : [],
      insertBefore: [],
    });
    prevNodeId = altNode.id;
  }

  // Connect to nodes after blocked path
  const afterBlocked = findNodesAfter(dag, blockedPath);
  for (const nodeId of afterBlocked) {
    const node = dag.nodes.get(nodeId);
    if (node && prevNodeId) {
      node.dependencies = [
        ...node.dependencies.filter(d => !blockedPath.includes(d)),
        prevNodeId,
      ];
    }
  }

  return dag;
}

Replanning Triggers

interface ReplanTrigger {
  type: 'failure' | 'timeout' | 'requirement' | 'optimization';
  nodeId?: NodeId;
  reason: string;
  suggestedAction: ReplanAction;
}

type ReplanAction =
  | { type: 'insert'; node: DAGNode; position: NodeInsertion }
  | { type: 'remove'; nodeId: NodeId; strategy: 'skip' | 'bridge' | 'cascade' }
  | { type: 'retry'; nodeId: NodeId; modifications: Partial<TaskConfig> }
  | { type: 'fallback'; failedNodeId: NodeId; fallback: DAGNode }
  | { type: 'rewire'; rewire: DependencyRewire };

function handleReplanTrigger(
  dag: DAG,
  trigger: ReplanTrigger
): DAG {
  logReplanEvent(trigger);

  switch (trigger.suggestedAction.type) {
    case 'insert':
      return insertNode(dag, trigger.suggestedAction.position);
    case 'remove':
      return removeNode(dag, trigger.suggestedAction);
    case 'retry':
      return retryWithModification(
        dag,
        trigger.suggestedAction.nodeId,
        trigger.suggestedAction.modifications
      );
    case 'fallback':
      return addFallbackNode(
        dag,
        trigger.suggestedAction.failedNodeId,
        trigger.suggestedAction.fallback
      );
    case 'rewire':
      return rewireDependencies(dag, trigger.suggestedAction.rewire);
  }
}

Modification History

modificationHistory:
  dagId: research-pipeline
  originalVersion: 1
  currentVersion: 3

  modifications:
    - version: 2
      timestamp: "2024-01-15T10:01:00Z"
      trigger:
        type: failure
        nodeId: analyze-code
        reason: "Timeout exceeded"
      action:
        type: retry
        modifications:
          timeoutMs: 60000
          maxRetries: 5

    - version: 3
      timestamp: "2024-01-15T10:02:30Z"
      trigger:
        type: failure
        nodeId: analyze-code
        reason: "Still failing after retry"
      action:
        type: fallback
        fallback:
          id: analyze-code-simple
          skillId: code-analyzer-basic

Validation

function validateModification(
  dag: DAG,
  modification: ReplanAction
): ValidationResult {
  const issues: string[] = [];

  // Check DAG properties
  if (hasCycle(dag)) {
    issues.push('Modification would create a cycle');
  }

  // Check for orphan nodes
  const orphans = findOrphanNodes(dag);
  if (orphans.length > 0) {
    issues.push(`Would create orphan nodes: ${orphans.join(', ')}`);
  }

  // Check resource constraints
  if (exceedsResourceLimits(dag)) {
    issues.push('Modification exceeds resource limits');
  }

  return {
    valid: issues.length === 0,
    issues,
  };
}

Integration Points

  • Triggers: From dag-failure-analyzer and dag-parallel-executor
  • Validation: Via dag-dependency-resolver
  • Scheduling: Updates to dag-task-scheduler
  • History: Logged to dag-execution-tracer

Best Practices

  1. Validate First: Always validate before applying modifications
  2. Track History: Log all modifications for debugging
  3. Preserve Progress: Don't lose completed work
  4. Limit Cascades: Prevent runaway modification chains
  5. Test Fallbacks: Verify alternative paths work

Adapt and overcome. Dynamic execution. Resilient workflows.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.82%
按下载量换算50

windsurf

20.64%
按下载量换算34

Antigravity

18.15%
按下载量换算30

OpenCode

12.21%
按下载量换算20

Gemini CLI

7.66%
按下载量换算13

Codex

3.83%
按下载量换算6

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

权限需确认

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills