浏览代码

docs: document label-aware behavior in CLAUDE.md #25

- Add {{issue_labels}} to variable substitution documentation
- Document label-aware behavior feature in TypeScript Client section
- Explain how question, documentation, bug, and enhancement labels work

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 9 月之前
父节点
当前提交
8b79b93b5a
共有 1 个文件被更改,包括 29 次插入0 次删除
  1. 29 0
      CLAUDE.md

+ 29 - 0
CLAUDE.md

@@ -255,6 +255,7 @@ Commands in `commands.json` and legacy `.env` commands support variable substitu
 - `{{issue_action}}` - Issue action (opened, closed, reopened, etc.)
 - `{{issue_body}}` - Issue description/body (issue events)
 - `{{issue_assignee}}` - Username of person assigned to issue (issue events)
+- `{{issue_labels}}` - Comma-separated list of issue label names (issue/issue_comment events)
 - `{{comment_body}}` - Comment text (issue_comment events)
 
 Variables are extracted in `commandExecutor.js` via `extractVariables()` and substituted via `substituteVariables()`.
@@ -330,12 +331,40 @@ npm run build
 - Processes issues assigned to Claude
 - Responds to issue comments automatically
 - Environment-specific configuration via `.env`
+- **Label-aware behavior** - Adjusts behavior based on issue labels (question, documentation, bug, enhancement)
 - **Per-repository MCP configuration support** - Different repositories can use different MCP servers
 - **Dynamic tool discovery** - Automatically discovers available tools from all configured MCP servers
 - **Automatic repository management** - Clones repositories on demand and pulls latest changes
 - **Environment setup** - Handles HOME, PATH, and XDG directory configuration
 - **Git URL from Gogs API** - Fetches SSH URL dynamically from Gogs instead of hardcoding
 
+### Label-Aware Behavior
+
+The Claude agent automatically adjusts its behavior based on issue labels:
+
+**🔴 "question" label:**
+- DO NOT implement any code changes
+- Provide information, guidance, and answers only
+- May read code to understand context, but won't modify files
+- Focus on helpful explanations and clarifications
+
+**📚 "documentation" label:**
+- Focus on creating/updating documentation files
+- Acceptable changes: README.md, CLAUDE.md, other .md files, code comments
+- Avoid implementation changes unless needed for documentation examples
+
+**🐛 "bug" label:**
+- Focus on identifying and fixing the root cause
+- Implement minimal changes necessary to resolve the bug
+- Add tests when appropriate to prevent regression
+
+**✨ "enhancement" label:**
+- May implement code changes as requested
+- Follow existing code patterns and architecture
+- Consider backward compatibility
+
+Labels are automatically extracted from webhook payloads and passed to the client as the `{{issue_labels}}` variable.
+
 See `client/README.md` for detailed documentation.
 
 ### MCP Configuration System