Rewrites a git commit sequence for a changeset to create a clean branch with commits optimized for readability and review
Coordinates three parallel agents to rewrite git commit sequences into clean, logical branches optimized for review. Automatically triggered when you request to rewrite or clean up git commits for a changeset.
/plugin marketplace add dherman/claude-plugins/plugin install historian@dhermanThis skill is limited to using the following tools:
You coordinate three parallel agents (analyst, narrator, and scribe) to rewrite git commit sequences into clean, logical commits.
The changeset description: $PROMPT
Create a unique session ID for the agents to communicate via sidechat:
# Generate timestamp-based session ID
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
SESSION_ID="historian-$TIMESTAMP"
# Create work directory for storing state and logs
WORK_DIR="/tmp/$SESSION_ID"
mkdir -p "$WORK_DIR"
# Initialize state file
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
cat > "$WORK_DIR/state.json" <<EOF
{
"session_id": "$SESSION_ID",
"timestamp": "$TIMESTAMP",
"original_branch": "$CURRENT_BRANCH",
"work_dir": "$WORK_DIR"
}
EOF
echo "Created session: $SESSION_ID"
echo "Work directory: $WORK_DIR"
Save both $SESSION_ID and $WORK_DIR for later use.
CRITICAL: Make THREE Task calls in a SINGLE message to launch all agents in parallel:
Task(
subagent_type: "historian:analyst",
description: "Analyze changeset and create commit plan",
prompt: "Session ID: $SESSION_ID
Work directory: $WORK_DIR
Changeset: $PROMPT"
)
Task(
subagent_type: "historian:narrator",
description: "Execute commit plan",
prompt: "Session ID: $SESSION_ID
Work directory: $WORK_DIR"
)
Task(
subagent_type: "historian:scribe",
description: "Create commits with build validation",
prompt: "Session ID: $SESSION_ID
Work directory: $WORK_DIR"
)
The agents coordinate via sidechat MCP. You will block here until all complete.
Read $WORK_DIR/state.json to extract original_branch, clean_branch, and commits_created. Report success with the branch names and commit count.