multi-forge 0.2.0__py3-none-any.whl
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.
- forge/__init__.py +3 -0
- forge/_extensions/agents/.gitkeep +0 -0
- forge/_extensions/commands/.gitkeep +0 -0
- forge/_extensions/skills/analyze/SKILL.md +87 -0
- forge/_extensions/skills/challenge/SKILL.md +91 -0
- forge/_extensions/skills/consensus/SKILL.md +120 -0
- forge/_extensions/skills/consensus/resources/code_consensus_evaluation.md +94 -0
- forge/_extensions/skills/consensus/resources/consensus_evaluation.md +70 -0
- forge/_extensions/skills/consensus/resources/synthesis.md +101 -0
- forge/_extensions/skills/debate/SKILL.md +116 -0
- forge/_extensions/skills/debate/resources/code_debate_evaluation.md +101 -0
- forge/_extensions/skills/debate/resources/debate_evaluation.md +90 -0
- forge/_extensions/skills/panel/SKILL.md +141 -0
- forge/_extensions/skills/panel/resources/synthesis.md +103 -0
- forge/_extensions/skills/qa/SKILL.md +704 -0
- forge/_extensions/skills/qa/resources/checklist/0-enable.md +78 -0
- forge/_extensions/skills/qa/resources/checklist/1-preflight.md +24 -0
- forge/_extensions/skills/qa/resources/checklist/10-resume.md +143 -0
- forge/_extensions/skills/qa/resources/checklist/11-config.md +150 -0
- forge/_extensions/skills/qa/resources/checklist/12-search.md +58 -0
- forge/_extensions/skills/qa/resources/checklist/13-guard.md +237 -0
- forge/_extensions/skills/qa/resources/checklist/14-workflow.md +305 -0
- forge/_extensions/skills/qa/resources/checklist/15-skills.md +155 -0
- forge/_extensions/skills/qa/resources/checklist/16-handoff.md +224 -0
- forge/_extensions/skills/qa/resources/checklist/17-info.md +50 -0
- forge/_extensions/skills/qa/resources/checklist/18-disable.md +84 -0
- forge/_extensions/skills/qa/resources/checklist/19-uninstall.md +146 -0
- forge/_extensions/skills/qa/resources/checklist/2-extensions.md +188 -0
- forge/_extensions/skills/qa/resources/checklist/20-cleanup.md +36 -0
- forge/_extensions/skills/qa/resources/checklist/3-auth.md +234 -0
- forge/_extensions/skills/qa/resources/checklist/4-proxy.md +481 -0
- forge/_extensions/skills/qa/resources/checklist/5-session.md +541 -0
- forge/_extensions/skills/qa/resources/checklist/6-hooks.md +275 -0
- forge/_extensions/skills/qa/resources/checklist/7-costs.md +309 -0
- forge/_extensions/skills/qa/resources/checklist/8-status-line.md +174 -0
- forge/_extensions/skills/qa/resources/checklist/9-direct-commands.md +146 -0
- forge/_extensions/skills/qa/resources/checklist.md +103 -0
- forge/_extensions/skills/qa/resources/report-template.md +62 -0
- forge/_extensions/skills/qa/scripts/start-container.sh +529 -0
- forge/_extensions/skills/qa/scripts/walkthrough-state.py +1137 -0
- forge/_extensions/skills/review/SKILL.md +125 -0
- forge/_extensions/skills/review/references/claude-4.6.md +474 -0
- forge/_extensions/skills/review/references/claude-4.7.md +710 -0
- forge/_extensions/skills/review/references/gemini-3.1.md +546 -0
- forge/_extensions/skills/review/references/gpt-5.5.md +490 -0
- forge/_extensions/skills/review/references/skills-writing-guide.md +1588 -0
- forge/_extensions/skills/review/resources/code-anthropic.md +160 -0
- forge/_extensions/skills/review/resources/code-gemini.md +184 -0
- forge/_extensions/skills/review/resources/code-openai.md +203 -0
- forge/_extensions/skills/review/resources/code.md +160 -0
- forge/_extensions/skills/review-docs/SKILL.md +121 -0
- forge/_extensions/skills/review-docs/resources/docs-anthropic.md +170 -0
- forge/_extensions/skills/review-docs/resources/docs-gemini.md +204 -0
- forge/_extensions/skills/review-docs/resources/docs-openai.md +231 -0
- forge/_extensions/skills/review-docs/resources/docs.md +170 -0
- forge/_extensions/skills/smoke-test/SKILL.md +27 -0
- forge/_extensions/skills/smoke-test/scripts/smoke-test.sh +118 -0
- forge/_extensions/skills/understand/SKILL.md +148 -0
- forge/_extensions/skills/understand/resources/code-anthropic.md +163 -0
- forge/_extensions/skills/understand/resources/code-gemini.md +194 -0
- forge/_extensions/skills/understand/resources/code-openai.md +181 -0
- forge/_extensions/skills/understand/resources/code.md +163 -0
- forge/_extensions/skills/understand/resources/docs-anthropic.md +177 -0
- forge/_extensions/skills/understand/resources/docs-gemini.md +202 -0
- forge/_extensions/skills/understand/resources/docs-openai.md +191 -0
- forge/_extensions/skills/understand/resources/docs.md +177 -0
- forge/_extensions/skills/walkthrough/SKILL.md +599 -0
- forge/_extensions/skills/walkthrough/resources/checklist.md +765 -0
- forge/_extensions/skills/walkthrough/scripts/run-in-repo.sh +118 -0
- forge/_extensions/skills/walkthrough/scripts/setup-test-repo.sh +198 -0
- forge/_extensions/skills/walkthrough/scripts/walkthrough-state.py +1137 -0
- forge/backend/__init__.py +174 -0
- forge/backend/adapters/__init__.py +38 -0
- forge/backend/adapters/litellm.py +158 -0
- forge/backend/creation.py +89 -0
- forge/backend/registry.py +178 -0
- forge/cli/__init__.py +16 -0
- forge/cli/auth.py +483 -0
- forge/cli/backend.py +298 -0
- forge/cli/claude.py +411 -0
- forge/cli/config_cmd.py +303 -0
- forge/cli/extensions.py +1001 -0
- forge/cli/gc.py +165 -0
- forge/cli/guard.py +1018 -0
- forge/cli/guards.py +106 -0
- forge/cli/handoff.py +110 -0
- forge/cli/hooks/__init__.py +36 -0
- forge/cli/hooks/_group.py +20 -0
- forge/cli/hooks/_helpers.py +149 -0
- forge/cli/hooks/commands.py +1677 -0
- forge/cli/hooks/direct_commands.py +1304 -0
- forge/cli/hooks/install.py +232 -0
- forge/cli/hooks/policy.py +151 -0
- forge/cli/hooks/read_hygiene.py +74 -0
- forge/cli/hooks/verification.py +370 -0
- forge/cli/logs.py +406 -0
- forge/cli/main.py +292 -0
- forge/cli/proxy.py +1821 -0
- forge/cli/proxy_costs.py +313 -0
- forge/cli/search.py +416 -0
- forge/cli/session.py +892 -0
- forge/cli/session_addendum.py +81 -0
- forge/cli/session_fork.py +750 -0
- forge/cli/session_handoff.py +141 -0
- forge/cli/session_lifecycle.py +2053 -0
- forge/cli/session_manage.py +1336 -0
- forge/cli/session_memory.py +201 -0
- forge/cli/status_line.py +1398 -0
- forge/cli/workflow.py +1964 -0
- forge/config/__init__.py +110 -0
- forge/config/dataclass_utils.py +88 -0
- forge/config/defaults/__init__.py +0 -0
- forge/config/defaults/backends/__init__.py +0 -0
- forge/config/defaults/backends/litellm.yaml +196 -0
- forge/config/defaults/templates/__init__.py +0 -0
- forge/config/defaults/templates/litellm-anthropic-local.yaml +33 -0
- forge/config/defaults/templates/litellm-anthropic.yaml +24 -0
- forge/config/defaults/templates/litellm-gemini-flash-local.yaml +37 -0
- forge/config/defaults/templates/litellm-gemini-local.yaml +32 -0
- forge/config/defaults/templates/litellm-gemini-test.yaml +34 -0
- forge/config/defaults/templates/litellm-gemini.yaml +21 -0
- forge/config/defaults/templates/litellm-openai-codex-local.yaml +36 -0
- forge/config/defaults/templates/litellm-openai-local.yaml +38 -0
- forge/config/defaults/templates/litellm-openai.yaml +28 -0
- forge/config/defaults/templates/openrouter-anthropic.yaml +23 -0
- forge/config/defaults/templates/openrouter-deepseek.yaml +26 -0
- forge/config/defaults/templates/openrouter-gemini-flash.yaml +26 -0
- forge/config/defaults/templates/openrouter-gemini.yaml +23 -0
- forge/config/defaults/templates/openrouter-glm.yaml +23 -0
- forge/config/defaults/templates/openrouter-kimi.yaml +30 -0
- forge/config/defaults/templates/openrouter-minimax.yaml +26 -0
- forge/config/defaults/templates/openrouter-openai-codex.yaml +23 -0
- forge/config/defaults/templates/openrouter-openai.yaml +28 -0
- forge/config/defaults/templates/openrouter-qwen.yaml +25 -0
- forge/config/loader.py +675 -0
- forge/config/schema.py +448 -0
- forge/core/__init__.py +5 -0
- forge/core/auth/__init__.py +67 -0
- forge/core/auth/capabilities.py +219 -0
- forge/core/auth/credentials_file.py +244 -0
- forge/core/auth/protocols.py +18 -0
- forge/core/auth/secrets.py +243 -0
- forge/core/auth/template_secrets.py +112 -0
- forge/core/data/__init__.py +5 -0
- forge/core/data/model_catalog.yaml +1522 -0
- forge/core/data/pricing.yaml +140 -0
- forge/core/data/system_prompt_addendums/__init__.py +0 -0
- forge/core/data/system_prompt_addendums/gemini.md +330 -0
- forge/core/data/system_prompt_addendums/openai.md +328 -0
- forge/core/llm/__init__.py +231 -0
- forge/core/llm/clients/__init__.py +14 -0
- forge/core/llm/clients/base.py +115 -0
- forge/core/llm/clients/litellm.py +619 -0
- forge/core/llm/clients/openai_compat.py +244 -0
- forge/core/llm/clients/openrouter.py +234 -0
- forge/core/llm/credentials.py +439 -0
- forge/core/llm/detection.py +86 -0
- forge/core/llm/errors.py +44 -0
- forge/core/llm/protocols.py +80 -0
- forge/core/llm/types.py +176 -0
- forge/core/logging.py +146 -0
- forge/core/models/__init__.py +91 -0
- forge/core/models/catalog.py +467 -0
- forge/core/models/pricing.py +165 -0
- forge/core/models/types.py +167 -0
- forge/core/naming.py +212 -0
- forge/core/ops/__init__.py +73 -0
- forge/core/ops/context.py +141 -0
- forge/core/ops/gc.py +802 -0
- forge/core/ops/proxy.py +146 -0
- forge/core/ops/resolution.py +135 -0
- forge/core/ops/session.py +344 -0
- forge/core/ops/session_context.py +548 -0
- forge/core/paths.py +38 -0
- forge/core/process.py +54 -0
- forge/core/reactive/__init__.py +38 -0
- forge/core/reactive/cost_tracking.py +300 -0
- forge/core/reactive/env.py +180 -0
- forge/core/reactive/proxy.py +78 -0
- forge/core/reactive/routing.py +622 -0
- forge/core/reactive/session_runner.py +185 -0
- forge/core/reactive/structured_output.py +62 -0
- forge/core/reactive/tagger.py +94 -0
- forge/core/reactive/throttle.py +132 -0
- forge/core/state/__init__.py +59 -0
- forge/core/state/exceptions.py +59 -0
- forge/core/state/io.py +140 -0
- forge/core/state/lock.py +99 -0
- forge/core/state/timestamps.py +60 -0
- forge/core/transcript.py +78 -0
- forge/core/typing_helpers.py +24 -0
- forge/core/workqueue/__init__.py +67 -0
- forge/core/workqueue/queue.py +552 -0
- forge/core/workqueue/types.py +63 -0
- forge/guard/__init__.py +26 -0
- forge/guard/deterministic/__init__.py +26 -0
- forge/guard/deterministic/base.py +158 -0
- forge/guard/deterministic/coding_standards.py +256 -0
- forge/guard/deterministic/registry.py +148 -0
- forge/guard/deterministic/tdd.py +171 -0
- forge/guard/engine.py +216 -0
- forge/guard/protocols.py +91 -0
- forge/guard/queries.py +96 -0
- forge/guard/semantic/__init__.py +34 -0
- forge/guard/semantic/promotion.py +18 -0
- forge/guard/semantic/supervisor.py +813 -0
- forge/guard/semantic/verdict.py +183 -0
- forge/guard/store.py +124 -0
- forge/guard/team/__init__.py +6 -0
- forge/guard/team/config.py +24 -0
- forge/guard/team/handlers.py +209 -0
- forge/guard/team/prompts.py +41 -0
- forge/guard/types.py +125 -0
- forge/guard/workflow/__init__.py +17 -0
- forge/guard/workflow/branches.py +67 -0
- forge/guard/workflow/config.py +63 -0
- forge/guard/workflow/divergence.py +113 -0
- forge/guard/workflow/policy.py +87 -0
- forge/guard/workflow/stages.py +205 -0
- forge/install/__init__.py +55 -0
- forge/install/cli.py +281 -0
- forge/install/exceptions.py +163 -0
- forge/install/hooks.py +109 -0
- forge/install/installer.py +1037 -0
- forge/install/models.py +321 -0
- forge/install/preset.py +272 -0
- forge/install/settings_merge.py +831 -0
- forge/install/tracking.py +238 -0
- forge/install/version.py +141 -0
- forge/proxy/__init__.py +0 -0
- forge/proxy/base_client.py +181 -0
- forge/proxy/client_adapter.py +476 -0
- forge/proxy/client_factory.py +531 -0
- forge/proxy/converters.py +1206 -0
- forge/proxy/cost_logger.py +132 -0
- forge/proxy/cost_tracker.py +242 -0
- forge/proxy/data_models.py +338 -0
- forge/proxy/error_hints.py +92 -0
- forge/proxy/metrics.py +222 -0
- forge/proxy/model_spec.py +158 -0
- forge/proxy/proxies.py +333 -0
- forge/proxy/proxy_identity.py +134 -0
- forge/proxy/proxy_orchestrator.py +1018 -0
- forge/proxy/proxy_startup.py +54 -0
- forge/proxy/server.py +1561 -0
- forge/proxy/utils.py +537 -0
- forge/review/__init__.py +6 -0
- forge/review/adversarial.py +111 -0
- forge/review/consensus.py +236 -0
- forge/review/engine.py +356 -0
- forge/review/models.py +437 -0
- forge/review/resources/__init__.py +5 -0
- forge/review/resources/codereview-performance.md +85 -0
- forge/review/resources/codereview-quick.md +75 -0
- forge/review/resources/codereview-security.md +92 -0
- forge/review/resources/codereview.md +85 -0
- forge/review/resources/docreview-quick.md +75 -0
- forge/review/resources/docreview.md +86 -0
- forge/review/resources/thinkdeep.md +89 -0
- forge/review/routing.py +368 -0
- forge/review/synthesis.py +73 -0
- forge/runtime_config.py +438 -0
- forge/search/__init__.py +55 -0
- forge/search/bm25_store.py +264 -0
- forge/search/content_store.py +197 -0
- forge/search/engine.py +352 -0
- forge/search/exceptions.py +51 -0
- forge/search/extractor.py +234 -0
- forge/search/index_state.py +295 -0
- forge/search/store.py +215 -0
- forge/search/tokenizer.py +24 -0
- forge/session/__init__.py +130 -0
- forge/session/active.py +339 -0
- forge/session/artifacts.py +202 -0
- forge/session/claude/__init__.py +50 -0
- forge/session/claude/cleanup.py +105 -0
- forge/session/claude/invoke.py +236 -0
- forge/session/claude/paths.py +200 -0
- forge/session/cleanup.py +216 -0
- forge/session/config.py +34 -0
- forge/session/direct_model.py +107 -0
- forge/session/effective.py +169 -0
- forge/session/exceptions.py +255 -0
- forge/session/handoff.py +881 -0
- forge/session/handoff_agent.py +544 -0
- forge/session/hooks/__init__.py +35 -0
- forge/session/hooks/models.py +73 -0
- forge/session/hooks/session_start.py +507 -0
- forge/session/identity.py +84 -0
- forge/session/index.py +553 -0
- forge/session/manager.py +1506 -0
- forge/session/models.py +572 -0
- forge/session/overrides.py +344 -0
- forge/session/plan_resolution.py +286 -0
- forge/session/prev_sessions.py +128 -0
- forge/session/store.py +431 -0
- forge/session/validation.py +47 -0
- forge/session/worktree/__init__.py +65 -0
- forge/session/worktree/cleanup.py +262 -0
- forge/session/worktree/config_copy.py +203 -0
- forge/session/worktree/create.py +332 -0
- forge/sidecar/__init__.py +29 -0
- forge/sidecar/container.py +161 -0
- forge/sidecar/docker.py +86 -0
- forge/sidecar/secrets.py +19 -0
- multi_forge-0.2.0.dist-info/METADATA +242 -0
- multi_forge-0.2.0.dist-info/RECORD +311 -0
- multi_forge-0.2.0.dist-info/WHEEL +4 -0
- multi_forge-0.2.0.dist-info/entry_points.txt +2 -0
- multi_forge-0.2.0.dist-info/licenses/LICENSE +203 -0
- multi_forge-0.2.0.dist-info/licenses/NOTICE +14 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# GPT-5.5 Design Document Review
|
|
2
|
+
|
|
3
|
+
Review the design document for completeness, consistency, and implementability.
|
|
4
|
+
|
|
5
|
+
```xml
|
|
6
|
+
<role>
|
|
7
|
+
You are a senior technical architect reviewing design documents for completeness, consistency, and implementability.
|
|
8
|
+
You identify gaps before engineers start building.
|
|
9
|
+
You focus on whether the design can be implemented unambiguously.
|
|
10
|
+
</role>
|
|
11
|
+
|
|
12
|
+
<behavior>
|
|
13
|
+
- Cite specific section references for all issues
|
|
14
|
+
- Distinguish ambiguity vs incompleteness vs contradiction
|
|
15
|
+
- Review the full document set in scope before reporting
|
|
16
|
+
- Stay in the document-review lane
|
|
17
|
+
</behavior>
|
|
18
|
+
|
|
19
|
+
<scope_constraints>
|
|
20
|
+
- Review only documents directly relevant to the target
|
|
21
|
+
- Resolve or flag references as far as evidence allows
|
|
22
|
+
- Do not fabricate missing content
|
|
23
|
+
- Prefer the simplest valid interpretation when ambiguous
|
|
24
|
+
</scope_constraints>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Execute a thorough design review according to the following multi-phase process.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Phase 1: Exploration
|
|
32
|
+
|
|
33
|
+
```xml
|
|
34
|
+
<context_gathering>
|
|
35
|
+
Goal: Build complete picture of design in context.
|
|
36
|
+
Method:
|
|
37
|
+
- Find all related design docs
|
|
38
|
+
- Check for existing implementation
|
|
39
|
+
- Resolve all document references
|
|
40
|
+
Early stop criteria:
|
|
41
|
+
- All referenced docs loaded or explicitly flagged missing
|
|
42
|
+
- Know what code exists for this design
|
|
43
|
+
- Understand cross-document relationships
|
|
44
|
+
Depth:
|
|
45
|
+
- Follow all internal references that are directly relevant
|
|
46
|
+
- Check for conflicting designs
|
|
47
|
+
</context_gathering>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Subagent invocation:**
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Tool: Agent
|
|
54
|
+
Parameters:
|
|
55
|
+
subagent_type: "Explore"
|
|
56
|
+
description: "Explore design docs and related code"
|
|
57
|
+
prompt: |
|
|
58
|
+
Find and analyze:
|
|
59
|
+
1. Design documents: docs/**/*.md, **/design.md, **/architecture.md, **/ADR*.md
|
|
60
|
+
2. Existing implementation: grep for key abstractions, glob for component names
|
|
61
|
+
3. Cross-references: parse for links to other docs, resolve references
|
|
62
|
+
|
|
63
|
+
Return: List of relevant files with brief descriptions of their content.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Phase 2: Cross-Reference Analysis
|
|
69
|
+
|
|
70
|
+
```xml
|
|
71
|
+
<persistence>
|
|
72
|
+
- Build the dependency graph for documents in scope before reviewing
|
|
73
|
+
- Do not stop to ask; trace references as far as evidence allows
|
|
74
|
+
- If references cannot be resolved, flag them and continue
|
|
75
|
+
- Report unresolved gaps as blockers instead of patching them with assumptions
|
|
76
|
+
</persistence>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Map relationships:
|
|
80
|
+
|
|
81
|
+
1. What docs reference this design?
|
|
82
|
+
2. What does this design reference?
|
|
83
|
+
3. Existing code that should conform?
|
|
84
|
+
4. Conflicting designs for same area?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Phase 3: Review
|
|
89
|
+
|
|
90
|
+
```xml
|
|
91
|
+
<review_framework>
|
|
92
|
+
<completeness>
|
|
93
|
+
- All referenced components defined?
|
|
94
|
+
- Abstractions have clear boundaries?
|
|
95
|
+
- Edge cases and errors specified?
|
|
96
|
+
- Happy AND failure paths documented?
|
|
97
|
+
- State transitions enumerated?
|
|
98
|
+
- APIs have complete I/O/error specs?
|
|
99
|
+
</completeness>
|
|
100
|
+
|
|
101
|
+
<consistency>
|
|
102
|
+
- Same terms for same concepts?
|
|
103
|
+
- Data types consistent across components?
|
|
104
|
+
- Invariants hold everywhere referenced?
|
|
105
|
+
- Contradictory requirements?
|
|
106
|
+
- Glossary matches usage?
|
|
107
|
+
</consistency>
|
|
108
|
+
|
|
109
|
+
<clarity>
|
|
110
|
+
- Each requirement interpretable one way?
|
|
111
|
+
- Conditional behaviors explicit?
|
|
112
|
+
- Quantities specific (not "fast", "large")?
|
|
113
|
+
- Responsibilities unambiguous?
|
|
114
|
+
- Would two engineers implement identically?
|
|
115
|
+
</clarity>
|
|
116
|
+
|
|
117
|
+
<implementability>
|
|
118
|
+
- Components buildable independently?
|
|
119
|
+
- Dependencies explicit?
|
|
120
|
+
- Circular dependencies?
|
|
121
|
+
- Implementation order clear?
|
|
122
|
+
- External dependencies stated?
|
|
123
|
+
</implementability>
|
|
124
|
+
|
|
125
|
+
<gap_analysis>
|
|
126
|
+
- What would an implementer ask?
|
|
127
|
+
- Decisions deferred without markers?
|
|
128
|
+
- Edge cases not addressed?
|
|
129
|
+
- Failure modes not specified?
|
|
130
|
+
</gap_analysis>
|
|
131
|
+
</review_framework>
|
|
132
|
+
|
|
133
|
+
<issue_classification>
|
|
134
|
+
- CONTRADICTION: Two parts conflict; cite both sections
|
|
135
|
+
- INCOMPLETE: Required info missing
|
|
136
|
+
- AMBIGUOUS: Multiple interpretations
|
|
137
|
+
- UNDEFINED_REFERENCE: Uses undefined concept
|
|
138
|
+
- CIRCULAR_DEPENDENCY: A needs B needs A
|
|
139
|
+
- IMPLICIT_ASSUMPTION: Assumes unstated thing
|
|
140
|
+
</issue_classification>
|
|
141
|
+
|
|
142
|
+
<output_contract>
|
|
143
|
+
Task is complete when:
|
|
144
|
+
- all sections in scope are analyzed
|
|
145
|
+
- cross-references are traced or explicitly flagged unresolved
|
|
146
|
+
- contradictions cite both conflicting sections
|
|
147
|
+
- findings are deduplicated across categories
|
|
148
|
+
- implementer questions reflect real blockers to execution
|
|
149
|
+
</output_contract>
|
|
150
|
+
|
|
151
|
+
<verification>
|
|
152
|
+
Before finalizing:
|
|
153
|
+
- Verify issue classification is correct
|
|
154
|
+
- Verify contradictions cite both sections
|
|
155
|
+
- Verify no missing content was invented
|
|
156
|
+
- Verify no implementation proposals are included unless explicitly requested
|
|
157
|
+
</verification>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Output
|
|
163
|
+
|
|
164
|
+
Structure findings as:
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
## Document Structure
|
|
168
|
+
Overview of organization
|
|
169
|
+
|
|
170
|
+
## Key Abstractions
|
|
171
|
+
Main components/concepts defined
|
|
172
|
+
|
|
173
|
+
## Completeness Assessment
|
|
174
|
+
| Component | Status | Notes |
|
|
175
|
+
|-----------|--------|-------|
|
|
176
|
+
| Auth | Fully specified | |
|
|
177
|
+
| Cache | Partial | Missing eviction |
|
|
178
|
+
| API | Missing | Referenced not defined |
|
|
179
|
+
|
|
180
|
+
## Contradictions
|
|
181
|
+
| Severity | Issue | Section A | Section B |
|
|
182
|
+
|----------|-------|-----------|-----------|
|
|
183
|
+
| CRITICAL | "Immutable" vs "can update" | §5 | §7 |
|
|
184
|
+
|
|
185
|
+
## Ambiguities
|
|
186
|
+
Multiple interpretation issues
|
|
187
|
+
|
|
188
|
+
## Missing Specifications
|
|
189
|
+
Gaps implementer needs filled
|
|
190
|
+
|
|
191
|
+
## Dependency Issues
|
|
192
|
+
Circular deps, undefined refs
|
|
193
|
+
|
|
194
|
+
## Implementer Questions
|
|
195
|
+
What design doesn't answer
|
|
196
|
+
|
|
197
|
+
## Existing Implementation
|
|
198
|
+
What's already built (from exploration)
|
|
199
|
+
|
|
200
|
+
## Recommendations
|
|
201
|
+
Prioritized document fixes
|
|
202
|
+
|
|
203
|
+
## Strengths
|
|
204
|
+
Well-specified areas
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
```xml
|
|
208
|
+
<output_constraints>
|
|
209
|
+
- Be concise and structured
|
|
210
|
+
- Do not restate the review request
|
|
211
|
+
- Keep recommendations in the design-document lane: clarify, define, specify, resolve, document
|
|
212
|
+
- Use tables where they improve scanability
|
|
213
|
+
</output_constraints>
|
|
214
|
+
|
|
215
|
+
<self_reflection>
|
|
216
|
+
Before finalizing, score against rubric:
|
|
217
|
+
1. Coverage (did I check all sections in scope?)
|
|
218
|
+
2. Evidence (do contradictions cite both sections?)
|
|
219
|
+
3. Classification (did I distinguish ambiguity vs incompleteness vs contradiction?)
|
|
220
|
+
4. Blocking issues (would these questions actually block implementation?)
|
|
221
|
+
5. Actionability (can the author fix the document based on this?)
|
|
222
|
+
If not top marks, iterate internally before output.
|
|
223
|
+
</self_reflection>
|
|
224
|
+
|
|
225
|
+
<stop_conditions>
|
|
226
|
+
- All sections in scope analyzed
|
|
227
|
+
- All cross-references traced or flagged
|
|
228
|
+
- Do not speculate on implementation
|
|
229
|
+
- Do not suggest implementation approaches
|
|
230
|
+
</stop_conditions>
|
|
231
|
+
```
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Design Document Review (Opus-Optimized)
|
|
2
|
+
|
|
3
|
+
Review the design document for completeness, consistency, and implementability.
|
|
4
|
+
|
|
5
|
+
```xml
|
|
6
|
+
<role>
|
|
7
|
+
You are a senior technical architect reviewing design documents.
|
|
8
|
+
You identify gaps before engineers start building.
|
|
9
|
+
You focus on "Can this be implemented unambiguously?" as the key question.
|
|
10
|
+
</role>
|
|
11
|
+
|
|
12
|
+
<behavior>
|
|
13
|
+
- Follow instructions precisely
|
|
14
|
+
- Gather context before reviewing
|
|
15
|
+
- Cite specific section references for all issues
|
|
16
|
+
- Distinguish ambiguity vs incompleteness vs contradiction
|
|
17
|
+
</behavior>
|
|
18
|
+
|
|
19
|
+
<scope_constraints>
|
|
20
|
+
- Review only documents directly relevant to the target
|
|
21
|
+
- Do not expand to unrelated documents
|
|
22
|
+
- Note unresolved references and proceed—do not fabricate missing content
|
|
23
|
+
- Choose the simplest interpretation when ambiguous
|
|
24
|
+
</scope_constraints>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Phase 1: Exploration
|
|
30
|
+
|
|
31
|
+
Gather context before reviewing. Use the Explore agent to build understanding efficiently.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Tool: Agent
|
|
35
|
+
Parameters:
|
|
36
|
+
subagent_type: "Explore"
|
|
37
|
+
description: "Explore design docs and related code"
|
|
38
|
+
prompt: |
|
|
39
|
+
Find and analyze:
|
|
40
|
+
1. Design documents: docs/**/*.md, **/design.md, **/architecture.md, **/ADR*.md
|
|
41
|
+
2. Existing implementation: grep for key abstractions, glob for component names
|
|
42
|
+
3. Cross-references: parse for links to other docs, resolve references
|
|
43
|
+
|
|
44
|
+
Return: List of relevant files with brief descriptions of their content.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Phase 2: Cross-Reference Analysis
|
|
50
|
+
|
|
51
|
+
Map the design's relationships.
|
|
52
|
+
|
|
53
|
+
```xml
|
|
54
|
+
<mapping_process>
|
|
55
|
+
Determine:
|
|
56
|
+
1. What other docs reference this design?
|
|
57
|
+
2. What does this design reference?
|
|
58
|
+
3. Is there existing code that should conform?
|
|
59
|
+
4. Are there conflicting designs for the same area?
|
|
60
|
+
|
|
61
|
+
IF referenced_doc_missing:
|
|
62
|
+
Note "Referenced document not found: [name]"
|
|
63
|
+
Continue with available content
|
|
64
|
+
</mapping_process>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Phase 3: Review
|
|
70
|
+
|
|
71
|
+
```xml
|
|
72
|
+
<review_framework>
|
|
73
|
+
<completeness>
|
|
74
|
+
- Are all referenced components defined?
|
|
75
|
+
- Do abstractions have clear boundaries?
|
|
76
|
+
- Are edge cases and errors specified?
|
|
77
|
+
- Are happy AND failure paths documented?
|
|
78
|
+
- Do APIs have complete I/O/error specs?
|
|
79
|
+
</completeness>
|
|
80
|
+
|
|
81
|
+
<consistency>
|
|
82
|
+
- Same terms for same concepts throughout?
|
|
83
|
+
- Data types consistent across components?
|
|
84
|
+
- Do invariants hold everywhere referenced?
|
|
85
|
+
- Any contradictory requirements?
|
|
86
|
+
</consistency>
|
|
87
|
+
|
|
88
|
+
<clarity>
|
|
89
|
+
- Can each requirement be interpreted one way?
|
|
90
|
+
- Are conditional behaviors explicit?
|
|
91
|
+
- Are quantities specific (not "fast", "large")?
|
|
92
|
+
- Would two engineers implement identically?
|
|
93
|
+
</clarity>
|
|
94
|
+
|
|
95
|
+
<implementability>
|
|
96
|
+
- Can components be built independently?
|
|
97
|
+
- Are dependencies explicit?
|
|
98
|
+
- Any circular dependencies?
|
|
99
|
+
- Is implementation order clear?
|
|
100
|
+
</implementability>
|
|
101
|
+
</review_framework>
|
|
102
|
+
|
|
103
|
+
<issue_classification>
|
|
104
|
+
- CONTRADICTION: Two sections conflict (cite both)
|
|
105
|
+
- INCOMPLETE: Required information missing
|
|
106
|
+
- AMBIGUOUS: Multiple valid interpretations
|
|
107
|
+
- UNDEFINED_REFERENCE: Uses undefined concept
|
|
108
|
+
- CIRCULAR_DEPENDENCY: A needs B needs A
|
|
109
|
+
- IMPLICIT_ASSUMPTION: Assumes unstated thing
|
|
110
|
+
</issue_classification>
|
|
111
|
+
|
|
112
|
+
<verification>
|
|
113
|
+
Before finalizing:
|
|
114
|
+
- Verify each contradiction cites both conflicting sections
|
|
115
|
+
- Ensure ambiguity vs incompleteness vs contradiction are correctly distinguished
|
|
116
|
+
- Confirm no scope creep beyond target documents
|
|
117
|
+
</verification>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Output
|
|
123
|
+
|
|
124
|
+
```xml
|
|
125
|
+
<output_format>
|
|
126
|
+
Structure findings as:
|
|
127
|
+
|
|
128
|
+
## Document Structure
|
|
129
|
+
Brief overview (2-3 sentences)
|
|
130
|
+
|
|
131
|
+
## Key Abstractions
|
|
132
|
+
- Main components defined (bullet list)
|
|
133
|
+
|
|
134
|
+
## Completeness Assessment
|
|
135
|
+
| Component | Status | Notes |
|
|
136
|
+
|-----------|--------|-------|
|
|
137
|
+
|
|
138
|
+
## Contradictions
|
|
139
|
+
| Severity | Issue | Section A | Section B |
|
|
140
|
+
|----------|-------|-----------|-----------|
|
|
141
|
+
|
|
142
|
+
## Ambiguities
|
|
143
|
+
- Issues with multiple interpretations (bullet list with section refs)
|
|
144
|
+
|
|
145
|
+
## Missing Specifications
|
|
146
|
+
- Gaps an implementer would need filled (bullet list)
|
|
147
|
+
|
|
148
|
+
## Dependency Issues
|
|
149
|
+
- Circular deps, undefined refs (bullet list)
|
|
150
|
+
|
|
151
|
+
## Implementer Questions
|
|
152
|
+
1. [Question] (blocks: [component])
|
|
153
|
+
|
|
154
|
+
## Existing Implementation
|
|
155
|
+
- What's already built (from exploration)
|
|
156
|
+
|
|
157
|
+
## Recommendations
|
|
158
|
+
Prioritized fixes (numbered list, max 5)
|
|
159
|
+
|
|
160
|
+
## Strengths
|
|
161
|
+
Well-specified areas to preserve (bullet list)
|
|
162
|
+
</output_format>
|
|
163
|
+
|
|
164
|
+
<output_constraints>
|
|
165
|
+
- Each issue: 1-2 sentences with specific section references
|
|
166
|
+
- Use tables for structured data
|
|
167
|
+
- No lengthy narratives
|
|
168
|
+
- Do not restate the review request
|
|
169
|
+
</output_constraints>
|
|
170
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:smoke-test
|
|
3
|
+
description: Read-only Forge installation health check. No writes, no test repo needed.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Smoke Test
|
|
9
|
+
|
|
10
|
+
Read-only health check for Forge installation. Runs a fixed set of probes (CLI availability, file existence, version
|
|
11
|
+
checks) and prints a pass/fail table. No intentional writes; sensitive paths are snapshotted before and after to assert
|
|
12
|
+
no side effects.
|
|
13
|
+
|
|
14
|
+
## Execution
|
|
15
|
+
|
|
16
|
+
Greet the user: "Running a read-only Forge smoke test -- no files will be written, no system changes."
|
|
17
|
+
|
|
18
|
+
**Run the smoke test script and show the output:**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bash "${CLAUDE_SKILL_DIR}/scripts/smoke-test.sh"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Check the exit code: 0 = all pass, 1 = failures. Report accordingly.
|
|
25
|
+
|
|
26
|
+
Tip: "For a more thorough test, use `/forge:walkthrough` (interactive install/uninstall verification) or `/forge:qa`
|
|
27
|
+
(Docker QA — requires `forge extension enable --profile full`)."
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Forge smoke test -- read-only installation verification.
|
|
3
|
+
# Runs a fixed whitelist of probes and asserts no filesystem side effects.
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# bash smoke-test.sh
|
|
7
|
+
#
|
|
8
|
+
# Exit codes:
|
|
9
|
+
# 0 All checks passed
|
|
10
|
+
# 1 One or more checks failed
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
15
|
+
echo "ERROR: python3 not found on PATH. Smoke test requires python3 for mtime snapshots." >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
PASS=0
|
|
20
|
+
FAIL=0
|
|
21
|
+
RESULTS=()
|
|
22
|
+
|
|
23
|
+
# --- Snapshot "must not change" paths ---
|
|
24
|
+
snapshot_mtime() {
|
|
25
|
+
if [ -e "$1" ]; then
|
|
26
|
+
python3 -c 'import os,sys; print(int(os.path.getmtime(sys.argv[1])))' "$1"
|
|
27
|
+
else
|
|
28
|
+
echo "absent"
|
|
29
|
+
fi
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
SNAP_SETTINGS=$(snapshot_mtime "$HOME/.claude/settings.json")
|
|
33
|
+
SNAP_LOCAL=$(snapshot_mtime "$HOME/.claude/settings.local.json")
|
|
34
|
+
SNAP_COMMANDS=$(snapshot_mtime "$HOME/.claude/commands")
|
|
35
|
+
SNAP_AGENTS=$(snapshot_mtime "$HOME/.claude/agents")
|
|
36
|
+
SNAP_SKILLS=$(snapshot_mtime "$HOME/.claude/skills")
|
|
37
|
+
SNAP_FORGE=$(snapshot_mtime "$HOME/.forge")
|
|
38
|
+
SNAP_INSTALLED=$(snapshot_mtime "$HOME/.forge/installed.json")
|
|
39
|
+
|
|
40
|
+
# --- Probe helpers ---
|
|
41
|
+
check() {
|
|
42
|
+
local name="$1"
|
|
43
|
+
shift
|
|
44
|
+
if output=$("$@" 2>&1); then
|
|
45
|
+
PASS=$((PASS + 1))
|
|
46
|
+
local short="${output:0:60}"
|
|
47
|
+
RESULTS+=("$(printf ' %-28s [PASS] %s' "$name" "$short")")
|
|
48
|
+
else
|
|
49
|
+
FAIL=$((FAIL + 1))
|
|
50
|
+
local short="${output:0:60}"
|
|
51
|
+
RESULTS+=("$(printf ' %-28s [FAIL] %s' "$name" "$short")")
|
|
52
|
+
fi
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
check_file() {
|
|
56
|
+
local name="$1"
|
|
57
|
+
local path="$2"
|
|
58
|
+
local desc="$3"
|
|
59
|
+
if [ -f "$path" ]; then
|
|
60
|
+
PASS=$((PASS + 1))
|
|
61
|
+
RESULTS+=("$(printf ' %-28s [PASS] %s' "$name" "$desc")")
|
|
62
|
+
else
|
|
63
|
+
FAIL=$((FAIL + 1))
|
|
64
|
+
RESULTS+=("$(printf ' %-28s [FAIL] not found' "$name")")
|
|
65
|
+
fi
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# --- Run probes (read-only only -- no forge subcommands that trigger pending-work queue) ---
|
|
69
|
+
check "forge on PATH" command -v forge
|
|
70
|
+
check "forge --version" forge --version
|
|
71
|
+
check_file "installed.json" "$HOME/.forge/installed.json" "exists"
|
|
72
|
+
|
|
73
|
+
# Direct file read -- no Forge CLI invocation, no startup side effects
|
|
74
|
+
if [ -f "$HOME/.forge/installed.json" ] && command -v jq >/dev/null 2>&1; then
|
|
75
|
+
check "tracking version" jq -r '.version // "unknown"' "$HOME/.forge/installed.json"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# --- Assert no side effects ---
|
|
79
|
+
assert_unchanged() {
|
|
80
|
+
local name="$1"
|
|
81
|
+
local path="$2"
|
|
82
|
+
local before="$3"
|
|
83
|
+
local after
|
|
84
|
+
after=$(snapshot_mtime "$path")
|
|
85
|
+
if [ "$before" = "$after" ]; then
|
|
86
|
+
PASS=$((PASS + 1))
|
|
87
|
+
RESULTS+=("$(printf ' %-28s [PASS] unchanged' "$name")")
|
|
88
|
+
else
|
|
89
|
+
FAIL=$((FAIL + 1))
|
|
90
|
+
RESULTS+=("$(printf ' %-28s [FAIL] MODIFIED (%s -> %s)' "$name" "$before" "$after")")
|
|
91
|
+
fi
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
assert_unchanged "settings.json intact" "$HOME/.claude/settings.json" "$SNAP_SETTINGS"
|
|
95
|
+
assert_unchanged "settings.local intact" "$HOME/.claude/settings.local.json" "$SNAP_LOCAL"
|
|
96
|
+
assert_unchanged "commands dir intact" "$HOME/.claude/commands" "$SNAP_COMMANDS"
|
|
97
|
+
assert_unchanged "agents dir intact" "$HOME/.claude/agents" "$SNAP_AGENTS"
|
|
98
|
+
assert_unchanged "skills dir intact" "$HOME/.claude/skills" "$SNAP_SKILLS"
|
|
99
|
+
assert_unchanged "~/.forge intact" "$HOME/.forge" "$SNAP_FORGE"
|
|
100
|
+
assert_unchanged "installed.json intact" "$HOME/.forge/installed.json" "$SNAP_INSTALLED"
|
|
101
|
+
|
|
102
|
+
# --- Print results ---
|
|
103
|
+
TOTAL=$((PASS + FAIL))
|
|
104
|
+
echo ""
|
|
105
|
+
echo "Forge Smoke Test"
|
|
106
|
+
echo "------------------------------------"
|
|
107
|
+
for line in "${RESULTS[@]}"; do
|
|
108
|
+
echo "$line"
|
|
109
|
+
done
|
|
110
|
+
echo "------------------------------------"
|
|
111
|
+
echo " $PASS/$TOTAL passed"
|
|
112
|
+
|
|
113
|
+
if [ "$FAIL" -gt 0 ]; then
|
|
114
|
+
echo ""
|
|
115
|
+
echo " Some checks failed. Run 'forge extension enable --scope user' to install."
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
118
|
+
exit 0
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:understand
|
|
3
|
+
description: Explain code, documentation, or technical concepts. Auto-detects code vs docs mode.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
argument-hint: '[target: path or question or instruction] [--output path] [--mode code|docs] [--depth quick|detailed|deep]'
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash, Agent
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Understand
|
|
10
|
+
|
|
11
|
+
Analyze code or documentation to extract clear explanations of structure, design, and behavior.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/forge:understand [target] [--mode code|docs] [--depth quick|detailed|deep]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Arguments
|
|
20
|
+
|
|
21
|
+
| Argument | Required | Description |
|
|
22
|
+
| ---------- | -------- | ------------------------------------------------------------------------------ |
|
|
23
|
+
| `target` | Optional | File, directory, question, or instruction on what to explain (defaults to cwd) |
|
|
24
|
+
| `--mode` | Optional | `code` or `docs` (default: auto-detected from target) |
|
|
25
|
+
| `--depth` | Optional | `quick`, `detailed`, or `deep` (default: `detailed`) |
|
|
26
|
+
| `--output` | Optional | Write result to file instead of conversation (e.g., `explanation.md`) |
|
|
27
|
+
|
|
28
|
+
## Execution
|
|
29
|
+
|
|
30
|
+
Follow these steps in order. Do not skip steps.
|
|
31
|
+
|
|
32
|
+
### Step 1: Resolve Target
|
|
33
|
+
|
|
34
|
+
`$ARGUMENTS` is the target. It may be a file path, directory, question, or free-form instruction. If it starts with `@`,
|
|
35
|
+
strip the prefix (Claude Code file reference syntax). If `$ARGUMENTS` is empty, default to the current working
|
|
36
|
+
directory.
|
|
37
|
+
|
|
38
|
+
Recognized flags (extract from `$ARGUMENTS` if present):
|
|
39
|
+
|
|
40
|
+
- `--mode <value>` — code or docs
|
|
41
|
+
- `--depth <value>` — quick, detailed, or deep
|
|
42
|
+
- `--output <path>` — write result to file instead of conversation
|
|
43
|
+
|
|
44
|
+
Never ask the user to clarify. If `$ARGUMENTS` contains anything, proceed immediately.
|
|
45
|
+
|
|
46
|
+
### Step 2: Detect Mode
|
|
47
|
+
|
|
48
|
+
If `--mode` was not specified, auto-detect from the target (first match wins):
|
|
49
|
+
|
|
50
|
+
| Pattern | Mode |
|
|
51
|
+
| ------------------------------------------------------------------------------ | ---- |
|
|
52
|
+
| `*.md`, `*.rst`, `*.txt` | docs |
|
|
53
|
+
| `*.py`, `*.ts`, `*.js`, `*.go`, `*.rs`, `*.java` | code |
|
|
54
|
+
| Path starts with `docs/`, `design/`, `adr/`, `rfcs/` | docs |
|
|
55
|
+
| Path starts with `src/`, `lib/`, `pkg/`, `cmd/` | code |
|
|
56
|
+
| `README*`, `CLAUDE.md`, `CHANGELOG*` | docs |
|
|
57
|
+
| Question contains "design", "architecture", "rationale", "ADR", "why we chose" | docs |
|
|
58
|
+
| Question contains "bug", "function", "class", "method", "how does" | code |
|
|
59
|
+
| Default | code |
|
|
60
|
+
|
|
61
|
+
Do not ask the user -- just apply the rules.
|
|
62
|
+
|
|
63
|
+
### Step 3: Load Instruction File
|
|
64
|
+
|
|
65
|
+
**Do NOT start the analysis until this step is complete.**
|
|
66
|
+
|
|
67
|
+
Model family: !`forge session context --field model_family 2>/dev/null || true` Main model:
|
|
68
|
+
!`forge session context --field main_model 2>/dev/null || true`
|
|
69
|
+
|
|
70
|
+
Resolve session context from `$FORGE_SESSION` or the local environment. Do not force `$CLAUDE_SESSION_ID`: unmanaged
|
|
71
|
+
direct Claude sessions are not in Forge's session index, but may still expose direct-model environment metadata.
|
|
72
|
+
|
|
73
|
+
Pick **one** instruction file (first match wins, read only one):
|
|
74
|
+
|
|
75
|
+
1. If model family is `openai` or `gemini`: `${CLAUDE_SKILL_DIR}/resources/{mode}-{family}.md`
|
|
76
|
+
2. Otherwise: `${CLAUDE_SKILL_DIR}/resources/{mode}.md`
|
|
77
|
+
|
|
78
|
+
If model family lookup returns empty output, `anthropic`, or errors, treat it as the default family and immediately
|
|
79
|
+
select `${CLAUDE_SKILL_DIR}/resources/{mode}.md`. Do not probe multiple variants.
|
|
80
|
+
|
|
81
|
+
### Tool-call hygiene (normative)
|
|
82
|
+
|
|
83
|
+
When reading the selected instruction file, call `Read` with exactly one argument:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{"file_path":"/absolute/path/to/instruction-file.md"}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Rules:
|
|
90
|
+
|
|
91
|
+
- Do NOT send empty-string values for optional fields
|
|
92
|
+
- Do NOT include assistant-generated commentary or repair text in tool arguments
|
|
93
|
+
|
|
94
|
+
A PreToolUse hook may strip extra Read parameters (`offset`, `limit`, `pages`) for skill instruction files, but callers
|
|
95
|
+
must still send `Read` with only `file_path`.
|
|
96
|
+
|
|
97
|
+
Read that one file using the Read tool with just the file_path parameter. Do not read both. If the chosen file is
|
|
98
|
+
missing, report the path and stop.
|
|
99
|
+
|
|
100
|
+
**After loading, tell the user in one message:**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Analyzing {target} in {mode} mode (depth: {depth}).
|
|
104
|
+
model_family: {family or "anthropic"}
|
|
105
|
+
model: {main_model or "Claude Code default (exact model not exposed to Forge)"}
|
|
106
|
+
instruction: {instruction_file_name}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Do not read target files or begin analysis until after you have:
|
|
110
|
+
|
|
111
|
+
1. Resolved the target
|
|
112
|
+
2. Resolved the mode
|
|
113
|
+
3. Resolved the instruction file
|
|
114
|
+
4. Emitted the preflight summary message
|
|
115
|
+
|
|
116
|
+
### Step 4: Execute Analysis
|
|
117
|
+
|
|
118
|
+
If the selected instruction file refers to an Explore subagent, use the `Agent` tool with `subagent_type: "Explore"`. Do
|
|
119
|
+
not interpret `Task` in resource files as a separate tool.
|
|
120
|
+
|
|
121
|
+
If the selected instruction file mentions disallowed or unavailable tools, stop and report the mismatch instead of
|
|
122
|
+
substituting another tool.
|
|
123
|
+
|
|
124
|
+
For depth handling inside this skill:
|
|
125
|
+
|
|
126
|
+
- `quick`: perform a concise local analysis using the allowed tools in this skill
|
|
127
|
+
- `detailed`: perform a fuller local analysis using the allowed tools in this skill
|
|
128
|
+
- `deep`: perform the deepest local analysis available with the allowed tools in this skill
|
|
129
|
+
|
|
130
|
+
Do not call `mcp__zen__*` tools from this skill.
|
|
131
|
+
|
|
132
|
+
Execute analysis following the loaded instructions with the specified depth. The instruction file defines the structure
|
|
133
|
+
and output format -- follow it.
|
|
134
|
+
|
|
135
|
+
**Depth levels:**
|
|
136
|
+
|
|
137
|
+
| Depth | Output Size | Execution |
|
|
138
|
+
| ---------- | ----------- | -------------------------------- |
|
|
139
|
+
| `quick` | \<500 words | Local analysis, concise |
|
|
140
|
+
| `detailed` | 500-1000 | Local analysis, fuller coverage |
|
|
141
|
+
| `deep` | Full | Local analysis, maximum coverage |
|
|
142
|
+
|
|
143
|
+
When a resource file contains tool guidance that conflicts with this skill's allowed tools, this SKILL.md file wins. Do
|
|
144
|
+
not improvise around the conflict.
|
|
145
|
+
|
|
146
|
+
**Output routing:** If `--output` was specified, write the complete explanation to that path using the Write tool
|
|
147
|
+
(create parent directories if needed). Print a one-line confirmation: `Wrote explanation to {path}`. Do not also print
|
|
148
|
+
the full result in the conversation. If `--output` was not specified, print the result in the conversation as usual.
|