This handoff is for the next Claude Code session. Read this file, then CLAUDE.md (operating guide) and plugin/skills/market-mirror/SKILL.md (recipes).
MarketMirror tests marketing and sales decisions on simulated buyers. It is a fork of 666ghj/MiroFish (AGPL-3.0) with:
- Claude as the LLM through Anthropic's OpenAI-compatible endpoint (
backend/app/config.py,backend/app/utils/openai_chat_compat.py). - Free local memory instead of Zep Cloud (
backend/app/utils/local_graph.py,embeddings.py; optional Cognee sidecar). - Persona planner (
backend/app/services/persona_planner.py): segments, balanced diversity traits, contradictions, communities, follow graph, and a filter that drops non-actor graph entities. - Feed test (
backend/app/services/feed_test.py): platform feeds with attention gating, habits, stated probabilities, damped social proof, wear-out, landing page, projections, ROI economics. - Analyst panel (
backend/app/services/analyst_panel.py) and API (backend/app/api/market.py). - CLI (
backend/claude_cli/mirofish.py,market_cli.py,quickstart.py): quickstart, run, market-test, survey, feedtest, captions, pitch, ideas, report, panel, ads-import, backtest, live, export. - Dashboard (
backend/claude_cli/exporter.py,marketing.py,feed_view.py,social_feed.py,report_view.py, vendored ECharts): one offline HTML file; the plain-language report with all downloads in its header, the social feed (real post view), sales rehearsal, test ideas, people cards. - Inside the rounds (
backend/scripts/agent_context.py,event_schedule.py): per-round persona cards with country voice and action budgets, brand posts and scheduled launch events, round-0 duplicate fix. Services:feed_story.py(post view),market_report.py(report),pitch.py(sales rehearsal),ideas.py(next tests from real ad data),persona_planner.pylife interviews. - Claude skill / plugin (
plugin/,.claude-plugin/marketplace.json).
Your own inputs go in scenarios/<name>/ (gitignored). Runs go to mirofish_runs/ (gitignored).
- Ontology, graph build (local memory), persona planning with communities, agent preparation.
- Feed test end to end, including landing page drop-off.
- OASIS rounds start and run; community follows are seeded on both platforms.
- Survey, SSR ratings, analyst panel, plain-language report (
market_report.json, methodllm) on the Fitloop demo run. - Social feed from the OASIS databases (
feed_story.json, 77 posts, 3 brand posts) on the Fitloop demo run. - Launch run with
posts/eventsand the pitch rehearsal on 28 people (mirofish_runs/fitloop_launch/): brand posts land at their rounds on both platforms with replies per country;pitch.jsonscored. - 150-person run from
quickstart --answers(mirofish_runs/fitloop/, simsim_4e650375af47): 13 min for the people, 41 min for feed test + 6 rounds + survey + pitch + panel + report; about 1,500 Claude calls; dashboard 3.9 MB. The market-map ontology (Brand, Competitor, Product, Community, segments) was used for it.
understand(product profile) and the no-key gateway (backend/gateway/local_gateway.py,mm.sh gateway).- Persona engine v2: adaptive probes, product questions, BDE card, stereotype guard, population weights, verbalized chances + dispersion,
survey --retest,calibrate(AIPW), SSR on pitch replies. - Speed: memory window, concurrent interviews, config pool, knobs; 150 people in 11 min.
- Campaign lab:
emailtest,test --spec(12 test types),study --spec(scenarios x seeds),predict+ calibration store + forecast,research(HN, App Store, Reddit when reachable) + voice store,context(live updates into rounds). - Report v2 (so-what, sales rehearsal, email, real-world check, budget plan, 30-day plan, decision changers, risks, reliability), dashboard design system.
- Integration:
docs/API.md+openapi.jsonfrombackend/app/api/registry.py(backend/scripts/gen_api_docs.py), webhooks (MIROFISH_WEBHOOK_URL),sdk/, Dockerfile + compose, CI (.github/workflows/tests.yml), Codex package (codex/),docs/PUBLISHING.md. - Checks that still need a real run: email test on real people (unit-tested only),
test --specon real people,calibratewith a real CSV, the gateway with a logged-inclaudeCLI (the login on this machine had expired when tried).
- Done: survey ratings come from free text mapped to anchor statements (SSR, arXiv 2510.08338,
backend/app/services/ssr.py), andfeedtest --seeds Nreports ranges. Not yet checked on a real run: the anchor sets and the decision thresholds on the SSR mean (go >= 3.5, iterate >= 2.7) are first guesses; tune them with a backtest or real survey data. - Pricing (Van Westendorp) answers from LLMs are low-confidence without real price data.
- The upstream Vue frontend is not updated for MarketMirror (the dashboard replaces it). Upstream bug:
frontend/src/api/report.jscallsgetReportStatuswith GET, the route is POST-only. - Local memory: no temporal invalidation of old facts; multilingual embedding truncates at 128 tokens.
- Pitch lead scores and the ideas' fallback list are heuristics; the number guard in the report drops any figure that is not in the fact sheet.
- Phase-5 framing: the ontology prompt now defaults to a market map (Brand, Competitor, segments, Objection, Benefit, PricePoint, Channel); the upstream Chinese opinion-simulation guidance remains as the fallback for non-market documents.
cp .env.example .env # LLM_API_KEY=<Anthropic key>
cd backend && uv sync --python 3.12 && cd ..
bash backend/claude_cli/start_server.sh
alias mm="backend/.venv/bin/python backend/claude_cli/mirofish.py"
mm quickstart # or:
mm run --seed scenarios/x/brief.md --requirement @scenarios/x/question.txt --personas scenarios/x/personas.json \
--stop-after prepare --out mirofish_runs/x --title "X market test"
mm feedtest --simulation <id> --creatives @scenarios/x/creatives.json --run-dir mirofish_runs/x
mm live # http://127.0.0.1:5050/