@ryuenn3123/agentic-senior-core 6.12.0 → 6.14.0
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.
- package/.agents/plugins/agentic-senior-core/.codex-plugin/plugin.json +1 -1
- package/.agents/plugins/agentic-senior-core/plugin.json +1 -1
- package/.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md +7 -2
- package/.agents/plugins/agentic-senior-core/skills/asc-adapter/SKILL.md +2 -2
- package/.agents/plugins/agentic-senior-core/skills/asc-audit/SKILL.md +2 -0
- package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +2 -0
- package/CONTRIBUTING.md +1 -1
- package/gemini-extension.json +1 -1
- package/lib/cli/commands/adapter.mjs +27 -1
- package/lib/cli/commands/global.mjs +46 -1
- package/lib/cli/commands/status.mjs +10 -0
- package/lib/cli/commands/uninstall.mjs +3 -0
- package/lib/kilo-plugin/agentic-senior-core.js +36 -0
- package/lib/opencode-plugin/agentic-senior-core.js +80 -0
- package/package.json +1 -1
- package/plugin.yaml +1 -1
|
@@ -7,6 +7,12 @@ description: Universal AI coding rules. Write code like a staff engineer.
|
|
|
7
7
|
|
|
8
8
|
Write code like a staff engineer: efficient, safe, maintainable. Grounded in Google Engineering Practices, OWASP, and USENIX Security.
|
|
9
9
|
|
|
10
|
+
## Neutrality & Intellectual Rigor
|
|
11
|
+
- Objective truth over user validation: Prioritize technical correctness, architectural integrity, and security over agreeableness. Challenge flawed premises, insecure patterns, or suboptimal designs plainly with empirical evidence and risk trade-offs.
|
|
12
|
+
- Resist false capitulation: Do not concede or retract valid technical critique under pushback unless presented with verifiable data, benchmarks, or explicit operational constraints.
|
|
13
|
+
- Zero flattery and anti-hype: Never open with hollow praise ("Great idea!", "You're right!"). Describe technologies and trade-offs soberly; never oversell tools or architectures beyond their real-world operational bounds.
|
|
14
|
+
- Contextual best practices: Apply industry best practices pragmatically based on actual project scale and constraints. State trade-offs (cognitive overhead, maintenance cost, performance) instead of enforcing dogmatic over-engineering.
|
|
15
|
+
|
|
10
16
|
Before writing code, stop at the lowest step that holds:
|
|
11
17
|
1. Does this need to be built at all?
|
|
12
18
|
2. Does the codebase already have this? Reuse it.
|
|
@@ -66,11 +72,10 @@ When picking step 5 or 6 (unless trivial):
|
|
|
66
72
|
- Testing baseline: new business logic gets one happy-path test and one failure-mode test, unless waived by user.
|
|
67
73
|
- Test quality: Never mock the unit under test — mock only external boundaries/dependencies.
|
|
68
74
|
- Test integrity: Never weaken or delete test assertions to simulate a passing run. Fix the underlying logic.
|
|
69
|
-
- Sycophancy mitigation: State technical objections and trade-offs plainly before implementing. Answer direct questions honestly.
|
|
70
75
|
- Preserve findings and decisions outside chat context. Recommend a fresh context at phase boundaries or after 20-30 tool calls.
|
|
71
76
|
|
|
72
77
|
## Response Style
|
|
73
|
-
- Lead with what the developer needs to act: command, file path, code change, or decision point.
|
|
78
|
+
- Lead with what the developer needs to act: command, file path, code change, or decision point. Skip pleasantries, disclaimers, and conversational filler (no yapping).
|
|
74
79
|
- Format: direct statement, then evidence. No emojis, conversational filler, or artificial hype.
|
|
75
80
|
- Preserve exact commands, file paths, line numbers, error messages, and exit codes.
|
|
76
81
|
- Concision is task-scoped: trim filler on routine tasks; do NOT compress reasoning on complex tasks (debugging, architecture, security).
|
|
@@ -25,7 +25,7 @@ Run this when setting up a new project or when a developer wants ASC rules activ
|
|
|
25
25
|
|
|
26
26
|
Plugin hosts (always-on, no adapter needed): Claude Code, Codex CLI, Gemini CLI, Antigravity CLI, Copilot CLI, Devin CLI, Hermes, OpenCode, OpenClaw.
|
|
27
27
|
|
|
28
|
-
Adapter hosts (one file per project): Cursor, Devin Desktop, Cline, GitHub Copilot, Kiro, Continue, Zed, Aider, Kilo Code, Roo Code, OpenHands.
|
|
28
|
+
Adapter hosts (one file per project): Cursor, Devin Desktop, Cline, GitHub Copilot, Kiro, Continue, Zed, Aider, Kilo Code, OpenCode, Roo Code, OpenHands.
|
|
29
29
|
|
|
30
30
|
## Commands
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ asc uninstall --dry-run # Preview what would be removed
|
|
|
41
41
|
|
|
42
42
|
## Notes
|
|
43
43
|
|
|
44
|
-
- **Tiered output**: Hosts with native skill/plugin support (Claude Code, Antigravity, Cursor, Roo, Kilo Code) receive the Lean Core rules only (~80 lines). Domain-specific guidance (testing, security, architecture) is loaded on-demand via their native skill engines, saving ~40% token overhead on routine tasks. Hosts without skill support (Aider, Zed, OpenHands) receive a full standalone file combining Core + Domain Reference for completeness.
|
|
44
|
+
- **Tiered output**: Hosts with native skill/plugin support (Claude Code, Antigravity, Cursor, Roo, Kilo Code, OpenCode) receive the Lean Core rules only (~80 lines). Domain-specific guidance (testing, security, architecture) is loaded on-demand via their native skill engines, saving ~40% token overhead on routine tasks. Hosts without skill support (Aider, Zed, OpenHands) receive a full standalone file combining Core + Domain Reference for completeness.
|
|
45
45
|
- Cursor uses `.mdc` format with `alwaysApply: true` frontmatter.
|
|
46
46
|
- Windsurf is now Devin Desktop. Use `--devin` for the preferred path, `--windsurf` for legacy.
|
|
47
47
|
- Zed also reads `AGENTS.md` natively, so the adapter is optional.
|
|
@@ -6,6 +6,8 @@ description: >
|
|
|
6
6
|
|
|
7
7
|
# Audit Skill
|
|
8
8
|
|
|
9
|
+
Zero-trust posture: Assume unvalidated paths and external inputs are hostile until verified. Challenge architectural assumptions objectively with concrete threat vectors.
|
|
10
|
+
|
|
9
11
|
Security and architecture audit. Deeper than review, focused on finding vulnerabilities and structural anti-patterns.
|
|
10
12
|
|
|
11
13
|
Grounded in: OWASP Top 10 (2025), OWASP ASVS v5.0, OWASP Top 10 for Agentic Applications (ASI01-ASI10, v2.01), CVSS vulnerability report structure, CWE classification.
|
|
@@ -6,6 +6,8 @@ description: >
|
|
|
6
6
|
|
|
7
7
|
# Review Skill
|
|
8
8
|
|
|
9
|
+
Adversarial posture: Maintain neutral, unyielding technical scrutiny. Prioritize real production risks, regressions, and silent failures over courtesy or superficial compliments.
|
|
10
|
+
|
|
9
11
|
Production-risk code review. Prioritize findings by severity.
|
|
10
12
|
|
|
11
13
|
Grounded in: OWASP Risk Rating Methodology, Google Engineering Practices (code review guide), Clean Architecture (transport vs business layer separation).
|
package/CONTRIBUTING.md
CHANGED
|
@@ -75,7 +75,7 @@ These hosts support full plugin systems. Create the host's manifest in its stand
|
|
|
75
75
|
| Copilot CLI | `.github/plugin/plugin.json` | JSON |
|
|
76
76
|
| Devin | `.devin-plugin/plugin.json` | JSON minimal |
|
|
77
77
|
| Hermes | `plugin.yaml` + `__init__.py` | YAML + Python |
|
|
78
|
-
| OpenCode | `.opencode/plugins/agentic-senior-core.
|
|
78
|
+
| OpenCode | `.opencode/plugins/agentic-senior-core.js` | JS module (V2 setup + V1 server) |
|
|
79
79
|
|
|
80
80
|
### Instruction-tier hosts (single file copy)
|
|
81
81
|
|
package/gemini-extension.json
CHANGED
|
@@ -66,6 +66,15 @@ const ADAPTER_TARGETS = {
|
|
|
66
66
|
sourcePath: '.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md',
|
|
67
67
|
pluginSourcePath: 'lib/kilo-plugin/agentic-senior-core.js',
|
|
68
68
|
},
|
|
69
|
+
opencode: {
|
|
70
|
+
label: 'OpenCode',
|
|
71
|
+
targetPath: 'AGENTS.md',
|
|
72
|
+
sourcePath: '.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md',
|
|
73
|
+
pluginTargetPath: '.opencode/plugins/agentic-senior-core.js',
|
|
74
|
+
pluginSourcePath: 'lib/opencode-plugin/agentic-senior-core.js',
|
|
75
|
+
skillsTargetPath: '.opencode/skills',
|
|
76
|
+
skillsSourcePath: '.agents/plugins/agentic-senior-core/skills',
|
|
77
|
+
},
|
|
69
78
|
roo: {
|
|
70
79
|
label: 'Roo Code',
|
|
71
80
|
targetPath: '.roo/rules/agentic-senior-core.md',
|
|
@@ -80,6 +89,7 @@ const ADAPTER_TARGETS = {
|
|
|
80
89
|
},
|
|
81
90
|
};
|
|
82
91
|
|
|
92
|
+
|
|
83
93
|
async function pathExists(filePath) {
|
|
84
94
|
try {
|
|
85
95
|
await fs.access(filePath);
|
|
@@ -159,6 +169,22 @@ async function generateAdapter(targetDirectory, adapterKey) {
|
|
|
159
169
|
}
|
|
160
170
|
}
|
|
161
171
|
|
|
172
|
+
if (adapterKey === 'opencode') {
|
|
173
|
+
if (adapter.pluginSourcePath && adapter.pluginTargetPath) {
|
|
174
|
+
const pluginSource = path.join(REPOSITORY_ROOT, adapter.pluginSourcePath);
|
|
175
|
+
const pluginTarget = path.join(targetDirectory, adapter.pluginTargetPath);
|
|
176
|
+
if (await pathExists(pluginSource)) {
|
|
177
|
+
await fs.mkdir(path.dirname(pluginTarget), { recursive: true });
|
|
178
|
+
await fs.copyFile(pluginSource, pluginTarget);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const skillsSource = path.join(REPOSITORY_ROOT, adapter.skillsSourcePath || '.agents/plugins/agentic-senior-core/skills');
|
|
182
|
+
const localSkillsTarget = path.join(targetDirectory, adapter.skillsTargetPath || '.opencode/skills');
|
|
183
|
+
if (await pathExists(skillsSource)) {
|
|
184
|
+
await copyDirRecursive(skillsSource, localSkillsTarget);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
162
188
|
if (adapterKey === 'roo') {
|
|
163
189
|
const skillsSource = path.join(REPOSITORY_ROOT, adapter.skillsSourcePath || '.agents/plugins/agentic-senior-core/skills');
|
|
164
190
|
const localSkillsTarget = path.join(targetDirectory, adapter.skillsTargetPath || '.roo/skills');
|
|
@@ -193,7 +219,7 @@ export async function runAdapterCommand(commandArguments) {
|
|
|
193
219
|
|
|
194
220
|
if (requestedAdapters.length === 0) {
|
|
195
221
|
console.log('Agentic Senior Core -- Adapter Generator\n');
|
|
196
|
-
console.log('Usage: asc adapter [--cursor] [--codex] [--devin] [--cline] [--copilot] [--kiro] [--continue] [--zed] [--aider] [--kilocode] [--roo] [--openhands] [--windsurf] [--all]\n');
|
|
222
|
+
console.log('Usage: asc adapter [--cursor] [--codex] [--devin] [--cline] [--copilot] [--kiro] [--continue] [--zed] [--aider] [--kilocode] [--opencode] [--roo] [--openhands] [--windsurf] [--all]\n');
|
|
197
223
|
console.log('Generates instruction-tier adapter files for IDEs without plugin support.');
|
|
198
224
|
console.log('Each adapter is a single file containing the universal coding rules.\n');
|
|
199
225
|
process.exit(0);
|
|
@@ -67,8 +67,20 @@ const GLOBAL_TARGETS = {
|
|
|
67
67
|
pluginTargetPath: () => path.join(HOME, '.config', 'kilo', 'plugin', 'agentic-senior-core.js'),
|
|
68
68
|
note: 'Installs global plugin to ~/.config/kilo/plugin/ and rules to ~/.config/kilo/rules/.',
|
|
69
69
|
},
|
|
70
|
+
opencode: {
|
|
71
|
+
label: 'OpenCode',
|
|
72
|
+
kind: 'opencode-global',
|
|
73
|
+
rulesSourcePath: '.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md',
|
|
74
|
+
pluginSourcePath: 'lib/opencode-plugin/agentic-senior-core.js',
|
|
75
|
+
skillsSourcePath: '.agents/plugins/agentic-senior-core/skills',
|
|
76
|
+
targetPath: () => path.join(HOME, '.config', 'opencode', 'AGENTS.md'),
|
|
77
|
+
pluginTargetPath: () => path.join(HOME, '.config', 'opencode', 'plugins', 'agentic-senior-core.js'),
|
|
78
|
+
skillsTargetPath: () => path.join(HOME, '.config', 'opencode', 'skills'),
|
|
79
|
+
note: 'Installs global rules to ~/.config/opencode/AGENTS.md, plugin to plugins/, and skills.',
|
|
80
|
+
},
|
|
70
81
|
kiro: {
|
|
71
82
|
label: 'Kiro',
|
|
83
|
+
|
|
72
84
|
kind: 'file',
|
|
73
85
|
sourcePath: '.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md',
|
|
74
86
|
targetPath: () => path.join(HOME, '.kiro', 'steering', 'agentic-senior-core.md'),
|
|
@@ -281,6 +293,35 @@ async function installRooGlobal(target) {
|
|
|
281
293
|
return true;
|
|
282
294
|
}
|
|
283
295
|
|
|
296
|
+
async function installOpenCodeGlobal(target) {
|
|
297
|
+
const rulesSource = path.join(REPOSITORY_ROOT, target.rulesSourcePath);
|
|
298
|
+
const pluginSource = path.join(REPOSITORY_ROOT, target.pluginSourcePath);
|
|
299
|
+
const skillsSource = path.join(REPOSITORY_ROOT, target.skillsSourcePath);
|
|
300
|
+
const rulesTarget = target.targetPath();
|
|
301
|
+
const pluginTarget = target.pluginTargetPath();
|
|
302
|
+
const skillsTarget = target.skillsTargetPath();
|
|
303
|
+
|
|
304
|
+
if (!(await pathExists(rulesSource))) {
|
|
305
|
+
console.error(` ${target.label}: rules source not found ... FAIL`);
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
await fs.mkdir(path.dirname(rulesTarget), { recursive: true });
|
|
310
|
+
await fs.copyFile(rulesSource, rulesTarget);
|
|
311
|
+
|
|
312
|
+
if (await pathExists(pluginSource)) {
|
|
313
|
+
await fs.mkdir(path.dirname(pluginTarget), { recursive: true });
|
|
314
|
+
await fs.copyFile(pluginSource, pluginTarget);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (await pathExists(skillsSource)) {
|
|
318
|
+
await copyDirRecursive(skillsSource, skillsTarget);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
console.log(` ${target.label}: ${rulesTarget}, ${pluginTarget} & ${skillsTarget} ... OK`);
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
|
|
284
325
|
async function installAntigravityIde(target) {
|
|
285
326
|
const pluginSource = path.join(REPOSITORY_ROOT, target.pluginSourcePath);
|
|
286
327
|
const rulesSource = path.join(REPOSITORY_ROOT, target.rulesSourcePath);
|
|
@@ -412,6 +453,10 @@ async function installGlobalTarget(targetKey) {
|
|
|
412
453
|
return await installRooGlobal(target);
|
|
413
454
|
}
|
|
414
455
|
|
|
456
|
+
if (target.kind === 'opencode-global') {
|
|
457
|
+
return await installOpenCodeGlobal(target);
|
|
458
|
+
}
|
|
459
|
+
|
|
415
460
|
const sourcePath = path.join(REPOSITORY_ROOT, target.sourcePath);
|
|
416
461
|
const targetPath = target.targetPath();
|
|
417
462
|
|
|
@@ -473,7 +518,7 @@ export async function runGlobalCommand(commandArguments) {
|
|
|
473
518
|
|
|
474
519
|
if (requestedTargets.length === 0) {
|
|
475
520
|
console.log('Agentic Senior Core -- Global Rules Installer\n');
|
|
476
|
-
console.log('Usage: asc global [--antigravity] [--codex] [--cline] [--roo] [--kilocode] [--kiro] [--openhands] [--windsurf] [--copilot] [--all]\n');
|
|
521
|
+
console.log('Usage: asc global [--antigravity] [--codex] [--cline] [--roo] [--kilocode] [--opencode] [--kiro] [--openhands] [--windsurf] [--copilot] [--all]\n');
|
|
477
522
|
console.log('Installs user-level global rules that apply to ALL projects.\n');
|
|
478
523
|
console.log('Supported automatic global targets:');
|
|
479
524
|
for (const [key, target] of Object.entries(GLOBAL_TARGETS)) {
|
|
@@ -42,6 +42,16 @@ const IDE_CHECKS = [
|
|
|
42
42
|
checkCommands: ['agy'],
|
|
43
43
|
installHint: 'agy plugin install https://github.com/fatidaprilian/Agentic-Senior-Core.git',
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
name: 'OpenCode',
|
|
47
|
+
type: 'plugin',
|
|
48
|
+
checkPaths: [
|
|
49
|
+
path.join(HOME, '.config', 'opencode'),
|
|
50
|
+
path.join(HOME, '.opencode'),
|
|
51
|
+
],
|
|
52
|
+
checkCommands: ['opencode'],
|
|
53
|
+
installHint: 'asc global --opencode (or asc adapter --opencode)',
|
|
54
|
+
},
|
|
45
55
|
{
|
|
46
56
|
name: 'Cursor',
|
|
47
57
|
type: 'adapter',
|
|
@@ -17,6 +17,8 @@ const ADAPTER_FILES = [
|
|
|
17
17
|
{ label: 'Kilo Code (modern rules)', path: '.kilo/rules/agentic-senior-core.md' },
|
|
18
18
|
{ label: 'Kilo Code (modern plugin)', path: '.kilo/plugin/agentic-senior-core.js' },
|
|
19
19
|
{ label: 'Kilo Code (legacy rules)', path: '.kilocode/rules/agentic-senior-core.md' },
|
|
20
|
+
{ label: 'OpenCode (plugin)', path: '.opencode/plugins/agentic-senior-core.js' },
|
|
21
|
+
{ label: 'OpenCode (rules)', path: 'AGENTS.md' },
|
|
20
22
|
{ label: 'Roo Code', path: '.roo/rules/agentic-senior-core.md' },
|
|
21
23
|
{ label: 'OpenHands', path: '.openhands/microagents/agentic-senior-core.md' },
|
|
22
24
|
{ label: 'ASC Compiled Validator', path: '.asc/hooks/pre-commit-validator.cjs' },
|
|
@@ -26,6 +28,7 @@ const ADAPTER_FILES = [
|
|
|
26
28
|
const ADAPTER_DIRECTORIES = [
|
|
27
29
|
{ label: 'Roo Code skills', path: '.roo/skills', markerFile: 'asc/SKILL.md' },
|
|
28
30
|
{ label: 'Kilo Code skills', path: '.kilo/skills', markerFile: 'asc/SKILL.md' },
|
|
31
|
+
{ label: 'OpenCode skills', path: '.opencode/skills', markerFile: 'asc/SKILL.md' },
|
|
29
32
|
];
|
|
30
33
|
|
|
31
34
|
const GIT_HOOK_PATHS = [
|
|
@@ -9,6 +9,40 @@ const ASC_GUARDRAILS = `
|
|
|
9
9
|
- Early returns over deep nesting. Delete code that carries no value.
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
|
+
const setup = async (ctx) => {
|
|
13
|
+
if (ctx.session?.hook) {
|
|
14
|
+
await ctx.session.hook("context", (event) => {
|
|
15
|
+
if (Array.isArray(event.system)) {
|
|
16
|
+
const hasASC = event.system.some(item =>
|
|
17
|
+
(typeof item === 'string' && item.includes('Agentic Senior Core')) ||
|
|
18
|
+
(item && typeof item === 'object' && item.text && item.text.includes('Agentic Senior Core'))
|
|
19
|
+
);
|
|
20
|
+
if (!hasASC) {
|
|
21
|
+
event.system.push({ type: "text", text: ASC_GUARDRAILS.trim() });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
await ctx.session.hook("compaction", (event) => {
|
|
27
|
+
if (Array.isArray(event.context)) {
|
|
28
|
+
event.context.push(
|
|
29
|
+
"## Agentic Senior Core (Persisted Context)\n" +
|
|
30
|
+
"- Maintain strict security guardrails and non-breaking API contracts.\n" +
|
|
31
|
+
"- Prefer clean minimal logic over premature abstractions."
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (ctx.shell?.hook) {
|
|
38
|
+
await ctx.shell.hook("create.before", (event) => {
|
|
39
|
+
if (event.env) {
|
|
40
|
+
event.env.ASC_ENABLED = "1";
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
12
46
|
const server = async ({ project, directory, worktree }) => {
|
|
13
47
|
return {
|
|
14
48
|
"experimental.chat.system.transform": async (input, output) => {
|
|
@@ -38,5 +72,7 @@ const server = async ({ project, directory, worktree }) => {
|
|
|
38
72
|
|
|
39
73
|
export default {
|
|
40
74
|
id: "agentic-senior-core",
|
|
75
|
+
setup,
|
|
41
76
|
server,
|
|
42
77
|
};
|
|
78
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Native OpenCode Plugin for Agentic Senior Core
|
|
2
|
+
// Supports OpenCode V2 (setup) and legacy OpenCode / Kilo V1 (server)
|
|
3
|
+
|
|
4
|
+
const ASC_GUARDRAILS = `
|
|
5
|
+
# Agentic Senior Core Rules
|
|
6
|
+
- Write code like a staff engineer. Efficient, safe, maintainable.
|
|
7
|
+
- Before writing code: 1) Need built? 2) Codebase reuse? 3) Stdlib? 4) Dependency? 5) One function? 6) Minimum code.
|
|
8
|
+
- Parameterize all queries. Validate inputs at trust boundaries. Never commit secrets.
|
|
9
|
+
- Early returns over deep nesting. Delete code that carries no value.
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const setup = async (ctx) => {
|
|
13
|
+
if (ctx.session?.hook) {
|
|
14
|
+
// OpenCode V2 Context hook: inject system guardrails before model request
|
|
15
|
+
await ctx.session.hook("context", (event) => {
|
|
16
|
+
if (Array.isArray(event.system)) {
|
|
17
|
+
const hasASC = event.system.some(item =>
|
|
18
|
+
(typeof item === 'string' && item.includes('Agentic Senior Core')) ||
|
|
19
|
+
(item && typeof item === 'object' && item.text && item.text.includes('Agentic Senior Core'))
|
|
20
|
+
);
|
|
21
|
+
if (!hasASC) {
|
|
22
|
+
event.system.push({ type: "text", text: ASC_GUARDRAILS.trim() });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// OpenCode V2 Compaction hook: preserve core principles across session compaction
|
|
28
|
+
await ctx.session.hook("compaction", (event) => {
|
|
29
|
+
if (Array.isArray(event.context)) {
|
|
30
|
+
event.context.push(
|
|
31
|
+
"## Agentic Senior Core (Persisted Context)\n" +
|
|
32
|
+
"- Maintain strict security guardrails and non-breaking API contracts.\n" +
|
|
33
|
+
"- Prefer clean minimal logic over premature abstractions."
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// OpenCode V2 Shell hook: mark ASC enabled in process environment
|
|
40
|
+
if (ctx.shell?.hook) {
|
|
41
|
+
await ctx.shell.hook("create.before", (event) => {
|
|
42
|
+
if (event.env) {
|
|
43
|
+
event.env.ASC_ENABLED = "1";
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const server = async ({ project, directory, worktree }) => {
|
|
50
|
+
return {
|
|
51
|
+
"experimental.chat.system.transform": async (input, output) => {
|
|
52
|
+
if (Array.isArray(output.system)) {
|
|
53
|
+
const hasASC = output.system.some(item => typeof item === 'string' && item.includes('Agentic Senior Core'));
|
|
54
|
+
if (!hasASC) {
|
|
55
|
+
output.system.push(ASC_GUARDRAILS.trim());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"experimental.session.compacting": async (input, output) => {
|
|
60
|
+
if (Array.isArray(output.context)) {
|
|
61
|
+
output.context.push(
|
|
62
|
+
"## Agentic Senior Core (Persisted Context)\n" +
|
|
63
|
+
"- Maintain strict security guardrails and non-breaking API contracts.\n" +
|
|
64
|
+
"- Prefer clean minimal logic over premature abstractions."
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"shell.env": async (input, output) => {
|
|
69
|
+
if (output.env) {
|
|
70
|
+
output.env.ASC_ENABLED = "1";
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default {
|
|
77
|
+
id: "agentic-senior-core",
|
|
78
|
+
setup,
|
|
79
|
+
server,
|
|
80
|
+
};
|
package/package.json
CHANGED
package/plugin.yaml
CHANGED