mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -982,10 +982,10 @@ export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'chinese-response.md');
|
||||
|
||||
if (!existsSync(userGuidelinesPath)) {
|
||||
return { error: 'Chinese response guidelines file not found at ~/.claude/workflows/chinese-response.md', status: 404 };
|
||||
return { error: 'Chinese response guidelines file not found at ~/.ccw/workflows/chinese-response.md', status: 404 };
|
||||
}
|
||||
|
||||
const guidelinesRef = '~/.claude/workflows/chinese-response.md';
|
||||
const guidelinesRef = '~/.ccw/workflows/chinese-response.md';
|
||||
|
||||
// Configure based on target
|
||||
const isCodex = target === 'codex';
|
||||
@@ -1177,7 +1177,7 @@ export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
if (existsSync(cliToolsUsagePath)) {
|
||||
cliToolsUsageContent = readFileSync(cliToolsUsagePath, 'utf8');
|
||||
} else {
|
||||
return { error: 'CLI tools usage guidelines file not found at ~/.claude/workflows/cli-tools-usage.md', status: 404 };
|
||||
return { error: 'CLI tools usage guidelines file not found at ~/.ccw/workflows/cli-tools-usage.md', status: 404 };
|
||||
}
|
||||
|
||||
const cliToolsJsonPath = join(homedir(), '.claude', 'cli-tools.json');
|
||||
@@ -1213,7 +1213,7 @@ export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
if (existsSync(cliToolsUsagePath)) {
|
||||
cliToolsUsageContent = readFileSync(cliToolsUsagePath, 'utf8');
|
||||
} else {
|
||||
return { error: 'CLI tools usage guidelines file not found at ~/.claude/workflows/cli-tools-usage.md', status: 404 };
|
||||
return { error: 'CLI tools usage guidelines file not found at ~/.ccw/workflows/cli-tools-usage.md', status: 404 };
|
||||
}
|
||||
|
||||
// Read and format cli-tools.json
|
||||
@@ -1304,10 +1304,10 @@ export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'windows-platform.md');
|
||||
|
||||
if (!existsSync(userGuidelinesPath)) {
|
||||
return { error: 'Windows platform guidelines file not found at ~/.claude/workflows/windows-platform.md', status: 404 };
|
||||
return { error: 'Windows platform guidelines file not found at ~/.ccw/workflows/windows-platform.md', status: 404 };
|
||||
}
|
||||
|
||||
const guidelinesRef = '~/.claude/workflows/windows-platform.md';
|
||||
const guidelinesRef = '~/.ccw/workflows/windows-platform.md';
|
||||
|
||||
const windowsRefLine = `- **Windows Platform**: @${guidelinesRef}`;
|
||||
const windowsRefPattern = /^- \*\*Windows Platform\*\*:.*windows-platform\.md.*$/gm;
|
||||
|
||||
@@ -955,10 +955,10 @@ export function updateCodeIndexMcp(
|
||||
|
||||
// Determine target file based on provider
|
||||
const targetFile = provider === 'ace'
|
||||
? '@~/.claude/workflows/context-tools-ace.md'
|
||||
? '@~/.ccw/workflows/context-tools-ace.md'
|
||||
: provider === 'none'
|
||||
? '@~/.claude/workflows/context-tools-none.md'
|
||||
: '@~/.claude/workflows/context-tools.md';
|
||||
? '@~/.ccw/workflows/context-tools-none.md'
|
||||
: '@~/.ccw/workflows/context-tools.md';
|
||||
|
||||
if (!fs.existsSync(globalClaudeMdPath)) {
|
||||
// If global CLAUDE.md doesn't exist, check project-level
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Template Discovery Module
|
||||
*
|
||||
* Provides auto-discovery and loading of CLI templates from
|
||||
* ~/.claude/workflows/cli-templates/
|
||||
* ~/.ccw/workflows/cli-templates/
|
||||
*
|
||||
* Features:
|
||||
* - Scan prompts/ directory (flat structure with category-function.txt naming)
|
||||
|
||||
Reference in New Issue
Block a user