ln-222-story-replanner by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-222-story-replanner路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在目录并向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
当史诗需求变更时,重新规划现有的故事。比较理想计划与现有故事,对操作进行分类(保留/更新/废弃/创建),并在 Linear 中执行变更。由 ln-220-story-coordinator 调用。
用于在需求变更时更新史诗中故事的通用重规划工作器。由 ln-220-story-coordinator 调用(数量 ≥ 1)。
ln-220-story-coordinator 重规划模式(阶段 5b):
epicData、、、、、广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
idealPlanstandardsResearchexistingStoryIdsteamIdautoApprove来自 ln-220-story-coordinator:
{
epicData: {id, title, description},
idealPlan: [{number, title, statement, ac, technicalNotes, estimatedHours, testCounts}],
standardsResearch: "OAuth 2.0 (RFC 6749)...", // 可能与现有内容不同
existingStoryIds: ["STORY-123", "STORY-124"], // 仅元数据
teamId: "team-id",
autoApprove: true
}
| 输入 | 必需 | 来源 | 描述 |
|---|---|---|---|
epicId | 是 | args, kanban, user | 要处理的史诗 |
解析: 史诗解析链。状态过滤器: 活动状态(已计划/已开始)
必读: 加载 shared/references/tools_config_guide.md、shared/references/storage_mode_detection.md、shared/references/input_resolution_pattern.md
提取:task_provider = 任务管理 → 提供者
步骤 0:解析 epicId(仅独立运行时执行 — 如果 ln-220 编排器提供了 epicData 则跳过):根据指南运行史诗解析链。
为提升令牌效率进行渐进式加载:
步骤 1: 编排器提供故事元数据(ID、标题、状态)
步骤 2: 逐个加载完整描述
如果 task_provider == "linear":
for each story_id:
get_issue(id=story_id) // 每个故事约 5,000 个令牌
否则(文件模式):
for each story_id:
Read("docs/tasks/epics/epic-{N}-*/stories/us{NNN}-*/story.md") // 每个故事约 5,000 个令牌
令牌原理说明: 10 个故事 × 5,000 = 50,000 个令牌。顺序加载以管理上下文。
步骤 3: 为每个故事解析 9 个部分
步骤 4: 提取元数据
输出: 用于比较的 N 个现有故事结构数组。
必读: 加载 replan_algorithm_stories.md 以了解重规划算法。
根据目标、角色、能力进行匹配:
对于理想计划中的每个故事:
对于每个现有故事:
对操作进行分类:
| 操作 | 标准 | 状态约束 | 动作 |
|---|---|---|---|
| 保留 | 目标 + 角色 + 能力 + 验收标准 + 标准研究相同 | 任意 | 无 |
| 更新 | 匹配 + (验收标准 或 标准研究 或 技术说明 已变更) | 待办/待处理 ✅进行中/评审中 ⚠️已完成 ❌ | update_issue |
| 废弃 | 无匹配 + 功能已移除 | 待办/待处理 ✅进行中/评审中 ⚠️已完成 ❌ | update_issue(state="Canceled") |
| 创建 | 在理想计划中 + 无匹配 + 新需求 | 不适用 | 生成文档 + create_issue |
边缘情况:
| 情况 | 动作 |
|---|---|
| 进行中的废弃 | ⚠️ 不自动取消,显示警告 |
| 已完成冲突 | 保留已完成状态,创建后续故事 |
| 故事拆分(1 → 2+) | ⚠️ 更新第一个 + 创建新的 |
| 故事合并(2+ → 1) | ⚠️ 更新第一个 + 废弃其余 |
| 模糊匹配(>70% 相似度) | 显示全部,选择最高的 |
史诗 7 的重规划摘要:OAuth 认证
理想计划:
1. US004:注册 OAuth 客户端(角色:第三方开发者)
2. US005:请求访问令牌 ← 新增 AC5! ← 新增 RFC 7636 PKCE!
3. US006:验证访问令牌
4. US009:令牌范围管理(新功能!)
现有故事:
✓ US004 - 状态:已完成 - 保留
⚠ US005 - 状态:待处理 - 更新
变更:新增 AC5,在技术说明中新增 RFC 7636,新增 2 个集成测试
差异(验收标准):+ AC5 "给定公共客户端,当使用 PKCE 请求时..."
差异(技术说明):+ RFC 7636 (PKCE)
✗ US008 - 状态:待处理 - 废弃(功能已移除)
+ US009 - 新功能(14小时,20个测试,OAuth 2.0 范围标准)
操作:2 个保留,1 个更新,1 个取消,1 个创建
警告:
- ⚠️ US005 (待处理):验收标准已变更,标准研究已更新
- ⚠️ US008 (待处理):功能已移除 - 检查依赖项
输入 "confirm" 以执行。
差异显示:
警告针对:
如果 autoApprove=true: 跳过 → 阶段 5 否则: 等待 "confirm"
调整: 用户可以请求更改 → 重新分类 → 显示更新后的摘要 → 循环直到 "confirm"
顺序: 更新 → 废弃 → 创建 → 更新看板
更新操作:
save_issue({id, description: new_description}) 否则: Edit("docs/tasks/epics/.../stories/us{NNN}-*/story.md") 并写入新内容create_comment({issueId, body: "故事已更新:..."}) 否则: Write(".../stories/us{NNN}-*/comments/{ISO-timestamp}.md") 并写入更新说明废弃操作:
save_issue({id, state: "Canceled"}) 否则: Edit **状态:** 行,在 story.md 中改为 **状态:** 已取消create_comment({issueId, body: "故事已取消:..."}) 否则: Write(".../comments/{ISO-timestamp}.md") 并写入取消说明创建操作:
save_issue({title, description, project: Epic.id, team: teamId, labels: ["user-story"], state: "Backlog"}) 否则: mkdir -p .../stories/us{NNN}-{slug}/tasks/ + Write story.md 并包含文件头更新 kanban_board.md:
删除(废弃): 移除已取消的故事行,移除任务行(如果有),如果史诗标题下为空则移除史诗标题
创建(新功能): 找到 ### 待办事项 → 搜索史诗分组 → 添加故事(2 空格缩进)
更新史诗故事计数器: 最后一个故事,下一个故事
返回:
史诗 7 的重规划已执行
操作摘要:
✓ 保留:2 个故事
✓ 更新:1 个故事(验收标准/标准研究已变更)
✓ 取消:1 个故事(功能已移除)
✓ 创建:1 个故事(新需求)
已更新:[ID: US005](url) - 新增 AC5,新增 RFC 7636 PKCE
已取消:US008 自定义令牌格式
新功能:[ID: US009](url) - 令牌范围管理
警告:US005 (待处理) 验收标准已变更
✓ kanban_board.md 已更新
✓ 标准研究更新:RFC 7636 PKCE 已添加到 US005
后续步骤:
1. 审查警告
2. 对已更新/创建的故事运行 ln-310-multi-agent-validator
3. 使用 ln-300-task-coordinator 创建/重规划任务
| 规则 | 描述 |
|---|---|
| 状态约束 | 更新/废弃:待办/待处理 ✅,进行中/评审中 ⚠️,已完成 ❌ |
| 保留已完成 | 永不更新/取消已完成的故事(如果冲突则创建后续故事) |
| 故事拆分/合并 | 检测 1→2+ 或 2+→1,显示警告(复杂,影响任务) |
| 清晰的差异 | 为更新显示变更前/后(验收标准、标准研究、技术说明) |
| 有意义的评论 | 解释为何更新/取消(引用已移除的能力) |
| 保守更新 | 有疑问时优先选择创建而非更新 |
| 渐进式加载 | 逐个加载故事(非一次性全部加载,提升令牌效率) |
✅ 阶段 1:
✅ 阶段 2:
✅ 阶段 3:
✅ 阶段 4:
✅ 阶段 5:
必读: 加载 shared/references/template_loading_pattern.md 以了解模板复制工作流。
模板: story_template.md 本地副本: docs/templates/story_template.md(在目标项目中)
shared/references/tools_config_guide.mdshared/references/storage_mode_detection.mdshared/references/template_loading_pattern.mdshared/references/linear_creation_workflow.mdshared/references/replan_algorithm.md位置: references/(由此技能拥有) 目的: 重规划模式(故事级别)的详细比较逻辑 内容: 保留/更新/废弃/创建规则、匹配标准、状态约束、边缘情况、示例 用法: 应用于阶段 2
位置: shared/templates/story_template.md(集中式) 本地副本: docs/templates/story_template.md(在目标项目中) 目的: 通用故事模板(9 个部分) 用法: 在生成用于更新/创建操作的故事更新文档时,通过模板加载逻辑加载
调用者: ln-220-story-coordinator(阶段 5b,数量 ≥ 1)
返回:
此工作器不执行:
版本: 3.0.0 最后更新: 2025-12-23
每周安装
152
仓库
GitHub 星标
245
首次出现
2026年1月24日
安全审计
安装于
claude-code138
codex136
opencode136
gemini-cli135
cursor135
github-copilot130
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Replans existing Stories when Epic requirements change. Compares IDEAL plan vs existing Stories, categorizes operations (KEEP/UPDATE/OBSOLETE/CREATE), and executes changes in Linear. Invoked by ln-220-story-coordinator.
Universal replanner worker for updating Stories in Epic when requirements change. Invoked by ln-220-story-coordinator (count ≥ 1).
ln-220-story-coordinator REPLAN MODE (Phase 5b):
epicData, idealPlan, standardsResearch, existingStoryIds, teamId, autoApproveFrom ln-220-story-coordinator:
{
epicData: {id, title, description},
idealPlan: [{number, title, statement, ac, technicalNotes, estimatedHours, testCounts}],
standardsResearch: "OAuth 2.0 (RFC 6749)...", // May differ from existing
existingStoryIds: ["STORY-123", "STORY-124"], // Metadata only
teamId: "team-id",
autoApprove: true
}
| Input | Required | Source | Description |
|---|---|---|---|
epicId | Yes | args, kanban, user | Epic to process |
Resolution: Epic Resolution Chain. Status filter: Active (planned/started)
MANDATORY READ: Load shared/references/tools_config_guide.md, shared/references/storage_mode_detection.md, shared/references/input_resolution_pattern.md
Extract: task_provider = Task Management → Provider
Step 0: Resolve epicId (standalone only — skip if epicData provided by ln-220 orchestrator): Run Epic Resolution Chain per guide.
Progressive Loading for token efficiency:
Step 1: Orchestrator provides Story metadata (ID, title, status)
Step 2: Load FULL descriptions ONE BY ONE
IF task_provider == "linear":
for each story_id:
get_issue(id=story_id) // ~5,000 tokens per Story
ELSE (file mode):
for each story_id:
Read("docs/tasks/epics/epic-{N}-*/stories/us{NNN}-*/story.md") // ~5,000 tokens per Story
Token Rationale: 10 Stories × 5,000 = 50,000 tokens. Load sequentially to manage context.
Step 3: Parse 9 sections for each Story
Step 4: Extract metadata
Output: Array of N existing Story structures ready for comparison.
MANDATORY READ: Load replan_algorithm_stories.md for replan algorithm.
Match by goal, persona, capability:
For EACH Story in IDEAL:
For EACH existing Story:
Categorize operations:
| Operation | Criteria | Status Constraint | Action |
|---|---|---|---|
| KEEP | Goal + Persona + Capability + AC + Standards Research same | Any | None |
| UPDATE | Match + (AC OR Standards Research OR Technical Notes changed) | Backlog/Todo ✅In Progress/Review ⚠️Done ❌ | update_issue |
| OBSOLETE | No match + Feature removed | Backlog/Todo ✅In Progress/Review ⚠️Done ❌ | update_issue(state="Canceled") |
| CREATE | In IDEAL + No match + New requirement | N/A | Generate doc + create_issue |
Edge Cases:
| Case | Action |
|---|---|
| In Progress OBSOLETE | ⚠️ NO auto-cancel, show warning |
| Done conflicts | Preserve Done, CREATE follow-up |
| Story Split (1 → 2+) | ⚠️ UPDATE first + CREATE new |
| Story Merge (2+ → 1) | ⚠️ UPDATE first + OBSOLETE rest |
| Ambiguous match (>70% similarity) | Show all, select highest |
Details: replan_algorithm_stories.md
REPLAN SUMMARY for Epic 7: OAuth Authentication
IDEAL PLAN:
1. US004: Register OAuth client (Persona: Third-party developer)
2. US005: Request access token ← AC5 ADDED! ← RFC 7636 PKCE ADDED!
3. US006: Validate access token
4. US009: Token scope management (NEW!)
EXISTING STORIES:
✓ US004 - Status: Done - KEEP
⚠ US005 - Status: Todo - UPDATE
Changes: Add AC5, Add RFC 7636 to Technical Notes, Add 2 Integration tests
Diff (AC): + AC5 "Given public client, When request with PKCE..."
Diff (Technical Notes): + RFC 7636 (PKCE)
✗ US008 - Status: Todo - OBSOLETE (feature removed)
+ US009 - NEW (14h, 20 tests, OAuth 2.0 Scope standard)
OPERATIONS: 2 keep, 1 update, 1 cancel, 1 create
WARNINGS:
- ⚠️ US005 (Todo): AC changed, Standards Research updated
- ⚠️ US008 (Todo): Feature removed - check dependencies
Type "confirm" to execute.
Diffs show:
Warnings for:
If autoApprove=true: Skip → Phase 5 Otherwise: Wait for "confirm"
Adjustment: User can request changes → Recategorize → Show updated summary → Loop until "confirm"
Sequence: UPDATE → OBSOLETE → CREATE → Update kanban
UPDATE operations:
save_issue({id, description: new_description}) ELSE: Edit("docs/tasks/epics/.../stories/us{NNN}-*/story.md") with new contentcreate_comment({issueId, body: "Story updated: ..."}) ELSE: Write(".../stories/us{NNN}-*/comments/{ISO-timestamp}.md") with update noteOBSOLETE operations:
save_issue({id, state: "Canceled"}) ELSE: Edit **Status:** line to **Status:** Canceled in story.mdcreate_comment({issueId, body: "Story canceled: ..."}) ELSE: Write(".../comments/{ISO-timestamp}.md") with cancellation noteCREATE operations:
save_issue({title, description, project: Epic.id, team: teamId, labels: ["user-story"], state: "Backlog"}) ELSE: mkdir -p .../stories/us{NNN}-{slug}/tasks/ + Write story.md with file headersUpdate kanban_board.md:
DELETE (OBSOLETE): Remove canceled Story lines, remove task lines if any, remove Epic header if empty
CREATE (NEW): Find ### Backlog → Search Epic group → Add Stories (2-space indent)
UPDATE Epic Story Counters: Last Story, Next Story
Return:
REPLAN EXECUTED for Epic 7
OPERATIONS SUMMARY:
✓ Kept: 2 Stories
✓ Updated: 1 Story (AC/Standards Research changed)
✓ Canceled: 1 Story (feature removed)
✓ Created: 1 Story (new requirement)
UPDATED: [ID: US005](url) - AC5 added, RFC 7636 PKCE added
CANCELED: US008 Custom token formats
NEW: [ID: US009](url) - Token scope management
WARNINGS: US005 (Todo) AC changed
✓ kanban_board.md updated
✓ Standards Research updates: RFC 7636 PKCE added to US005
NEXT STEPS:
1. Review warnings
2. Run ln-310-multi-agent-validator on updated/created Stories
3. Use ln-300-task-coordinator to create/replan tasks
| Rule | Description |
|---|---|
| Status Constraints | UPDATE/OBSOLETE: Backlog/Todo ✅, In Progress/Review ⚠️, Done ❌ |
| Preserve Done | Never update/cancel Done Stories (CREATE follow-up if conflicts) |
| Story Split/Merge | Detect 1→2+ OR 2+→1, show warnings (complex, impacts Tasks) |
| Clear Diffs | Show before/after for UPDATE (AC, Standards Research, Technical Notes) |
| Meaningful Comments | Explain why updated/canceled (reference removed capabilities) |
| Conservative Updates | Prefer CREATE over UPDATE when in doubt |
| Progressive Loading | Load Stories ONE BY ONE (not all at once, token efficiency) |
✅ Phase 1:
✅ Phase 2:
✅ Phase 3:
✅ Phase 4:
✅ Phase 5:
MANDATORY READ: Load shared/references/template_loading_pattern.md for template copy workflow.
Template: story_template.md Local copy: docs/templates/story_template.md (in target project)
shared/references/tools_config_guide.mdshared/references/storage_mode_detection.mdshared/references/template_loading_pattern.mdshared/references/linear_creation_workflow.mdshared/references/replan_algorithm.mdLocation: references/ (owned by this skill) Purpose: Detailed comparison logic for REPLAN mode (Story level) Contents: KEEP/UPDATE/OBSOLETE/CREATE rules, Match criteria, Status constraints, Edge cases, Examples Usage: Applied in Phase 2
Location: shared/templates/story_template.md (centralized) Local Copy: docs/templates/story_template.md (in target project) Purpose: Universal Story template (9 sections) Usage: Load via Template Loading logic when generating updated Story documents for UPDATE/CREATE operations
Called by: ln-220-story-coordinator (Phase 5b, count ≥ 1)
Returns:
Worker does NOT:
Version: 3.0.0 Last Updated: 2025-12-23
Weekly Installs
152
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code138
codex136
opencode136
gemini-cli135
cursor135
github-copilot130
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
65,000 周安装
OpenClaw Skill Guard - AI技能运行时安全监控器,实时检测权限违规与可疑行为
260 周安装
智能体上下文隔离最佳实践:防止AI输出污染主对话,优化Claude使用效率
261 周安装
Bicep图表生成器 - 从Azure Bicep文件自动生成架构图 | Eraser
259 周安装
LLM提示词缓存优化指南:降低90%成本,实现多级缓存与语义匹配
259 周安装
CCXT Python 库使用指南:加密货币交易所 API 集成与实时交易
260 周安装
剪映AI视频生成自动化脚本 - 基于Playwright的Seedance 2.0模型文生图/图生视频工具
268 周安装