Loading...
Loading...
Use when generating agent-native onboarding docs, coverage maps, health baselines, and agent adapters for a repo.
npx skill4agent add fellowship-dev/dogfooded-skills popsiclenpx skills add fellowship-dev/dogfooded-skills/skills/ops/popsicle--agents/tmpCLAUDE.mddocs/docs/architecture.mddocs/api.mddocs/configuration.mddocs/runbook.mddocs/wc -l CLAUDE.mddocs/*.mddocs/architecture.mddocs/api.mddocs/configuration.mddocs/workflows.mddocs/data-model.mddocs/glossary.mddocs/runbook.mddocs/misc.mddocs/notes.mdREADME.mddocs/REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename $(git remote get-url origin) .git)
TODAY=$(date +%Y-%m-%d)
ITERATION=1
MAX_ITERATIONS=5
PASS_THRESHOLD=80--loop--agents--canonical agentsAGENTS.mdCLAUDE.md--agents.cursor/.github/copilot-instructions.md--agentsmainindexapp| Category | Target file |
|---|---|
| identity, stack, run/test commands, key rules | |
| system design, data flow, service boundaries | |
| routes, endpoints, request/response | |
| env vars, config files, feature flags | |
| dev workflow, CI/CD, deploy, release | |
| database schema, key tables | |
| domain terms | |
KNOWLEDGE_MAP="/tmp/popsicle-knowledge-$(date +%s).json"python3 -c "
import json, sys
concepts = [
{
'id': 'concept-1',
'category': 'architecture',
'target_file': 'docs/architecture.md',
'name': 'Short name',
'description': 'What an agent should know about this',
'evidence': 'Where you found it in the code (file:line)',
'question': 'Question to ask the validation session',
'nav_question': 'Which doc file would you read to learn about this?'
},
# ... 5-10 concepts
]
with open('$KNOWLEDGE_MAP', 'w') as f:
json.dump({'repo': '$REPO_NAME', 'iteration': $ITERATION, 'concepts': concepts}, f, indent=2)
"/tmpdocs/coverage-map.md# Coverage Map — {REPO_NAME}
> Generated by popsicle on {TODAY} (iteration {N}).
> ✓ = documented ✗ = gap ~ = partial
## {top-level-area/}
- ✓ `src/index.ts` — entry point, startup sequence
- ✓ `src/routes/` — API routes (see docs/architecture.md)
- ✗ `src/workers/` — background job processing (undocumented)
- ~ `src/models/` — data models exist in README but schema not captured
## {another-area/}
- ✗ `scripts/deploy.sh` — deployment procedure (gap)
- ✓ `.env.example` — environment variables documented in CLAUDE.md✓~CLAUDE.mddocs/README.md# TitleCLAUDE_LINES=$(wc -l < CLAUDE.md 2>/dev/null || echo 0)
if [ "$CLAUDE_LINES" -gt 80 ]; then
echo "CLAUDE.md is $CLAUDE_LINES lines — over 80-line budget. Refactor."
fidocs/See [docs/configuration.md](docs/configuration.md) for full env var reference.# {Repo Name}
{One sentence: what this is and what stack.}
## Quick Start
{install, run, test commands — no prose, just the commands}
## Key Rules
{Things that break if violated — max 5 bullets}
## Project Structure
{Only if non-obvious — 5-10 lines max showing key directories}
## Reference
- [Architecture](docs/architecture.md) — {one-line summary}
- [Configuration](docs/configuration.md) — {one-line summary}
- [API](docs/api.md) — {one-line summary}docs/health-baseline.md# Doc Health Baseline — {REPO_NAME}
> Last updated by popsicle on {TODAY}.
## Architecture
**Docs exist:** `docs/architecture.md`, CLAUDE.md §Architecture
**Missing:** service dependency graph, data flow for async jobs
**Companion skills installed:** none
## API Contracts
**Docs exist:** README API section
**Missing:** request/response schemas for /auth routes
**Companion skills installed:** none
## Dev Setup
**Docs exist:** README §Getting Started
**Missing:** `.env` values required for local OAuth
**Companion skills installed:** hookshot (enforces freshness on commit)
## Deployment
**Docs exist:** none
**Missing:** deploy command, required secrets, rollback procedure
**Companion skills installed:** nonedocs/generated/<!-- generated by popsicle on {TODAY} — do not edit manually -->docs/generated/env-vars.md.env.exampleprocess.env.*os.environdocs/generated/api-routes.mddocs/generated/db-schema.mdgit add CLAUDE.md docs/
git commit -m "docs: popsicle iteration $ITERATION — structured agent docs
Concepts targeted: [list the concept names]
Coverage map updated. Health baseline updated."AGENTS.mdCLAUDE.mdif [ ! -e "$REPO_ROOT/AGENTS.md" ]; then
ln -s CLAUDE.md "$REPO_ROOT/AGENTS.md"
git add "$REPO_ROOT/AGENTS.md"
git commit -m "docs: add AGENTS.md symlink for Codex compatibility"
fi--canonical agentsAGENTS.mdCLAUDE.md--agents.cursor/.github/copilot-instructions.md--agentsgenerated by popsicle.github/copilot-instructions.md<!-- generated by popsicle — edit CLAUDE.md instead -->
# {REPO_NAME} — Copilot Instructions
See CLAUDE.md for project identity and docs/ for reference material.
Key docs: docs/architecture.md, docs/coverage-map.md, docs/health-baseline.md.cursor/rules/project.mdc---
description: Project onboarding for {REPO_NAME}
alwaysApply: true
---
<!-- generated by popsicle — edit CLAUDE.md instead -->
See CLAUDE.md for project identity and docs/ for reference material.
Key docs: docs/architecture.md, docs/coverage-map.md, docs/health-baseline.mdCLAUDE.md--canonical agentsgenerated by popsiclegit add .github/copilot-instructions.md .cursor/rules/project.mdc 2>/dev/null
git diff --cached --quiet || git commit -m "docs: add agent adapter files (popsicle)"/tmpRESULTS_DIR="/tmp/popsicle-results-$(date +%s)"
mkdir -p "$RESULTS_DIR"claude -p "You are examining the repository at $REPO_ROOT. \
Using ONLY the documentation in this repo (CLAUDE.md, docs/*.md), \
answer this question. Do not read source code — only docs. \
If the docs don't cover this, say 'NOT DOCUMENTED'. \
\
Question: [concept.question]" \
--model sonnet --output-format text \
2>/dev/null > "$RESULTS_DIR/concept-N-content-1.txt"claude -p "You are examining the repository at $REPO_ROOT. \
Look at the documentation files available (CLAUDE.md, docs/*.md). \
Do NOT read the full contents — only look at file names and headers. \
\
Question: Which specific doc file would you open to learn about: [concept.nav_question]? \
Answer with just the file path." \
--model sonnet --output-format text \
2>/dev/null > "$RESULTS_DIR/concept-N-nav.txt"waittarget_filePORT=4000DATABASE_URLDB_CONNECTION_STRINGsrc/server.jssrc/app.jsnpm startpackage.json.nvmrcSTALE{
"type": "STALE",
"doc_claim": "port 3000 (README line 42)",
"actual": "PORT env var defaults to 4000 (src/config.ts:8)",
"fix": "Update README to reference PORT env var"
}SCORE=$((PASS_COUNT * 100 + PARTIAL_COUNT * 50))
PASS_RATE=$((SCORE / TOTAL_CONCEPTS))REPORT="$REPO_ROOT/docs/popsicle-report-${TODAY}.md"# Popsicle Report — {REPO_NAME}
**Date**: {TODAY}
**Iteration**: {N}
**Concepts tested**: {count}
**Pass rate**: {PASS_COUNT}/{TOTAL} ({PCT}%)
**Stale claims found**: {STALE_COUNT}
## Doc Structure
| File | Lines | Status |
|------|-------|--------|
| CLAUDE.md | {n} | {ok / over budget} |
| docs/architecture.md | {n} | {exists / created / n/a} |
| docs/configuration.md | {n} | {exists / created / n/a} |
| ... | | |
## Results
| # | Concept | Target File | Content | Nav | Verdict |
|---|---------|-------------|---------|-----|---------|
| 1 | {name} | docs/arch.. | PASS | HIT | PASS |
| 2 | {name} | CLAUDE.md | WEAK | HIT | PARTIAL |
| 3 | {name} | docs/api.. | FAIL | MISS| FAIL |
## Gaps Remaining
- **{concept}**: {why it failed — what's missing or misplaced}
- ...
## Staleness
<!-- Omit section if STALE_COUNT == 0 -->
- **{doc_claim}** in `{file}`: actual value is `{actual}`. Fix: {fix}
- ...
## Missing Knowledge
<!-- Concepts that cannot be inferred from source code alone. These require human input. -->
- **Business rules**: {e.g., "pricing tiers defined in Notion, not in code"}
- **External credentials**: {e.g., "Stripe webhook secret — ask ops team"}
- **Deployment procedures**: {e.g., "staging deploy requires VPN + manual approval"}
- ...
## Doc Changes This Iteration
- Updated `CLAUDE.md`: added {what}
- Updated `docs/architecture.md`: added {what}
- Updated `docs/coverage-map.md`: reflects new scan
- Updated `docs/health-baseline.md`: added {category} section
- Created `docs/generated/env-vars.md`
- ...
## Companion Skills
These skills complement popsicle for ongoing doc health:
- **hookshot** — enforces doc freshness via commit hooks
`npx skills add fellowship-dev/dogfooded-skills/skills/ops/hookshot`
- **entropy-check** — periodic doc drift sensor
`npx skills add fellowship-dev/dogfooded-skills/skills/ops/entropy-check`
- **trash-truck** — removes dead/duplicate code that confuses agents
`npx skills add fellowship-dev/dogfooded-skills/skills/ops/trash-truck`
- **speckit** — structured issue-to-PR pipeline for doc-gated features
`npx skills add fellowship-dev/dogfooded-skills/skills/ops/speckit`git add "docs/popsicle-report-${TODAY}.md"
git commit -m "docs: popsicle report — iteration $ITERATION, ${PASS_RATE}% pass rate"if [ "$PASS_RATE" -ge "$PASS_THRESHOLD" ]; then
echo "Pass rate ${PASS_RATE}% >= ${PASS_THRESHOLD}%. Docs are agent-ready. Stopping."
exit 0
fi
if [ "$ITERATION" -ge "$MAX_ITERATIONS" ]; then
echo "Hit max iterations ($MAX_ITERATIONS). Pass rate: ${PASS_RATE}%. Review remaining gaps manually."
exit 0
fi
ITERATION=$((ITERATION + 1))rm -f /tmp/popsicle-knowledge-*.json
rm -rf /tmp/popsicle-results-*/popsicle/popsicle --loop/popsicle --agents/popsicle --canonical agentscurl -X POST "$PYLOT_DISPATCH_URL" \
-H "Authorization: Bearer $PYLOT_DISPATCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"agent":"crew.lead","task":"Run popsicle in loop mode on this repo. Commit doc improvements and reports.","repo":"org/repo"}'/tmp