Intent Finish
You are helping the user mark an intent as complete.
Workflow
- •Check
~/.claude-intents/in-progress/for intents filtered by current repository:- •Get current repository name:
basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $(pwd) - •List only intents where the folder name contains the current repository name
- •Intent folder format:
YYYY-mm-dd-{repository-name}-{intent-description}
- •Get current repository name:
- •Ask which intent to mark as done (if multiple) or confirm the intent
- •Read the spec.md to understand the intent
- •Generate a summary.md file with a concise summary:
- •Title: Brief, clear title from the spec
- •Problem: Short description of the issue (1-2 sentences from spec's Problem section)
- •Solution: How it was fixed (2-3 bullet points from spec's Solution section)
- •Key Changes: List the main files/components modified
- •Testing: Steps to verify the fix
- •Keep it concise - this is a quick reference, not a copy of the full spec
- •Generate a fix.diff file with the changes made:
- •Run
git difffrom the main/master branch to capture all changes - •Use:
git diff $(git rev-parse --verify main 2>/dev/null || git rev-parse --verify master 2>/dev/null || echo HEAD~10)..HEAD - •If no git repo, skip this step and note that no diff is available
- •Save the raw diff output to
fix.diff
- •Run
- •Ask: "Was a PR created for this intent? If yes, provide the PR URL"
- •Ask: "Any final notes or learnings to document?"
- •Update the spec.md:
- •Change status from "In Progress" to "Completed"
- •Add completion date
- •Add PR link (if provided)
- •Add "## Completion Summary" section with final notes
- •Move the entire intent folder from
~/.claude-intents/in-progress/to~/.claude-intents/done/ - •Confirm the intent has been marked as complete and show the summary.md content
Example spec.md update
diff
- **Status:** In Progress + **Status:** Completed + **Date Completed:** YYYY-MM-DD + **PR:** [Link to PR](url) +## Completion Summary +[Final notes and learnings]
Example summary.md format
markdown
# [Title from spec] ## Problem [Short description of the issue - 1-2 sentences] ## Solution - Change 1 - Change 2 - Change 3 ## Key Changes - `path/to/file1.ts` - Description of change - `path/to/file2.ts` - Description of change ## Testing 1. Step 1 to test 2. Step 2 to test 3. Expected result ## PR [Link to PR](url) (if applicable)
Example fix.diff
The fix.diff file contains the raw git diff output:
diff
diff --git a/src/component.ts b/src/component.ts
index abc123..def456 100644
--- a/src/component.ts
+++ b/src/component.ts
@@ -10,6 +10,8 @@ export function example() {
+ // New code added
+ return result;
}
Important Notes
- •Intents folder: All intents are stored in
~/.claude-intents/ - •Repository filtering: Only show intents that match the current repository name. Get repository name with:
basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $(pwd) - •Intent folder naming format:
YYYY-mm-dd-{repository-name}-{intent-description} - •Search for intents in
~/.claude-intents/in-progress/ - •Move completed intents to
~/.claude-intents/done/ - •Create
~/.claude-intents/done/directory if it doesn't exist - •Preserve all files when moving (spec.md, notes.md, summary.md, fix.diff)
- •Show before/after path for confirmation
- •The summary.md should be an extra short, concise summary - not a copy of the full spec
- •The fix.diff captures all code changes for future reference