Cross-reference forgejo_list_milestones from issue/PR create promptGuidelines #26

Closed
opened 2026-08-18 02:34:21 +00:00 by david · 1 comment
Owner

Summary

Update the promptGuidelines on forgejo_issue_create and forgejo_pr_create (in src/index.ts) to point at forgejo_list_milestones for resolving a milestone id, closing the gap called out in docs/DESIGN.md: "milestone params accept IDs only ... no way to discover them."

Background

Depends on: #21 (Add forgejo_list_milestones tool) (the tool being referenced must exist first).

Both forgejo_issue_create and forgejo_pr_create already accept an optional milestone (id) parameter, and both already have a promptGuidelines array with a similar existing line for labels: "Use forgejo_list_labels to resolve label names to ids before passing labels." This issue adds an equivalent line for milestones, so the LLM using these tools discovers forgejo_list_milestones without needing external documentation.

Implementation Details

In src/index.ts:

  1. forgejo_issue_create tool registration — its promptGuidelines array currently is:

    promptGuidelines: [
      "Use forgejo_list_labels to resolve label names to ids before passing labels.",
      "Content is serialized as JSON — special characters are safe by construction.",
    ],
    

    Add a new line: "Use forgejo_list_milestones to resolve a milestone id before passing it."

  2. forgejo_pr_create tool registration — its promptGuidelines array currently is:

    promptGuidelines: [
      "Use forgejo_list_labels to resolve label names to ids before passing labels.",
      "A 409 conflict means a PR for this branch already exists — the existing PR URL is in the error.",
    ],
    

    Add the same new line: "Use forgejo_list_milestones to resolve a milestone id before passing it."

No functional/schema changes — this is a documentation-string-only change inside two existing tool registrations. No new tests are strictly required for pure string content, but if the test suite asserts exact promptGuidelines array contents for these two tools (check tests/index.test.ts/tests/tools.test.ts), update those assertions to match.

Acceptance Criteria

  • forgejo_issue_create's promptGuidelines includes a line referencing forgejo_list_milestones.
  • forgejo_pr_create's promptGuidelines includes the same line.
  • No other behavior of either tool changes (parameters, execute logic unchanged).
  • Any existing test assertions on the exact promptGuidelines arrays for these two tools are updated to match.
  • npm test and npm run check pass with no regressions.

Test Plan

  1. Run npm test — full suite green, including any updated promptGuidelines assertions.
  2. Run npm run check — lint/typecheck passes.
  3. Manual check: inspect the registered tool metadata for forgejo_issue_create/forgejo_pr_create (e.g. via a /reload in pi and inspecting tool help) and confirm the new guideline text is present.
## Summary Update the `promptGuidelines` on `forgejo_issue_create` and `forgejo_pr_create` (in `src/index.ts`) to point at `forgejo_list_milestones` for resolving a milestone id, closing the gap called out in `docs/DESIGN.md`: "milestone params accept IDs only ... no way to discover them." ## Background **Depends on:** #21 (Add forgejo_list_milestones tool) (the tool being referenced must exist first). Both `forgejo_issue_create` and `forgejo_pr_create` already accept an optional `milestone` (id) parameter, and both already have a `promptGuidelines` array with a similar existing line for labels: `"Use forgejo_list_labels to resolve label names to ids before passing labels."` This issue adds an equivalent line for milestones, so the LLM using these tools discovers `forgejo_list_milestones` without needing external documentation. ## Implementation Details In `src/index.ts`: 1. `forgejo_issue_create` tool registration — its `promptGuidelines` array currently is: ```ts promptGuidelines: [ "Use forgejo_list_labels to resolve label names to ids before passing labels.", "Content is serialized as JSON — special characters are safe by construction.", ], ``` Add a new line: `"Use forgejo_list_milestones to resolve a milestone id before passing it."` 2. `forgejo_pr_create` tool registration — its `promptGuidelines` array currently is: ```ts promptGuidelines: [ "Use forgejo_list_labels to resolve label names to ids before passing labels.", "A 409 conflict means a PR for this branch already exists — the existing PR URL is in the error.", ], ``` Add the same new line: `"Use forgejo_list_milestones to resolve a milestone id before passing it."` No functional/schema changes — this is a documentation-string-only change inside two existing tool registrations. No new tests are strictly required for pure string content, but if the test suite asserts exact `promptGuidelines` array contents for these two tools (check `tests/index.test.ts`/`tests/tools.test.ts`), update those assertions to match. ## Acceptance Criteria - [ ] `forgejo_issue_create`'s `promptGuidelines` includes a line referencing `forgejo_list_milestones`. - [ ] `forgejo_pr_create`'s `promptGuidelines` includes the same line. - [ ] No other behavior of either tool changes (parameters, execute logic unchanged). - [ ] Any existing test assertions on the exact `promptGuidelines` arrays for these two tools are updated to match. - [ ] `npm test` and `npm run check` pass with no regressions. ## Test Plan 1. Run `npm test` — full suite green, including any updated `promptGuidelines` assertions. 2. Run `npm run check` — lint/typecheck passes. 3. Manual check: inspect the registered tool metadata for `forgejo_issue_create`/`forgejo_pr_create` (e.g. via a `/reload` in pi and inspecting tool help) and confirm the new guideline text is present.
david closed this issue 2026-08-18 08:39:16 +00:00
Author
Owner

pi-loop opened and merged a pull request for this issue: #40

pi-loop opened and merged a pull request for this issue: https://git.excelera.net/david/pi-extensions-and-skills/pulls/40
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills#26
No description provided.