Skip to content

Commit d231ea8

Browse files
committed
Update project from 'agents-common' Copier template (HEAD).
1 parent 7ec4ef8 commit d231ea8

File tree

19 files changed

+1432
-63
lines changed

19 files changed

+1432
-63
lines changed
Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,41 @@
1111
- Check README files in directories you're working with for insights about architecture, constraints, and TODO items.
1212
- Update files under `.auxiliary/notes` during conversation, removing completed tasks and adding emergent items.
1313

14+
<!-- OPENSPEC:START -->
15+
# OpenSpec Instructions
16+
17+
These instructions are for AI assistants working in this project.
18+
19+
Always open `@/openspec/AGENTS.md` when the request:
20+
- Mentions planning or proposals (words like proposal, spec, change, plan)
21+
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
22+
- Sounds ambiguous and you need the authoritative spec before coding
23+
24+
Use `@/openspec/AGENTS.md` to learn:
25+
- How to create and apply change proposals
26+
- Spec format and conventions
27+
- Project structure and guidelines
28+
29+
Keep this managed block so 'openspec update' can refresh the instructions.
30+
31+
<!-- OPENSPEC:END -->
32+
33+
# Development Standards
34+
35+
Before implementing code changes, consult these files in `.auxiliary/instructions/`:
36+
- `practices.rst` - General development principles (robustness, immutability, exception chaining)
37+
- `practices-python.rst` - Python-specific patterns (module organization, type annotations, wide parameter/narrow return)
38+
- `nomenclature.rst` - Naming conventions for variables, functions, classes, exceptions
39+
- `style.rst` - Code formatting standards (spacing, line length, documentation mood)
40+
- `validation.rst` - Quality assurance requirements (linters, type checkers, tests)
41+
1442
# Operation
1543

1644
- Use `rg --line-number --column` to get precise coordinates for MCP tools that require line/column positions.
1745
- Choose appropriate editing tools based on the task complexity and your familiarity with the tools.
18-
- Consider `mcp__pyright__edit_file` for more reliable line-based editing than context-based `Edit`/`MultiEdit` when making complex changes.
19-
- Use pyright MCP tools where appropriate: `rename_symbol` for refactors, `hover` for getting function definitions without searching through code, `references` for precise symbol analysis.
46+
- Use the 'pyright' MCP server where appropriate:
47+
- `rename_symbol` for refactors
48+
- `references` for precise symbol analysis
2049
- Batch related changes together when possible to maintain consistency.
2150
- Use relative paths rather than absolute paths when possible.
2251
- Do not write to paths outside the current project unless explicitly requested.
@@ -25,7 +54,7 @@
2554
# Commits
2655

2756
- Use `git status` to ensure all relevant changes are in the changeset.
28-
- Do **not** commit without explicit user approval. Unless the user has requested the commit, ask for a review of your edits first.
57+
- Do **not** commit without explicit user approval. Unless the user has requested the commit, **ask first** for a review of your work.
2958
- Use present tense, imperative mood verbs (e.g., "Fix" not "Fixed").
3059
- Write sentences with proper punctuation.
3160
- Include a `Co-Authored-By:` field as the final line. Should include the model name and a no-reply address.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Command wrapper for Claude Code web environments.
4+
5+
This script wraps command execution via Python subprocess to bypass
6+
Bash tool permission restrictions in Claude Code web environments.
7+
8+
Usage:
9+
bash-tool-bypass <command> [arguments...]
10+
11+
Examples:
12+
bash-tool-bypass gh --version
13+
bash-tool-bypass gh pr view 1
14+
bash-tool-bypass gh pr list --limit 5
15+
bash-tool-bypass gh issue view 42 --json title,state,author
16+
bash-tool-bypass gh repo view owner/repo
17+
bash-tool-bypass some-other-restricted-command --flag value
18+
19+
Notes:
20+
- This wrapper is designed to bypass specific command restrictions in
21+
Claude Code
22+
- Common use case is running 'gh' commands when Bash tool blocks them
23+
directly
24+
- Any command accessible in PATH can be executed through this wrapper
25+
- Authentication/permissions still apply to the wrapped command itself
26+
"""
27+
28+
import subprocess
29+
import sys
30+
31+
# Minimum required argument count (script name + command)
32+
MIN_ARGS = 2
33+
34+
35+
def main():
36+
"""Execute command via subprocess and exit with its return code."""
37+
if len(sys.argv) < MIN_ARGS:
38+
print(__doc__)
39+
sys.exit(1)
40+
41+
# Build command with all arguments
42+
cmd = sys.argv[1:]
43+
44+
# Execute command (intentionally passes through untrusted input)
45+
result = subprocess.run(cmd, check=False) # noqa: S603
46+
47+
# Exit with command's return code
48+
sys.exit(result.returncode)
49+
50+
51+
if __name__ == '__main__':
52+
main()
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Claude Code (Web) Session Setup
2+
3+
**Instructions for Claude instances**: Execute the following setup steps at the beginning of each Claude Code (Web) session to ensure all required tools are available.
4+
5+
## Required Setup Steps
6+
7+
### 1. Install System Packages
8+
9+
Install GitHub CLI from the latest release (ensures latest version instead of older Ubuntu package).
10+
11+
First, get the latest version number:
12+
13+
```bash
14+
wget https://github.com/cli/cli/releases/latest -O - 2>&1 | grep -oP 'href="/cli/cli/releases/tag/v\K[0-9.]+' | head -1
15+
```
16+
17+
Then download and install, substituting the version number from above:
18+
19+
```bash
20+
wget -O /tmp/gh_VERSION_linux_amd64.deb https://github.com/cli/cli/releases/download/vVERSION/gh_VERSION_linux_amd64.deb
21+
```
22+
23+
```bash
24+
dpkg -i /tmp/gh_VERSION_linux_amd64.deb
25+
```
26+
27+
### 2. Install Core Python Tools
28+
29+
```bash
30+
uv tool install hatch
31+
uv tool install copier
32+
uv tool install emcd-agents
33+
```
34+
35+
### 3. Populate Project Agents
36+
37+
```bash
38+
agentsmgr populate project github:emcd/agents-common@master#defaults
39+
```
40+
41+
### 4. Configure Environment
42+
43+
Set up Go paths for persistent access. Append to `~/.local/bin/env`:
44+
45+
```bash
46+
cat >> ~/.local/bin/env << 'EOF'
47+
48+
# Add Go bin to PATH
49+
export GOPATH="${HOME}/.local/share/go"
50+
case ":${PATH}:" in
51+
*:"${GOPATH}/bin":*)
52+
;;
53+
*)
54+
export PATH="${GOPATH}/bin:${PATH}"
55+
;;
56+
esac
57+
EOF
58+
```
59+
60+
Source the updated environment:
61+
62+
```bash
63+
source ~/.local/bin/env
64+
```
65+
66+
### 5. Install Language Servers
67+
68+
Install `mcp-language-server` (proxies language servers for MCP):
69+
70+
```bash
71+
go install github.com/isaacphi/mcp-language-server@latest
72+
```
73+
74+
Install Pyright (Python language server):
75+
76+
```bash
77+
npm install -g pyright
78+
```
79+
80+
Install Ruff (Python linter/formatter):
81+
82+
```bash
83+
uv tool install ruff
84+
```
85+
86+
### 6. Setup Bash Tool Bypass Wrapper
87+
88+
Copy the bash-tool-bypass script to PATH for accessing restricted commands:
89+
90+
```bash
91+
cp .auxiliary/configuration/coders/claude/miscellany/bash-tool-bypass ~/.local/bin/
92+
chmod +x ~/.local/bin/bash-tool-bypass
93+
```
94+
95+
## Notes
96+
97+
- The `.mcp.json` configuration expects these tools to be in PATH
98+
- The `bash-tool-bypass` wrapper enables execution of commands restricted by Claude Code Bash tool permissions

.auxiliary/configuration/coders/claude/settings.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
},
4040
"permissions": {
4141
"auto_allow": [
42+
"mcp__context7__get-library-docs",
43+
"mcp__context7__resolve-library-id",
44+
"mcp__librovore__query_content",
45+
"mcp__librovore__query_inventory",
46+
"mcp__pyright__definition",
47+
"mcp__pyright__diagnostics",
48+
"mcp__pyright__edit_file",
49+
"mcp__pyright__hover",
50+
"mcp__pyright__references",
51+
"mcp__pyright__rename_symbol",
52+
"Bash(hatch run *)",
53+
"Bash(hatch --env develop run *)",
4254
"Bash(awk *)",
4355
"Bash(cat *)",
4456
"Bash(cut *)",
@@ -68,8 +80,6 @@
6880
"Bash(git show *)",
6981
"Bash(git status)",
7082
"Bash(grep *)",
71-
"Bash(hatch run python *)",
72-
"Bash(hatch --env develop run *)",
7383
"Bash(head *)",
7484
"Bash(ls *)",
7585
"Bash(ps *)",
@@ -80,15 +90,7 @@
8090
"Bash(tail *)",
8191
"Bash(uniq *)",
8292
"Bash(wc *)",
83-
"Bash(which *)",
84-
"mcp__context7__get-library-docs",
85-
"mcp__context7__resolve-library-id",
86-
"mcp__pyright__definition",
87-
"mcp__pyright__diagnostics",
88-
"mcp__pyright__edit_file",
89-
"mcp__pyright__hover",
90-
"mcp__pyright__references",
91-
"mcp__pyright__rename_symbol"
93+
"Bash(which *)"
9294
]
9395
},
9496
"sandbox": {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
# Process Title
3+
4+
Brief introductory paragraph explaining the purpose.
5+
6+
Target/input description: {{args}}
7+
8+
## Context
9+
10+
- Current state checks, if applicable: !{command1}
11+
- Environment info, if applicable: !{command2}
12+
- Relevant data, if applicable: !{command3}
13+
14+
## Prerequisites
15+
16+
Before running this process, ensure:
17+
- Prerequisite 1
18+
- Prerequisite 2
19+
- @-references to relevant guides if applicable
20+
21+
## Process Summary
22+
23+
Key functional areas:
24+
1. **Phase 1**: Description
25+
2. **Phase 2**: Description
26+
3. **Phase 3**: Description
27+
28+
## Safety Requirements
29+
30+
Stop and consult the user if:
31+
- List validation conditions
32+
- Error conditions that require user input
33+
- Unexpected situations
34+
35+
## Execution
36+
37+
Execute the following steps:
38+
39+
### 1. Step Name
40+
Description of what this step does.
41+
42+
### 2. Step Name
43+
More steps as needed.

0 commit comments

Comments
 (0)