chore: quantlab-agent 프로젝트 초기 설정
agent_guide 템플릿 기반으로 프로젝트 구조 설정. Gitea(quantlab-agent), Vikunja(project #15) 연동 완료. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
52
.agent/scripts/extract_skills.js
Normal file
52
.agent/scripts/extract_skills.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const vendorDir = path.join(__dirname, '../vendor');
|
||||
const activeSkillsDir = path.join(__dirname, '../skills');
|
||||
|
||||
const targets = [
|
||||
{ src: path.join(vendorDir, 'superpowers/skills'), type: 'directory_of_skills' },
|
||||
{ src: path.join(vendorDir, 'obsidian-skills/skills'), type: 'directory_of_skills' }
|
||||
];
|
||||
|
||||
let copiedCount = 0;
|
||||
|
||||
if (!fs.existsSync(activeSkillsDir)) {
|
||||
fs.mkdirSync(activeSkillsDir, { recursive: true });
|
||||
}
|
||||
|
||||
targets.forEach(target => {
|
||||
if (fs.existsSync(target.src)) {
|
||||
const items = fs.readdirSync(target.src);
|
||||
items.forEach(item => {
|
||||
const srcPath = path.join(target.src, item);
|
||||
const destPath = path.join(activeSkillsDir, item);
|
||||
|
||||
if (fs.statSync(srcPath).isDirectory()) {
|
||||
// Ensure SKILL.md exists before copying
|
||||
if (fs.existsSync(path.join(srcPath, 'SKILL.md'))) {
|
||||
// Node 16.7+ standard copy
|
||||
fs.cpSync(srcPath, destPath, { recursive: true, force: true });
|
||||
copiedCount++;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Create .gitignore to avoid committing flattened skills to the root repo
|
||||
// This keeps the Zero-Pollution architecture intact!
|
||||
const gitignorePath = path.join(activeSkillsDir, '.gitignore');
|
||||
const gitignoreContent = [
|
||||
'# Auto-generated by extract_skills.js',
|
||||
'*', // Ignore everything by default
|
||||
'!.gitignore', // Track this file
|
||||
'!ui-ux-pro-max/', // Keep manually copied ones
|
||||
'!browser_use/', // Keep if explicitly placed
|
||||
'!mini-swe/',
|
||||
'!gsd-*/' // Essential for tracking auto-generated GSD commands
|
||||
].join('\n');
|
||||
|
||||
fs.writeFileSync(gitignorePath, gitignoreContent, 'utf8');
|
||||
|
||||
console.log(`Successfully extracted and flattened ${copiedCount} internal skills to .agent/skills/`);
|
||||
Reference in New Issue
Block a user