$npx -y skills add lbb00/ai-rules-sync --skill summarize-sessionSummarize the current session and generate reusable Claude rules, skills, or commands.
| 1 | # Summarize Session |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | At the end of a productive coding session, analyze the conversation to extract reusable patterns and generate Claude Code artifacts (rules, skills, commands) that can accelerate future work. |
| 6 | |
| 7 | ## Instructions |
| 8 | |
| 9 | 1. **Review Session Activity** |
| 10 | - What problems were solved? |
| 11 | - What code was written or modified? |
| 12 | - What workflows were performed? |
| 13 | - What decisions were made and why? |
| 14 | |
| 15 | 2. **Identify Patterns** |
| 16 | |
| 17 | **Rules Candidates** (coding standards, project conventions): |
| 18 | - Repeated code style corrections |
| 19 | - Error patterns that were fixed |
| 20 | - Best practices established |
| 21 | - Project-specific conventions |
| 22 | |
| 23 | **Skills Candidates** (multi-step workflows): |
| 24 | - Complex operations performed multiple times |
| 25 | - Sequences of commands that go together |
| 26 | - Integration or deployment workflows |
| 27 | - Testing or validation procedures |
| 28 | |
| 29 | **Commands Candidates** (single-action shortcuts): |
| 30 | - Frequently used command combinations |
| 31 | - Build/test/deploy shortcuts |
| 32 | - Common git operations |
| 33 | - Project-specific utilities |
| 34 | |
| 35 | 3. **Generate Artifacts** |
| 36 | |
| 37 | For each identified pattern, create the appropriate artifact: |
| 38 | |
| 39 | **Rules** → `.claude/rules/<name>/RULE.md` |
| 40 | ```markdown |
| 41 | --- |
| 42 | name: rule-name |
| 43 | description: Brief description |
| 44 | --- |
| 45 | |
| 46 | # Rule Name |
| 47 | |
| 48 | ## When to Apply |
| 49 | ... |
| 50 | |
| 51 | ## Guidelines |
| 52 | ... |
| 53 | ``` |
| 54 | |
| 55 | **Skills** → `.claude/skills/<name>/SKILL.md` |
| 56 | ```markdown |
| 57 | --- |
| 58 | name: skill-name |
| 59 | description: Brief description |
| 60 | --- |
| 61 | |
| 62 | # Skill Name |
| 63 | |
| 64 | ## Instructions |
| 65 | 1. Step 1 |
| 66 | 2. Step 2 |
| 67 | ... |
| 68 | ``` |
| 69 | |
| 70 | **Commands** → `.claude/commands/<name>.md` |
| 71 | ```markdown |
| 72 | # Command Name |
| 73 | |
| 74 | Description of what this command does. |
| 75 | |
| 76 | ## Steps |
| 77 | 1. ... |
| 78 | 2. ... |
| 79 | ``` |
| 80 | |
| 81 | 4. **Validate Artifacts** |
| 82 | - Ensure artifacts are general enough to be reusable |
| 83 | - Remove session-specific details |
| 84 | - Test that instructions are complete and actionable |
| 85 | |
| 86 | 5. **Document Session Summary** |
| 87 | - What was accomplished |
| 88 | - What artifacts were generated |
| 89 | - Recommendations for next session |
| 90 | |
| 91 | ## Output Format |
| 92 | |
| 93 | ```markdown |
| 94 | ## Session Summary |
| 95 | |
| 96 | ### Accomplished |
| 97 | - [List of completed tasks] |
| 98 | |
| 99 | ### Generated Artifacts |
| 100 | |
| 101 | #### Rules |
| 102 | - `<rule-name>`: <description> |
| 103 | |
| 104 | #### Skills |
| 105 | - `<skill-name>`: <description> |
| 106 | |
| 107 | #### Commands |
| 108 | - `<command-name>`: <description> |
| 109 | |
| 110 | ### Next Steps |
| 111 | - [Recommendations for future work] |
| 112 | ``` |
| 113 | |
| 114 | ## Examples |
| 115 | |
| 116 | ### Example: After Adding a New Adapter |
| 117 | |
| 118 | **Identified Pattern**: Multi-step process for adding adapters |
| 119 | **Generated**: Skill `new-adapter` |
| 120 | |
| 121 | ### Example: After Fixing Multiple Type Errors |
| 122 | |
| 123 | **Identified Pattern**: TypeScript strict mode conventions |
| 124 | **Generated**: Rule `typescript-conventions` |
| 125 | |
| 126 | ### Example: After Repeated Test Commands |
| 127 | |
| 128 | **Identified Pattern**: Test-then-commit workflow |
| 129 | **Generated**: Command `test-and-commit` |