Skip to content

Requirements

Răzvan Albu edited this page May 18, 2026 · 6 revisions

OpenCode Plugin & Visual Studio Code Extension

Definitions

  • Prompt: A message to the agent originating from the user.
  • Tasklet: A set of plan and build user prompts, together with the non-thinking replies from the LLM, that collectively result in a code change.
  • User Checkpoint: A hidden commit saving the state of the codebase immediately before OpenCode changes, to enable accurate diffing of OpenCode changes.

OpenCode Plugin

RQ1: The plugin shall capture all prompt interactions executed via OpenCode

Issue(s): #1

Captured data per prompt:

  • User message
  • Model response
  • Model follow-up questions (if present)

Tags applied to each prompt:

  • prompt_id
  • session_id
  • type: "plan" | "build"
  • timestamp

RQ2: The plugin shall group related Plan and Build prompts into a single tasklet

Issue(s): #2

A tasklet:

  • Begins with a Plan or Build prompt
  • May contain multiple Plan prompts
  • Ends with a Build prompt (code changes)

The system shall:

  • Assign a shared id to all prompts within the tasklet
  • Preserve prompt order within the session

RQ3: The plugin shall record AI-generated code changes as git commits

Issue(s): #3

  • Using events, detect when the agent has finished editing code
  • For each set of changes, create a "user checkpoint" commit and an OpenCode commit
  • The plugin commits shall not interfere with the user's workflow

RQ4: The plugin shall associate tasklets with code changes

Issue(s): #4, #19

  • When the user creates a commit, if it contains any OpenCode changes, track the tasklets to the commit

RQ5: The plugin shall handle subsequent OpenCode modifications to previously traced lines

Issue(s): #5, #7

If OpenCode modifies code that was previously generated and traced in a different session, both tasklets shall be traced.

Visual Studio Code Extension

RQ6: The extension shall display session details when a gutter marker is clicked

Issue(s): #6 (Changed by #6 to use Git Blame Button instead)

  • For each traced line range, render a gutter marker (similar to the Git diff gutter)
  • Show the list of tasklets associated with that line range
  • Each tasklet includes its prompts in order

RQ7: The extension shall indicate when multiple tasklets have resulted in changes to the same lines

Issue(s): #7

  • In the expanded tasklet view, provide a count indicator (e.g. "3 tasklets")

RQ8: Display full prompt details

Issue(s): #8, #25

Each prompt must show:

  • User input
  • Model response
  • Model follow-up questions
  • Type: "plan" | "build"
  • Timestamp

RQ9: Allow navigation between sessions (DROPPED)

Reason: Since aggregating tasklets by session does not guarantee contextual consistency, this requirement was dropped.

Users shall be able to:

  • Switch between sessions
  • View prompt history per session

RQ10: Display captured Git commits

Issue(s): #10

If a before-commit reference exists, the user shall be able to:

  • View the previous version of the code
  • Compare the previous version with the current version

RQ11: Display prompt annotations on demand only

Issue(s): #11, #30, #41

  • Prompt annotations shall not be visible by default
  • Users shall be able to explicitly request the display of annotations for a given line range or session
  • Developers who do not wish to engage with prompt metadata are not distracted, while those who want transparency can access it when needed

RQ12: Display prompt annotations as metadata only (DROPPED)

Reason: The project design in itself discounts this requirement.

  • Prompt information shall be presented exclusively through gutter markers, side panels, or hover overlays
  • Prompt information shall not be injected into the source code as comments or annotations
  • The source file must remain unmodified by the extension's display layer

RQ13: Allow users to copy or re-use captured prompts (DROPPED)

Reason: Time constraints, and redundant feature due to being able to copy-paste prompts from the tasklet menu

  • For each AI-generated code change, the originating prompt shall be copyable
  • Developers shall be able to re-run, refine, or resubmit a prompt without reconstructing it manually

Additional Requirements

RQ14: Generate a summary of prompts highlighting intent and decisions (DROPPED)

Reason: Out of Scope due to time constraints.

  • For each tasklet, the system shall produce a condensed summary of the prompts used during generation
  • The summary shall emphasise the developer's intent, key decisions made, and the reasoning behind them
  • The summary shall serve as a human-readable record of why the code was written the way it was, complementing low-level code comments that describe what the code does