mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-03 15:43:11 +08:00
Refactor Chinese documentation for team skills and commands
- Removed outdated table of contents from commands-skills.md - Updated skills overview in claude-collaboration.md with new skill names and descriptions - Enhanced clarity and structure of skills details, including roles and pipelines - Added new team skills: team-arch-opt, team-perf-opt, team-brainstorm, team-frontend, team-uidesign, team-issue, team-iterdev, team-quality-assurance, team-roadmap-dev, team-tech-debt, team-ultra-analyze - Improved user command section for better usability - Streamlined best practices for team skills usage
This commit is contained in:
@@ -67,13 +67,9 @@ const THROTTLE_CONFIG = new Map<string, { interval: number; category: ThrottleCa
|
||||
['COORDINATOR_QUESTION_ASKED', { interval: 0, category: 'immediate' }],
|
||||
['COORDINATOR_ANSWER_RECEIVED', { interval: 0, category: 'immediate' }],
|
||||
['LOOP_COMPLETED', { interval: 0, category: 'immediate' }],
|
||||
['LOOP_COMPLETED' as any, { interval: 0, category: 'immediate' }],
|
||||
].filter(([key]) => key !== 'LOOP_COMPLETED' as any)
|
||||
] as const
|
||||
);
|
||||
|
||||
// Add LOOP_COMPLETED separately to avoid type issues
|
||||
THROTTLE_CONFIG.set('LOOP_COMPLETED', { interval: 0, category: 'immediate' });
|
||||
|
||||
/** Per-message-type throttle tracking */
|
||||
const throttleState = new Map<string, ThrottleEntry>();
|
||||
|
||||
@@ -563,36 +559,6 @@ export function parseWebSocketFrame(buffer: Buffer): { opcode: number; payload:
|
||||
return { opcode, payload: payload.toString('utf8'), frameLength };
|
||||
}
|
||||
|
||||
/**
|
||||
* Create WebSocket frame
|
||||
*/
|
||||
export function createWebSocketFrame(data: unknown): Buffer {
|
||||
const payload = Buffer.from(JSON.stringify(data), 'utf8');
|
||||
const length = payload.length;
|
||||
|
||||
let frame;
|
||||
if (length <= 125) {
|
||||
frame = Buffer.alloc(2 + length);
|
||||
frame[0] = 0x81; // Text frame, FIN
|
||||
frame[1] = length;
|
||||
payload.copy(frame, 2);
|
||||
} else if (length <= 65535) {
|
||||
frame = Buffer.alloc(4 + length);
|
||||
frame[0] = 0x81;
|
||||
frame[1] = 126;
|
||||
frame.writeUInt16BE(length, 2);
|
||||
payload.copy(frame, 4);
|
||||
} else {
|
||||
frame = Buffer.alloc(10 + length);
|
||||
frame[0] = 0x81;
|
||||
frame[1] = 127;
|
||||
frame.writeBigUInt64BE(BigInt(length), 2);
|
||||
payload.copy(frame, 10);
|
||||
}
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract session ID from file path
|
||||
*/
|
||||
|
||||
@@ -267,53 +267,37 @@ export class CliHistoryStore {
|
||||
const hasProjectRoot = tableInfo.some(col => col.name === 'project_root');
|
||||
const hasRelativePath = tableInfo.some(col => col.name === 'relative_path');
|
||||
|
||||
// Silent migrations - only log warnings/errors
|
||||
if (!hasCategory) {
|
||||
console.log('[CLI History] Migrating database: adding category column...');
|
||||
this.db.exec(`
|
||||
ALTER TABLE conversations ADD COLUMN category TEXT DEFAULT 'user';
|
||||
`);
|
||||
// Create index separately to handle potential errors
|
||||
this.db.exec(`ALTER TABLE conversations ADD COLUMN category TEXT DEFAULT 'user';`);
|
||||
try {
|
||||
this.db.exec(`CREATE INDEX IF NOT EXISTS idx_conversations_category ON conversations(category);`);
|
||||
} catch (indexErr) {
|
||||
console.warn('[CLI History] Category index creation warning:', (indexErr as Error).message);
|
||||
}
|
||||
console.log('[CLI History] Migration complete: category column added');
|
||||
}
|
||||
|
||||
if (!hasParentExecutionId) {
|
||||
console.log('[CLI History] Migrating database: adding parent_execution_id column...');
|
||||
this.db.exec(`
|
||||
ALTER TABLE conversations ADD COLUMN parent_execution_id TEXT;
|
||||
`);
|
||||
this.db.exec(`ALTER TABLE conversations ADD COLUMN parent_execution_id TEXT;`);
|
||||
try {
|
||||
this.db.exec(`CREATE INDEX IF NOT EXISTS idx_conversations_parent ON conversations(parent_execution_id);`);
|
||||
} catch (indexErr) {
|
||||
console.warn('[CLI History] Parent execution index creation warning:', (indexErr as Error).message);
|
||||
}
|
||||
console.log('[CLI History] Migration complete: parent_execution_id column added');
|
||||
}
|
||||
|
||||
// Add hierarchical storage support columns
|
||||
if (!hasProjectRoot) {
|
||||
console.log('[CLI History] Migrating database: adding project_root column for hierarchical storage...');
|
||||
this.db.exec(`
|
||||
ALTER TABLE conversations ADD COLUMN project_root TEXT;
|
||||
`);
|
||||
this.db.exec(`ALTER TABLE conversations ADD COLUMN project_root TEXT;`);
|
||||
try {
|
||||
this.db.exec(`CREATE INDEX IF NOT EXISTS idx_conversations_project_root ON conversations(project_root);`);
|
||||
} catch (indexErr) {
|
||||
console.warn('[CLI History] Project root index creation warning:', (indexErr as Error).message);
|
||||
}
|
||||
console.log('[CLI History] Migration complete: project_root column added');
|
||||
}
|
||||
|
||||
if (!hasRelativePath) {
|
||||
console.log('[CLI History] Migrating database: adding relative_path column for hierarchical storage...');
|
||||
this.db.exec(`
|
||||
ALTER TABLE conversations ADD COLUMN relative_path TEXT;
|
||||
`);
|
||||
console.log('[CLI History] Migration complete: relative_path column added');
|
||||
this.db.exec(`ALTER TABLE conversations ADD COLUMN relative_path TEXT;`);
|
||||
}
|
||||
|
||||
// Add missing timestamp index for turns table (for time-based queries)
|
||||
@@ -324,9 +308,7 @@ export class CliHistoryStore {
|
||||
`).get();
|
||||
|
||||
if (!indexExists) {
|
||||
console.log('[CLI History] Adding missing timestamp index to turns table...');
|
||||
this.db.exec(`CREATE INDEX IF NOT EXISTS idx_turns_timestamp ON turns(timestamp DESC);`);
|
||||
console.log('[CLI History] Migration complete: turns timestamp index added');
|
||||
}
|
||||
} catch (indexErr) {
|
||||
console.warn('[CLI History] Turns timestamp index creation warning:', (indexErr as Error).message);
|
||||
@@ -353,15 +335,11 @@ export class CliHistoryStore {
|
||||
}
|
||||
}
|
||||
|
||||
// Batch migration - only output log if there are columns to migrate
|
||||
// Batch migration - silent
|
||||
if (missingTurnsColumns.length > 0) {
|
||||
console.log(`[CLI History] Migrating turns table: adding ${missingTurnsColumns.length} columns (${missingTurnsColumns.join(', ')})...`);
|
||||
|
||||
for (const col of missingTurnsColumns) {
|
||||
this.db.exec(`ALTER TABLE turns ADD COLUMN ${col} ${turnsColumnDefs[col]};`);
|
||||
}
|
||||
|
||||
console.log('[CLI History] Migration complete: turns table updated');
|
||||
}
|
||||
|
||||
// Add transaction_id column to native_session_mapping table for concurrent session disambiguation
|
||||
@@ -369,16 +347,12 @@ export class CliHistoryStore {
|
||||
const hasTransactionId = mappingInfo.some(col => col.name === 'transaction_id');
|
||||
|
||||
if (!hasTransactionId) {
|
||||
console.log('[CLI History] Migrating database: adding transaction_id column to native_session_mapping...');
|
||||
this.db.exec(`
|
||||
ALTER TABLE native_session_mapping ADD COLUMN transaction_id TEXT;
|
||||
`);
|
||||
this.db.exec(`ALTER TABLE native_session_mapping ADD COLUMN transaction_id TEXT;`);
|
||||
try {
|
||||
this.db.exec(`CREATE INDEX IF NOT EXISTS idx_native_transaction_id ON native_session_mapping(transaction_id);`);
|
||||
} catch (indexErr) {
|
||||
console.warn('[CLI History] Transaction ID index creation warning:', (indexErr as Error).message);
|
||||
}
|
||||
console.log('[CLI History] Migration complete: transaction_id column added');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[CLI History] Migration error:', (err as Error).message);
|
||||
|
||||
Reference in New Issue
Block a user