archgraph-argo 0.9.1 → 0.9.3

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.
@@ -28,5 +28,16 @@ argument-hint: "要发布的文章主题或源文档路径"
28
28
  node "d:\Projects\_tools\wechat-cli-src\obsidian-wechat-public-platform-master\dist\wechat-public-cli.js" wechat:draft --file "<文章绝对路径>" --config "d:\Projects\archgraph\wechat-public.config.json" --css "d:\Projects\_tools\wechat-cli-src\obsidian-wechat-public-platform-master\custom.css"
29
29
  ```
30
30
 
31
+ ## 文风要求(人味优先,去 AI 味)
32
+
33
+ 发布公众号文章前,必须按以下要求降低「AI 味」、增加「人味」,否则读者不会看:
34
+
35
+ - 禁止 AI 套话与八股:删掉「首先/其次/最后」「综上所述」「总而言之」「值得注意的是」「赋能」「抓手」「闭环」「底层逻辑」等空洞词,去掉「本文将从以下 N 个方面展开」式开场。
36
+ - 去掉机械排比与对仗堆砌;段落要短,句子长短交错,像人说话,不像机器列清单。
37
+ - 多点人味:加入真实场景、具体例子、第一人称视角、设问、适度的口语与幽默;用具体数字和细节代替抽象概括。
38
+ - 开门见山直给观点与结论,少绕弯子;结尾给出可行动的判断,而非泛泛展望。
39
+ - 标题与摘要(digest)同样要有人味,避免口号式、震惊体式标题。
40
+ - 每篇至少通读一遍,找出并改写任何读起来像机器生成的句子。
41
+
31
42
  ## 输出格式
32
43
  返回:文章路径、草稿 media_id(或确切失败原因)、状态(草稿已创建 / BLOCKED)。并提醒:API 发布不可用,需在公众号后台「草稿箱」手动发布。
@@ -0,0 +1,27 @@
1
+ // Argo wakeup gate plugin for opencode.
2
+ //
3
+ // Injects an unconditional "wakeup gate" as the FIRST system instruction of
4
+ // every session, so the agent identifies its Business Actor and restores its
5
+ // long-term memory before responding to anything (including greetings and
6
+ // casual questions). The rule also lives in argo/rules/archgraph.instructions.md,
7
+ // but that file is long and can be skimmed; this hook guarantees a short,
8
+ // high-salience gate sits at the top of the system prompt on session start.
9
+
10
+ const WAKEUP_GATE = [
11
+ "WAKEUP GATE (unconditional; applies to the very first message of every session, including greetings, casual chat, and questions; never skip or defer).",
12
+ "1. Your very FIRST tool call must be an ARGO MCP query listing all Business Actors (getSystemArchitecture, purpose \"audit\", subject \"Business Actor\") to identify which Business Actor you are.",
13
+ "2. Restore that Actor's long-term memory (the SUBVIEW hierarchy mounted under it) before responding.",
14
+ "3. If the ARGO MCP is unavailable or errors, say so explicitly first. Only after this gate may you respond or act.",
15
+ ].join("\n");
16
+
17
+ export default async function argoWakeupPlugin() {
18
+ return {
19
+ "experimental.chat.system.transform": async (_input, output) => {
20
+ const system = Array.isArray(output.system) ? output.system : [];
21
+ if (system.some((entry) => entry.includes("WAKEUP GATE"))) {
22
+ return;
23
+ }
24
+ output.system = [WAKEUP_GATE, ...system];
25
+ },
26
+ };
27
+ }
@@ -4,6 +4,14 @@ name: "ArchGraph ARGO Workflow Rules"
4
4
  applyTo: "**"
5
5
  ---
6
6
 
7
+ <WakeupGuideline>
8
+ STEP 0 — UNCONDITIONAL STARTUP GATE. This applies to the very first message of every session, including greetings, casual chat, and questions; it may never be skipped, deferred, or treated as optional.
9
+ 1. Your very FIRST tool call in the session MUST be an ARGO MCP query that lists all `Business Actor`s (getSystemArchitecture with purpose "audit" and subject "Business Actor"). Identify which `Business Actor` you are. If you are not sure, consult your human partner to confirm your role before doing anything else.
10
+ 2. Restore your long-term memory: the SUBVIEW hierarchy mounted under that `Business Actor` element — the Views whose `parent_element_id` points to this Actor, plus the elements, relationships, and further nested sub-views inside them (NOT the View that merely includes the Actor in its `included_elements`) — and load it into session memory.
11
+ 3. If the `agent` attribute of the confirmed Actor differs from your current Agent type, switch to that Agent type, or delegate to an Agent of that type per `<CoperationGuideline>` item 2.
12
+ 4. If the ARGO MCP is unavailable or errors, state that explicitly to the user before doing anything else. Only after completing this gate may you respond to the user or take any other action.
13
+ </WakeupGuideline>
14
+
7
15
  <CoreRules>
8
16
  The following are non-negotiable red lines (MUST) for this Agent and must never be skipped at any time; details are expanded in the corresponding `<...>` sections.
9
17
  1. Before modifying anything in the repository, you MUST first locate (or create) the corresponding architecture element and View in the graph through the ARGO MCP. See `<IntentArchitectureFirst>`.
@@ -20,11 +28,6 @@ Your cognitive architecture is composed of ArchiMate 3.2 elements and their exte
20
28
  2. For the definitions of element or relationship types, see: ~/.argo/schema/archimate3.2.md
21
29
  </Ontology>
22
30
 
23
- <WakeupGuideline>
24
- 1. When you are started, first identify which `Business Actor` you are, then find your long-term memory — the SUBVIEW hierarchy mounted under that `Business Actor` element (the Views whose `parent_element_id` points to this Actor, plus the elements, relationships, and further nested sub-views inside them; NOT the View that merely includes the Actor in its `included_elements`) — and restore it into your session memory.
25
- 2. If you are not sure, query all existing `Business Actor`s, then consult your human partner to confirm your role. If the Agent type (the `agent` attribute) corresponding to the confirmed role differs from the current Agent type, switch to that Agent type, or delegate to an Agent of that type per `<CoperationGuideline>` item 2.
26
- </WakeupGuideline>
27
-
28
31
  <ExplorationGuideline>
29
32
  1. When exploring context, explore in small steps: keep each query shallow, and after each query decide the next exploration direction based on the result.
30
33
  2. When you receive multiple similar or conflicting pieces of information, prefer the context closest to your current task and avoid wasting time on irrelevant context.
package/install-argo.ps1 CHANGED
@@ -10,7 +10,9 @@ param(
10
10
  [string]$OpenCodeConfigPath = "$env:USERPROFILE\.config\opencode\opencode.json",
11
11
  [string]$CopilotAgentsRoot = "$env:USERPROFILE\.copilot\agents",
12
12
  [string]$CursorAgentsRoot = "$env:USERPROFILE\.cursor\agents",
13
+ [string]$CursorRulesRoot = "$env:USERPROFILE\.cursor\rules",
13
14
  [string]$OpenCodeAgentsRoot = "$env:USERPROFILE\.config\opencode\agents",
15
+ [string]$PluginsRoot = "$env:USERPROFILE\.argo\plugins",
14
16
  [switch]$SkipEnv,
15
17
  [switch]$SkipDeps,
16
18
  [switch]$SkipMcp,
@@ -93,6 +95,34 @@ function Convert-AgentFile {
93
95
  [System.IO.File]::WriteAllText($DestinationFile, $result, (New-Object System.Text.UTF8Encoding $false))
94
96
  }
95
97
 
98
+ function Convert-RuleFile {
99
+ param(
100
+ [string]$SourceFile,
101
+ [string]$DestinationFile
102
+ )
103
+ $content = Get-Content $SourceFile -Raw -Encoding UTF8
104
+ $m = [regex]::Match($content, '(?s)^---\s*\r?\n(.*?)\r?\n---\s*\r?\n(.*)$')
105
+ if (-not $m.Success) {
106
+ Copy-Item -Force -Path $SourceFile -Destination $DestinationFile
107
+ return
108
+ }
109
+ $front = $m.Groups[1].Value
110
+ $body = $m.Groups[2].Value
111
+
112
+ $desc = ''
113
+ $dm = [regex]::Match($front, '(?m)^description:\s*(.*)$')
114
+ if ($dm.Success) { $desc = $dm.Groups[1].Value.Trim().Trim('"').Trim("'") }
115
+
116
+ # Cursor .mdc rule: description + alwaysApply so it is injected into every
117
+ # request. The rule body (WakeupGuideline + CoreRules + ...) is kept verbatim.
118
+ $newFront = "---`r`n"
119
+ if ($desc) { $newFront += "description: `"$($desc -replace '"','\"')`"`r`n" }
120
+ $newFront += "alwaysApply: true`r`n---`r`n"
121
+
122
+ $result = $newFront + "`r`n" + $body
123
+ [System.IO.File]::WriteAllText($DestinationFile, $result, (New-Object System.Text.UTF8Encoding $false))
124
+ }
125
+
96
126
  function Write-McpConfig {
97
127
  param(
98
128
  [string]$Path,
@@ -129,6 +159,39 @@ function Write-McpConfig {
129
159
  [System.IO.File]::WriteAllText($Path, $json, (New-Object System.Text.UTF8Encoding $false))
130
160
  }
131
161
 
162
+ function Register-OpenCodePlugin {
163
+ param(
164
+ [string]$ConfigPath,
165
+ [string]$PluginFilePath
166
+ )
167
+
168
+ $root = [ordered]@{}
169
+ if (Test-Path $ConfigPath) {
170
+ try {
171
+ $existing = Get-Content $ConfigPath -Raw | ConvertFrom-Json
172
+ foreach ($p in $existing.PSObject.Properties) {
173
+ $root[$p.Name] = $p.Value
174
+ }
175
+ } catch {
176
+ # Ignore an unparseable existing file and start fresh.
177
+ }
178
+ }
179
+
180
+ $url = 'file:///' + (($PluginFilePath -replace '\\', '/').TrimStart('/'))
181
+ $plugins = @()
182
+ if ($root.Contains('plugin') -and $null -ne $root['plugin']) {
183
+ $plugins = @($root['plugin'])
184
+ }
185
+ if ($plugins -notcontains $url) {
186
+ $plugins += $url
187
+ }
188
+ $root['plugin'] = $plugins
189
+
190
+ New-Item -ItemType Directory -Force -Path (Split-Path $ConfigPath) | Out-Null
191
+ $json = $root | ConvertTo-Json -Depth 10
192
+ [System.IO.File]::WriteAllText($ConfigPath, $json, (New-Object System.Text.UTF8Encoding $false))
193
+ }
194
+
132
195
  function Add-AgentsRule {
133
196
  param(
134
197
  [string]$AgentsPath,
@@ -176,56 +239,66 @@ Write-Host '==> Deploying Argo toolchain'
176
239
 
177
240
  $schemaSrc = Join-Path $argoDir 'schema'
178
241
  $schemaDest = Join-Path $ArgoRoot 'schema'
179
- Write-Host "[1/12] argo\schema -> $schemaDest"
242
+ Write-Host "[1/14] argo\schema -> $schemaDest"
180
243
  Copy-Tree -Source $schemaSrc -Destination $schemaDest
181
244
 
182
245
  $scriptsSrc = Join-Path $argoDir 'scripts'
183
246
  $scriptsDest = Join-Path $ArgoRoot 'scripts'
184
- Write-Host "[2/12] argo\scripts -> $scriptsDest"
247
+ Write-Host "[2/14] argo\scripts -> $scriptsDest"
185
248
  Copy-Tree -Source $scriptsSrc -Destination $scriptsDest
186
249
 
187
250
  $defaultsSrc = Join-Path $argoDir 'defaults'
188
251
  $defaultsDest = Join-Path $ArgoRoot 'defaults'
189
- Write-Host "[3/12] argo\defaults -> $defaultsDest"
252
+ Write-Host "[3/14] argo\defaults -> $defaultsDest"
190
253
  Copy-Tree -Source $defaultsSrc -Destination $defaultsDest
191
254
 
192
255
  $skillSrc = Join-Path (Join-Path $argoDir 'skills') 'argo-init'
193
256
  $skillDest = Join-Path $SkillsRoot 'argo-init'
194
- Write-Host "[4/12] argo\skills\argo-init -> $skillDest"
257
+ Write-Host "[4/14] argo\skills\argo-init -> $skillDest"
195
258
  Copy-Tree -Source $skillSrc -Destination $skillDest
196
259
 
197
260
  $ruleSrc = Join-Path (Join-Path $argoDir 'rules') 'archgraph.instructions.md'
198
261
  $ruleDest = Join-Path $PromptsRoot 'archgraph.instructions.md'
199
- Write-Host "[5/12] argo\rules\archgraph.instructions.md -> $ruleDest"
262
+ Write-Host "[5/14] argo\rules\archgraph.instructions.md -> $ruleDest"
200
263
  New-Item -ItemType Directory -Force -Path $PromptsRoot | Out-Null
201
264
  Copy-Item -Force -Path $ruleSrc -Destination $ruleDest
202
265
 
203
266
  $depsSrc = Join-Path $argoDir 'package.json'
204
267
  $depsDest = Join-Path $ArgoRoot 'package.json'
205
- Write-Host "[6/12] argo\package.json -> $depsDest"
268
+ Write-Host "[6/14] argo\package.json -> $depsDest"
206
269
  Copy-Item -Force -Path $depsSrc -Destination $depsDest
207
270
 
208
271
  $cursorSkillDest = Join-Path $CursorSkillsRoot 'argo-init'
209
- Write-Host "[7/12] argo\skills\argo-init -> $cursorSkillDest (Cursor)"
272
+ Write-Host "[7/14] argo\skills\argo-init -> $cursorSkillDest (Cursor)"
210
273
  Copy-Tree -Source $skillSrc -Destination $cursorSkillDest
211
274
 
212
275
  $openCodeSkillDest = Join-Path $OpenCodeSkillsRoot 'argo-init'
213
- Write-Host "[8/12] argo\skills\argo-init -> $openCodeSkillDest (OpenCode)"
276
+ Write-Host "[8/14] argo\skills\argo-init -> $openCodeSkillDest (OpenCode)"
214
277
  Copy-Tree -Source $skillSrc -Destination $openCodeSkillDest
215
278
 
216
- Write-Host "[9/12] argo\rules\archgraph.instructions.md -> $OpenCodeAgentsPath (OpenCode global AGENTS.md)"
279
+ Write-Host "[9/14] argo\rules\archgraph.instructions.md -> $OpenCodeAgentsPath (OpenCode global AGENTS.md)"
217
280
  Add-AgentsRule -AgentsPath $OpenCodeAgentsPath -RulePath $ruleSrc
218
281
 
219
282
  $agentsSrc = Join-Path $argoDir 'agents'
220
- Write-Host "[10/12] argo\agents -> $CopilotAgentsRoot (Copilot user-level)"
283
+ Write-Host "[10/14] argo\agents -> $CopilotAgentsRoot (Copilot user-level)"
221
284
  Copy-Agents -Source $agentsSrc -Destination $CopilotAgentsRoot
222
285
 
223
- Write-Host "[11/12] argo\agents -> $CursorAgentsRoot (Cursor user-level, converted to .md)"
286
+ Write-Host "[11/14] argo\agents -> $CursorAgentsRoot (Cursor user-level, converted to .md)"
224
287
  Copy-Agents -Source $agentsSrc -Destination $CursorAgentsRoot -Target cursor
225
288
 
226
- Write-Host "[12/12] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level, converted to .md)"
289
+ Write-Host "[12/14] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level, converted to .md)"
227
290
  Copy-Agents -Source $agentsSrc -Destination $OpenCodeAgentsRoot -Target opencode
228
291
 
292
+ $pluginsSrc = Join-Path $argoDir 'plugins'
293
+ Write-Host "[13/14] argo\plugins -> $PluginsRoot (Argo opencode plugins)"
294
+ Copy-Tree -Source $pluginsSrc -Destination $PluginsRoot
295
+
296
+ $cursorRuleSrc = Join-Path (Join-Path $argoDir 'rules') 'archgraph.instructions.md'
297
+ $cursorRuleDest = Join-Path $CursorRulesRoot 'archgraph.mdc'
298
+ Write-Host "[14/14] argo\rules\archgraph.instructions.md -> $cursorRuleDest (Cursor global rule, alwaysApply)"
299
+ New-Item -ItemType Directory -Force -Path $CursorRulesRoot | Out-Null
300
+ Convert-RuleFile -SourceFile $cursorRuleSrc -DestinationFile $cursorRuleDest
301
+
229
302
  if ($SkipDeps) {
230
303
  Write-Host 'Skipped dependency install (-SkipDeps).'
231
304
  } elseif (Get-Command npm -ErrorAction SilentlyContinue) {
@@ -347,5 +420,12 @@ if ($SkipMcp) {
347
420
  Write-Host "argo MCP config written -> $OpenCodeConfigPath"
348
421
  }
349
422
 
423
+ $wakeupPluginPath = Join-Path $PluginsRoot 'argo-wakeup.js'
424
+ if (Test-Path $wakeupPluginPath) {
425
+ Write-Host '==> Registering argo-wakeup plugin in OpenCode'
426
+ Register-OpenCodePlugin -ConfigPath $OpenCodeConfigPath -PluginFilePath $wakeupPluginPath
427
+ Write-Host "argo-wakeup plugin registered -> $OpenCodeConfigPath"
428
+ }
429
+
350
430
  Write-Host ''
351
431
  Write-Host 'Argo deployment complete.'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  "argo/schema",
12
12
  "argo/defaults",
13
13
  "argo/agents",
14
+ "argo/plugins",
14
15
  "argo/skills/argo-init",
15
16
  "argo/rules",
16
17
  "argo/package.json",