Community程式設計與開發github.com

專案開發

此技能用於LLM驅動系統的專案層級決策:判斷LLM是否為當前任務的正確基礎元件、設計多階段批次或代理管線的架構、估算代幣與成本、選擇單代理或多代理架構、設計結構化輸出,以及規劃代理輔助迭代流程。

專案開發 是什麼?

此技能為開發者與AI代理提供一套專注於專案層級的LLM系統開發方法論。當工作單元是整個專案或一個多階段管線時應啟用,其核心目標是協助在開發初期做出正確的架構決策,避免因設計錯誤而浪費大量時間與成本。技能涵蓋四大核心概念:任務-模型契合度辨識(透過特徵表格評估LLM是否適合該任務)、手動原型驗證(在自動化前用真實範例測試模型能力)、管線架構(分離確定性與非確定性階段以提高迭代效率與成本控制)、檔案系統狀態機(透過中間檔案存在性實現天然冪等性與快取)。此外,還包含結構化輸出設計(在提示中明確要求可解析格式)、代理輔助開發(利用LLM加速專案迭代)、成本與規模估算(使用公式預估總花費)。此技能明確指出其範疇邊界,不處理工具設計、語境優化或多代理拓撲等由其他技能負責的議題。支援各種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為主的專案的代幣數、美元成本和時間表。
  • 在專案層級選擇單代理或多代理架構。
  • 規劃代理輔助迭代(代理協助建構專案本身)。
  • 在管線合約層級設計結構化輸出(跨階段交接格式)。

切勿就以下由其他技能負責的相鄰工作啟用此技能:

  • 每個工具的描述、架構、命名、回應格式、錯誤訊息:tool-design。
  • 每個軌跡的代幣效率策略(遮罩、分區、快取):context-optimization。
  • 在代理拓撲層級決定如何將工作分配給子代理:multi-agent-patterns。
  • 設計自主控制循環(鎖定指標、新穎性門檻、人為審批邊界):harness-engineering。

核心概念

任務-模型契合度辨識

在撰寫任何程式碼之前評估任務-模型契合度,因為在根本上不相符的任務上構建自動化會浪費數天的努力。對每個提議的任務執行以下兩個表格的評估,以決定「繼續」或「停止」。

當任務具有以下特徵時,應繼續:

特徵理由
跨來源綜合LLM比基於規則的方法更善於結合來自多個輸入的資訊
帶有評分標準的主觀判斷評分、評估和使用標準進行分類,自然地映射到語言推理上
自然語言輸出當目標是人類可讀的文字時,LLM能原生地提供
容錯性單一失敗不會破壞整個系統,因此LLM的非確定性是可接受的
批次處理項目之間不需要對話狀態,這能保持語境清晰
訓練中包含領域知識模型已具有相關語境,減少了提示工程的負擔

當任務具有以下特徵時,應停止:

特徵理由
精確計算語言模型在數學、計數和精確演算法上不可靠
即時性要求LLM的延遲對於亞秒級回應來說過高
完美準確度要求幻覺風險使得100%準確度不可能實現
依賴專有資料模型缺乏必要的語境,且無法僅從提示中獲取
順序依賴性每一步都高度依賴前一步的結果,從而加劇錯誤
確定性輸出要求相同輸入必須產生完全相同的輸出,LLM無法保證

手動原型步驟

在投資自動化之前,始終通過手動測試來驗證任務-模型契合度。將一個代表性的輸入複製到模型介面中,評估輸出品質,並使用結果回答以下問題:

  • 模型是否擁有執行此任務所需的知識?
  • 模型能否以所需格式產生輸出?
  • 在大規模使用時應預期何種品質水準?
  • 是否有需要解決的明顯失敗模式?

這麼做是因為失敗的手動原型預示著失敗的自動化系統,而成功的手動原型則同時提供了品質基準和提示設計模板。此測試只需幾分鐘,並能防止數小時的浪費開發。

管線架構

將LLM專案結構化為分階段管線,因為分離確定性與非確定性階段能實現快速迭代和成本控制。將每個階段設計為:

  • 離散的:階段之間有明確界限,以便每個階段都能獨立除錯
  • 冪等的:重新執行會產生相同結果,防止重複工作
  • 可快取的:中間結果持久化到磁碟,避免昂貴的重複計算
  • 獨立的:每個階段可以獨立執行,支援選擇性重新執行

使用此標準管線結構:

acquire -> prepare -> process -> parse -> render
  1. 取得 (Acquire):從來源(API、檔案、資料庫)獲取原始資料
  2. 準備 (Prepare):將資料轉換為提示格式
  3. 處理 (Process):執行LLM呼叫(昂貴、非確定性步驟)
  4. 解析 (Parse):從LLM輸出中提取結構化資料
  5. 呈現 (Render):產生最終輸出(報告、檔案、視覺化)

階段 1、2、4 和 5 是確定性的。階段 3 是非確定性的且昂貴。保持此分離非常重要,因為它允許僅在必要時重新執行昂貴的LLM階段,同時可以快速迭代解析和呈現環節。

作為狀態機的檔案系統

使用檔案系統而非資料庫或記憶體結構來追蹤管線狀態,因為檔案的存在提供了天然的冪等性和人類可讀的除錯能力。

data/{id}/
  raw.json         # 取得階段完成
  prompt.md        # 準備階段完成
  response.md      # 處理階段完成
  parsed.json      # 解析階段完成

透過檢查輸出檔案是否存在來判斷項目是否需要處理。刪除其輸出檔案及下游檔案來重新執行某個階段。直接讀取中間檔案來進行除錯。此模式之所以有效,是因為每個目錄都是獨立的,從而實現簡單的平行化和輕鬆的快取。

結構化輸出設計

為結構化、可解析的輸出設計提示,因為提示設計直接決定了解析的可靠性。在每個結構化提示中包含以下元素:

  1. 區段標記:解析器可以匹配的明確標題或前綴
  2. 格式範例:精確顯示輸出應有的樣子
  3. 意圖揭露:說明「我將以程式方式解析此內容」,以便模型優先考慮格式合規性
  4. 限制值:列舉選項、分數範圍和固定格式

建構能以優雅方式處理LLM輸出變異的解析器,因為LLM不會完美地遵循指令。使用足夠靈活以應對輕微格式變化的正規表示式模式,當區段缺失時提供合理的預設值,並記錄解析失敗以供審查,而非直接崩潰。

代理輔助開發

使用具備代理能力的模型來加速開發:描述專案目標和約束,讓代理產生初始實作,測試並迭代具體的失敗,然後根據結果改進提示和架構。

採用以下做法,因為它們能使代理輸出保持專注和高品質:

  • 事先提供清晰、具體的要求以減少修改次數
  • 將大型專案分解為離散元件,以便每個元件都能獨立驗證
  • 在進入下一個元件之前測試當前元件,以便及早發現失敗
  • 讓代理一次專注於一項任務,以防止語境退化

成本與規模估算

在開始前估算LLM處理成本,因為代幣成本在大規模使用時會迅速累積,而預算超支的延遲發現會導致代價高昂的重工。使用以下公式:

Total cost = (items x tokens_per_item x price_per_token) + API overhead

對於批次處理,估算每個項目的輸入代幣數(提示 + 語境),估算每個項目的輸出代幣數(典型回應長度),乘以項目數量,並增加 20-30% 的緩衝以應對重試和失敗。

在開發過程中追蹤實際成本。如果成本顯著超過預估,通過截斷來減少語境長度,對較簡單的項目使用較小的模型,快取並重用部分結果,或添加平行處理以減少實際時間。

詳細主題

選擇單代理與多代理架構

對於具有獨立項目的批次處理,預設使用單代理管線,因為它們管理更簡單、運行成本更低且更容易除錯。僅在滿足以下條件之一時升級到多代理架構:

  • 需要平行探索不同的方面
  • 任務超過單一語境窗口容量
  • 專業化的子代理在基準測試中可證明地提高了品質

基於語境隔離而非角色擬人化來選擇多代理。子代理可以為專注的子任務獲得全新的語境窗口,這能防止長時間執行任務時出現語境退化。

有關詳細架構指導,請參閱 multi-agent-patterns 技能。

架構簡化

從最簡潔的架構開始,僅在生產證據證明必要時才增加複雜性,因為過度設計的框架往往限制而非促進模型效能。

Vercel 的 d0 案例研究報告稱,在將許多專門工具減少為兩個原語(命令執行和 SQL)後,成功率有所提高(claim-project-development-vercel-d0-reduction)。檔案系統代理模式使用標準的 Unix 工具而非自訂的探索工具。

在以下情況下簡化:

  • 資料層文件完善且結構一致
  • 模型具有足夠的推理能力
  • 專門工具正在限制而非促進效能
  • 花在維護框架上的時間多於改善結果的時間

在以下情況下增加複雜性:

  • 底層資料雜亂、不一致或文件不足
  • 領域需要模型缺乏的專門知識
  • 安全約束需要限制代理能力
  • 操作確實很複雜,並且受益於結構化工作流程

有關詳細的工俱全面指導,請參閱 tool-design 技能。

迭代與重構

從一開始就規劃多次架構迭代,因為大規模的生產代理系統總是需要重構。Manus 自推出以來已對其代理框架進行了五次重構。苦澀的教訓表明,為當前模型限制而添加的結構,在模型改進後會變成約束。

透過遵循以下實踐來為變更做好準備:

  • 保持架構簡單且無固有意見,以便重構成本低廉
  • 跨模型世代進行測試,以驗證框架並未限制效能
  • 設計能從模型改進中受益的系統,而非鎖定限制

實用指引

專案規劃模板

依序遵循此模板,因為每個步驟都會在下一步投入精力之前驗證假設。

  1. 任務分析

    • 明確定義輸入和期望的輸出
    • 分類:綜合、生成、分類或分析
    • 根據業務影響設定可接受的錯誤率
    • 估算每次成功完成的價值,以證明成本合理性
  2. 手動驗證

    • 使用目標模型測試一個代表性範例
    • 根據要求評估輸出品質和格式
    • 識別需要加強解析器或修改提示的失敗模式
    • 估算每個項目的代幣數以進行成本預測
  3. 架構選擇

    • 根據上述標準選擇單管線或多代理
    • 識別所需的工具和資料來源
    • 使用檔案系統狀態設計儲存和快取策略
    • 規劃處理階段的平行化方法
  4. 成本估算

    • 計算 項目數 x 代幣數 x 價格,並加上 20-30% 緩衝
    • 估算每個管線階段的開發時間
    • 識別基礎設施需求(API 金鑰、儲存、運算)
    • 預測生產運行的持續營運成本
  5. 開發計劃

    • 逐階段實施,每個階段在繼續前進行測試
    • 為每個階段定義測試策略,包含預期輸出
    • 設定與品質指標相關的迭代里程碑
    • 規劃包含回滾能力的部署方法

範例

範例 1:批次分析管線(Karpathy 的 HN Time Capsule)

任務:以事後評分的方式分析 930 篇來自 10 年前的 HN 討論。

架構:

  • 5 階段管線:獲取 -> 提示 -> 分析 -> 解析 -> 呈現
  • 檔案系統狀態:data/{date}/{item_id}/ 包含階段輸出檔案
  • 結構化輸出:6 個區段,帶有明確的格式要求
  • 平行執行:15 個工作者進行 LLM 呼叫

結果:總成本 $58,約 1 小時執行時間,靜態 HTML 輸出。

範例 2:架構簡化(Vercel d0)

任務:用於內部分析的 Text-to-SQL 代理。

之前:許多專門工具,測量成功率較低,平均執行時間較長。

之後:兩個工具(bash + SQL),測量成功率較高,平均執行時間較短(claim-project-development-vercel-d0-reduction)。

關鍵洞察:語義層已經是很好的文件。Claude 只需要直接讀取檔案的權限。

有關詳細分析,請參閱案例研究。

指南

  1. 在建立自動化之前,透過手動原型驗證任務-模型契合度
  2. 將管線結構化為離散、冪等、可快取的階段
  3. 使用檔案系統進行狀態管理和除錯
  4. 設計提示以獲得結構化、可解析的輸出,並包含明確的格式範例
  5. 從最簡潔的架構開始;僅在證明必要時才增加複雜性
  6. 及早估算成本並在整個開發過程中進行追蹤
  7. 建構能夠優雅處理 LLM 輸出變異的強健解析器

...(原文已截斷)

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.

相關技能