一键导入
pattern-sharing
AI-assisted workflow for sharing personal patterns with the team. Detects valuable patterns, checks duplicates, and guides sharing decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
AI-assisted workflow for sharing personal patterns with the team. Detects valuable patterns, checks duplicates, and guides sharing decisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pattern-sharing |
| description | AI-assisted workflow for sharing personal patterns with the team. Detects valuable patterns, checks duplicates, and guides sharing decisions. |
Trigger words:
Use this skill when:
Relationship to aiknowsys learn command:
learn command: Create new patterns (personal or learned)learn creates patterns, skill shares them laterlearn = capture knowledge, pattern-sharing = distribute knowledgeWhen NOT to use this skill:
Before starting, ensure:
.aiknowsys/personal/<username>/ directory exists (user's personal patterns).aiknowsys/learned/ directory exists (create if missing)Required knowledge:
Goal: Determine which pattern(s) the user wants to share
Scenario A: Agent suggests sharing (proactive)
Agent: "I noticed we're handling API rate limiting repeatedly. I've created
a learned pattern: .aiknowsys/personal/<username>/api-rate-limiting.md
This seems valuable for the team (used 8 times today). Would you like me to
share it with the team?"
Actions:
Scenario B: User requests sharing
User: "share my patterns" or "what patterns can I share?"
Actions:
.aiknowsys/personal/<username>/ directory.md files"You have 5 personal patterns:
HIGH VALUE (used frequently):
• api-rate-limiting.md - Created Jan 15, used 12 times
• error-recovery-strategy.md - Created Jan 20, used 8 times
RECENT (created within last week):
• vue-composable-lifecycle.md - Created yesterday
EXPERIMENTAL (low usage):
• temp-debugging-notes.md - Created today, used once
• webgl-experiment.md - Created Jan 10, used once
Which would you like to share?"
User responses:
Goal: Avoid creating duplicate patterns in learned/
Actions:
.aiknowsys/learned/ directoryDuplicate detection logic:
function checkDuplicates(newPattern, learnedPatterns) {
const newTitle = extractTitle(newPattern);
const newKeywords = extractKeywords(newPattern);
for (const learned of learnedPatterns) {
const learnedTitle = extractTitle(learned);
const learnedKeywords = extractKeywords(learned);
// Exact title match
if (titleSimilarity(newTitle, learnedTitle) > 0.8) {
return { isDuplicate: true, pattern: learned, confidence: 'high' };
}
// Keyword overlap
const overlap = keywordOverlap(newKeywords, learnedKeywords);
if (overlap > 0.6) {
return { isDuplicate: true, pattern: learned, confidence: 'medium' };
}
}
return { isDuplicate: false };
}
If unique pattern (no duplicates):
If duplicate found:
"Similar pattern exists: api-retry-strategy.md
Your pattern: API Rate Limiting
- Focuses on backoff algorithms
- Created Jan 15, 2026
- 150 lines
Existing team pattern: API Retry Strategy
- Focuses on circuit breakers
- Created by jane-smith, Dec 2025
- 120 lines
These seem related but have different focuses. Would you like to:
1. **Merge them** - Combine both approaches into one comprehensive pattern
2. **Keep separate** - Different focus areas, both valuable
3. **Cancel** - Review manually and decide later
User chooses:
Goal: Transfer pattern from personal/ to learned/ directory
File operations:
1. Read pattern content:
- Source: `.aiknowsys/personal/<username>/<pattern-name>.md`
2. Update frontmatter:
- Add `shared_by: <username>`
- Add `shared_date: <YYYY-MM-DD>`
- Preserve existing frontmatter (type, created, tags)
3. Write to learned:
- Destination: `.aiknowsys/learned/<pattern-name>.md`
4. Handle original file (user preference):
- **Default:** Delete from personal/ (pattern now belongs to team)
- **Option:** Keep copy in personal/ (user's reference)
Example frontmatter transformation:
Before (personal/):
---
type: error_resolution
created: 2026-01-15
tags: [api, rate-limiting, backoff]
---
After (learned/):
---
type: error_resolution
created: 2026-01-15
shared_by: arno-paffen
shared_date: 2026-02-03
tags: [api, rate-limiting, backoff]
---
Validation:
# Verify file was written successfully
cat .aiknowsys/learned/<pattern-name>.md
# Confirm frontmatter is valid YAML
# Check that content is intact
# Verify no data loss from move operation
Goal: Inform user of successful sharing
Agent response:
"✅ Pattern shared successfully!
📁 Location: .aiknowsys/learned/api-rate-limiting.md
👥 Teammates will see it after pulling from git
💡 Tip: Consider committing this now:
git add .aiknowsys/learned/api-rate-limiting.md
git commit -m 'Add learned pattern: API Rate Limiting'
Would you like me to create a session note about this?"
Optional: Update session file
Session files track work across multiple tasks (see AGENTS.md for details).
If session file exists (.aiknowsys/sessions/YYYY-MM-DD-session.md):
## Pattern Sharing (HH:MM)
**Shared:** api-rate-limiting.md
**From:** personal/arno-paffen/
**To:** learned/
**Reason:** Frequently used (12 times), solves recurring API throttling issues
**Next steps:**
- Team members pull to see pattern
- Consider adding to docs if widely applicable
If no session file exists, consider creating one for complex multi-task work. See: AGENTS.md
Goal: Intelligently combine two related patterns
Actions if user chose "Merge":
5.1 Analyze Both Patterns
Reading both patterns...
YOUR PATTERN (api-rate-limiting.md):
- Section 1: Overview
- Section 2: Exponential Backoff Algorithm
- Section 3: Implementation in Python
- Section 4: Testing Strategy
- Unique content: 80% (algorithms, Python code)
TEAM PATTERN (api-retry-strategy.md):
- Section 1: Problem Description
- Section 2: Circuit Breaker Pattern
- Section 3: Implementation in JavaScript
- Section 4: Monitoring
- Unique content: 70% (circuit breakers, JS code)
OVERLAP: 30% (problem description, general concepts)
5.2 Propose Merge Structure
"I can merge these patterns. Here's my proposal:
COMBINED PATTERN: API Retry & Rate Limiting Strategy
Structure:
1. **Overview** (merged from both)
2. **Problem Description** (from team pattern)
3. **Rate Limiting Strategies** (from your pattern)
- Exponential Backoff Algorithm
- Implementation in Python
4. **Circuit Breaker Pattern** (from team pattern)
- Implementation in JavaScript
5. **Testing Strategy** (from your pattern)
6. **Monitoring** (from team pattern)
7. **Best Practices** (combined recommendations)
This creates a comprehensive guide covering both approaches.
Options:
- **Apply merge** - Save merged pattern to learned/
- **Show preview** - Display full merged content first
- **Cancel** - Keep patterns separate after all
5.3 Execute Merge (if user approves)
1. Combine content sections intelligently:
- Preserve all unique content
- Merge overlapping sections (keep best explanations)
- Maintain code examples from both languages
2. Update frontmatter:
---
type: combined_pattern
created: 2025-12-01 # From original team pattern
updated: 2026-02-03
authors: [jane-smith, arno-paffen]
merged_from: [api-retry-strategy.md, api-rate-limiting.md]
tags: [api, rate-limiting, circuit-breaker, retry, backoff]
---
3. Save merged version:
- Destination: .aiknowsys/learned/api-retry-rate-limiting.md
4. Archive originals (optional):
- Move to .aiknowsys/learned/archive/ (if user wants history)
- Or delete (merged content preserves everything)
5.4 Confirm Merge Success
"✅ Patterns merged successfully!
📁 New combined pattern: .aiknowsys/learned/api-retry-rate-limiting.md
👥 Authors: jane-smith, arno-paffen
📊 Size: 320 lines (was 150 + 120)
The merged pattern includes:
- Both Python and JavaScript implementations
- Backoff algorithms AND circuit breakers
- Comprehensive testing and monitoring guidance
Original patterns archived to learned/archive/ (if you need to reference them).
Would you like me to notify jane-smith about this merge?"
Goal: Proactively suggest sharing valuable patterns before session ends
Trigger: User says "done", "that's all", or session timeout approaching
Actions:
1. Check `.aiknowsys/personal/<username>/` for unshared patterns
2. Analyze each pattern:
- How many times referenced in current session?
- How recently created?
- File size (larger = more invested)
- Keywords suggest importance?
3. If 2+ valuable patterns exist, suggest:
Example suggestion:
Agent: "Before we finish, I noticed you have 3 personal patterns that could
benefit the team:
HIGH VALUE (used today):
• api-rate-limiting.md - Used 8 times during debugging
• error-recovery.md - Used 12 times in error handling
RECENT (created this week):
• database-pooling.md - Created 3 days ago, solid implementation
These seem valuable. Would you like to share any before we wrap up?"
User responses:
User: "share the database optimization pattern"
Agent searches personal/, doesn't find match:
"I couldn't find 'database optimization' in your personal patterns.
Your personal patterns:
• api-rate-limiting.md
• error-recovery.md
• vue-composable-lifecycle.md
Did you mean one of these? Or would you like to create a new pattern first?"
User: "share my patterns"
Agent checks personal/ directory, it's empty:
"You don't have any personal patterns yet.
Personal patterns are created using the 'learn' workflow when you document
solutions, workarounds, or discoveries during development.
Would you like to create a pattern now? I can help you document something
from this session."
First time sharing in new project:
"The .aiknowsys/learned/ directory doesn't exist yet.
This is normal for new projects. I'll create it now and share your pattern."
[Create .aiknowsys/learned/]
[Create .aiknowsys/learned/README.md if needed]
[Proceed with sharing]
File operations fail due to permissions:
"❌ I couldn't write to .aiknowsys/learned/ (permission denied).
This might happen if:
- Directory is read-only
- File is locked by another process
- Insufficient permissions
Try:
1. Check file permissions: ls -la .aiknowsys/learned/
2. Run: chmod +w .aiknowsys/learned/
3. Close any editors with the file open
Then try sharing again."
User: "share the API retry pattern"
Agent:
api-retry-pattern.mdOutput:
✅ Pattern shared successfully!
📁 Location: .aiknowsys/learned/api-retry-pattern.md
👥 Team will see it after pulling
Suggested commit:
git add .aiknowsys/learned/api-retry-pattern.md
git commit -m "Add learned pattern: API Retry Strategy"
User: "share the database pooling pattern"
Agent:
personal/arno/database-pooling.mdlearned/database-connection-pool.md (similar!)Asks user:
"Similar pattern exists: database-connection-pool.md
Both patterns focus on database connection management, but:
YOUR pattern: Focuses on PostgreSQL connection pooling with pg-pool
TEAM pattern: Focuses on MySQL connection pooling with mysql2
These are related but different implementations. Options:
1. Merge (combine PostgreSQL + MySQL examples)
2. Keep separate (different databases deserve separate guides)
3. Cancel
What would you like to do?"
User: "keep separate"
Agent:
"✅ Keeping patterns separate.
Your pattern will be shared as:
.aiknowsys/learned/database-pooling-postgresql.md
(Added 'postgresql' to distinguish from existing MySQL pattern)
Team now has both PostgreSQL and MySQL pooling guides!"
User: "share the error handling pattern"
Agent detects duplicate:
"Found similar pattern: error-recovery-strategy.md
Both patterns cover error handling, with ~70% overlap.
Would you like to merge them?"
User: "yes, merge"
Agent:
✅ Patterns merged!
📁 New pattern: .aiknowsys/learned/error-handling-comprehensive.md
👥 Authors: arno-paffen, jane-smith
📊 Combined: 250 lines (was 120 + 150)
Includes:
- Error catching fundamentals (merged)
- Retry logic with backoff (from your pattern)
- User notification strategies (from team pattern)
- Logging best practices (from your pattern)
- Transaction rollback (from team pattern)
Original patterns archived to learned/archive/
User: "what should I share?"
Agent:
"You have 7 personal patterns. Let me analyze which are most valuable:
🌟 HIGH PRIORITY (share recommended):
• api-rate-limiting.md
- Used 12 times this week
- Solves recurring throttling issues
- Well-documented with examples
• error-recovery-strategy.md
- Used 8 times today
- Critical for production stability
- Clear implementation steps
⭐ MEDIUM PRIORITY (consider sharing):
• vue-composable-lifecycle.md
- Created yesterday, still evolving
- Good examples but might need refinement
• database-query-optimization.md
- Used 3 times last month
- Valuable but less urgent
🔍 LOW PRIORITY (probably don't share yet):
• temp-debugging-notes.md
- Used once, seems temporary
- Might be session-specific
• experiment-webgl-shaders.md
- Experimental code, not finalized
• wip-authentication-flow.md
- Work in progress (has TODO markers)
Recommendation: Share the 2 high-priority patterns now, and maybe the Vue
composable one if you've refined it.
What would you like to do?"
User: "share high priority ones"
Agent:
Output:
✅ Shared 2 high-priority patterns!
📁 New team patterns:
- .aiknowsys/learned/api-rate-limiting.md
- .aiknowsys/learned/error-recovery-strategy.md
Teammates will see these after pulling. Consider committing:
git add .aiknowsys/learned/*.md
git commit -m "Add 2 learned patterns: API rate limiting, Error recovery"
Problem: Agent shares pattern without checking learned/, creating duplicate
Symptom: Team has two nearly identical patterns with different names
Solution:
Example:
// ❌ Wrong - Skip duplicate check
async function sharePattern(patternName) {
moveToLearned(patternName);
}
// ✅ Correct - Always check first
async function sharePattern(patternName) {
const duplicates = await checkDuplicates(patternName);
if (duplicates.found) {
askUserWhatToDo(duplicates);
} else {
moveToLearned(patternName);
}
}
Problem: Delete source file before verifying write succeeded
Symptom: Pattern disappears from both personal/ and learned/
Solution:
Example:
// ❌ Wrong - Delete before verifying write
await fs.unlink(personalPath);
await fs.writeFile(learnedPath, content);
// ✅ Correct - Verify write, then delete
await fs.writeFile(learnedPath, content);
const written = await fs.readFile(learnedPath, 'utf-8');
if (written === content) {
await fs.unlink(personalPath); // Safe to delete now
}
Problem: Merge creates confusing pattern with duplicate sections
Symptom: Merged pattern harder to read than originals
Solution:
Example:
❌ Wrong - Just concatenate both patterns:
# Error Handling
(Content from pattern 1)
# Error Handling
(Content from pattern 2) # Duplicate section!
✅ Correct - Intelligent merge:
# Error Handling
(Combined best explanations from both)
## Retry Logic (from pattern 1)
## User Notifications (from pattern 2)
If sharing goes wrong:
Restore from personal/ (if still exists):
# If move failed but personal copy still there
# Just verify learned/ version
cat .aiknowsys/learned/<pattern>.md
Restore from git (if committed):
# Undo last commit
git reset HEAD~1
# Or restore specific file
git checkout HEAD~1 -- .aiknowsys/learned/<pattern>.md
Restore from backup (if kept):
# Copy back from personal backup
cp .aiknowsys/personal/<user>/<pattern>.md .aiknowsys/learned/
Verification after rollback:
# Check pattern still in personal/
ls -la .aiknowsys/personal/<user>/
# Verify learned/ doesn't have broken version
cat .aiknowsys/learned/<pattern>.md
Related documentation:
Related skills:
External resources:
Part of AIKnowSys multi-developer collaboration system. Enables team knowledge sharing through AI-assisted pattern distribution.
Archive completed plans and clean workspace using CLI commands
Query up-to-date 3rd-party framework/library documentation using Context7 MCP
Create and modify AIKnowSys sessions and plans using mutation commands
Query AIKnowSys knowledge system (READ operations only - plans, sessions, context search)
Review AIKnowSys deliverables (skills, stack templates, documentation) using Context7 MCP for current framework documentation. Use for monthly quality reviews, pre-release validation, or when frameworks release major versions.
Template for creating new skills following VS Code Agent Skills standard