Revert "feat: seed Assistant workspace with update-configuration skill and improved docs"

This reverts commit 6a14bc6b69.
This commit is contained in:
Chris Scott committed 2026-04-27 18:07:41 +00:00
1 parent 6a14bc6b69
commit d0ddda01de
10 files changed
+19 -189

No files matched your search

+1 -1
View File
@@ -423,7 +423,7 @@ app.get('/', async (c) => {
const options = AssistantModeInitRequestSchema.parse(body)
const status = await ensureAssistantMode(repo, options)
if (status.files.opencodeJson.created || status.files.updateConfigurationSkill.created) {
if (status.files.opencodeJson.created) {
opencodeServerManager.clearStartupError()
await restartOpenCode(openCodeSupervisor)
}
+8 -81
View File
@@ -18,7 +18,6 @@ const ASSISTANT_MODE_DIR = 'assistant'
const ASSISTANT_MODE_RELATIVE_PATH = 'repos/assistant'
const ASSISTANT_AGENTS_MD_FILENAME = 'AGENTS.md'
const ASSISTANT_OPENCODE_CONFIG_FILENAME = 'opencode.json'
const ASSISTANT_UPDATE_CONFIGURATION_SKILL_PATH = path.join('.opencode', 'skills', 'update-configuration', 'SKILL.md')
export function getAssistantModeDirectory(): string {
const reposPath = getReposPath()
@@ -34,40 +33,22 @@ export function getAssistantModeDirectory(): string {
}
export function buildAssistantAgentsMd(): string {
return `# Assistant Directory
return `# Assistant Mode Instructions
This directory is the shared Assistant workspace for OpenCode Manager.
This folder is the shared Assistant mode workspace for OpenCode Manager.
## Purpose
Use this workspace to customize how the Assistant behaves across OpenCode Manager sessions. It is separate from your project repositories, so changes here are for the Assistant itself rather than application code.
This workspace is useful for:
- Durable Assistant instructions, preferences, and working agreements
- Assistant-specific OpenCode configuration
- Reusable skills and workflows for managing this environment
- Iterative improvements to how the Assistant helps you
## Files
- \`AGENTS.md\` defines Assistant instructions loaded for this workspace
- \`opencode.json\` defines OpenCode configuration for this workspace
- \`.opencode/skills/\` contains Assistant-scoped skills
## Customization
Edit \`AGENTS.md\` when you want to change the Assistant's default behavior, communication style, or durable preferences.
Edit \`opencode.json\` when you want to change OpenCode settings such as models, agents, providers, permissions, or plugins for this workspace.
Add skills under \`.opencode/skills/<skill-name>/SKILL.md\` when you want reusable workflows. The seeded \`update-configuration\` skill is for safely updating this workspace configuration and reloading OpenCode afterward.
Assistant mode provides an isolated space for:
- Self-editing agent instructions and preferences
- Customized workflows specific to this assistant workspace
- Iterative improvement of assistant behavior
## Self-Editing Rules
The agent MAY self-edit the following files within this workspace:
- \`AGENTS.md\` - Assistant instructions, persona, and durable preferences
- \`opencode.json\` - OpenCode configuration for this workspace
- \`.opencode/skills/\` - Assistant-scoped reusable workflows
## Constraints
@@ -75,49 +56,13 @@ The agent MAY self-edit the following files within this workspace:
- Self-edits should be concise and auditable
- Preserve user-customized content when modifying files
- Always ask for confirmation before making significant changes
- Validate JSON before saving \`opencode.json\`
- Reload or restart OpenCode after configuration or skill changes when needed
## Guidelines
1. Keep instructions clear and actionable
2. Update AGENTS.md when learning durable preferences
3. Prefer small configuration changes over broad rewrites
4. Maintain version control awareness
5. Document significant changes in commit messages
`
}
export function buildAssistantUpdateConfigurationSkill(): string {
return `---
name: update-configuration
description: Safely update Assistant workspace instructions, OpenCode config, and skills, then reload OpenCode configuration when needed.
---
# Update Configuration
Use this skill when the user wants to change how the Assistant workspace behaves, including edits to \`AGENTS.md\`, \`opencode.json\`, or Assistant-scoped skills.
## Workflow
1. Inspect the current Assistant workspace files before editing.
2. Identify the smallest configuration change that satisfies the request.
3. Preserve user-written instructions and existing settings unless the user asks to replace them.
4. Validate \`opencode.json\` as JSON after changes.
5. Reload or restart OpenCode configuration after changing \`opencode.json\` or skills.
6. Tell the user what changed and whether reload succeeded.
## Files
- \`AGENTS.md\` stores durable Assistant instructions and preferences.
- \`opencode.json\` stores Assistant workspace OpenCode settings.
- \`.opencode/skills/<name>/SKILL.md\` stores Assistant-scoped reusable workflows.
## Rules
- Do not rewrite the whole configuration when a targeted edit is enough.
- Do not remove user customizations unless explicitly requested.
- Do not edit project repositories unless the user explicitly asks.
- If reload fails, report the error and leave the files in a valid state.
3. Maintain version control awareness
4. Document significant changes in commit messages
`
}
@@ -155,11 +100,9 @@ export async function ensureAssistantMode(
const agentsMdPath = path.join(assistantDir, ASSISTANT_AGENTS_MD_FILENAME)
const opencodeJsonPath = path.join(assistantDir, ASSISTANT_OPENCODE_CONFIG_FILENAME)
const updateConfigurationSkillPath = path.join(assistantDir, ASSISTANT_UPDATE_CONFIGURATION_SKILL_PATH)
const agentsMdExists = await fileExists(agentsMdPath)
const opencodeJsonExists = await fileExists(opencodeJsonPath)
const updateConfigurationSkillExists = await fileExists(updateConfigurationSkillPath)
const overwriteAgentsMd = options?.overwriteAgentsMd ?? false
const overwriteOpenCodeConfig = options?.overwriteOpenCodeConfig ?? false
@@ -176,10 +119,6 @@ export async function ensureAssistantMode(
await writeFileContent(opencodeJsonPath, JSON.stringify(config, null, 2))
}
if (!updateConfigurationSkillExists) {
await writeFileContent(updateConfigurationSkillPath, buildAssistantUpdateConfigurationSkill())
}
return {
repoId: repo.id,
directory: assistantDir,
@@ -195,11 +134,6 @@ export async function ensureAssistantMode(
exists: true,
created: !opencodeJsonExists || overwriteOpenCodeConfig || hasLegacyOpenCodeConfig,
},
updateConfigurationSkill: {
path: updateConfigurationSkillPath,
exists: true,
created: !updateConfigurationSkillExists,
},
},
}
}
@@ -219,11 +153,9 @@ export async function getAssistantModeStatus(repo: Repo): Promise<AssistantModeS
const agentsMdPath = path.join(assistantDir, ASSISTANT_AGENTS_MD_FILENAME)
const opencodeJsonPath = path.join(assistantDir, ASSISTANT_OPENCODE_CONFIG_FILENAME)
const updateConfigurationSkillPath = path.join(assistantDir, ASSISTANT_UPDATE_CONFIGURATION_SKILL_PATH)
const agentsMdExists = await fileExists(agentsMdPath)
const opencodeJsonExists = await fileExists(opencodeJsonPath)
const updateConfigurationSkillExists = await fileExists(updateConfigurationSkillPath)
return {
repoId: repo.id,
@@ -240,11 +172,6 @@ export async function getAssistantModeStatus(repo: Repo): Promise<AssistantModeS
exists: opencodeJsonExists,
created: false,
},
updateConfigurationSkill: {
path: updateConfigurationSkillPath,
exists: updateConfigurationSkillExists,
created: false,
},
},
}
}