Skip to content

Commit acdf4ba

Browse files
committed
wip
1 parent 4d9d000 commit acdf4ba

83 files changed

Lines changed: 627 additions & 48758 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ModuleConfig.cfc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ component {
1313
this.cfmapping = "coldbox-cli";
1414

1515
function configure(){
16-
variables.settings = { templatesPath : modulePath & "/templates" }
16+
variables.settings = {
17+
templatesPath : modulePath & "/templates",
18+
skillsRegistryUrl : "https://skills.boxlang.io",
19+
coldboxSkillsRepo : { owner : "coldbox", repo : "skills" },
20+
boxlangSkillsRepo : { owner : "ortus-boxlang", repo : "skills" },
21+
ortusSkillsRepo : { owner : "ortus-solutions", repo : "skills" }
22+
}
1723
}
1824

1925
function onLoad(){

commands/coldbox/ai/skills/create.cfc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Create a custom skill template
3-
* Scaffolds a new skill in .ai/skills/custom/
3+
* Scaffolds a new skill in .ai/skills/{name}/
44
*
55
* Examples:
66
* coldbox ai skills create api-development
@@ -35,12 +35,15 @@ component extends="coldbox-cli.models.BaseAICommand" {
3535
// Determine language (cfml flag overrides boxlang)
3636
var language = arguments.cfml ? "cfml" : "boxlang"
3737

38+
// Replace spaces with dashes for skill name
39+
arguments.name = arguments.name.replaceAll( "\s+", "-" )
40+
3841
print.line()
3942
printInfo( "Creating custom skill: #arguments.name# (#uCase( language )#)" )
4043
print.line()
4144

4245
// Check if already exists
43-
var skillPath = "#arguments.directory#/.ai/skills/custom/#arguments.name#/SKILL.md"
46+
var skillPath = "#arguments.directory#/.ai/skills/#arguments.name#/SKILL.md"
4447
if ( fileExists( skillPath ) ) {
4548
printError( "Skill '#arguments.name#' already exists at:" )
4649
printError( " #skillPath#" )
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/**
2+
* Search the skills registry and display matching skills.
3+
* Use this to discover skills before installing them.
4+
*
5+
* Examples:
6+
* coldbox ai skills find
7+
* coldbox ai skills find testing
8+
* coldbox ai skills find --owner=ortus-boxlang
9+
* coldbox ai skills find --owner=coldbox --repo=skills
10+
* coldbox ai skills find boxlang --owner=ortus-boxlang
11+
*/
12+
component extends="coldbox-cli.models.BaseAICommand" {
13+
14+
// DI
15+
property name="skillManager" inject="SkillManager@coldbox-cli";
16+
17+
/**
18+
* Run the command
19+
*
20+
* @query Optional search term to filter skill names or descriptions.
21+
* @owner Filter by GitHub owner/org (defaults to both ortus-boxlang and coldbox).
22+
* @repo Filter by GitHub repo (requires --owner when specified).
23+
* @category Filter by skill category.
24+
* @directory The target directory (defaults to current directory).
25+
*/
26+
function run(
27+
string query = "",
28+
string owner = "",
29+
string repo = "",
30+
string category = "",
31+
string directory = getCwd()
32+
){
33+
showColdBoxBanner( "Find AI Skills" )
34+
ensureInstalled( arguments.directory )
35+
36+
print.line()
37+
38+
var bxRepo = variables.settings.boxlangSkillsRepo
39+
var cbRepo = variables.settings.coldboxSkillsRepo
40+
41+
// Determine which repos to search
42+
var reposToSearch = []
43+
if ( arguments.owner.len() && arguments.repo.len() ) {
44+
reposToSearch.append( { owner: arguments.owner, repo: arguments.repo } )
45+
} else if ( arguments.owner.len() ) {
46+
var guessedRepo = "skills"
47+
reposToSearch.append( { owner: arguments.owner, repo: guessedRepo } )
48+
} else {
49+
reposToSearch.append( bxRepo )
50+
reposToSearch.append( cbRepo )
51+
}
52+
53+
// Gather all skills
54+
var allSkills = []
55+
reposToSearch.each( ( r ) => {
56+
var repoSkills = variables.skillManager.fetchRepoSkillList( r.owner, r.repo )
57+
repoSkills.each( ( s ) => {
58+
s.ownerRepo = "#r.owner#/#r.repo#"
59+
allSkills.append( s )
60+
} )
61+
} )
62+
63+
if ( allSkills.isEmpty() ) {
64+
printError( "Could not retrieve skills from the registry. Check your network connection." )
65+
return
66+
}
67+
68+
// Filter by query (name or description)
69+
if ( arguments.query.len() ) {
70+
allSkills = allSkills.filter( ( s ) => {
71+
var q = lcase( arguments.query )
72+
return lcase( s.name ?: "" ).findNoCase( q ) ||
73+
lcase( s.description ?: "" ).findNoCase( q ) ||
74+
lcase( s.category ?: "" ).findNoCase( q )
75+
} )
76+
}
77+
78+
// Filter by category
79+
if ( arguments.category.len() ) {
80+
allSkills = allSkills.filter( ( s ) => compareNoCase( s.category ?: "", arguments.category ) == 0 )
81+
}
82+
83+
if ( allSkills.isEmpty() ) {
84+
printInfo( "No skills matched your search." )
85+
print.line()
86+
printTip( "Try browsing all skills with: coldbox ai skills find" )
87+
return
88+
}
89+
90+
// Group by category for display
91+
var grouped = {}
92+
allSkills.sortBy( "category" ).each( ( s ) => {
93+
var cat = s.category ?: "other"
94+
if ( !grouped.keyExists( cat ) ) grouped[ cat ] = []
95+
grouped[ cat ].append( s )
96+
} )
97+
98+
var totalCount = allSkills.len()
99+
printInfo( "Found #totalCount# skill(s):" )
100+
print.line()
101+
102+
var tableData = []
103+
for ( var cat in grouped ) {
104+
grouped[ cat ].each( ( s ) => {
105+
tableData.append( [
106+
s.name ?: "",
107+
s.category ?: "",
108+
s.ownerRepo ?: "",
109+
left( s.description ?: "", 60 )
110+
] )
111+
} )
112+
}
113+
114+
print.table(
115+
headers = [ "Name", "Category", "Owner/Repo", "Description" ],
116+
data = tableData
117+
)
118+
119+
print.line()
120+
printTip( "Install a skill: coldbox ai skills install <owner/repo/category/skill-name>" )
121+
printTip( "Install all skills in a category: coldbox ai skills install <owner/repo/category>" )
122+
}
123+
124+
}

commands/coldbox/ai/skills/help.cfc

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,60 @@ component excludeFromHelp=true extends="coldbox-cli.models.BaseCommand" {
77
.boldCyan( "AI Skills Management" )
88
.line()
99
.line()
10-
.whiteLine( "Skills are how-to cookbooks that guide AI through specific tasks" )
11-
.line()
12-
.boldWhiteLine( "Skill Types:" )
13-
.line()
14-
.line( " • Core - Framework skills (creating handlers, REST APIs, tests, etc.)" )
15-
.line( " • Modules - Module-specific skills (migrations, authentication, etc.)" )
16-
.line( " • Custom - Your project-specific workflows and patterns" )
17-
.line( " • Overrides - Custom overrides of core/module skills" )
10+
.whiteLine( "Skills are how-to cookbooks that guide AI assistants through specific tasks." )
11+
.whiteLine( "They are fetched from a central registry and stored locally in your project." )
1812
.line()
1913
.boldWhiteLine( "Commands:" )
2014
.line()
21-
.greenLine( " coldbox ai skills list List all available skills" )
22-
.greenLine( " coldbox ai skills create <name> Create a custom skill" )
23-
.greenLine( " coldbox ai skills override <name> Override a core/module skill" )
24-
.greenLine( " coldbox ai skills remove <name> Remove a skill (requires --core|--module|--custom|--override)" )
25-
.greenLine( " coldbox ai skills refresh Sync skills with installed modules" )
15+
.greenLine( " coldbox ai skills find [query] Search the skills registry" )
16+
.greenLine( " coldbox ai skills install <slug> Install skill(s) from the registry" )
17+
.greenLine( " coldbox ai skills add <slug> Alias for install" )
18+
.greenLine( " coldbox ai skills list List installed skills" )
19+
.greenLine( " coldbox ai skills list --outdated Show skills with available updates" )
20+
.greenLine( " coldbox ai skills refresh Refresh/update all installed skills" )
21+
.greenLine( " coldbox ai skills create <name> Create a custom skill" )
22+
.greenLine( " coldbox ai skills override <name> Override an installed skill locally" )
23+
.greenLine( " coldbox ai skills remove <name> Remove a skill" )
2624
.line()
2725
.yellowLine( "Examples:" )
2826
.line()
29-
.dim( " ## List all skills" )
27+
.dim( " ## Search the registry" )
28+
.line( " coldbox ai skills find testing" )
29+
.line( " coldbox ai skills find --owner=coldbox --repo=skills" )
30+
.line()
31+
.dim( " ## Install skills" )
32+
.line( " coldbox ai skills install --list ## interactive picker" )
33+
.line( " coldbox ai skills install --all ## install all core skills" )
34+
.line( " coldbox ai skills install handler-development" )
35+
.line( " coldbox ai skills install coldbox/skills/handler-development" )
36+
.line( " coldbox ai skills add rest-api-development" )
37+
.line()
38+
.dim( " ## List and check for updates" )
3039
.line( " coldbox ai skills list" )
40+
.line( " coldbox ai skills list --verbose" )
41+
.line( " coldbox ai skills list --outdated" )
3142
.line()
32-
.dim( " ## Create a custom deployment workflow skill (BoxLang syntax)" )
43+
.dim( " ## Create a custom skill" )
3344
.line( " coldbox ai skills create deployment-workflow" )
34-
.line()
35-
.dim( " ## Create a custom skill with CFML syntax" )
3645
.line( " coldbox ai skills create payment-processing --cfml" )
3746
.line()
38-
.dim( " ## Refresh skills after installing new modules" )
39-
.line( " coldbox ai skills refresh" )
40-
.line()
41-
.dim( " ## Override a core skill with project-specific patterns" )
47+
.dim( " ## Override an installed skill with project-specific content" )
4248
.line( " coldbox ai skills override handler-development" )
4349
.line()
44-
.dim( " ## Remove a custom skill" )
45-
.line( " coldbox ai skills remove deployment-workflow --custom" )
50+
.dim( " ## Remove a skill" )
51+
.line( " coldbox ai skills remove handler-development" )
4652
.line()
47-
.dim( " ## Remove an override" )
48-
.line( " coldbox ai skills remove handler-development --override" )
53+
.dim( " ## Refresh all installed skills to latest versions" )
54+
.line( " coldbox ai skills refresh" )
4955
.line()
5056
.line()
51-
.yellowLine( "Skills are stored in:" )
52-
.line( " .ai/skills/core/ - Core framework skills" )
53-
.line( " .ai/skills/modules/ - Module skills" )
54-
.line( " .ai/skills/custom/ - Your custom skills" )
55-
.line( " .ai/skills/overrides/ - Overridden skills" )
57+
.yellowLine( "Skills are stored in (searched in this order):" )
58+
.line( " .ai/skills/{name}/SKILL.md - Primary location" )
59+
.line( " .agents/skills/{name}/SKILL.md - Alternate (Windsurf/Cursor)" )
60+
.line( " .claude/skills/{name}/SKILL.md - Alternate (Claude desktop)" )
5661
.line()
5762
.line()
58-
.yellowLine( "Tip: Skills complement guidelines - guidelines explain 'what', skills explain 'how'" )
63+
.yellowLine( "Tip: Skills complement guidelines guidelines explain 'what', skills explain 'how'" )
5964
.line()
6065
}
6166

0 commit comments

Comments
 (0)