@dccxx/auggiegw 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.opencode/command/opsx-apply.md +149 -0
  2. package/.opencode/command/opsx-archive.md +154 -0
  3. package/.opencode/command/opsx-bulk-archive.md +239 -0
  4. package/.opencode/command/opsx-continue.md +111 -0
  5. package/.opencode/command/opsx-explore.md +171 -0
  6. package/.opencode/command/opsx-ff.md +91 -0
  7. package/.opencode/command/opsx-new.md +66 -0
  8. package/.opencode/command/opsx-onboard.md +522 -0
  9. package/.opencode/command/opsx-sync.md +131 -0
  10. package/.opencode/command/opsx-verify.md +161 -0
  11. package/.opencode/skills/openspec-apply-change/SKILL.md +156 -0
  12. package/.opencode/skills/openspec-archive-change/SKILL.md +114 -0
  13. package/.opencode/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  14. package/.opencode/skills/openspec-continue-change/SKILL.md +118 -0
  15. package/.opencode/skills/openspec-explore/SKILL.md +290 -0
  16. package/.opencode/skills/openspec-ff-change/SKILL.md +101 -0
  17. package/.opencode/skills/openspec-new-change/SKILL.md +74 -0
  18. package/.opencode/skills/openspec-onboard/SKILL.md +529 -0
  19. package/.opencode/skills/openspec-sync-specs/SKILL.md +138 -0
  20. package/.opencode/skills/openspec-verify-change/SKILL.md +168 -0
  21. package/dist/cli.js +1187 -65
  22. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/.openspec.yaml +2 -0
  23. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/design.md +113 -0
  24. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/proposal.md +28 -0
  25. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/specs/kit-command/spec.md +107 -0
  26. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/specs/kit-install-prompts/spec.md +90 -0
  27. package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/tasks.md +62 -0
  28. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/.openspec.yaml +2 -0
  29. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/design.md +131 -0
  30. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/proposal.md +35 -0
  31. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/specs/kit-command/spec.md +157 -0
  32. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/specs/opencode-agent-support/spec.md +65 -0
  33. package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/tasks.md +54 -0
  34. package/openspec/config.yaml +20 -0
  35. package/package.json +2 -1
  36. package/specs/kit-command/spec.md +157 -0
  37. package/specs/kit-install-prompts/spec.md +90 -0
  38. package/specs/opencode-agent-support/spec.md +65 -0
@@ -0,0 +1,2 @@
1
+ schema: spec-driven
2
+ created: 2026-02-01
@@ -0,0 +1,113 @@
1
+ ## Context
2
+
3
+ The current `kit` command in `src/cli.ts` automatically installs prompts and subagents to both Claude (`~/.claude/`) and Augment (`~/.augment/`) directories at the user level without any user interaction. This change introduces interactive prompts using `@clack/prompts` to give users control over:
4
+ 1. Which AI tool to install to (Claude, Augment, or Both)
5
+ 2. Whether to install at user level (home directory) or project level (current working directory)
6
+
7
+ The existing implementation has hardcoded paths and dual-directory logic in `savePromptToFile()` and `saveSubagentToFile()` functions. These need to be refactored to support dynamic path resolution based on user selections.
8
+
9
+ ## Goals / Non-Goals
10
+
11
+ **Goals:**
12
+ - Add interactive CLI prompts for target AI tool and installation scope selection
13
+ - Support optional `--target` and `--scope` flags for automation/scripting
14
+ - Refactor file saving logic to support dynamic path resolution
15
+ - Maintain existing file format specifications (YAML frontmatter + content)
16
+ - Show exact installation paths in success messages
17
+ - Auto-create directories if they don't exist
18
+
19
+ **Non-Goals:**
20
+ - Modifying the kit API endpoint or response format
21
+ - Changing the file format for prompts or subagents
22
+ - Adding .gitignore management for project-level installations
23
+ - Modifying the model name mapping logic for Claude
24
+ - Supporting additional AI tools beyond Claude and Augment
25
+ - Adding validation for kit contents before installation
26
+
27
+ ## Decisions
28
+
29
+ ### Decision 1: Use @clack/prompts for interactive UI
30
+ **Rationale**: @clack/prompts provides beautiful, modern CLI prompts with excellent UX. It's widely used in modern CLI tools (create-t3-app, create-next-app, etc.) and has a clean API.
31
+
32
+ **Alternatives considered**:
33
+ - `prompts` library: Lighter weight but less visually polished
34
+ - `inquirer`: More mature but heavier and older API design
35
+ - Custom implementation: Too much effort for standard functionality
36
+
37
+ **Trade-off**: Adds ~500KB to dependencies, but the UX improvement justifies the cost.
38
+
39
+ ### Decision 2: Always prompt by default, no --yes flag
40
+ **Rationale**: The prompts themselves ARE the interface. Users who want automation can use `--target` and `--scope` flags. Adding a `--yes` flag would be redundant since the prompts are the primary UX, not an obstacle.
41
+
42
+ **Alternatives considered**:
43
+ - Add `--yes` flag to skip prompts: Adds unnecessary complexity
44
+ - Make prompts opt-in with `--interactive`: Breaks existing behavior more severely
45
+
46
+ ### Decision 3: Refactor save functions to accept paths as parameters
47
+ **Rationale**: Current `savePromptToFile()` and `saveSubagentToFile()` have hardcoded paths. Refactoring them to accept paths as parameters makes them reusable and testable.
48
+
49
+ **Approach**:
50
+ - Create new functions: `savePromptToPath(prompt, dirPath)` and `saveSubagentToPath(subagent, dirPath, isClaudeTarget)`
51
+ - Keep model mapping logic in `saveSubagentToPath()` - only apply when `isClaudeTarget` is true
52
+ - Build path configuration object in `handleKit()` based on user selections
53
+
54
+ **Alternatives considered**:
55
+ - Pass full config object to save functions: More coupling, harder to test
56
+ - Keep dual-directory logic in save functions: Doesn't support single-target installations
57
+
58
+ ### Decision 4: Project-level installations use current working directory
59
+ **Rationale**: Using `process.cwd()` is the standard approach for project-level CLI tools. Users expect `./.augment/` and `./.claude/` to be created in the directory where they run the command.
60
+
61
+ **Alternatives considered**:
62
+ - Search for project root (package.json, git root): Too complex, not always desired
63
+ - Use a config file to specify project directory: Overkill for this use case
64
+
65
+ ### Decision 5: CLI flags use exact values (no abbreviations)
66
+ **Rationale**: Explicit values improve clarity and reduce errors.
67
+
68
+ **Flag design**:
69
+ - `--target <claude|augment|both>`: Exact match to prompt options
70
+ - `--scope <user|project>`: Clear and unambiguous
71
+
72
+ **Alternatives considered**:
73
+ - Abbreviations like `--target c|a|b`: Less clear, error-prone
74
+ - Different naming like `--ai-tool`: More verbose without added clarity
75
+
76
+ ## Risks / Trade-offs
77
+
78
+ **[Risk] Breaking change for existing scripts** → Mitigation: Document the change clearly in release notes. Users can add `--target both --scope user` to maintain old behavior.
79
+
80
+ **[Risk] @clack/prompts adds 500KB to bundle** → Mitigation: Acceptable trade-off for significantly improved UX. This is a CLI tool, not a web bundle.
81
+
82
+ **[Risk] Project-level installations may clutter repositories** → Mitigation: Users are responsible for adding `.augment/` and `.claude/` to `.gitignore`. We explicitly decided not to auto-manage .gitignore.
83
+
84
+ **[Risk] Path resolution complexity with multiple targets** → Mitigation: Clear separation of concerns - path resolution happens once in `handleKit()`, save functions are simple and focused.
85
+
86
+ **[Risk] Users may not understand the difference between user and project level** → Mitigation: Use clear labels in prompts: "User level (~/.augment)" and "Project level (./.augment)" to show exact paths.
87
+
88
+ ## Migration Plan
89
+
90
+ **Deployment**:
91
+ 1. Add `@clack/prompts` dependency via `bun add @clack/prompts`
92
+ 2. Implement new types and interfaces for configuration
93
+ 3. Create prompt functions using @clack/prompts
94
+ 4. Refactor save functions to accept paths
95
+ 5. Update `handleKit()` to orchestrate prompts and path resolution
96
+ 6. Update command definition to add `--target` and `--scope` options
97
+ 7. Run `bun run lint` and `bun run build` to verify
98
+ 8. Update version in package.json (breaking change - bump major version)
99
+ 9. Publish with clear release notes about breaking change
100
+
101
+ **Rollback strategy**:
102
+ - If critical issues arise, users can downgrade to previous version
103
+ - No data migration needed - this only affects installation behavior
104
+ - Existing installed kits are not affected
105
+
106
+ **Breaking change communication**:
107
+ - Document in CHANGELOG.md
108
+ - Include migration guide: add `--target both --scope user` to scripts
109
+ - Consider adding deprecation warning in previous version (if time permits)
110
+
111
+ ## Open Questions
112
+
113
+ None - all design decisions have been made based on the exploration phase.
@@ -0,0 +1,28 @@
1
+ ## Why
2
+
3
+ The current `kit` command automatically installs prompts and subagents to both Claude and Augment directories at the user level without any user choice. Users need control over which AI tool to install to (Claude, Augment, or both) and whether to install at user level or project level for better flexibility and project-specific configurations.
4
+
5
+ ## What Changes
6
+
7
+ - Add interactive prompts using `@clack/prompts` to let users choose:
8
+ - Target AI tool: Claude, Augment, or Both
9
+ - Installation scope: User level (~/.augment, ~/.claude) or Project level (./.augment, ./.claude)
10
+ - Add optional CLI flags `--target` and `--scope` for automation/scripting
11
+ - Refactor file saving logic to support dynamic path resolution based on user selections
12
+ - Update success messages to show exact installation paths
13
+ - **BREAKING**: Default behavior changes from automatic installation to interactive prompts (users can use flags to maintain automation)
14
+
15
+ ## Capabilities
16
+
17
+ ### New Capabilities
18
+ - `kit-install-prompts`: Interactive prompts for selecting AI tool target and installation scope when installing kits
19
+
20
+ ### Modified Capabilities
21
+ - `kit-command`: Existing kit command behavior changes from automatic dual-directory installation to user-controlled installation with prompts
22
+
23
+ ## Impact
24
+
25
+ - **Code**: `src/cli.ts` - `handleKit()`, `savePromptToFile()`, `saveSubagentToFile()` functions need refactoring
26
+ - **Dependencies**: New dependency `@clack/prompts` for interactive CLI prompts
27
+ - **Breaking Change**: Existing scripts using `auggiegw kit <id>` will now show prompts instead of auto-installing. Users need to add `--target both --scope user` flags to maintain old behavior
28
+ - **User Experience**: More control and flexibility for users, better project-level kit management
@@ -0,0 +1,107 @@
1
+ ## MODIFIED Requirements
2
+
3
+ ### Requirement: Command Invocation
4
+ WHEN the user runs `auggiegw kit <kit-id>`, THE SYSTEM SHALL prompt the user to select target AI tool and installation scope, then fetch the kit from the public API endpoint.
5
+
6
+ #### Scenario: User runs kit command without flags
7
+ - **WHEN** user runs `auggiegw kit <kit-id>` without any flags
8
+ - **THEN** system displays interactive prompt for target selection
9
+ - **THEN** system displays interactive prompt for scope selection
10
+ - **THEN** system fetches the kit from the public API endpoint
11
+
12
+ #### Scenario: User runs kit command with flags
13
+ - **WHEN** user runs `auggiegw kit <kit-id> --target claude --scope user`
14
+ - **THEN** system skips prompts and uses provided flag values
15
+ - **THEN** system fetches the kit from the public API endpoint
16
+
17
+ #### Scenario: Missing kit-id argument
18
+ - **WHEN** kit-id argument is missing
19
+ - **THEN** system displays "Error: Kit ID is required" and usage message, and exits with code 1
20
+
21
+ ### Requirement: Prompt Installation
22
+ WHEN processing prompts, THE SYSTEM SHALL create the target directories based on user selection and save markdown files with YAML frontmatter to the selected locations.
23
+
24
+ #### Scenario: Install prompts to Claude user level
25
+ - **WHEN** user selects target "Claude" and scope "User level"
26
+ - **THEN** system creates directory `~/.claude/commands/` if it does not exist
27
+ - **THEN** for each prompt in the kit, system saves a markdown file to `~/.claude/commands/{command}.md` with YAML frontmatter containing `description` and `type: "manual"` fields
28
+
29
+ #### Scenario: Install prompts to Augment project level
30
+ - **WHEN** user selects target "Augment" and scope "Project level"
31
+ - **THEN** system creates directory `./.augment/commands/` if it does not exist
32
+ - **THEN** for each prompt in the kit, system saves a markdown file to `./.augment/commands/{command}.md` with YAML frontmatter containing `description` and `type: "manual"` fields
33
+
34
+ #### Scenario: Install prompts to both targets at user level
35
+ - **WHEN** user selects target "Both" and scope "User level"
36
+ - **THEN** system creates directories `~/.augment/commands/` and `~/.claude/commands/` if they do not exist
37
+ - **THEN** for each prompt in the kit, system saves markdown files to both `~/.augment/commands/{command}.md` and `~/.claude/commands/{command}.md`
38
+
39
+ #### Scenario: Overwrite existing prompt files
40
+ - **WHEN** a prompt file with the same filename already exists
41
+ - **THEN** system overwrites the existing file without confirmation
42
+
43
+ #### Scenario: Prompt file save failure
44
+ - **WHEN** a prompt file fails to save
45
+ - **THEN** system throws an error with message "Failed to save prompt file for command '{command}': {error}"
46
+
47
+ #### Scenario: Partial save failure with multiple targets
48
+ - **WHEN** user selects "Both" targets and a prompt file fails to save to one directory
49
+ - **THEN** system still attempts to save to the other directory before throwing an error
50
+
51
+ ### Requirement: Subagent Installation
52
+ WHEN processing subagents, THE SYSTEM SHALL create the target directories based on user selection and save markdown files with YAML frontmatter to the selected locations.
53
+
54
+ #### Scenario: Install subagents to Claude user level
55
+ - **WHEN** user selects target "Claude" and scope "User level"
56
+ - **THEN** system creates directory `~/.claude/agents/` if it does not exist
57
+ - **THEN** for each subagent in the kit, system saves a markdown file to `~/.claude/agents/{name}.md` with YAML frontmatter containing `name`, `description`, `model`, and `color` fields
58
+
59
+ #### Scenario: Install subagents to Augment project level
60
+ - **WHEN** user selects target "Augment" and scope "Project level"
61
+ - **THEN** system creates directory `./.augment/agents/` if it does not exist
62
+ - **THEN** for each subagent in the kit, system saves a markdown file to `./.augment/agents/{name}.md` with YAML frontmatter containing `name`, `description`, `model`, and `color` fields
63
+
64
+ #### Scenario: Install subagents to both targets at user level
65
+ - **WHEN** user selects target "Both" and scope "User level"
66
+ - **THEN** system creates directories `~/.augment/agents/` and `~/.claude/agents/` if they do not exist
67
+ - **THEN** for each subagent in the kit, system saves markdown files to both `~/.augment/agents/{name}.md` and `~/.claude/agents/{name}.md`
68
+
69
+ #### Scenario: Overwrite existing subagent files
70
+ - **WHEN** a subagent file with the same filename already exists
71
+ - **THEN** system overwrites the existing file without confirmation
72
+
73
+ #### Scenario: Subagent file save failure
74
+ - **WHEN** a subagent file fails to save
75
+ - **THEN** system throws an error with message "Failed to save subagent file for '{name}': {error}"
76
+
77
+ #### Scenario: Partial save failure with multiple targets
78
+ - **WHEN** user selects "Both" targets and a subagent file fails to save to one directory
79
+ - **THEN** system still attempts to save to the other directory before throwing an error
80
+
81
+ ### Requirement: User Feedback
82
+ WHILE fetching and installing the kit, THE SYSTEM SHALL display progress information and show detailed success message with exact installation paths.
83
+
84
+ #### Scenario: Display fetching progress
85
+ - **WHEN** fetching the kit
86
+ - **THEN** system displays a spinner with text "Fetching kit {kitId}..."
87
+
88
+ #### Scenario: Display processing progress
89
+ - **WHEN** processing the kit
90
+ - **THEN** system updates the spinner text to "Processing kit \"{name}\"..."
91
+
92
+ #### Scenario: Display saving prompts progress
93
+ - **WHEN** saving prompts
94
+ - **THEN** system updates the spinner text to "Saving {count} prompts..."
95
+
96
+ #### Scenario: Display saving subagents progress
97
+ - **WHEN** saving subagents
98
+ - **THEN** system updates the spinner text to "Saving {count} subagents..."
99
+
100
+ #### Scenario: Display success message with exact paths
101
+ - **WHEN** installation completes successfully
102
+ - **THEN** system displays "Successfully installed kit \"{name}\": {promptsCount} prompts, {subagentsCount} subagents"
103
+ - **THEN** system displays exact installation paths showing where files were saved
104
+
105
+ #### Scenario: Display error message
106
+ - **WHEN** any error occurs during the process
107
+ - **THEN** system displays "Kit fetch failed: {error}" and exits with code 1
@@ -0,0 +1,90 @@
1
+ ## ADDED Requirements
2
+
3
+ ### Requirement: User can select target AI tool
4
+ The system SHALL prompt the user to select which AI tool to install the kit to: Claude, Augment, or Both.
5
+
6
+ #### Scenario: User selects Claude only
7
+ - **WHEN** user runs `auggiegw kit <kit-id>` without `--target` flag
8
+ - **THEN** system displays interactive prompt with options: Claude, Augment, Both
9
+ - **WHEN** user selects "Claude"
10
+ - **THEN** system installs kit files only to Claude directories
11
+
12
+ #### Scenario: User selects Augment only
13
+ - **WHEN** user runs `auggiegw kit <kit-id>` without `--target` flag
14
+ - **THEN** system displays interactive prompt with options: Claude, Augment, Both
15
+ - **WHEN** user selects "Augment"
16
+ - **THEN** system installs kit files only to Augment directories
17
+
18
+ #### Scenario: User selects Both
19
+ - **WHEN** user runs `auggiegw kit <kit-id>` without `--target` flag
20
+ - **THEN** system displays interactive prompt with options: Claude, Augment, Both
21
+ - **WHEN** user selects "Both"
22
+ - **THEN** system installs kit files to both Claude and Augment directories
23
+
24
+ #### Scenario: User provides target via CLI flag
25
+ - **WHEN** user runs `auggiegw kit <kit-id> --target claude`
26
+ - **THEN** system skips the target prompt and uses "claude" as the target
27
+
28
+ ### Requirement: User can select installation scope
29
+ The system SHALL prompt the user to select the installation scope: User level or Project level.
30
+
31
+ #### Scenario: User selects user level installation
32
+ - **WHEN** user runs `auggiegw kit <kit-id>` without `--scope` flag
33
+ - **THEN** system displays interactive prompt with options: User level, Project level
34
+ - **WHEN** user selects "User level"
35
+ - **THEN** system installs kit files to home directory paths (~/.augment or ~/.claude)
36
+
37
+ #### Scenario: User selects project level installation
38
+ - **WHEN** user runs `auggiegw kit <kit-id>` without `--scope` flag
39
+ - **THEN** system displays interactive prompt with options: User level, Project level
40
+ - **WHEN** user selects "Project level"
41
+ - **THEN** system installs kit files to current working directory paths (./.augment or ./.claude)
42
+
43
+ #### Scenario: User provides scope via CLI flag
44
+ - **WHEN** user runs `auggiegw kit <kit-id> --scope project`
45
+ - **THEN** system skips the scope prompt and uses "project" as the scope
46
+
47
+ ### Requirement: System resolves installation paths based on selections
48
+ The system SHALL resolve the correct installation paths based on the user's target and scope selections.
49
+
50
+ #### Scenario: Claude target with user scope
51
+ - **WHEN** user selects target "Claude" and scope "User level"
52
+ - **THEN** system resolves paths to ~/.claude/commands/ and ~/.claude/agents/
53
+
54
+ #### Scenario: Augment target with project scope
55
+ - **WHEN** user selects target "Augment" and scope "Project level"
56
+ - **THEN** system resolves paths to ./.augment/commands/ and ./.augment/agents/
57
+
58
+ #### Scenario: Both targets with user scope
59
+ - **WHEN** user selects target "Both" and scope "User level"
60
+ - **THEN** system resolves paths to both ~/.augment/ and ~/.claude/ directories
61
+
62
+ #### Scenario: Both targets with project scope
63
+ - **WHEN** user selects target "Both" and scope "Project level"
64
+ - **THEN** system resolves paths to both ./.augment/ and ./.claude/ directories
65
+
66
+ ### Requirement: System creates directories automatically
67
+ The system SHALL automatically create target directories if they do not exist.
68
+
69
+ #### Scenario: Target directory does not exist
70
+ - **WHEN** system attempts to save files to a directory that does not exist
71
+ - **THEN** system creates the directory recursively before saving files
72
+
73
+ #### Scenario: Multiple target directories need creation
74
+ - **WHEN** user selects "Both" targets and directories do not exist
75
+ - **THEN** system creates all required directories for both Claude and Augment
76
+
77
+ ### Requirement: System displays installation paths in success message
78
+ The system SHALL display the exact installation paths in the success message after kit installation completes.
79
+
80
+ #### Scenario: Single target installation
81
+ - **WHEN** kit installation completes successfully with single target
82
+ - **THEN** success message includes exact paths where prompts and subagents were installed
83
+
84
+ #### Scenario: Both targets installation
85
+ - **WHEN** kit installation completes successfully with both targets
86
+ - **THEN** success message includes exact paths for both Claude and Augment installations
87
+
88
+ #### Scenario: Success message shows file counts per location
89
+ - **WHEN** kit installation completes successfully
90
+ - **THEN** success message shows the number of prompts and subagents installed to each location
@@ -0,0 +1,62 @@
1
+ ## 1. Add Dependencies
2
+
3
+ - [x] 1.1 Add @clack/prompts dependency using `bun add @clack/prompts`
4
+
5
+ ## 2. Add Type Definitions
6
+
7
+ - [x] 2.1 Add AITarget type: 'claude' | 'augment' | 'both'
8
+ - [x] 2.2 Add InstallScope type: 'user' | 'project'
9
+ - [x] 2.3 Add KitInstallConfig interface with targets, scope, and paths properties
10
+ - [x] 2.4 Add KitOptions interface with optional target and scope properties
11
+
12
+ ## 3. Create Prompt Functions
13
+
14
+ - [x] 3.1 Create promptAITarget() function using @clack/prompts select() with options: Claude, Augment, Both
15
+ - [x] 3.2 Create promptInstallScope() function using @clack/prompts select() with options: User level, Project level
16
+
17
+ ## 4. Create Path Resolution Function
18
+
19
+ - [x] 4.1 Create resolveInstallPaths() function that takes target and scope parameters
20
+ - [x] 4.2 Implement logic to resolve base directory based on scope (os.homedir() for user, process.cwd() for project)
21
+ - [x] 4.3 Implement logic to build paths object based on target selection (augment, claude, or both)
22
+ - [x] 4.4 Return KitInstallConfig object with resolved paths
23
+
24
+ ## 5. Refactor File Saving Functions
25
+
26
+ - [x] 5.1 Create savePromptToPath() function that accepts prompt and directory path parameters
27
+ - [x] 5.2 Implement prompt file saving logic with YAML frontmatter to specified path
28
+ - [x] 5.3 Create saveSubagentToPath() function that accepts subagent, directory path, and isClaudeTarget parameters
29
+ - [x] 5.4 Implement subagent file saving logic with YAML frontmatter to specified path
30
+ - [x] 5.5 Apply model name mapping only when isClaudeTarget is true in saveSubagentToPath()
31
+
32
+ ## 6. Update handleKit Function
33
+
34
+ - [x] 6.1 Add options parameter to handleKit() function signature
35
+ - [x] 6.2 Implement target selection logic: use options.target if provided, otherwise call promptAITarget()
36
+ - [x] 6.3 Implement scope selection logic: use options.scope if provided, otherwise call promptInstallScope()
37
+ - [x] 6.4 Call resolveInstallPaths() with selected target and scope to get installation config
38
+ - [x] 6.5 Update prompt installation loop to iterate over config.paths and call savePromptToPath() for each target
39
+ - [x] 6.6 Update subagent installation loop to iterate over config.paths and call saveSubagentToPath() for each target
40
+ - [x] 6.7 Update success message to show exact installation paths from config
41
+
42
+ ## 7. Update Command Definition
43
+
44
+ - [x] 7.1 Add --target option to kit command with description and valid values (claude, augment, both)
45
+ - [x] 7.2 Add --scope option to kit command with description and valid values (user, project)
46
+ - [x] 7.3 Update action handler to pass options to handleKit()
47
+
48
+ ## 8. Remove Old Functions
49
+
50
+ - [x] 8.1 Remove old savePromptToFile() function (replaced by savePromptToPath())
51
+ - [x] 8.2 Remove old saveSubagentToFile() function (replaced by saveSubagentToPath())
52
+
53
+ ## 9. Quality Assurance
54
+
55
+ - [x] 9.1 Run `bun run lint` to check code quality
56
+ - [x] 9.2 Fix any linting errors manually (no --unsafe flag)
57
+ - [x] 9.3 Run `bun run build` to verify the build succeeds
58
+ - [x] 9.4 Test kit command with interactive prompts (no flags)
59
+ - [x] 9.5 Test kit command with --target flag only
60
+ - [x] 9.6 Test kit command with --scope flag only
61
+ - [x] 9.7 Test kit command with both --target and --scope flags
62
+ - [x] 9.8 Verify files are created in correct locations for each scenario
@@ -0,0 +1,2 @@
1
+ schema: spec-driven
2
+ created: 2026-02-01
@@ -0,0 +1,131 @@
1
+ ## Context
2
+
3
+ The `auggiegw` CLI tool currently supports installing kits (prompts and subagents) to two AI tools: Claude and Augment. Both use similar directory structures (`~/.claude/` and `~/.augment/`) and identical YAML frontmatter formats.
4
+
5
+ OpenCode is a third AI coding assistant that requires:
6
+ - Different directory structure: `~/.config/opencode/` (user level) and `.opencode/` (project level)
7
+ - Different YAML frontmatter for subagents: requires `mode: subagent` field, excludes `model` field
8
+
9
+ The existing implementation in `src/cli.ts` has:
10
+ - `AITarget` type: `'claude' | 'augment' | 'both'`
11
+ - Path resolution logic in `resolveInstallPaths()`
12
+ - Save functions: `savePromptToPath()` and `saveSubagentToPath()`
13
+ - Interactive prompts using `@clack/prompts`
14
+
15
+ ## Goals / Non-Goals
16
+
17
+ **Goals:**
18
+ - Add OpenCode as a supported installation target
19
+ - Handle OpenCode's unique directory structure and YAML format
20
+ - Maintain backward compatibility with existing `claude`, `augment`, and `both` options
21
+ - Support installing to OpenCode alone or in combination with other targets
22
+ - Provide clear user feedback showing OpenCode installation paths
23
+
24
+ **Non-Goals:**
25
+ - Changing the existing behavior of Claude and Augment installations
26
+ - Supporting other AI tools beyond Claude, Augment, and OpenCode
27
+ - Auto-detecting which AI tools are installed on the user's system
28
+ - Validating OpenCode installation or configuration
29
+
30
+ ## Decisions
31
+
32
+ ### Decision 1: Target Selection UX
33
+ **Choice:** Add `opencode` as a fourth option, keep `both` for backward compatibility, add multi-select capability
34
+
35
+ **Rationale:**
36
+ - `both` remains as legacy option (Claude + Augment) to avoid breaking existing scripts
37
+ - Users can select individual targets: `claude`, `augment`, `opencode`
38
+ - Users can select multiple targets via comma-separated flags: `--target claude,opencode`
39
+ - Interactive mode shows all three individual options plus `both` for convenience
40
+
41
+ **Alternatives considered:**
42
+ - Replace `both` with `all` (BREAKING - rejected)
43
+ - Always use multi-select UI (more complex UX - rejected)
44
+ - Add `all` as fifth option (too many options - rejected)
45
+
46
+ ### Decision 2: AITarget Type Definition
47
+ **Choice:** Extend type to `'claude' | 'augment' | 'opencode' | 'both'`
48
+
49
+ **Rationale:**
50
+ - Minimal change to existing type system
51
+ - `both` continues to mean "Claude + Augment" for backward compatibility
52
+ - Internal logic can expand `both` to `['claude', 'augment']` array
53
+ - OpenCode is treated as a separate, equal target
54
+
55
+ **Alternatives considered:**
56
+ - Use array type `('claude' | 'augment' | 'opencode')[]` (requires refactoring all usages - rejected)
57
+ - Add `all` value meaning all three (adds complexity without clear benefit - rejected)
58
+
59
+ ### Decision 3: Path Resolution Strategy
60
+ **Choice:** Extend `resolveInstallPaths()` to handle OpenCode paths based on scope
61
+
62
+ **Paths:**
63
+ - User level: `~/.config/opencode/commands/` and `~/.config/opencode/agents/`
64
+ - Project level: `./.opencode/commands/` and `./.opencode/agents/`
65
+
66
+ **Rationale:**
67
+ - Follows OpenCode's documented directory structure
68
+ - Consistent with existing pattern for Claude and Augment
69
+ - `~/.config/` is standard for user-level config on Unix-like systems
70
+
71
+ ### Decision 4: YAML Frontmatter Handling
72
+ **Choice:** Modify `saveSubagentToPath()` to accept target type and conditionally format YAML
73
+
74
+ **For OpenCode subagents:**
75
+ ```yaml
76
+ ---
77
+ mode: subagent
78
+ name: "Agent Name"
79
+ description: "Description"
80
+ color: "#FF5733"
81
+ ---
82
+ ```
83
+
84
+ **For Claude/Augment subagents (unchanged):**
85
+ ```yaml
86
+ ---
87
+ name: "Agent Name"
88
+ description: "Description"
89
+ model: "claude-sonnet-4"
90
+ color: "#FF5733"
91
+ ---
92
+ ```
93
+
94
+ **Rationale:**
95
+ - OpenCode requires `mode: subagent` field
96
+ - OpenCode does not use `model` field (model selection is handled by OpenCode itself)
97
+ - Prompts/commands use identical format across all three tools (no changes needed)
98
+
99
+ **Alternatives considered:**
100
+ - Create separate `saveSubagentToOpenCode()` function (code duplication - rejected)
101
+ - Always include both formats (invalid YAML for each tool - rejected)
102
+
103
+ ### Decision 5: Flag Support for Multiple Targets
104
+ **Choice:** Support comma-separated values in `--target` flag: `--target claude,opencode`
105
+
106
+ **Rationale:**
107
+ - Enables automation scripts to install to multiple specific targets
108
+ - More flexible than requiring `both` or adding new combined options
109
+ - Follows common CLI pattern (e.g., `--include *.js,*.ts`)
110
+
111
+ **Implementation:**
112
+ - Parse comma-separated string into array
113
+ - Validate each target value
114
+ - Pass array to installation logic
115
+
116
+ ## Risks / Trade-offs
117
+
118
+ **Risk:** OpenCode directory structure or YAML format changes in future versions
119
+ → **Mitigation:** Document the OpenCode version this implementation targets; add version detection in future if needed
120
+
121
+ **Risk:** Users expect `both` to include OpenCode after this change
122
+ → **Mitigation:** Keep `both` as legacy (Claude + Augment only); document clearly in help text and error messages
123
+
124
+ **Trade-off:** Adding fourth target option increases UI complexity
125
+ → **Accepted:** The benefit of OpenCode support outweighs the minor increase in option count
126
+
127
+ **Trade-off:** Conditional YAML formatting in `saveSubagentToPath()` adds complexity
128
+ → **Accepted:** Keeps code DRY; alternative (separate functions) would duplicate more logic
129
+
130
+ **Risk:** Project-level `.opencode/` directory conflicts with other tools
131
+ → **Mitigation:** This is OpenCode's documented structure; users who use OpenCode will expect this directory
@@ -0,0 +1,35 @@
1
+ ## Why
2
+
3
+ The CLI tool currently supports installing kits (prompts and subagents) to Claude and Augment only. OpenCode is a popular AI coding assistant that uses a different directory structure and YAML format. Adding OpenCode support enables users to install kits to all three major AI tools from a single command.
4
+
5
+ ## What Changes
6
+
7
+ - Add `opencode` as a new target option alongside `claude` and `augment`
8
+ - Support OpenCode's unique directory structure (`~/.config/opencode/` for user level, `.opencode/` for project level)
9
+ - Handle OpenCode's different YAML frontmatter format for subagents (requires `mode: subagent` field, no `model` field)
10
+ - Update interactive prompts to include OpenCode as a target option
11
+ - Update target selection to support combinations (claude, augment, opencode, or multiple selections)
12
+ - Extend path resolution logic to handle OpenCode paths
13
+ - Update success messages to show OpenCode installation paths
14
+
15
+ ## Capabilities
16
+
17
+ ### New Capabilities
18
+ - `opencode-agent-support`: Support for installing kits to OpenCode AI tool with its specific directory structure and YAML format requirements
19
+
20
+ ### Modified Capabilities
21
+ - `kit-command`: Extend target selection to include OpenCode as an installation target option
22
+
23
+ ## Impact
24
+
25
+ **Affected Code:**
26
+ - `src/cli.ts`: Type definitions (`AITarget`), path constants, prompt functions, save functions, path resolution logic, kit installation handler
27
+
28
+ **User Experience:**
29
+ - Users will see "OpenCode" as a new option when running `auggiegw kit <kit-id>`
30
+ - Flag usage: `--target opencode` or `--target claude,augment,opencode` for multiple targets
31
+ - Installation paths will include OpenCode directories in success messages
32
+
33
+ **Backward Compatibility:**
34
+ - Non-breaking: Existing `claude`, `augment`, and `both` options continue to work as before
35
+ - New `opencode` option is additive