Skip to content
Closed
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
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ inputs:
description: "Force tag mode with tracking comments for pull_request and issue events. Only applicable to pull_request (opened, synchronize, ready_for_review, reopened) and issue (opened, edited, labeled, assigned) events."
required: false
default: "false"
concise_comments:
description: "Use <details> blocks to collapse verbose content in comments (keeps PR threads clean)"
required: false
default: "true"
path_to_claude_code_executable:
description: "Optional path to a custom Claude Code executable. If provided, skips automatic installation and uses this executable instead. WARNING: Using an older version may cause problems if the action begins taking advantage of new Claude Code features. This input is typically not needed unless you're debugging something specific or have unique needs in your environment."
required: false
Expand Down Expand Up @@ -177,6 +181,7 @@ runs:
BOT_ID: ${{ inputs.bot_id }}
BOT_NAME: ${{ inputs.bot_name }}
TRACK_PROGRESS: ${{ inputs.track_progress }}
CONCISE_COMMENTS: ${{ inputs.concise_comments }}
ADDITIONAL_PERMISSIONS: ${{ inputs.additional_permissions }}
CLAUDE_ARGS: ${{ inputs.claude_args }}
ALL_INPUTS: ${{ toJson(inputs) }}
Expand Down
1 change: 1 addition & 0 deletions bun.lock

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

42 changes: 42 additions & 0 deletions src/create-prompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,46 @@ export function getEventTypeAndContext(envVars: PreparedContext): {
}
}

function getConciseCommentsInstructions(): string {
return `
COMMENT FORMATTING FOR CLEAN PR THREADS:
Your comments should be scannable and not clutter the PR thread. Follow this format:

1. Keep the visible summary brief (1-3 sentences describing what you did or your answer)
2. Use <details> blocks for anything verbose:
- Detailed explanations or reasoning
- Code snippets longer than 10 lines
- Command output or logs
- Step-by-step breakdowns
- Full error messages or stack traces
- File lists or lengthy enumerations

Example format:
\`\`\`
### Summary
Fixed the authentication bug by updating token validation in \`auth.ts\`.

<details>
<summary>📝 Detailed changes</summary>

The issue was in the \`validateToken()\` function which wasn't checking token expiry...

</details>

<details>
<summary>📋 Files modified</summary>

- \`src/auth/auth.ts\` - Updated token validation
- \`src/auth/types.ts\` - Added new error type
- \`tests/auth.test.ts\` - Added test coverage

</details>
\`\`\`

This keeps the PR thread readable while preserving all details for those who want them.
`;
}

function getCommitInstructions(
eventData: EventData,
githubData: FetchDataResult,
Expand Down Expand Up @@ -559,6 +599,7 @@ Communication:
- Use mcp__github_comment__update_claude_comment to update (only "body" param needed)
- Use checklist format for tasks: - [ ] incomplete, - [x] complete
- Use ### headers (not #)
${context.githubContext?.inputs.conciseComments ? getConciseCommentsInstructions() : ""}
${getCommitInstructions(eventData, githubData, context, useCommitSigning)}
${
eventData.claudeBranch
Expand Down Expand Up @@ -801,6 +842,7 @@ ${
- REPOSITORY SETUP INSTRUCTIONS: The repository's CLAUDE.md file(s) contain critical repo-specific setup instructions, development guidelines, and preferences. Always read and follow these files, particularly the root CLAUDE.md, as they provide essential context for working with the codebase effectively.
- Use h3 headers (###) for section titles in your comments, not h1 headers (#).
- Your comment must always include the job run link in the format "[View job run](${GITHUB_SERVER_URL}/${context.repository}/actions/runs/${process.env.GITHUB_RUN_ID})" at the bottom of your response (branch link if there is one should also be included there).
${context.githubContext?.inputs.conciseComments ? getConciseCommentsInstructions() : ""}

CAPABILITIES AND LIMITATIONS:
When users ask you to do something, be aware of what you can and cannot do. This section helps you understand how to respond when users request actions outside your scope.
Expand Down
2 changes: 2 additions & 0 deletions src/github/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type BaseContext = {
allowedBots: string;
allowedNonWriteUsers: string;
trackProgress: boolean;
conciseComments: boolean;
};
};

Expand Down Expand Up @@ -150,6 +151,7 @@ export function parseGitHubContext(): GitHubContext {
allowedBots: process.env.ALLOWED_BOTS ?? "",
allowedNonWriteUsers: process.env.ALLOWED_NON_WRITE_USERS ?? "",
trackProgress: process.env.TRACK_PROGRESS === "true",
conciseComments: (process.env.CONCISE_COMMENTS ?? "true") === "true",
},
};

Expand Down
1 change: 1 addition & 0 deletions test/install-mcp-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe("prepareMcpConfig", () => {
allowedBots: "",
allowedNonWriteUsers: "",
trackProgress: false,
conciseComments: true,
},
};

Expand Down
1 change: 1 addition & 0 deletions test/mockContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const defaultInputs = {
allowedBots: "",
allowedNonWriteUsers: "",
trackProgress: false,
conciseComments: true,
};

const defaultRepository = {
Expand Down
1 change: 1 addition & 0 deletions test/modes/detector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe("detectMode with enhanced routing", () => {
allowedBots: "",
allowedNonWriteUsers: "",
trackProgress: false,
conciseComments: true,
},
};

Expand Down
1 change: 1 addition & 0 deletions test/permissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe("checkWritePermissions", () => {
allowedBots: "",
allowedNonWriteUsers: "",
trackProgress: false,
conciseComments: true,
},
});

Expand Down