/autoresearch:learn [Mode: <init|update|check|summarize|wiki>] [Scope: <glob>] [Iterations: N] [--depth <level>] [--modules <list>] [--force] [--evals]from autoresearch
Scout codebase and auto-generate docs — or a navigable wiki knowledge base — with validation-fix loop
Ships in autoresearch. Installing the plugin adds it to Claude Code.
EXECUTE IMMEDIATELY.
Extract from $ARGUMENTS:
Mode: or --mode — init (create from scratch), update (refresh existing), check (validate), summarize (brief overview), wiki (navigable knowledge base)Scope: or --scope — file globs to documentDepth: or --depth — overview, standard, comprehensive--file <path> — specific file to document--scan — force fresh codebase scout--topics — comma-separated focus topics--modules <list> — wiki mode: comma-separated module names/paths overriding auto-detection--force — wiki mode: regenerate all pages from scratch, ignore existing manifest--no-fix — validate only, don't auto-fix issues--format — markdown (default), json, rstIterations: or --iterations — default 10. "unlimited" for unbounded.--evals, --evals-interval N, --chain, --<subcommand>AskUserQuestion (single batch): Q1 (Mode): "What to do?" — init (generate docs), update (refresh), check (validate), summarize (overview), wiki (knowledge base) Q2 (Scope): "Which files?" — suggested globs + entire codebase Q3 (Depth): "How detailed?" — overview only, standard, comprehensive Q4 (Topics): "Focus on?" — architecture, API, database, testing, all If all provided → skip.
autoresearch/learn-{YYMMDD}-{HHMM}/# metric_direction: higher_is_better\niteration\ttimestamp\tfile_documented\tvalidation_status\tissues_found\tissues_fixed\tdescriptionIf mode == summarize:
If mode == wiki: reuse Scout (Phase 1) + Analyze output, then generate a navigable wiki/ knowledge base. Skip the init/update/check loop. Metric = pages_generated / pages_planned × 100 (from manifest); size target 300 lines/page.
--modules flag (explicit override, always wins; every path must resolve inside project root — reject escapes)workspaces in package.json, Cargo workspace members, pnpm-workspace.yaml)pyproject.toml, Cargo.toml, go.mod, *.csproj)Cap 10 modules. If >10, group by top-level dir; if a group has >5 sub-modules, expand and take 10 largest by file count.
mkdir -p wiki/modules/; append wiki-manifest.json to .gitignore if absentwiki-manifest.json BEFORE generating — {version:"1", generated_at, generation_status:"in_progress", modules_detected:[…], pages_planned:N, pages:{ "wiki/architecture.md":{status:"pending",type:"architecture"}, "wiki/modules/<name>.md":{…"module"}, "wiki/glossary.md":{…}, "wiki/onboarding.md":{…}, "wiki/index.md":{…} }}wiki/index.md listing every planned page as [pending] (navigation survives interruption)--force deletes it and regenerates all, else skip "generated" pages and only do "pending". Corrupted manifest (invalid JSON, or missing version/pages) without --force → error directing user to --force.architecture.md — system overview from scout context. Up to 5 Mermaid diagrams, 3 types only (graph TD, sequenceDiagram, classDiagram); include one canonical example of each in the prompt; pick by signal.glossary.md — domain terms from class names, exports, types, comments; filter language keywords + stdlib; soft cap ~60-80, prioritize terms in 3+ files.onboarding.md — reading order, env setup, first-contribution workflow, gotchas. Sources: dir structure, README/docs, manifests, entry-point sampling, git log --since='6 months ago' directory frequency (skip with note if not a git repo or >10s).index.md — final pass: replace stub with real page descriptions + reading order.generated_by: autoresearch in YAML frontmattergrep -rlE '(AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9]{20,}|ghp_[a-zA-Z0-9]{36}|password\s*[:=]\s*\S+|mongodb(\+srv)?://\S+|postgres(ql)?://\S+)' wiki/ and warn (non-blocking) in the report.generated_by: autoresearch frontmatter; if absent (user-created) skip with warning. --force overrides.After each page is written, flip its manifest entry pending→generated (interrupt-safe). When all done, set generation_status:"complete". Then run Phase 3 (Validate) with wiki path swap: replace docs/ with wiki/ (ls wiki/*.md wiki/modules/*.md 2>/dev/null), use maxLoc 300. Output: ✓ Wiki: [N] modules, [M] pages generated.
docs: document {file/module}Append to TSV: iteration, timestamp, file_documented, validation_status, issues_found, issues_fixed, description
If --evals: check if current_iteration % interval == 0 → run checkpoint.
If bounded: current_iteration >= max_iterations → exit loop.
learn-results.tsvsummary.md — documentation overviewvalidation-report.md — issues found/fixedPrint: files documented, validation pass rate, issues found/fixed, remaining gaps.
If --evals present:
--- Eval Checkpoint (iterations {X}-{Y}) ---\nDocs written: {n} | Validation: {pass}/{total} | Gaps remaining: {m}\n{recommendation}\n---After completion, write handoff.json: version "2.1.0", source "learn", timestamp, status, results_tsv path, findings = documentation gaps remaining, config{mode, scope, depth}. Invoke next target in --chain order. Propagate --evals flag.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
14 commands in this plugin
/autoresearchAutonomous iteration loop: modify, verify, keep/discard against any metric/debugautoresearch:debugHunt bugs with scientific method: hypothesize, test, falsify, repeat/evalsautoresearch:evalsAnalyze iteration results: trends, plateaus, regressions, recommendations/fixautoresearch:fixCrush errors one-by-one until zero remain: tests, types, lint, build/improveautoresearch:improveResearch ICP challenges, discover improvements, generate PRDs/planautoresearch:planConvert a goal into validated Scope, Metric, Direction, Verify configGenerated from the plugin's indexed repository (hasin-ai/autoresearch-puku) — no native marketplace selected
npx claudepluginhub p/hasin-ai-autoresearch