claude-code-pilot 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +11 -11
  2. package/bin/install.js +20 -2
  3. package/manifest.json +5 -1
  4. package/package.json +18 -6
  5. package/src/agents/a11y-architect.md +141 -0
  6. package/src/agents/code-architect.md +71 -0
  7. package/src/agents/code-explorer.md +69 -0
  8. package/src/agents/code-simplifier.md +47 -0
  9. package/src/agents/comment-analyzer.md +45 -0
  10. package/src/agents/csharp-reviewer.md +101 -0
  11. package/src/agents/dart-build-resolver.md +201 -0
  12. package/src/agents/pr-test-analyzer.md +45 -0
  13. package/src/agents/silent-failure-hunter.md +50 -0
  14. package/src/agents/type-design-analyzer.md +41 -0
  15. package/src/available-rules/README.md +3 -1
  16. package/src/available-rules/dart/coding-style.md +159 -0
  17. package/src/available-rules/dart/hooks.md +66 -0
  18. package/src/available-rules/dart/patterns.md +261 -0
  19. package/src/available-rules/dart/security.md +135 -0
  20. package/src/available-rules/dart/testing.md +215 -0
  21. package/src/available-rules/web/coding-style.md +105 -0
  22. package/src/available-rules/web/design-quality.md +72 -0
  23. package/src/available-rules/web/hooks.md +129 -0
  24. package/src/available-rules/web/patterns.md +88 -0
  25. package/src/available-rules/web/performance.md +73 -0
  26. package/src/available-rules/web/security.md +66 -0
  27. package/src/available-rules/web/testing.md +64 -0
  28. package/src/commands/ccp/ai-integration-phase.md +36 -0
  29. package/src/commands/ccp/audit-fix.md +33 -0
  30. package/src/commands/ccp/code-review-fix.md +52 -0
  31. package/src/commands/ccp/eval-review.md +32 -0
  32. package/src/commands/ccp/extract_learnings.md +22 -0
  33. package/src/commands/ccp/import.md +37 -0
  34. package/src/commands/ccp/ingest-docs.md +42 -0
  35. package/src/commands/ccp/intel.md +179 -0
  36. package/src/commands/ccp/plan-review-convergence.md +58 -0
  37. package/src/commands/ccp/scan.md +26 -0
  38. package/src/commands/ccp/sketch-wrap-up.md +31 -0
  39. package/src/commands/ccp/sketch.md +54 -0
  40. package/src/commands/ccp/spec-phase.md +62 -0
  41. package/src/commands/ccp/spike-wrap-up.md +31 -0
  42. package/src/commands/ccp/spike.md +51 -0
  43. package/src/commands/ccp/ultraplan-phase.md +33 -0
  44. package/src/hooks/ccp-read-injection-scanner.js +152 -0
  45. package/src/hooks/kit-check-update.js +59 -7
  46. package/src/hooks/run-with-flags-shell.sh +1 -0
  47. package/src/hooks/run-with-flags.js +48 -1
  48. package/src/hooks/session-end.js +88 -1
  49. package/src/lib/hook-flags.js +14 -0
  50. package/src/pilot/references/agent-contracts.md +79 -0
  51. package/src/pilot/references/ai-evals.md +156 -0
  52. package/src/pilot/references/ai-frameworks.md +186 -0
  53. package/src/pilot/references/doc-conflict-engine.md +91 -0
  54. package/src/pilot/references/gate-prompts.md +100 -0
  55. package/src/pilot/references/gates.md +70 -0
  56. package/src/pilot/references/mandatory-initial-read.md +2 -0
  57. package/src/pilot/references/project-skills-discovery.md +19 -0
  58. package/src/pilot/references/revision-loop.md +97 -0
  59. package/src/pilot/references/sketch-interactivity.md +41 -0
  60. package/src/pilot/references/sketch-theme-system.md +94 -0
  61. package/src/pilot/references/sketch-tooling.md +45 -0
  62. package/src/pilot/references/sketch-variant-patterns.md +81 -0
  63. package/src/pilot/references/thinking-models-debug.md +44 -0
  64. package/src/pilot/references/thinking-models-execution.md +50 -0
  65. package/src/pilot/references/thinking-models-planning.md +62 -0
  66. package/src/pilot/references/thinking-models-research.md +50 -0
  67. package/src/pilot/references/thinking-models-verification.md +55 -0
  68. package/src/pilot/templates/AI-SPEC.md +246 -0
  69. package/src/pilot/templates/spec.md +307 -0
  70. package/src/pilot/workflows/ai-integration-phase.md +284 -0
  71. package/src/pilot/workflows/audit-fix.md +175 -0
  72. package/src/pilot/workflows/code-review-fix.md +497 -0
  73. package/src/pilot/workflows/eval-review.md +155 -0
  74. package/src/pilot/workflows/extract_learnings.md +242 -0
  75. package/src/pilot/workflows/import.md +246 -0
  76. package/src/pilot/workflows/ingest-docs.md +328 -0
  77. package/src/pilot/workflows/plan-review-convergence.md +329 -0
  78. package/src/pilot/workflows/scan.md +102 -0
  79. package/src/pilot/workflows/sketch-wrap-up.md +285 -0
  80. package/src/pilot/workflows/sketch.md +360 -0
  81. package/src/pilot/workflows/spec-phase.md +262 -0
  82. package/src/pilot/workflows/spike-wrap-up.md +306 -0
  83. package/src/pilot/workflows/spike.md +452 -0
  84. package/src/pilot/workflows/ultraplan-phase.md +189 -0
  85. package/src/skills/accessibility/SKILL.md +146 -0
  86. package/src/skills/agent-eval/SKILL.md +145 -0
  87. package/src/skills/agent-introspection-debugging/SKILL.md +153 -0
  88. package/src/skills/android-clean-architecture/SKILL.md +339 -0
  89. package/src/skills/api-connector-builder/SKILL.md +120 -0
  90. package/src/skills/code-tour/SKILL.md +236 -0
  91. package/src/skills/compose-multiplatform-patterns/SKILL.md +299 -0
  92. package/src/skills/csharp-testing/SKILL.md +321 -0
  93. package/src/skills/dart-flutter-patterns/SKILL.md +563 -0
  94. package/src/skills/dashboard-builder/SKILL.md +108 -0
  95. package/src/skills/dotnet-patterns/SKILL.md +321 -0
  96. package/src/skills/frontend-design/SKILL.md +145 -0
  97. package/src/skills/frontend-slides/SKILL.md +184 -0
  98. package/src/skills/frontend-slides/STYLE_PRESETS.md +330 -0
  99. package/src/skills/gateguard/SKILL.md +121 -0
  100. package/src/skills/github-ops/SKILL.md +144 -0
  101. package/src/skills/hookify-rules/SKILL.md +128 -0
  102. package/src/skills/knowledge-ops/SKILL.md +154 -0
  103. package/src/skills/liquid-glass-design/SKILL.md +279 -0
  104. package/src/skills/nestjs-patterns/SKILL.md +230 -0
  105. package/src/skills/security-bounty-hunter/SKILL.md +99 -0
  106. package/src/skills/swift-actor-persistence/SKILL.md +143 -0
  107. package/src/skills/swift-protocol-di-testing/SKILL.md +190 -0
  108. package/src/skills/swiftui-patterns/SKILL.md +259 -0
  109. package/src/skills/terminal-ops/SKILL.md +109 -0
  110. package/src/skills/ui-demo/SKILL.md +465 -0
@@ -0,0 +1,156 @@
1
+ # AI Evaluation Reference
2
+
3
+ > Reference used by `gsd-eval-planner` and `gsd-eval-auditor`.
4
+ > Based on "AI Evals for Everyone" course (Reganti & Badam) + industry practice.
5
+
6
+ ---
7
+
8
+ ## Core Concepts
9
+
10
+ ### Why Evals Exist
11
+ AI systems are non-deterministic. Input X does not reliably produce output Y across runs, users, or edge cases. Evals are the continuous process of assessing whether your system's behavior meets expectations under real-world conditions — unit tests and integration tests alone are insufficient.
12
+
13
+ ### Model vs. Product Evaluation
14
+ - **Model evals** (MMLU, HumanEval, GSM8K) — measure general capability in standardized conditions. Use as initial filter only.
15
+ - **Product evals** — measure behavior inside your specific system, with your data, your users, your domain rules. This is where 80% of eval effort belongs.
16
+
17
+ ### The Three Components of Every Eval
18
+ - **Input** — everything affecting the system: query, history, retrieved docs, system prompt, config
19
+ - **Expected** — what good behavior looks like, defined through rubrics
20
+ - **Actual** — what the system produced, including intermediate steps, tool calls, and reasoning traces
21
+
22
+ ### Three Measurement Approaches
23
+ 1. **Code-based metrics** — deterministic checks: JSON validation, required disclaimers, performance thresholds, classification flags. Fast, cheap, reliable. Use first.
24
+ 2. **LLM judges** — one model evaluates another against a rubric. Powerful for subjective qualities (tone, reasoning, escalation). Requires calibration against human judgment before trusting.
25
+ 3. **Human evaluation** — gold standard for nuanced judgment. Doesn't scale. Use for calibration, edge cases, periodic sampling, and high-stakes decisions.
26
+
27
+ Most effective systems combine all three.
28
+
29
+ ---
30
+
31
+ ## Evaluation Dimensions
32
+
33
+ ### Pre-Deployment (Development Phase)
34
+
35
+ | Dimension | What It Measures | When It Matters |
36
+ |-----------|-----------------|-----------------|
37
+ | **Factual accuracy** | Correctness of claims against ground truth | RAG, knowledge bases, any factual assertions |
38
+ | **Context faithfulness** | Response grounded in provided context vs. fabricated | RAG pipelines, document Q&A, retrieval-augmented systems |
39
+ | **Hallucination detection** | Plausible but unsupported claims | All generative systems, high-stakes domains |
40
+ | **Escalation accuracy** | Correct identification of when human intervention needed | Customer service, healthcare, financial advisory |
41
+ | **Policy compliance** | Adherence to business rules, legal requirements, disclaimers | Regulated industries, enterprise deployments |
42
+ | **Tone/style appropriateness** | Match with brand voice, audience expectations, emotional context | Customer-facing systems, content generation |
43
+ | **Output structure validity** | Schema compliance, required fields, format correctness | Structured extraction, API integrations, data pipelines |
44
+ | **Task completion** | Whether the system accomplished the stated goal | Agentic workflows, multi-step tasks |
45
+ | **Tool use correctness** | Correct selection and invocation of tools | Agent systems with tool calls |
46
+ | **Safety** | Absence of harmful, biased, or inappropriate outputs | All user-facing systems |
47
+
48
+ ### Production Monitoring
49
+
50
+ | Dimension | Monitoring Approach |
51
+ |-----------|---------------------|
52
+ | **Safety violations** | Online guardrail — real-time, immediate intervention |
53
+ | **Compliance failures** | Online guardrail — block or escalate before user sees output |
54
+ | **Quality degradation trends** | Offline flywheel — batch analysis of sampled interactions |
55
+ | **Emerging failure modes** | Signal-metric divergence — when user behavior signals diverge from metric scores, investigate manually |
56
+ | **Cost/latency drift** | Code-based metrics — automated threshold alerts |
57
+
58
+ ---
59
+
60
+ ## The Guardrail vs. Flywheel Decision
61
+
62
+ Ask: "If this behavior goes wrong, would it be catastrophic for my business?"
63
+
64
+ - **Yes → Guardrail** — run online, real-time, with immediate intervention (block, escalate, hand off). Be selective: guardrails add latency.
65
+ - **No → Flywheel** — run offline as batch analysis feeding system refinements over time.
66
+
67
+ ---
68
+
69
+ ## Rubric Design
70
+
71
+ Generic metrics are meaningless without context. "Helpfulness" in real estate means summarizing listings clearly. In healthcare it means knowing when *not* to answer.
72
+
73
+ A rubric must define:
74
+ 1. The dimension being measured
75
+ 2. What scores 1, 3, and 5 on a 5-point scale (or pass/fail criteria)
76
+ 3. Domain-specific examples of acceptable vs. unacceptable behavior
77
+
78
+ Without rubrics, LLM judges produce noise rather than signal.
79
+
80
+ ---
81
+
82
+ ## Reference Dataset Guidelines
83
+
84
+ - Start with **10-20 high-quality examples** — not 200 mediocre ones
85
+ - Cover: critical success scenarios, common user workflows, known edge cases, historical failure modes
86
+ - Have domain experts label the examples (not just engineers)
87
+ - Expand based on what you learn in production — don't build for hypothetical coverage
88
+
89
+ ---
90
+
91
+ ## Eval Tooling Guide
92
+
93
+ | Tool | Type | Best For | Key Strength |
94
+ |------|------|----------|-------------|
95
+ | **RAGAS** | Python library | RAG evaluation | Purpose-built metrics: faithfulness, answer relevance, context precision/recall |
96
+ | **Langfuse** | Platform (open-source, self-hostable) | All system types | Strong tracing, prompt management, good for teams wanting infrastructure control |
97
+ | **LangSmith** | Platform (commercial) | LangChain/LangGraph ecosystems | Tightest integration with LangChain; best if already in that ecosystem |
98
+ | **Arize Phoenix** | Platform (open-source + hosted) | RAG + multi-agent tracing | Strong RAG eval + trace visualization; open-source with hosted option |
99
+ | **Braintrust** | Platform (commercial) | Model-agnostic evaluation | Dataset and experiment management; good for comparing across frameworks |
100
+ | **Promptfoo** | CLI tool (open-source) | Prompt testing, CI/CD | CLI-first, excellent for CI/CD prompt regression testing |
101
+
102
+ ### Tool Selection by System Type
103
+
104
+ | System Type | Recommended Tooling |
105
+ |-------------|---------------------|
106
+ | RAG / Knowledge Q&A | RAGAS + Arize Phoenix or Braintrust |
107
+ | Multi-agent systems | Langfuse + Arize Phoenix |
108
+ | Conversational / single-model | Promptfoo + Braintrust |
109
+ | Structured extraction | Promptfoo + code-based validators |
110
+ | LangChain/LangGraph projects | LangSmith (native integration) |
111
+ | Production monitoring (all types) | Langfuse, Arize Phoenix, or LangSmith |
112
+
113
+ ---
114
+
115
+ ## Evals in the Development Lifecycle
116
+
117
+ ### Plan Phase (Evaluation-Aware Design)
118
+ Before writing code, define:
119
+ 1. What type of AI system is being built → determines framework and dominant eval concerns
120
+ 2. Critical failure modes (3-5 behaviors that cannot go wrong)
121
+ 3. Rubrics — explicit definitions of acceptable/unacceptable behavior per dimension
122
+ 4. Evaluation strategy — which dimensions use code metrics, LLM judges, or human review
123
+ 5. Reference dataset requirements — size, composition, labeling approach
124
+ 6. Eval tooling selection
125
+
126
+ Output: EVALS-SPEC section of AI-SPEC.md
127
+
128
+ ### Execute Phase (Instrument While Building)
129
+ - Add tracing from day one (Langfuse, Arize Phoenix, or LangSmith)
130
+ - Build reference dataset concurrently with implementation
131
+ - Implement code-based checks first; add LLM judges only for subjective dimensions
132
+ - Run evals in CI/CD via Promptfoo or Braintrust
133
+
134
+ ### Verify Phase (Pre-Deployment Validation)
135
+ - Run full reference dataset against all metrics
136
+ - Conduct human review of edge cases and LLM judge disagreements
137
+ - Calibrate LLM judges against human scores (target ≥ 0.7 correlation before trusting)
138
+ - Define and configure production guardrails
139
+ - Establish monitoring baseline
140
+
141
+ ### Monitor Phase (Production Evaluation Loop)
142
+ - Smart sampling — weight toward interactions with concerning signals (retries, unusual length, explicit escalations)
143
+ - Online guardrails on every interaction
144
+ - Offline flywheel on sampled batch
145
+ - Watch for signal-metric divergence — the early warning system for evaluation gaps
146
+
147
+ ---
148
+
149
+ ## Common Pitfalls
150
+
151
+ 1. **Assuming benchmarks predict product success** — they don't; model evals are a filter, not a verdict
152
+ 2. **Engineering evals in isolation** — domain experts must co-define rubrics; engineers alone miss critical nuances
153
+ 3. **Building comprehensive coverage on day one** — start small (10-20 examples), expand from real failure modes
154
+ 4. **Trusting uncalibrated LLM judges** — validate against human judgment before relying on them
155
+ 5. **Measuring everything** — only track metrics that drive decisions; "collect it all" produces noise
156
+ 6. **Treating evaluation as one-time setup** — user behavior evolves, requirements change, failure modes emerge; evaluation is continuous
@@ -0,0 +1,186 @@
1
+ # AI Framework Decision Matrix
2
+
3
+ > Reference used by `gsd-framework-selector` and `gsd-ai-researcher`.
4
+ > Distilled from official docs, benchmarks, and developer reports (2026).
5
+
6
+ ---
7
+
8
+ ## Quick Picks
9
+
10
+ | Situation | Pick |
11
+ |-----------|------|
12
+ | Simplest path to a working agent (OpenAI) | OpenAI Agents SDK |
13
+ | Simplest path to a working agent (model-agnostic) | CrewAI |
14
+ | Production RAG / document Q&A | LlamaIndex |
15
+ | Complex stateful workflows with branching | LangGraph |
16
+ | Multi-agent teams with defined roles | CrewAI |
17
+ | Code-aware autonomous agents (Anthropic) | Claude Agent SDK |
18
+ | "I don't know my requirements yet" | LangChain |
19
+ | Regulated / audit-trail required | LangGraph |
20
+ | Enterprise Microsoft/.NET shops | AutoGen/AG2 |
21
+ | Google Cloud / Gemini-committed teams | Google ADK |
22
+ | Pure NLP pipelines with explicit control | Haystack |
23
+
24
+ ---
25
+
26
+ ## Framework Profiles
27
+
28
+ ### CrewAI
29
+ - **Type:** Multi-agent orchestration
30
+ - **Language:** Python only
31
+ - **Model support:** Model-agnostic
32
+ - **Learning curve:** Beginner (role/task/crew maps to real teams)
33
+ - **Best for:** Content pipelines, research automation, business process workflows, rapid prototyping
34
+ - **Avoid if:** Fine-grained state management, TypeScript, fault-tolerant checkpointing, complex conditional branching
35
+ - **Strengths:** Fastest multi-agent prototyping, 5.76x faster than LangGraph on QA tasks, built-in memory (short/long/entity/contextual), Flows architecture, standalone (no LangChain dep)
36
+ - **Weaknesses:** Limited checkpointing, coarse error handling, Python only
37
+ - **Eval concerns:** Task decomposition accuracy, inter-agent handoff, goal completion rate, loop detection
38
+
39
+ ### LlamaIndex
40
+ - **Type:** RAG and data ingestion
41
+ - **Language:** Python + TypeScript
42
+ - **Model support:** Model-agnostic
43
+ - **Learning curve:** Intermediate
44
+ - **Best for:** Legal research, internal knowledge assistants, enterprise document search, any system where retrieval quality is the #1 priority
45
+ - **Avoid if:** Primary need is agent orchestration, multi-agent collaboration, or chatbot conversation flow
46
+ - **Strengths:** Best-in-class document parsing (LlamaParse), 35% retrieval accuracy improvement, 20-30% faster queries, mixed retrieval strategies (vector + graph + reranker)
47
+ - **Weaknesses:** Data framework first — agent orchestration is secondary
48
+ - **Eval concerns:** Context faithfulness, hallucination, answer relevance, retrieval precision/recall
49
+
50
+ ### LangChain
51
+ - **Type:** General-purpose LLM framework
52
+ - **Language:** Python + TypeScript
53
+ - **Model support:** Model-agnostic (widest ecosystem)
54
+ - **Learning curve:** Intermediate–Advanced
55
+ - **Best for:** Evolving requirements, many third-party integrations, teams wanting one framework for everything, RAG + agents + chains
56
+ - **Avoid if:** Simple well-defined use case, RAG-primary (use LlamaIndex), complex stateful workflows (use LangGraph), performance at scale is critical
57
+ - **Strengths:** Largest community and integration ecosystem, 25% faster development vs scratch, covers RAG/agents/chains/memory
58
+ - **Weaknesses:** Abstraction overhead, p99 latency degrades under load, complexity creep risk
59
+ - **Eval concerns:** End-to-end task completion, chain correctness, retrieval quality
60
+
61
+ ### LangGraph
62
+ - **Type:** Stateful agent workflows (graph-based)
63
+ - **Language:** Python + TypeScript (full parity)
64
+ - **Model support:** Model-agnostic (inherits LangChain integrations)
65
+ - **Learning curve:** Intermediate–Advanced (graph mental model)
66
+ - **Best for:** Production-grade stateful workflows, regulated industries, audit trails, human-in-the-loop flows, fault-tolerant multi-step agents
67
+ - **Avoid if:** Simple chatbot, purely linear workflow, rapid prototyping
68
+ - **Strengths:** Best checkpointing (every node), time-travel debugging, native Postgres/Redis persistence, streaming support, chosen by 62% of developers for stateful agent work (2026)
69
+ - **Weaknesses:** More upfront scaffolding, steeper curve, overkill for simple cases
70
+ - **Eval concerns:** State transition correctness, goal completion rate, tool use accuracy, safety guardrails
71
+
72
+ ### OpenAI Agents SDK
73
+ - **Type:** Native OpenAI agent framework
74
+ - **Language:** Python + TypeScript
75
+ - **Model support:** Optimized for OpenAI (supports 100+ via Chat Completions compatibility)
76
+ - **Learning curve:** Beginner (4 primitives: Agents, Handoffs, Guardrails, Tracing)
77
+ - **Best for:** OpenAI-committed teams, rapid agent prototyping, voice agents (gpt-realtime), teams wanting visual builder (AgentKit)
78
+ - **Avoid if:** Model flexibility needed, complex multi-agent collaboration, persistent state management required, vendor lock-in concern
79
+ - **Strengths:** Simplest mental model, built-in tracing and guardrails, Handoffs for agent delegation, Realtime Agents for voice
80
+ - **Weaknesses:** OpenAI vendor lock-in, no built-in persistent state, younger ecosystem
81
+ - **Eval concerns:** Instruction following, safety guardrails, escalation accuracy, tone consistency
82
+
83
+ ### Claude Agent SDK (Anthropic)
84
+ - **Type:** Code-aware autonomous agent framework
85
+ - **Language:** Python + TypeScript
86
+ - **Model support:** Claude models only
87
+ - **Learning curve:** Intermediate (18 hook events, MCP, tool decorators)
88
+ - **Best for:** Developer tooling, code generation/review agents, autonomous coding assistants, MCP-heavy architectures, safety-critical applications
89
+ - **Avoid if:** Model flexibility needed, stable/mature API required, use case unrelated to code/tool-use
90
+ - **Strengths:** Deepest MCP integration, built-in filesystem/shell access, 18 lifecycle hooks, automatic context compaction, extended thinking, safety-first design
91
+ - **Weaknesses:** Claude-only vendor lock-in, newer/evolving API, smaller community
92
+ - **Eval concerns:** Tool use correctness, safety, code quality, instruction following
93
+
94
+ ### AutoGen / AG2 / Microsoft Agent Framework
95
+ - **Type:** Multi-agent conversational framework
96
+ - **Language:** Python (AG2), Python + .NET (Microsoft Agent Framework)
97
+ - **Model support:** Model-agnostic
98
+ - **Learning curve:** Intermediate–Advanced
99
+ - **Best for:** Research applications, conversational problem-solving, code generation + execution loops, Microsoft/.NET shops
100
+ - **Avoid if:** You want ecosystem stability, deterministic workflows, or "safest long-term bet" (fragmentation risk)
101
+ - **Strengths:** Most sophisticated conversational agent patterns, code generation + execution loop, async event-driven (v0.4+), cross-language interop (Microsoft Agent Framework)
102
+ - **Weaknesses:** Ecosystem fragmented (AutoGen maintenance mode, AG2 fork, Microsoft Agent Framework preview) — genuine long-term risk
103
+ - **Eval concerns:** Conversation goal completion, consensus quality, code execution correctness
104
+
105
+ ### Google ADK (Agent Development Kit)
106
+ - **Type:** Multi-agent orchestration framework
107
+ - **Language:** Python + Java
108
+ - **Model support:** Optimized for Gemini; supports other models via LiteLLM
109
+ - **Learning curve:** Intermediate (agent/tool/session model, familiar if you know LangGraph)
110
+ - **Best for:** Google Cloud / Vertex AI shops, multi-agent workflows needing built-in session management and memory, teams already committed to Gemini, agent pipelines that need Google Search / BigQuery tool integration
111
+ - **Avoid if:** Model flexibility is required beyond Gemini, no Google Cloud dependency acceptable, TypeScript-only stack
112
+ - **Strengths:** First-party Google support, built-in session/memory/artifact management, tight Vertex AI and Google Search integration, own eval framework (RAGAS-compatible), multi-agent by design (sequential, parallel, loop patterns), Java SDK for enterprise teams
113
+ - **Weaknesses:** Gemini vendor lock-in in practice, younger community than LangChain/LlamaIndex, less third-party integration depth
114
+ - **Eval concerns:** Multi-agent task decomposition, tool use correctness, session state consistency, goal completion rate
115
+
116
+ ### Haystack
117
+ - **Type:** NLP pipeline framework
118
+ - **Language:** Python
119
+ - **Model support:** Model-agnostic
120
+ - **Learning curve:** Intermediate
121
+ - **Best for:** Explicit, auditable NLP pipelines, document processing with fine-grained control, enterprise search, regulated industries needing transparency
122
+ - **Avoid if:** Rapid prototyping, multi-agent workflows, or you want a large community
123
+ - **Strengths:** Explicit pipeline control, strong for structured data pipelines, good documentation
124
+ - **Weaknesses:** Smaller community, less agent-oriented than alternatives
125
+ - **Eval concerns:** Extraction accuracy, pipeline output validity, retrieval quality
126
+
127
+ ---
128
+
129
+ ## Decision Dimensions
130
+
131
+ ### By System Type
132
+
133
+ | System Type | Primary Framework(s) | Key Eval Concerns |
134
+ |-------------|---------------------|-------------------|
135
+ | RAG / Knowledge Q&A | LlamaIndex, LangChain | Context faithfulness, hallucination, retrieval precision/recall |
136
+ | Multi-agent orchestration | CrewAI, LangGraph, Google ADK | Task decomposition, handoff quality, goal completion |
137
+ | Conversational assistants | OpenAI Agents SDK, Claude Agent SDK | Tone, safety, instruction following, escalation |
138
+ | Structured data extraction | LangChain, LlamaIndex | Schema compliance, extraction accuracy |
139
+ | Autonomous task agents | LangGraph, OpenAI Agents SDK | Safety guardrails, tool correctness, cost adherence |
140
+ | Content generation | Claude Agent SDK, OpenAI Agents SDK | Brand voice, factual accuracy, tone |
141
+ | Code automation | Claude Agent SDK | Code correctness, safety, test pass rate |
142
+
143
+ ### By Team Size and Stage
144
+
145
+ | Context | Recommendation |
146
+ |---------|----------------|
147
+ | Solo dev, prototyping | OpenAI Agents SDK or CrewAI (fastest to running) |
148
+ | Solo dev, RAG | LlamaIndex (batteries included) |
149
+ | Team, production, stateful | LangGraph (best fault tolerance) |
150
+ | Team, evolving requirements | LangChain (broadest escape hatches) |
151
+ | Team, multi-agent | CrewAI (simplest role abstraction) |
152
+ | Enterprise, .NET | AutoGen AG2 / Microsoft Agent Framework |
153
+
154
+ ### By Model Commitment
155
+
156
+ | Preference | Framework |
157
+ |-----------|-----------|
158
+ | OpenAI-only | OpenAI Agents SDK |
159
+ | Anthropic/Claude-only | Claude Agent SDK |
160
+ | Google/Gemini-committed | Google ADK |
161
+ | Model-agnostic (full flexibility) | LangChain, LlamaIndex, CrewAI, LangGraph, Haystack |
162
+
163
+ ---
164
+
165
+ ## Anti-Patterns
166
+
167
+ 1. **Using LangChain for simple chatbots** — Direct SDK call is less code, faster, and easier to debug
168
+ 2. **Using CrewAI for complex stateful workflows** — Checkpointing gaps will bite you in production
169
+ 3. **Using OpenAI Agents SDK with non-OpenAI models** — Loses the integration benefits you chose it for
170
+ 4. **Using LlamaIndex as a multi-agent framework** — It can do agents, but that's not its strength
171
+ 5. **Defaulting to LangChain without evaluating alternatives** — "Everyone uses it" ≠ right for your use case
172
+ 6. **Starting a new project on AutoGen (not AG2)** — AutoGen is in maintenance mode; use AG2 or wait for Microsoft Agent Framework GA
173
+ 7. **Choosing LangGraph for simple linear flows** — The graph overhead is not worth it; use LangChain chains instead
174
+ 8. **Ignoring vendor lock-in** — Provider-native SDKs (OpenAI, Claude) trade flexibility for integration depth; decide consciously
175
+
176
+ ---
177
+
178
+ ## Combination Plays (Multi-Framework Stacks)
179
+
180
+ | Production Pattern | Stack |
181
+ |-------------------|-------|
182
+ | RAG with observability | LlamaIndex + LangSmith or Langfuse |
183
+ | Stateful agent with RAG | LangGraph + LlamaIndex |
184
+ | Multi-agent with tracing | CrewAI + Langfuse |
185
+ | OpenAI agents with evals | OpenAI Agents SDK + Promptfoo or Braintrust |
186
+ | Claude agents with MCP | Claude Agent SDK + LangSmith or Arize Phoenix |
@@ -0,0 +1,91 @@
1
+ # Doc Conflict Engine
2
+
3
+ Shared conflict-detection contract for workflows that ingest external content into `.planning/` (e.g., `/ccp:import`, `/ccp:ingest-docs`). Defines the report format, severity semantics, and safety-gate behavior. The specific checks that populate each severity bucket are workflow-specific and defined by the calling workflow.
4
+
5
+ ---
6
+
7
+ ## Severity Semantics
8
+
9
+ - **[BLOCKER]** — Unsafe to proceed. The workflow MUST exit without writing any destination files. Used for contradictions of locked decisions, missing prerequisites, and impossible targets.
10
+ - **[WARNING]** — Ambiguous or partially overlapping. The workflow MUST surface the warning and obtain explicit user approval before writing. Never auto-approve.
11
+ - **[INFO]** — Informational only. No gate; no user prompt required. Included in the report for transparency.
12
+
13
+ ---
14
+
15
+ ## Report Format
16
+
17
+ Plain-text, never markdown tables (no `|---|`). The report is rendered to the user verbatim.
18
+
19
+ ```
20
+ ## Conflict Detection Report
21
+
22
+ ### BLOCKERS ({N})
23
+
24
+ [BLOCKER] {Short title}
25
+ Found: {what the incoming content says}
26
+ Expected: {what existing project context requires}
27
+ → {Specific action to resolve}
28
+
29
+ ### WARNINGS ({N})
30
+
31
+ [WARNING] {Short title}
32
+ Found: {what was detected}
33
+ Impact: {what could go wrong}
34
+ → {Suggested action}
35
+
36
+ ### INFO ({N})
37
+
38
+ [INFO] {Short title}
39
+ Note: {relevant information}
40
+ ```
41
+
42
+ Every entry requires `Found:` plus one of `Expected:`/`Impact:`/`Note:` plus (for BLOCKER/WARNING) a `→` remediation line.
43
+
44
+ ---
45
+
46
+ ## Safety Gate
47
+
48
+ **If any [BLOCKER] exists:**
49
+
50
+ Display:
51
+ ```
52
+ GSD > BLOCKED: {N} blockers must be resolved before {operation} can proceed.
53
+ ```
54
+
55
+ Exit WITHOUT writing any destination files. The gate must hold regardless of WARNING/INFO counts.
56
+
57
+ **If only WARNINGS and/or INFO (no blockers):**
58
+
59
+ Render the full report, then prompt for approval via the `approve-revise-abort` or `yes-no` pattern from `references/gate-prompts.md`. Respect text mode (see the workflow's own text-mode handling). If the user aborts, exit cleanly with a cancellation message.
60
+
61
+ **If the report is empty (no entries in any bucket):**
62
+
63
+ Proceed silently or display `GSD > No conflicts detected.` Either is acceptable; workflows choose based on verbosity context.
64
+
65
+ ---
66
+
67
+ ## Workflow Responsibilities
68
+
69
+ Each workflow that consumes this contract must define:
70
+
71
+ 1. **Its own check list per bucket** — which conditions are BLOCKER vs WARNING vs INFO. These are domain-specific (plan ingestion checks are not doc ingestion checks).
72
+ 2. **The loaded context** — what it reads (ROADMAP.md, PROJECT.md, REQUIREMENTS.md, CONTEXT.md, intel files) before running checks.
73
+ 3. **The operation noun** — substituted into the BLOCKED banner (`import`, `ingest`, etc.).
74
+
75
+ The workflow MUST NOT:
76
+
77
+ - Introduce new severity levels beyond BLOCKER/WARNING/INFO
78
+ - Render the report as a markdown table
79
+ - Write any destination file when BLOCKERs exist
80
+ - Auto-approve past WARNINGs without user input
81
+
82
+ ---
83
+
84
+ ## Anti-Patterns
85
+
86
+ Do NOT:
87
+
88
+ - Use markdown tables (`|---|`) in the conflict report — use plain-text labels as shown above
89
+ - Bypass the safety gate when BLOCKERs exist — no exceptions for "minor" blockers
90
+ - Fold WARNINGs into INFO to skip the approval prompt — if user input is needed, it is a WARNING
91
+ - Re-invent severity labels per workflow — the three-level taxonomy is fixed
@@ -0,0 +1,100 @@
1
+ # Gate Prompt Patterns
2
+
3
+ Reusable prompt patterns for structured gate checks in workflows and agents.
4
+
5
+ **For checkpoint box format details, see `references/ui-brand.md`** -- checkpoint boxes use double-line border drawing with 62-character inner width.
6
+
7
+ ## Rules
8
+
9
+ - `header` must be max 12 characters
10
+ - `multiSelect` is always `false` for gate checks
11
+ - Always handle the "Other" case (user typed a freeform response instead of selecting)
12
+ - Max 4 options per prompt -- if more are needed, use a 2-step flow
13
+
14
+ ---
15
+
16
+ ## Pattern: approve-revise-abort
17
+ 3-option gate for plan approval, gap-closure approval.
18
+ - question: "Approve these {noun}?"
19
+ - header: "Approve?"
20
+ - options: Approve | Request changes | Abort
21
+
22
+ ## Pattern: yes-no
23
+ Simple 2-option confirmation for re-planning, rebuild, replace plans, commit.
24
+ - question: "{Specific question about the action}"
25
+ - header: "Confirm"
26
+ - options: Yes | No
27
+
28
+ ## Pattern: stale-continue
29
+ 2-option refresh gate for staleness warnings, timestamp freshness.
30
+ - question: "{Artifact} may be outdated. Refresh or continue?"
31
+ - header: "Stale"
32
+ - options: Refresh | Continue anyway
33
+
34
+ ## Pattern: yes-no-pick
35
+ 3-option selection for seed selection, item inclusion.
36
+ - question: "Include {items} in planning?"
37
+ - header: "Include?"
38
+ - options: Yes, all | Let me pick | No
39
+
40
+ ## Pattern: multi-option-failure
41
+ 4-option failure handler for build failures.
42
+ - question: "Plan {id} failed. How should we proceed?"
43
+ - header: "Failed"
44
+ - options: Retry | Skip | Rollback | Abort
45
+
46
+ ## Pattern: multi-option-escalation
47
+ 4-option escalation for review escalation (max retries exceeded).
48
+ - question: "Phase {N} has failed verification {attempt} times. How should we proceed?"
49
+ - header: "Escalate"
50
+ - options: Accept gaps | Re-plan (via /ccp:plan-phase) | Debug (via /ccp:debug) | Retry
51
+
52
+ ## Pattern: multi-option-gaps
53
+ 4-option gap handler for review gaps-found.
54
+ - question: "{count} verification gaps need attention. How should we proceed?"
55
+ - header: "Gaps"
56
+ - options: Auto-fix | Override | Manual | Skip
57
+
58
+ ## Pattern: multi-option-priority
59
+ 4-option priority selection for milestone gap priority.
60
+ - question: "Which gaps should we address?"
61
+ - header: "Priority"
62
+ - options: Must-fix only | Must + should | Everything | Let me pick
63
+
64
+ ## Pattern: toggle-confirm
65
+ 2-option confirmation for enabling/disabling boolean features.
66
+ - question: "Enable {feature_name}?"
67
+ - header: "Toggle"
68
+ - options: Enable | Disable
69
+
70
+ ## Pattern: action-routing
71
+ Up to 4 suggested next actions with selection (status, resume workflows).
72
+ - question: "What would you like to do next?"
73
+ - header: "Next Step"
74
+ - options: {primary action} | {alternative 1} | {alternative 2} | Something else
75
+ - Note: Dynamically generate options from workflow state. Always include "Something else" as last option.
76
+
77
+ ## Pattern: scope-confirm
78
+ 3-option confirmation for quick task scope validation.
79
+ - question: "This task looks complex. Proceed as quick task or use full planning?"
80
+ - header: "Scope"
81
+ - options: Quick task | Full plan (via /ccp:plan-phase) | Revise
82
+
83
+ ## Pattern: depth-select
84
+ 3-option depth selection for planning workflow preferences.
85
+ - question: "How thorough should planning be?"
86
+ - header: "Depth"
87
+ - options: Quick (3-5 phases, skip research) | Standard (5-8 phases, default) | Comprehensive (8-12 phases, deep research)
88
+
89
+ ## Pattern: context-handling
90
+ 3-option handler for existing CONTEXT.md in discuss workflow.
91
+ - question: "Phase {N} already has a CONTEXT.md. How should we handle it?"
92
+ - header: "Context"
93
+ - options: Overwrite | Append | Cancel
94
+
95
+ ## Pattern: gray-area-option
96
+ Dynamic template for presenting gray area choices in discuss workflow.
97
+ - question: "{Gray area title}"
98
+ - header: "Decision"
99
+ - options: {Option 1} | {Option 2} | Let Claude decide
100
+ - Note: Options generated at runtime. Always include "Let Claude decide" as last option.
@@ -0,0 +1,70 @@
1
+ # Gates Taxonomy
2
+
3
+ Canonical gate types used across GSD workflows. Every validation checkpoint maps to one of these four types.
4
+
5
+ ---
6
+
7
+ ## Gate Types
8
+
9
+ ### Pre-flight Gate
10
+ **Purpose:** Validates preconditions before starting an operation.
11
+ **Behavior:** Blocks entry if conditions unmet. No partial work created.
12
+ **Recovery:** Fix the missing precondition, then retry.
13
+ **Examples:**
14
+ - Plan-phase checks for REQUIREMENTS.md before planning
15
+ - Execute-phase validates PLAN.md exists before execution
16
+ - Discuss-phase confirms phase exists in ROADMAP.md
17
+
18
+ ### Revision Gate
19
+ **Purpose:** Evaluates output quality and routes to revision if insufficient.
20
+ **Behavior:** Loops back to producer with specific feedback. Bounded by iteration cap.
21
+ **Recovery:** Producer addresses feedback; checker re-evaluates. The loop also escalates early if issue count does not decrease between consecutive iterations (stall detection). After max iterations, escalates unconditionally.
22
+ **Examples:**
23
+ - Plan-checker reviewing PLAN.md (max 3 iterations)
24
+ - Verifier checking phase deliverables against success criteria
25
+
26
+ ### Escalation Gate
27
+ **Purpose:** Surfaces unresolvable issues to the developer for a decision.
28
+ **Behavior:** Pauses workflow, presents options, waits for human input.
29
+ **Recovery:** Developer chooses action; workflow resumes on selected path.
30
+ **Examples:**
31
+ - Revision loop exhausted after 3 iterations
32
+ - Merge conflict during worktree cleanup
33
+ - Ambiguous requirement needing clarification
34
+
35
+ ### Abort Gate
36
+ **Purpose:** Terminates the operation to prevent damage or waste.
37
+ **Behavior:** Stops immediately, preserves state, reports reason.
38
+ **Recovery:** Developer investigates root cause, fixes, restarts from checkpoint.
39
+ **Examples:**
40
+ - Context window critically low during execution
41
+ - STATE.md in error state blocking /ccp:next
42
+ - Verification finds critical missing deliverables
43
+
44
+ ---
45
+
46
+ ## Gate Matrix
47
+
48
+ | Workflow | Phase | Gate Type | Artifacts Checked | Failure Behavior |
49
+ |----------|-------|-----------|-------------------|------------------|
50
+ | plan-phase | Entry | Pre-flight | REQUIREMENTS.md, ROADMAP.md | Block with missing-file message |
51
+ | plan-phase | Step 12 | Revision | PLAN.md quality | Loop to planner (max 3) |
52
+ | plan-phase | Post-revision | Escalation | Unresolved issues | Surface to developer |
53
+ | execute-phase | Entry | Pre-flight | PLAN.md | Block with missing-plan message |
54
+ | execute-phase | Completion | Revision | SUMMARY.md completeness | Re-run incomplete tasks |
55
+ | verify-work | Entry | Pre-flight | SUMMARY.md | Block with missing-summary |
56
+ | verify-work | Evaluation | Escalation | Failed criteria | Surface gaps to developer |
57
+ | next | Entry | Abort | Error state, checkpoints | Stop with diagnostic |
58
+
59
+ ---
60
+
61
+ ## Implementing Gates
62
+
63
+ Use this taxonomy when designing or auditing workflow validation points:
64
+
65
+ - **Pre-flight** gates belong at workflow entry points. They are cheap, deterministic checks that prevent wasted work. If you can verify a precondition with a file-existence check or a config read, use a pre-flight gate.
66
+ - **Revision** gates belong after a producer step where quality varies. Always pair them with an iteration cap to prevent infinite loops. The cap should reflect the cost of each iteration -- expensive operations get fewer retries.
67
+ - **Escalation** gates belong wherever automated resolution is impossible or ambiguous. They are the safety valve between revision loops and abort. Present the developer with clear options and enough context to decide.
68
+ - **Abort** gates belong at points where continuing would cause damage, waste significant resources, or produce meaningless output. They should preserve state so work can resume after the root cause is fixed.
69
+
70
+ **Selection heuristic:** Start with pre-flight. If the check happens after work is produced, it is a revision gate. If the revision loop cannot resolve the issue, escalate. If continuing is dangerous, abort.
@@ -0,0 +1,2 @@
1
+ **CRITICAL: Mandatory Initial Read**
2
+ If the prompt contains a `<required_reading>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
@@ -0,0 +1,19 @@
1
+ # Project Skills Discovery
2
+
3
+ Before execution, check for project-defined skills and apply their rules.
4
+
5
+ **Discovery steps (shared across all GSD agents):**
6
+ 1. Check `.claude/skills/` or `.agents/skills/` directory — if neither exists, skip.
7
+ 2. List available skills (subdirectories).
8
+ 3. Read `SKILL.md` for each skill (lightweight index, typically ~130 lines).
9
+ 4. Load specific `rules/*.md` files only as needed during the current task.
10
+ 5. Do NOT load full `AGENTS.md` files — they are large (100KB+) and cost significant context.
11
+
12
+ **Application** — how to apply the loaded rules depends on the calling agent:
13
+ - Planners account for project skill patterns and conventions in the plan.
14
+ - Executors follow skill rules relevant to the task being implemented.
15
+ - Researchers ensure research output accounts for project skill patterns.
16
+ - Verifiers apply skill rules when scanning for anti-patterns and verifying quality.
17
+ - Debuggers follow skill rules relevant to the bug being investigated and the fix being applied.
18
+
19
+ The caller's agent file should specify which application applies.