Compare commits

3 Commits

Author SHA1 Message Date
zhi
5a8f490cc2 feat: add openclaw-plugin-dev skill
Plugin development reference and workflows based on real development
experience (Dirigent, ContractorAgent, PrismFacet).

Docs: structure, entry-point, hooks, tools, state, config, debugging
Workflows: create-plugin, add-hook

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:25:07 +00:00
zhi
1d34768019 feat: add daily-routine skill and role definitions
daily-routine skill:
- plan-schedule: daily planning workflow (review workload, create slots,
  coordinate with other agents)
- task-handson: task execution workflow (acknowledge slot, find right
  skill workflow, execute)
- slot-complete: post-slot workflow (record results, check overdue,
  defer or pick next)

Role definitions (6 roles):
- developer, manager, operator, mentor, secretary,
  agent-resource-director
- Each defines responsibilities, capabilities, boundaries,
  escalation rules, and memory practice

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:14:05 +00:00
zhi
4cca810c15 feat: role-based skill installation via role-skills.json
learn.sh now installs skills in three layers:
1. mandatory (.mandatory) - all agents
2. role/position (role-skills.json) - based on ego-mgr fields
3. agent-specific (.skill-list) - optional per-agent extras

Deduplicated across layers. ego-mgr unavailable = graceful skip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:05:40 +00:00
22 changed files with 997 additions and 24 deletions

12
daily-routine/SKILL.md Normal file
View File

@@ -0,0 +1,12 @@
---
name: daily-routine
description: Daily work lifecycle — planning, task execution, and slot management. Use when woken up for daily planning or task slot execution.
---
> Scripts interact with HarborForge via `hf` CLI (must run via pcexec).
## Workflows
- `{baseDir}/workflows/plan-schedule.md` — When woken up at daily planning time. Plan today's schedule based on suggested workload.
- `{baseDir}/workflows/task-handson.md` — When a task slot is due. Execute the assigned task following the appropriate skill workflow.
- `{baseDir}/workflows/slot-complete.md` — When finishing a slot. Handle defer decisions and transition to next slot.

View File

@@ -0,0 +1,71 @@
# Plan Schedule
When woken up for daily planning (typically 01:00 UTC). You receive your suggested workload for the day.
## Process
### 1. Review Suggested Workload
Read the suggested workload provided in your wakeup message. This includes:
- Number of oncall slots to schedule
- Number of task slots to schedule
This was designed by agent-resource-director for your specific role and capacity.
### 2. Review Existing Schedule
Check if any slots have already been planned for today:
```bash
hf calendar show --date today
```
### 3. Review Pending Tasks
List tasks assigned to you or that you've claimed:
```bash
hf tasks list --assignee me --status open
```
### 4. Plan Slots
Create slots for today. Distribute them within the work period:
```bash
hf calendar slot create --type work --time HH:MM --duration <min> --event-data '{"task_id": <id>}'
hf calendar slot create --type oncall --time HH:MM --duration <min>
```
For each task slot, note which HF task you intend to work on.
### 5. Assess Collaboration Needs
Review your planned work — does any task require discussion with other agents?
If yes:
- Check the shared daily planning channel
- Propose discussion time with relevant agents
- Agree on a time slot
### 6. Write Daily Plan to Memory
Append a brief summary to your daily note:
```
memory/YYYY-MM-DD.md:
## Daily Plan
- N task slots, M oncall slots scheduled
- Tasks to work on: [list]
- Discussions planned: [list or none]
```
### 7. Confirm Readiness
Once your schedule is submitted, you're done with planning. Set your status:
```bash
hf agent status --set idle
```
Wait for your first slot to be triggered by the wakeup mechanism.

View File

@@ -0,0 +1,63 @@
# Slot Complete
When you have finished working on the current slot.
## Process
### 1. Record Results
Update the task status if applicable:
```bash
hf tasks update --id <task_id> --status <completed|in-progress|blocked>
```
Update the slot:
```bash
hf calendar slot update --id <slot_id> --status finished
```
### 2. Write to Memory
Append a brief work summary to your daily note (`memory/YYYY-MM-DD.md`):
```
## Slot <slot_id> — <task summary>
- What was done: ...
- Key decisions: ...
- Output: commit <hash>, PR #<num>, file <path>, etc.
- Blockers: ... (if any)
```
### 3. Check for Overdue Slots
Before going idle, check if there are overdue slots:
```bash
hf calendar show --date today --status not-started
```
For each overdue slot, decide:
- **Defer**: reschedule to a later time today (if work period allows)
- **Skip**: if no longer relevant
```bash
hf calendar slot update --id <slot_id> --status deferred --time HH:MM
```
### 4. Decide Next Action
If there are more ready slots within the work period:
- Pick the highest priority one
- Follow `task-handson` workflow for it
- Do NOT set status to idle yet
If no more slots, or work period is ending:
- Set status to idle:
```bash
hf agent status --set idle
```
Your session can end. You will be woken up again if new slots become due.

View File

@@ -0,0 +1,55 @@
# Task Handson
When a task slot is due and you are woken up to work on it.
## Process
### 1. Acknowledge Slot
Set your status to busy:
```bash
hf agent status --set busy
```
Update the slot status:
```bash
hf calendar slot update --id <slot_id> --status ongoing
```
### 2. Identify the Task
Read the slot's event data to find the associated task:
```bash
hf calendar slot show --id <slot_id>
```
If the slot has an associated task_id, load the task details:
```bash
hf tasks show --id <task_id>
```
### 3. Find the Right Workflow
Based on the task type and your role, find the appropriate skill workflow:
- Code implementation → your role's development workflow
- Code review → git-hangman-lab PR review workflow
- Deployment → operator deployment workflow
- Skill maintenance → claw-skills improve/create workflow
- Administrative → role-specific administrative workflow
If no specific workflow applies, work on the task directly using your tools and judgment.
### 4. Execute
Follow the identified workflow to completion. During execution:
- Use appropriate tools for your task
- Commit code changes with meaningful messages
- Update task comments with progress if the work is substantial
### 5. Complete Slot
When done, follow the `slot-complete` workflow.

View File

@@ -6,44 +6,85 @@ if [[ -z "${AGENT_WORKSPACE:-}" ]]; then
exit 1 exit 1
fi fi
SKILL_LIST="${AGENT_WORKSPACE}/.skill-list"
TARGET_DIR="${AGENT_WORKSPACE}/skills" TARGET_DIR="${AGENT_WORKSPACE}/skills"
CLAW_DIR="$(cd "$(dirname "$0")" && pwd)" CLAW_DIR="$(cd "$(dirname "$0")" && pwd)"
MANDATORY_FILE="${CLAW_DIR}/.mandatory" MANDATORY_FILE="${CLAW_DIR}/.mandatory"
ROLE_SKILLS_FILE="${CLAW_DIR}/role-skills.json"
SKILL_LIST="${AGENT_WORKSPACE}/.skill-list"
mkdir -p "$TARGET_DIR" mkdir -p "$TARGET_DIR"
# First: install mandatory skills from .mandatory (one per line) # Track installed skills to avoid duplicates
declare -A INSTALLED
install_skill() {
local skill_name="$1"
local source="$2"
[[ -z "$skill_name" || "$skill_name" == \#* ]] && return
if [[ -n "${INSTALLED[$skill_name]:-}" ]]; then
return
fi
local skill_dir="${CLAW_DIR}/${skill_name}"
if [[ -d "$skill_dir" ]]; then
echo "Installing ($source): $skill_name"
cp -r "$skill_dir" "${TARGET_DIR}/"
INSTALLED[$skill_name]=1
else
echo "Skipping (not found): $skill_name"
fi
}
# 1. Install mandatory skills
if [[ -f "$MANDATORY_FILE" ]]; then if [[ -f "$MANDATORY_FILE" ]]; then
while IFS= read -r skill_name || [[ -n "$skill_name" ]]; do while IFS= read -r skill_name || [[ -n "$skill_name" ]]; do
[[ -z "$skill_name" || "$skill_name" == \#* ]] && continue install_skill "$skill_name" "mandatory"
skill_dir="${CLAW_DIR}/${skill_name}"
if [[ -d "$skill_dir" ]]; then
echo "Installing (mandatory): $skill_name"
cp -r "$skill_dir" "${TARGET_DIR}/"
else
echo "Skipping (not found): $skill_name"
fi
done < "$MANDATORY_FILE" done < "$MANDATORY_FILE"
fi fi
# Then: install skills from .skill-list # 2. Install role-based skills from role-skills.json
if [[ -f "$ROLE_SKILLS_FILE" ]]; then
ROLE=$(ego-mgr get role 2>/dev/null || true)
POSITION=$(ego-mgr get position 2>/dev/null || true)
if [[ -n "$ROLE" ]]; then
ROLE_SKILLS=$(python3 -c "
import json, sys
with open('$ROLE_SKILLS_FILE') as f:
data = json.load(f)
skills = data.get('roles', {}).get('$ROLE', [])
print('\n'.join(skills))
" 2>/dev/null || true)
while IFS= read -r skill_name; do
[[ -n "$skill_name" ]] && install_skill "$skill_name" "role:$ROLE"
done <<< "$ROLE_SKILLS"
fi
if [[ -n "$POSITION" ]]; then
POS_SKILLS=$(python3 -c "
import json, sys
with open('$ROLE_SKILLS_FILE') as f:
data = json.load(f)
skills = data.get('positions', {}).get('$POSITION', [])
print('\n'.join(skills))
" 2>/dev/null || true)
while IFS= read -r skill_name; do
[[ -n "$skill_name" ]] && install_skill "$skill_name" "position:$POSITION"
done <<< "$POS_SKILLS"
fi
else
echo "Warning: role-skills.json not found, skipping role-based skills"
fi
# 3. Install agent-specific skills from .skill-list (if exists)
if [[ -f "$SKILL_LIST" ]]; then if [[ -f "$SKILL_LIST" ]]; then
while IFS= read -r skill_name || [[ -n "$skill_name" ]]; do while IFS= read -r skill_name || [[ -n "$skill_name" ]]; do
[[ -z "$skill_name" || "$skill_name" == \#* ]] && continue install_skill "$skill_name" "skill-list"
skill_dir="${CLAW_DIR}/${skill_name}"
if [[ -d "$skill_dir" ]]; then
echo "Installing: $skill_name"
cp -r "$skill_dir" "${TARGET_DIR}/"
else
echo "Skipping (not found): $skill_name"
fi
done < "$SKILL_LIST" done < "$SKILL_LIST"
else
echo "Error: .skill-list not found at $SKILL_LIST"
exit 1
fi fi
echo "Done." echo "Done."

View File

@@ -0,0 +1,21 @@
---
name: openclaw-plugin-dev
description: OpenClaw plugin development — structure, conventions, hooks, tools, install scripts, and debugging. Use when creating, modifying, or debugging OpenClaw plugins.
---
> Reference docs provide the full specification. Workflows guide specific tasks.
## Reference
- `{baseDir}/docs/structure.md` — Project layout, directory conventions, file naming
- `{baseDir}/docs/entry-point.md` — Plugin entry format, globalThis patterns, lifecycle protection
- `{baseDir}/docs/hooks.md` — Hook registration, dedup patterns, available hooks
- `{baseDir}/docs/tools.md` — Tool registration interface (inputSchema + execute)
- `{baseDir}/docs/state.md` — State management rules (globalThis vs module-level)
- `{baseDir}/docs/config.md` — Config schema, install scripts, sensitive fields
- `{baseDir}/docs/debugging.md` — Dev loop, log keywords, smoke testing
## Workflows
- `{baseDir}/workflows/create-plugin.md` — When creating a new OpenClaw plugin from scratch.
- `{baseDir}/workflows/add-hook.md` — When adding a new hook handler to an existing plugin.

View File

@@ -0,0 +1,61 @@
# Config Schema & Install Scripts
## openclaw.plugin.json
```json
{
"$schema": "https://openclaw.ai/schemas/plugin-config.json",
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"myToken": { "type": "string" },
"myFlag": { "type": "boolean", "default": false }
}
}
}
```
### Rules
- `additionalProperties: false` is mandatory — OpenClaw validates config against schema
- Removing a config field requires removing it from schema too (or gateway fails to start)
- Sensitive fields (tokens, keys): no `default`, user must configure manually
## Install Script (scripts/install.mjs)
### Install does:
1. Build dist (compile TypeScript)
2. Clean and copy to `~/.openclaw/plugins/<id>/`
3. Update `openclaw.json`:
- Add to `plugins.allow`
- Add to `plugins.load.paths`
- Set `plugins.entries.<id>.enabled = true`
- Set default config via `setIfMissing` (never overwrite existing values)
4. Never set sensitive fields (tokens) — add comments for manual configuration
### Uninstall does:
1. Remove from `plugins.allow`
2. Delete `plugins.entries.<id>`
3. Remove from `plugins.load.paths`
4. Delete install directory
### setIfMissing pattern
```javascript
function setIfMissing(obj, key, value) {
if (obj[key] === undefined || obj[key] === null) {
obj[key] = value;
}
}
```
### Config field changes
When renaming or removing config fields:
1. Update `openclaw.plugin.json` schema first (source of truth)
2. Update `normalizeConfig()` in index.ts
3. Update install script `setIfMissing` calls
4. Document migration steps for users

View File

@@ -0,0 +1,46 @@
# Development & Debugging
## Dev Loop
```bash
# 1. Modify code in plugin/
# 2. Reinstall
node scripts/install.mjs --install
# 3. Restart gateway
openclaw gateway restart
# 4. Watch logs
openclaw logs --follow
# 5. Test
```
## Log Keywords
| Keyword | Meaning |
|---------|---------|
| `plugin registered` | register() completed |
| `startSideCar called` / `already running` | Sidecar status |
| `must NOT have additional properties` | Schema vs config mismatch |
| `EADDRINUSE` | Port conflict (sidecar or HTTP server) |
## Checklist Before Deploy
### General
- [ ] All hook handlers have event dedup (globalThis, not module-level)
- [ ] Gateway lifecycle events protected by globalThis flag
- [ ] Business state on globalThis
- [ ] `openclaw.plugin.json` schema matches actual config fields
- [ ] Install script doesn't set schema-absent fields
- [ ] Sensitive fields not set by install script
- [ ] Install script cleans old dist before copying
### Connection-type plugins
- [ ] Start flag on globalThis (not module-level `let`)
- [ ] Runtime reference on globalThis
- [ ] Shared registries/callbacks on globalThis, init once
- [ ] Cross-plugin API object overwritten every register() but runtime started once
- [ ] Consumer plugins defend against provider not loaded

View File

@@ -0,0 +1,49 @@
# Plugin Entry Point
## Format
```typescript
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
const _G = globalThis as Record<string, unknown>;
const LIFECYCLE_KEY = "_myPluginGatewayLifecycleRegistered";
export default {
id: "my-plugin",
name: "My Plugin",
register(api: OpenClawPluginApi) {
const config = normalizeConfig(api);
// Gateway lifecycle: only once
if (!_G[LIFECYCLE_KEY]) {
_G[LIFECYCLE_KEY] = true;
// Start sidecars, init global resources
api.on("gateway_stop", () => { _G[LIFECYCLE_KEY] = false; });
}
// Agent session hooks: every register() call (dedup inside handler)
registerMyHook(api, config);
// Tools
registerMyTools(api, config);
api.logger.info("my-plugin: registered");
},
};
```
## Why globalThis?
OpenClaw may hot-reload plugins. Module-level variables reset on reload, but `globalThis` persists. All mutable state must be on `globalThis`:
- Startup flags → prevent double initialization
- Dedup sets → prevent double hook execution
- Runtime references → keep connections alive across reloads
- Shared registries → preserve cross-plugin state
## Naming Convention
```
_<pluginId>PluginXxx # Internal state (e.g., _prismFacetRouters)
__<pluginId> # Cross-plugin public API (e.g., __yonexusClient)
```

View File

@@ -0,0 +1,62 @@
# Hook Registration
## Available Hooks
| Hook | Purpose | Dedup Method |
|------|---------|-------------|
| `before_model_resolve` | Override model/provider before LLM call | WeakSet on event |
| `before_prompt_build` | Inject into system prompt | WeakSet on event |
| `before_agent_start` | Legacy prompt injection | WeakSet on event |
| `agent_end` | Post-conversation actions | Set on runId |
| `message_received` | React to inbound messages | — |
| `llm_input` / `llm_output` | Observe LLM traffic | — |
| `before_tool_call` / `after_tool_call` | Observe tool execution | — |
| `gateway_start` / `gateway_stop` | Gateway lifecycle | globalThis flag |
## Dedup Patterns
### WeakSet (for event-object hooks)
```typescript
const _G = globalThis as Record<string, unknown>;
const DEDUP_KEY = "_myPluginHookDedup";
if (!(_G[DEDUP_KEY] instanceof WeakSet)) _G[DEDUP_KEY] = new WeakSet<object>();
const dedup = _G[DEDUP_KEY] as WeakSet<object>;
api.on("before_model_resolve", async (event, ctx) => {
if (dedup.has(event as object)) return;
dedup.add(event as object);
// ... handler logic
});
```
### Set with runId (for agent_end)
```typescript
const DEDUP_KEY = "_myPluginAgentEndDedup";
if (!(_G[DEDUP_KEY] instanceof Set)) _G[DEDUP_KEY] = new Set<string>();
const dedup = _G[DEDUP_KEY] as Set<string>;
api.on("agent_end", async (event, ctx) => {
const runId = (event as any).runId as string;
if (runId) {
if (dedup.has(runId)) return;
dedup.add(runId);
if (dedup.size > 500) dedup.delete(dedup.values().next().value!);
}
// ... handler logic
});
```
## Prompt Injection Hooks
`before_prompt_build` and `before_agent_start` can return prompt mutation fields:
| Field | Caching | Use for |
|-------|---------|---------|
| `prependSystemContext` | Cached | Static role/identity prompts |
| `appendSystemContext` | Cached | Static supplementary guidance |
| `prependContext` | Not cached | Per-turn dynamic context |
| `systemPrompt` | — | Full system prompt replacement (rarely used) |
Requires `plugins.entries.<id>.hooks.allowPromptInjection: true` in openclaw.json.

View File

@@ -0,0 +1,48 @@
# State Management
## Where to Store What
| Data Type | Location | Reason |
|-----------|----------|--------|
| Business state (maps, sets, caches) | `globalThis` | Module vars reset on hot reload |
| Event dedup (WeakSet/Set) | `globalThis` | Same |
| Gateway lifecycle flags | `globalThis` | Prevent double init |
| Connection flags (WebSocket/TCP) | `globalThis` | Prevent duplicate connections |
| Runtime references | `globalThis` | Closures need living instance |
| Cross-plugin API objects (`__pluginId`) | `globalThis` | Other plugins access via globalThis |
| Pure utility functions | Module-level | No state needed |
| Persistent data | File + memory cache | Survives gateway restart |
## Cross-Plugin API Pattern
### Provider side
```typescript
const _G = globalThis as Record<string, unknown>;
// Init shared objects once
if (!(_G["_myRegistry"] instanceof MyRegistry)) {
_G["_myRegistry"] = new MyRegistry();
}
// Overwrite public API every register() (updates closures)
_G["__myPlugin"] = {
registry: _G["_myRegistry"],
send: (msg) => (_G["_myRuntime"] as Runtime)?.send(msg) ?? false,
};
```
### Consumer side
```typescript
const provider = (globalThis as any)["__myPlugin"];
if (!provider) {
console.error("[consumer] __myPlugin not found");
return;
}
provider.registry.register("my_rule", handler);
```
### Load Order
Provider must be listed before consumer in `plugins.allow`. Consumer must defend against provider not being loaded.

View File

@@ -0,0 +1,26 @@
# Plugin Project Structure
```
proj-root/
plugin/ # Installable plugin (copied to ~/.openclaw/plugins/<id>/)
index.ts # Entry: export default { id, name, register }
openclaw.plugin.json # Config schema declaration
package.json # name, version, type: module
hooks/ # Hook handlers (one file per hook)
tools/ # Tool registrations
core/ # Pure business logic (no plugin-sdk imports)
web/ # HTTP routes (optional)
services/ # Sidecar processes (optional, installed alongside plugin)
skills/ # OpenClaw skills provided by this plugin (optional)
routers/ # Drop-in modules (plugin-specific, e.g., PrismFacet routers)
scripts/
install.mjs # --install / --uninstall / --update
docs/ # Documentation
```
## Conventions
- File names: kebab-case (`before-model-resolve.ts`)
- Export names: camelCase (`registerBeforeModelResolve`)
- `plugin/core/` must not import from `openclaw/plugin-sdk` — keeps logic unit-testable
- Hook registration logic goes in `plugin/hooks/`, not in `index.ts`

View File

@@ -0,0 +1,40 @@
# Tool Registration
## Interface
```typescript
// Without agent context
api.registerTool({
name: "my-tool",
description: "Does something",
inputSchema: {
type: "object",
properties: {
param: { type: "string", description: "..." },
},
required: ["param"],
},
execute: async (toolCallId, params) => {
const { param } = params as { param: string };
return { result: "ok" };
},
});
// With agent context (factory function)
api.registerTool((ctx) => ({
name: "my-contextual-tool",
description: "...",
inputSchema: { /* ... */ },
execute: async (toolCallId, params) => {
const agentId = ctx.agentId;
return { result: agentId };
},
}));
```
## Key Points
- Interface is `execute: async (toolCallId, params)`, NOT `handler:`
- Use `inputSchema` (JSON Schema), NOT `parameters`
- Return `{ result: "..." }` object
- Factory form `(ctx) => ({...})` gives access to agent context (agentId, sessionKey, etc.)

View File

@@ -0,0 +1,40 @@
# Add Hook
When adding a new hook handler to an existing plugin.
> See `{baseDir}/docs/hooks.md` for available hooks and dedup patterns.
## Process
### 1. Create Hook File
Add `plugin/hooks/<hook-name>.ts`. Export a registration function:
```typescript
export function registerMyHook(api, config) {
// Set up dedup on globalThis
// api.on("<hook-name>", handler)
}
```
### 2. Add Dedup
Choose the right dedup pattern:
- `before_model_resolve`, `before_prompt_build` → WeakSet on event object
- `agent_end` → Set on runId with size cap (500)
- `gateway_start/stop` → globalThis flag (in index.ts, not in hook file)
### 3. Register in index.ts
Import and call the registration function in the `register()` method.
Hooks that need to run every register() call (agent-scoped): put outside the lifecycle guard.
Hooks that should run once (gateway-scoped): put inside the lifecycle guard.
### 4. If Prompt Injection
If the hook returns `prependSystemContext` or `appendSystemContext`, ensure `allowPromptInjection: true` is set in the plugin's config entry and in the install script.
### 5. Test
Reinstall, restart gateway, verify via logs.

View File

@@ -0,0 +1,72 @@
# Create Plugin
When creating a new OpenClaw plugin from scratch.
> See `{baseDir}/docs/structure.md` for directory layout and conventions.
## Process
### 1. Scaffold
Create the project structure:
```
my-plugin/
plugin/
index.ts
openclaw.plugin.json
package.json
core/
hooks/
tools/
scripts/
install.mjs
routers/ # if applicable
package.json # dev dependencies (typescript, @types/node)
tsconfig.plugin.json
.gitignore
```
### 2. Define Config Schema
Write `plugin/openclaw.plugin.json` with `additionalProperties: false`. Only include fields the plugin actually uses.
### 3. Implement Entry Point
Follow the pattern in `{baseDir}/docs/entry-point.md`:
- `export default { id, name, register }`
- globalThis lifecycle protection
- Hooks in separate files under `hooks/`
- Tools in separate files under `tools/`
- Business logic in `core/` (no plugin-sdk imports)
### 4. Implement Hooks
Follow dedup patterns in `{baseDir}/docs/hooks.md`. Each hook gets its own file.
### 5. Implement Tools
Follow the interface in `{baseDir}/docs/tools.md`: `inputSchema` + `execute`.
### 6. Write Install Script
Follow `{baseDir}/docs/config.md` for install/uninstall conventions.
### 7. Build & Test
```bash
npm run build
node scripts/install.mjs --install
openclaw gateway restart
# Test via Discord or openclaw agent CLI
```
### 8. Push
Create a git repository and push:
```bash
git-ctrl repo create <plugin-name>
git add -A && git commit -m "init: <plugin-name>"
git push -u origin main
```

39
role-skills.json Normal file
View File

@@ -0,0 +1,39 @@
{
"_description": "Maps role and position to skill lists. learn.sh resolves skills by: mandatory → role → position (in that order, deduplicated).",
"_extensibility": "Add new roles/positions as needed. Unknown role/position values are silently skipped.",
"roles": {
"developer": [
"git-hangman-lab"
],
"manager": [
"git-hangman-lab"
],
"operator": [
"git-hangman-lab"
],
"mentor": [
"git-hangman-lab",
"claw-skills"
],
"secretary": [],
"agent-resource-director": [
"keycloak-hangman-lab",
"recruitment"
]
},
"positions": {
"tech-leader": [],
"delivery-manager": [],
"operator": [],
"mentor": [
"claw-skills"
],
"administrative-secretary": [],
"director": [
"keycloak-hangman-lab",
"recruitment"
]
}
}

View File

@@ -0,0 +1,53 @@
---
role: agent-resource-director
---
## Responsibilities
- Design and publish suggested workload per agent on a periodic basis
- Analyze agent performance: completion rate, efficiency, task complexity
- Evaluate ClawSkills branches based on agent performance correlation
- Recommend branch merges to mentor based on performance data
- Oversee agent recruitment (supervise recruiter)
- Maintain role-specific evaluation skills
## Capabilities
- HF Calendar and Task API for workload analysis
- Performance metrics: slot completion/defer/abandon rates per agent
- Cross-referencing task complexity with agent efficiency
- Managing evaluation criteria skills (self-maintained, self-improved)
## Boundaries
- Do not merge ClawSkills branches directly — recommend to mentor
- Do not assign individual tasks — that is manager's role
- Do not write application code
## Key Processes
### Workload Design
Periodically assigned via HF task. Analyze each agent's recent performance, current project load, and role requirements to produce suggested daily workload (N oncall slots, M task slots per agent).
### Performance Evaluation
- Track per-agent: slots completed vs deferred vs abandoned
- Factor in task complexity (not just speed)
- Each role has different output quality criteria
- Evaluation skills are themselves subject to periodic review and improvement
### ClawSkills Branch Assessment
- Agent performing well → their ClawSkills branch likely contains good improvements
- Agent performing poorly → their branch may introduce problems
- Provide data-backed recommendations to mentor for merge decisions
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Skill branch needs technical review | mentor |
| Project-level resource allocation | manager |
| Infrastructure for new agents | operator |
## Memory Practice
After each evaluation cycle, write to `memory/YYYY-MM-DD.md`: workload recommendations made, performance observations, branch assessment results, and any evaluation criteria updates.

36
roles/developer/ROLE.md Normal file
View File

@@ -0,0 +1,36 @@
---
role: developer
---
## Responsibilities
- Implement features, fix bugs, and write code based on assigned HF tasks
- Create pull requests via git-ctrl and assist with code reviews
- Maintain code quality and write meaningful commit messages
- Follow the daily-routine skill for slot planning and task execution
## Capabilities
- Git operations: clone, commit, push, create/review PRs (git-hangman-lab skill)
- Code editing, debugging, and testing across the workspace
- Reading and searching codebases
- Running build and test commands
## Boundaries
- Do not deploy to production servers — escalate to operator
- Do not recruit or onboard new agents — escalate to agent-resource-director
- Do not modify ClawSkills main branch directly — use promote-improvements, mentor evaluates
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Production deployment needed | operator |
| Task requirements unclear | manager |
| Skill/workflow is broken or missing | mentor |
| New agent needed for workload | agent-resource-director |
## Memory Practice
After completing each task slot, write a brief summary to `memory/YYYY-MM-DD.md` including what was done, key decisions, and output references (commits, PRs, files).

35
roles/manager/ROLE.md Normal file
View File

@@ -0,0 +1,35 @@
---
role: manager
---
## Responsibilities
- Break down proposals/requirements into actionable HF tasks
- Assign tasks to appropriate agents based on their role and capacity
- Track project milestones and delivery progress
- Coordinate cross-agent work by initiating discussions when needed
## Capabilities
- HF task/project/milestone management via `hf` CLI
- Creating and managing discussion channels for cross-agent coordination
- Reviewing project status and progress reports
## Boundaries
- Do not write production code — assign to developer
- Do not deploy — assign to operator
- Do not evaluate agent performance — that is agent-resource-director's role
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Technical implementation question | developer (tech-leader) |
| Deployment coordination | operator |
| Agent capacity/performance concern | agent-resource-director |
| Skill/process improvement needed | mentor |
## Memory Practice
After completing each planning or review slot, write a summary to `memory/YYYY-MM-DD.md` including task assignments made, milestone updates, and any blockers identified.

35
roles/mentor/ROLE.md Normal file
View File

@@ -0,0 +1,35 @@
---
role: mentor
---
## Responsibilities
- Create, maintain, and improve ClawSkills — the shared skill repository
- Review skill branches from other agents (via promote-improvements)
- Ensure skill quality: clear workflows, working scripts, proper structure
- Guide agents on skill usage when they encounter issues
## Capabilities
- Full access to ClawSkills repository
- Create new skills following claw-skills/docs/standard.md
- Evaluate and merge skill branches into main
- Review and improve existing workflows and scripts
## Boundaries
- Do not merge skill branches based solely on code quality — coordinate with agent-resource-director for performance-based evaluation
- Do not deploy applications — escalate to operator
- Do not assign tasks — escalate to manager
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Skill branch performance evaluation data needed | agent-resource-director |
| Infrastructure issue blocking skill testing | operator |
| New skill request from project requirements | manager |
## Memory Practice
After reviewing or creating skills, write to `memory/YYYY-MM-DD.md`: which skills were modified, what changed, which branches were evaluated, and any quality concerns.

36
roles/operator/ROLE.md Normal file
View File

@@ -0,0 +1,36 @@
---
role: operator
---
## Responsibilities
- Deploy applications to production servers (T0, T1, T2, T3)
- Manage Docker containers, Nginx configs, and server infrastructure
- Monitor server health and respond to operational issues
- Maintain deployment scripts and automation
## Capabilities
- SSH to all servers (server.t0 through server.t3)
- Docker and docker-compose operations
- Server configuration and maintenance
- HarborForge Monitor telemetry access
## Boundaries
- Do not write application features — escalate to developer
- Do not make product decisions — escalate to manager
- Infrastructure changes that affect all servers should be documented
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Code changes needed before deploy | developer |
| Deployment priority/scheduling | manager |
| Server capacity planning | agent-resource-director |
| Deployment skill needs improvement | mentor |
## Memory Practice
After each deployment or infrastructure change, write to `memory/YYYY-MM-DD.md`: what was deployed, which servers, any issues encountered, rollback steps if applicable.

32
roles/secretary/ROLE.md Normal file
View File

@@ -0,0 +1,32 @@
---
role: secretary
---
## Responsibilities
- Record meeting notes and discussion summaries
- Manage communications and email correspondence
- Maintain team documentation and administrative records
- Organize and archive important discussions
## Capabilities
- Discord channel management and message reading
- Document creation and organization
- Meeting note formatting and distribution
## Boundaries
- Do not make project decisions — record and escalate to manager
- Do not modify code or infrastructure
## Escalation
| Situation | Escalate To |
|-----------|-------------|
| Decision needed on meeting outcomes | manager |
| Technical questions from communications | developer or operator |
## Memory Practice
After each meeting or communication task, write to `memory/YYYY-MM-DD.md`: meeting participants, key decisions, action items, and follow-up needed.