### Run Setup Wizard Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Execute the interactive setup command within the OpenCode environment. ```text /goop-setup ``` -------------------------------- ### Reference Pattern Implementation Example Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/retrospective.md Use this placeholder to link to a specific file containing an implementation example of a pattern. ```text {{example_file}} ``` -------------------------------- ### Development Commands Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Standard commands for installing dependencies, testing, and building the project. ```bash # Install dependencies bun install # Run tests bun test # Type check bun run typecheck # Build bun run build ``` -------------------------------- ### Clone and install dependencies Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/CONTRIBUTING.md Initial commands to set up the local development environment using Bun. ```bash git clone https://github.com/hffmnnj/opencode-goopspec.git cd goopspec bun install ``` -------------------------------- ### Get global configuration Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Retrieves the current global configuration settings. ```javascript goop_get_global_config({}) ``` -------------------------------- ### Tag Convention Examples Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/field-notes-protocol.md Examples of recommended and discouraged tag formats for note categorization. ```json ["sqlite", "fts5", "performance"] ["bun", "esm", "import-resolution"] ["opencode-sdk", "hook-api", "breaking-change"] ``` ```json ["research", "notes"] ["important", "todo"] ["misc"] ``` -------------------------------- ### Load References Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-execute.md Load necessary protocol and pattern references before starting execution. ```text goop_reference({ name: "dispatch-patterns" }) goop_reference({ name: "core-protocol" }) ``` -------------------------------- ### Format ARTIFACTS Section Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/response-format.md Example format for listing modified or created files. ```markdown - src/auth/service.ts — added JWT signing helpers - src/auth/service.test.ts — added signing tests ``` -------------------------------- ### Verify GoopSpec setup Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-setup.md Verifies the current configuration status. ```javascript goop_setup({ action: "verify" }) ``` -------------------------------- ### Example Executor Task Response Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/response-format.md A complete example of a sub-agent response for a code change task. ```markdown ## STATUS complete ## SUMMARY Implemented the in-process memory manager using `bun:sqlite` with FTS5. Saves, searches, and deletes entries without a worker process. ## ARTIFACTS - src/features/memory/index.ts — memory manager with save/search/forget - src/features/memory/schema.ts — SQLite table and FTS5 definitions - src/features/memory/index.test.ts — manager unit tests ## VERIFICATION bun test packages/opencode-plugin/src/features/memory/ — 9 passed, 0 failed ## NEXT Continue to Wave 4 Task 4.5: build memory_search and memory_save tools using this manager. ``` -------------------------------- ### Tool-Call Batching Patterns Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-orchestrator.md Examples demonstrating the transition from sequential, inefficient tool calls to batched, parallel execution. ```javascript Message 1: goop_state({ action: "create-workflow", workflowId: "my-workflow" }) Message 2: goop_state({ action: "set-active-workflow", workflowId: "my-workflow" }) ``` ```javascript Message 1: goop_state({ action: "get" }) Message 2: goop_state({ action: "set-autopilot", autopilot: true, lazy: true }) ``` ```javascript Single message: goop_state({ action: "create-workflow", workflowId: "my-workflow", activate: true }) ``` ```javascript Single message, two parallel calls: - goop_state({ action: "get" }) - goop_state({ action: "set-autopilot", autopilot: true, lazy: true }) ``` -------------------------------- ### Mocking Patterns in TypeScript Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tdd.md Examples for mocking functions, modules using Bun, and controlling time with Jest. ```typescript // Function mock const mockFetch = mock(() => Promise.resolve({ data: [] })); // Module mock with Bun: preserve named exports from the real module const real = await import("./database.js"); mock.module("./database.js", () => ({ ...real, query: mock(() => Promise.resolve([])) })); // Time mock jest.useFakeTimers(); jest.advanceTimersByTime(1000); ``` -------------------------------- ### Initiate Feature Discussion Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Starts the requirement gathering process for a new feature. ```text /goop-discuss "Add user notifications" ``` -------------------------------- ### Batched Tool Calls (Optimized) Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/core-protocol.md Examples of optimized tool calls using batching or combined parameters to reduce message turns. ```json Single message: goop_state({ action: "create-workflow", workflowId: "my-workflow", activate: true }) ``` ```json Single message, two parallel tool calls: - goop_state({ action: "get" }) - goop_search_notes({ query: "..." }) ``` -------------------------------- ### Valid PR Content Example Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md An example of PR content that passes the terminology gate. ```text Title: Add PR creation tool with terminology gate Body: Implements the sanitizer module and MCP tool. Integration step verified. Decision log updated. ``` -------------------------------- ### Initiate Feature Development Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Start the GoopSpec interview process by providing a feature request. ```text /goop-discuss "Add dark mode to the settings page" ``` -------------------------------- ### Install GoopSpec Plugin Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Add the GoopSpec plugin to your opencode.json configuration file. ```json { "plugins": ["@goopspec/opencode-plugin"] } ``` -------------------------------- ### Example Researcher Task Response Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/response-format.md A complete example of a sub-agent response for a research findings task. ```markdown ## STATUS complete ## SUMMARY Compared the stable and beta OpenCode SDK hook APIs. Two hooks changed signatures and one event was renamed; the rest are viable unchanged. ## ARTIFACTS - .research/sdk-divergence-report.md — stable-vs-beta diff with migration notes - .research/hook-feasibility-report.md — per-hook viability verdicts ## VERIFICATION n/a ## NEXT Hand to Wave 5 planner to redesign the two changed hooks before hook implementation begins. ``` -------------------------------- ### Format VERIFICATION Section Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/response-format.md Example format for reporting test or typecheck results. ```markdown bun test packages/core/src/auth/ — 12 passed, 0 failed bun run typecheck — no errors ``` -------------------------------- ### Blocked Response Example Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/phase-gates.md The standard format for a blocked response when a phase gate requirement is not met. ```markdown ## GoopSpec · Gate Blocked Specification must be locked before execution. → Run: `/goop-plan` ``` -------------------------------- ### Blocked PR Content Example Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md An example of PR content that triggers the terminology gate due to forbidden internal terms. ```text Title: Complete wave 2/4 — MH-3 implemented Body: goop-executor-medium ran the wiring task. Deviation rule 3 applied. ADL updated. ``` -------------------------------- ### State and Workflow Tools Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Tools for managing workflow states, status, checkpoints, setup, and specifications. ```APIDOC ## goop_state ### Description Manages workflow state transitions and configurations. ### Parameters - **action** (string) - Required - **phase** (string) - Optional - **mode** (string) - Optional - **depth** (integer) - Optional - **autopilot** (boolean) - Optional - **lazy** (boolean) - Optional - **currentWave** (integer) - Optional - **totalWaves** (integer) - Optional - **workflowId** (string) - Optional - **force** (boolean) - Optional - **activate** (boolean) - Optional ## goop_status ### Description Retrieves the current status of the system. ### Parameters - **verbose** (boolean) - Optional ## goop_checkpoint ### Description Saves, loads, or lists workflow checkpoints. ### Parameters - **action** (string) - Required - "save", "load", or "list" - **id** (string) - Optional - **context** (object) - Optional ## goop_setup ### Description Configures the project environment. ### Parameters - **action** (string) - Required - **projectName** (string) - Optional - **defaultModel** (string) - Optional - **agentModels** (object) - Optional - **memoryEnabled** (boolean) - Optional - **gitignoreGoopspec** (boolean) - Optional - **preserveData** (boolean) - Optional - **confirmed** (boolean) - Optional - **scope** (string) - Optional ## goop_spec ### Description Performs operations on the project specification. ### Parameters - **action** (string) - Required - "read", "list", or "validate" - **file** (string) - Optional - "spec", "plan", or "both" - **phase** (string) - Optional ``` -------------------------------- ### GoopSpec Inquiry Questions Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Example of the questions generated by GoopSpec during the discussion phase. ```text > What triggers notifications? (new messages, mentions, system alerts?) > How should they be delivered? (in-app, email, push?) > Do users need to configure notification preferences? > What happens when a notification is clicked? ``` -------------------------------- ### Sequential Tool Calls (Anti-pattern) Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/core-protocol.md Examples of inefficient sequential tool calls where the second operation does not depend on the first. ```json Message 1: goop_state({ action: "create-workflow", workflowId: "my-workflow" }) Message 2: goop_state({ action: "set-active-workflow", workflowId: "my-workflow" }) ``` ```json Message 1: goop_state({ action: "get" }) Message 2: goop_state({ action: "set-autopilot", autopilot: true, lazy: true }) ``` -------------------------------- ### Commit Message Examples Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/git-workflow.md Comparison between a compliant commit message and a non-compliant one containing internal references. ```text feat(auth): Add OAuth2 login with Google and GitHub Users can now authenticate via Google or GitHub. This replaces the legacy email-only flow and simplifies onboarding. Changes: - Add OAuth2 callback handler - Update user schema to store provider IDs - Add provider selection UI ``` ```text feat(auth): Wave 2 Task 3 - implement OAuth per SPEC MH-04 Completed task W2.T3 from BLUEPRINT.md. Changes: - Implemented the feature - Added required files - Tests pass ``` -------------------------------- ### Anti-pattern: Sequential search calls Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/field-notes-protocol.md Example of inefficient search patterns that fail to retrieve full note bodies. ```text Call 1: goop_search_notes({ query: "SQLite WAL mode" }) → snippet truncated at 200 chars, no full body Call 2: goop_search_notes({ query: "SQLite WAL mode performance" }) → same snippet, still truncated Call 3: goop_search_notes({ query: "SQLite WAL mode", limit: 1 }) → one result, still truncated Call 4: goop_search_notes({ query: "WAL mode benefits SQLite", limit: 1 }) → one result, still truncated Call 5: goop_search_notes({ query: "SQLite WAL mode benefits", limit: 1 }) → one result, still truncated Call 6: goop_search_notes({ query: "fn_20260618_sqlite01", limit: 1 }) → one result, still truncated (query is FTS, not ID lookup) ``` -------------------------------- ### Field Note ID Examples Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/field-notes-protocol.md Sample identifiers generated using the Field Note protocol format. ```text fn_20260618_a3b7f2k9 ``` ```text fn_20260615_xm4p9q2w ``` -------------------------------- ### Initialize Exploration with goop_read_db Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-explorer.md Load project specifications and blueprints to establish context before beginning the exploration process. ```javascript goop_read_db({ doc_types: ["spec", "blueprint"] }) ``` -------------------------------- ### Structure Project Directories Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/architecture-design.md Demonstrates the recommended feature-based organization for source code. ```text src/ ├── features/ │ ├── auth/ │ │ ├── login.ts │ │ └── auth.test.ts │ └── users/ │ ├── create-user.ts │ └── users.test.ts ├── shared/ │ ├── database/ │ └── utils/ └── index.ts ``` -------------------------------- ### Build and Test Commands Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Standard commands for managing dependencies, building, linting, and testing the opencode-plugin package using Bun. ```bash bun install # Install workspace dependencies bun run --cwd packages/opencode-plugin build # Build the plugin bun run --cwd packages/opencode-plugin typecheck # Type check the plugin bun run --cwd packages/opencode-plugin test # Run all plugin tests bun run --cwd packages/opencode-plugin lint # Run Biome lint on src bun run --cwd packages/opencode-plugin lint:fix # Fix Biome issues in src bun run --cwd packages/opencode-plugin format # Format src with Biome # Testing bun test packages/opencode-plugin/ # Test plugin package bun test packages/opencode-plugin/src/tools/goop-status/index.test.ts # Single file bun test --filter "goop_status" # Tests matching pattern bun test --watch # Watch mode ``` -------------------------------- ### Initialize GoopSpec Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-setup.md Applies the configuration settings after gathering project details. ```javascript goop_setup({ action: "init", ... }) ``` -------------------------------- ### Execute Mandatory Boot Sequence Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-tester.md The required sequence of tool calls to initialize the agent's context before beginning any testing tasks. ```javascript goop_state({ action: "get" }) goop_search_notes({ query: "[feature under test]", limit: 5 }) goop_read_db({ doc_types: ["spec", "blueprint", "chronicle"] }) Read(".goopspec/PROJECT_KNOWLEDGE_BASE.md") memory_search({ query: "test patterns coverage targets edge cases flakiness", limit: 5 }) goop_reference({ name: "core-protocol" }) goop_reference({ name: "response-format" }) goop_reference({ name: "tdd" }) goop_reference({ name: "tool-reference" }) Read("AGENTS.md") ``` -------------------------------- ### Execute Phase Transition Tool Calls Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/phase-gates.md Required tool calls for transitioning between project phases. Announcing intent without calling these tools results in a hard failure. ```json mcp_slashcommand({ command: "/goop-plan" }) ``` ```json mcp_slashcommand({ command: "/goop-execute" }) ``` ```json mcp_slashcommand({ command: "/goop-accept" }) ``` -------------------------------- ### Run Quick Commands Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/chronicle.md Provides a list of standard CLI commands for managing the GoopSpec workflow. ```bash # Check status /goop-status # Continue work /goop-execute # Save checkpoint /goop-pause # Resume from checkpoint /goop-resume # Search past work /goop-recall "{{query}}" ``` -------------------------------- ### Project structure overview Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/CONTRIBUTING.md Directory layout of the main package and source code. ```text packages/ └── opencode-plugin/ # @goopspec/opencode-plugin — the main package ├── agents/ # Agent markdown definitions ├── commands/ # Command markdown definitions ├── references/ # Reference documentation ├── templates/ # File templates └── src/ # TypeScript source ├── core/ # Types, config, context ├── features/ # Feature modules ├── hooks/ # OpenCode hooks ├── shared/ # Utilities └── tools/ # MCP tools ``` -------------------------------- ### Run detection Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-setup.md Initializes the detection process for the project environment. ```javascript goop_setup({ action: "detect" }) ``` -------------------------------- ### Load References Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-accept.md Retrieves necessary configuration and checklist references for the verification process. ```text goop_reference({ name: "phase-gates" }) goop_reference({ name: "security-checklist" }) ``` -------------------------------- ### Initialize State and Context Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-executor-low.md Initial mandatory steps to retrieve current workflow state and relevant task context. ```javascript goop_state({ action: "get" }) ``` ```javascript goop_search_notes({ query: "[task topic]", limit: 5 }) ``` ```javascript goop_read_db({ doc_types: ["spec", "blueprint"] }) ``` ```javascript memory_search({ query: "[task context]" }) ``` -------------------------------- ### Using goop_create_pr Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Invokes the PR creation tool with the required metadata fields. ```bash goop_create_pr({ title: "feat(tools): add PR creation tool with terminology gate", body: "Implements the sanitizer and MCP tool...", branch: "feat/atomic-pr-system", base: "main" }) ``` -------------------------------- ### Parallel Dispatch Flow Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/dispatch-patterns.md Visual representation of tasks executed in parallel, starting and merging at common points. ```text ┌─ Task A ─┐ Start ─┼─ Task B ─┼─ Merge └─ Task C ─┘ ``` -------------------------------- ### Load References Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-plan.md Load necessary protocol and task decomposition references before planning. ```javascript goop_reference({ name: "core-protocol" }) goop_reference({ name: "task-decomposition" }) goop_reference({ name: "phase-gates" }) goop_reference({ name: "pr-creation" }) ``` -------------------------------- ### Define HANDOFF.md Structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/wiring-checklist.md Template for documenting session progress, state, and next steps to ensure continuity between development sessions. ```markdown # Session Handoff **Generated:** [timestamp] **Phase:** [current phase] ## Accomplished This Session - [x] [Task/milestone] ## Current State - Phase: [phase] - Spec Locked: [yes/no] - Wave: [N of M] - Task: [X of Y] ## Files Modified - `path/to/file` — [change] ## Commits Made - `abc1234` — type(scope): message ## Next Session Instructions ### Command to Run `/goop-[command]` ### Documents to Read First 1. `goop_read_db({ doc_type: "spec" }) 2. `goop_read_db({ doc_type: "blueprint" }) 3. `goop_read_db({ doc_type: "chronicle" }) ### Context Summary [2-4 sentences: decisions, patterns, gotchas] ### Immediate Next Task **Task:** [exact description] **Files:** `path/to/files` **Action:** [what needs to be done] **Verify:** [how to verify] ## Warnings & Blockers ### Active Blockers [None | list] ### Gotchas Discovered - [pattern or issue] ``` -------------------------------- ### Batch Reading Database Documents Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Load multiple document types in a single call during agent boot sequences to improve performance. ```javascript goop_read_db({ doc_types: ["spec", "blueprint", "chronicle"] }) ``` -------------------------------- ### Create and Manage PRs with GitHub CLI Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Commands for detecting the default branch, creating PRs with templates, and checking PR status. ```bash # Detect default branch git remote show origin | grep 'HEAD branch' # Create PR targeting main gh pr create --base main --title "feat(hooks): add reference injection hook" --body "$(cat <<'EOF' ## Summary [What and why] ## Changes - [Change 1] - [Change 2] ## Testing - [How it was tested] EOF )" # Create PR and open in browser gh pr create --base main --web # Check PR status gh pr status # View PR checks gh pr checks ``` -------------------------------- ### Load discovery interview protocol Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-discuss.md Initializes the interview protocol required for the discovery phase. ```javascript goop_reference({ name: "discovery-interview" }) ``` -------------------------------- ### Run project scripts Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/CONTRIBUTING.md Commonly used scripts for building, testing, and maintaining code quality. ```bash # Build bun run build # Type check bun run typecheck # Tests bun test # Lint (via Biome) bun run lint # Format (via Biome) bun run format ``` -------------------------------- ### Execute Mandatory Research Initialization Steps Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-researcher.md Required tool calls to initialize the research context before beginning analysis. ```javascript goop_state({ action: "get" }) goop_search_notes({ query: "[research topic]" }) goop_read_db({ doc_types: ["spec", "blueprint"] }) Read(".goopspec/PROJECT_KNOWLEDGE_BASE.md") memory_search({ query: "[topic] research findings", limit: 5 }) ``` -------------------------------- ### Define project documentation structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-writer.md Standard directory layout for organizing project documentation files. ```text Documentation/ ├── README.md # Entry point for humans ├── docs/ │ ├── index.md # Navigation hub │ ├── overview.md # Mental model │ ├── api.md # API reference │ ├── guides/ # Task-based how-to │ └── reference/ # Deep reference └── CONTRIBUTING.md # Contributor workflow ``` -------------------------------- ### Create and set active workflow Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-discuss.md Commands to initialize a new workflow and set it as the active context. ```javascript goop_state({ action: "create-workflow", workflowId: "" }) goop_state({ action: "set-active-workflow", workflowId: "" }) ``` -------------------------------- ### Assemble Research Summary Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-plan.md Use this to query notes and format them for the planner delegation prompt. ```javascript goop_search_notes({ query: "[workflow topic]", limit: 10 }) ``` -------------------------------- ### Initialize Task Context Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-executor-frontend-medium.md The mandatory first step for initializing the executor, involving state retrieval, research, and documentation loading. ```javascript goop_state({ action: "get" }) — note phase, spec lock, workflowId. goop_search_notes({ query: "[task topic]", limit: 5 }) — check prior findings. goop_read_db({ doc_types: ["spec", "blueprint"] }) — load spec contract and task context. memory_search({ query: "[task context]" }). Load references/response-format.md, references/dispatch-patterns, references/git-workflow, references/tdd, references/tool-reference. Batch independent tool calls into a single message — see references/core-protocol.md Tool-Call Batching. ``` -------------------------------- ### Read Project Knowledge Base Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-explorer.md Access the project's known conventions stored in the knowledge base file. ```text Read(".goopspec/PROJECT_KNOWLEDGE_BASE.md") ``` -------------------------------- ### Define a test plan template Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-tester.md Use this template to outline unit, integration, and E2E test cases before implementation. ```markdown Unit: - File: src/feature/logic.ts Tests: - should [behavior] when [context] - should [behavior] when [edge case] Integration: - Flow: feature + persistence Tests: - should [interaction] across modules E2E: - Journey: user completes [workflow] Tests: - should [outcome] in real UI ``` -------------------------------- ### Define Directory Structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/project.md Represents the expected file and folder hierarchy for the project. ```text {{directory_structure}} ``` -------------------------------- ### Mandatory Initialization Tool Calls Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-orchestrator.md Initial sequence of tool calls required to load state, context, and documentation before beginning any orchestration task. ```javascript goop_state({ action: "get" }) ``` ```javascript goop_search_notes({ query: "[workflow topic]", limit: 5 }) ``` ```javascript goop_read_db({ doc_types: ["spec", "blueprint", "chronicle"] }) ``` ```javascript memory_search({ query: "[current task]" }) ``` ```javascript goop_reference({ name: "core-protocol", section: "Tool-Call Batching" }) ``` -------------------------------- ### Load required references Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-amend.md Retrieve necessary protocol and gate references to perform impact analysis. ```javascript goop_reference({ name: "phase-gates" }) goop_reference({ name: "core-protocol" }) ``` -------------------------------- ### Execute Quick Bug Fix Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Use this command to skip gates and perform an atomic commit for rapid bug resolution. ```text /goop-quick "Fix the date formatting bug in the dashboard" ``` -------------------------------- ### Security Verification Commands Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/security-checklist.md Common command-line tools for auditing dependencies, static analysis, and secret detection. ```bash bun audit semgrep --config auto . gitleaks detect ``` -------------------------------- ### Manage state and workflows Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Tools for controlling workflow lifecycle, status reporting, and project configuration. ```javascript goop_state({ action: "create-workflow", workflowId: "my-feature", activate: true }) ``` ```javascript goop_status({ verbose: true }) ``` ```javascript goop_checkpoint({ action: "save", id: "before-refactor", context: { branch: "feat/tool-reference" } }) ``` ```javascript goop_setup({ action: "verify" }) ``` ```javascript goop_spec({ action: "validate" }) ``` -------------------------------- ### Complete Execution Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-execute.md Trigger the completion command once all waves have been processed. ```text mcp_slashcommand({ command: "/goop-accept" }) ``` -------------------------------- ### Run verification tests Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/CONTRIBUTING.md Commands to execute tests and type checking before submitting a pull request. ```bash bun test bun run typecheck ``` -------------------------------- ### Project Directory Structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Visual representation of the repository layout, focusing on the opencode-plugin package and supporting directories. ```text packages/ └── opencode-plugin/ # @goopspec/opencode-plugin — MCP tools, hooks, and orchestration logic packages/opencode-plugin/src/ ├── core/ # Types, config, resolver ├── tools/ # MCP tool implementations │ ├── goop-read-db/ # Read workflow docs from GoopSpecDB │ ├── goop-write-db/ # Write/update workflow docs; auto-renders markdown sidecar │ ├── goop-read-section/ # Read structured document sections │ ├── goop-write-wave/ # Upsert wave/task progress rows │ ├── goop-blocker/ # Open, resolve, and list workflow blockers │ ├── goop-dashboard/ # Render cross-workflow dashboard │ ├── goop-save-note/ # Save a Field Note to the global knowledge base │ ├── goop-search-notes/ # Search Field Notes with FTS + tag filtering │ └── ... # Other tool directories ├── hooks/ # OpenCode plugin hooks ├── features/ # Feature modules (memory, state, db, routing, model-routing) │ └── db/ # GoopSpecDB — unified SQLite database (schema, migrations, types) ├── shared/ # Utilities (logger, paths) ├── test-utils.ts # Shared test utilities └── index.ts # Plugin entry point agents/ # 14 agent markdown definitions commands/ # 9 slash command definitions references/ # 13 consolidated reference documents (incl. field-notes-protocol) templates/ # File templates ``` -------------------------------- ### Configuration precedence hierarchy Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Visual representation of the configuration merge order, where project-level settings override global and built-in defaults. ```text Project goopspec.json ← highest priority └─ .goopspec/config.json └─ Global ~/.config/opencode/goopspec.json └─ Built-in default ← lowest priority ``` -------------------------------- ### Generate Feature Plan Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Triggers the creation of specification and blueprint documentation. ```text /goop-plan ``` -------------------------------- ### Create a DEBUG.md report Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-debugger.md Template for documenting bug investigations, hypotheses, and fixes in the .goopspec directory. ```markdown # DEBUG: [Bug title] **Status:** Investigating | Fixed | Cannot Reproduce ## Symptoms Exact description of the problem. ## Reproduction 1. Step 1 2. Step 2 3. Expected: X, Actual: Y ## Hypotheses ### H1: [Specific hypothesis] - **Prediction:** If true, then ... - **Test:** Method - **Result:** confirmed / refuted / inconclusive - **Evidence:** What was observed ## Root cause Confirmed explanation with evidence. ## Fix applied File and change summary. ## Validation - [x] Bug no longer reproduces - [x] No regression in related functionality - [x] Tests pass ``` -------------------------------- ### Execute Major Refactor Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Initiates a full workflow including research, spec locking, and multi-wave execution. ```text /goop-discuss "v2.0 Database Migration" ``` -------------------------------- ### Manage blockers Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Opens a new blocker with a description and severity level. ```javascript goop_blocker({ action: "open", description: "CI token expired", severity: "high", wave_id: 2 }) ``` -------------------------------- ### Next Session Command Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/handoff.md Displays the command required to resume work in the next session. ```text {{next_command}} ``` -------------------------------- ### Stacked branch visualization Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Visual representation of the branch dependency chain rooted at main. ```text main ← feat/wave-1 ← feat/wave-2 ← feat/wave-3 ← … ``` -------------------------------- ### Write requirements and complete interview Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-discuss.md Saves the requirements document and marks the interview phase as complete. ```javascript goop_write_db({ doc_type: "requirements", content: "..." }) goop_state({ action: "complete-interview" }) ``` -------------------------------- ### Memory-First Flow Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-orchestrator.md The standard operational sequence for memory management and task delegation. ```text memory_search (start) → delegate → parse response → memory_save / memory_decision (end) ``` -------------------------------- ### Local Testing and Type Checking Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Commands to ensure the package passes tests and type checks before opening a PR. ```bash bun test packages/opencode-plugin/ ``` ```bash bun run --cwd packages/opencode-plugin typecheck ``` -------------------------------- ### Execute Feature Tasks Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Initiates the automated execution of tasks in defined waves. ```text /goop-execute ``` -------------------------------- ### Analyze Brownfield Project Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Triggers the explorer agent to map existing stack and patterns. ```text Research the codebase structure and the patterns this project uses. ``` -------------------------------- ### Create and Manage Draft PRs Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Use draft PRs for work-in-progress to enable early feedback and CI checks. Always mark the PR as ready before merging. ```bash # Create as draft gh pr create --draft --base main --title "..." --body "..." # Mark ready when done gh pr ready ``` -------------------------------- ### Tool Implementation Pattern Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Defines a tool using the @opencode-ai/plugin/tool library, emphasizing a memory-first execution flow. ```typescript import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"; import type { PluginContext, ToolContext } from "../../core/types.js"; export function createMyTool(ctx: PluginContext): ToolDefinition { return tool({ description: "Brief tool description", args: { param: tool.schema.string().optional(), }, async execute(args, _context: ToolContext): Promise { // 1. Memory Check (Memory-First) const memory = await ctx.memory.search(args.param); // 2. Execution const state = ctx.stateManager.getState(); return "result"; }, }); } ``` -------------------------------- ### Write traceability record Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Records a coverage status for a specific requirement key. ```javascript goop_write_traceability({ requirement_key: "MH2", wave_number: 2, task_index: 1, status: "covered" }) ``` -------------------------------- ### Locate Existing Test Files Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-tester.md Use glob patterns to identify existing test files to ensure consistency with project conventions. ```javascript Glob("**/*.{test,spec}.ts") ``` -------------------------------- ### Project Directory Structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Overview of the GoopSpec repository layout. ```text goopspec/ ├── packages/ │ └── opencode-plugin/ # @goopspec/opencode-plugin │ ├── agents/ # 13 agent markdown definitions │ ├── commands/ # 9 slash command definitions │ ├── references/ # 13 consolidated reference documents │ ├── templates/ # File templates │ └── src/ │ ├── core/ # Types, config, resolver │ ├── features/ # Feature modules (memory, state, db, routing, model-routing) │ ├── hooks/ # OpenCode plugin hooks │ ├── shared/ # Utilities (logger, paths) │ └── tools/ # MCP tool implementations └── .github/ # CI workflows, issue templates ``` -------------------------------- ### Assess Flakiness Risk Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-tester.md Format for documenting unstable tests and their mitigation strategies. ```markdown - Test: path/file.test.ts::should ... Risk: External timing variability Mitigation: Mock dependency, assert on state ``` -------------------------------- ### Search Exploration Notes Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-explorer.md Query existing notes to identify previously documented patterns and conventions for the project. ```javascript goop_search_notes({ query: "[codebase/project name] patterns conventions" }) ``` -------------------------------- ### Manage field notes Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Tools for saving and searching project notes. Prefer note_id for direct retrieval to bypass search overhead. ```javascript goop_save_note({ title: "SQLite FTS5 tokenization", body: "...", tags: ["sqlite", "fts5"], source_agent: "goop-researcher", importance: 8 }) ``` ```javascript goop_search_notes({ note_id: "fn_20260716_0v28qlej" }) ``` -------------------------------- ### Create PR with Linked Issues via CLI Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Include issue-linking keywords directly in the body argument when creating a PR via the CLI. ```bash gh pr create --body "Fixes #123 ## Summary ..." ``` -------------------------------- ### Project View Tools Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Tools for retrieving project-related information such as timelines and dashboards. ```APIDOC ## goop_timeline ### Description Retrieves the timeline for a specific workflow. ### Parameters - **workflow_id** (string) - Optional - The ID of the workflow. - **limit** (integer) - Optional - The maximum number of entries to return. ## goop_dashboard ### Description Retrieves the dashboard for a specific workflow. ### Parameters - **workflow_id** (string) - Optional - The ID of the workflow. ``` -------------------------------- ### Define Wave Header with PR and Branch Metadata Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-planner.md Use this format for wave headers in BLUEPRINT.md when the Atomic PR Strategy is enabled. ```markdown ## Wave 1 — Feature Name **PR:** `feat(scope): add feature name` **Branch:** `feat/feature-name` ``` -------------------------------- ### goop_get_global_config Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Retrieves the global configuration. ```APIDOC ## goop_get_global_config ### Description Retrieves the current global configuration settings. ``` -------------------------------- ### Create pull request Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Automates the creation of a pull request with the provided branch and metadata. ```javascript goop_create_pr({ title: "fix(db): prevent section shadowing", body: "...", branch: "feat/section-tool-hardening", base: "main" }) ``` -------------------------------- ### Requirements Document Template Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/discovery-interview.md Standard structure for the REQUIREMENTS.md file generated upon completion of the discovery interview. ```markdown # REQUIREMENTS: [Feature Name] **Generated:** [date] **Status:** Locked ## Vision [What and why] ## Must-Haves - [ ] [Requirement 1] - [ ] [Requirement 2] ## Constraints ### Technical - [Constraint 1] ### Practical - [Timeline, budget, resources] ## Out of Scope - [Item 1] — [reason/future phase] ## Assumptions - [Assumption 1] — If false: [Impact] ## Risks & Mitigations | Risk | Impact | Likelihood | Mitigation | |------|--------|------------|------------| | [Risk 1] | H/M/L | H/M/L | [Plan] | ## Atomic PR Strategy [Yes — one PR per wave / No — single PR / Custom] *Discovery interview completed. Ready for /goop-plan.* ``` -------------------------------- ### Checkout new git branch Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-discuss.md Creates and switches to a new branch dedicated to the current workflow. ```bash git checkout -b ``` -------------------------------- ### Define Workflow Phases Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/architecture-design.md Represents the sequential lifecycle stages of the plugin workflow. ```text idle → plan → research → specify → execute → accept → archive ``` -------------------------------- ### Manage Reviewers via GitHub CLI Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Assign reviewers during PR creation or update existing PRs using the gh CLI. ```bash # Add reviewer at creation time gh pr create --base main --reviewer octocat --title "..." --body "..." # Add reviewer after creation gh pr edit --add-reviewer octocat ``` -------------------------------- ### Retrieve project timeline and dashboard Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Use these tools to inspect workflow history or access the project dashboard. ```javascript goop_timeline({ workflow_id: "goopspec-orchestration-upgrade", limit: 50 }) ``` ```javascript goop_dashboard({}) ``` -------------------------------- ### Modify configuration Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-setup.md Updates existing configuration settings. ```javascript goop_setup({ action: "apply", ... }) ``` -------------------------------- ### Test Structure for Goop Status Tool Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Uses Bun's testing framework to verify tool execution within a mocked plugin context. ```typescript import { describe, it, expect, beforeEach, afterEach } from "bun:test"; import { createGoopStatusTool } from "./index.js"; import { createMockPluginContext, createMockToolContext, setupTestEnvironment, type PluginContext, } from "../../test-utils.js"; describe("goop_status tool", () => { let ctx: PluginContext; let cleanup: () => void; beforeEach(() => { const env = setupTestEnvironment("test-name"); cleanup = env.cleanup; ctx = createMockPluginContext({ testDir: env.testDir }); }); afterEach(() => cleanup()); it("does something", async () => { const tool = createGoopStatusTool(ctx); const result = await tool.execute({}, createMockToolContext()); expect(result).toContain("expected"); }); }); ``` -------------------------------- ### goop_status() Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-status.md Retrieves the current workflow status and suggests the next command. ```APIDOC ## goop_status() ### Description Displays the current workflow state, gate status, wave progress, and suggests the next command to execute. ### Signature `goop_status({ verbose: boolean })` ### Parameters - **verbose** (boolean) - Optional - If true, provides additional detail regarding the current workflow status. ### Response - **Active workflow and phase** (string) - **Gate status** (string) - Possible values: `interviewComplete`, `specLocked`, `allWavesComplete`. - **Wave progress** (object) - Includes current wave and total waves. - **Blockers/Deviations** (array) - List of pending blockers or deviations. - **Suggested next command** (string) - The recommended next action based on the current state. ``` -------------------------------- ### Define Response Format Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-researcher.md Required structure for all agent responses. ```markdown ## STATUS complete | partial | blocked ## SUMMARY ## ARTIFACTS ## VERIFICATION ## NEXT ``` -------------------------------- ### Global Search Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/field-notes-protocol.md Searches across all projects and workflows without applying filters. ```text goop_search_notes("JWT token rotation") ``` -------------------------------- ### Configure GoopSpec Agent Models Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md The configuration file defines the model mapping for each executor tier. This file is typically generated by running /goop-setup and stored in .goopspec/config.json. ```json { "agents": { "goop-executor-low": { "model": "anthropic/claude-sonnet-4-6" }, "goop-executor-medium": { "model": "anthropic/claude-sonnet-4-6" }, "goop-executor-high": { "model": "anthropic/claude-opus-4-6" }, "goop-executor-frontend-low": { "model": "anthropic/claude-sonnet-4-6" }, "goop-executor-frontend-high": { "model": "anthropic/claude-opus-4-6" } } } ``` -------------------------------- ### Define Technical Debt Location Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/retrospective.md Use this placeholder to specify the file path or module location of incurred technical debt. ```text {{location}} ``` -------------------------------- ### slashcommand Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Executes a slash command. ```APIDOC ## slashcommand ### Description Executes a specific slash command. ### Arguments - **command** (string) - Required ``` -------------------------------- ### Execute Task Verification Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/templates/blueprint.md Executes the verification command defined for a specific task. ```bash {{verification_command}} ``` -------------------------------- ### Post-Merge Cleanup and Verification Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md Commands to delete local branches and verify CI status after a PR has been merged. ```bash # Delete the remote branch (GitHub UI does this automatically if configured) # Delete local branch git branch -d feat/my-feature # Or derive branch name from the PR and delete gh pr view --json headRefName -q '.headRefName' | xargs git branch -d # Return to main and pull git checkout main && git pull # Confirm CI passed on the merged commit gh run list --limit 3 ``` -------------------------------- ### Configure agent thinking levels Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Define the reasoning effort for specific agent roles within a goopspec.json configuration file. ```json { "agentThinkingLevels": { "explorer": "medium", "executor-low": "low", "executor-high": "xhigh", "orchestrator": "high" } } ``` -------------------------------- ### Trigger goop-plan via autopilot Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-discuss.md Invokes the planning command automatically when running in lazy autopilot mode. ```javascript mcp_slashcommand({ command: "/goop-plan" }) ``` -------------------------------- ### Plan-phase sequencing Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-orchestrator.md The standard sequence of operations during the plan phase. ```text discovery gate → research (or skip + ADL log) → assemble Research Summary → goop-planner delegation → contract gate → spec lock ``` -------------------------------- ### Standard Test Structure Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-tester.md Boilerplate for writing tests using bun:test and local test utilities. ```typescript import { describe, it, expect, beforeEach, afterEach } from "bun:test"; import { createFeature } from "./index.js"; import { createMockPluginContext, setupTestEnvironment, type PluginContext, } from "../../test-utils.js"; describe("Feature: [Name]", () => { describe("when [context]", () => { it("should [expected behavior]", async () => { // Arrange const input = setupTestData(); // Act const result = await functionUnderTest(input); // Assert expect(result).toMatchExpectedOutput(); }); }); }); ``` -------------------------------- ### Execute slash command Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Triggers a specific slash command within the environment. ```javascript slashcommand({ command: "/goop-execute" }) ``` -------------------------------- ### Search Project Memory Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-explorer.md Query long-term memory for specific project entry points, integration points, and patterns. ```javascript memory_search({ query: "[project] entrypoints integration points patterns", limit: 5 }) ``` -------------------------------- ### Workflow Sequencing Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-plan.md The logical flow of operations from discovery to specification locking. ```text discovery gate → research (or skip + ADL log) → assemble Research Summary → planner delegation → contract gate → spec lock ``` -------------------------------- ### goop_write_traceability Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Records traceability information for a requirement. ```APIDOC ## goop_write_traceability ### Description Records traceability information for a requirement. ### Parameters - **requirement_key** (string) - Required - **wave_number** (number) - Optional - **task_index** (number) - Optional - **status** (string) - Optional - **workflow_id** (string) - Optional - **items** (array) - Optional - {requirement_key, wave_number?, task_index?, status?}[] ### Example `goop_write_traceability({ requirement_key: "MH2", wave_number: 2, task_index: 1, status: "covered" })` ``` -------------------------------- ### Execute goop-status Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/commands/goop-status.md Call the status tool directly to retrieve the current workflow state. ```javascript goop_status({ verbose: true }) ``` -------------------------------- ### Format Research Summary for Skipped Research Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/agents/goop-planner.md Use this format to document the justification when pre-plan research is skipped. ```markdown ## Research Summary Pre-plan research was skipped under the conservative skip heuristic (see ADL entry dated [date]). Reason: [e.g., markdown-only change to ≤ 2 known files with no domain or technology unknowns]. Architecture draws on direct file reads and prior Field Notes already in memory. ``` -------------------------------- ### Retrieve goop reference Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Fetches specific reference documents or templates by name. ```javascript goop_reference({ names: ["core-protocol", "git-workflow", "field-notes-protocol"] }) ``` -------------------------------- ### Check for existing feature branches Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/pr-creation.md List all local and remote branches filtered by the feature prefix to avoid naming collisions. ```bash git branch -a | grep feat/ ``` -------------------------------- ### Perform ADL action Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/tool-reference.md Reads or appends to the ADL log with specified rule and file context. ```javascript goop_adl({ action: "append", type: "deviation", description: "Bypassed code-review gate", entry_action: "Escalated to user", rule: 4, files: ["src/auth.ts"] }) ``` -------------------------------- ### TypeScript Import Ordering Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/AGENTS.md Follow this structure to maintain consistent import ordering, prioritizing external packages followed by internal modules with explicit .js extensions. ```typescript // 1. External imports import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"; // 2. Internal imports with .js extension import type { PluginContext } from "../../core/types.js"; import { log, logError } from "../shared/logger.js"; ``` -------------------------------- ### Natural Language Recall Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Query the memory system for past project information using natural language. ```text How did we handle auth before? ``` -------------------------------- ### Target Branch Detection Command Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/git-workflow.md Command to identify the default branch of the remote repository. ```bash git remote show origin | grep 'HEAD branch' ``` -------------------------------- ### Execution Wave Progress Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md Shows the status of tasks completed during the execution phase. ```text Wave 1: Foundation (DB schema, types) ✓ Task 1.1: Create notifications table ✓ Task 1.2: Add TypeScript interfaces Wave 2: Core (business logic) ✓ Task 2.1: Notification service ✓ Task 2.2: Mark-as-read endpoint Wave 3: UI (components) ✓ Task 3.1: NotificationBadge component ✓ Task 3.2: NotificationDropdown component ✓ Task 3.3: Preferences page ``` -------------------------------- ### Sequential Dispatch Flow Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/dispatch-patterns.md Visual representation of tasks executed in a strictly sequential order. ```text Task A → Complete → Task B → Complete → Task C ``` -------------------------------- ### Define GoopSpec Workflow Phases Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/core-protocol.md The sequential phases of the GoopSpec workflow. ```text discuss -> plan -> execute -> accept -> confirm ``` -------------------------------- ### Contract Gate Planning Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/README.md The mandatory confirmation step before execution to define project scope. ```text +-------------------------------------------------------+ | CONTRACT GATE | +-------------------------------------------------------+ | MUST-HAVES: | OUT OF SCOPE: | | • Login with email | • OAuth (future) | | • Session persistence | • Password reset | | • Error messages | | +-------------------------------------------------------+ | Type "confirm" to lock. Changes require /goop-amend. | +-------------------------------------------------------+ ``` -------------------------------- ### Configure Boundary Guardrails Source: https://github.com/hffmnnj/opencode-goopspec/blob/main/packages/opencode-plugin/references/phase-gates.md Defines the enforcement tiers for project operations in the .goopspec/config.json file. ```json { "boundaries": { "always": ["run_tests_before_commit"], "ask_first": ["schema_changes"], "never": ["commit_secrets"] } } ```