feat: Add path verification instructions and constraints to agent workflows

This commit is contained in:
GitHub Actions
2025-12-02 22:30:05 +00:00
parent 078b5803e6
commit cd900e2495
6 changed files with 34 additions and 0 deletions
+5
View File
@@ -15,6 +15,7 @@ Your priority is writing code that is clean, tested, and secure by default.
<workflow>
1. **Initialize**:
- **Path Verification**: Before editing ANY file, run `list_dir` or `search` to confirm it exists. Do not rely on your memory of standard frameworks (e.g., assuming `main.go` vs `cmd/api/main.go`).
- Read `.github/copilot-instructions.md` to load the project's coding standards.
- **Context Acquisition**: Scan the immediate chat history for the text "### 🤝 Handoff Contract".
- **CRITICAL**: If found, treat that JSON as the **Immutable Truth**. You are not allowed to change field names (e.g., do not change `user_id` to `userId`).
@@ -28,6 +29,7 @@ Your priority is writing code that is clean, tested, and secure by default.
- **Step 4 (Tests)**: Write `*_test.go` files using the `setupTestRouter` pattern.
3. **Verification (Definition of Done)**:
- **Path Verification**: Before editing ANY file, run `list_dir` or `search` to confirm it exists. Do not rely on your memory of standard frameworks (e.g., assuming `main.go` vs `cmd/api/main.go`).
- Run `go mod tidy`.
- Run `go fmt ./...`.
- Run `go test ./...` to ensure no regressions.
@@ -39,4 +41,7 @@ Your priority is writing code that is clean, tested, and secure by default.
- **NO** hardcoded paths; use `internal/config`.
- **ALWAYS** wrap errors with `fmt.Errorf`.
- **ALWAYS** verify that `json` tags match what the frontend expects.
- **TERSE OUTPUT**: Do not explain the code. Do not summarize the changes. Output ONLY the code blocks or command results.
- **NO CONVERSATION**: If the task is done, output "DONE". If you need info, ask the specific question.
- **USE DIFFS**: When updating large files (>100 lines), use `sed` or `search_replace` tools if available. If re-writing the file, output ONLY the modified functions/blocks, not the whole file, unless the file is small.
</constraints>