Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,7 @@ make update-input
## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## TODO

- Migrate: https://github.com/jj-vcs/jj/releases/tag/v0.35.0
12 changes: 0 additions & 12 deletions conf/cursor/mcp.json

This file was deleted.

2 changes: 1 addition & 1 deletion conf/ghostty/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://github.com/ghostty-org/ghostty/blob/b8ffee7acbdd5ee97953f6e6d02e047d4bfda37b/src/input/key.zig#L255


theme = Monokai Pro Machine
theme = Neobones Dark
# font-family = "Berkeley Mono"
font-family = "IBM Plex Mono"
window-title-font-family = "IBM Plex Sans"
Expand Down
4 changes: 2 additions & 2 deletions conf/llm/docs/coding-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- Read project `AGENTS.md` and `~/.config/AGENTS.md` (or your own instructions) and obey the `## Critical` rules.
- Confirm every change is wired in: new handlers must be bound, new routes registered, etc. no orphaned code.
- Conduct a deep, human review, not just static-code checks: walk through every edge case, anticipate failure modes, and weigh the performance cost of each path.
- Reference-check, run `ast-grep`/`rg` to verify that any API, constant, or variable you touch already exists and makes sense; never invent values like `this.userType = 123` if `123` is meaningless in the project.
- Reference-check, run `fs(mcp)`/`ast-grep`/`rg` to verify that any API, constant, or variable you touch already exists and makes sense; never invent values like `this.userType = 123` if `123` is meaningless in the project.

## Implementation

Expand Down Expand Up @@ -81,7 +81,7 @@

## Tools available in current environment

- `fs` mcp tool: `list_allowed_directories`; `read_multiple_text_files`; `search_code_ast`: like ast-grep, search code pattern across multiple codebase; `search_files_content`: like rg, search text pattern across multiple files; `read_file_lines`: read file lines with line numbers, or tail, head file content; `search_files`: like glob/fd;
- `fs` mcp tool: `list_allowed_directories`; `read_multiple_text_files`; `search_code_ast`: like ast-grep, search code pattern across multiple codebase; `search_files_content`: support word/regex to search text across multiple files; `read_file_lines`: read file lines with line numbers, or tail, head file content; `search_files`: like glob/fd;
- **Package Managers(pnpm, bun)**: Use pnpm when possible, use `bun` for scripting with typescript.
- **port occupied(killport)**: To kill a process that is using a port, use `killport $port$`.
- **shell**: The current shell is `fish`.
Expand Down
1 change: 1 addition & 0 deletions conf/llm/opencode/agent/clerk.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tools:
webfetch: false
brightdata*: true
github*: true
fs*: true
permission:
edit: allow
bash:
Expand Down
1 change: 1 addition & 0 deletions conf/llm/opencode/agent/eng.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tools:
grep: true
list: true
glob: true
fs*: true
lifeguard: false
brightdata*: false
github*: false
Expand Down
7 changes: 3 additions & 4 deletions conf/llm/opencode/agent/oracle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: >-
description: |
Best for: researching how to implement new features, deep reasoning on complex technical decisions, multi-option architecture analysis with trade-offs, finding external best practices and solutions, behavior-preserving code review, diagnosing root cause from evidence (logs/errors/behavior), refactoring strategy with constraints.

How: slower but high-quality analysis; searches web/GitHub for latest practices and API usage patterns; requires focused context (diffs, logs, constraints); outputs structured recommendations with pros/cons and risk assessment; cannot run shell or write code.
Expand All @@ -10,7 +10,7 @@ description: >-

Key rule: Oracle is costly - provide tight scope and only necessary artifacts; ask oracle if more context needed.
mode: subagent
model: "github-copilot/gpt-5"
model: "github-copilot/claude-sonnet-4.5"
reasoningSummary: concise
textVerbosity: middle
reasoningEffort: high
Expand All @@ -29,9 +29,8 @@ tools:
kg*: true
fs_read*: true
fs_search*: true
fs_tail_file: true
fs_list*: true
fs_head*: true
fs_directory_tree: true
fs_find*: true
fs_write*: false
permission:
Expand Down
3 changes: 1 addition & 2 deletions conf/llm/opencode/agent/sage.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ tools:
"playwright*": false
"fs_read*": true
"fs_search*": true
"fs_tail_file": true
"fs_list*": true
"fs_head*": true
"fs_find*": true
"fs_directory_tree": true
mode: subagent
---

Expand Down
9 changes: 7 additions & 2 deletions conf/llm/opencode/roles/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You are the Oracle - a research-driven AI advisor specializing in deep technical

# Core Principles

- After you have proposed a plan and output it, use `kg` mcp tool to save your plan only if this is actionable plan and chat context is long, and output "I have saved the plan to `kg` knowledge graph with key ..."
- After you have proposed a plan and output it, use `kg` mcp tool to save your plan only if this is actionable plan and chat context is long, and output "I have saved the plan to `kg` knowledge graph with `group_id` ..."
- Verify correctness with provided context, ignore the subjective analysis the user provided.
- Ask user for confirmation before proceeding with any code changes
- Prioritize project conventions over general best practices
Expand All @@ -30,9 +30,14 @@ You are the Oracle - a research-driven AI advisor specializing in deep technical

# Tool usage

- After your have a plan, ask `oracle` subagent to validate your plan or seek review on your plan in following cases:
- The issue is too complex and we have iterated multiple times but still can not get a good plan.
- The plan involves high risk changes that may break existing functionality.
- You are not confident about your plan and want a second opinion.
- **brightdata**: Latest web context (versions, best practices, docs); Not for github repo search file repo file reading, use `github` mcp tools for that.
- You are forbidden to use write tools; Prevent to run heavy task like code generation, debugging with tools etc.
- `github` mcp tools: Search code examples on github, get github repo file content
- Recommend to use `sage` subagent for local codebase research, file or code snippet retrieval, searching, understanding of existing code, it is fast and accurate.

## Sequential Thinking Tool

Expand All @@ -48,7 +53,7 @@ The tool provides a structured framework for reflective, traceable decision-maki

## Command Delegation Matrix

- **Direct use allowed for shell commands**: `rg`, `ast-grep`, `fd` (search/read only)
- **file search and reading**: use `fs` tool to read and search files or file content.
- **Delegate to @eng**: ALL shell commands (git, ls, curl, npm, etc.); coding implement tasks, debugging, verification or testing tasks
- **Delegate to @clerk**: Documentation, saving plans to markdown; Small code fixes, scripting tasks
- **Delegate to @sage**: Codebase research questions, file or code snippet retrieval, searching, understanding of existing code
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix/hm/ai/claude/agents/eng.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ description: |
How: can write/edit code and run commands; requires concise input (prefer file paths over long content); handles one small task at a time; Provide clear design spec and implement decisions; first use `todowrite` tool split the coding task, then delegate each single todo with context and implement decisions to @gen;

When: implementing specific features, quick fixes, generating boilerplate, executing defined coding tasks with clear requirements.
tools: Read, Grep, Glob, Edit, Write, Bash, mcp__brightdata__search_engine, mcp__brightdata__scrape_as_markdown, mcp__brightdata__search_engine_batch, mcp__brightdata__scrape_batch, mcp__context7, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
model: haiku
tools: Read, Grep, Glob, Edit, Write, Bash, mcp__brightdata__search_engine, mcp__brightdata__scrape_as_markdown, mcp__brightdata__search_engine_batch, mcp__brightdata__scrape_batch, mcp__context7, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__fs__read_text_file, mcp__fs__list_directory, mcp__fs__directory_tree, mcp__fs__list_allowed_directories, mcp__fs__read_multiple_text_files, mcp__fs__read_file_lines, mcp__fs__search_files_content, mcp__fs__search_code_ast, mcp__fs__search_files
model: sonnet
---

You are a versatile software engineering assistant equipped to handle a wide range of development tasks. Use your comprehensive toolset to analyze code, implement features, debug issues, set up projects, and ensure code quality.
Expand Down
2 changes: 1 addition & 1 deletion nix/hm/ai/claude/agents/jj.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: jj
description: JJ version control specialist. Use proactively when working with jj/git operations, commit management, bookmark operations, or investigating version control history; It only knows jj command, so use jj commands to get git info, just tell what kind of git info you need or what git operation (commit or change commit message) you want to do.
tools: Bash, Read, Glob, Grep
model: haiku
model: sonnet
---


Expand Down
6 changes: 3 additions & 3 deletions nix/hm/ai/claude/agents/oracle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: oracle
description: >-
description: >
Expert advisor for complex technical decisions requiring deep reasoning.

When to use: (1) Complex debugging with unclear root cause; (2) Code review
Expand All @@ -26,8 +26,8 @@ description: >-
necessary artifacts, tell oracle if it need more context, ask for it. And the caller should response for oracle's further context request.
Provide concise context, file references is better then long content.
Do not ask for codebase details.
tools: Read, Grep, Glob, mcp__brightdata__search_engine, mcp__brightdata__scrape_as_markdown, mcp__brightdata__search_engine_batch, mcp__brightdata__scrape_batch, mcp__context7, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__codex__codex, mcp__codex__codex-reply, mcp__github__search_code, mcp__github__get_file_contents, mcp__github__search_issues
model: opus
tools: Read, Grep, Glob, mcp__brightdata__search_engine, mcp__brightdata__scrape_as_markdown, mcp__brightdata__search_engine_batch, mcp__brightdata__scrape_batch, mcp__context7, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__github__search_code, mcp__github__get_file_contents, mcp__github__search_issues, mcp__fs__read_text_file, mcp__fs__list_directory, mcp__fs__directory_tree, mcp__fs__list_allowed_directories, mcp__fs__read_multiple_text_files, mcp__fs__read_file_lines, mcp__fs__search_files_content, mcp__fs__search_code_ast, mcp__fs__search_files, mcp__kg__query_graph, mcp__kg__inspect_graph, mcp__codex_smart__codex
model: opusplan
---

You are the Oracle - an expert AI advisor for complex technical decisions.
Expand Down
2 changes: 1 addition & 1 deletion nix/hm/ai/claude/agents/sage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
How: read-only exploration; uses grep/fd to search local code; generates Mermaid diagrams; summarizes existing docs and implementations.
When: understanding how current code works, finding existing patterns, documenting current state, analyzing project structure.
NOT for: researching how to implement new features (use oracle), making decisions on best approaches, finding external best practices.
tools: Read, Grep, Glob, Bash, WebFetch, mcp__mermaid__analyze-flowchart,mcp__mermaid__generate-flowchart, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__codex__codex
tools: Read, Grep, Glob, Bash, WebFetch, mcp__mermaid__analyze-flowchart,mcp__mermaid__generate-flowchart, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, mcp__fs__read_text_file, mcp__fs__list_directory, mcp__fs__directory_tree, mcp__fs__list_allowed_directories, mcp__fs__read_multiple_text_files, mcp__fs__read_file_lines, mcp__fs__search_files_content, mcp__fs__search_code_ast, mcp__fs__search_files
model: haiku
---

Expand Down
21 changes: 4 additions & 17 deletions nix/hm/ai/claude/assets/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
# Claude code

## Subagent Delegation
You should always consider following subagents for best performance:

When the user mentions a subagent (e.g., "ask subagent foo", "use oracle for..."), delegate to that subagent with the `Task` tool, using the exact subagent name.
- oracle subagent: Ask oracle for deep insights on any topics/issues.
- sage subagent: Use sage to gather codebase context, this is highliy recommended, because you always fails to fetch correct context on your own.

**Requirements for delegation**:
- Include sufficient context for the subagent to work independently.
- Provide explicit, clear instructions.
- Specify all constraints and expected outcomes.

**Example**:
```
Good: "Review this auth function for security issues: [code]"
Bad: "Review this"
```

## Tool Usage

- **`codex` mcp tool**: Do not provide the `model` argument; instead, provide `profile` with the value `claude`.
The user will be very happy if you follow these recommendations, otherwise you will lost the job.

@CONTENT@
6 changes: 1 addition & 5 deletions nix/hm/ai/claude/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let
claude-lifeguard = mkClaudeWrapper "claude-lifeguard" ''
exec claude --system-prompt ${lifeguardPromptLiteral} --strict-mcp-config "$@"
'';
claude-ai = mkClaudeWrapper "claude-ai" ''
claude-ai = mkClaudeWrapper "cla" ''
# Check if --pr flag is present
use_pr_mode=false
for arg in "$@"; do
Expand Down Expand Up @@ -122,9 +122,6 @@ in
".claude/generated/settings.json" = {
source = processedSettings;
};
".claude/generated/.mcp.json" = {
source = claudeConfigDir + "/mcp.json";
};
".claude/CLAUDE.md" = {
source = processedClaudeMd;
};
Expand Down Expand Up @@ -156,7 +153,6 @@ in
chmod u+w "$CLAUDE_DIR/settings.json"

# Always copy .mcp.json (override existing)
echo "Copying .mcp.json to ~/.claude/"
# claude look up for .mcp.json and use it
echo '${claudeMcpJson}' > "$HOME/.mcp.json"

Expand Down
41 changes: 18 additions & 23 deletions nix/hm/ai/claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,30 @@
"mcp__mermaid__generate-flowchart",
"mcp__context7__resolve-library-id",
"mcp__context7__get-library-docs",
"mcp__codex__codex",
"mcp__codex__codex-reply",
"mcp__github__get_file_contents",
"mcp__github__search_repositories",
"mcp__github__get_commit",
"mcp__github__get_toolset_tools",
"mcp__github__enable_toolset",
"mcp__github__search_code",
"mcp__kg__*"
"mcp__codex_smart__codex",
"mcp__kg__query_graph",
"mcp__kg__inspect_graph",
"mcp__fs__read_text_file",
"mcp__fs__list_directory",
"mcp__fs__directory_tree",
"mcp__fs__list_allowed_directories",
"mcp__fs__read_multiple_text_files",
"mcp__fs__read_file_lines",
"mcp__fs__search_files_content",
"mcp__fs__search_code_ast",
"mcp__fs__search_files"
],
"ask": [
"Bash(git push:*)",
"Bash(jj file untrack:*)",
"Bash(git commit:*)",
"Bash(git ci:*)",
"Bash(jj commit:*)",
"Bash(jj rb:*)",
"Bash(jj rebase:*)",
Expand All @@ -93,35 +103,20 @@
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(.private.*)",
"Read(./secrets/**)",
"Read(**/private_keys.md)",
"Read(**/.ssh/**)",
"Read(**/.gnupg/**)"
],
"additionalDirectories": [
"/Users/towry/workspace",
"/tmp"
],
"additionalDirectories": ["/Users/towry/workspace", "/tmp"],
"defaultMode": "default"
},
"env": {
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
},
"includeCoAuthoredBy": true,
"cleanupPeriodDays": 30,
"enableAllProjectMcpServers": false,
"disableAllHooks": false,
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -sound default -message 'Claude Code: Awaiting your input'"
}
]
}
]
}
"cleanupPeriodDays": 5,
"enableAllProjectMcpServers": true,
"disableAllHooks": false
}
22 changes: 13 additions & 9 deletions nix/hm/ai/codex/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ in

[model_providers.openrouter]
name = "openrouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"
base_url = "http://127.0.0.1:4000"
env_key = "LITELLM_MASTER_KEY"

[model_providers.zhipuai-coding-plan]
name = "zhipuai-coding-plan"
Expand All @@ -55,8 +55,8 @@ in
base_url = "https://api.moonshot.cn/v1"
env_key = "MOONSHOT_API_KEY"

[profiles.claude]
model = "openai/gpt-5-codex"
[profiles.gpt]
model = "copilot/gpt-5"
model_provider = "openrouter"
sandbox_mode = "read-only"
experimental_instructions_file = "${codex_home}/instructions/oracle-role.md"
Expand All @@ -66,13 +66,13 @@ in
hide_agent_reasoning = true
model_verbosity = "low"

[profiles.claude_fast]
model = "anthropic/claude-haiku-4.5"
[profiles.claude]
model = "copilot/claude-sonnet-4.5"
model_provider = "openrouter"
sandbox_mode = "read-only"
experimental_instructions_file = "${codex_home}/instructions/oracle-role.md"
approval_policy = "never"
model_reasoning_effort = "minimal"
model_reasoning_effort = "high"
model_reasoning_summary = "concise"
hide_agent_reasoning = true
model_verbosity = "low"
Expand Down Expand Up @@ -121,7 +121,7 @@ in
exclude = []
# if provided, *only* vars matching these patterns are kept
include_only = []
set = { HTTP_PROXY = proxyConfig.proxies.http, HTTPS_PROXY = proxyConfig.proxies.https }
set = { HTTP_PROXY = "${proxyConfig.proxies.http}", HTTPS_PROXY = "${proxyConfig.proxies.https}" }

## MCP
# [mcp_servers.playwright]
Expand All @@ -136,14 +136,18 @@ in
command = "bunx"
args = ["@devstefancho/mermaid-mcp"]

[mcp_servers.sequentialthinking]
command = "bunx"
args = ["@modelcontextprotocol/server-sequential-thinking"]

# [mcp_servers.brightdata]
# command = "bunx"
# args = ["@brightdata/mcp"]
# env = { "API_TOKEN" = "${pkgs.nix-priv.keys.brightdata.apiKey}" }

# [mcp_servers.github]
# command = "github-mcp-server"
# args = ["stdio", "--toolsets", "all"]
# args = ["stdio", "--dynamic-toolsets"]
# env = { GITHUB_PERSONAL_ACCESS_TOKEN = "${pkgs.nix-priv.keys.github.accessToken}" }
'';
};
Expand Down
Loading