From cloverleaf
Invoke the Researcher agent (operation=draftRfc) to populate an RFC body from its brief. Emits zero or more Spike work items from the RFC's unknowns[]. Transitions the RFC drafting → spike-in-flight (if unknowns exist) or drafting → planning (if no unknowns). Usage — /cloverleaf-draft-rfc <RFC-ID>.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cloverleaf:cloverleaf-draft-rfcThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user has invoked this skill with an RFC-ID (e.g., `CLV-009`).
The user has invoked this skill with an RFC-ID (e.g., CLV-009).
Capture <RFC-ID> as $RFC_ID. If missing, report usage and stop.
Load the RFC:
cloverleaf-cli load-rfc <repo_root> <RFC-ID>
Parse the JSON. Verify status === "drafting". If not, report and stop.
Load the discovery config:
CFG=$(cloverleaf-cli discovery-config --repo-root <repo_root>)
DOC_CTX=$(echo "$CFG" | jq -r .docContextUri)
Gather re-draft context (optional — used when re-invoked after spikes):
PRIOR_RFC: the current RFC JSON (for a re-draft, same content)COMPLETED_SPIKES: for each spike ref linked to this RFC (via spike's parent_rfc field), if status === "completed", include its findings/recommendation. Build a JSON array. If none, use [].Find all spikes for this RFC by scanning .cloverleaf/spikes/*.json for files whose parent_rfc.id === $RFC_ID. Use jq. If none, the array is empty.
Dispatch the Researcher subagent via the Task tool:
subagent_type: general-purposemodel: sonnet$(cloverleaf-cli plugin-root)/prompts/researcher.md, with placeholders substituted:
{{operation}} → draftRfc{{brief}} → the RFC's problem field (seeded by /cloverleaf-new-rfc){{doc_context_uri}} → $DOC_CTX{{repo_root}} → absolute path to the current repo{{prior_rfc}} → PRIOR_RFC JSON (or the literal string null for first draft){{completed_spikes}} → COMPLETED_SPIKES JSON array (or []){{spike}} → (unused for draftRfc; substitute null)Parse subagent's response: expected JSON conforming to rfc.schema.json. Required fields: id, type: "rfc", status: "drafting", owner, project, title, problem, solution, unknowns (array of strings), acceptance_criteria, out_of_scope.
If output fails schema validation: bounce. Budget: 3 bounces per invocation. On budget exhaustion: report and stop without advancing state.
Ensure output id === $RFC_ID and project === <original>. If the subagent changed them, override back.
Save the populated RFC:
cloverleaf-cli save-rfc <repo_root> /tmp/rfc-draft-$RFC_ID.json
Inspect rfc.unknowns[]:
If unknowns.length > 0: create one Spike per unknown:
for unknown in rfc.unknowns:
SPIKE_ID=$(cloverleaf-cli next-work-item-id <repo_root> <project>)
cat > /tmp/spike-$SPIKE_ID.json <<EOF
{
"type": "spike",
"project": "<project>",
"id": "$SPIKE_ID",
"status": "pending",
"owner": { "kind": "agent", "id": "researcher" },
"title": "<first 80 chars of unknown>",
"parent_rfc": { "project": "<project>", "id": "$RFC_ID" },
"question": "<unknown>",
"method": "research"
}
EOF
cloverleaf-cli save-spike <repo_root> /tmp/spike-$SPIKE_ID.json
Then transition RFC:
cloverleaf-cli advance-rfc <repo_root> <RFC-ID> spike-in-flight agent
If unknowns.length === 0: transition RFC directly to planning:
cloverleaf-cli advance-rfc <repo_root> <RFC-ID> planning agent
Clean up temp files. Commit state files under .cloverleaf/:
git add .cloverleaf/rfcs/ .cloverleaf/spikes/ .cloverleaf/events/
git commit -m "cloverleaf: draft RFC $RFC_ID + spike emission"
Report: RFC body populated; N spikes created (list IDs); RFC status now spike-in-flight or planning.
/cloverleaf-discover) invokes this plus manages bounces and gates.npx claudepluginhub cloverleaf-org/cloverleaf --plugin cloverleafProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.