LM/jrswab axe: Difference between revisions
< LM
Jump to navigation
Jump to search
No edit summary |
|||
| (11 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
Official Site: https://github.com/jrswab/axe | Official Site: https://github.com/jrswab/axe | ||
== Installation | == Installation == | ||
=== Install === | === Install === | ||
| Line 18: | Line 18: | ||
go install github.com/jrswab/axe@latest | go install github.com/jrswab/axe@latest | ||
axe config init | axe config init | ||
</syntaxhighlight> | |||
Then got this. | |||
<syntaxhighlight lang="text"> | |||
....\Documents\SynologyDrive\11.Environments\axe | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 38: | Line 44: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# TODO: need to update | |||
ii $HOME\AppData\Roaming\axe\config.toml | ii $HOME\AppData\Roaming\axe\config.toml | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 46: | Line 53: | ||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
[providers.openai] | [providers.openai] | ||
api_key = "sk- | api_key = "sk-have-a-good-key" | ||
base_url = "http:// | base_url = "http://xxx.xxx.xxx.xxx:60000/v1" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 72: | Line 79: | ||
== Advanced practices == | == Advanced practices == | ||
<pre> | |||
# i-have-adhd | |||
curl -sSL https://raw.githubusercontent.com/ayghri/i-have-adhd/main/skills/i-have-adhd/SKILL.md -o adhd.md | |||
# modern-go-guidelines | |||
curl -sSL https://raw.githubusercontent.com/JetBrains/go-modern-guidelines/main/claude/modern-go-guidelines/skills/use-modern-go/SKILL.md -o modern-go.md | |||
# samber/cc-skills-golang | |||
curl -sSL https://raw.githubusercontent.com/samber/cc-skills-golang/main/skills/golang-security/SKILL.md -o go-security.md | |||
curl -sSL https://raw.githubusercontent.com/samber/cc-skills-golang/main/skills/golang-performance/SKILL.md -o go-perf.md | |||
</pre> | |||
<pre> | |||
name = "go-developer" | |||
description = "High-efficiency Go developer with gopls & golangci-lint execution capabilities" | |||
model = "anthropic/claude-3-7-sonnet" # 或使用 open-ai/gpt-4o / ollama/qwen2.5-coder | |||
skills = [ | |||
"~/.config/axe/skills/adhd.md", | |||
"~/.config/axe/skills/modern-go.md", | |||
"~/.config/axe/skills/go-security.md" | |||
] | |||
system_prompt = """ | |||
You are a senior Golang developer. | |||
- You must strictly follow the i-have-adhd format: direct output, step-by-step with time estimates, and ending with a single Next Step. | |||
- Before suggesting any refactoring, check for lint errors using golangci-lint. | |||
- Write modern Go code (Go 1.21+) using standard libraries like `slices`, `cmp`, and proper error wrapping `fmt.Errorf("%w")`. | |||
""" | |||
[mcp_servers.gopls] | |||
command = "gopls-mcp" | |||
args = [] | |||
[tools] | |||
file_read = true | |||
file_write = true | |||
bash_exec = true | |||
</pre> | |||
= system_prompt & skills & files = | |||
{| class="wikitable" style="max-width:80%;" | |||
! Dimension !! system_prompt !! skill !! files | |||
|- | |||
! Core Meaning | |||
| '''Who are you?''' | |||
| '''How should you do it?''' | |||
| '''What are you operating on?''' | |||
|- | |||
! Analogy | |||
| Employee's work ethics, role persona, and reasoning logic. | |||
| Employee's SOP manual, workflow guides, and executable tools. | |||
| Project files and raw context documents placed on the employee's desk. | |||
|- | |||
! Lifecycle | |||
| '''Permanent'''<br />(Global at Agent level) | |||
| '''Modular'''<br />(Reusable across Agents/Projects) | |||
| '''Disposable'''<br />(Ephemeral per Task/Query level) | |||
|- | |||
! Primary Task | |||
| Defines role persona, output format restrictions, tone, and fundamental reasoning boundaries. | |||
| Provides step-by-step SOPs, domain knowledge guides, prompt templates, and executable shell tools. | |||
| Serves as the target source code, database schemas, or specifications to be analyzed or processed. | |||
|- | |||
! Content Example | |||
| "You are a strict security expert. Answer concisely in Traditional Chinese." | |||
| "SOP for SQL Injection audit and executable script for database migration check." | |||
| 300 lines of source code in <code>api_service.go</code>. | |||
|- | |||
! Modification Frequency | |||
| '''Very Low'''<br />(Set during Agent creation) | |||
| '''Medium'''<br />(Updated with SOP or tool upgrades) | |||
| '''Very High'''<br />(Changes per command execution) | |||
|} | |||
Latest revision as of 01:56, 19 August 2026
What's that?
Official Site: https://github.com/jrswab/axe
Installation
Install
Set config dir first for NAS auto backup.
[System.Environment]::SetEnvironmentVariable('XDG_CONFIG_HOME', "$HOME\Documents\SynologyDrive\11.Environments", 'User')
Reopen Power Shell to take effect.
go install github.com/jrswab/axe@latest
axe config init
Then got this.
....\Documents\SynologyDrive\11.Environments\axe
Set VSCode as Editor for axe
Set environment variable EDITOR as
%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe
Reopen PowerShell and execute to verify.
# Varify environment variable
Get-ChildItem Env:EDITOR
Set provider for local model
Then edit config.yoml.
# TODO: need to update
ii $HOME\AppData\Roaming\axe\config.toml
It would be opened by VSCode. Edit section providers.openai.
[providers.openai]
api_key = "sk-have-a-good-key"
base_url = "http://xxx.xxx.xxx.xxx:60000/v1"
Setup Agent
Add agent
axe agents init query
axe agents edit query
model = "openai/google/gemma-4-E4B-qat-a4_0-gguf"
Test agent
axe run query -p "1+1=?"
If it outputs 2, axe is ready to use.
Advanced practices
# i-have-adhd curl -sSL https://raw.githubusercontent.com/ayghri/i-have-adhd/main/skills/i-have-adhd/SKILL.md -o adhd.md # modern-go-guidelines curl -sSL https://raw.githubusercontent.com/JetBrains/go-modern-guidelines/main/claude/modern-go-guidelines/skills/use-modern-go/SKILL.md -o modern-go.md # samber/cc-skills-golang curl -sSL https://raw.githubusercontent.com/samber/cc-skills-golang/main/skills/golang-security/SKILL.md -o go-security.md curl -sSL https://raw.githubusercontent.com/samber/cc-skills-golang/main/skills/golang-performance/SKILL.md -o go-perf.md
name = "go-developer"
description = "High-efficiency Go developer with gopls & golangci-lint execution capabilities"
model = "anthropic/claude-3-7-sonnet" # 或使用 open-ai/gpt-4o / ollama/qwen2.5-coder
skills = [
"~/.config/axe/skills/adhd.md",
"~/.config/axe/skills/modern-go.md",
"~/.config/axe/skills/go-security.md"
]
system_prompt = """
You are a senior Golang developer.
- You must strictly follow the i-have-adhd format: direct output, step-by-step with time estimates, and ending with a single Next Step.
- Before suggesting any refactoring, check for lint errors using golangci-lint.
- Write modern Go code (Go 1.21+) using standard libraries like `slices`, `cmp`, and proper error wrapping `fmt.Errorf("%w")`.
"""
[mcp_servers.gopls]
command = "gopls-mcp"
args = []
[tools]
file_read = true
file_write = true
bash_exec = true
system_prompt & skills & files
| Dimension | system_prompt | skill | files |
|---|---|---|---|
| Core Meaning | Who are you? | How should you do it? | What are you operating on? |
| Analogy | Employee's work ethics, role persona, and reasoning logic. | Employee's SOP manual, workflow guides, and executable tools. | Project files and raw context documents placed on the employee's desk. |
| Lifecycle | Permanent (Global at Agent level) |
Modular (Reusable across Agents/Projects) |
Disposable (Ephemeral per Task/Query level) |
| Primary Task | Defines role persona, output format restrictions, tone, and fundamental reasoning boundaries. | Provides step-by-step SOPs, domain knowledge guides, prompt templates, and executable shell tools. | Serves as the target source code, database schemas, or specifications to be analyzed or processed. |
| Content Example | "You are a strict security expert. Answer concisely in Traditional Chinese." | "SOP for SQL Injection audit and executable script for database migration check." | 300 lines of source code in api_service.go.
|
| Modification Frequency | Very Low (Set during Agent creation) |
Medium (Updated with SOP or tool upgrades) |
Very High (Changes per command execution) |