源码: prompt.rs:277-301
(self)
| 362 | return "# Environment context\n" + "\n".join(f" - {item}" for item in items) |
| 363 | |
| 364 | def _render_project_context(self) -> str: |
| 365 | """源码: prompt.rs:277-301""" |
| 366 | ctx = self._project_context |
| 367 | bullets = [ |
| 368 | f"Today's date is {ctx.current_date}.", |
| 369 | f"Working directory: {ctx.cwd}", |
| 370 | ] |
| 371 | if ctx.instruction_files: |
| 372 | bullets.append(f"Claude instruction files discovered: {len(ctx.instruction_files)}.") |
| 373 | lines = ["# Project context"] + [f" - {b}" for b in bullets] |
| 374 | if ctx.git_status: |
| 375 | lines.append("") |
| 376 | lines.append("Git status snapshot:") |
| 377 | lines.append(ctx.git_status) |
| 378 | if ctx.git_diff: |
| 379 | lines.append("") |
| 380 | lines.append("Git diff snapshot:") |
| 381 | lines.append(ctx.git_diff) |
| 382 | return "\n".join(lines) |
| 383 | |
| 384 | def _render_instruction_files(self) -> str: |
| 385 | """源码: prompt.rs:303-324 |