kollabor 0.4.9__py3-none-any.whl → 0.4.15__py3-none-any.whl
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.
- agents/__init__.py +2 -0
- agents/coder/__init__.py +0 -0
- agents/coder/agent.json +4 -0
- agents/coder/api-integration.md +2150 -0
- agents/coder/cli-pretty.md +765 -0
- agents/coder/code-review.md +1092 -0
- agents/coder/database-design.md +1525 -0
- agents/coder/debugging.md +1102 -0
- agents/coder/dependency-management.md +1397 -0
- agents/coder/git-workflow.md +1099 -0
- agents/coder/refactoring.md +1454 -0
- agents/coder/security-hardening.md +1732 -0
- agents/coder/system_prompt.md +1448 -0
- agents/coder/tdd.md +1367 -0
- agents/creative-writer/__init__.py +0 -0
- agents/creative-writer/agent.json +4 -0
- agents/creative-writer/character-development.md +1852 -0
- agents/creative-writer/dialogue-craft.md +1122 -0
- agents/creative-writer/plot-structure.md +1073 -0
- agents/creative-writer/revision-editing.md +1484 -0
- agents/creative-writer/system_prompt.md +690 -0
- agents/creative-writer/worldbuilding.md +2049 -0
- agents/data-analyst/__init__.py +30 -0
- agents/data-analyst/agent.json +4 -0
- agents/data-analyst/data-visualization.md +992 -0
- agents/data-analyst/exploratory-data-analysis.md +1110 -0
- agents/data-analyst/pandas-data-manipulation.md +1081 -0
- agents/data-analyst/sql-query-optimization.md +881 -0
- agents/data-analyst/statistical-analysis.md +1118 -0
- agents/data-analyst/system_prompt.md +928 -0
- agents/default/__init__.py +0 -0
- agents/default/agent.json +4 -0
- agents/default/dead-code.md +794 -0
- agents/default/explore-agent-system.md +585 -0
- agents/default/system_prompt.md +1448 -0
- agents/kollabor/__init__.py +0 -0
- agents/kollabor/analyze-plugin-lifecycle.md +175 -0
- agents/kollabor/analyze-terminal-rendering.md +388 -0
- agents/kollabor/code-review.md +1092 -0
- agents/kollabor/debug-mcp-integration.md +521 -0
- agents/kollabor/debug-plugin-hooks.md +547 -0
- agents/kollabor/debugging.md +1102 -0
- agents/kollabor/dependency-management.md +1397 -0
- agents/kollabor/git-workflow.md +1099 -0
- agents/kollabor/inspect-llm-conversation.md +148 -0
- agents/kollabor/monitor-event-bus.md +558 -0
- agents/kollabor/profile-performance.md +576 -0
- agents/kollabor/refactoring.md +1454 -0
- agents/kollabor/system_prompt copy.md +1448 -0
- agents/kollabor/system_prompt.md +757 -0
- agents/kollabor/trace-command-execution.md +178 -0
- agents/kollabor/validate-config.md +879 -0
- agents/research/__init__.py +0 -0
- agents/research/agent.json +4 -0
- agents/research/architecture-mapping.md +1099 -0
- agents/research/codebase-analysis.md +1077 -0
- agents/research/dependency-audit.md +1027 -0
- agents/research/performance-profiling.md +1047 -0
- agents/research/security-review.md +1359 -0
- agents/research/system_prompt.md +492 -0
- agents/technical-writer/__init__.py +0 -0
- agents/technical-writer/agent.json +4 -0
- agents/technical-writer/api-documentation.md +2328 -0
- agents/technical-writer/changelog-management.md +1181 -0
- agents/technical-writer/readme-writing.md +1360 -0
- agents/technical-writer/style-guide.md +1410 -0
- agents/technical-writer/system_prompt.md +653 -0
- agents/technical-writer/tutorial-creation.md +1448 -0
- core/__init__.py +0 -2
- core/application.py +343 -88
- core/cli.py +229 -10
- core/commands/menu_renderer.py +463 -59
- core/commands/registry.py +14 -9
- core/commands/system_commands.py +2461 -14
- core/config/loader.py +151 -37
- core/config/service.py +18 -6
- core/events/bus.py +29 -9
- core/events/executor.py +205 -75
- core/events/models.py +27 -8
- core/fullscreen/command_integration.py +20 -24
- core/fullscreen/components/__init__.py +10 -1
- core/fullscreen/components/matrix_components.py +1 -2
- core/fullscreen/components/space_shooter_components.py +654 -0
- core/fullscreen/plugin.py +5 -0
- core/fullscreen/renderer.py +52 -13
- core/fullscreen/session.py +52 -15
- core/io/__init__.py +29 -5
- core/io/buffer_manager.py +6 -1
- core/io/config_status_view.py +7 -29
- core/io/core_status_views.py +267 -347
- core/io/input/__init__.py +25 -0
- core/io/input/command_mode_handler.py +711 -0
- core/io/input/display_controller.py +128 -0
- core/io/input/hook_registrar.py +286 -0
- core/io/input/input_loop_manager.py +421 -0
- core/io/input/key_press_handler.py +502 -0
- core/io/input/modal_controller.py +1011 -0
- core/io/input/paste_processor.py +339 -0
- core/io/input/status_modal_renderer.py +184 -0
- core/io/input_errors.py +5 -1
- core/io/input_handler.py +211 -2452
- core/io/key_parser.py +7 -0
- core/io/layout.py +15 -3
- core/io/message_coordinator.py +111 -2
- core/io/message_renderer.py +129 -4
- core/io/status_renderer.py +147 -607
- core/io/terminal_renderer.py +97 -51
- core/io/terminal_state.py +21 -4
- core/io/visual_effects.py +816 -165
- core/llm/agent_manager.py +1063 -0
- core/llm/api_adapters/__init__.py +44 -0
- core/llm/api_adapters/anthropic_adapter.py +432 -0
- core/llm/api_adapters/base.py +241 -0
- core/llm/api_adapters/openai_adapter.py +326 -0
- core/llm/api_communication_service.py +167 -113
- core/llm/conversation_logger.py +322 -16
- core/llm/conversation_manager.py +556 -30
- core/llm/file_operations_executor.py +84 -32
- core/llm/llm_service.py +934 -103
- core/llm/mcp_integration.py +541 -57
- core/llm/message_display_service.py +135 -18
- core/llm/plugin_sdk.py +1 -2
- core/llm/profile_manager.py +1183 -0
- core/llm/response_parser.py +274 -56
- core/llm/response_processor.py +16 -3
- core/llm/tool_executor.py +6 -1
- core/logging/__init__.py +2 -0
- core/logging/setup.py +34 -6
- core/models/resume.py +54 -0
- core/plugins/__init__.py +4 -2
- core/plugins/base.py +127 -0
- core/plugins/collector.py +23 -161
- core/plugins/discovery.py +37 -3
- core/plugins/factory.py +6 -12
- core/plugins/registry.py +5 -17
- core/ui/config_widgets.py +128 -28
- core/ui/live_modal_renderer.py +2 -1
- core/ui/modal_actions.py +5 -0
- core/ui/modal_overlay_renderer.py +0 -60
- core/ui/modal_renderer.py +268 -7
- core/ui/modal_state_manager.py +29 -4
- core/ui/widgets/base_widget.py +7 -0
- core/updates/__init__.py +10 -0
- core/updates/version_check_service.py +348 -0
- core/updates/version_comparator.py +103 -0
- core/utils/config_utils.py +685 -526
- core/utils/plugin_utils.py +1 -1
- core/utils/session_naming.py +111 -0
- fonts/LICENSE +21 -0
- fonts/README.md +46 -0
- fonts/SymbolsNerdFont-Regular.ttf +0 -0
- fonts/SymbolsNerdFontMono-Regular.ttf +0 -0
- fonts/__init__.py +44 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/METADATA +54 -4
- kollabor-0.4.15.dist-info/RECORD +228 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/top_level.txt +2 -0
- plugins/agent_orchestrator/__init__.py +39 -0
- plugins/agent_orchestrator/activity_monitor.py +181 -0
- plugins/agent_orchestrator/file_attacher.py +77 -0
- plugins/agent_orchestrator/message_injector.py +135 -0
- plugins/agent_orchestrator/models.py +48 -0
- plugins/agent_orchestrator/orchestrator.py +403 -0
- plugins/agent_orchestrator/plugin.py +976 -0
- plugins/agent_orchestrator/xml_parser.py +191 -0
- plugins/agent_orchestrator_plugin.py +9 -0
- plugins/enhanced_input/box_styles.py +1 -0
- plugins/enhanced_input/color_engine.py +19 -4
- plugins/enhanced_input/config.py +2 -2
- plugins/enhanced_input_plugin.py +61 -11
- plugins/fullscreen/__init__.py +6 -2
- plugins/fullscreen/example_plugin.py +1035 -222
- plugins/fullscreen/setup_wizard_plugin.py +592 -0
- plugins/fullscreen/space_shooter_plugin.py +131 -0
- plugins/hook_monitoring_plugin.py +436 -78
- plugins/query_enhancer_plugin.py +66 -30
- plugins/resume_conversation_plugin.py +1494 -0
- plugins/save_conversation_plugin.py +98 -32
- plugins/system_commands_plugin.py +70 -56
- plugins/tmux_plugin.py +154 -78
- plugins/workflow_enforcement_plugin.py +94 -92
- system_prompt/default.md +952 -886
- core/io/input_mode_manager.py +0 -402
- core/io/modal_interaction_handler.py +0 -315
- core/io/raw_input_processor.py +0 -946
- core/storage/__init__.py +0 -5
- core/storage/state_manager.py +0 -84
- core/ui/widget_integration.py +0 -222
- core/utils/key_reader.py +0 -171
- kollabor-0.4.9.dist-info/RECORD +0 -128
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/WHEEL +0 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/entry_points.txt +0 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
<!-- Explore agent loading, discovery, and skill management system -->
|
|
2
|
+
|
|
3
|
+
skill name: explore-agent-system
|
|
4
|
+
|
|
5
|
+
purpose:
|
|
6
|
+
understand how kollabor agents are discovered, loaded, and switched.
|
|
7
|
+
helps troubleshoot agent initialization, skill loading, and agent
|
|
8
|
+
directory resolution issues.
|
|
9
|
+
|
|
10
|
+
when to use:
|
|
11
|
+
[ ] need to list all available agents
|
|
12
|
+
[ ] want to see active agent and its skills
|
|
13
|
+
[ ] debugging agent switching problems
|
|
14
|
+
[ ] tracing why an agent isn't loading
|
|
15
|
+
[ ] verifying skill activation status
|
|
16
|
+
[ ] understanding agent directory priority (local vs global)
|
|
17
|
+
[ ] creating or modifying agents
|
|
18
|
+
|
|
19
|
+
methodology:
|
|
20
|
+
|
|
21
|
+
phase 1: agent discovery
|
|
22
|
+
understand agent search paths
|
|
23
|
+
list all discovered agents
|
|
24
|
+
verify agent directory structure
|
|
25
|
+
|
|
26
|
+
phase 2: agent inspection
|
|
27
|
+
examine active agent configuration
|
|
28
|
+
check loaded skills
|
|
29
|
+
verify agent.json settings
|
|
30
|
+
|
|
31
|
+
phase 3: skill troubleshooting
|
|
32
|
+
trace skill loading process
|
|
33
|
+
debug skill activation issues
|
|
34
|
+
verify default skills
|
|
35
|
+
|
|
36
|
+
tools and commands:
|
|
37
|
+
|
|
38
|
+
core files to read:
|
|
39
|
+
<read>file>core/llm/agent_manager.py</file>
|
|
40
|
+
<read>file>core/utils/config_utils.py</file>
|
|
41
|
+
|
|
42
|
+
agent definitions:
|
|
43
|
+
<read>file>agents/default/system_prompt.md</file>
|
|
44
|
+
<read>file>agents/coder/system_prompt.md</file>
|
|
45
|
+
<read>file>agents/kollabor/system_prompt.md</file>
|
|
46
|
+
|
|
47
|
+
grep patterns for agent discovery:
|
|
48
|
+
<terminal>grep -r "class Agent" core/llm/</terminal>
|
|
49
|
+
<terminal>grep -r "AgentManager" core/llm/</terminal>
|
|
50
|
+
<terminal>grep -r "def.*agent" core/utils/config_utils.py</terminal>
|
|
51
|
+
|
|
52
|
+
list all agent directories:
|
|
53
|
+
<terminal>find agents -name "system_prompt.md" -type f</terminal>
|
|
54
|
+
<terminal>ls -la agents/</terminal>
|
|
55
|
+
|
|
56
|
+
check local vs global agents:
|
|
57
|
+
<terminal>ls -la .kollabor-cli/agents/</terminal>
|
|
58
|
+
<terminal>ls -la ~/.kollabor-cli/agents/</terminal>
|
|
59
|
+
|
|
60
|
+
view agent configs:
|
|
61
|
+
<terminal>find .kollabor-cli/agents -name "agent.json"</terminal>
|
|
62
|
+
<terminal>find ~/.kollabor-cli/agents -name "agent.json"</terminal>
|
|
63
|
+
|
|
64
|
+
agent system architecture:
|
|
65
|
+
|
|
66
|
+
agentmanager (core/llm/agent_manager.py)
|
|
67
|
+
central coordinator for agent discovery and loading
|
|
68
|
+
|
|
69
|
+
key classes:
|
|
70
|
+
- skill: represents a skill loaded from .md file
|
|
71
|
+
- agent: represents an agent with system_prompt and skills
|
|
72
|
+
- agentmanager: manages discovery, loading, switching
|
|
73
|
+
|
|
74
|
+
agent discovery paths:
|
|
75
|
+
1. global: ~/.kollabor-cli/agents/ (user defaults)
|
|
76
|
+
2. local: .kollabor-cli/agents/ (project-specific, overrides global)
|
|
77
|
+
|
|
78
|
+
local agents take priority over global agents with the same name.
|
|
79
|
+
|
|
80
|
+
agent directory structure:
|
|
81
|
+
agents/<agent-name>/
|
|
82
|
+
system_prompt.md (required - base system prompt)
|
|
83
|
+
agent.json (optional - config with description, profile, default_skills)
|
|
84
|
+
*.md (optional - skill files)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
skill class (core/llm/agent_manager.py:29-99)
|
|
88
|
+
attributes:
|
|
89
|
+
- name: skill identifier (filename without .md)
|
|
90
|
+
- content: full content of the skill file
|
|
91
|
+
- file_path: path to the skill file
|
|
92
|
+
- description: extracted from html comment at file start
|
|
93
|
+
|
|
94
|
+
methods:
|
|
95
|
+
- from_file(cls, file_path): load skill from .md file
|
|
96
|
+
- to_dict(): convert to dictionary for serialization
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
agent class (core/llm/agent_manager.py:101-260)
|
|
100
|
+
attributes:
|
|
101
|
+
- name: agent identifier (directory name)
|
|
102
|
+
- directory: path to agent directory
|
|
103
|
+
- system_prompt: base system prompt content
|
|
104
|
+
- skills: dict of available skills (name -> skill)
|
|
105
|
+
- active_skills: list of currently loaded skill names
|
|
106
|
+
- profile: optional preferred llm profile
|
|
107
|
+
- description: human-readable description
|
|
108
|
+
- default_skills: skills to auto-load when activated
|
|
109
|
+
|
|
110
|
+
methods:
|
|
111
|
+
- from_directory(cls, agent_dir): load agent from directory
|
|
112
|
+
- get_full_system_prompt(): get prompt with active skills appended
|
|
113
|
+
- load_skill(skill_name): load skill into active context
|
|
114
|
+
- unload_skill(skill_name): unload skill from active context
|
|
115
|
+
- list_skills(): get all available skills
|
|
116
|
+
- get_skill(name): get specific skill by name
|
|
117
|
+
- to_dict(): convert to dictionary for serialization
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
agentmanager class (core/llm/agent_manager.py:262-876)
|
|
121
|
+
attributes:
|
|
122
|
+
- _agents: dict of discovered agents (name -> agent)
|
|
123
|
+
- _active_agent_name: currently selected agent name
|
|
124
|
+
- global_agents_dir: ~/.kollabor-cli/agents/
|
|
125
|
+
- local_agents_dir: .kollabor-cli/agents/
|
|
126
|
+
|
|
127
|
+
key methods:
|
|
128
|
+
- _discover_agents(): scan directories and load agents
|
|
129
|
+
- get_agent(name): get agent by name
|
|
130
|
+
- get_active_agent(): get current active agent
|
|
131
|
+
- set_active_agent(name, load_defaults=true): switch agents
|
|
132
|
+
- list_agents(): get all discovered agents
|
|
133
|
+
- get_agent_names(): get list of agent names
|
|
134
|
+
- load_skill(skill_name, agent_name=none): load skill for agent
|
|
135
|
+
- unload_skill(skill_name, agent_name=none): unload skill
|
|
136
|
+
- toggle_default_skill(skill_name, agent_name): toggle auto-load
|
|
137
|
+
- refresh(): re-discover agents (preserves active skills)
|
|
138
|
+
- create_agent(...): create new agent with directory
|
|
139
|
+
- delete_agent(name): delete agent directory
|
|
140
|
+
- update_agent(...): rename/update agent
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
agent initialization flow (core/utils/config_utils.py)
|
|
144
|
+
|
|
145
|
+
initialize_system_prompt() runs on first startup:
|
|
146
|
+
|
|
147
|
+
step 1: check if local .kollabor-cli/agents/default/system_prompt.md exists
|
|
148
|
+
if yes: use local (already set up)
|
|
149
|
+
if no: continue to step 2
|
|
150
|
+
|
|
151
|
+
step 2: migrate from old system_prompt/ directory if exists
|
|
152
|
+
if yes: copy to new agent structure
|
|
153
|
+
if no: continue to step 3
|
|
154
|
+
|
|
155
|
+
step 3: copy all seed agents from bundled agents/ to global
|
|
156
|
+
scans agents/ at package root or cwd
|
|
157
|
+
copies each agent to ~/.kollabor-cli/agents/
|
|
158
|
+
|
|
159
|
+
step 4: copy default agent from global to local
|
|
160
|
+
creates .kollabor-cli/agents/default/
|
|
161
|
+
copies system_prompt.md and agent.json
|
|
162
|
+
copies all skill files (*.md)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
system prompt resolution order (core/utils/config_utils.py:158-221)
|
|
166
|
+
|
|
167
|
+
highest to lowest priority:
|
|
168
|
+
1. cli --system-prompt argument
|
|
169
|
+
2. kollabor_system_prompt environment variable (direct string)
|
|
170
|
+
3. kollabor_system_prompt_file environment variable (file path)
|
|
171
|
+
4. local .kollabor-cli/agents/default/system_prompt.md
|
|
172
|
+
5. global ~/.kollabor-cli/agents/default/system_prompt.md
|
|
173
|
+
6. fallback minimal default
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
phase 1: discover agents
|
|
177
|
+
|
|
178
|
+
step 1: list all available agents
|
|
179
|
+
|
|
180
|
+
from python:
|
|
181
|
+
<read>file>core/llm/agent_manager.py</file>
|
|
182
|
+
<lines>378-394</lines>
|
|
183
|
+
|
|
184
|
+
from command line:
|
|
185
|
+
<terminal>python -c "
|
|
186
|
+
from core.llm.agent_manager import agentmanager
|
|
187
|
+
am = agentmanager()
|
|
188
|
+
for name in am.get_agent_names():
|
|
189
|
+
agent = am.get_agent(name)
|
|
190
|
+
print(f'{name}: {agent.description or \"(no description)\"}')
|
|
191
|
+
print(f' directory: {agent.directory}')
|
|
192
|
+
print(f' skills: {len(agent.skills)}')
|
|
193
|
+
print(f' profile: {agent.profile or \"(none)\"}')
|
|
194
|
+
print()
|
|
195
|
+
"</terminal>
|
|
196
|
+
|
|
197
|
+
expected output:
|
|
198
|
+
default: default agent with standard system prompt
|
|
199
|
+
directory: /path/to/.kollabor-cli/agents/default
|
|
200
|
+
skills: 5
|
|
201
|
+
profile: (none)
|
|
202
|
+
|
|
203
|
+
coder: coding-focused agent
|
|
204
|
+
directory: /home/user/.kollabor-cli/agents/coder
|
|
205
|
+
skills: 3
|
|
206
|
+
profile: claude-opus-4
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
step 2: check agent directory priority
|
|
210
|
+
|
|
211
|
+
verify local vs global:
|
|
212
|
+
<terminal>echo "=== local agents ===" && ls -la .kollabor-cli/agents/ 2>/dev/null</terminal>
|
|
213
|
+
<terminal>echo "=== global agents ===" && ls -la ~/.kollabor-cli/agents/</terminal>
|
|
214
|
+
|
|
215
|
+
local agents override global agents with the same name.
|
|
216
|
+
this allows project-specific customization.
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
step 3: examine agent structure
|
|
220
|
+
|
|
221
|
+
for a specific agent:
|
|
222
|
+
<terminal>ls -la agents/default/</terminal>
|
|
223
|
+
<terminal>cat agents/default/agent.json</terminal>
|
|
224
|
+
|
|
225
|
+
expected structure:
|
|
226
|
+
system_prompt.md (required)
|
|
227
|
+
agent.json (optional - may not exist)
|
|
228
|
+
skill1.md
|
|
229
|
+
skill2.md
|
|
230
|
+
...
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
phase 2: inspect active agent
|
|
234
|
+
|
|
235
|
+
step 1: get current active agent
|
|
236
|
+
|
|
237
|
+
<terminal>python -c "
|
|
238
|
+
from core.llm.agent_manager import agentmanager
|
|
239
|
+
am = agentmanager()
|
|
240
|
+
active = am.get_active_agent()
|
|
241
|
+
if active:
|
|
242
|
+
print(f'active agent: {active.name}')
|
|
243
|
+
print(f'description: {active.description or \"(none)\"}')
|
|
244
|
+
print(f'profile: {active.profile or \"(none)\"}')
|
|
245
|
+
print(f'directory: {active.directory}')
|
|
246
|
+
print(f'total skills: {len(active.skills)}')
|
|
247
|
+
print(f'active skills: {active.active_skills}')
|
|
248
|
+
print(f'default skills: {active.default_skills}')
|
|
249
|
+
else:
|
|
250
|
+
print('no active agent')
|
|
251
|
+
"</terminal>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
step 2: list agent skills
|
|
255
|
+
|
|
256
|
+
<terminal>python -c "
|
|
257
|
+
from core.llm.agent_manager import agentmanager
|
|
258
|
+
am = agentmanager()
|
|
259
|
+
agent = am.get_active_agent()
|
|
260
|
+
if agent:
|
|
261
|
+
for skill in agent.list_skills():
|
|
262
|
+
active = '*' if skill.name in agent.active_skills else ' '
|
|
263
|
+
default = 'd' if skill.name in agent.default_skills else ' '
|
|
264
|
+
desc = skill.description[:40] + '...' if skill.description and len(skill.description) > 40 else skill.description or ''
|
|
265
|
+
print(f'[{active}][{default}] {skill.name}: {desc}')
|
|
266
|
+
"</terminal>
|
|
267
|
+
|
|
268
|
+
legend:
|
|
269
|
+
[*] = currently active/loaded
|
|
270
|
+
[d] = default skill (auto-loads on agent activation)
|
|
271
|
+
[ ] = available but not active
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
step 3: view full system prompt
|
|
275
|
+
|
|
276
|
+
<terminal>python -c "
|
|
277
|
+
from core.llm.agent_manager import agentmanager
|
|
278
|
+
am = agentmanager()
|
|
279
|
+
agent = am.get_active_agent()
|
|
280
|
+
if agent:
|
|
281
|
+
prompt = agent.get_full_system_prompt()
|
|
282
|
+
print(prompt)
|
|
283
|
+
"</terminal>
|
|
284
|
+
|
|
285
|
+
this shows base system_prompt + all active skills appended
|
|
286
|
+
with "## skill: {name}" headers.
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
phase 3: skill troubleshooting
|
|
290
|
+
|
|
291
|
+
issue 1: skill not loading
|
|
292
|
+
|
|
293
|
+
checklist:
|
|
294
|
+
[ ] does skill file exist?
|
|
295
|
+
<terminal>ls -la .kollabor-cli/agents/default/*.md</terminal>
|
|
296
|
+
|
|
297
|
+
[ ] is skill file valid .md?
|
|
298
|
+
<terminal>file .kollabor-cli/agents/default/myskill.md</terminal>
|
|
299
|
+
|
|
300
|
+
[ ] was skill loaded correctly?
|
|
301
|
+
check logs: <terminal>grep -i "skill" .kollabor-cli/logs/kollabor.log | tail -20</terminal>
|
|
302
|
+
|
|
303
|
+
[ ] is skill in active_skills list?
|
|
304
|
+
see step 2 above
|
|
305
|
+
|
|
306
|
+
[ ] was agent refreshed after adding skill?
|
|
307
|
+
agentmanager.refresh() must be called to discover new files
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
issue 2: agent not discovered
|
|
311
|
+
|
|
312
|
+
checklist:
|
|
313
|
+
[ ] does agent directory exist?
|
|
314
|
+
<terminal>ls -la agents/</terminal>
|
|
315
|
+
<terminal>ls -la ~/.kollabor-cli/agents/</terminal>
|
|
316
|
+
|
|
317
|
+
[ ] does system_prompt.md exist?
|
|
318
|
+
<terminal>ls agents/myagent/system_prompt.md</terminal>
|
|
319
|
+
|
|
320
|
+
[ ] is agent directory valid (not __pycache__, etc)?
|
|
321
|
+
<read>file>core/llm/agent_manager.py</file>
|
|
322
|
+
<lines>294-305</lines>
|
|
323
|
+
|
|
324
|
+
[ ] was application restarted after adding agent?
|
|
325
|
+
agents are discovered at startup
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
issue 3: wrong agent active
|
|
329
|
+
|
|
330
|
+
checklist:
|
|
331
|
+
[ ] what is _active_agent_name?
|
|
332
|
+
<terminal>python -c "from core.llm.agent_manager import agentmanager; print(agentmanager().active_agent_name)"</terminal>
|
|
333
|
+
|
|
334
|
+
[ ] was set_active_agent called?
|
|
335
|
+
check for: <terminal>grep -r "set_active_agent" core/</terminal>
|
|
336
|
+
|
|
337
|
+
[ ] is agent name correct?
|
|
338
|
+
verify exact name: <terminal>ls agents/</terminal>
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
issue 4: default skills not loading
|
|
342
|
+
|
|
343
|
+
checklist:
|
|
344
|
+
[ ] is skill in agent.json default_skills array?
|
|
345
|
+
<terminal>cat agents/default/agent.json</terminal>
|
|
346
|
+
|
|
347
|
+
[ ] was load_defaults=true when activating?
|
|
348
|
+
set_active_agent(name, load_defaults=true)
|
|
349
|
+
|
|
350
|
+
[ ] does skill actually exist?
|
|
351
|
+
skill name must match filename without .md
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
issue 5: agent.json changes not taking effect
|
|
355
|
+
|
|
356
|
+
checklist:
|
|
357
|
+
[ ] was agent.refresh() called?
|
|
358
|
+
changes require refresh or restart
|
|
359
|
+
|
|
360
|
+
[ ] is json valid?
|
|
361
|
+
<terminal>python -c "import json; print(json.load(open('agents/default/agent.json')))"</terminal>
|
|
362
|
+
|
|
363
|
+
[ ] was skill toggled correctly?
|
|
364
|
+
toggle_default_skill() saves to agent.json
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
example workflow:
|
|
368
|
+
|
|
369
|
+
scenario: "create a new custom agent"
|
|
370
|
+
|
|
371
|
+
step 1: use agentmanager to create agent
|
|
372
|
+
|
|
373
|
+
<terminal>python -c "
|
|
374
|
+
from core.llm.agent_manager import agentmanager
|
|
375
|
+
|
|
376
|
+
am = agentmanager()
|
|
377
|
+
|
|
378
|
+
# create new agent
|
|
379
|
+
agent = am.create_agent(
|
|
380
|
+
name='my-custom',
|
|
381
|
+
description='specialized agent for my project',
|
|
382
|
+
profile='claude-opus-4',
|
|
383
|
+
system_prompt='''# my custom agent
|
|
384
|
+
|
|
385
|
+
you are specialized for this project.
|
|
386
|
+
focus on clean, documented code.
|
|
387
|
+
''',
|
|
388
|
+
default_skills=['code-review', 'refactoring']
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
if agent:
|
|
392
|
+
print(f'created agent: {agent.name}')
|
|
393
|
+
print(f'directory: {agent.directory}')
|
|
394
|
+
else:
|
|
395
|
+
print('agent creation failed - may already exist')
|
|
396
|
+
"</terminal>
|
|
397
|
+
|
|
398
|
+
step 2: verify agent was created
|
|
399
|
+
|
|
400
|
+
<terminal>ls -la .kollabor-cli/agents/my-custom/</terminal>
|
|
401
|
+
<terminal>cat .kollabor-cli/agents/my-custom/agent.json</terminal>
|
|
402
|
+
|
|
403
|
+
step 3: add skill files
|
|
404
|
+
|
|
405
|
+
create skills in the agent directory:
|
|
406
|
+
<create><file>.kollabor-cli/agents/my-custom/my-skill.md</file><content><!-- my custom skill -->
|
|
407
|
+
skill name: my-skill
|
|
408
|
+
purpose: does something specific
|
|
409
|
+
...
|
|
410
|
+
</content></create>
|
|
411
|
+
|
|
412
|
+
step 4: switch to new agent
|
|
413
|
+
|
|
414
|
+
<terminal>python -c "
|
|
415
|
+
from core.llm.agent_manager import agentmanager
|
|
416
|
+
am = agentmanager()
|
|
417
|
+
success = am.set_active_agent('my-custom')
|
|
418
|
+
print(f'activated: {success}')
|
|
419
|
+
print(f'active agent: {am.active_agent_name}')
|
|
420
|
+
"</terminal>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
example workflow 2:
|
|
424
|
+
|
|
425
|
+
scenario: "debug why a skill isn't loading"
|
|
426
|
+
|
|
427
|
+
step 1: verify skill file exists
|
|
428
|
+
<terminal>ls -la .kollabor-cli/agents/default/*.md</terminal>
|
|
429
|
+
|
|
430
|
+
step 2: check skill is discovered
|
|
431
|
+
<terminal>python -c "
|
|
432
|
+
from core.llm.agent_manager import agentmanager
|
|
433
|
+
am = agentmanager()
|
|
434
|
+
agent = am.get_agent('default')
|
|
435
|
+
print('available skills:', [s.name for s in agent.list_skills()])
|
|
436
|
+
"</terminal>
|
|
437
|
+
|
|
438
|
+
step 3: try loading skill
|
|
439
|
+
<terminal>python -c "
|
|
440
|
+
from core.llm.agent_manager import agentmanager
|
|
441
|
+
am = agentmanager()
|
|
442
|
+
success = am.load_skill('my-skill', 'default')
|
|
443
|
+
print(f'loaded: {success}')
|
|
444
|
+
"</terminal>
|
|
445
|
+
|
|
446
|
+
step 4: check logs for errors
|
|
447
|
+
<terminal>grep -i "skill\|agent" .kollabor-cli/logs/kollabor.log | tail -30</terminal>
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
example workflow 3:
|
|
451
|
+
|
|
452
|
+
scenario: "copy agent from global to local for customization"
|
|
453
|
+
|
|
454
|
+
step 1: identify global agent
|
|
455
|
+
<terminal>ls -la ~/.kollabor-cli/agents/</terminal>
|
|
456
|
+
|
|
457
|
+
step 2: copy to local
|
|
458
|
+
<terminal>cp -r ~/.kollabor-cli/agents/coder .kollabor-cli/agents/</terminal>
|
|
459
|
+
|
|
460
|
+
step 3: customize local version
|
|
461
|
+
<read>file>.kollabor-cli/agents/coder/system_prompt.md</file>
|
|
462
|
+
<edit><file>.kollabor-cli/agents/coder/system_prompt.md</file><find>old content</find><replace>customized content</replace></edit>
|
|
463
|
+
|
|
464
|
+
step 4: refresh and verify
|
|
465
|
+
<terminal>python -c "
|
|
466
|
+
from core.llm.agent_manager import agentmanager
|
|
467
|
+
am = agentmanager()
|
|
468
|
+
am.refresh()
|
|
469
|
+
agent = am.get_agent('coder')
|
|
470
|
+
print(f'agent source: {agent.directory}')
|
|
471
|
+
if '.kollabor-cli' in str(agent.directory):
|
|
472
|
+
print('using local agent (customized)')
|
|
473
|
+
else:
|
|
474
|
+
print('using global agent (default)')
|
|
475
|
+
"</terminal>
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
advanced: programmatic agent inspection
|
|
479
|
+
|
|
480
|
+
create agent inspection script (inspect_agents.py):
|
|
481
|
+
|
|
482
|
+
#!/usr/bin/env python3
|
|
483
|
+
"""inspect all agents and their skills."""
|
|
484
|
+
import sys
|
|
485
|
+
from pathlib import path
|
|
486
|
+
sys.path.insert(0, str(path(__file__).parent))
|
|
487
|
+
|
|
488
|
+
from core.llm.agent_manager import agentmanager
|
|
489
|
+
|
|
490
|
+
def main():
|
|
491
|
+
am = agentmanager()
|
|
492
|
+
|
|
493
|
+
print(f"=== agent discovery ===")
|
|
494
|
+
print(f"local dir: {am.local_agents_dir}")
|
|
495
|
+
print(f"global dir: {am.global_agents_dir}")
|
|
496
|
+
print(f"total agents: {len(am.list_agents())}")
|
|
497
|
+
print(f"active agent: {am.active_agent_name or '(none)'}")
|
|
498
|
+
|
|
499
|
+
for agent in am.list_agents():
|
|
500
|
+
is_local = "local" if agent.directory.is_relative_to(am.local_agents_dir) else "global"
|
|
501
|
+
is_active = "*" if agent.name == am.active_agent_name else " "
|
|
502
|
+
|
|
503
|
+
print(f"\n[{is_active}] {agent.name} ({is_local})")
|
|
504
|
+
print(f" dir: {agent.directory}")
|
|
505
|
+
print(f" desc: {agent.description or '(none)'}")
|
|
506
|
+
print(f" profile: {agent.profile or '(none)'}")
|
|
507
|
+
|
|
508
|
+
if agent.skills:
|
|
509
|
+
print(f" skills ({len(agent.skills)}):")
|
|
510
|
+
for skill in agent.list_skills():
|
|
511
|
+
active = "*" if skill.name in agent.active_skills else " "
|
|
512
|
+
default = "d" if skill.name in agent.default_skills else " "
|
|
513
|
+
print(f" [{active}][{default}] {skill.name}")
|
|
514
|
+
else:
|
|
515
|
+
print(f" skills: (none)")
|
|
516
|
+
|
|
517
|
+
if agent.active_skills:
|
|
518
|
+
print(f" active: {', '.join(agent.active_skills)}")
|
|
519
|
+
if agent.default_skills:
|
|
520
|
+
print(f" defaults: {', '.join(agent.default_skills)}")
|
|
521
|
+
|
|
522
|
+
if __name__ == "__main__":
|
|
523
|
+
main()
|
|
524
|
+
|
|
525
|
+
run:
|
|
526
|
+
<terminal>python inspect_agents.py</terminal>
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
troubleshooting tips:
|
|
530
|
+
|
|
531
|
+
tip 1: agent not appearing
|
|
532
|
+
- verify system_prompt.md exists in agent directory
|
|
533
|
+
- check directory name is valid (no special chars)
|
|
534
|
+
- ensure agent is under agents/ or .kollabor-cli/agents/
|
|
535
|
+
- restart application after adding new agent
|
|
536
|
+
|
|
537
|
+
tip 2: skills not loading
|
|
538
|
+
- skill files must end in .md
|
|
539
|
+
- skill files cannot be named system_prompt.md
|
|
540
|
+
- description must be in html comment at file start
|
|
541
|
+
- call refresh() after adding new skill files
|
|
542
|
+
|
|
543
|
+
tip 3: local agent not overriding global
|
|
544
|
+
- local must be in .kollabor-cli/agents/
|
|
545
|
+
- agent names must match exactly
|
|
546
|
+
- local directory must exist and be valid
|
|
547
|
+
|
|
548
|
+
tip 4: agent.json changes ignored
|
|
549
|
+
- json must be valid (check syntax)
|
|
550
|
+
- default_skills must reference existing skill files
|
|
551
|
+
- call refresh() or restart after changes
|
|
552
|
+
|
|
553
|
+
tip 5: switching agents doesn't work
|
|
554
|
+
- agent name must match exactly (case-sensitive)
|
|
555
|
+
- agent must exist (check get_agent_names())
|
|
556
|
+
- check logs for errors during activation
|
|
557
|
+
- verify agent.json profile exists if specified
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
expected output:
|
|
561
|
+
|
|
562
|
+
when this skill executes successfully, you should be able to:
|
|
563
|
+
|
|
564
|
+
[ ] list all discovered agents
|
|
565
|
+
[ ] show active agent and its configuration
|
|
566
|
+
[ ] display all skills for an agent with active/default status
|
|
567
|
+
[ ] trace agent loading from local vs global directories
|
|
568
|
+
[ ] create new agents programmatically
|
|
569
|
+
[ ] debug why agents or skills aren't loading
|
|
570
|
+
[ ] understand skill activation and default loading
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
status tags reference:
|
|
574
|
+
|
|
575
|
+
[ok] agent/skill is working correctly
|
|
576
|
+
[warn] agent/skill has issues but still loads
|
|
577
|
+
[error] agent/skill is failing or not loading
|
|
578
|
+
[todo] action needed to fix agent/skill
|
|
579
|
+
|
|
580
|
+
common exit conditions:
|
|
581
|
+
|
|
582
|
+
[ok] issue identified and resolved
|
|
583
|
+
[ok] workaround implemented
|
|
584
|
+
[warn] issue understood but not fixed
|
|
585
|
+
[error] root cause unclear, needs more investigation
|