china-qijizhifeng/agentic-harness-engineering/nexau-evolution-guide
Claude Code and agent skill by china-qijizhifeng/agentic-harness-engineering
- community
Checking that the SKILL.md file is still in the repository.
NexAU agent evolution reference for a simple starting agent. Use when adding tools, middleware, sub-agents, or skills during evolution. Covers all available components, YAML config schema, and creation guides. Reference docs in reference/ for deep dives.
Install
npx vskill@latest install china-qijizhifeng/agentic-harness-engineering/nexau-evolution-guideSKILL.md
NexAU Evolution Guide — Simple Agent Starting Point
The code agent starts simple: a single run_shell_command tool, no middleware, no skills, no sub-agents. Evolution progressively adds components to improve performance. This guide covers what you can add and how to add it.
Current Agent Baseline
Everything below is available to add during evolution.
Validation
After any change, always validate:
Adding Tools
The agent only starts with run_shell_command. Add tools to give the agent more capabilities.
Available Built-in Tools
These tool implementations already exist in workspace/tools/ and can be registered by adding entries to code_agent.yaml:
| Tool | Binding | Purpose | |
|---|---|---|---|
read_file | tools.file_tools:read_file | Read file with line numbers, offset/limit pagination | |
write_file | tools.file_tools:write_file | Write/overwrite a file | |
replace | tools.file_tools:replace | Find-and-replace in files (exact → flexible → regex fallback) | |
search_file_content | tools.file_tools:search_file_content | Search file contents (ripgrep-style) | |
glob | tools.file_tools:glob | Find files by glob pattern | |
list_directory | tools.file_tools:list_directory | List directory contents | |
run_shell_command | tools.shell_tools:run_shell_command | Execute shell commands (already registered) | |
BackgroundTaskManage | tools:background_task_manage_tool | Manage background processes | |
web_search | tools.web_tools:google_web_search | Google web search | |
web_read | tools.web_tools:web_fetch | Fetch web page content | |
save_memory | tools.session_tools:save_memory | Save notes to memory file | |
write_todos | tools.session_tools:write_todos | Write TODO list | |
complete_task | tools.session_tools:complete_task | Signal task completion (stop tool) |
How to Register a Tool
Add to tools: in workspace/code_agent.yaml:
Each tool needs:
- Tool YAML (
tool_descriptions/*.tool.yaml) — schema + description for the LLM - Python binding (
tools/*.py) — the implementation - Registration in
code_agent.yamlundertools:
If adding complete_task, also set stop_tools: [complete_task].
Creating a New Tool
Step 1 — YAML definition (workspace/tool_descriptions/my_tool.tool.yaml):
Step 2 — Python implementation (workspace/tools/my_module.py):
Step 3 — Register in code_agent.yaml:
⚠️ CRITICAL: All three steps required. Missing any one = tool unavailable or agent crashes.
Tool Modification Ideas
| Problem | Action | |
|---|---|---|
replace OLD_STRING_NOT_FOUND | Add fuzzy match with difflib.get_close_matches | |
| Shell output too large | Edit _truncate_shell_output() to keep head+tail | |
Agent uses python not python3 | Add shim in run_shell_command.py | |
| Tool description unclear | Edit tool_descriptions/*.tool.yaml (high-impact, low-risk) |
Adding Middleware
The agent starts with no middleware. Middleware hooks into the execution pipeline to modify behavior at various points. Register middleware in code_agent.yaml under middlewares:.
Order matters: before_* hooks run top-to-bottom; after_* hooks run bottom-to-top.
AgentState & GlobalStorage API
Middleware and tools access runtime state via agent_state. `global_storage` is NOT a dict — it is a thread-safe GlobalStorage object. Do NOT use dict methods like [], setdefault(), in, or pop().
AgentState API:
| Method | Description | |
|---|---|---|
agent_state.get_global_value(key, default) | Read from global storage | |
agent_state.set_global_value(key, value) | Write to global storage | |
agent_state.get_context_value(key, default) | Read from context | |
agent_state.set_context_value(key, value) | Write to context | |
agent_state.get_sandbox() | Get sandbox instance | |
agent_state.agent_name | Agent name (str) | |
agent_state.agent_id | Agent ID (str) |
GlobalStorage API (agent_state.global_storage):
| Method | Description | |
|---|---|---|
.get(key, default=None) | Read a value | |
.set(key, value) | Write a value | |
.update(dict) | Batch write | |
.delete(key) | Delete a key | |
.keys() | List all keys | |
.items() | List all key-value pairs | |
.lock_key(key) | Context manager for exclusive key access |
Common mistakes:
Creating Custom Middleware
Step 1 — Create workspace/middleware/my_middleware.py:
Step 2 — Register in code_agent.yaml:
Hook Points Reference
| Hook | When | Can modify | Use case | |
|---|---|---|---|---|
before_agent | Before execution loop | messages | One-time setup | |
after_agent | After execution loop | — | Cleanup | |
before_model | Before each LLM call | messages | Inject reminders, compact context | |
after_model | After LLM response | messages, parsed_response, force_continue | Post-process, force retry | |
before_tool | Before tool execution | tool inputs | Validate/transform arguments | |
after_tool | After tool execution | tool_output | Truncate/enrich output | |
wrap_model_call | Wraps LLM call | params | Error handling, failover | |
wrap_tool_call | Wraps tool call | params | Timeout, retry |
Middleware LLM Access
Middleware can make its own LLM calls. At runtime, these env vars are always available:
| Variable | Value | |
|---|---|---|
LLM_API_KEY | API key for current experiment | |
LLM_BASE_URL | LLM API endpoint | |
LLM_MODEL | Model identifier |
In `wrap_model_call` (preferred — reuse existing client):
In other hooks (create standalone client):
Always set `middleware_manager=None` to avoid infinite recursion.
Adding Sub-Agents
Sub-agents are child agents with their own prompt, tools, middleware, and isolated context window.
When to Use
| Use sub-agent | Don't use sub-agent | |
|---|---|---|
| Task needs deep, focused context | Simple one-shot operation | |
| Subtask needs different tools/prompt | Parent's tools are sufficient | |
| Isolate failure from parent | Overhead not justified |
Creating a Sub-Agent
Step 1 — Create config (workspace/sub_agents/verifier/agent.yaml):
Step 2 — Create prompt (workspace/sub_agents/verifier/prompt.md)
Step 3 — Register in code_agent.yaml:
⚠️ CRITICAL: Framework auto-injectsRecallSubAgenttool whensub_agentsis non-empty. Do NOT add it manually — causes duplicate tool error.
Adding Skills
Skills are modular knowledge packages loaded at runtime via LoadSkill.
Structure
SKILL.md Format
Registration
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/evolve_agent/skills/nexau-evolution-guide/SKILL.md
Popularity
- Repository stars
- 211
- Repository forks
- 23
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/china-qijizhifeng/agentic-harness-engineering/nexau-evolution-guide)