/midnight-expert:feedbackfrom midnight-expert
Files feedback, bug reports, or feature requests to the midnightntwrk/midnight-expert GitHub repo. Collects user prose, scans session context, redacts sensitive info, and generates a maintainer-ready issue body.
Ships in midnight-expert. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Route a user's feedback to GitHub on midnightntwrk/midnight-expert with minimal user effort. The user contributes intent and expectation; the skill provides everything else.
Bash, Read, Write, AskUserQuestion
If the slash-command was invoked with arguments, those are the opening prose. Otherwise ask the user:
"What's the feedback?"
Accept the user's free-text reply as prose. If prose is empty or whitespace-only, ask once more:
"I need a sentence or two to get started — what's the feedback?"
If the second reply is also empty, abort cleanly: print "Cancelled — no feedback captured." and stop.
Save prose to /tmp/feedback-prose.txt using the Write tool (cleaner than heredoc bash).
Determine the current session's JSONL file:
CURRENT_JSONL="$(bash "${CLAUDE_SKILL_DIR}/scripts/find-current-session.sh" "$PWD")"
The Phase 1 dependency graph (so you call these in the right batch):
parallel: collect-environment.sh list-recent-sessions.sh find-current-session.sh
│ │ │
│ │ ▼
│ │ extract-failure-signature.js
│ │ plugin-name-detection.js
└────── all five → /tmp/feedback-*.json ──┘
Then in a single message, run these in parallel Bash tool calls (independent):
bash "${CLAUDE_SKILL_DIR}/scripts/collect-environment.sh" > /tmp/feedback-environment.json
bash "${CLAUDE_SKILL_DIR}/scripts/list-recent-sessions.sh" "$PWD" > /tmp/feedback-recent-sessions.json
If CURRENT_JSONL is non-empty, also run (depends on the JSONL path):
node "${CLAUDE_SKILL_DIR}/scripts/extract-failure-signature.js" "$CURRENT_JSONL" > /tmp/feedback-failure-signature.json
KNOWN="$(jq -r '.plugins | keys | join(",")' /tmp/feedback-environment.json)"
node "${CLAUDE_SKILL_DIR}/scripts/plugin-name-detection.js" \
--prose-file /tmp/feedback-prose.txt \
--jsonl-file "$CURRENT_JSONL" \
--plugins "$KNOWN" \
> /tmp/feedback-plugin-candidates.json
If CURRENT_JSONL is empty (no session JSONLs found), substitute these defaults:
echo '{"events":[],"counts":{"tool-error":0,"nonzero-exit":0}}' > /tmp/feedback-failure-signature.json
echo '{"fromProse":[],"fromFailingTools":[],"activeInSession":[]}' > /tmp/feedback-plugin-candidates.json
If individual scripts fail, fall back to null / empty for that field. If ~/.claude/projects/ doesn't exist at all, abort with:
"I can't read your session storage at
~/.claude/projects/. Re-run from a Claude Code session."
Read ${CLAUDE_SKILL_DIR}/references/inference-rubric.md. Then read in parallel:
/tmp/feedback-prose.txt/tmp/feedback-recent-sessions.json/tmp/feedback-failure-signature.json/tmp/feedback-plugin-candidates.json/tmp/feedback-environment.jsonApply the rubric to produce a JSON object matching this exact schema:
{
"route": "issue" | "enhancement",
"route_confidence": "high" | "medium" | "low",
"session_pointer": "current" | "older" | "ambiguous",
"session_candidates": ["<sessionId>", ...],
"plugin_label": "<slug>" | null,
"plugin_confidence": "high" | "medium" | "low",
"expected_anchor_draft": "<prose>" | null,
"intent_anchor_draft": "<prose>" | null
}
Save it to /tmp/feedback-inference.json using the Write tool. Do not include any prose around the JSON.
If your output is unparseable, retry once. On the retry, prepend this exact instruction to your reasoning context: "Output ONLY the JSON object — no markdown fences, no commentary, no leading or trailing whitespace, no explanatory text. The very first character of your output must be { and the last must be }." If still unparseable after the retry, save the prose to a draft and abort:
DRAFT_DIR="${CLAUDE_PLUGIN_DATA}/.feedback/drafts"
mkdir -p "$DRAFT_DIR"
cp /tmp/feedback-prose.txt "$DRAFT_DIR/$(date -u +%Y%m%dT%H%M%SZ)-prose-only.md"
Print: "I couldn't analyze the feedback. Your prose is saved at . Try again or file manually at https://github.com/midnightntwrk/midnight-expert/issues/new"
Read /tmp/feedback-inference.json. Build a single AskUserQuestion call with up to 3 questions, each guarded by its confidence:
Skip if route_confidence == "high".
RouteIs this a bug report or a feature request?Bug report (description: "Something isn't working as expected.")Feature request (description: "I'd like a new capability.")Skip if session_pointer == "current".
SessionWhich session does this relate to?session_candidates. For each sessionId listed, an option whose label is <gitBranch> · <startedAt> and description is <firstUserPrompt> (truncated to ~80 chars). Always include Current session as the first option (recommended if session_candidates is empty).Skip if plugin_confidence == "high".
PluginWhich plugin is this about?fromProse + fromFailingTools + activeInSession in plugin-candidates.json. Mark plugin_label (if non-null) as recommended. If the candidate list is empty, fall back to a 4-option list of plugins from environment.json plugins (top 4 by alphabetical order — better than nothing).If all three are skipped (everything was high-confidence), proceed directly to Phase 4 with the inferred values.
If at least one is asked, send a single message containing the AskUserQuestion. After the user responds, update the inference object with their corrections (in working memory; no file write needed unless you prefer to persist).
Based on the (possibly user-corrected) route:
route == "issue" → read ${CLAUDE_SKILL_DIR}/references/issue-flow.md and follow it step by step.route == "enhancement" → read ${CLAUDE_SKILL_DIR}/references/enhancement-flow.md and follow it step by step.The hub does not duplicate route procedures inline. Each reference file is self-contained and uses the values already produced by Phases 0–3 (prose, JSONL path, environment, inference).
After the route flow returns:
/tmp/feedback-prose.txt, /tmp/feedback-environment.json, /tmp/feedback-recent-sessions.json, /tmp/feedback-failure-signature.json, /tmp/feedback-plugin-candidates.json, /tmp/feedback-inference.json.issue-flow.md Step 9 that didn't reach its own cleanup branch:
rm -f /tmp/feedback-body.*.md
${CLAUDE_PLUGIN_DATA}/.feedback/drafts/ — those are user-visible artifacts.The skill has either:
gh failure (path printed, paste-ready command printed)In all cases, return control to the user.
references/enhancement-flow.md (opens in a new tab)references/evidence-extraction.md (opens in a new tab)references/inference-rubric.md (opens in a new tab)references/issue-body-template.md (opens in a new tab)references/issue-flow.md (opens in a new tab)scripts/__tests__/collect-environment.test.js (opens in a new tab)scripts/__tests__/extract-failure-signature.test.js (opens in a new tab)scripts/__tests__/find-current-session.test.js (opens in a new tab)scripts/__tests__/fixtures/sample-session.jsonl (opens in a new tab)scripts/__tests__/list-recent-sessions.test.js (opens in a new tab)scripts/__tests__/parse-session.test.js (opens in a new tab)scripts/__tests__/plugin-name-detection.test.js (opens in a new tab)scripts/__tests__/redact-string.test.js (opens in a new tab)scripts/__tests__/redactor.test.js (opens in a new tab)scripts/collect-environment.sh (opens in a new tab)scripts/extract-failure-signature.js (opens in a new tab)scripts/find-current-session.sh (opens in a new tab)scripts/list-recent-sessions.sh (opens in a new tab)scripts/parse-session.js (opens in a new tab)scripts/plugin-name-detection.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub midnightntwrk/midnight-expert --plugin midnight-expert3 skills in this plugin
/add-to-ecosystemmidnight-expert:add-to-ecosystemThis skill should be used when the user asks to add their project to the Midnight ecosystem, submit to Electric Capital, make a repo eligible for the EC crypto-ecosystems report, register a Midnight project, list a project in the EC report, tag a repo with `midnightntwrk` or `compact` topics, or add the canonical Midnight attribution to a README. Walks through the four Electric Capital eligibility requirements (on GitHub, public, `midnightntwrk` topic, optional `compact` topic), inserts the canonical attribution sentence into README.md, commits, pushes, and opens a PR./doctormidnight-expert:doctorThis skill should be used when the user asks to "check my setup", "run diagnostics", "doctor", "health check", "verify my installation", "are my plugins working", "check plugin status", "what's broken", "fix my setup", "debug my environment", "check dependencies", "environment check", "troubleshoot setup", or invokes /midnight-expert:doctor. Provides comprehensive health reporting for the midnight-expert ecosystem — plugin installation, MCP servers, external tools, cross-plugin references, and NPM registry.Other plugins' skills for the same job