Skip to content

Commit 4c956bd

Browse files
authored
Add git read-only permissions to project-manager (#63)
* feat: add git read-only permissions to project-manager (#62) - Add git status, branch, log, show, diff commands to PM read-only capabilities - Enable PM to check repository state directly without delegation - Update opencode.work.json and opencode.personal.json with new git tools - Document PM git read-only permissions in project-manager.txt - Update workflow-standards.md with clarified PM permissions - Update shortcut-cli-awareness.md with PM capabilities * fix: remove gh issue create/edit from PM - align config with docs (#62)
1 parent 3a6cbc0 commit 4c956bd

5 files changed

Lines changed: 90 additions & 52 deletions

File tree

‎instructions/shortcut-cli-awareness.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ The PM can query Shortcut directly for:
1919
- Listing projects: `short projects`
2020
- Checking workspaces: `short workspace "current sprint"`
2121

22-
### When to Use gh Issue CLI Directly
22+
### When to Use gh Issue CLI Directly (Read-Only)
2323

24-
The PM can manage GitHub issues directly for:
24+
The PM can query GitHub issues directly for:
2525
- Viewing issues: `gh issue view 123`
2626
- Listing issues: `gh issue list --limit 20`
27-
- Creating issues: `gh issue create --title "..." --body "..."`
28-
- Editing issues: `gh issue edit 123 --add-label "shortcut:sc-45678"`
27+
28+
The PM must delegate to @git-agent for:
29+
- Creating issues: Delegate with title and body
30+
- Editing issues: Delegate for label/state changes
2931

3032
### What PM Still Delegates to Git Agent
3133

‎instructions/workflow-standards.md‎

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88

99
**GITHUB OPERATIONS:** Use `gh` CLI exclusively (never browser, never API calls)
1010

11-
**PROJECT MANAGER:** Delegate ALL GitHub operations to @git-agent
12-
- `gh issue view/list` - Checking if issues exist
13-
- `gh issue create` - Creating issues
14-
- `gh pr view/list/create` - PR operations
15-
- `gh run view/watch` - CI status checks
11+
**PROJECT MANAGER:** Can run read-only git and GitHub operations, delegates state-changing operations to @git-agent
12+
- `gh issue view/list` - Can run directly (read-only)
13+
- `gh issue create/edit` - Delegate to @git-agent (write)
14+
- `gh pr view/list` - Can run directly (read-only)
15+
- `gh pr create/merge` - Delegate to @git-agent (write)
16+
- `gh run view/watch` - Can run directly (monitoring)
17+
- `git status/branch/log/show/diff` - Can run directly (read-only)
18+
- Git write operations (commit, push, merge) - Delegate to @git-agent
1619

1720
---
1821

@@ -48,8 +51,9 @@
4851
- **REFUSE ALL DEVELOPMENT WORK** without proper GitHub issue tracking
4952
- **INCLUDE ISSUE REFERENCE** in all commits and communications
5053

51-
**PROJECT MANAGER NOTE:** You have NO bash access and cannot run `gh` commands directly.
52-
Always delegate GitHub verification and operations to @git-agent.
54+
**PROJECT MANAGER NOTE:** You have SELECTIVE bash access for read-only git and GitHub operations.
55+
You can directly check: `git status`, `git log`, `git branch`, `gh issue view/list`, `gh pr view/list`, `gh run view/watch`
56+
Delegate state-changing operations (commits, pushes, PR creation, issue creation) to @git-agent.
5357

5458
---
5559

@@ -237,15 +241,25 @@ Add comprehensive test suite for token refresh logic including:
237241
- ✅ Report work complete to PM
238242
- ✅ Read git status/log for context
239243

240-
### Project Manager Constraints
244+
### Project Manager Permissions & Constraints
241245

242-
- **YOU HAVE NO BASH ACCESS** - Cannot run `gh` commands directly
243-
- **DEVELOPMENT tasks**: Delegate to @git-agent to verify/create GitHub issue FIRST
246+
**✅ You CAN execute directly (read-only operations):**
247+
- `git status`, `git branch`, `git log`, `git show`, `git diff` - Repository inspection
248+
- `gh issue view`, `gh issue list` - Check issue status and details
249+
- `gh pr view`, `gh pr list` - Check PR status and details
250+
- `gh run view`, `gh run watch` - Monitor CI status in real-time
251+
- `remory *` - All memory operations for context persistence
252+
253+
**❌ You MUST delegate to @git-agent (state-changing operations):**
254+
- `git add`, `git commit`, `git push`, `git pull`, `git merge`, `git rebase` - Version control writes
255+
- `gh issue create`, `gh issue edit` - GitHub issue state changes
256+
- `gh pr create`, `gh pr merge`, `gh pr review` - PR state changes
257+
258+
**Development workflow:**
259+
- **DEVELOPMENT tasks**: Use git status/branch/log to verify state, delegate state-changing ops to @git-agent
244260
- **RESEARCH tasks**: Delegate directly to appropriate specialist (no issue needed)
245-
- **ALL GITHUB OPERATIONS**: Delegate to @git-agent (issues, PRs, CI checks)
246-
- Wait for @git-agent confirmation before proceeding with work delegation
247261
- Ensure agents follow feature branch workflow for development
248-
- Delegate CI monitoring to @git-agent before declaring completion
262+
- You can monitor CI progress with `gh run watch` before declaring completion
249263
- Coordinate PR creation through @git-agent
250264

251265
### Workflow After Code Ready

‎opencode.personal.json‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,31 @@
1313
"description": "Pure orchestrator that coordinates specialists but never executes code - read-only tools and delegation only",
1414
"mode": "primary",
1515
"prompt": "{file:prompts/project-manager.txt}",
16-
"permission": {
17-
"bash": {
18-
"remory *": "allow",
19-
"export PROJECT_ID=*": "allow",
20-
"cat *": "allow",
21-
"uuidgen*": "allow",
22-
"echo*": "allow",
23-
"tee*": "allow",
24-
"rg*": "allow",
25-
"jq*": "allow",
26-
"wc*": "allow",
27-
"gh issue view*": "allow",
28-
"gh issue list*": "allow",
29-
"gh issue create*": "allow",
30-
"gh issue edit*": "allow",
31-
"*": "deny"
32-
},
16+
"permission": {
17+
"bash": {
18+
"remory *": "allow",
19+
"export PROJECT_ID=*": "allow",
20+
"cat *": "allow",
21+
"uuidgen*": "allow",
22+
"echo*": "allow",
23+
"tee*": "allow",
24+
"rg*": "allow",
25+
"jq*": "allow",
26+
"wc*": "allow",
27+
"gh issue view*": "allow",
28+
"gh issue list*": "allow",
29+
"git status*": "allow",
30+
"git branch*": "allow",
31+
"git log*": "allow",
32+
"git show*": "allow",
33+
"git diff*": "allow",
34+
"git remote*": "allow",
35+
"git config --get*": "allow",
36+
"git rev-parse*": "allow",
37+
"git merge-base*": "allow",
38+
"git tag*": "allow",
39+
"*": "deny"
40+
},
3341
"write": "deny",
3442
"edit": "deny"
3543
},

‎opencode.work.json‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,31 @@
1414
"description": "Pure orchestrator that coordinates specialists but never executes code - read-only tools and delegation only",
1515
"mode": "primary",
1616
"prompt": "{file:prompts/project-manager.txt}",
17-
"permission": {
18-
"bash": {
19-
"remory *": "allow",
20-
"export PROJECT_ID=*": "allow",
21-
"cat *": "allow",
22-
"uuidgen*": "allow",
23-
"echo*": "allow",
24-
"tee*": "allow",
25-
"rg*": "allow",
26-
"jq*": "allow",
27-
"wc*": "allow",
28-
"gh issue view*": "allow",
29-
"gh issue list*": "allow",
30-
"gh issue create*": "allow",
31-
"gh issue edit*": "allow",
32-
"*": "deny"
33-
},
17+
"permission": {
18+
"bash": {
19+
"remory *": "allow",
20+
"export PROJECT_ID=*": "allow",
21+
"cat *": "allow",
22+
"uuidgen*": "allow",
23+
"echo*": "allow",
24+
"tee*": "allow",
25+
"rg*": "allow",
26+
"jq*": "allow",
27+
"wc*": "allow",
28+
"gh issue view*": "allow",
29+
"gh issue list*": "allow",
30+
"git status*": "allow",
31+
"git branch*": "allow",
32+
"git log*": "allow",
33+
"git show*": "allow",
34+
"git diff*": "allow",
35+
"git remote*": "allow",
36+
"git config --get*": "allow",
37+
"git rev-parse*": "allow",
38+
"git merge-base*": "allow",
39+
"git tag*": "allow",
40+
"*": "deny"
41+
},
3442
"write": "deny",
3543
"edit": "deny"
3644
},

‎prompts/project-manager.txt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Before ANY delegation, ensure you have ALL required information:
6262
YOU NEVER:
6363
- ❌ Write code, edit files, or create implementations
6464
- ❌ Run tests, linting, or build commands
65-
- ❌ Execute arbitrary bash commands - you have SELECTIVE bash for remory CLI only
65+
- ❌ Execute arbitrary bash commands - you have SELECTIVE bash for remory CLI + git inspection only
6666
- ❌ Make git commits, create branches, or push code
6767
- ❌ Fix bugs, debug code, or modify implementations
6868
- ❌ Install dependencies or configure environments
@@ -95,6 +95,12 @@ That's investigation work. That's @research-specialist's job.
9595
- ✅ Coordinate between specialists for multi-domain work
9696
- ✅ Ask users for approval on documentation and major decisions
9797

98+
✅ **Git read-only operations** (coordination/inspection only):
99+
- Status: `git status`, `git branch --show-current`, `git branch`
100+
- History: `git log`, `git show`, `git diff`
101+
- Configuration: `git remote`, `git config --get`
102+
- Coordination: `git merge-base`, `git rev-parse`
103+
98104
**🔥 YOU HAVE SELECTIVE BASH ACCESS FOR REMORY CLI:**
99105
✅ You CAN run: remory search, remory add (with inline file reading pattern)
100106
✅ Use remory CLI DIRECTLY - do NOT delegate memory operations to other agents

0 commit comments

Comments
 (0)