@nt-ai-lab/opencode-skillz 0.2.4 → 0.2.6
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/agents/default.md +2 -0
- package/index.js +20 -1
- package/package.json +1 -1
package/agents/default.md
CHANGED
|
@@ -25,3 +25,5 @@ You are a tool that takes user commands and produces responses.
|
|
|
25
25
|
- Never use words like "likely" or "should". Say "I don't know" and explain what needs to be done to ascertain facts. Speculation and assumptions are dangerous => provide facts, find evidence, don't be lazy and speculate which could lead the user to make bad decisions based on confident-sounding tool responses.
|
|
26
26
|
|
|
27
27
|
- NEVER bypass rules or do workarounds to make a problem go away. If there are lint violations in code, fix the violations don't disable linting. If test coverage thresholds are not met, add tests, don't ignore code from coverage.
|
|
28
|
+
|
|
29
|
+
- Tight feedback loops: validate your work regularly. Don't modify 50 files and then run lint and find 100 errors. Run lint after each file edit
|
package/index.js
CHANGED
|
@@ -97,6 +97,25 @@ function loadAgents(commands) {
|
|
|
97
97
|
|
|
98
98
|
const agents = {}
|
|
99
99
|
|
|
100
|
+
function collectPreloadedCommands(agentName, stack = new Set()) {
|
|
101
|
+
const rawAgent = rawAgents[agentName]
|
|
102
|
+
if (!rawAgent) return []
|
|
103
|
+
if (stack.has(agentName)) return parseCsvList(rawAgent.meta.preload_commands)
|
|
104
|
+
|
|
105
|
+
stack.add(agentName)
|
|
106
|
+
|
|
107
|
+
const merged = []
|
|
108
|
+
const parentAgentName = typeof rawAgent.meta.extends === "string" ? rawAgent.meta.extends.trim() : ""
|
|
109
|
+
if (parentAgentName && rawAgents[parentAgentName]) {
|
|
110
|
+
merged.push(...collectPreloadedCommands(parentAgentName, stack))
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
merged.push(...parseCsvList(rawAgent.meta.preload_commands))
|
|
114
|
+
stack.delete(agentName)
|
|
115
|
+
|
|
116
|
+
return [...new Set(merged)]
|
|
117
|
+
}
|
|
118
|
+
|
|
100
119
|
for (const [name, raw] of Object.entries(rawAgents)) {
|
|
101
120
|
const { meta, body } = raw
|
|
102
121
|
const promptParts = []
|
|
@@ -111,7 +130,7 @@ function loadAgents(commands) {
|
|
|
111
130
|
promptParts.push(body)
|
|
112
131
|
}
|
|
113
132
|
|
|
114
|
-
const preloadedCommands =
|
|
133
|
+
const preloadedCommands = collectPreloadedCommands(name)
|
|
115
134
|
for (const commandName of preloadedCommands) {
|
|
116
135
|
const command = commands[commandName]
|
|
117
136
|
if (!command || !command.template) continue
|