Skip to content

feat(skills/code-agent): ticket-driven mode (plan-first carve-out) (closes #73)#74

Merged
initializ-mk merged 1 commit into
mainfrom
feature/code-agent-ticket-driven
May 20, 2026
Merged

feat(skills/code-agent): ticket-driven mode (plan-first carve-out) (closes #73)#74
initializ-mk merged 1 commit into
mainfrom
feature/code-agent-ticket-driven

Conversation

@initializ-mk
Copy link
Copy Markdown
Contributor

Summary

Single-file SKILL.md update to the existing code-agent skill. No tool signatures, scripts, or scaffold templates change — the entire diff is in the system-prompt body. The EXECUTE mantra is preserved for direct user requests; a planning carve-out is added for ticket-driven mode.

Closes #73.

What changed

forge-skills/local/embedded/code-agent/SKILL.md (+67 / −5):

1. Frontmatter

Added ticket-driven to tags. Nothing else touched (bins, egress_domains, timeout_hint, denied_tools, etc. all preserved).

2. ABSOLUTE RULES

Rule Status
1 Modified — "tool calls OR a structured plan presentation"
2 Modified — narration-without-action forbidden; ticket-driven exception explicitly allows code_plan_create + plan presentation
3 Modified — confirmation EXCEPTION for complexity: \"high\" or non-empty risks after code_plan_create
4 Unchanged verbatim
5 Modified — direct requests still one-shot; ticket-driven follows plan → present → confirm if needed → write → test → commit → push → PR
6 Unchanged verbatim
7 Unchanged verbatim

3. New "Ticket-Driven Mode" section

Placed exactly where the issue specified — between Iteration Rules and Full-Stack Architecture. Contents:

  • Trigger — three signals: conversation began with linear_*/github_get_issue, ticket-id pattern in user message, pasted ticket structure
  • Required sequence (8 steps) — including the open_questions-cannot-resolve → comment-and-stop rule
  • Plan adherence — plan is a contract; regenerate rather than drift; writing files outside the plan ⇒ stop
  • What this does NOT change — direct requests stay one-shot; framework conventions / scaffold rules / tool signatures all preserved

4. New "Ticket-Driven Implementation" sub-flow

Added as the fourth sub-flow under One-Shot Workflow (after New Project / Existing Codebase / Modify Existing). 12-step canonical sequence from linear_get_issue through linear_add_comment, with an explicit "Do NOT call code_agent_scaffold" closer.

5. Tool Reference table

Added one pointer row at the top for code_plan_create flagged as living in the sibling code-plan skill, plus a clarifying note below the table: "In ticket-driven mode the code-plan skill is a hard prerequisite." No ## Tool: code_plan_* heading added to this file — the pointer is in the reference table only, preserving the single-skill ownership of each tool.

6. Safety bullet

Before: "Do not create git commits unless explicitly asked."
After: "Do not create git commits unless the request requires them. Direct one-shot scaffolds typically do not commit. Ticket-driven flows always commit and PR — that's the whole point."

Resolves the contradiction with the new flow.

Verification

  • grep -c '^## Ticket-Driven Mode$' SKILL.md → 1 (exactly one new section heading)
  • grep -c '^### Ticket-Driven Implementation$' SKILL.md → 1
  • All 5 ## Tool: code_agent_* headings preserved (scaffold, write, read, edit, run)
  • Zero ## Tool: code_plan_* headings — pointer is table-only, no scope leakage
  • go test ./forge-skills/... — all green (15 skills, TestEmbeddedRegistry_LoadContent still finds ## Tool: headings)
  • golangci-lint run ./forge-skills/... — 0 issues
  • No script changes → shellcheck not run (no surface)
  • Manual: forge build against a test agent with code-agent enabled produces a system prompt containing "Ticket-Driven Mode" — jq '.system_prompt' .forge-output/agent-spec.json | grep -c 'Ticket-Driven Mode' → expected 1
  • Manual: agent driven from Telegram with a Linear ticket triggers the plan-first flow; a direct "build me a todo app" request still scaffolds in one turn

Out of scope per #73

  • No new tools in this skill
  • No tool signature changes
  • No mode parameter — mode is inferred from conversation context as documented
  • No script touches, no framework template changes, no scaffold rule edits
  • No "plan mode" toggle in forge.yaml
  • No telemetry, no cross-skill state sharing
  • No auto-classification of ticket-driven mode beyond the three documented signals

Prerequisite stack (all merged)

PR Provides
#67 (linear) linear_get_issue / linear_add_comment referenced in the required sequence
#69 (code-plan) code_plan_create — hard prerequisite for ticket-driven mode
#71 (github update) github_branch_name_from_ticket + ticket-aware github_create_pr referenced in the 12-step sub-flow

Together with this PR, the canonical ticket → plan → branch → write → test → commit → PR → comment flow is fully wired across the four skills.

…loses #73)

Single-file SKILL.md update. No tool signatures, scripts, or scaffold
templates change. The EXECUTE mantra is preserved for direct user
requests; a planning carve-out is added for ticket-driven mode.

Frontmatter:
- Added "ticket-driven" tag.

ABSOLUTE RULES:
- Rules 1, 2, 3, 5: reworded with explicit ticket-driven carve-outs
  (rule 1 allows "tool calls OR a structured plan presentation"; rule 3
  carves an exception for high-complexity or risky plans; rule 5 spells
  out the canonical plan → present → confirm → write → test → commit →
  push → PR sequence).
- Rules 4, 6, 7: preserved verbatim.

New "Ticket-Driven Mode" section (between Iteration Rules and
Full-Stack Architecture):
- Trigger criteria (3 signals: linear_*/github_get_issue origin,
  ticket-id pattern in user message, pasted ticket structure).
- 8-step required sequence including the
  open_questions-cannot-resolve → comment-and-stop rule.
- Plan-adherence contract: regenerate the plan rather than drift; if
  writing files outside the plan, stop and re-plan.
- "What this does NOT change" — direct requests still follow the
  one-shot rules; framework conventions unchanged; tool signatures
  unchanged.

New "Ticket-Driven Implementation" sub-flow in One-Shot Workflow:
- 12-step canonical sequence from linear_get_issue through
  linear_add_comment, explicitly forbidding code_agent_scaffold.

Tool Reference:
- Added a pointer row at the top for code_plan_create (from the
  code-plan skill) with a clarifying note that it's a sibling-skill
  hard prerequisite for ticket-driven mode.

Safety:
- "Do not create git commits unless explicitly asked" → "Do not create
  git commits unless the request requires them. Direct one-shot
  scaffolds typically do not commit. Ticket-driven flows always commit
  and PR — that's the whole point." Resolves the contradiction with
  the new ticket-driven flow.

No new tools added. No `mode` parameter. Mode is inferred from
conversation context as documented in the Trigger section. The
code-agent tool surface is byte-identical to today.

go test ./forge-skills/... — all green (15 skills,
TestEmbeddedRegistry_LoadContent still finds "## Tool:" headings).
golangci-lint clean. No script changes → shellcheck not needed.

References merged work this skill depends on:
- PR #67 (linear) — provides linear_get_issue / linear_add_comment
- PR #69 (code-plan) — provides code_plan_create
- PR #71 (github update) — provides github_branch_name_from_ticket
  and ticket_id/ticket_url params on github_create_pr
@initializ-mk initializ-mk merged commit d748eef into main May 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skill]: update code-agent — ticket-driven mode (plan-first, then execute)

1 participant