Reflect on the conversation and persist learnings — brain vault notes, skill extraction, or structural enforcement. Use when wrapping up, after mistakes or corrections, after non-obvious debugging, or when significant codebase knowledge was gained. Triggers: /flux:reflect, "reflect", "save this as a skill". Note: "remember X" routes to flux-brain, not here. This skill is for session-wide reflection.
From fluxnpx claudepluginhub nairon-ai/flux --plugin fluxThis skill uses the workspace's default tool permissions.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Review the conversation and persist learnings — to .flux/brain/, as new skills, to existing skill files, or as structural enforcement.
Adapted from brainmaxxing by @poteto, with skill extraction adapted from Claudeception.
On entry, set the session phase:
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}}"
[ ! -d "$PLUGIN_ROOT/scripts" ] && PLUGIN_ROOT=$(ls -td ~/.claude/plugins/cache/nairon-flux/flux/*/ 2>/dev/null | head -1)
FLUXCTL="${PLUGIN_ROOT}/scripts/fluxctl"
$FLUXCTL session-phase set reflect
On completion, reset:
$FLUXCTL session-phase set idle
Before processing learnings, check if an external memory provider is configured:
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}}"
[ ! -d "$PLUGIN_ROOT/scripts" ] && PLUGIN_ROOT=$(ls -td ~/.claude/plugins/cache/nairon-flux/flux/*/ 2>/dev/null | head -1)
FLUXCTL="${PLUGIN_ROOT}/scripts/fluxctl"
EXTERNAL_MEMORY_PROVIDER=$($FLUXCTL config get externalMemory.provider --json 2>/dev/null | jq -r '.value // empty')
EXTERNAL_MEMORY_TOOL=$($FLUXCTL config get externalMemory.tool --json 2>/dev/null | jq -r '.value // empty')
If EXTERNAL_MEMORY_PROVIDER is set, two additional behaviors activate:
Dedup on write — before writing a learning to .flux/brain/, query the external memory MCP to check if it already exists externally. If a close match is found, skip the brain write and log: "Already in {provider} — skipping brain write for: {topic}". This prevents the same insight living in both places.
Personal-scope routing — when a learning is personal/cross-project (not repo-specific), offer to store it in the external provider instead of brain. Use AskUserQuestion:
{
"questions": [{
"question": "This learning seems personal/cross-project. Store in {EXTERNAL_MEMORY_PROVIDER} instead of brain vault?",
"header": "Learning: {one-line summary}",
"multiSelect": false,
"options": [
{"label": "Yes — store in {EXTERNAL_MEMORY_PROVIDER}", "description": "Cross-project, personal, not git-tracked"},
{"label": "No — store in brain vault", "description": "Repo-specific, git-tracked, shared with team"},
{"label": "Skip", "description": "Don't store this learning anywhere"}
]
}]
}
Heuristic for personal vs repo-scoped: A learning is personal if it's about the user's preferences, workflow habits, tool choices, or general engineering patterns that aren't specific to this codebase. A learning is repo-scoped if it references specific files, APIs, architecture, team members, or project decisions.
If EXTERNAL_MEMORY_PROVIDER is NOT set, skip both behaviors — reflect works exactly as before.
.flux/brain/index.md to understand what notes already exist.flux/brain/index.md if any brain files were added or removedNot everything belongs in the brain. Route each learning to where it will have the most impact.
For each learning, ask in order:
.flux/brain/principles/encode-lessons-in-structure.md and docs/review-structuralization.md..flux/brain/.fluxctl..flux/brain/)Codebase knowledge, principles, gotchas — anything that informs future sessions. This is the default destination. Use the flux-brain skill for writing conventions.
[[wikilinks]]..secureskills/ preferred)When a learning meets ALL of these criteria, extract it as a standalone skill:
Criteria:
When to extract:
Process:
Invoke the flux-skill-builder skill autonomously. Pass it the learning context — what was discovered, why it's reusable, and the verified solution from this session. The skill builder handles research, drafting, validation (validate_skills.py), and installation to project-local .secureskills/ through PlaTo when available, with loose .codex/skills/<name>/ mirrors only as fallback.
Do NOT manually create skill files. The skill builder encodes all best practices from docs/skills-best-practices.md and produces validated, trigger-optimized skills with proper progressive disclosure.
Don't extract when:
When the session includes a manual review or engineering-taste review, look specifically for developer-confirmed patterns:
For those, run the structuralization checkpoint from docs/review-structuralization.md:
lintcn ruleDefault new taste-oriented lintcn rules to warn, and escalate to error only for clear anti-patterns or after the codebase has been cleaned up.
.flux/brain/.lintcn rule without developer confirmation that the pattern should be enforced repo-wide.skills/<skill>/)If a learning is about how a specific Flux skill works — its process, prompts, or edge cases — update the skill directly.
Follow-up work that can't be done during reflection — bugs, non-trivial rewrites, tooling gaps. File as a task via fluxctl.
## Reflect Summary
- Brain: [files created/updated, one-line each]
- External memory: [learnings routed to {provider}, one-line each] (only if external memory is configured)
- Dedup skipped: [learnings already in {provider}, one-line each] (only if any were deduped)
- Skills extracted: [new skill files created, one-line each]
- Skills updated: [existing skill files modified, one-line each]
- Structural: [rules/scripts/checks added]
- Todos: [follow-up items filed]
After reflection is complete, check if the brain vault needs maintenance:
PITFALL_COUNT=$(find .flux/brain/pitfalls -name "*.md" 2>/dev/null | wc -l | xargs)
If PITFALL_COUNT >= 20, automatically run /flux:meditate to prune stale content and promote recurring patterns to principles. Do not ask — just run it. If meditate fails, report the error but do not fail the overall reflect. Tell the user:
Brain vault has {PITFALL_COUNT} pitfalls — running meditate to prune and promote...