ilang-ai/autocode / skills/product-study
product-study
UnverifiedStudy an existing product from its public pages and turn it into an evidence-backed blueprint plus an MVP cut that AutoCode can build and ship. Use this whenever the user wants something "like X", "similar to X", "my own version of X", "a clone of X", names a competitor they admire, or pastes a product URL and asks to build it — even when they never say "research" or "analyze". Public sources only (official site, docs, pricing, changelog, public repos, app-store listings, public reviews); no logins, captures, decompiling, or copying of code, copy, images or brand.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.9 KB |
| examples/dino/README.md | markdown | 1.6 KB |
| examples/dino/blueprint.md | markdown | 9.6 KB |
| examples/dino/mvp.md | markdown | 4.5 KB |
| examples/dino/site/acceptance.js | script | 2.9 KB |
| examples/dino/site/index.html | other | 13.1 KB |
| examples/dino/sources.json | config | 1.5 KB |
| examples/linear/README.md | markdown | 1.0 KB |
| examples/linear/blueprint.md | markdown | 22.7 KB |
| examples/linear/mvp.md | markdown | 5.2 KB |
| examples/linear/sources.json | config | 9.2 KB |
| references/blueprint-template.md | markdown | 5.6 KB |
| references/boundaries.md | markdown | 3.9 KB |
| references/sources-policy.md | markdown | 5.2 KB |
| scripts/acceptance_run.py | script | 6.6 KB |
| scripts/blueprint.py | script | 16.9 KB |
| scripts/fetch_public.py | script | 25.6 KB |
| scripts/selftest.py | script | 14.1 KB |
scripts/acceptance_run.py
View on GitHub#!/usr/bin/env python3
"""Run a build's acceptance checks and print the table the user sees.
python3 acceptance_run.py <site_dir> # against the local build
python3 acceptance_run.py <site_dir> --url <live> # against the page actually served at the URL
python3 acceptance_run.py --selftest
Convention (the fixed part of S5-verify): next to the build lives a checks file,
`acceptance.js` (run with node) or `acceptance.py` (run with python3). It receives one
argument, the path of the HTML to check, and prints one JSON object per line:
{"id": "5", "check": "自动加速 1000 次更新后速度", "expected": "7.000", "actual": "7.000", "ok": true}
Any other stdout lines are ignored. This script renders the rows as
check / expected / actual / match, adds a one-line verdict, and exits 1 on any mismatch,
so go-live can refuse to proceed. With --url it first fetches the live HTML (and waits
for it to carry the build's rules block, `<script id="rules">`), so what is verified is
what people will actually open, not the local file. Python 3.8+, standard library.
"""
import argparse, json, os, subprocess, sys, tempfile, time, urllib.request
for _stream in (sys.stdout, sys.stderr): # Windows consoles default to cp1252; the table has CJK and ✓
try:
_stream.reconfigure(encoding="utf-8", errors="replace")
except Exception: # noqa: BLE001
pass
def width(s):
return sum(2 if ord(c) > 255 else 1 for c in str(s))
def pad(s, n):
return str(s) + " " * max(0, n - width(s))
def fetch_live(url, tries=30, wait=10):
last = ""
for _ in range(tries):
try:
with urllib.request.urlopen(url, timeout=15) as r:
html = r.read().decode("utf-8", "replace")
if r.status == 200 and '<script id="rules">' in html:
return html
last = "status %s, rules block %s" % (r.status, "present" if '<script id="rules">' in html else "missing")
except Exception as e: # noqa: BLE001 - any network error is a retry
last = str(e)
time.sleep(wait)
raise SystemExit("live page not ready after %d tries: %s (%s)" % (tries, url, last))
def find_checks(site_dir):
for name, runner in (("acceptance.js", "node"), ("acceptance.py", sys.executable)):
p = os.path.join(site_dir, name)
if os.path.exists(p):
return p, runner
return None, None
def run_checks(checks, runner, html_path):
r = subprocess.run([runner, checks, html_path], capture_output=True, encoding="utf-8", errors="replace")
rows = []
for line in (r.stdout or "").splitlines():
line = line.strip()
if line.startswith("{"):
try:
d = json.loads(line)
rows.append({"id": str(d.get("id", "")), "check": str(d.get("check", "")), "expected": str(d.get("expected", "")),
"actual": str(d.get("actual", "")), "ok": bool(d.get("ok"))})
except ValueError:
pass
return rows, r.returncode, (r.stderr or "").strip()
def render(rows, title):
w = [3, max(10, max((width(r["check"]) for r in rows), default=0) + 2), max(8, max((width(r["expected"]) for r in rows), default=0) + 2),
max(8, max((width(r["actual"]) for r in rows), default=0) + 2)]
out = [title, pad("#", w[0]) + pad("检查 check", w[1]) + pad("预期 expected", w[2]) + pad("实际 actual", w[3]) + "结果"]
for r in rows:
out.append(pad(r["id"], w[0]) + pad(r["check"], w[1]) + pad(r["expected"], w[2]) + pad(r["actual"], w[3]) + ("✓ 一致" if r["ok"] else "✗ 不一致"))
bad = sum(1 for r in rows if not r["ok"])
out.append("")
out.append("%d/%d 一致 (%d/%d match)%s" % (len(rows) - bad, len(rows), len(rows) - bad, len(rows), "" if not bad else ",%d 项不一致,先修再上线" % bad))
return "\n".join(out), bad
def main(argv=None):
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("site_dir", nargs="?")
ap.add_argument("--url", help="verify the page served at this URL instead of the local index.html")
ap.add_argument("--html", default="index.html", help="local file to check (default index.html)")
ap.add_argument("--selftest", action="store_true")
a = ap.parse_args(argv)
if a.selftest:
return selftest()
if not a.site_dir:
ap.print_help()
return 1
site = os.path.abspath(a.site_dir)
checks, runner = find_checks(site)
if not checks:
print("no acceptance.js / acceptance.py next to the build in %s — S5-verify has nothing to run; write one before go-live" % site)
return 2
if a.url:
html = fetch_live(a.url)
fd, html_path = tempfile.mkstemp(suffix=".html"); os.close(fd)
with open(html_path, "w", encoding="utf-8") as f:
f.write(html)
title = "验收 · 线上 %s" % a.url
else:
html_path = os.path.join(site, a.html)
title = "验收 · 本地 %s" % a.html
try:
rows, rc, err = run_checks(checks, runner, html_path)
finally:
if a.url:
os.remove(html_path)
if not rows:
print("checks file ran (exit %d) but printed no JSON rows%s" % (rc, (": " + err[:300]) if err else ""))
return 2
text, bad = render(rows, title)
print(text)
return 1 if bad else 0
def selftest():
"""No node, no network: a python checks file against a stub page."""
d = tempfile.mkdtemp()
with open(os.path.join(d, "index.html"), "w", encoding="utf-8") as f:
f.write('<html><script id="rules">var START=6;</script></html>')
with open(os.path.join(d, "acceptance.py"), "w", encoding="utf-8") as f:
f.write("import json,sys\nh=open(sys.argv[1],encoding='utf-8').read()\n"
"print(json.dumps({'id':'1','check':'rules block present','expected':'yes','actual':'yes' if 'id=\"rules\"' in h else 'no','ok':'id=\"rules\"' in h}))\n"
"print(json.dumps({'id':'2','check':'start speed','expected':'6','actual':'6','ok':True}))\n")
rows, rc, _ = run_checks(os.path.join(d, "acceptance.py"), sys.executable, os.path.join(d, "index.html"))
text, bad = render(rows, "selftest")
ok = len(rows) == 2 and bad == 0 and "2/2" in text
# a failing row must make the verdict non-zero
rows2 = rows + [{"id": "3", "check": "x", "expected": "1", "actual": "2", "ok": False}]
_, bad2 = render(rows2, "selftest")
ok = ok and bad2 == 1
print("acceptance_run selftest: %s" % ("ok" if ok else "FAIL"))
return 0 if ok else 1
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |