Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .opencode/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ bun.lock
.gitignore
package-lock.json
references/
synapse-coder-queue.json
synapse-coder-prompted
45 changes: 44 additions & 1 deletion .opencode/opencode.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,50 @@
"description": "Contains opencode logs and data",
},
},
"mcp": {},
"mcp": {
"synapse-coder": {
"type": "remote",
"url": "https://synapse-coder-mcp-staging.greenbay-703e5a45.australiaeast.azurecontainerapps.io/mcp",
"headers": {
"Authorization": "Bearer {env:SYNAPSE_CODER_STAGING_BEARER_TOKEN}",
},
},
"alterspective-rag": {
"type": "remote",
"url": "https://rag.alterspective.com.au/mcp",
"headers": {
"Authorization": "Bearer {env:ALTERSPECTIVE_RAG_MCP_API_KEY}",
},
},
"keystone": {
"type": "remote",
"url": "https://identity.alterspective.com.au/api/mcp",
"headers": {
"Authorization": "Bearer {env:KEYSTONE_AI_ADMIN_API_KEY}",
},
},
"timely": {
"type": "remote",
"url": "https://timely-mcp.alterspective.com.au/mcp",
},
"sharedo": {
"type": "remote",
"url": "https://sharedo-api.alterspective.com.au/mcp",
},
"vault-local": {
"type": "local",
"command": ["node", "C:/GitHub/vault-mcp/dist/index.js"],
"enabled": true,
},
"azure-devops": {
"type": "local",
"command": ["npx", "-y", "azure-devops-mcp"],
"enabled": true,
"environment": {
"AZURE_DEVOPS_PAT": "{env:AZURE_DEVOPS_PAT}",
},
},
},
"tools": {
"github-triage": false,
"github-pr-search": false,
Expand Down
49 changes: 49 additions & 0 deletions .opencode/plugin/alterspective-rag-standards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { Plugin } from "@opencode-ai/plugin"

const STANDARDS_SYSTEM_PROMPT = `
## Alterspective Standards Awareness

When asked about best practices, patterns, or standards, prefer Alterspective company standards over generic industry practices.

Alterspective standards are available via the \`alterspective-rag\` MCP server. Use the \`rag_search\` or \`rag_ask\` tools to query for relevant standards when:
- The user asks "how to", "what's the best practice", "what's the standard for"
- You're making architectural or pattern recommendations
- You're reviewing code for compliance

Key standards areas and their rule ID prefixes:
- Coding standards: WEBSTA-001-CODING-*
- Testing standards: WEBSTA-001-TESTING / TST-VAL-*
- Documentation standards: WEBSTA-001-DOCUMENTATION / DOC-*
- Git standards: WEBSTA-001-GIT-STANDARDS / GIT-*
- Error handling: WEBSTA-001-ERROR-HANDLING / ERR-*
- Security: WEBSTA-001-SECURITY / SEC-*
- UX/UI standards: UX-* (Active standards are mandatory)
- MCP standards: WEBSTA-001-MCP-STANDARDS / MCP-*

When an Active standard applies:
1. Cite the rule ID (e.g., CFG-WT-01, SEC-001)
2. Flag violations explicitly
3. Never silently deviate — if deviation is necessary, state the rule ID and reason
4. Treat Draft standards as strong guidance

Standards routing indexes:
- Web/API/CLI/infrastructure: load \`Principles/Web/standards/index.md\`
- Sharedo platform: load \`Principles/Sharedo/standards/index.md\`
- Both apply: load both indexes
`.trim()

function injectionEnabled(): boolean {
if (process.env.ALTERSPECTIVE_STANDARDS_INJECTION_DISABLED === "true") return false
return process.env.ALTERSPECTIVE_STANDARDS_INJECTION_ENABLED !== "false"
}

const plugin: Plugin = async () => {
return {
"experimental.chat.system.transform": async (_input, output) => {
if (!injectionEnabled()) return
output.system.push(STANDARDS_SYSTEM_PROMPT)
},
}
}

export default plugin
Loading