
workflow
Session workflow helpers and deferred-work backlog - knowledge capture, confusion handling, course correction, clipboard copy, backlog items
- GitHub stars
- 497
Install
/plugin install workflow@umputun-cc-thingzRun it inside Claude Code after adding the marketplace with /plugin marketplace add umputun/cc-thingz.
Contents
Discovered from sourceSkills 6
Backlog
docs/backlog/ at a repo root holds work that is real but not being done now: a defect a change did not
introduce, drift with no user-visible symptom, a fix whose blast radius exceeded its value, an idea worth
keeping. One file per item. It is the maintainer's own list — it never gates anything and never reaches a
contributor.
The directory path is fixed, so every invocation in a repo reads and writes one predictable store.
Git only. The lifecycle is expressed in Git — git rm to close an item, branch detection before
writing, staging and committing the file. Outside a Git repository, say so plainly and stop; do not
improvise an equivalent in another VCS.
Item format
docs/backlog/<slug>.md. The slug names the defect, not the file it lives in
(reopen-fallback-ignores-frontmost.md), so it can be cited from a commit and dedupe is a filename check.
---
worth: later
where: internal/window/library.go:537
added: 2026-08-05
---
# reopen fallback ignores the last-frontmost window
`reopen`'s fallback ignores which window was last frontmost once `frontmost` is nil, so a multi-window
user's last-window capture replays only when the exited window happened to be `windows.first`. Surfaced
reviewing PR #370; the fix touches restore ordering, which is why it was deferred rather than done inline.
Three frontmatter fields, written once and rewritten only as Appending below allows:
worth: yes | no | later— the triage call, and the field the list is ordered by:yes— the value is agreed and it should be fixed. Says nothing about schedule: an item blocked on an upstream release is stillyesif nobody disputes it is worth doing.later— the value decision itself is unresolved, not the work. The body must name the unknown or the condition that would settle it; without that it is ayesor anoin disguise.no— a decision not to fix, kept so the same finding is not rediscovered and re-argued by the next review that touches the file. Keep anoonly while that rationale still earns its place; once it does not, delete the file rather than carrying it.
where: path:line— omit when the item is not anchored to one place. Its path narrows the dedupe search alongside the slug and the line is a navigation hint that moves. Compare paths only when both items havewhere; two items missing it are not thereby the same item.added: YYYY-MM-DD— never updated, so it reads as age. A year-old item is itself information. Zero-pad it so the values sort lexically.
The H1 is the title. The body below it has no required sections — repro, what was tried, the review that
surfaced it, links, a snippet, in whatever shape suits. A two-line item stays two lines, a gnarly one gets
a page. Two items owe one sentence each, which a two-line body can carry: a later names the unknown that
would settle its value decision, and a no records why the fix was rejected, without which it cannot do
the anti-rediscovery job it is kept for.
Lifecycle
Create the file. When the work lands, git rm it in the commit that lands the fix — not a separate cleanup
commit. There is no checkbox, no in-progress marker: the staged deletion is the state. Dropping an item
decided against is the same operation with a different reason.
Briefing an item
Both argument forms below put the same four things on screen before asking anything about an item, as
ordinary output rather than inside the AskUserQuestion. The widget covers roughly five lines above
itself, so the question text still names the item and carries the one-line reason for its recommendation.
- Summary — what the item is and why it was filed, in your own words, one or two sentences. Not the H1 restated and not the body pasted back.
- Effort — what the fix costs: the files and call sites it touches, whether a test already covers the path, and whether it is mechanical or a design decision still to be made.
- Blast radius — what else the change can reach. Callers, generated files, anything sharing the code path, and whether it reverts cleanly. "Contained" is a claim about what depends on the code, so check before making it.
- Materiality — who is affected today, how badly, and what leaving it costs. Most items have no user-visible symptom; say so rather than inflating one.
Each of the last three is ONE line carrying a word and the fact behind it — the word alone asks the user
to take the call on trust, the fact is what lets him disagree with it, and the length is what keeps the
briefing readable above its question. Judge all four against the repo as it stands rather than against
the item's own account: the reasoning in a file goes stale the same way its where does.
Every item as the argument
/workflow:backlog --all walks every current item to a disposition. Check this mode before slug handling.
An argument that starts with - is option syntax, so a file whose name begins with - cannot be reached
as a slug; all.md is still an ordinary slug and unaffected.
- Glob
docs/backlog/*.mdfrom the repo root and read every file in full. Keepworth: noitems in the walk: worth informs the recommendation, it does not filter the list. - Before asking anything, verify every
whereand analyze each item's value, complexity, and blockers. Identify explicit blockers and relationships between items, ask about real prerequisites before their dependents, and carry each relationship into EVERY affected item's briefing — a prerequisite's own materiality rises because fixing it unblocks another, so the context runs both ways. The serial flow decides one item at a time, so a relationship is context for a question rather than a joint decision. For a blocker outside the backlog, recommend leaving the item and name the blocker. - Take the items ONE AT A TIME: print that item's briefing, ask about it alone with AskUserQuestion
with the recommended disposition first, carry out the answer, and only then move to the next. Never
brief several items and ask afterwards — a batch of briefings is a wall of text with no decision
attached to any of it, and the answer to one item routinely changes the next. Number them,
item N of M, so the walk's length is visible from the first question. Use the concrete actions from the list flow below rather than a single action for the whole list. - Carry out each answer before asking about the next item. Immediately before an accepted fix or drop
— both mutate, a leave does not — re-read the item and verify its
whereagain, because an earlier fix may have moved or changed it. If that materially changes the recommendation or any part of the briefing, print the updated briefing and ask about that item again — an answer given against a briefing now known to be stale is not an answer to act on. Apply the usual tests, formatters, and linters, andgit rma fixed or dropped item under the lifecycle rule above. - Continue until every item has a disposition. Never auto-commit. If the user later authorizes commits, default to one commit per independent fix with its item deletion; pure drops may share one backlog-only cleanup commit.
A slug as the argument
/workflow:backlog <slug> names one item: docs/backlog/<slug>.md, the file name without its extension. Read
that file alone, verify its where the same way step 2 below does when it has one, print the briefing
above for it, and go straight to the fix-or-drop question — skip the listing, which is not what was
asked for. A slug matching no file is a mistake worth saying plainly: report it and list what is there
instead of guessing at the nearest name.
Reading and working the list
-
Glob
docs/backlog/*.mdfrom the repo root and read each file's frontmatter and H1. If the directory does not exist, say so plainly and offer to start one — do not create it empty. -
Verify before reporting.
wheregoes stale when a file is renamed or a line moves. For each item that has one, check the location still exists and still says what the item claims; report a stale item as stale rather than as work. An item withoutwherehas nothing to verify — carry it through as-is. -
Report every item, one line each —
yesfirst, thenlater, thenno, oldestaddedfirst within each group. Includewherefor the items that have one. Do not editorialize; the item already carries its reasoning. -
Offer concrete actions with AskUserQuestion, never prose, with a recommendation first:
- fix a named item now — name the specific item in the option label, not "fix something";
- drop a named item — a
nowhose rationale has stopped earning its place; - leave it — report only, nothing changes.
With more than four items, group them across several questions rather than truncating the list.
-
On "fix it now": do the work under the usual gates — tests, formatters, linters — and
git rmthe file in the same commit. Never auto-commit.
Appending
When a run produces deferred items, offer to append them; never write silently.
Never add a backlog item to an unrelated work branch. Repo-wide notes dropped into someone else's in-progress branch get swept into that branch's diff or vanish with it. Check the branch before creating the directory or writing any file:
- Detect the repository's default branch: read
git symbolic-ref refs/remotes/origin/HEADand strip therefs/remotes/origin/prefix. If that command fails or returns nothing — it exits non-zero when the ref is not symbolic, which is the usual signal — fall back to two ordered passes withgit rev-parse --verify, remote first and complete before local:refs/remotes/origin/master, thenrefs/remotes/origin/main, thenrefs/remotes/origin/trunk; only if none of the three resolves, tryrefs/heads/master, thenrefs/heads/main, thenrefs/heads/trunk. Never interleave the two passes per candidate — a repo migrated tomaincan keep a stale localmaster, and checking localmasterbefore remotemainpicks the dead branch as the default. Probe the full ref paths, so a tag of the same name cannot answer for a branch. - Compare it with
git branch --show-current. If no default branch was found at all, say so and take the "anywhere else" case below: there is nothing to compare against, so the answer must come from the user rather than from a guess.- On the default branch — write in place.
- Anywhere else — report the current branch by name, or
detached HEAD at <sha>when the command returns nothing, and ask whether to write in this checkout anyway. On yes, write here. On no, change nothing: do not create a branch, a worktree, or a temp checkout, do not switch the current checkout, and do not pick a destination the user did not name.
Dedupe before writing. The where path and the slug find the candidates; what settles it is the defect
each one claims. A shared path is not a duplicate on its own, since one file holds several unrelated defects,
and the trailing line moves with any edit above it. A pre-existing defect surfaces in every
review that touches its file, so the same item arrives repeatedly. If it is already there, say so and leave
it alone. If the new sighting sharpens the description or changes the worth call, edit that file in place
rather than adding a second one.
Create docs/backlog/ if it does not exist — after the branch check above, never before it.
When the files are written, read git diff --cached --name-only before offering anything. Nothing has
been staged yet at that point, so anything it lists is pre-existing — including another backlog file from
an earlier run. If it lists anything at all, do not commit: report what is staged and let the user resolve
it, because a plain git commit would sweep it in alongside the item. With an empty index, offer the next
step with AskUserQuestion, staging the exact paths this invocation created or edited and not the
directory — an item bundled with the run's other changes violates the rule below. Never commit without that
answer. Offer commit and push together: a backlog item is notes with no code in it, and unpushed it stays
invisible from every other machine, so the push is part of filing rather than an upsell.
Rules
- Never post a backlog item to a PR, MR, or issue thread unless the user explicitly asks. These are the maintainer's cleanup notes; surfacing them on a contributor's change reads as scope pressure.
- Never auto-commit an item file, and never commit it alongside unrelated work.
- Do not fix an item without being asked. Reading the backlog is not permission to work it.
- Prefer deleting to demoting for an item nobody will ever do and whose reasoning nobody needs — say
so and offer to drop it. This does not reach a
nothat is still doing its job of stopping a rediscovery; that one stays.
Clarify
Handle user confusion by verifying intent, explaining actual behavior, and determining if there's a real issue.
Primary goal: Clarify and explain, not fix. Most confusion stems from misunderstanding or forgetting, not from bugs.
Activation Triggers
- "confused", "I'm confused", "this is confusing"
- "I don't understand", "doesn't make sense", "makes no sense"
- "wait, shouldn't it...", "but I thought..."
- "why is this happening", "why does this..."
- "I expected X but got Y"
- "this is wrong", "something's off"
- frustration signals, contradictory statements
- questions that reveal misconceptions about system behavior
Important Context
Users often:
- Work on multiple projects in parallel and may confuse behaviors between them
- Forget how things were implemented especially after time away
- Have outdated mental models based on old versions or different projects
- Mix up similar concepts from different codebases or frameworks
But also:
- Users are experienced developers - their instincts are often correct
- Real bugs exist - about half of confusion cases point to actual issues
- User expectations are reasonable - if something feels wrong, investigate thoroughly
Do not assume either way. Investigate before concluding. Both outcomes are equally valid:
- User misremembered/mixed things up -> clarify with evidence
- System has a genuine issue -> proceed to plan mode for fix
Workflow
Phase 1: Identify the Confusion
- Extract the core question - What specifically is the user asking about?
- Identify the expectation - What did the user expect to happen?
- Identify the reality - What is actually happening?
- Locate the gap - Where is the misalignment?
- Consider context mixing - Could user be thinking of a different project/feature?
Categories of confusion:
- Memory gap - user forgot how it works, needs a reminder
- Project mixing - user confused this with another project they're working on
- Outdated mental model - user's understanding is based on old behavior
- Architectural - misunderstanding system design, component relationships, data flow
- Behavioral - expecting different runtime behavior than what occurs
- Configuration - settings not producing expected results
- Documentation - docs don't match implementation or are unclear
- Conceptual - misunderstanding underlying concepts or patterns
- Implementation - code doesn't work as assumed
Phase 2: Investigate
Before explaining, gather evidence:
- Read relevant code - Understand actual implementation
- Check configuration - Verify settings and their effects
- Review documentation - See what's documented vs actual behavior
- Trace the flow - Follow execution path if behavioral confusion
Do not guess or assume. Investigate the actual system state.
Phase 3: Explain (Gently)
Structure the explanation with patience and care:
- Acknowledge the confusion - Validate that it's understandable, confusion is normal
- State the expectation - "You expected X to do Y"
- State the reality - "Actually, X does Z because..."
- Explain why - Provide the reasoning/design decision behind the behavior
- Show evidence - Point to specific code, config, or docs
Tone guidelines:
- Be gentle, not condescending - user may have simply forgotten
- Avoid "you're wrong" framing - use "here's how it actually works"
- If user mixed up projects, clarify without judgment
- Remind that it's easy to forget details when working on multiple things
Keep explanations:
- Concrete, not abstract
- Backed by evidence from the codebase
- Focused on the specific case, not general theory
Phase 4: Assess
Start with the most common cases first:
A) Memory gap - user simply forgot
- User implemented this but forgot how it works
- System is working exactly as designed
- Resolution: gentle reminder with code references
B) Project mixing - wrong mental context
- User is thinking of a different project or codebase
- This project works differently than user's current mental model
- Resolution: clarify which project this is and how it differs
C) Outdated understanding
- System changed since user last worked on it
- Or user's mental model never matched reality
- Resolution: explain current behavior with evidence
D) Documentation issue
- System works correctly but docs are misleading/missing
- Resolution: suggest updating docs, may use EnterPlanMode
E) Configuration issue
- System can do what user expects but isn't configured for it
- Resolution: suggest configuration changes
F) Real issue - design or implementation problem
- User's expectation is reasonable AND system genuinely doesn't meet it
- This indicates a bug, design flaw, or missing feature
- Resolution: MUST proceed to Phase 5
Phase 5: Plan the Fix (for real issues)
If Phase 4 identified a real issue (category F):
Step 1: Summarize and Assess Scope
Explain to user what fixing this involves:
Scope categories:
- Trivial - Simple fix, single file, no side effects
- Localized - Few files, contained to one component
- Moderate - Multiple components affected, requires testing
- Significant - Cross-cutting concern, affects multiple subsystems
- Architectural - Fundamental design change, may require rethinking approach
Be explicit: "This is a [scope] change because [reason]."
User must understand the magnitude before deciding to proceed.
Step 2: Present Options (if multiple approaches exist)
When there are multiple valid solutions, use AskUserQuestion tool to present choices:
- List 2-4 options with clear trade-off descriptions
- Put recommended option first with "(Recommended)" suffix
- Include "Do nothing" as an option when relevant:
- Issue is cosmetic or low-impact
- Workaround exists
- Fix is risky relative to benefit
- Issue is edge case that rarely occurs
- Let user choose the approach
Step 3: Proceed to Plan Mode
After user confirms or selects an approach:
- Use EnterPlanMode - Create implementation plan for the chosen approach
- Plan should reflect the scope assessment from Step 1
CRITICAL: Do not attempt to fix issues without planning. Always use EnterPlanMode for:
- Bug fixes
- Design changes
- Missing features
- Documentation updates that require code understanding
Response Format
## Understanding Your Confusion
**What you expected**: [user's expectation]
**What actually happens**: [actual behavior]
## Why This Happens
[Explanation with evidence - code references, config, docs]
## Assessment
[One of: Not an issue / Documentation issue / Real issue / Configuration issue]
[If real issue]:
This is a real issue that should be addressed. I recommend switching to plan mode to design a proper fix.
Should I enter plan mode to plan the solution?
Guidelines
Mindset:
- Users are experienced developers - trust their instincts
- About half of confusion cases are real issues, half are misunderstandings
- Users work on many projects - confusion between them is normal
- Memory is fallible - be patient when reminding how things work
Approach:
- Never dismiss confusion as "user error" - investigate first
- Never assume something is broken without evidence either
- Always back explanations with evidence from the actual codebase
- If unsure, ask clarifying questions before investigating
- Keep the tone helpful, not condescending
- If the confusion reveals a real problem, treat it as valuable feedback
- Don't over-explain - focus on the specific confusion, not general tutorials
Fixing:
- Investigate first, then determine outcome
- If it's a misunderstanding -> explain clearly with evidence
- If it's a real issue -> proceed to plan mode for fix
- Use EnterPlanMode when investigation confirms a genuine bug/flaw
Learn
Review the current conversation history and identify strategic, reusable project knowledge that should be captured in the project CLAUDE.md file. When the project has opted into Claude Code's three-tier memory convention by creating CLAUDE.local.md, route genuinely personal or environment-specific discoveries there instead.
Analysis Process
-
Review Session History
- Examine all files read and modified during this session
- Identify patterns discovered while working on tasks
- Note architectural insights gained from exploring the codebase
-
Extract Strategic Knowledge
- Filter out tactical details (bug fixes, specific implementations)
- Focus on reusable patterns and project structure
- Identify conventions and architectural decisions
-
Categorize Findings
- Project architecture and structure
- Data flow patterns
- External service integrations
- Project-specific conventions
- Key dependencies and their purposes
- Configuration patterns
- Testing strategies
- Build and deployment processes
- Operational knowledge (debugging, DevOps)
Destinations
This skill writes to one of two files in the project root:
-
CLAUDE.md(project memory, committed, team-shared) — the default destination. Use for architecture, conventions, integration patterns, and any other knowledge useful to the whole team. -
CLAUDE.local.md(local memory, gitignored personal overrides) — used only when both conditions hold:CLAUDE.local.mdalready exists in the project (the project has opted into the three-tier memory convention).- The discovery describes per-developer / per-checkout state — not just mentions something personal, but the knowledge itself is meaningful only to the current developer on this machine. Examples: a tool-loading workaround that depends on this developer's interpreter / runtime setup, a personal alias, a per-checkout env override.
Counter-example: "We keep credentials in
~/.aws/credentials" mentions a user-home path but describes a team-wide convention — the path is illustrative, not per-developer state. Such notes belong in project CLAUDE.md. When in doubt about whether a discovery is genuinely personal, default to project CLAUDE.md.
This skill never writes to the user's global ~/.claude/CLAUDE.md (user memory) — only reads it to avoid duplicating cross-project knowledge.
Default for ambiguous cases: project CLAUDE.md. Leaking personal config into a committed file is a loud error that reviewers catch quickly; hiding project-wide knowledge in a gitignored personal file is a silent error that rots over time.
What Qualifies
INCLUDE - Strategic discoveries from this session:
- Architectural patterns uncovered while working
- Project structure insights gained from navigation
- Conventions noticed across multiple files
- Integration patterns discovered
- Configuration approaches identified
- Testing strategies observed
- Build/deployment processes encountered
- Performance optimizations found
- Security implementations discovered
- Operational knowledge:
- Database locations and connection details per environment
- Useful queries discovered during debugging
- Testing procedures and verification steps
- Deployment workflows and commands
- Log locations and monitoring endpoints
- Environment-specific quirks and gotchas
EXCLUDE - Session-specific tactical work:
- The specific bug we fixed
- The particular feature we implemented
- Temporary workarounds we used
- One-off code changes
- TODO items we encountered
- Historical context about changes
Decision Criteria
Ask yourself for each discovery:
- "Will this help understand the project in 6 months?"
- "Is this a pattern that appears multiple times?"
- "Does this represent a project-wide convention?"
- "Would knowing this speed up future development?"
- "Would this save debugging time in the future?" (for operational knowledge)
Workflow
1. Check for Existing Memory-Placement Guidance
Before applying the routing rules below, scan the project's root CLAUDE.md, any .claude/rules/*.md files, the user's global ~/.claude/CLAUDE.md, and any ~/.claude/rules/*.md files for documented memory-placement guidance — for example, a placement decision tree, an instruction to use a project-specific triage command, or specific destinations beyond CLAUDE.md / CLAUDE.local.md. If such guidance exists, defer to it: follow the documented workflow or place each discovery according to its rules instead of using this skill's defaults. The remaining steps apply only when no such guidance is found.
2. Check Existing Memory Content
Read the current content of project CLAUDE.md, CLAUDE.local.md (if present), and the user's global ~/.claude/CLAUDE.md to avoid duplication — including cross-project entries already captured in user memory.
3. Early Exit if Nothing Found
If no new strategic knowledge was discovered during this session:
- Report "no new strategic knowledge to capture"
- Do NOT use AskUserQuestion tool
- End the skill execution
4. Classify Each Discovery
For each discovery, determine its destination per the Destinations rules: default to project CLAUDE.md, and route to CLAUDE.local.md only when both file-exists and personal-content criteria are met (and the counter-example caveat doesn't apply).
5. New Knowledge to Add
Present discovered knowledge formatted for the chosen destination, tagging each block with its inferred file:
## [Section Name] → project CLAUDE.md
- Discovery 1
- Discovery 2
6. User Confirmation with AskUserQuestion Tool
CRITICAL: Use AskUserQuestion tool for granular selection of what to save.
Build options dynamically based on discoveries:
- First option: "All knowledge" - save everything to its inferred destination
- Last option before custom: "None" - skip saving entirely
- Middle options: Individual knowledge items (up to 2-3 most significant), each labelled with its inferred destination
- User can always type custom selection via "Other"
Example with 3 discoveries (2 project, 1 personal):
question: "Which knowledge should I save?"
options:
- label: "All (3 items)"
description: "Save all discovered patterns to their inferred destinations"
- label: "Service discovery pattern → project CLAUDE.md"
description: "Project-wide convention for how modules find each other"
- label: "Local toolchain variant → CLAUDE.local.md"
description: "Per-checkout build runner override (only relevant on this machine)"
- label: "None"
description: "Skip saving, nothing worth keeping"
Example with 1 discovery:
question: "Save this knowledge?"
options:
- label: "Yes → project CLAUDE.md"
description: "Save: [brief description of the discovery]"
- label: "No"
description: "Skip saving"
After user selection:
- "All" -> save everything to its inferred destination
- "None" -> end without saving
- Specific item -> save only that item, to the inferred destination shown in the label
- "Other" -> user types custom selection of which discoveries to save (comma-separated item names). Destinations follow the labels shown —
"Other"does NOT redirect a destination to an arbitrary path. To override a routing decision, the user should decline the auto-classification, edit the destination file manually, or re-invoke the skill with explicit instructions.
Important Guidelines
- Only capture genuinely new discoveries from this session
- Don't duplicate existing project CLAUDE.md,
CLAUDE.local.md, or user CLAUDE.md content - Focus on patterns observed, not specific code written
- Keep descriptions concise and actionable
- MUST use AskUserQuestion tool for confirmation (not plain text questions)
- If no knowledge found, exit early without asking
- Defer to project- or user-level memory-placement guidance discovered in step 1 — do not override existing conventions with this skill's defaults
Markdown Copy
Extract the final answer from this session, convert it to proper markdown format, and copy to clipboard.
Formatting Rules
- No heading elements (
#,##, etc.) — use bold for section titles instead - Convert any ASCII tables to proper markdown tables
- Use italic for emphasis and minor notes
- Preserve code blocks with proper language tags
- Keep bullet lists and numbered lists
- Remove any leading spaces or bullet headers (bullet-style)
- Give the content a nice descriptive title (as bold text, not heading)
Workflow
- Identify the final answer/response in this session
- Format it according to the rules above
- Write formatted text to a timestamped temp file:
tmpfile="/tmp/claude-md-copy-$(date +%s).txt"
cat > "$tmpfile" << 'EOF'
<formatted content>
EOF
- Copy to clipboard and remove temp file:
if [[ "$OSTYPE" == "darwin"* ]]; then
pbcopy < "$tmpfile"
elif command -v xclip &> /dev/null; then
xclip -selection clipboard < "$tmpfile"
elif command -v xsel &> /dev/null; then
xsel --clipboard --input < "$tmpfile"
else
echo "No clipboard tool found" >&2
fi
rm -f "$tmpfile"
- Report success with character count
Copy Text to Clipboard
Copy generated text content to clipboard via a timestamped temp file.
Activation Triggers
- "copy this", "copy to clipboard", "save to clipboard"
- "copy the email", "copy the message", "copy the letter"
- After generating text content when user indicates they want to use it
- "I need to paste this", "put it in clipboard"
Workflow
-
Identify the text content to copy (from recent generation or user-specified)
-
Write to timestamped temp file:
tmpfile="/tmp/claude-txt-copy-$(date +%s).txt"
cat > "$tmpfile" << 'EOF'
<content here>
EOF
- Copy to clipboard and remove temp file:
if [[ "$OSTYPE" == "darwin"* ]]; then
pbcopy < "$tmpfile"
elif command -v xclip &> /dev/null; then
xclip -selection clipboard < "$tmpfile"
elif command -v xsel &> /dev/null; then
xsel --clipboard --input < "$tmpfile"
else
echo "No clipboard tool found" >&2
fi
rm -f "$tmpfile"
- Confirm to user: "Copied to clipboard (N characters)"
Notes
- Use
catwith heredoc and single-quoted EOF to preserve exact content - Temp file uses timestamp to avoid collisions across invocations
- Temp file is removed after clipboard copy
Wrong — Reset and Re-evaluate
The current approach isn't working as expected. Step back and re-examine the problem from the beginning.
Workflow
Step 1: Re-analyze the Core Problem
State the problem in clear, simple terms. What exactly are we trying to solve?
Step 2: Identify Missing Context
Determine what additional information is needed about:
- The existing codebase and its patterns
- Performance requirements or constraints
- Integration points with other systems
- Expected usage patterns or scale
- Any domain-specific requirements not yet mentioned
Step 3: Propose Fresh Approaches
Suggest 2-3 alternative solutions that:
- Follow project best practices and idioms
- Match the existing code's style and architecture patterns
- Are maintainable and testable
- Solve the exact problem without over-engineering
- Don't use shortcuts or hacks
Step 4: Explain Trade-offs
For each proposed approach, briefly explain:
- Why this approach fits the problem
- What the main benefits and drawbacks are
- How it integrates with the existing codebase
Step 5: Recommend the Best Path Forward
Which approach is most appropriate and why?
Requirements
- Solution must be production-ready, not a proof of concept
- Code should be idiomatic and follow established patterns
- Include comprehensive tests with edge cases
- Provide complete, runnable code with no placeholders
- Ensure the solution is maintainable
Ask clarifying questions before proceeding.
Sponsors
Details
- Marketplace
- umputun/cc-thingz
- Source
- plugins/workflow
- Category
- Community