Skip to content

rrrrrredy/research-toolkit / plugins/research-toolkit

research-toolkit

Flagged

Use for source-backed long-form research and writing in English or Chinese across fields, including revisions and continuation. Understand requirements, develop analysis through substantive research collaboration, and deliver a complete report after independent review, audit and acceptance.

FileKindSize
.codex-plugin/plugin.jsonconfig1.0 KB
.generated-files.jsonconfig6.3 KB
.mcp.jsonconfig158 B
LICENSEother1.0 KB
README.mdmarkdown3.4 KB
README.zh-CN.mdmarkdown3.0 KB
SKILL.mdskill md7.8 KB
SKILL.zh-CN.mdmarkdown6.5 KB
VERSIONother6 B
docs/compatibility.mdmarkdown3.8 KB
docs/compatibility.zh-CN.mdmarkdown3.2 KB
docs/delivery-verification.mdmarkdown19.2 KB
docs/delivery-verification.zh-CN.mdmarkdown16.3 KB
docs/review-completion.mdmarkdown18.0 KB
docs/review-completion.zh-CN.mdmarkdown14.7 KB
docs/usage-data.mdmarkdown15.4 KB
docs/usage-data.zh-CN.mdmarkdown13.9 KB
docs/usage-modes.mdmarkdown55.6 KB
docs/usage-modes.zh-CN.mdmarkdown48.6 KB
hooks/hooks.jsonconfig3.2 KB
mcp.jsonconfig253 B
plugin.jsonconfig1.1 KB
references/gotchas.mdmarkdown6.2 KB
references/gotchas.zh-CN.mdmarkdown3.6 KB
references/horizontal-vertical-analysis.mdmarkdown4.3 KB
references/horizontal-vertical-analysis.zh-CN.mdmarkdown3.2 KB
references/optional-analysis-lenses.mdmarkdown8.1 KB
references/optional-analysis-lenses.zh-CN.mdmarkdown6.1 KB
references/postmortem-lessons.mdmarkdown4.3 KB
references/postmortem-lessons.zh-CN.mdmarkdown3.5 KB
references/quality-gates.mdmarkdown5.7 KB
references/quality-gates.zh-CN.mdmarkdown4.5 KB
references/research-standard.mdmarkdown18.2 KB
references/research-standard.zh-CN.mdmarkdown13.7 KB
references/research-workflow.mdmarkdown25.5 KB
references/research-workflow.zh-CN.mdmarkdown19.9 KB
references/subagents-and-review-loop.mdmarkdown17.0 KB
references/subagents-and-review-loop.zh-CN.mdmarkdown13.4 KB
references/task-continuity.mdmarkdown6.9 KB
references/task-continuity.zh-CN.mdmarkdown5.3 KB
references/writing-style.mdmarkdown18.1 KB
references/writing-style.zh-CN.mdmarkdown14.9 KB
requirements-mcp.txtmarkdown11 B
scripts/agent_session.pyscript6.2 KB
scripts/check_delivery.pyscript44.6 KB
scripts/check_review_completion.pyscript28.5 KB
scripts/cli_agent_session.pyscript9.6 KB
scripts/codex_session.pyscript7.5 KB
scripts/extract_source_text.pyscript10.7 KB
scripts/host_review.pyscript78.4 KB
scripts/install_usage.pyscript9.7 KB
scripts/record_changes.pyscript13.7 KB
scripts/release_updates.pyscript9.8 KB
scripts/research_guidance.pyscript5.8 KB
scripts/research_host.pyscript52.4 KB
scripts/research_mcp.pyscript18.9 KB
scripts/research_records.pyscript28.5 KB
scripts/research_workflow.pyscript40.9 KB
scripts/review_process.pyscript5.2 KB
scripts/review_runner.pyscript20.2 KB
scripts/run_observation.pyscript7.7 KB
scripts/task_context.pyscript21.1 KB
scripts/task_lock.pyscript1.7 KB
scripts/task_reading.pyscript4.0 KB
scripts/task_storage.pyscript3.1 KB
scripts/usage_events.pyscript38.9 KB
scripts/usage_host.pyscript7.8 KB
scripts/usage_opencode.mjsscript3.1 KB

scripts/usage_opencode.mjs

View on GitHub
// OpenCode's native events feed the same local collector as other hosts.
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";
import path from "node:path";

export function createUsagePlugin(python = "python") {
  return async () => {
    const send = async (payload) => {
      if (["off", "0", "false"].includes((process.env.RESEARCH_TOOLKIT_TELEMETRY || "").toLowerCase())) return;
      const script = path.join(path.dirname(fileURLToPath(import.meta.url)), "usage_host.py");
      await new Promise((resolve) => {
        const child = spawn(python, [script, "--host", "opencode"], { stdio: ["pipe", "ignore", "pipe"], windowsHide: true });
        let reported = false;
        const unavailable = () => {
          if (!reported) process.stderr.write("Research Toolkit usage collector unavailable; research continues.\n");
          reported = true;
        };
        child.on("error", () => { unavailable(); resolve(); });
        child.stdin.on("error", unavailable);
        child.on("close", (code) => { if (code) unavailable(); resolve(); });
        child.stderr.on("data", (data) => process.stderr.write(data));
        child.stdin.end(JSON.stringify(payload));
      });
    };
    return {
      "chat.message": async (input, output) => {
        const requested = output.parts.some((part) => part.type === "text" && /research[- ]toolkit|研究工具箱/i.test(part.text));
        await send({hook_event_name: "UserPromptSubmit", session_id: input.sessionID,
          event_id: input.messageID || output.message.id, prompt: requested ? "research-toolkit" : ""});
      },
      "tool.execute.before": async (input, output) => send({
        hook_event_name: "PreToolUse", session_id: input.sessionID, tool_use_id: input.callID,
        tool_name: input.tool, tool_input: output.args,
      }),
      "tool.execute.after": async (input) => send({
        hook_event_name: "PostToolUse", session_id: input.sessionID, tool_use_id: input.callID,
        tool_name: input.tool, tool_input: input.args,
      }),
      event: async ({ event }) => {
        const p = event.properties || {};
        if (event.type === "message.part.updated" && p.part?.type === "tool" && p.part.state?.status === "error") await send({
          hook_event_name: "PostToolUseFailure", session_id: p.part.sessionID, tool_use_id: p.part.callID,
          tool_name: p.part.tool, tool_input: p.part.state.input,
        });
        if (event.type === "session.created" && p.info?.parentID) await send({
          hook_event_name: "SubagentStart", session_id: p.info.parentID, agent_id: p.info.id,
          event_id: p.info.id,
        });
        if (event.type === "session.idle") await send({hook_event_name: "Stop", session_id: p.sessionID, event_id: String(Date.now())});
        if (event.type === "session.compacted") await send({hook_event_name: "PostCompact", session_id: p.sessionID, event_id: String(Date.now())});
        if (event.type === "session.deleted") await send({hook_event_name: "SessionEnd", session_id: p.info?.id, event_id: p.info?.id});
      },
    };
  };
}

export default createUsagePlugin();
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall