@champpaba/claude-agent-kit 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/CLAUDE.md +2 -2
- package/.claude/agents/02-uxui-frontend.md +115 -2
- package/.claude/commands/cdev.md +87 -0
- package/.claude/commands/pageplan.md +6 -6
- package/.claude/contexts/patterns/animation-patterns.md +1 -1
- package/.claude/lib/context-loading-protocol.md +2 -2
- package/.claude/lib/detailed-guides/page-planning.md +1 -1
- package/.claude/lib/task-analyzer.md +1 -1
- package/LICENSE +21 -21
- package/README.md +1278 -1278
- package/bin/cli.js +59 -59
- package/lib/init.js +57 -57
- package/lib/update.js +90 -90
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Claude Agent Kit - CLI Entry Point
|
|
5
|
-
*
|
|
6
|
-
* This is the main CLI file that handles all commands:
|
|
7
|
-
* - cak init → Initialize template in current project
|
|
8
|
-
* - cak update → Update template to latest version
|
|
9
|
-
* - cak --version → Show version
|
|
10
|
-
* - cak --help → Show help
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const { program } = require('commander');
|
|
14
|
-
const chalk = require('chalk');
|
|
15
|
-
const pkg = require('../package.json');
|
|
16
|
-
|
|
17
|
-
// Import command handlers
|
|
18
|
-
const initCommand = require('../lib/init');
|
|
19
|
-
const updateCommand = require('../lib/update');
|
|
20
|
-
|
|
21
|
-
// Configure CLI
|
|
22
|
-
program
|
|
23
|
-
.name('cak')
|
|
24
|
-
.description(chalk.cyan('🤖 Claude Agent Kit - Universal Multi-Agent Template'))
|
|
25
|
-
.version(pkg.version, '-v, --version', 'Show version number');
|
|
26
|
-
|
|
27
|
-
// Command: cak init
|
|
28
|
-
program
|
|
29
|
-
.command('init')
|
|
30
|
-
.description('Initialize Claude Agent Kit template in current project')
|
|
31
|
-
.action(async (options) => {
|
|
32
|
-
try {
|
|
33
|
-
await initCommand(options);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error(chalk.red('❌ Error:'), error.message);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Command: cak update
|
|
41
|
-
program
|
|
42
|
-
.command('update')
|
|
43
|
-
.description('Update template files to latest version')
|
|
44
|
-
.action(async (options) => {
|
|
45
|
-
try {
|
|
46
|
-
await updateCommand(options);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error(chalk.red('❌ Error:'), error.message);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Show help if no command provided
|
|
54
|
-
if (!process.argv.slice(2).length) {
|
|
55
|
-
program.outputHelp();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Parse command line arguments
|
|
59
|
-
program.parse(process.argv);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Claude Agent Kit - CLI Entry Point
|
|
5
|
+
*
|
|
6
|
+
* This is the main CLI file that handles all commands:
|
|
7
|
+
* - cak init → Initialize template in current project
|
|
8
|
+
* - cak update → Update template to latest version
|
|
9
|
+
* - cak --version → Show version
|
|
10
|
+
* - cak --help → Show help
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { program } = require('commander');
|
|
14
|
+
const chalk = require('chalk');
|
|
15
|
+
const pkg = require('../package.json');
|
|
16
|
+
|
|
17
|
+
// Import command handlers
|
|
18
|
+
const initCommand = require('../lib/init');
|
|
19
|
+
const updateCommand = require('../lib/update');
|
|
20
|
+
|
|
21
|
+
// Configure CLI
|
|
22
|
+
program
|
|
23
|
+
.name('cak')
|
|
24
|
+
.description(chalk.cyan('🤖 Claude Agent Kit - Universal Multi-Agent Template'))
|
|
25
|
+
.version(pkg.version, '-v, --version', 'Show version number');
|
|
26
|
+
|
|
27
|
+
// Command: cak init
|
|
28
|
+
program
|
|
29
|
+
.command('init')
|
|
30
|
+
.description('Initialize Claude Agent Kit template in current project')
|
|
31
|
+
.action(async (options) => {
|
|
32
|
+
try {
|
|
33
|
+
await initCommand(options);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error(chalk.red('❌ Error:'), error.message);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Command: cak update
|
|
41
|
+
program
|
|
42
|
+
.command('update')
|
|
43
|
+
.description('Update template files to latest version')
|
|
44
|
+
.action(async (options) => {
|
|
45
|
+
try {
|
|
46
|
+
await updateCommand(options);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(chalk.red('❌ Error:'), error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Show help if no command provided
|
|
54
|
+
if (!process.argv.slice(2).length) {
|
|
55
|
+
program.outputHelp();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Parse command line arguments
|
|
59
|
+
program.parse(process.argv);
|
package/lib/init.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Init Command - Initialize Claude Agent Kit template
|
|
3
|
-
*
|
|
4
|
-
* This function merges the .claude/ template folder into the current project.
|
|
5
|
-
* - Overwrites files with same name
|
|
6
|
-
* - Keeps existing files that don't exist in template
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require('fs-extra');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
const chalk = require('chalk');
|
|
12
|
-
const { promptUser, mergeTemplateFiles } = require('./helpers');
|
|
13
|
-
|
|
14
|
-
module.exports = async function init(options = {}) {
|
|
15
|
-
// Paths
|
|
16
|
-
const templatePath = path.join(__dirname, '../.claude');
|
|
17
|
-
const targetPath = path.join(process.cwd(), '.claude');
|
|
18
|
-
|
|
19
|
-
console.log(chalk.cyan('\n🤖 Claude Agent Kit - Initializing...\n'));
|
|
20
|
-
|
|
21
|
-
// Check if template exists
|
|
22
|
-
if (!fs.existsSync(templatePath)) {
|
|
23
|
-
throw new Error('Template folder not found. Please reinstall the package.');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Check if .claude/ already exists
|
|
27
|
-
if (fs.existsSync(targetPath)) {
|
|
28
|
-
console.log(chalk.yellow('⚠️ .claude/ already exists in this project.'));
|
|
29
|
-
console.log(chalk.gray(' Existing files will be preserved, template files will be merged.\n'));
|
|
30
|
-
|
|
31
|
-
const shouldContinue = await promptUser(
|
|
32
|
-
chalk.cyan('❓ Merge with template files? (y/N): ')
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
if (!shouldContinue) {
|
|
36
|
-
console.log(chalk.gray('\n❌ Initialization cancelled.\n'));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
console.log(chalk.gray('\n📦 Merging template files...\n'));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Merge template files
|
|
44
|
-
try {
|
|
45
|
-
await mergeTemplateFiles(templatePath, targetPath);
|
|
46
|
-
|
|
47
|
-
console.log(chalk.green('✅ Successfully initialized Claude Agent Kit!\n'));
|
|
48
|
-
console.log(chalk.white('📁 Files merged to: ') + chalk.cyan(targetPath));
|
|
49
|
-
console.log(chalk.white('\n📚 Next steps:\n'));
|
|
50
|
-
console.log(chalk.gray(' 1. Review the .claude/ folder'));
|
|
51
|
-
console.log(chalk.gray(' 2. Run: ') + chalk.cyan('/psetup') + chalk.gray(' (one-time project setup)'));
|
|
52
|
-
console.log(chalk.gray(' 3. Start using agents with Claude Code\n'));
|
|
53
|
-
|
|
54
|
-
} catch (error) {
|
|
55
|
-
throw new Error(`Failed to merge template: ${error.message}`);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Init Command - Initialize Claude Agent Kit template
|
|
3
|
+
*
|
|
4
|
+
* This function merges the .claude/ template folder into the current project.
|
|
5
|
+
* - Overwrites files with same name
|
|
6
|
+
* - Keeps existing files that don't exist in template
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs-extra');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const chalk = require('chalk');
|
|
12
|
+
const { promptUser, mergeTemplateFiles } = require('./helpers');
|
|
13
|
+
|
|
14
|
+
module.exports = async function init(options = {}) {
|
|
15
|
+
// Paths
|
|
16
|
+
const templatePath = path.join(__dirname, '../.claude');
|
|
17
|
+
const targetPath = path.join(process.cwd(), '.claude');
|
|
18
|
+
|
|
19
|
+
console.log(chalk.cyan('\n🤖 Claude Agent Kit - Initializing...\n'));
|
|
20
|
+
|
|
21
|
+
// Check if template exists
|
|
22
|
+
if (!fs.existsSync(templatePath)) {
|
|
23
|
+
throw new Error('Template folder not found. Please reinstall the package.');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Check if .claude/ already exists
|
|
27
|
+
if (fs.existsSync(targetPath)) {
|
|
28
|
+
console.log(chalk.yellow('⚠️ .claude/ already exists in this project.'));
|
|
29
|
+
console.log(chalk.gray(' Existing files will be preserved, template files will be merged.\n'));
|
|
30
|
+
|
|
31
|
+
const shouldContinue = await promptUser(
|
|
32
|
+
chalk.cyan('❓ Merge with template files? (y/N): ')
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (!shouldContinue) {
|
|
36
|
+
console.log(chalk.gray('\n❌ Initialization cancelled.\n'));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log(chalk.gray('\n📦 Merging template files...\n'));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Merge template files
|
|
44
|
+
try {
|
|
45
|
+
await mergeTemplateFiles(templatePath, targetPath);
|
|
46
|
+
|
|
47
|
+
console.log(chalk.green('✅ Successfully initialized Claude Agent Kit!\n'));
|
|
48
|
+
console.log(chalk.white('📁 Files merged to: ') + chalk.cyan(targetPath));
|
|
49
|
+
console.log(chalk.white('\n📚 Next steps:\n'));
|
|
50
|
+
console.log(chalk.gray(' 1. Review the .claude/ folder'));
|
|
51
|
+
console.log(chalk.gray(' 2. Run: ') + chalk.cyan('/psetup') + chalk.gray(' (one-time project setup)'));
|
|
52
|
+
console.log(chalk.gray(' 3. Start using agents with Claude Code\n'));
|
|
53
|
+
|
|
54
|
+
} catch (error) {
|
|
55
|
+
throw new Error(`Failed to merge template: ${error.message}`);
|
|
56
|
+
}
|
|
57
|
+
};
|
package/lib/update.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update Command - Update Claude Agent Kit template to latest version
|
|
3
|
-
*
|
|
4
|
-
* This function:
|
|
5
|
-
* 1. Checks for new version in npm registry
|
|
6
|
-
* 2. Optionally updates the global package
|
|
7
|
-
* 3. Merges latest template files into .claude/
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const fs = require('fs-extra');
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const chalk = require('chalk');
|
|
13
|
-
const pkg = require('../package.json');
|
|
14
|
-
const {
|
|
15
|
-
promptUser,
|
|
16
|
-
mergeTemplateFiles,
|
|
17
|
-
getLatestVersion,
|
|
18
|
-
getCurrentVersion,
|
|
19
|
-
installGlobalPackage
|
|
20
|
-
} = require('./helpers');
|
|
21
|
-
|
|
22
|
-
module.exports = async function update(options = {}) {
|
|
23
|
-
const packageName = pkg.name;
|
|
24
|
-
|
|
25
|
-
// Paths
|
|
26
|
-
const templatePath = path.join(__dirname, '../.claude');
|
|
27
|
-
const targetPath = path.join(process.cwd(), '.claude');
|
|
28
|
-
|
|
29
|
-
console.log(chalk.cyan('\n🤖 Claude Agent Kit - Updating...\n'));
|
|
30
|
-
|
|
31
|
-
// Check if .claude/ exists
|
|
32
|
-
if (!fs.existsSync(targetPath)) {
|
|
33
|
-
console.log(chalk.yellow('⚠️ .claude/ not found in this project.'));
|
|
34
|
-
console.log(chalk.gray(' Run init first:\n'));
|
|
35
|
-
console.log(chalk.cyan(' cak init\n'));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// STEP 1: Check version
|
|
40
|
-
console.log(chalk.gray('🔍 Checking for updates...\n'));
|
|
41
|
-
|
|
42
|
-
const currentVersion = getCurrentVersion(packageName) || pkg.version;
|
|
43
|
-
const latestVersion = await getLatestVersion(packageName);
|
|
44
|
-
|
|
45
|
-
if (!latestVersion) {
|
|
46
|
-
console.log(chalk.yellow('⚠️ Unable to check npm registry. Continuing with local version.\n'));
|
|
47
|
-
} else if (currentVersion === latestVersion) {
|
|
48
|
-
console.log(chalk.green(`✅ Already on latest version (${latestVersion})\n`));
|
|
49
|
-
} else {
|
|
50
|
-
console.log(chalk.cyan(`📦 New version available: ${chalk.bold(latestVersion)} (current: ${currentVersion})\n`));
|
|
51
|
-
|
|
52
|
-
const shouldUpdatePackage = await promptUser(
|
|
53
|
-
chalk.cyan('❓ Update package globally first? (y/N): ')
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// STEP 2: Update package globally
|
|
57
|
-
if (shouldUpdatePackage) {
|
|
58
|
-
const success = await installGlobalPackage(packageName, latestVersion);
|
|
59
|
-
|
|
60
|
-
if (!success) {
|
|
61
|
-
console.log(chalk.yellow('⚠️ Package update failed. Continuing with current version.\n'));
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
console.log(chalk.gray('\n⏭️ Skipping package update. Using current version.\n'));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Check if template exists
|
|
69
|
-
if (!fs.existsSync(templatePath)) {
|
|
70
|
-
throw new Error('Template folder not found. Please reinstall the package.');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// STEP 3: Update files (merge mode)
|
|
74
|
-
console.log(chalk.gray('📦 Merging template files...\n'));
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
await mergeTemplateFiles(templatePath, targetPath);
|
|
78
|
-
|
|
79
|
-
console.log(chalk.green('✅ Successfully updated Claude Agent Kit!\n'));
|
|
80
|
-
console.log(chalk.white('📁 Updated files in: ') + chalk.cyan(targetPath));
|
|
81
|
-
console.log(chalk.gray(' (Existing files preserved, template files merged)\n'));
|
|
82
|
-
|
|
83
|
-
console.log(chalk.white('📚 What\'s new:\n'));
|
|
84
|
-
console.log(chalk.gray(' Check CHANGELOG.md for latest changes'));
|
|
85
|
-
console.log(chalk.gray(' Or visit: ') + chalk.cyan('https://github.com/ChampPABA/claude-multi-agent-template\n'));
|
|
86
|
-
|
|
87
|
-
} catch (error) {
|
|
88
|
-
throw new Error(`Failed to update template: ${error.message}`);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Update Command - Update Claude Agent Kit template to latest version
|
|
3
|
+
*
|
|
4
|
+
* This function:
|
|
5
|
+
* 1. Checks for new version in npm registry
|
|
6
|
+
* 2. Optionally updates the global package
|
|
7
|
+
* 3. Merges latest template files into .claude/
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const fs = require('fs-extra');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const chalk = require('chalk');
|
|
13
|
+
const pkg = require('../package.json');
|
|
14
|
+
const {
|
|
15
|
+
promptUser,
|
|
16
|
+
mergeTemplateFiles,
|
|
17
|
+
getLatestVersion,
|
|
18
|
+
getCurrentVersion,
|
|
19
|
+
installGlobalPackage
|
|
20
|
+
} = require('./helpers');
|
|
21
|
+
|
|
22
|
+
module.exports = async function update(options = {}) {
|
|
23
|
+
const packageName = pkg.name;
|
|
24
|
+
|
|
25
|
+
// Paths
|
|
26
|
+
const templatePath = path.join(__dirname, '../.claude');
|
|
27
|
+
const targetPath = path.join(process.cwd(), '.claude');
|
|
28
|
+
|
|
29
|
+
console.log(chalk.cyan('\n🤖 Claude Agent Kit - Updating...\n'));
|
|
30
|
+
|
|
31
|
+
// Check if .claude/ exists
|
|
32
|
+
if (!fs.existsSync(targetPath)) {
|
|
33
|
+
console.log(chalk.yellow('⚠️ .claude/ not found in this project.'));
|
|
34
|
+
console.log(chalk.gray(' Run init first:\n'));
|
|
35
|
+
console.log(chalk.cyan(' cak init\n'));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// STEP 1: Check version
|
|
40
|
+
console.log(chalk.gray('🔍 Checking for updates...\n'));
|
|
41
|
+
|
|
42
|
+
const currentVersion = getCurrentVersion(packageName) || pkg.version;
|
|
43
|
+
const latestVersion = await getLatestVersion(packageName);
|
|
44
|
+
|
|
45
|
+
if (!latestVersion) {
|
|
46
|
+
console.log(chalk.yellow('⚠️ Unable to check npm registry. Continuing with local version.\n'));
|
|
47
|
+
} else if (currentVersion === latestVersion) {
|
|
48
|
+
console.log(chalk.green(`✅ Already on latest version (${latestVersion})\n`));
|
|
49
|
+
} else {
|
|
50
|
+
console.log(chalk.cyan(`📦 New version available: ${chalk.bold(latestVersion)} (current: ${currentVersion})\n`));
|
|
51
|
+
|
|
52
|
+
const shouldUpdatePackage = await promptUser(
|
|
53
|
+
chalk.cyan('❓ Update package globally first? (y/N): ')
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// STEP 2: Update package globally
|
|
57
|
+
if (shouldUpdatePackage) {
|
|
58
|
+
const success = await installGlobalPackage(packageName, latestVersion);
|
|
59
|
+
|
|
60
|
+
if (!success) {
|
|
61
|
+
console.log(chalk.yellow('⚠️ Package update failed. Continuing with current version.\n'));
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
console.log(chalk.gray('\n⏭️ Skipping package update. Using current version.\n'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Check if template exists
|
|
69
|
+
if (!fs.existsSync(templatePath)) {
|
|
70
|
+
throw new Error('Template folder not found. Please reinstall the package.');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// STEP 3: Update files (merge mode)
|
|
74
|
+
console.log(chalk.gray('📦 Merging template files...\n'));
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
await mergeTemplateFiles(templatePath, targetPath);
|
|
78
|
+
|
|
79
|
+
console.log(chalk.green('✅ Successfully updated Claude Agent Kit!\n'));
|
|
80
|
+
console.log(chalk.white('📁 Updated files in: ') + chalk.cyan(targetPath));
|
|
81
|
+
console.log(chalk.gray(' (Existing files preserved, template files merged)\n'));
|
|
82
|
+
|
|
83
|
+
console.log(chalk.white('📚 What\'s new:\n'));
|
|
84
|
+
console.log(chalk.gray(' Check CHANGELOG.md for latest changes'));
|
|
85
|
+
console.log(chalk.gray(' Or visit: ') + chalk.cyan('https://github.com/ChampPABA/claude-multi-agent-template\n'));
|
|
86
|
+
|
|
87
|
+
} catch (error) {
|
|
88
|
+
throw new Error(`Failed to update template: ${error.message}`);
|
|
89
|
+
}
|
|
90
|
+
};
|