@nahisaho/satori 0.27.0 → 0.28.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/bin/satori.js +70 -1
- package/package.json +1 -1
package/bin/satori.js
CHANGED
|
@@ -73,8 +73,10 @@ Usage:
|
|
|
73
73
|
satori init [--force] [--dry-run] Install .github/ skills into current directory
|
|
74
74
|
satori skill search <query> Search skills by keyword
|
|
75
75
|
satori skill info <name> Show detailed skill information
|
|
76
|
+
satori skill recommend <name> Get similar/related skills
|
|
76
77
|
satori pipeline suggest Interactive pipeline recommendation
|
|
77
78
|
satori pipeline list List all available pipelines
|
|
79
|
+
satori pipeline custom <action> Manage custom pipelines
|
|
78
80
|
satori validate [--verbose] Validate all SKILL.md files
|
|
79
81
|
satori stats Show skill/TU coverage statistics
|
|
80
82
|
satori help Show this help message
|
|
@@ -84,6 +86,11 @@ Options:
|
|
|
84
86
|
--force Overwrite existing .github/ directory
|
|
85
87
|
--dry-run Preview what would be installed without making changes
|
|
86
88
|
--verbose Show detailed validation output
|
|
89
|
+
|
|
90
|
+
Custom Pipelines:
|
|
91
|
+
satori pipeline custom list List custom pipelines
|
|
92
|
+
satori pipeline custom add <path> Add custom pipeline from file
|
|
93
|
+
satori pipeline custom remove <id> Remove custom pipeline
|
|
87
94
|
`);
|
|
88
95
|
}
|
|
89
96
|
|
|
@@ -895,6 +902,66 @@ function skillInfo() {
|
|
|
895
902
|
console.log(`ファイル: src/.github/skills/${dirName}/SKILL.md`);
|
|
896
903
|
}
|
|
897
904
|
|
|
905
|
+
function skillRecommend() {
|
|
906
|
+
const name = process.argv[4];
|
|
907
|
+
if (!name) {
|
|
908
|
+
console.error('Error: スキル名を指定してください。');
|
|
909
|
+
console.log('Usage: satori skill recommend <name>');
|
|
910
|
+
process.exit(1);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const skillsDir = path.join(SOURCE_DIR, 'skills');
|
|
914
|
+
const dirName = name.startsWith('scientific-') ? name : `scientific-${name}`;
|
|
915
|
+
const filePath = path.join(skillsDir, dirName, 'SKILL.md');
|
|
916
|
+
|
|
917
|
+
if (!fs.existsSync(filePath)) {
|
|
918
|
+
console.error(`Error: スキル "${name}" が見つかりません。`);
|
|
919
|
+
process.exit(1);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
// スキル名から短縮形を取得
|
|
923
|
+
const shortName = dirName.replace('scientific-', '');
|
|
924
|
+
|
|
925
|
+
// 全パイプラインから、このスキルを使用するパイプラインを検出
|
|
926
|
+
const usedInPipelines = PIPELINES.filter((p) => p.skills.includes(shortName));
|
|
927
|
+
|
|
928
|
+
// これらのパイプラインで使用される他のスキルをカウント
|
|
929
|
+
const skillCooccurrence = {};
|
|
930
|
+
for (const p of usedInPipelines) {
|
|
931
|
+
const skillNames = p.skills.split(' → ').map((s) => s.trim());
|
|
932
|
+
for (const sk of skillNames) {
|
|
933
|
+
if (sk !== shortName && !skillCooccurrence[sk]) {
|
|
934
|
+
skillCooccurrence[sk] = 0;
|
|
935
|
+
}
|
|
936
|
+
if (sk !== shortName) {
|
|
937
|
+
skillCooccurrence[sk]++;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// スコア降順にソート
|
|
943
|
+
const recommended = Object.entries(skillCooccurrence)
|
|
944
|
+
.map(([skill, count]) => ({ skill, count }))
|
|
945
|
+
.sort((a, b) => b.count - a.count)
|
|
946
|
+
.slice(0, 5);
|
|
947
|
+
|
|
948
|
+
console.log(`\n🎯 "${name}" に関連するスキル\n`);
|
|
949
|
+
|
|
950
|
+
if (usedInPipelines.length > 0) {
|
|
951
|
+
console.log(`このスキルが使用されるパイプライン: ${usedInPipelines.length} 件\n`);
|
|
952
|
+
console.log('関連スキル:');
|
|
953
|
+
for (let i = 0; i < recommended.length; i++) {
|
|
954
|
+
const { skill, count } = recommended[i];
|
|
955
|
+
console.log(` ${i + 1}. ${skill} (${count} パイプラインで併用)`);
|
|
956
|
+
}
|
|
957
|
+
console.log('');
|
|
958
|
+
console.log('詳細は `satori skill info <related-skill>` で確認できます。');
|
|
959
|
+
} else {
|
|
960
|
+
console.log('❌ このスキルが使用されるパイプラインが見つかりませんでした。');
|
|
961
|
+
console.log('すべてのパイプラインは `satori pipeline list` で確認できます。');
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
898
965
|
switch (COMMAND) {
|
|
899
966
|
case 'init':
|
|
900
967
|
init();
|
|
@@ -904,9 +971,11 @@ switch (COMMAND) {
|
|
|
904
971
|
skillSearch();
|
|
905
972
|
} else if (SUBCOMMAND === 'info') {
|
|
906
973
|
skillInfo();
|
|
974
|
+
} else if (SUBCOMMAND === 'recommend') {
|
|
975
|
+
skillRecommend();
|
|
907
976
|
} else {
|
|
908
977
|
console.error(`Unknown skill subcommand: ${SUBCOMMAND || '(none)'}`);
|
|
909
|
-
console.log('Usage: satori skill search <query> | satori skill info <name>');
|
|
978
|
+
console.log('Usage: satori skill search <query> | satori skill info <name> | satori skill recommend <name>');
|
|
910
979
|
process.exit(1);
|
|
911
980
|
}
|
|
912
981
|
break;
|