用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Fadil369/Solutions --skill offline-sync-engine命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | Offline Sync Engine |
| version | 1.0.0 |
| description | Handles offline data synchronization with conflict resolution and progressive sync. |
| author | workspace |
| activated | false |
Manages offline data storage and synchronization when connectivity returns.
| Pattern | Conflict Strategy | Best For |
|---|---|---|
| Last-write-wins | Timestamp comparison | Simple data |
| Operational transform | Transform operations | Collaborative text |
| CRDT | Merge all changes | Distributed systems |
| Manual merge | User resolves | Critical data |
┌─────────────────────────────────────┐
│ Application Layer │
├─────────────────────────────────────┤
│ Sync Queue (pending changes) │
├─────────────────────────────────────┤
│ Local Cache (IndexedDB/SQLite) │
├─────────────────────────────────────┤
│ Conflict Resolution │
├─────────────────────────────────────┤
│ Remote API │
└─────────────────────────────────────┘
class SyncQueue {
constructor() {
this.pending = [];
this.failed = [];
}
add(change) {
this.pending.push({
id: generateId(),
operation: change.operation,
data: change.data,
timestamp: Date.now(),
retries: 0
});
}
async flush() {
while (this.pending.length > 0) {
const change = this.pending[0];
try {
await this.sendToServer(change);
this.pending.shift();
} catch (error) {
change.retries++;
if (change.retries >= 3) {
this.failed.push(..());
}
;
}
}
}
}
class ConflictResolver {
resolve(local, remote, strategy = 'last-write-wins') {
switch(strategy) {
case 'last-write-wins':
return local.updatedAt > remote.updatedAt ? local : remote;
case 'merge':
return this.deepMerge(local, remote);
case 'manual':
throw new ConflictError(local, remote);
}
}
}
| Error Type | Strategy | Recovery |
|---|---|---|
| Network timeout | Retry with backoff | Auto |
| Conflict | Merge strategy | Auto/Manual |
| Auth expired | Refresh token | Auto |
| Data corruption | Rollback + alert | Manual |
Provides accessible UI component patterns with ARIA attributes, keyboard navigation, and screen reader support.
Builds robust API clients with retry logic, caching, error handling, and request/response transformation.
Designs secure authentication flows including OAuth2, OIDC, MFA, session management, and password reset patterns.
基于 SOC 职业分类