ground-truth

GitHub

基于代码事实生成可信的GTM文档,通过确定性脚本验证引用与声明,确保内容真实可追溯。

data/skills-md/0xhoneyjar/loa-finn/ground-truth/SKILL.md NeverSight/learn-skills.dev

Trigger Scenarios

需要生成产品能力简介或架构概述文档 要求文档内容必须严格基于代码实现并附带真实引用

Install

npx skills add NeverSight/learn-skills.dev --skill ground-truth -g -y
More Options

Non-standard path

npx skills add https://github.com/NeverSight/learn-skills.dev/tree/main/data/skills-md/0xhoneyjar/loa-finn/ground-truth -g -y

Use without installing

npx skills use NeverSight/learn-skills.dev@ground-truth

指定 Agent (Claude Code)

npx skills add NeverSight/learn-skills.dev --skill ground-truth -a claude-code -g -y

安装 repo 全部 skill

npx skills add NeverSight/learn-skills.dev --all -g -y

预览 repo 内 skill

npx skills add NeverSight/learn-skills.dev --list

SKILL.md

Frontmatter
{
    "name": "ground-truth",
    "agent": "general-purpose",
    "context": "fork",
    "enhance": false,
    "description": "Generate factual, code-grounded GTM documents with BridgeBuilder voice and deterministic verification",
    "danger_level": "moderate",
    "allowed-tools": "Read, Grep, Glob, Bash(.claude\/scripts\/ground-truth\/*)"
}

Ground Truth — Factual GTM Document Generation

You are generating factual, code-grounded GTM documents using the BridgeBuilder voice. Every claim must be verifiable. Every citation must be real. The verification layer is entirely deterministic — shell scripts check your work. You cannot hallucinate past the firewall.

"Mechanism over adjective. Evidence over assertion. Teaching over selling."

Pre-flight

Check registries exist

for f in features.yaml limitations.yaml capability-taxonomy.yaml; do
  if [[ ! -f "grimoires/loa/ground-truth/$f" ]]; then
    echo "ERROR: Missing registry: grimoires/loa/ground-truth/$f"
    echo ""
    echo "Run: .claude/scripts/ground-truth/bootstrap-registries.sh"
    echo "Then edit the files and commit before running /ground-truth."
    exit 1
  fi
done
echo "Registries OK"

Parse arguments

Supported flags:

  • --type capability-brief (default)
  • --type architecture-overview
  • --incremental — Only regenerate stale sections (v2.0)
DOC_TYPE="${1:-capability-brief}"
OUTPUT_DIR="grimoires/loa/ground-truth"
INCREMENTAL=false
# Parse --incremental flag from arguments

Stage 1: GROUND — Load codebase reality

Load context in priority order. Tier A is non-negotiable.

Tier A: Hard Constraints (load first, always)

  1. Template for the selected document type:

    • Read: .claude/skills/ground-truth/resources/templates/${DOC_TYPE}.md
    • This defines required sections, provenance expectations, and structure
  2. Provenance specification:

    • Read: .claude/skills/ground-truth/resources/provenance-spec.md
    • This defines the exact tag syntax, citation rules, and evidence anchor format
  3. Quality gate requirements (know what will be checked):

    • Citation verification: every file:line must resolve to a real, tracked file
    • Banned terms: zero tolerance for superlatives
    • Provenance tags: ≥95% coverage, class-specific citation rules enforced
    • Evidence anchors: every CODE-FACTUAL paragraph needs <!-- evidence: ... -->

Tier B: Evidence (load in priority order, within token budget)

  1. Code reality — highest priority evidence:

    • Read: grimoires/loa/reality/index.md (if available from /ride)
    • Or: Run inventory-modules.sh to enumerate modules
    • Read actual source files for specific claims
  2. Registry files:

    • Read: grimoires/loa/ground-truth/features.yaml
    • Read: grimoires/loa/ground-truth/limitations.yaml
    • Read: grimoires/loa/ground-truth/capability-taxonomy.yaml
  3. Grimoire state (if available):

    • Read: grimoires/loa/NOTES.md
    • Read: grimoires/loa/decisions.yaml (if exists)
  4. Voice template:

    • Read: .claude/skills/ground-truth/resources/voice/bridgebuilder-gtm.md
  5. Analogy bank (if available):

    • Read: .claude/skills/ground-truth/resources/analogies/analogy-bank.yaml
    • Each analogy has a confidence field (high/moderate):
      • high: Use directly — "X works like Y" with full structural comparison
      • moderate: Use with qualifier — "in some ways similar to Y" or "loosely parallels Y"
    • Staleness of high-confidence analogies is a more urgent signal than moderate ones

Token budget

Target: 13,500–28,000 tokens for generation context.

  • Tier A: ~3,000 tokens (templates + provenance spec)
  • Tier B reality: ~8,000 tokens (code + registries)
  • Tier B voice: ~1,500 tokens (voice template + analogies)
  • Remaining: generation prompt + output space

If context exceeds budget, truncate Tier B items from lowest priority up.


Stage 2: INVENTORY — Run shell scripts

Run inventory and extraction scripts to gather structured data:

# Module inventory
.claude/scripts/ground-truth/inventory-modules.sh --json

# Limitations extraction
.claude/scripts/ground-truth/extract-limitations.sh --json

Use the Read tool to inspect specific source files for claims you'll make. Do NOT use arbitrary Bash to read files — use the Read tool.


Stage 3: GENERATE — Produce the document

Incremental mode (v2.0)

When --incremental is set, only regenerate sections that are stale:

# Check which sections need regeneration
staleness=$(.claude/scripts/ground-truth/check-staleness.sh "${OUTPUT_DIR}/${DOC_TYPE}.md" --json)
stale_count=$(echo "$staleness" | jq -r '.stale_count')

if [[ "$stale_count" -eq 0 ]]; then
  echo "No stale sections — document is current"
  # Skip to Stage 6 (OUTPUT)
fi

# Get list of stale section headings
stale_headings=$(echo "$staleness" | jq -r '.stale_sections[].heading')

When regenerating incrementally:

  1. Read the existing document
  2. Only rewrite sections whose headings appear in stale_headings
  3. Preserve all non-stale sections byte-for-byte
  4. Run VERIFY on the full document after partial regeneration (not just stale sections)

If --incremental is NOT set, generate the full document as before:

Generate the document following the template structure exactly.

Generation rules

  1. Every CODE-FACTUAL paragraph MUST:

    • Be preceded by <!-- provenance: CODE-FACTUAL -->
    • Contain at least one backtick file:line citation
    • Be followed by <!-- evidence: symbol=X, literal="Y" --> with tokens from the cited range
    • Use the Read tool to verify the cited lines BEFORE writing the citation
  2. Every HYPOTHESIS paragraph MUST:

    • Be preceded by <!-- provenance: HYPOTHESIS -->
    • Start with an epistemic marker ("We hypothesize", "We are exploring", etc.)
  3. Every EXTERNAL-REFERENCE MUST cite a URL or paper reference

  4. BridgeBuilder voice:

    • At least 1 FAANG/bluechip analogy per major section (## heading)
    • 70/30 rule: 70% mechanism, 30% analogy
    • Never force an analogy — prefer omission over inaccuracy
  5. Banned terms: Never use any term from banned-terms.txt

  6. Citation encoding: Paths must be repo-relative, matching ^[a-zA-Z0-9_./-]+$

Output

Write the generated document to:

grimoires/loa/ground-truth/${DOC_TYPE}.md

Stage 4: VERIFY — Deterministic quality gates

Run the full quality gate suite. No LLM in this path.

.claude/scripts/ground-truth/quality-gates.sh "grimoires/loa/ground-truth/${DOC_TYPE}.md" --json

If exit code is 0: proceed to Stage 6 (OUTPUT). If exit code is 1: proceed to Stage 5 (REPAIR).


Stage 5: REPAIR — Fix verification failures (max 3 iterations)

When quality gates fail, you receive a JSON failure report. Fix each failure.

Repair interface contract

  • Input: Failure JSON from quality-gates.sh + the generated markdown draft
  • Allowed edits: ONLY the generated markdown at grimoires/loa/ground-truth/${DOC_TYPE}.md
  • Method: Full rewrite of the generated markdown file
  • Guard: Do NOT edit source code, registries, or any file outside grimoires/loa/ground-truth/

Repair rules

  1. Fix the citation, not the claim — find the correct file:line for the real code
  2. If the claim is wrong — update both the claim and the citation
  3. If a claim cannot be grounded — convert from CODE-FACTUAL to HYPOTHESIS with epistemic marker
  4. Never fabricate a citation to make the verifier pass
  5. Use the Read tool to inspect actual source files during repair

Repair loop

iteration = 0
while iteration < 3:
  Fix failures based on JSON report
  Rewrite document
  Run quality-gates.sh again
  If PASS: break
  iteration++

If iteration == 3 and still failing:
  HALT with detailed failure report
  Save last draft for manual review

After each repair, re-run Stage 4 (VERIFY).


Stage 6: OUTPUT — Write and stamp

After verification passes:

Stamp freshness metadata

.claude/scripts/ground-truth/stamp-freshness.sh "grimoires/loa/ground-truth/${DOC_TYPE}.md"

Confirm output

Report to the user:

  • Document path
  • Citation count (verified)
  • Provenance coverage percentage
  • Warning count (if any)
  • Generation timestamp

Stage 7: MANIFEST — Update generation manifest

.claude/scripts/ground-truth/write-manifest.sh "grimoires/loa/ground-truth/${DOC_TYPE}.md" \
  --citations ${CITATION_COUNT} \
  --warnings ${WARNING_COUNT} \
  --gates pass

This creates/updates grimoires/loa/ground-truth/generation-manifest.json with:

  • Document path, generation timestamp, HEAD SHA
  • Citation count, quality gate result, warning count
  • Registry SHAs (features, limitations, ride)

Beads Integration (Optional)

If br (beads_rust) is available, track generation as a beads task:

if command -v br &>/dev/null; then
  # Create task before generation
  br create --label "ground-truth:${DOC_TYPE}" --status in_progress

  # On success
  br close <task-id> --reason "Generated ${DOC_TYPE} with ${CITATION_COUNT} verified citations"

  # On repair loop exhaustion
  br update <task-id> --status blocked --comment "Repair loop exhausted after 3 iterations"
fi

If br is not available, skip silently — beads integration is optional.


Error Handling

Failure Recovery
/ride output missing Prompt user to run /ride first
/ride output stale (>7 days) Warn user; proceed with stale data or prompt re-ride
Registry files missing Fail fast with bootstrap command
Quality gate fails Enter REPAIR loop (max 3 iterations)
Repair loop exhausted HALT with failure report; save last draft
yq not installed Warn; skip registry-consistency gate

Circuit Breaker

If the same document type fails verification 3 consecutive times across separate invocations, log a warning to grimoires/loa/NOTES.md:

## Blockers

- [{date}] ground-truth: {doc-type} failed verification 3 consecutive times.
  Last failure: {gate} on {citation}.
  Likely cause: /ride reality is stale or features.yaml is out of date.
  Action: Re-run /ride and review features.yaml.

Version History

  • e0220ca Current 2026-07-05 20:35

Same Skill Collection

data/skills-md/00prabalk00/claude-skills/knowledge-base-gap-finder/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-agile/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-auth/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-issues/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-project-management/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-projects/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-safe/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-search/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-spaces/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-transitions/SKILL.md
data/skills-md/0731coderlee-sudo/wechat-publisher/wechat-publisher/SKILL.md
data/skills-md/0froq/skills/conventionalcommits/SKILL.md
data/skills-md/0froq/skills/nuxt/SKILL.md
data/skills-md/0froq/skills/oq/SKILL.md
data/skills-md/0froq/skills/pinia/SKILL.md
data/skills-md/0froq/skills/pnpm/SKILL.md
data/skills-md/0froq/skills/slidev/SKILL.md
data/skills-md/0froq/skills/tsdown/SKILL.md
data/skills-md/0froq/skills/turborepo/SKILL.md
data/skills-md/0froq/skills/unocss/SKILL.md
data/skills-md/0froq/skills/vitepress/SKILL.md
data/skills-md/0froq/skills/vitest/SKILL.md
data/skills-md/0froq/skills/vue-best-practices/SKILL.md
data/skills-md/0froq/skills/vue-router-best-practices/SKILL.md
data/skills-md/0froq/skills/vue-testing-best-practices/SKILL.md
data/skills-md/0froq/skills/vue/SKILL.md
data/skills-md/0froq/skills/vueuse-functions/SKILL.md
data/skills-md/0froq/skills/web-design-guidelines/SKILL.md
data/skills-md/0juano/agent-skills/bondterminal-x402/SKILL.md
data/skills-md/0juano/agent-skills/edgeone-pages-deploy/SKILL.md
data/skills-md/0juano/agent-skills/ley-ar/SKILL.md
data/skills-md/0juano/agent-skills/ticktick/SKILL.md
data/skills-md/0juano/agent-skills/x-image-cards/SKILL.md
data/skills-md/0juano/x-image-cards/x-image-cards/SKILL.md
data/skills-md/0x0funky/agent-sprite-forge/generate2dsprite/SKILL.md
data/skills-md/0x0funky/agent-sprite-forge/video2dsprite/SKILL.md
data/skills-md/0x2e/superpowers/brainstorming/SKILL.md
data/skills-md/0x2e/superpowers/dispatching-parallel-agents/SKILL.md
data/skills-md/0x2e/superpowers/executing-plans/SKILL.md
data/skills-md/0x2e/superpowers/finishing-a-development-branch/SKILL.md
data/skills-md/0x2e/superpowers/receiving-code-review/SKILL.md
data/skills-md/0x2e/superpowers/requesting-code-review/SKILL.md
data/skills-md/0x2e/superpowers/subagent-driven-development/SKILL.md
data/skills-md/0x2e/superpowers/systematic-debugging/SKILL.md
data/skills-md/0x2e/superpowers/test-driven-development/SKILL.md
data/skills-md/0x2e/superpowers/using-git-worktrees/SKILL.md
data/skills-md/0x2e/superpowers/using-superpowers/SKILL.md
data/skills-md/0x2e/superpowers/verification-before-completion/SKILL.md
data/skills-md/0x2e/superpowers/writing-plans/SKILL.md
data/skills-md/0x2e/superpowers/writing-skills/SKILL.md

Metadata

Files
0
Version
e4a0f95
Hash
6aea47a7
Indexed
2026-07-05 20:35

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-06 22:43
浙ICP备14020137号-1 $Map of visitor$