Community编程与开发github.com

项目开发方法论

该技能用于在项目层面做出关于LLM驱动系统的决策:判断LLM是否为当前任务的合适原语、设计多阶段批处理或智能体管线的架构、估算token和成本、在项目层面选择单智能体还是多智能体方案、设计用于下游解析的结构化输出,以及组织智能体辅助的迭代过程。

项目开发方法论 是什么?

该技能专注于在项目层面指导开发者设计、评估和迭代基于LLM的系统。它提供了一个完整的方法论,包括任务模型匹配识别(判断任务是否适合LLM处理)、管线架构设计(推荐`获取->准备->处理->解析->渲染`的规范化管线)、结构化输出设计(确保解析可靠性)、以及成本与规模估算(快速计算token消耗和预算)。该技能适用于Claude Code、Cursor、Codex等主流Agent平台,特别适合处理整个项目或多阶段管线的工作单元。其核心原则包括:始终先通过手动原型验证任务匹配度、保持管线的离散性和幂等性、使用文件系统作为状态机简化调试、从最小架构开始逐步增加复杂性。通过遵循这些原则,开发者可以有效避免常见的LLM项目陷阱(如成本失控、幻觉累积、过度工程化),并支持快速迭代。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/project-development

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

项目开发方法论 是做什么的?

本技能涵盖了识别适合LLM处理的任务、设计有效的项目架构以及使用智能体辅助开发进行快速迭代的原则。该方法论适用于构建批处理管线、多智能体研究系统或交互式智能体应用。

本技能的工作单元是整个项目或多阶段管线。单个工具设计(描述、模式、错误信息)属于tool-design技能。每个技能的激活路由属于相应技能加上语料库索引。本技能负责项目层面的问题:是否应该用LLM来构建此功能、管线应该采取什么形状、成本是多少、应该如何迭代。

何时激活

当工作单元是整个项目或管线时,激活此技能:

  • 判断LLM是否是某项任务的合适原语(在任何代码之前先进行任务-模型匹配)。
  • 设计多阶段批处理或智能体管线(获取/准备/处理/解析/渲染)。
  • 估计LLM密集型项目的token、美元成本和时间线。
  • 在项目层面选择单智能体还是多智能体方案。
  • 组织智能体辅助的迭代(智能体帮助构建项目本身)。
  • 在管线合约层面设计结构化输出(跨阶段交接格式)。

对于由其他技能负责的相邻工作,不要激活此技能:

  • 每个工具的描述、模式、命名、响应格式、错误信息:tool-design。
  • 每个轨迹的token效率策略(掩码、分区、缓存):context-optimization。
  • 在智能体拓扑层面决定将工作拆分为子智能体:multi-agent-patterns。
  • 设计自主控制循环(锁定指标、新颖性门控、人工审批边界):harness-engineering。

核心概念

任务-模型匹配识别

在编写任何代码之前,评估任务-模型匹配度,因为为一个根本不适配的任务构建自动化会浪费几天的工作。将每个提议的任务通过以下两个表格进行评估,以决定继续还是停止。

当任务具有以下特征时继续:

特征理由
跨来源的综合LLM比基于规则的替代方案更能结合多个输入的信息
带有评分标准的主观判断评分、评估和分类与语言推理自然映射
自然语言输出当目标是人类可读文本时,LLM原生提供
容错性单个失败不会破坏整个系统,因此LLM的非确定性是可接受的
批处理项目之间不需要对话状态,这保持了上下文的清晰
训练中的领域知识模型已拥有相关上下文,减少了提示工程的开销

当任务具有以下特征时停止:

特征理由
精确计算数学、计数和精确算法在语言模型中不可靠
实时要求LLM延迟太高,无法实现亚秒级响应
完美准确度要求幻觉风险使得100%准确度不可能
依赖专有数据模型缺乏必要的上下文,无法仅从提示中获取
顺序依赖每一步都严重依赖前一个结果,这会加剧错误
确定性输出要求相同输入必须产生相同输出,LLM无法保证

手动原型步骤

在投资自动化之前,始终通过手动测试验证任务-模型匹配度。将一个代表性输入复制到模型界面,评估输出质量,并使用结果回答以下问题:

  • 模型是否具备完成此任务所需的知识?
  • 模型能否以所需格式生成输出?
  • 在规模化后,应期望达到什么质量水平?
  • 是否有需要解决的明显故障模式?

执行此操作是因为失败的手动原型预示着失败的自动化系统,而成功的原型既提供了质量基线,也提供了提示设计模板。这个测试只需几分钟,可以防止数小时的开发浪费。

管线架构

将LLM项目组织为分阶段管线,因为将确定性和非确定性阶段分离可以实现快速迭代和成本控制。将每个阶段设计为:

  • 离散的:阶段之间边界清晰,以便每个阶段可以独立调试
  • 幂等的:重新运行产生相同的结果,防止重复工作
  • 可缓存的:中间结果持久化到磁盘,避免昂贵的重新计算
  • 独立的:每个阶段可以单独运行,支持选择性重新执行

使用此规范管线结构:

获取 -> 准备 -> 处理 -> 解析 -> 渲染
  1. 获取:从来源(API、文件、数据库)获取原始数据
  2. 准备:将数据转换为提示格式
  3. 处理:执行LLM调用(昂贵的、非确定性的步骤)
  4. 解析:从LLM输出中提取结构化数据
  5. 渲染:生成最终输出(报告、文件、可视化)

第1、2、4、5阶段是确定性的。第3阶段是非确定性的且昂贵。保持这种分离,因为这样可以在必要时仅重新运行昂贵的LLM阶段,同时快速迭代解析和渲染。

文件系统作为状态机

使用文件系统来跟踪管线状态,而不是数据库或内存结构,因为文件存在提供了自然的幂等性和人类可读的调试。

data/{id}/
  raw.json         # 获取阶段完成
  prompt.md        # 准备阶段完成
  response.md      # 处理阶段完成
  parsed.json      # 解析阶段完成

通过检查输出文件是否存在来判断某个项目是否需要处理。通过删除其输出文件及其下游文件来重新运行某个阶段。通过直接读取中间文件进行调试。这种模式之所以有效,是因为每个目录都是独立的,支持简单的并行化和简单的缓存。

结构化输出设计

为结构化、可解析的输出设计提示,因为提示设计直接决定解析可靠性。在每个结构化提示中包含以下元素:

  1. 章节标记:解析器可以匹配的显式标题或前缀
  2. 格式示例:精确展示输出应该是什么样的
  3. 理由披露:说明“我将以编程方式解析此内容”,以便模型优先考虑格式合规
  4. 约束值:枚举选项、分数范围和固定格式

构建能优雅处理LLM输出变异的解析器,因为LLM并不能完美遵循指令。使用足够灵活的正则表达式模式来处理微小的格式变异,在章节缺失时提供合理的默认值,并将解析失败记录到日志中以便审查,而不是崩溃。

智能体辅助开发

使用具有智能体能力的模型通过快速迭代来加速开发:描述项目目标和约束,让智能体生成初始实现,针对特定失败进行测试和迭代,然后根据结果优化提示和架构。

采用以下实践,因为它们能使智能体输出保持专注和高质量:

  • 提前提供清晰、具体的需求,以减少修订周期
  • 将大型项目分解为独立的组件,以便每个组件可以独立验证
  • 在进入下一个组件之前测试每个组件,以便及早发现失败
  • 让智能体一次只专注于一个任务,以防止上下文退化

成本和规模估算

在开始之前估算LLM处理成本,因为token成本在规模化时会迅速累积,并且预算超支的晚期发现会导致代价高昂的返工。使用以下公式:

总成本 = (项目数量 x 每个项目的token数 x 每个token的价格) + API开销

对于批处理,估算每个项目的输入token数(提示 + 上下文),估算每个项目的输出token数(典型响应长度),乘以项目数量,并增加20-30%的缓冲用于重试和失败。

在开发过程中跟踪实际成本。如果成本显著超过估算,通过截断减少上下文长度,对简单项目使用较小的模型,缓存和重用部分结果,或添加并行处理以减少挂钟时间。

详细主题

选择单智能体与多智能体架构

对于具有独立项目的批处理,默认使用单智能体管线,因为它们管理简单、运行成本低且易于调试。仅在满足以下条件之一时才升级到多智能体架构:

  • 需要并行探索不同方面
  • 任务超出单个上下文窗口容量
  • 专门的子智能体在基准测试中显著提高质量

为上下文隔离选择多智能体,而不是角色拟人化。子智能体获得新的上下文窗口以专注于子任务,这防止了长时间运行任务中的上下文退化。

有关详细的架构指导,请参阅multi-agent-patterns技能。

架构简化

从最小架构开始,仅在生产证据证明必要时才增加复杂性,因为过度工程的脚手架往往限制而非促进模型性能。

Vercel的d0案例研究报告称,在将许多专门工具简化为两个原语(命令执行和SQL)后,成功率有所提高(claim-project-development-vercel-d0-reduction)。文件系统智能体模式使用标准Unix工具而不是自定义探索工具。

在以下情况下简化:

  • 数据层文档完善且结构一致
  • 模型具有足够的推理能力
  • 专门工具限制而非促进
  • 维护脚手架的时间多于改进结果的时间

在以下情况下增加复杂性:

  • 底层数据混乱、不一致或文档不完善
  • 领域需要模型缺乏的专业知识
  • 安全约束要求限制智能体能力
  • 操作确实复杂,且受益于结构化工作流

有关详细的工具架构指导,请参阅tool-design技能。

迭代与重构

从一开始就规划多次架构迭代,因为大规模的生产智能体系统总是需要重构。Manus自发布以来已经重构了他们的智能体框架五次。苦涩的教训表明,为当前模型限制添加的结构随着模型的改进会变成约束。

通过遵循以下实践来构建适应变化的能力:

  • 保持架构简单且非固执己见,以便重构成本低廉
  • 跨模型代际进行测试,以验证框架没有限制性能
  • 设计能从模型改进中受益的系统,而不是锁定限制

实用指导

项目规划模板

按顺序遵循此模板,因为每一步都在下一步投入努力之前验证假设。

  1. 任务分析

    • 明确定义输入和期望输出
    • 分类:综合、生成、分类或分析
    • 根据业务影响设定可接受的错误率
    • 估算每次成功完成的价值,以证明成本合理
  2. 手动验证

    • 使用目标模型测试一个代表性示例
    • 根据要求评估输出质量和格式
    • 识别需要强化解析器或修改提示的故障模式
    • 估算成本预测中的每个项目token数
  3. 架构选择

    • 根据上述标准选择单管线或多智能体
    • 识别所需的工具和数据源
    • 使用文件系统状态设计存储和缓存策略
    • 规划处理阶段的并行化方法
  4. 成本估算

    • 计算项目数 x token数 x 价格,加上20-30%的缓冲
    • 估算每个管线阶段的开发时间
    • 确定基础设施需求(API密钥、存储、计算)
    • 为生产运行预测持续运营成本
  5. 开发计划

    • 逐步实现每个阶段,在继续之前进行测试
    • 为每个阶段定义测试策略,包括期望输出
    • 设置与质量指标相关的迭代里程碑
    • 规划部署方法,包括回滚能力

示例

示例1:批处理分析管线(Karpathy的HN时间胶囊)

任务:使用事后评分分析10年前的930个HN讨论。

架构:

  • 5阶段管线:获取 -> 提示 -> 分析 -> 解析 -> 渲染
  • 文件系统状态:data/{date}/{item_id}/,包含阶段输出文件
  • 结构化输出:6个章节,带有显式格式要求
  • 并行执行:15个工作线程进行LLM调用

结果:总成本58美元,约1小时执行时间,静态HTML输出。

示例2:架构简化(Vercel d0)

任务:用于内部分析的文本到SQL智能体。

之前:许多专门工具,成功率较低且平均执行时间较长。

之后:两个工具(bash + SQL),成功率更高且平均执行时间更短(claim-project-development-vercel-d0-reduction)。

关键见解:语义层已经是良好的文档。Claude只需要直接读取文件的权限。

有关详细分析,请参阅案例研究。

指导原则

  1. 在构建自动化之前,通过手动原型验证任务-模型匹配度
  2. 将管线构建为离散、幂等、可缓存的阶段
  3. 使用文件系统进行状态管理和调试
  4. 为结构化、可解析的输出设计提示,并包含显式格式示例
  5. 从最小架构开始;仅在证明必要时才增加复杂性
  6. 尽早估算成本并在开发过程中持续跟踪
  7. 构建鲁棒的解析器,能够优雅处理LLM输出变异
  8. 使用智能体辅助开发加速迭代,同时保持对单一任务的专注
  9. 对文档完善的语义层进行架构简化,而不是过度工程化
  10. 规划多次重构,因为生产系统总是需要进化

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

advanced-evaluation

This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment.

bdi-mental-states

This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration.

book-sft-pipeline

This skill should be used for book-to-SFT pipelines: ePub extraction, literary segmentation, author-voice dataset construction, style-transfer training, LoRA workflows, and model evaluation for voice replication.

compaction-control-profiling

This skill should be used when deciding, for a specific model and workload, whether the harness or the model should control compaction, and when qualifying or calibrating that choice with measurements: context-budget sweeps that compare harness-driven and model-driven compaction on one harness, the context-pressure regime where delegation pays, a per-model compaction behavior profile (interface uptake, compression factor per call, reopen rate of archived content, context fill at first compaction, response to pressure warnings), context anxiety and timing-instruction calibration, reversible collapse-and-archive interfaces, and re-qualification after a model or prompt change. Route the editable-file protocol, harness invariants, and edit-position cache cost of self-editing agents to self-managed-context, summary content to context-compression, harness thresholds and cache layout to context-optimization, and general evaluation design to evaluation.

comprehensive-research-agent

Ensure thorough validation, error recovery, and transparent reasoning in research tasks with multiple tool calls

context-compression

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

context-degradation

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

context-fundamentals

This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. Use this for conceptual explanation, onboarding, and background reading. Route operational work to the specialized skills: debugging attention failures goes to context-degradation, token-efficiency work goes to context-optimization, conversation summarization goes to context-compression, and project-shape decisions go to project-development.

context-optimization

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

evaluation

This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates, production monitoring, baseline comparison, and outcome measurement for agent pipelines.

filesystem-context

This skill should be used when agent work needs file-backed context: durable scratchpads, tool-output offloading, just-in-time discovery, cross-agent handoff files, filesystem memory, or cleanup policies for context stored outside the prompt.

harness-engineering

This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.

hosted-agents

This skill should be used when designing hosted or background agent infrastructure: sandboxed execution, remote coding environments, warm pools, session persistence, multiplayer collaboration, self-spawning agents, or Modal-style sandboxes.

instruction-surface-security

Hardens agent runtimes against persistent prompt injection or unauthorized changes to instructions and permissions. Use to audit what agents auto-load, design reviewed activation for project rules, skills, memory, or tool configuration, and test whether trust boundaries hold after reload, restart, or delegation.

latent-briefing

This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.

long-horizon-prompting

This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

memory-systems

This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to context-compression, and token-efficiency tactics to context-optimization.

multi-agent-patterns

This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple agents are justified.

self-improvement-loops

This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

self-managed-context

This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context exposed as an editable file the model rewrites with code tools, model-driven eviction and in-place updates, the harness invariants that keep self-editing safe (pinned prefix, edit gate, edit receipts, budget readouts, rollback on overflow), the prefix-cache cost of mid-context edits, and steering or training the model's own context-editing strategy. Route note content and fixed-threshold summarization to context-compression, cache-stable layout under harness control to context-optimization, file offloading to filesystem-context, and loop governance to self-improvement-loops.

相关技能