@chrono-meta/fh-gate 1.0.3 → 1.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.
- package/.claude/agents/challenger.md +169 -0
- package/AGENTS.md +160 -0
- package/CATALOG.md +256 -0
- package/CHEATSHEET.md +367 -0
- package/CLAUDE.md +331 -0
- package/CONTRIBUTING.md +198 -0
- package/LICENSE +21 -0
- package/README.md +131 -418
- package/bin/fh-goal.js +9 -0
- package/bin/fh-run.js +9 -0
- package/docs/banner.png +0 -0
- package/docs/codex-compat.md +123 -0
- package/docs/pillars.svg +70 -0
- package/knowledge/shared/harness-core/fh_integration_contract.md +48 -29
- package/package.json +31 -6
- package/plugins/fh-commons/README.md +37 -0
- package/plugins/fh-commons/agents/quench-challenger.md +373 -0
- package/plugins/fh-commons/skills/convergence-loop/SKILL.md +155 -0
- package/plugins/fh-commons/skills/deliberation/SKILL.md +288 -0
- package/plugins/fh-commons/skills/mcp-circuit-breaker/SKILL.md +196 -0
- package/plugins/fh-commons/skills/token-budget-gate/SKILL.md +175 -0
- package/plugins/fh-meta/agents/fact-checker.md +121 -0
- package/plugins/fh-meta/agents/hub-persona-auditor.md +109 -0
- package/plugins/fh-meta/agents/persona-innovator.md +195 -0
- package/plugins/fh-meta/skills/agent-composer/SKILL.md +461 -0
- package/plugins/fh-meta/skills/agent-composer/SKILL_detail.md +464 -0
- package/plugins/fh-meta/skills/apex-review/SKILL.md +185 -0
- package/plugins/fh-meta/skills/asset-placement-gate/SKILL.md +135 -0
- package/plugins/fh-meta/skills/contention-layer/SKILL.md +127 -0
- package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL.md +30 -0
- package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL_detail.md +144 -0
- package/plugins/fh-meta/skills/context-doctor/SKILL.md +341 -0
- package/plugins/fh-meta/skills/cross-ecosystem-synergy-detection/SKILL.md +202 -0
- package/plugins/fh-meta/skills/deep-clarify/SKILL.md +144 -0
- package/plugins/fh-meta/skills/edit-manifest/SKILL.md +210 -0
- package/plugins/fh-meta/skills/field-harvest/SKILL.md +384 -0
- package/plugins/fh-meta/skills/frontier-digest/SKILL.md +272 -0
- package/plugins/fh-meta/skills/goal-quench/SKILL.md +509 -0
- package/plugins/fh-meta/skills/harness-doctor/SKILL.md +277 -0
- package/plugins/fh-meta/skills/harness-doctor/SKILL_detail.md +484 -0
- package/plugins/fh-meta/skills/harvest-loop/SKILL.md +231 -0
- package/plugins/fh-meta/skills/harvest-loop/SKILL_detail.md +201 -0
- package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL.md +129 -0
- package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL_detail.md +158 -0
- package/plugins/fh-meta/skills/install-doctor/SKILL.md +207 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +613 -0
- package/plugins/fh-meta/skills/marketplace-gate/SKILL.md +193 -0
- package/plugins/fh-meta/skills/memory-hygiene/SKILL.md +143 -0
- package/plugins/fh-meta/skills/meta-prompt-builder/SKILL.md +167 -0
- package/plugins/fh-meta/skills/meta-prompt-builder/SKILL_detail.md +37 -0
- package/plugins/fh-meta/skills/pipeline-conductor/SKILL.md +430 -0
- package/plugins/fh-meta/skills/plugin-recommender/SKILL.md +221 -0
- package/plugins/fh-meta/skills/plugin-recommender/SKILL_detail.md +220 -0
- package/plugins/fh-meta/skills/prompt-regression/SKILL.md +178 -0
- package/plugins/fh-meta/skills/public-surface-audit/SKILL.md +224 -0
- package/plugins/fh-meta/skills/return-path-gate/SKILL.md +257 -0
- package/plugins/fh-meta/skills/self-marketing-lint/SKILL.md +129 -0
- package/plugins/fh-meta/skills/sim-conductor/SKILL.md +364 -0
- package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +337 -0
- package/plugins/fh-meta/skills/skill-splitter/SKILL.md +126 -0
- package/plugins/fh-meta/skills/skill-splitter/SKILL_detail.md +185 -0
- package/plugins/fh-meta/skills/source-grounding-audit/SKILL.md +230 -0
- package/plugins/fh-meta/skills/source-grounding-audit/SKILL_detail.md +182 -0
- package/plugins/fh-meta/skills/steel-quench/SKILL.md +226 -0
- package/plugins/fh-meta/skills/steel-quench/SKILL_detail.md +453 -0
- package/plugins/fh-meta/skills/verify-bidirectional/SKILL.md +238 -0
- package/scripts/fh-gate.sh +175 -40
- package/scripts/fh-goal.sh +182 -0
- package/scripts/fh-run.sh +269 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: install-wizard
|
|
3
|
+
description: Run when setting up a new project for the first time or onboarding after installing FH (first setup, initial configuration, onboarding start, configure project, help me set up). Performs environment detection → gap diagnosis → item-by-item suggestions → user approval → execution → acceleration baseline setup in sequence. Use --dry-run to output diagnosis report only (bg dispatch compatible).
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: ["Read", "Write", "Bash", "Glob", "Grep", "Edit"]
|
|
6
|
+
model: opus
|
|
7
|
+
category: Composability Gate
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# install-wizard — Onboarding Setup Wizard
|
|
11
|
+
|
|
12
|
+
> ⚠️ **Prerequisite — Read first if this is your first install**
|
|
13
|
+
>
|
|
14
|
+
> This skill is available **after the fh-meta plugin is registered in Claude Code**.
|
|
15
|
+
> If you type `/install-wizard` and CC doesn't respond, the plugin hasn't been registered yet.
|
|
16
|
+
>
|
|
17
|
+
> **When running Claude Code from the FH directory**: the AI detects the MISS automatically
|
|
18
|
+
> and installs the plugin via Bash — no manual input needed. Just say "install the plugin."
|
|
19
|
+
>
|
|
20
|
+
> **Manual fallback (if needed):**
|
|
21
|
+
> ```bash
|
|
22
|
+
> claude plugin marketplace add https://github.com/chrono-meta/forge-harness.git
|
|
23
|
+
> claude plugin install -s user fh-meta@forge-harness
|
|
24
|
+
> ```
|
|
25
|
+
> After install, if `install-wizard` appears in `/skills` list in CC chat, you're ready.
|
|
26
|
+
> See `README.md > Advanced Settings > Plugin Install` for detailed guide.
|
|
27
|
+
|
|
28
|
+
Run immediately after cloning forge-harness (FH), or when setting up a new project for the first time.
|
|
29
|
+
Sets up periodic notification structure (zshrc hook) and weekly audit notifications within Claude Code (CC) sessions. The zshrc hook is permanently applied; CronCreate is valid only for the current session.
|
|
30
|
+
|
|
31
|
+
## Key Terms
|
|
32
|
+
|
|
33
|
+
| Term | Definition |
|
|
34
|
+
|---|---|
|
|
35
|
+
| **sentinel** | An empty file that records whether a specific event (audit complete, install complete, etc.) has occurred. Created in `~/.cc_sentinels/`. |
|
|
36
|
+
| **CronCreate** | Claude Code built-in command — schedules periodic tasks valid for the current session. Disappears when session ends. |
|
|
37
|
+
| **zshrc hook** | Shell function added to `~/.zshrc`. Automatically runs on terminal start and applies permanently. |
|
|
38
|
+
|
|
39
|
+
## Execution Modes
|
|
40
|
+
|
|
41
|
+
| Mode | Trigger | Action |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| **Normal mode** (default) | `/install-wizard` | Gap diagnosis → per-item approval → execution → zshrc/sentinel install (interactive) |
|
|
44
|
+
| **Analysis mode** | `/install-wizard --dry-run` | Gap diagnosis + report output only. No approval gate or execution. bg dispatch compatible |
|
|
45
|
+
|
|
46
|
+
> On `--dry-run`, outputs Step 2 report then skips Steps 3~4 and exits early.
|
|
47
|
+
|
|
48
|
+
## Core Principles
|
|
49
|
+
|
|
50
|
+
- **Propose-First**: Show proposal list and get approval before any changes
|
|
51
|
+
- **Per-item approval**: Select each item individually (Y approve / N skip / L later)
|
|
52
|
+
- **Double-confirm irreversible changes**: Preview before file writes and zshrc modifications
|
|
53
|
+
- **User review before PR creation**: Output PR parameters (title, base branch, included files, body) and get approval before execution. No automatic submission.
|
|
54
|
+
- **Periodic audit structure setup**: zshrc hook (permanently applied on terminal start) + sentinel initialization + CronCreate (valid for current CC session)
|
|
55
|
+
|
|
56
|
+
## Execution Steps
|
|
57
|
+
|
|
58
|
+
> Overall flow summary (guide for first-time readers):
|
|
59
|
+
>
|
|
60
|
+
> | Stage | Name | Condition |
|
|
61
|
+
> |---|---|---|
|
|
62
|
+
> | **Step 0-A** | FH suitability pre-check (pre-flight) | Always run |
|
|
63
|
+
> | **Step 0-B** | Git token pre-injection | When repo creation/fork/push included |
|
|
64
|
+
> | **Step 0** | Auto environment detection + environment card output | Always run (after 0-A/B) |
|
|
65
|
+
> | **Step 0-C** | Existing harness detection + integration proposal | Auto-run when CLAUDE.md >50 lines or 3+ rules |
|
|
66
|
+
> | **Step 1** | Gap diagnosis | Always run |
|
|
67
|
+
> | **Step 2** | Diagnosis report + proposal list | Always run (`--dry-run` exits here) |
|
|
68
|
+
> | **Step 3** | User approval → per-item execution | Normal mode only |
|
|
69
|
+
> | **Step 4** | Acceleration baseline setup | Normal mode only |
|
|
70
|
+
> | **Step 5** | Completion report + contribution guidance | Normal mode only |
|
|
71
|
+
>
|
|
72
|
+
> **Sub-step vs Main step**: Steps 0-A/B/C are sub-steps of Step 0 environment detection.
|
|
73
|
+
> Proceed in order 0-A → 0-B → 0 (environment card) → 0-C, then move to Step 1.
|
|
74
|
+
|
|
75
|
+
### Step 0-A. FH Suitability Pre-check (pre-flight)
|
|
76
|
+
|
|
77
|
+
If this is your first time with FH, confirm 3 things before install. All should apply for maximum effect.
|
|
78
|
+
|
|
79
|
+
| Check item | Optimal situation | If not |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| **Are you using Claude Code as your primary tool?** | ✅ Using CC daily | FH only works on top of CC. Need to adopt CC first |
|
|
82
|
+
| **Are you running 2+ projects in parallel or have a meta-hub?** | ✅ Multiple projects or team shared environment | FH may not be needed for a single small project |
|
|
83
|
+
| **Do you want to structurally improve AI collaboration quality?** | ✅ Repeatedly performing verification/simulation/diagnosis | If you only want simple coding automation, deeper skills after install-wizard are optional |
|
|
84
|
+
| **Are you developing or researching FH itself?** | ✅ Extending skills, writing papers, running experiments on FH | → **Mode D** — companion-store setup needed (see below) |
|
|
85
|
+
|
|
86
|
+
Fewer than 2 of 3 (first three) → Proceed with install but recommend using only core skills (`context-doctor`, `harness-doctor`) first.
|
|
87
|
+
All 3 → Proceed in order: Step 0-B (token injection) → Step 0 (environment card) → Step 0-C (existing harness).
|
|
88
|
+
|
|
89
|
+
**Mode D detected (FH developer/researcher)**: Guide companion-store setup before Step 1.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
You're developing FH itself — you need a private companion store
|
|
93
|
+
alongside the public mirror.
|
|
94
|
+
|
|
95
|
+
Recommended layout:
|
|
96
|
+
public: {org}/{hub} (methodology, skills, rules)
|
|
97
|
+
private: {org}/{hub}-be (paper drafts, experiment logs,
|
|
98
|
+
raw signals, handoff files)
|
|
99
|
+
|
|
100
|
+
Quick setup:
|
|
101
|
+
gh repo create {org}/{hub}-be --private
|
|
102
|
+
git clone https://github.com/{org}/{hub}-be ~/path/to/{hub}-be
|
|
103
|
+
mkdir -p {hub}-be/{paper-drafts,paper-signals,digests,handoff}
|
|
104
|
+
|
|
105
|
+
Key rule: knowledge/shared/ drafts stay local via .gitignore glob.
|
|
106
|
+
Push snapshots to the companion store explicitly — never auto-push.
|
|
107
|
+
handoff/ files bridge cloud session → local without exposing content.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Step 0-B. Git Token Pre-injection (when repo creation/fork/push included)
|
|
111
|
+
|
|
112
|
+
When the work involves Git authentication needs like GitHub repo creation, fork, push, etc.,
|
|
113
|
+
inject the token as an environment variable in the terminal **before starting the CC session**.
|
|
114
|
+
|
|
115
|
+
> Pasting tokens directly in chat exposes them in conversation history.
|
|
116
|
+
> Injecting as environment variable keeps them out of the record while gh / git CLI automatically recognizes them.
|
|
117
|
+
|
|
118
|
+
**Method A — One-time injection per session (recommended):**
|
|
119
|
+
```bash
|
|
120
|
+
# In terminal before starting CC
|
|
121
|
+
export GH_TOKEN=ghp_xxxx # GitHub Personal Access Token
|
|
122
|
+
export GITHUB_TOKEN=$GH_TOKEN # Some CLIs read GITHUB_TOKEN
|
|
123
|
+
claude # gh / git commands will automatically use token afterward
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Method B — Permanent local secret file:**
|
|
127
|
+
```bash
|
|
128
|
+
mkdir -p ~/.cc_secrets
|
|
129
|
+
echo 'export GH_TOKEN=ghp_xxxx' >> ~/.cc_secrets/tokens.env
|
|
130
|
+
chmod 600 ~/.cc_secrets/tokens.env
|
|
131
|
+
echo 'source ~/.cc_secrets/tokens.env' >> ~/.zshrc
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> `~/.cc_secrets/` is a local-only path outside git management — not a commit target for team repos.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
**The following are environment detection procedures that CC executes automatically. No need for users to run manually.**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Prompt injection pre-flight: check for AI instruction injection in external config files
|
|
142
|
+
if grep -rE "^# CLAUDE:|^# AI:|<instructions>" ~/.zshrc .claude/settings.json 2>/dev/null | grep -q .; then
|
|
143
|
+
echo "⚠️ AI instruction pattern detected in external config files — injection risk. Manual check recommended."; fi
|
|
144
|
+
|
|
145
|
+
# FH location
|
|
146
|
+
echo "FH_DIR=${FH_DIR:-not set}"
|
|
147
|
+
echo "CC_HUB_DIR=${CC_HUB_DIR:-not set}"
|
|
148
|
+
|
|
149
|
+
# cwd project info
|
|
150
|
+
basename "$(pwd)"
|
|
151
|
+
ls .claude/ 2>/dev/null
|
|
152
|
+
|
|
153
|
+
# CC settings (handle both dict and list for plugins)
|
|
154
|
+
cat .claude/settings.json 2>/dev/null | python3 -c "
|
|
155
|
+
import json,sys
|
|
156
|
+
d=json.load(sys.stdin)
|
|
157
|
+
p=d.get('plugins',{})
|
|
158
|
+
print('plugins:', list(p.keys()) if isinstance(p,dict) else p)
|
|
159
|
+
" 2>/dev/null || echo "settings.json not found"
|
|
160
|
+
|
|
161
|
+
# MCP plugin connection status
|
|
162
|
+
python3 -c "import json,os; d=json.load(open(os.path.expanduser('~/.claude.json'))); print('MCP:', list(d.get('mcpServers',{}).keys()))" 2>/dev/null || echo "MCP config not found"
|
|
163
|
+
|
|
164
|
+
# zshrc hook status
|
|
165
|
+
grep -q "fh_audit_check.zsh" ~/.zshrc 2>/dev/null && echo "zshrc hook: present" || echo "zshrc hook: absent"
|
|
166
|
+
|
|
167
|
+
# Framework detection (Streamlit) — must be specified in requirements.txt or pyproject.toml
|
|
168
|
+
STREAMLIT_PROJECT=false
|
|
169
|
+
if grep -q "streamlit" requirements.txt 2>/dev/null || \
|
|
170
|
+
grep -q "streamlit" pyproject.toml 2>/dev/null; then
|
|
171
|
+
STREAMLIT_PROJECT=true
|
|
172
|
+
echo "Framework: Streamlit detected"
|
|
173
|
+
fi
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Bootstrap guidance when FH_DIR is not set (stop immediately in Step 0):**
|
|
177
|
+
```
|
|
178
|
+
⚠️ FH_DIR not set — install FH first then rerun.
|
|
179
|
+
|
|
180
|
+
1. Clone FH repo:
|
|
181
|
+
git clone https://github.com/chrono-meta/forge-harness ~/forge-harness
|
|
182
|
+
|
|
183
|
+
2. Set environment variable:
|
|
184
|
+
export FH_DIR=~/forge-harness
|
|
185
|
+
|
|
186
|
+
3. Install FH plugin in CC:
|
|
187
|
+
Settings → Plugins → Add → {FH_DIR}/plugins/fh-meta
|
|
188
|
+
|
|
189
|
+
4. Rerun /install-wizard after completion
|
|
190
|
+
```
|
|
191
|
+
→ Do not proceed to subsequent Steps when FH_DIR is not set.
|
|
192
|
+
|
|
193
|
+
### Step 0. Auto Environment Detection — Environment Card Output
|
|
194
|
+
|
|
195
|
+
*(Run after Step 0-A·B pre-checks. Output results as environment card, then continue to Step 0-C.)*
|
|
196
|
+
|
|
197
|
+
Output detection results as **environment card**. Activate CC pattern reference on Streamlit detection:
|
|
198
|
+
```
|
|
199
|
+
📌 Streamlit project detected → CC pattern reference activated
|
|
200
|
+
{CC_HUB_DIR}/knowledge/shared/streamlit_patterns.md loaded (if present — optional Streamlit pattern pack, not shipped by default)
|
|
201
|
+
Check: data_editor empty df / column nesting / async wrapper / CSS numeric variables
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
install-wizard — Environment Detection
|
|
206
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
|
+
Project: {cwd name}
|
|
208
|
+
FH_DIR: {path or not set}
|
|
209
|
+
CC Hub: {CC_HUB_DIR or not set}
|
|
210
|
+
Plugins: {installed plugin list}
|
|
211
|
+
zshrc hook: {present/absent}
|
|
212
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Step 0-C. Existing Harness Detection + Integration Proposal
|
|
216
|
+
|
|
217
|
+
> **Safe**: This step is analysis/proposal output only. No file writes. Runs safely regardless of `--dry-run` flag.
|
|
218
|
+
|
|
219
|
+
> **Core message**: FH is not something placed on top of an existing harness.
|
|
220
|
+
> It analyzes existing rules to remove duplicates — making things lighter.
|
|
221
|
+
>
|
|
222
|
+
> **Measured expectations** (--dry-run verified values):
|
|
223
|
+
>
|
|
224
|
+
> | Project type | Example | Total volume | Reduction | Main cause |
|
|
225
|
+
> |---|---|---|---|---|
|
|
226
|
+
> | QA strategy platform (domain-specialized complete) | Project A | 324 lines | **14%** (46 lines) | Duplicate meta operation rules |
|
|
227
|
+
> | Mobile QA automation framework | Project B | 2,448 lines (constant) | **32%** (~790 lines) | 2 unremoved duplicate files post-install |
|
|
228
|
+
>
|
|
229
|
+
> Token savings: Project A ~0.5K/session, Project B ~15~20K/session
|
|
230
|
+
>
|
|
231
|
+
> * QA strategy platform level = CLAUDE.md 200~400 lines, 5~10 rules files. Mobile QA automation level = 7+ rule files, 2,000+ lines of constant context.
|
|
232
|
+
> * Check your own project numbers directly with `/install-wizard --dry-run`. (These numbers are from actual single measurements and may vary by environment.)
|
|
233
|
+
>
|
|
234
|
+
> **How to read**: FH does not touch domain-specific rules (code guides, domain knowledge).
|
|
235
|
+
> Reduction targets are only meta operation rules (PR procedures, commit guides, FH path duplicates, etc.).
|
|
236
|
+
|
|
237
|
+
**Detection condition**: Run integration analysis if any of the following apply.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Detect existing harness scale
|
|
241
|
+
CLAUDE_MD_LINES=$(wc -l < CLAUDE.md 2>/dev/null || echo 0)
|
|
242
|
+
RULES_COUNT=$(ls .claude/rules/*.md 2>/dev/null | wc -l || echo 0)
|
|
243
|
+
|
|
244
|
+
echo "CLAUDE.md: ${CLAUDE_MD_LINES} lines"
|
|
245
|
+
echo ".claude/rules/: ${RULES_COUNT} files"
|
|
246
|
+
|
|
247
|
+
# Existing harness detected: CLAUDE.md > 50 lines OR 3+ rules
|
|
248
|
+
if [ "$CLAUDE_MD_LINES" -gt 50 ] || [ "$RULES_COUNT" -ge 3 ]; then
|
|
249
|
+
echo "STATUS: Existing harness detected → proceeding with integration analysis"
|
|
250
|
+
else
|
|
251
|
+
echo "STATUS: New install → move to Step 1"
|
|
252
|
+
fi
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**When existing harness detected — integration analysis:**
|
|
256
|
+
|
|
257
|
+
Analyze existing CLAUDE.md + rules along 3 axes.
|
|
258
|
+
|
|
259
|
+
| Analysis axis | What to check | FH response |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| **Duplicate rules** | Patterns already covered by FH standard skills (context-doctor, harness-doctor, verify-bidirectional, etc.) | Classify as removable items |
|
|
262
|
+
| **Project-specific** | Rules valid only for this project/domain | Keep (FH does not touch these) |
|
|
263
|
+
| **FH-delegatable** | Manually written recurring patterns (commit format, review checklists, audit schedule, etc.) | Classify as delegatable to FH skills |
|
|
264
|
+
|
|
265
|
+
**Integration analysis output format:**
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
269
|
+
Existing Harness Integration Analysis
|
|
270
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
271
|
+
CLAUDE.md current: {X} lines
|
|
272
|
+
.claude/rules/: {N} files
|
|
273
|
+
|
|
274
|
+
Duplicates (FH-covered): {A} items → can be removed
|
|
275
|
+
FH-delegatable: {B} items → replaceable with skills
|
|
276
|
+
Project-specific: {C} items → keep
|
|
277
|
+
|
|
278
|
+
Expected after integration: CLAUDE.md {X} → {Y} lines ({Z}% reduction)
|
|
279
|
+
Token savings estimate: ~{W}K tokens/session saved
|
|
280
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
281
|
+
|
|
282
|
+
Show integration plan?
|
|
283
|
+
Y — Per-item removal/delegation detailed proposal (applied in subsequent Step 1)
|
|
284
|
+
N — Continue with add-only approach (keep existing rules)
|
|
285
|
+
S — Skip for now, move directly to Step 1. Can reanalyze later with /install-wizard --dry-run
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Respect user judgment**: FH mapping (duplicate removal, skill delegation) is not forced.
|
|
289
|
+
If FH is truly frontier, it will be chosen naturally. The choice is the user's.
|
|
290
|
+
Any of Y/N/S continues to Step 1.
|
|
291
|
+
|
|
292
|
+
**If Y selected**: Add integration plan items to Step 1 gap diagnosis and proceed.
|
|
293
|
+
**If N/S selected**: Keep existing rules as-is and proceed with Step 1 in add-only mode for new FH items.
|
|
294
|
+
|
|
295
|
+
### Step 1. Gap Diagnosis
|
|
296
|
+
|
|
297
|
+
**[Prerequisite] install-doctor Conflict Diagnosis (only in environments without install history)**
|
|
298
|
+
|
|
299
|
+
If `~/.cc_sentinels/{project-name}_wizard_done` doesn't exist (first install), call install-doctor first and map results to the checks below:
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
/install-doctor --plugin fh-meta
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
install-doctor CONFLICT/WARNING items → add ❗ markers to Step 2 proposal list.
|
|
306
|
+
No install-doctor results or clean → proceed directly with Step 1 checks.
|
|
307
|
+
|
|
308
|
+
Auto-check the following items based on detected environment. Each item classified as PASS / MISS / FAIL.
|
|
309
|
+
|
|
310
|
+
> ※ install-doctor result mapping scope:
|
|
311
|
+
> - Items diagnosed by doctor (`FH plugin install` · `zshrc hook` · `.claudeignore`) → map doctor results directly, skip re-diagnosis.
|
|
312
|
+
> - Items not diagnosed by doctor (`weekly_audit` · `sentinel` · `local_fh_context.md` · `deep-insight plugin` etc.) → check directly using table below.
|
|
313
|
+
|
|
314
|
+
| Check item | Criteria | Verification method |
|
|
315
|
+
|---|---|---|
|
|
316
|
+
| `.claudeignore` | Existence | `ls .claudeignore` |
|
|
317
|
+
| `local_fh_context.md` | Existence in `.claude/rules/` | `ls .claude/rules/local_fh_context.md` |
|
|
318
|
+
| `zshrc hook` | Contains `fh_audit_check.zsh` source line | `grep fh_audit_check.zsh ~/.zshrc` |
|
|
319
|
+
| `weekly_audit` latest | Within 7 days | CC_HUB_DIR/tracks/_audit/ mtime |
|
|
320
|
+
| `sentinel` setup | `~/.cc_sentinels/` exists | `ls ~/.cc_sentinels/` |
|
|
321
|
+
| FH plugin install | `installed_plugins.json` has `fh-meta` entry | `python3 -c "import json,os; d=json.load(open(os.path.expanduser('~/.claude/plugins/installed_plugins.json'))); print([k for k in d.get('plugins',{}) if 'fh-meta' in k])"` |
|
|
322
|
+
| `.git/info/exclude` | Personal files excluded | grep local_fh_context .git/info/exclude |
|
|
323
|
+
| MCP plugin | ~/.claude.json mcpServers contains entry | `python3 -c "import json,os; d=json.load(open(os.path.expanduser('~/.claude.json'))); print(list(d.get('mcpServers',{}).keys()))"` |
|
|
324
|
+
| `deep-insight plugin` | settings.json plugins contains deep-insight | `grep -r "deep-insight" .claude/settings.json 2>/dev/null` |
|
|
325
|
+
| `fh_env_context.jsonc` | `.claude/rules/fh_env_context.jsonc` exists | `ls .claude/rules/fh_env_context.jsonc` |
|
|
326
|
+
| `Streamlit pattern applied` | (Streamlit projects only, if the pattern pack is present) data_editor empty df branch/async wrapper/CSS numeric variables | CC `knowledge/shared/streamlit_patterns.md` Pattern 1-5 check (skip if file absent) |
|
|
327
|
+
|
|
328
|
+
**Score calculation**: PASS = 1 point / MISS = 0.5 points / FAIL = 0 points → converted to 100-point scale.
|
|
329
|
+
|
|
330
|
+
### Step 2. Diagnosis Report + Proposal List
|
|
331
|
+
|
|
332
|
+
Output diagnosis results and generate per-item proposals.
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
install-wizard — Diagnosis Results ({score}/100)
|
|
336
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
337
|
+
✅ PASS .claudeignore exists
|
|
338
|
+
⚠️ MISS local_fh_context.md absent
|
|
339
|
+
⚠️ MISS zshrc hook absent
|
|
340
|
+
❌ FAIL weekly_audit 12 days elapsed
|
|
341
|
+
✅ PASS FH plugin installed
|
|
342
|
+
⚠️ MISS MCP plugin absent
|
|
343
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
344
|
+
|
|
345
|
+
📋 Proposal list (per-item approval required before execution):
|
|
346
|
+
|
|
347
|
+
[1] Install local_fh_context.md — FH skill auto-recognition
|
|
348
|
+
[2] Add zshrc hook — periodic audit notification on terminal start
|
|
349
|
+
[3] Run weekly_audit immediately — call /harvest-loop (lightweight mode)
|
|
350
|
+
[4] Initialize ~/.cc_sentinels/ — project audit tracking
|
|
351
|
+
[5] Install fh-meta plugin — activate all FH skills (if FH plugin MISS)
|
|
352
|
+
AI executes automatically via Bash — no manual terminal input needed:
|
|
353
|
+
claude plugin marketplace add https://github.com/chrono-meta/forge-harness.git
|
|
354
|
+
claude plugin install -s user fh-meta@forge-harness
|
|
355
|
+
CC restart required after completion for skills to appear in /skills list
|
|
356
|
+
[6] Add MCP plugin — activate integrations (if MCP plugin MISS)
|
|
357
|
+
Run: claude mcp add <your-mcp-plugin> -- npx -y <your-mcp-plugin>
|
|
358
|
+
CC restart required after completion
|
|
359
|
+
[7] Install deep-insight plugin — activate sim-conductor multi-persona simulation (if deep-insight MISS)
|
|
360
|
+
Settings → Plugins → Add → {deep-insight plugin path}
|
|
361
|
+
Without install, /sim-conductor persona branching disabled (single-point simulation only)
|
|
362
|
+
[8] Create fh_env_context.jsonc — org/network/Git environment context file (if fh_env_context.jsonc MISS)
|
|
363
|
+
Copy: {FH_DIR}/templates/fh_env_context.jsonc → .claude/rules/fh_env_context.jsonc
|
|
364
|
+
Then manually update with actual values for org name, Jira URL, environment status, etc.
|
|
365
|
+
Effect: Each skill references common environment context → eliminate individual setting duplication
|
|
366
|
+
|
|
367
|
+
Each item: Y (approve) / N (skip) / L (later) / A (approve all)
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### cross-install Detection → agent-composer Auto-Update Proposal
|
|
371
|
+
|
|
372
|
+
When external plugins are cross-installed:
|
|
373
|
+
1. Collect trigger keyword list from installed skills
|
|
374
|
+
2. Check if those triggers exist in `agent-composer/SKILL.md` Step 1 mapping table
|
|
375
|
+
3. If missing triggers found → propose agent-composer update to user
|
|
376
|
+
|
|
377
|
+
Output format:
|
|
378
|
+
```
|
|
379
|
+
🔍 cross-install detected: {skill name} ({trigger keywords})
|
|
380
|
+
→ agent-composer mapping gap confirmed
|
|
381
|
+
→ auto-update proposal included in Step 3
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
If no gaps → output "agent-composer mapping up to date" then proceed to next step.
|
|
385
|
+
|
|
386
|
+
> **`--dry-run` branch point**: If `--dry-run` flag is set at this point, output message below and **exit** (skip Steps 3~4):
|
|
387
|
+
> ```
|
|
388
|
+
> install-wizard [dry-run] — Analysis complete ({score}/100)
|
|
389
|
+
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
390
|
+
> MISS/FAIL items: {N} — rerun /install-wizard to execute
|
|
391
|
+
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
392
|
+
> ```
|
|
393
|
+
|
|
394
|
+
### Step 3. User Approval → Per-item Execution
|
|
395
|
+
|
|
396
|
+
After receiving approval input, execute in order. **Output actual action preview before each execution**.
|
|
397
|
+
|
|
398
|
+
Execution example (local_fh_context.md install):
|
|
399
|
+
```
|
|
400
|
+
▶ [1] Install local_fh_context.md
|
|
401
|
+
Copy: {FH_DIR}/templates/local_fh_context.md
|
|
402
|
+
→ .claude/rules/local_fh_context.md
|
|
403
|
+
Exclude: add pattern to .git/info/exclude
|
|
404
|
+
Execute? (Y/N):
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Execution priority:
|
|
408
|
+
1. FAIL items (immediate effect)
|
|
409
|
+
2. MISS items (configuration supplementation)
|
|
410
|
+
3. Optimization items (optional)
|
|
411
|
+
|
|
412
|
+
#### FH Plugin Auto-Install Execution Block
|
|
413
|
+
|
|
414
|
+
When FH plugin is MISS, execute the following via Bash (no manual input required):
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Step A: register marketplace (idempotent — "already on disk" is OK)
|
|
418
|
+
claude plugin marketplace add https://github.com/chrono-meta/forge-harness.git 2>&1
|
|
419
|
+
|
|
420
|
+
# Step B: install plugin
|
|
421
|
+
claude plugin install -s user fh-meta@forge-harness 2>&1
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
**Error handling:**
|
|
425
|
+
|
|
426
|
+
| Output | Meaning | Action |
|
|
427
|
+
|---|---|---|
|
|
428
|
+
| `✔ Marketplace ... already on disk` | Already registered | Continue to Step B |
|
|
429
|
+
| `✔ Successfully installed` | Done | Report success, remind CC restart |
|
|
430
|
+
| `Plugin "fh-meta" not found` | Marketplace cache stale | Run `claude plugin marketplace update forge-harness` then retry Step B |
|
|
431
|
+
| Any other error | Unknown failure | Report error verbatim, ask user to retry manually |
|
|
432
|
+
|
|
433
|
+
**Output format on success:**
|
|
434
|
+
```
|
|
435
|
+
▶ [5] Install fh-meta plugin
|
|
436
|
+
✅ Marketplace: forge-harness registered
|
|
437
|
+
✅ Plugin: fh-meta@forge-harness installed (scope: user)
|
|
438
|
+
⚠️ CC restart needed — skills will appear in /skills after restart
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**agent-composer mapping update** (when skills were added via cross-install):
|
|
442
|
+
|
|
443
|
+
For skills with confirmed agent-composer mapping gaps from Step 2 cross-install detection,
|
|
444
|
+
propose adding rows to `agent-composer/SKILL.md` Step 1 mapping table in this format:
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
| {skill name} related task | {skill name} (S) | — |
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Output preview before execution:
|
|
451
|
+
```
|
|
452
|
+
▶ agent-composer mapping update
|
|
453
|
+
Add to: agent-composer/SKILL.md Step 1 table
|
|
454
|
+
| {skill name} related task | {skill name} (S) | — |
|
|
455
|
+
Execute? (Y/N):
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Step 4. Acceleration Baseline Setup
|
|
459
|
+
|
|
460
|
+
After executing approved items, install automatic maintenance structure:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
# zshrc hook (if not installed — preview then confirm, idempotent)
|
|
464
|
+
if ! grep -q "fh_audit_check.zsh" ~/.zshrc 2>/dev/null; then
|
|
465
|
+
cat >> ~/.zshrc << 'EOF'
|
|
466
|
+
export FH_DIR="{FH_DIR}"
|
|
467
|
+
export CC_HUB_DIR="{CC_HUB_DIR}"
|
|
468
|
+
export CC_SENTINELS_DIR="$HOME/.cc_sentinels"
|
|
469
|
+
source "$FH_DIR/templates/fh_audit_check.zsh"
|
|
470
|
+
EOF
|
|
471
|
+
fi
|
|
472
|
+
|
|
473
|
+
# 4-axis verification gate — install the FH pre-commit hook on the forge-harness clone (idempotent)
|
|
474
|
+
# Git does NOT set core.hooksPath automatically on clone, so this one-time step is required for the gate to enforce (otherwise it stays advisory).
|
|
475
|
+
if [ -d "$FH_DIR/templates/.git-hooks" ]; then
|
|
476
|
+
git -C "$FH_DIR" config core.hooksPath templates/.git-hooks
|
|
477
|
+
chmod +x "$FH_DIR/templates/.git-hooks/pre-commit" 2>/dev/null
|
|
478
|
+
echo "4-axis pre-commit gate: installed (core.hooksPath -> templates/.git-hooks)"
|
|
479
|
+
fi
|
|
480
|
+
|
|
481
|
+
# sentinel initialization (per-project independent — prevent conflicts with other projects on same machine)
|
|
482
|
+
mkdir -p ~/.cc_sentinels
|
|
483
|
+
touch ~/.cc_sentinels/$(basename "$(pwd)")_wizard_done
|
|
484
|
+
|
|
485
|
+
# Weekly audit schedule in CC (CronCreate — valid for this session)
|
|
486
|
+
# → auto-call /harvest-loop (lightweight mode) every Monday at 9:03
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Step 5. Completion Report + Contribution Guidance
|
|
490
|
+
|
|
491
|
+
```
|
|
492
|
+
install-wizard — Complete
|
|
493
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
494
|
+
✅ Executed: {N} ⏭ Skipped: {N} ⏳ Later: {N}
|
|
495
|
+
|
|
496
|
+
From now on:
|
|
497
|
+
· Periodic audit auto-check on terminal start
|
|
498
|
+
· Yellow warning output when weekly_audit exceeds 7 days
|
|
499
|
+
· Auto /harvest-loop (lightweight) at 9am Monday when CC is open
|
|
500
|
+
|
|
501
|
+
Next step skills:
|
|
502
|
+
· Not sure which plugin you need → /plugin-recommender
|
|
503
|
+
· Need complex task automation → /agent-composer
|
|
504
|
+
· Quality audit before publishing external assets → hub-persona-auditor auto-run
|
|
505
|
+
(select "external user entry point audit" task type when composing in agent-composer)
|
|
506
|
+
|
|
507
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
508
|
+
💡 If this setup helped, consider contributing to FH.
|
|
509
|
+
Pattern discovered → return with /field-harvest
|
|
510
|
+
New skill proposal → PR:
|
|
511
|
+
https://github.com/chrono-meta/forge-harness
|
|
512
|
+
|
|
513
|
+
🔬 Developing FH itself? Set up a private companion store:
|
|
514
|
+
gh repo create {org}/{hub}-be --private # paper drafts, experiment logs, handoffs
|
|
515
|
+
→ public mirror holds methodology · private store holds research artifacts
|
|
516
|
+
→ field projects (internal harness) can use the same dual-repo pattern
|
|
517
|
+
|
|
518
|
+
🔀 Don't want to lose your accumulated assets — fork as your own hub:
|
|
519
|
+
Personal skills/rules/notes added directly to FH may be lost on FH updates.
|
|
520
|
+
git clone <FH_URL> ~/my-forge # name is up to you (my-forge, team-forge, etc.)
|
|
521
|
+
→ Build freely in your fork and preserve permanently with git
|
|
522
|
+
→ When you discover valuable patterns, /field-harvest to reverse-contribute to FH anytime
|
|
523
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
## Re-run (Inspection Mode)
|
|
527
|
+
|
|
528
|
+
When run again in an environment that has already passed the wizard, operates in **inspection mode**:
|
|
529
|
+
- Only runs Step 1 gap diagnosis
|
|
530
|
+
- Proposes only newly found MISS/FAIL items
|
|
531
|
+
- No full reinstall
|
|
532
|
+
|
|
533
|
+
```bash
|
|
534
|
+
# Auto-switches to inspection mode when .cc_sentinels/{project-name}_wizard_done exists (per-project independent)
|
|
535
|
+
PROJECT_NAME=$(basename "$(pwd)")
|
|
536
|
+
ls ~/.cc_sentinels/${PROJECT_NAME}_wizard_done 2>/dev/null && echo "Inspection mode"
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
## External User Environment Adaptation
|
|
540
|
+
|
|
541
|
+
| Mode | Environment | Action |
|
|
542
|
+
|---|---|---|
|
|
543
|
+
| **A** (full) | FH clone + CC hub (your-hub etc.) present | Run all Steps 0~5 |
|
|
544
|
+
| **B** (FH standalone) | FH clone + no CC hub | Skip CC_HUB_DIR-related items, focus on FH setup |
|
|
545
|
+
| **C** (plugin only) | CC plugin install only (no FH clone) | Steps 0~2 diagnosis + guide output / no file writes |
|
|
546
|
+
|
|
547
|
+
## Activation Triggers
|
|
548
|
+
|
|
549
|
+
> **CC auto-detection**: Based on description field keywords (list below is for human reference).
|
|
550
|
+
|
|
551
|
+
- `/install-wizard`
|
|
552
|
+
- "first setup", "initial configuration", "onboarding start", "help me set up"
|
|
553
|
+
- "configure project", "onboarding start", "help me set up"
|
|
554
|
+
- "wizard" (when used standalone, confirm FH context before activating)
|
|
555
|
+
|
|
556
|
+
## Three-Doctor Loop Integration
|
|
557
|
+
|
|
558
|
+
| Situation | Integrated skill |
|
|
559
|
+
|---|---|
|
|
560
|
+
| Structural anomaly detected | `/harness-doctor` |
|
|
561
|
+
| Token waste pattern detected | `/context-doctor` |
|
|
562
|
+
| External user simulation needed | `/sim-conductor Area A` |
|
|
563
|
+
| Install conflict suspected | `/install-doctor` |
|
|
564
|
+
|
|
565
|
+
## Per-Cluster Deferred Loading (Progressive Disclosure)
|
|
566
|
+
|
|
567
|
+
Only activate the cluster matching the utterance — loading all skills degrades selection quality.
|
|
568
|
+
|
|
569
|
+
| Cluster | Trigger keywords | Skills |
|
|
570
|
+
|---|---|---|
|
|
571
|
+
| **A — Harvest/Evolution** | harvest · session wrap-up · pattern · reverse absorption · fh evolution | field-harvest · harvest-loop · contention-layer · verify-bidirectional |
|
|
572
|
+
| **B — Diagnosis (doctor)** | diagnose · health · check · inspect · token waste · install conflict · doctor | harness-doctor · context-doctor · sim-conductor · install-doctor · install-wizard |
|
|
573
|
+
| **C — Compose (composer)** | agent composition · parallel · compose prompt · context card | agent-composer · meta-prompt-builder |
|
|
574
|
+
| **D — Audit/Review** | review · audit · PR review · steel quench · adversarial · lint · placement | hub-cc-pr-reviewer · steel-quench · apex-review · harness-doctor (--lint) · marketplace-gate · asset-placement-gate |
|
|
575
|
+
| **E — Explore/Frontier** | trends · plugin recommendation · synergy · frontier | frontier-digest · plugin-recommender · cross-ecosystem-synergy-detection |
|
|
576
|
+
| **F — Common (always-on)** | — | convergence-loop · deliberation (fh-commons) |
|
|
577
|
+
|
|
578
|
+
Rules: single match → that cluster only · multi-match → all matched · unclear → default B + delegate to agent-composer.
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
## Failure Response
|
|
583
|
+
|
|
584
|
+
On Claude API / MCP failure → refer to [`references/fallback-guide.md`](../../references/fallback-guide.md) manual checklist.
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
588
|
+
## Done When
|
|
589
|
+
|
|
590
|
+
```
|
|
591
|
+
☐ Environment detection complete: shell, CC version, OS, project type identified
|
|
592
|
+
☐ Gap diagnosis output: present vs missing items listed
|
|
593
|
+
☐ User approval/decline recorded for each suggested item
|
|
594
|
+
☐ All approved items installed with no failure state
|
|
595
|
+
(failed installs surfaced to user — not silently skipped)
|
|
596
|
+
☐ Acceleration baseline confirmed: zshrc alias + sentinels active (or user declined)
|
|
597
|
+
☐ Summary output: "N items installed, M items skipped — setup complete"
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
`--dry-run` mode Done When: gap diagnosis report written, no installation executed.
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## Hub Orchestration Hint
|
|
605
|
+
|
|
606
|
+
After setup, **where you work** significantly affects efficiency:
|
|
607
|
+
|
|
608
|
+
| Work type | Recommended location |
|
|
609
|
+
|---|---|
|
|
610
|
+
| Single project coding/debugging | That project's cwd |
|
|
611
|
+
| Meta/audit/simulation / 2+ projects simultaneously | Meta-harness cwd → Agent parallel dispatch |
|
|
612
|
+
|
|
613
|
+
Dispatching multiple tasks simultaneously using the `Agent` tool from the meta-harness cwd enables 5-6x acceleration vs sequential. However, this isn't forced — focused work on a single project is best done at each project's own cwd.
|