Sfoglia il codice sorgente

feat: force Claude to communicate only via issue comments

Modified the Claude callback prompt to enforce strict output requirements:
- Claude must ONLY respond via mcp__gogs__create_issue_comment tool
- All text output, questions, progress updates, and responses must be posted as issue comments
- Direct text output is forbidden

This ensures all Claude responses are visible and tracked in the issue thread,
improving transparency and eliminating silent execution output.

Updated documentation to reflect this behavior change.
Claude 9 mesi fa
parent
commit
dea6ef0215
2 ha cambiato i file con 75 aggiunte e 2 eliminazioni
  1. 27 2
      docs/CLAUDE-AUTOMATION.md
  2. 48 0
      scripts/handle-issue.sh

+ 27 - 2
docs/CLAUDE-AUTOMATION.md

@@ -223,10 +223,34 @@ Before you start any work on this issue, you MUST complete these steps IN ORDER:
 === YOUR TASK ===
 [Instructions here]
 
+=== CRITICAL OUTPUT REQUIREMENTS ===
+
+YOU MUST FOLLOW THESE OUTPUT RULES STRICTLY:
+
+1. DO NOT output any text responses to the user
+2. DO NOT print any messages, explanations, or status updates
+3. DO NOT use echo or any command-line output tools
+4. ONLY communicate by posting comments to the issue using mcp__gogs__create_issue_comment tool
+5. ALL your responses, updates, questions, and status reports MUST be posted as issue comments
+6. You are FORBIDDEN from producing any output except through the Gogs MCP comment tool
+
+When you need to:
+- Ask questions → Post a comment on the issue
+- Report progress → Post a comment on the issue
+- Share results → Post a comment on the issue
+- Report errors → Post a comment on the issue
+- Provide any information → Post a comment on the issue
+
+Use mcp__gogs__create_issue_comment with:
+- owner: owner
+- repo: repo
+- number: 42
+- body: [your message here]
+
 DO NOT skip reading the comments using the MCP tools. This is critical.
 ```
 
-This ensures Claude always has the complete conversation context.
+This ensures Claude always has the complete conversation context and **forces Claude to communicate only through issue comments**, preventing any direct text output.
 
 ## Workflow Example
 
@@ -277,7 +301,8 @@ This ensures Claude always has the complete conversation context.
    - Reads codebase
    - Implements feature
    - Commits changes
-   - Uses `mcp__gogs__create_issue_comment` to comment on issue
+   - **IMPORTANT**: Uses `mcp__gogs__create_issue_comment` to post ALL responses, updates, and questions to the issue
+   - **NO direct output**: Claude does not print any text - all communication is via issue comments
 
 7. **Job completes** → Next job starts (if any)
 

+ 48 - 0
scripts/handle-issue.sh

@@ -101,6 +101,30 @@ This issue is assigned to you. You must:
 2. Understand the full discussion context
 3. Then proceed with the appropriate action based on the complete conversation
 
+=== CRITICAL OUTPUT REQUIREMENTS ===
+
+YOU MUST FOLLOW THESE OUTPUT RULES STRICTLY:
+
+1. DO NOT output any text responses to the user
+2. DO NOT print any messages, explanations, or status updates
+3. DO NOT use echo or any command-line output tools
+4. ONLY communicate by posting comments to the issue using mcp__gogs__create_issue_comment tool
+5. ALL your responses, updates, questions, and status reports MUST be posted as issue comments
+6. You are FORBIDDEN from producing any output except through the Gogs MCP comment tool
+
+When you need to:
+- Ask questions → Post a comment on the issue
+- Report progress → Post a comment on the issue
+- Share results → Post a comment on the issue
+- Report errors → Post a comment on the issue
+- Provide any information → Post a comment on the issue
+
+Use mcp__gogs__create_issue_comment with:
+- owner: $OWNER
+- repo: $REPO
+- number: $ISSUE_NUMBER
+- body: [your message here]
+
 DO NOT skip reading the comments using the MCP tools. This is critical to understanding the full context."
 
 else
@@ -143,6 +167,30 @@ This issue is assigned to you. You must:
 2. Understand the full discussion context (even if there are no comments yet)
 3. Then proceed with the appropriate action
 
+=== CRITICAL OUTPUT REQUIREMENTS ===
+
+YOU MUST FOLLOW THESE OUTPUT RULES STRICTLY:
+
+1. DO NOT output any text responses to the user
+2. DO NOT print any messages, explanations, or status updates
+3. DO NOT use echo or any command-line output tools
+4. ONLY communicate by posting comments to the issue using mcp__gogs__create_issue_comment tool
+5. ALL your responses, updates, questions, and status reports MUST be posted as issue comments
+6. You are FORBIDDEN from producing any output except through the Gogs MCP comment tool
+
+When you need to:
+- Ask questions → Post a comment on the issue
+- Report progress → Post a comment on the issue
+- Share results → Post a comment on the issue
+- Report errors → Post a comment on the issue
+- Provide any information → Post a comment on the issue
+
+Use mcp__gogs__create_issue_comment with:
+- owner: $OWNER
+- repo: $REPO
+- number: $ISSUE_NUMBER
+- body: [your message here]
+
 DO NOT skip reading the comments using the MCP tools. This is critical to understanding the full context."
 fi