@chrono-meta/fh-gate 1.1.0 → 1.2.1

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 (68) hide show
  1. package/.claude/agents/challenger.md +169 -0
  2. package/AGENTS.md +160 -0
  3. package/CATALOG.md +256 -0
  4. package/CHEATSHEET.md +367 -0
  5. package/CLAUDE.md +331 -0
  6. package/CONTRIBUTING.md +198 -0
  7. package/LICENSE +21 -0
  8. package/README.md +61 -8
  9. package/bin/fh-goal.js +9 -0
  10. package/bin/fh-run.js +9 -0
  11. package/docs/codex-compat.md +123 -0
  12. package/docs/pillars.svg +70 -0
  13. package/knowledge/shared/harness-core/fh_integration_contract.md +45 -28
  14. package/package.json +30 -6
  15. package/plugins/fh-commons/README.md +37 -0
  16. package/plugins/fh-commons/agents/quench-challenger.md +373 -0
  17. package/plugins/fh-commons/skills/convergence-loop/SKILL.md +155 -0
  18. package/plugins/fh-commons/skills/deliberation/SKILL.md +288 -0
  19. package/plugins/fh-commons/skills/mcp-circuit-breaker/SKILL.md +196 -0
  20. package/plugins/fh-commons/skills/token-budget-gate/SKILL.md +175 -0
  21. package/plugins/fh-meta/agents/fact-checker.md +121 -0
  22. package/plugins/fh-meta/agents/hub-persona-auditor.md +109 -0
  23. package/plugins/fh-meta/agents/persona-innovator.md +195 -0
  24. package/plugins/fh-meta/skills/agent-composer/SKILL.md +461 -0
  25. package/plugins/fh-meta/skills/agent-composer/SKILL_detail.md +464 -0
  26. package/plugins/fh-meta/skills/apex-review/SKILL.md +185 -0
  27. package/plugins/fh-meta/skills/asset-placement-gate/SKILL.md +135 -0
  28. package/plugins/fh-meta/skills/contention-layer/SKILL.md +127 -0
  29. package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL.md +30 -0
  30. package/plugins/fh-meta/skills/context-bridge-dispatch/SKILL_detail.md +144 -0
  31. package/plugins/fh-meta/skills/context-doctor/SKILL.md +341 -0
  32. package/plugins/fh-meta/skills/cross-ecosystem-synergy-detection/SKILL.md +202 -0
  33. package/plugins/fh-meta/skills/deep-clarify/SKILL.md +144 -0
  34. package/plugins/fh-meta/skills/edit-manifest/SKILL.md +210 -0
  35. package/plugins/fh-meta/skills/field-harvest/SKILL.md +384 -0
  36. package/plugins/fh-meta/skills/frontier-digest/SKILL.md +272 -0
  37. package/plugins/fh-meta/skills/goal-quench/SKILL.md +509 -0
  38. package/plugins/fh-meta/skills/harness-doctor/SKILL.md +277 -0
  39. package/plugins/fh-meta/skills/harness-doctor/SKILL_detail.md +484 -0
  40. package/plugins/fh-meta/skills/harvest-loop/SKILL.md +231 -0
  41. package/plugins/fh-meta/skills/harvest-loop/SKILL_detail.md +201 -0
  42. package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL.md +129 -0
  43. package/plugins/fh-meta/skills/hub-cc-pr-reviewer/SKILL_detail.md +158 -0
  44. package/plugins/fh-meta/skills/install-doctor/SKILL.md +207 -0
  45. package/plugins/fh-meta/skills/install-wizard/SKILL.md +613 -0
  46. package/plugins/fh-meta/skills/marketplace-gate/SKILL.md +193 -0
  47. package/plugins/fh-meta/skills/memory-hygiene/SKILL.md +143 -0
  48. package/plugins/fh-meta/skills/meta-prompt-builder/SKILL.md +167 -0
  49. package/plugins/fh-meta/skills/meta-prompt-builder/SKILL_detail.md +37 -0
  50. package/plugins/fh-meta/skills/pipeline-conductor/SKILL.md +430 -0
  51. package/plugins/fh-meta/skills/plugin-recommender/SKILL.md +221 -0
  52. package/plugins/fh-meta/skills/plugin-recommender/SKILL_detail.md +220 -0
  53. package/plugins/fh-meta/skills/prompt-regression/SKILL.md +178 -0
  54. package/plugins/fh-meta/skills/public-surface-audit/SKILL.md +224 -0
  55. package/plugins/fh-meta/skills/return-path-gate/SKILL.md +257 -0
  56. package/plugins/fh-meta/skills/self-marketing-lint/SKILL.md +129 -0
  57. package/plugins/fh-meta/skills/sim-conductor/SKILL.md +364 -0
  58. package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +337 -0
  59. package/plugins/fh-meta/skills/skill-splitter/SKILL.md +126 -0
  60. package/plugins/fh-meta/skills/skill-splitter/SKILL_detail.md +185 -0
  61. package/plugins/fh-meta/skills/source-grounding-audit/SKILL.md +230 -0
  62. package/plugins/fh-meta/skills/source-grounding-audit/SKILL_detail.md +182 -0
  63. package/plugins/fh-meta/skills/steel-quench/SKILL.md +226 -0
  64. package/plugins/fh-meta/skills/steel-quench/SKILL_detail.md +453 -0
  65. package/plugins/fh-meta/skills/verify-bidirectional/SKILL.md +238 -0
  66. package/scripts/fh-gate.sh +175 -40
  67. package/scripts/fh-goal.sh +182 -0
  68. package/scripts/fh-run.sh +269 -0
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: marketplace-gate
3
+ description: Evaluates whether a repository meets marketplace listing criteria via a 5-point check and outputs a listing suitability verdict. Checks README completeness, zero-config readiness, maintenance signals, duplication, and public safety.
4
+ user-invocable: true
5
+ allowed-tools: ["Read", "Bash", "Grep", "Glob"]
6
+ model: sonnet
7
+ category: Composability Gate
8
+ ---
9
+
10
+ # marketplace-gate — Marketplace Listing Suitability Gate
11
+
12
+ Evaluates a repository against 5 listing criteria — README completeness, zero-config readiness, maintenance signals, duplication, and public safety — and outputs a listing suitability verdict.
13
+
14
+ > While `asset-placement-gate` answers "is this asset suitable for FH?",
15
+ > `marketplace-gate` answers "is this repo ready to be listed in a marketplace?"
16
+
17
+ ## Triggers
18
+
19
+ - `/marketplace-gate`
20
+ - `/marketplace-gate --target <repo path>`
21
+ - "Can I list this in the marketplace?", "Pre-listing repo check", "Verify before publishing", "Is this ready for marketplace listing?"
22
+ - "Can other teams use this repo?", "Is there a checklist before external distribution?", "Check if this is ready to be public"
23
+ - "Review for open-source release", "Verify before sharing outside the team"
24
+
25
+ ---
26
+
27
+ ## Step 0. Confirm Target Path
28
+
29
+ Use the path specified by `--target <path>` if provided. Otherwise use current cwd.
30
+
31
+ ```bash
32
+ REPO_PATH="${ARGUMENTS#--target }"
33
+ REPO_PATH="${REPO_PATH:-$(pwd)}"
34
+ echo "Target: $REPO_PATH"
35
+ ls "$REPO_PATH" 2>/dev/null | head -20 || echo "Path not found — please verify the path"
36
+ ```
37
+
38
+ Stop immediately if path is not found.
39
+
40
+ ---
41
+
42
+ ## Step 1. 5-Point Check
43
+
44
+ ### Check 1 — README Completeness
45
+
46
+ ```bash
47
+ README=$(ls "$REPO_PATH"/README* 2>/dev/null | head -1)
48
+ [ -z "$README" ] && echo "FAIL: No README found" && exit
49
+ # Installation command exists
50
+ grep -i "install\|clone\|setup" "$README" | head -3
51
+ # Code block (usage example) exists
52
+ grep -c '```' "$README" 2>/dev/null
53
+ ```
54
+
55
+ | Criterion | Check |
56
+ |---|---|
57
+ | README file exists | ls |
58
+ | Purpose in 1 sentence (first 50 lines) | presence check |
59
+ | Installation path documented | install·clone·setup keywords |
60
+ | At least 1 usage example | code block presence |
61
+ | Version notation | version·v[0-9] pattern |
62
+
63
+ Result: **PASS** (5/5) / **PARTIAL** (3-4/5) / **FAIL** (≤2/5)
64
+
65
+ ### Check 2 — Immediate Usability (zero-config)
66
+
67
+ ```bash
68
+ # plugin manifest exists
69
+ ls "$REPO_PATH"/.claude-plugin/plugin.json "$REPO_PATH"/package.json 2>/dev/null
70
+ # single-line install command (from README)
71
+ grep -i "claude plugin install\|npm install\|pip install\|brew install" "$README" 2>/dev/null | head -3
72
+ # prerequisites documented
73
+ grep -i "prerequisite\|requirement\|env\|api.key" "$README" -A 2 | head -6
74
+ ```
75
+
76
+ | Criterion | Check |
77
+ |---|---|
78
+ | Single-line install command in README | grep |
79
+ | Prerequisites documented (API key, env var, etc.) | grep |
80
+ | Plugin manifest exists | ls |
81
+
82
+ Result: **PASS** / **PARTIAL** / **FAIL**
83
+
84
+ ### Check 3 — Maintenance Signals
85
+
86
+ ```bash
87
+ cd "$REPO_PATH" 2>/dev/null || cd "$(pwd)"
88
+ git log -1 --format="Last commit: %ar (%ad)" --date=short 2>/dev/null
89
+ ls CHANGELOG* 2>/dev/null && echo "CHANGELOG found" || echo "No CHANGELOG"
90
+ git tag -l 2>/dev/null | tail -5
91
+ ```
92
+
93
+ | Criterion | Check |
94
+ |---|---|
95
+ | Last commit within 60 days | git log |
96
+ | CHANGELOG or version bump history | ls |
97
+ | git tags exist (version management) | git tag |
98
+
99
+ Result: **ACTIVE** / **STALE** (60–180 days) / **ABANDONED** (180+ days)
100
+
101
+ ### Check 4 — Duplication / Conflict Detection
102
+
103
+ ```bash
104
+ # list skills in current repo (directory-based)
105
+ find "$REPO_PATH" -name "SKILL.md" 2>/dev/null | xargs -I{} dirname {} | xargs -I{} basename {}
106
+ # compare with existing FH skills (if FH_DIR is set)
107
+ [ -n "$FH_DIR" ] && ls "$FH_DIR/plugins/fh-meta/skills/" 2>/dev/null
108
+ # cross-check registered skills in plugin.json (SoT)
109
+ [ -n "$FH_DIR" ] && python3 -c "
110
+ import json, sys
111
+ with open('$FH_DIR/plugins/fh-meta/.claude-plugin/plugin.json') as f:
112
+ d = json.load(f)
113
+ skills = [s['name'] for s in d.get('skills', [])]
114
+ print('plugin.json registered skills (' + str(len(skills)) + '):', ', '.join(skills))
115
+ " 2>/dev/null || echo "plugin.json parse failed (FH_DIR not set or path error)"
116
+ ```
117
+
118
+ **Duplication verdict**: If directory-based list and plugin.json list don't match → **STALE** warning.
119
+
120
+ | Criterion | Check |
121
+ |---|---|
122
+ | No name conflict with existing FH skills | name comparison |
123
+ | No functional duplication | description keyword comparison |
124
+ | plugin.json list matches directory list | cross-check (SoT consistency) |
125
+
126
+ Result: **CLEAN** / **OVERLAP** (N candidates) / **CONFLICT** (direct conflict)
127
+
128
+ ### Check 5 — Public Safety
129
+
130
+ ```bash
131
+ # detect hardcoded internal domains
132
+ grep -r "<your-ghe-url>\|internal-domain\|sandbox\|internal-api" \
133
+ "$REPO_PATH" --include="*.md" --include="*.json" --include="*.yaml" -l 2>/dev/null | head -10
134
+ # sensitive information exposure
135
+ grep -r "API_KEY\s*=\|SECRET\s*=\|PASSWORD\s*=" \
136
+ "$REPO_PATH" --include="*.md" --include="*.json" -l 2>/dev/null | head -5
137
+ # license
138
+ ls "$REPO_PATH"/LICENSE* 2>/dev/null && echo "LICENSE found" || echo "No LICENSE"
139
+ ```
140
+
141
+ | Criterion | Check |
142
+ |---|---|
143
+ | No hardcoded internal domains (or clearly marked as internal-only) | grep |
144
+ | No sensitive information exposed | grep |
145
+ | LICENSE file exists | ls |
146
+
147
+ Result: **SAFE** / **WARNING** (N items to review) / **BLOCKED** (sensitive info exposed)
148
+
149
+ ---
150
+
151
+ ## Step 2. Verdict Output
152
+
153
+ ```
154
+ marketplace-gate — Listing Suitability Verdict
155
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
156
+ Target: {REPO_PATH}
157
+
158
+ Check 1 README completeness : ✅ PASS / ⚠️ PARTIAL / ❌ FAIL
159
+ Check 2 zero-config : ✅ PASS / ⚠️ PARTIAL / ❌ FAIL
160
+ Check 3 Maintenance signals : ✅ ACTIVE / ⚠️ STALE / ❌ ABANDONED
161
+ Check 4 Duplication detection: ✅ CLEAN / ⚠️ OVERLAP({N}) / ❌ CONFLICT
162
+ Check 5 Public safety : ✅ SAFE / ⚠️ WARNING({N}) / ❌ BLOCKED
163
+
164
+ Overall verdict:
165
+ 🟢 Recommended for listing — 0 FAIL + 0 BLOCKED
166
+ 🟡 Conditional listing — ≤1 FAIL + 0 BLOCKED
167
+ 🔴 Listing on hold — 2+ FAIL or 1+ BLOCKED
168
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Follow-up Connections
174
+
175
+ | Situation | Next skill |
176
+ |---|---|
177
+ | Check 1 FAIL — README needs improvement | `hub-persona-auditor` — external reader perspective audit |
178
+ | Check 4 OVERLAP — confirm duplication | `cross-ecosystem-synergy-detection` — explore synergy potential |
179
+ | Check 5 WARNING — internal assets need cleanup | `harness-doctor` — internal structure consistency diagnosis |
180
+ | After 🟢 verdict — install test | `install-doctor` — pre-install conflict verification |
181
+
182
+ ## Done When
183
+
184
+ ```
185
+ All steps 0–2 completed
186
+ + Full 5-point check results output (Check 1–5 individual verdicts)
187
+ + Overall verdict output (🟢 Recommended / 🟡 Conditional / 🔴 On hold)
188
+ ```
189
+
190
+ **→ Mandatory before 🟢 Recommended verdict: `source-grounding-audit`** — forward axis check on all citations, external URLs, and file path references in the asset being reviewed. A 🟢 verdict without source-grounding-audit is incomplete. If source-grounding-audit finds phantom refs → verdict downgrades to 🟡 Conditional automatically.
191
+
192
+ > When `agent-composer` receives a "comprehensive marketplace listing audit" request,
193
+ > recommend: Wave 0 `fact-checker` → Wave 1 `marketplace-gate` + `hub-persona-auditor` in parallel.
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: memory-hygiene
3
+ description: Detects "stale-but-confident" memory entries — facts that were once verified but have silently drifted. Scans memory/*.md for entries past their staleness threshold and proposes re-verification or archival. Runs automatically as part of harvest-loop Step 0-c and on explicit invocation.
4
+ user-invocable: true
5
+ allowed-tools: ["Read", "Grep", "Glob", "Edit", "Bash"]
6
+ model: sonnet
7
+ ---
8
+
9
+ # memory-hygiene — Stale Memory Detection and Re-Verification
10
+
11
+ > Addresses the "stale-but-confident" failure mode: verified information that silently drifts
12
+ > while remaining highly ranked in retrieval — identified as a critical harness failure mode
13
+ > in *Scaling the Harness in Agentic AI* (arXiv:2605.26112).
14
+
15
+ FH is an online-first harness. Its memory entries point to live external resources (GitHub
16
+ repos, arXiv records, Zenodo DOIs, monitoring routines). These drift faster than in
17
+ offline systems — which makes hygiene both more necessary and more tractable (live
18
+ re-verification is possible).
19
+
20
+ ## Trigger Conditions
21
+
22
+ ### Natural Language Triggers
23
+
24
+ | Phrase | Intent |
25
+ |---|---|
26
+ | "memory check", "check stale memories" | Manual hygiene scan |
27
+ | "are my memories still accurate?" | Full re-verification pass |
28
+ | "clean up memory", "memory audit" | Propose archival candidates |
29
+ | "something in memory might be wrong" | Targeted re-check |
30
+
31
+ ### Automatic Trigger
32
+
33
+ - **harvest-loop Step 0-c**: Runs automatically as the first step of every full harvest-loop
34
+ - **Cadence guard**: Skip if memory-hygiene ran within the last 7 days
35
+ (`tracks/_meta/memory_hygiene_*.md` mtime check)
36
+
37
+ ## Staleness Classification
38
+
39
+ | Type | Staleness Threshold | Re-verification Method |
40
+ |---|---|---|
41
+ | `project` — status/milestone entries | **14 days** | Re-read source file or live resource |
42
+ | `reference` — external URLs, DOIs, GitHub repos | **30 days** | WebFetch or gh CLI check |
43
+ | `feedback` — operating rules | **90 days** | Grep for contradicting evidence in recent sessions |
44
+ | `user` — user profile entries | **180 days** | Flag only, no auto-verification |
45
+
46
+ ## Execution Steps
47
+
48
+ ### Step 1 — Scan memory/*.md
49
+
50
+ ```bash
51
+ ls ~/.claude/projects/*/memory/*.md 2>/dev/null
52
+ # or hub-local:
53
+ ls memory/*.md 2>/dev/null
54
+ ```
55
+
56
+ For each file, extract:
57
+ - `metadata.type` from frontmatter
58
+ - `date:` or any date-like field in frontmatter or body
59
+ - Key factual claims (GitHub URLs, status strings, version numbers, dates)
60
+
61
+ ### Step 2 — Classify by Staleness
62
+
63
+ Apply thresholds from the table above. Output a staleness roster:
64
+
65
+ ```
66
+ STALE (>threshold):
67
+ - api-migration-notes.md [feedback, 45d] — procedure may have changed
68
+ - release-status.md [project, 16d] — status fields need live check
69
+ - upstream-tracker.md [reference, 32d] — GitHub URL check needed
70
+
71
+ FRESH (<threshold):
72
+ - user_role.md [user, 3d] — skip
73
+ - fh-closed-loop-principle.md [feedback, 7d] — skip
74
+ ```
75
+
76
+ ### Step 3 — Re-verify Stale Entries
77
+
78
+ For each stale entry, run the appropriate re-verification:
79
+
80
+ **Reference type** (URLs, DOIs, GitHub):
81
+ - Use `gh api` for GitHub resources
82
+ - Use `WebFetch` for DOIs and arXiv records
83
+ - Mark `verified_at: YYYY-MM-DD` in frontmatter if still valid
84
+ - Flag `⚠ DRIFTED` if content has changed materially
85
+
86
+ **Project type** (status, milestones):
87
+ - Cross-check against `reference_next_session_starter.md` and recent git log
88
+ - Update or flag
89
+
90
+ **Feedback type** (rules):
91
+ - Grep `tracks/*/` for evidence contradicting the rule in last 30 days
92
+ - If 2+ contradictions found → flag for human review (do not auto-modify)
93
+
94
+ ### Step 4 — Propose Actions (User Gate)
95
+
96
+ Present findings in this format:
97
+
98
+ ```
99
+ memory-hygiene scan complete: N entries checked
100
+ VERIFIED (no change needed): N
101
+ UPDATED (refreshed verified_at): N
102
+ ⚠ DRIFTED (content changed — needs human review): N
103
+ 📦 ARCHIVE CANDIDATE (no activity in Xd, superseded): N
104
+
105
+ Proposed changes:
106
+ 1. arxiv-submission-status.md — update status fields [auto-apply?]
107
+ 2. harness-federation-sync-plan.md — CLOSED flag still accurate? [confirm]
108
+ ...
109
+
110
+ Apply updates? [y / N per item]
111
+ ```
112
+
113
+ ### Step 5 — Record Run
114
+
115
+ ```bash
116
+ # Create hygiene log
117
+ echo "---\ndate: $(date +%Y-%m-%d)\nentries_checked: N\nupdated: N\ndrifted: N\n---" \
118
+ > tracks/_meta/memory_hygiene_$(date +%Y-%m-%d).md
119
+ ```
120
+
121
+ ## Constraints
122
+
123
+ - **No auto-deletion**: Archive candidates are proposed, not deleted. Human confirmation required.
124
+ - **Feedback type**: Never auto-modify feedback rules — flag only.
125
+ - **Simplification guard**: If 0 stale entries found, output one line "memory-hygiene: all fresh" and exit.
126
+ - **FH online advantage**: Unlike offline harnesses, FH can re-verify external references live.
127
+ Use this — don't skip external checks.
128
+
129
+ ## Done When
130
+
131
+ ```
132
+ Step 1~5 complete
133
+ + Staleness roster output
134
+ + Re-verification run for all STALE entries
135
+ + User gate presented and responded to (y/N per item)
136
+ + Hygiene log written to tracks/_meta/memory_hygiene_{date}.md
137
+ ```
138
+
139
+ ## References
140
+
141
+ - Theoretical basis: *Scaling the Harness in Agentic AI* (arXiv:2605.26112) §Memory Problems — "stale-but-confident" failure mode
142
+ - Integrates with: `harvest-loop` Step 0-c · `context-doctor` (context layer hygiene)
143
+ - Memory format: `~/.claude/projects/*/memory/MEMORY.md`
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: meta-prompt-builder
3
+ description: Generates structured prompts to send to each agent in an agent dispatch plan. Triggered by "write the instructions", "what do I say to the agent?", "write the prompt for me", "meta-prompt-builder". Bridges agent-composer (which agents) and prompt content (what to say). Uses Goal/Context/Constraints/Done When structure.
4
+ user-invocable: true
5
+ allowed-tools: ["Read", "Bash", "Glob", "Grep"]
6
+ model: opus
7
+ ---
8
+
9
+ # meta-prompt-builder — Prompt Delegation Skill
10
+
11
+ When agent-composer decides "what to orchestrate", meta-prompt-builder designs "what to say to each agent."
12
+ Delegates prompt writing itself to AI — interprets Goal / Context / Constraints / Done When structure within the FH context.
13
+
14
+ ## Primary Users
15
+
16
+ **agent-composer proficients** — People who already have an orchestration plan and want to structure the specific instructions for each agent. Use this when you already know "which agents to use."
17
+
18
+ Beginners (unsure which agents to use) → start with agent-composer first. meta-prompt-builder is a post-orchestration step.
19
+
20
+ ## Triggers
21
+
22
+ - `/meta-prompt-builder`
23
+ - Automatically suggested immediately after agent-composer outputs an orchestration plan when user says "how do I instruct each one specifically?"
24
+ - "Write the prompts per Wave", "What should I say to each agent?", "Design the instructions"
25
+ - "I don't know what to tell the agents"
26
+ - "Tell me how to instruct this task so it's handled well"
27
+ - "Write the prompt for me"
28
+ - "Tell me how to request this from Claude"
29
+ - "How should I write the instructions?"
30
+
31
+ ---
32
+
33
+ ## Step 0. Receive Task
34
+
35
+ Input: natural language task description + (optional) agent-composer orchestration plan
36
+
37
+ If no input is provided, ask for 4 fields:
38
+ ```
39
+ What task are you designing a prompt for?
40
+ - Goal: What are you trying to achieve?
41
+ - Context: What project, files, or harness state is involved?
42
+ - Constraints: What should be avoided? Are there budget or time limits?
43
+ - Done When: When can you say "it's done"?
44
+ ```
45
+
46
+ ### Natural Language Goal → Auto-suggest Recommended Chain
47
+
48
+ When Goal is provided in natural language (e.g., "I need to report to the team lead"), suggest a recommended chain using the keyword mapping below.
49
+
50
+ | Goal keyword | Recommended chain | Reason |
51
+ |---|---|---|
52
+ | "report", "team lead", "executive", "CTO", "persuade", "review" | apex-review → (sim-conductor if needed) | Decision-maker simulation then quality validation |
53
+ | "analyze", "diagnose", "something seems off" | harness-doctor → context-doctor | Structural + contextual diagnosis simultaneously |
54
+ | "simulate", "validate", "meta" | sim-conductor (D-code or Area B) | Multi-perspective validation |
55
+ | "install", "setup", "onboarding" | plugin-recommender → install-wizard | Recommend then install |
56
+ | "review", "code check" | sim-conductor D-code → hub-cc-pr-reviewer | Code review chain |
57
+
58
+ Output format:
59
+ ```
60
+ Recommended chain: {Goal keyword} →
61
+ Wave 1: {Agent A} — {1-line reason}
62
+ Wave 2: {Agent B} — {1-line reason}
63
+ → Proceed with this chain? (Y: immediately orchestrate with agent-composer / N: enter 4-field directly)
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Step 1. Reinterpret as FH 4-field
69
+
70
+ Structure the input task according to FH context.
71
+
72
+ | Field | FH interpretation |
73
+ |---|---|
74
+ | Goal | The harness state change this agent combination must achieve |
75
+ | Context | Harness version + latest sim result M/S tier + target file paths |
76
+ | Constraints | Simplification guard + no self-recursion + no inter-Wave file conflicts |
77
+ | Done When | M-tier 0 items OR specified agent fan-in complete OR N naming candidates produced |
78
+
79
+ ---
80
+
81
+ ## Step 2. Generate Per-Agent Prompt Drafts
82
+
83
+ Receive agent-composer orchestration plan as input and generate instructions to deliver to each agent per Wave.
84
+
85
+ Format:
86
+ ```
87
+ Wave {N}-{ID}: [{agent name}]
88
+ Goal: {1 line}
89
+ Context: {harness state in 3 lines max}
90
+ Constraints: {prohibited items in 2 lines max}
91
+ Done When: {evaluation criterion in 1 line}
92
+ ───────────────────────────────
93
+ Actual instruction:
94
+ "{Natural language instruction for the agent — 2–4 sentences}"
95
+ ```
96
+
97
+ When called standalone without an agent-composer plan: collect 4-field directly via Step 0 questions, then generate a single-agent prompt.
98
+
99
+ ---
100
+
101
+ ## Step 3. Quality Self-Validation
102
+
103
+ Before outputting the generated prompt draft, check against 3 criteria.
104
+
105
+ 1. **Goal achievability**: Is the Goal achievable within the agent's allowed-tools range?
106
+ 2. **Done When measurability**: Is Done When a measurable event in the M/S/R framework?
107
+ 3. **Context alignment**: Does the Context match the "target" scope defined in the agent's SKILL.md?
108
+
109
+ Items that fail the check are marked `[WARN]` and the decision is delegated to the user.
110
+
111
+ **Step 3 bias prevention**: When checking Goal achievability, Read the agent's SKILL.md to directly verify (directly compare allowed-tools list). Since generator and validator are the same LLM, self-validation without external reference repeats bias.
112
+
113
+ **Done When completeness check**: Even if Done When is measurable in the M/S/R framework, the following 3 must also be stated to pass without WARN:
114
+ 1. Measurement subject (which agent's output is the basis)
115
+ 2. Measurement timing (absolute basis for this run vs relative to previous run)
116
+ 3. Version / baseline (harness-doctor version, sim-conductor Area, etc.)
117
+
118
+ ### Done When Ambiguity Patterns — Automatic WARN Triggers
119
+
120
+ If Done When contains any of the following patterns, automatically emit `[WARN: Done When not measurable]`.
121
+
122
+ | Ambiguity type | Example expression | WARN reason |
123
+ |---|---|---|
124
+ | **Subjective completion** | "if it goes well", "if it's done properly", "if it feels right" | No binary judgment criterion |
125
+ | **Speed without numbers** | "quickly done", "finished soon" | No count/time criterion |
126
+ | **Absence description** | "if there are no issues", "if there are no errors" | Cannot count as M/S/R |
127
+ | **Unconditioned completion** | "when it's all done", "when finished" | What state counts as complete is undefined |
128
+
129
+ Acceptable form examples:
130
+ - "M-tier 0 items" ✅
131
+ - "harness-doctor fan-in complete + S-tier 3 or fewer" ✅
132
+ - "Scenario 1 PASS verdict received" ✅
133
+
134
+ ---
135
+
136
+ ## Integration with Existing FH Assets
137
+
138
+ | Asset | Integration direction |
139
+ |---|---|
140
+ | **agent-composer** | Input source: orchestration plan → meta-prompt-builder elaborates Wave-by-Wave prompts |
141
+ | **sim-conductor** | Output validation: generated prompts can be quality-validated via D-code mode |
142
+ | **fact-checker** | Wave 0 gating: check if generated prompts overlap or conflict with existing assets |
143
+ | **field-harvest** | Context field input source: field patterns can be reflected in Constraints |
144
+ | **harness-doctor** | Done When cross-validation: verify alignment with harness-doctor checklist |
145
+
146
+ ---
147
+
148
+ ## Meta-Simulation Validation Criteria (required after onboarding)
149
+
150
+ > **Detail**: See `SKILL_detail.md §Meta-Simulation Validation Criteria` — 3-axis functional/performance measurement (goal achievement / context alignment / constraint validity) + 3 validation scenarios + marketplace-gate onboarding gate — read after onboarding when validating the skill itself, not per-invocation.
151
+
152
+ ---
153
+
154
+ ## Done When
155
+
156
+ ```
157
+ All steps 0–3 completed
158
+ + Per-agent prompt drafts output per Wave (Goal/Context/Constraints/Done When 4-field included)
159
+ + Step 3 quality self-validation complete ([WARN] items delegated to user if present)
160
+ + Generated prompts awaiting user review
161
+ ```
162
+
163
+ ## Simplification Guard
164
+
165
+ - meta-prompt-builder does not execute agents directly. Prompt design only.
166
+ - Requests without Done When must be confirmed before proceeding.
167
+ - Generated prompts are always reviewed by the user before execution.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: meta-prompt-builder-detail
3
+ description: On-demand detail for meta-prompt-builder. Holds the onboarding-time Meta-Simulation Validation Criteria (3-axis measurement + validation scenarios + marketplace-gate). Not needed per-invocation; read after onboarding when validating the skill itself.
4
+ load: on-demand
5
+ ---
6
+
7
+ # meta-prompt-builder — Detail (on-demand)
8
+
9
+ ## §Meta-Simulation Validation Criteria
10
+
11
+ **(required after onboarding)**
12
+
13
+ Not persona simulation — **functional and performance measurement** along 3 axes:
14
+
15
+ **Axis 1. Goal achievement rate (functional accuracy)**
16
+ - Inject meta-prompt-builder-generated prompts into actual agents
17
+ - Binary judgment on whether Done When criteria are met
18
+ - Measurement: Done When achieved (1/0) × number of Waves
19
+
20
+ **Axis 2. Context alignment (context quality)**
21
+ - Grep cross-validation of whether generated Context field matches actual harness state
22
+ - Measurement: false positives (missing paths, stale version references) / total Context items
23
+
24
+ **Axis 3. Constraint validity (guard effectiveness)**
25
+ - Whether simplification guard violations occur when generated prompts are executed
26
+ - Measurement: violation count (target: 0)
27
+
28
+ **Validation scenarios**:
29
+
30
+ - Scenario 1 (core): Compare meta-prompt-builder usage vs direct phrasing
31
+ - Pass criteria: Achieve same Done When in ≤70% of conversation turns
32
+ - Scenario 2 (edge): Graceful fallback when agent-composer returns "cannot orchestrate"
33
+ - Pass criteria: "No orchestration plan → redirect to direct 4-field input" transition (no error stop)
34
+ - Scenario 3 (stress): WARN emission rate 100% when Done When is ambiguous
35
+ - Pass criteria: WARN 100% across 3+ ambiguous expression tests
36
+
37
+ **Onboarding gate**: marketplace-gate check must pass.