@coralai/sps-cli 0.57.15 → 0.58.1

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 (143) hide show
  1. package/README-CN.md +123 -2
  2. package/README.md +123 -2
  3. package/dist/commands/codexProxyCommand.d.ts +2 -0
  4. package/dist/commands/codexProxyCommand.d.ts.map +1 -0
  5. package/dist/commands/codexProxyCommand.js +81 -0
  6. package/dist/commands/codexProxyCommand.js.map +1 -0
  7. package/dist/commands/graphCommand.d.ts +2 -0
  8. package/dist/commands/graphCommand.d.ts.map +1 -0
  9. package/dist/commands/graphCommand.js +97 -0
  10. package/dist/commands/graphCommand.js.map +1 -0
  11. package/dist/commands/imCommand.d.ts +2 -0
  12. package/dist/commands/imCommand.d.ts.map +1 -0
  13. package/dist/commands/imCommand.js +34 -0
  14. package/dist/commands/imCommand.js.map +1 -0
  15. package/dist/commands/pipelineTick.d.ts.map +1 -1
  16. package/dist/commands/pipelineTick.js +9 -0
  17. package/dist/commands/pipelineTick.js.map +1 -1
  18. package/dist/commands/setup.d.ts.map +1 -1
  19. package/dist/commands/setup.js +3 -0
  20. package/dist/commands/setup.js.map +1 -1
  21. package/dist/commands/tick.d.ts.map +1 -1
  22. package/dist/commands/tick.js +10 -0
  23. package/dist/commands/tick.js.map +1 -1
  24. package/dist/console/index.d.ts.map +1 -1
  25. package/dist/console/index.js +25 -13
  26. package/dist/console/index.js.map +1 -1
  27. package/dist/console/routes/channels.d.ts +3 -0
  28. package/dist/console/routes/channels.d.ts.map +1 -0
  29. package/dist/console/routes/channels.js +43 -0
  30. package/dist/console/routes/channels.js.map +1 -0
  31. package/dist/console/routes/chat.d.ts.map +1 -1
  32. package/dist/console/routes/chat.js +49 -7
  33. package/dist/console/routes/chat.js.map +1 -1
  34. package/dist/console/routes/codexProxy.d.ts +11 -0
  35. package/dist/console/routes/codexProxy.d.ts.map +1 -0
  36. package/dist/console/routes/codexProxy.js +58 -0
  37. package/dist/console/routes/codexProxy.js.map +1 -0
  38. package/dist/console/routes/graph.d.ts +13 -0
  39. package/dist/console/routes/graph.d.ts.map +1 -0
  40. package/dist/console/routes/graph.js +65 -0
  41. package/dist/console/routes/graph.js.map +1 -0
  42. package/dist/console/routes/providers.d.ts.map +1 -1
  43. package/dist/console/routes/providers.js +6 -2
  44. package/dist/console/routes/providers.js.map +1 -1
  45. package/dist/console-assets/assets/index-CKM0zA_z.js +666 -0
  46. package/dist/console-assets/assets/index-DVnv2TaM.css +10 -0
  47. package/dist/console-assets/index.html +2 -2
  48. package/dist/core/agents/sidecar/CodexProxyManager.d.ts +74 -0
  49. package/dist/core/agents/sidecar/CodexProxyManager.d.ts.map +1 -0
  50. package/dist/core/agents/sidecar/CodexProxyManager.js +292 -0
  51. package/dist/core/agents/sidecar/CodexProxyManager.js.map +1 -0
  52. package/dist/core/agents/workerAnthropicEnv.d.ts +23 -0
  53. package/dist/core/agents/workerAnthropicEnv.d.ts.map +1 -0
  54. package/dist/core/agents/workerAnthropicEnv.js +22 -0
  55. package/dist/core/agents/workerAnthropicEnv.js.map +1 -0
  56. package/dist/core/claudeJsonl.d.ts +2 -0
  57. package/dist/core/claudeJsonl.d.ts.map +1 -1
  58. package/dist/core/claudeJsonl.js +29 -0
  59. package/dist/core/claudeJsonl.js.map +1 -1
  60. package/dist/core/codegraph/CodeGraphService.d.ts +45 -0
  61. package/dist/core/codegraph/CodeGraphService.d.ts.map +1 -0
  62. package/dist/core/codegraph/CodeGraphService.js +141 -0
  63. package/dist/core/codegraph/CodeGraphService.js.map +1 -0
  64. package/dist/engines/StageEngine.d.ts.map +1 -1
  65. package/dist/engines/StageEngine.js +14 -0
  66. package/dist/engines/StageEngine.js.map +1 -1
  67. package/dist/engines/smartarrange/runner.d.ts.map +1 -1
  68. package/dist/engines/smartarrange/runner.js +2 -0
  69. package/dist/engines/smartarrange/runner.js.map +1 -1
  70. package/dist/im/IMAdapter.d.ts +40 -0
  71. package/dist/im/IMAdapter.d.ts.map +1 -0
  72. package/dist/im/IMAdapter.js +2 -0
  73. package/dist/im/IMAdapter.js.map +1 -0
  74. package/dist/im/IMGatewayManager.d.ts +13 -0
  75. package/dist/im/IMGatewayManager.d.ts.map +1 -0
  76. package/dist/im/IMGatewayManager.js +90 -0
  77. package/dist/im/IMGatewayManager.js.map +1 -0
  78. package/dist/im/adapters/dingtalkAdapter.d.ts +46 -0
  79. package/dist/im/adapters/dingtalkAdapter.d.ts.map +1 -0
  80. package/dist/im/adapters/dingtalkAdapter.js +157 -0
  81. package/dist/im/adapters/dingtalkAdapter.js.map +1 -0
  82. package/dist/im/adapters/discordAdapter.d.ts +43 -0
  83. package/dist/im/adapters/discordAdapter.d.ts.map +1 -0
  84. package/dist/im/adapters/discordAdapter.js +170 -0
  85. package/dist/im/adapters/discordAdapter.js.map +1 -0
  86. package/dist/im/adapters/feishuAdapter.d.ts +44 -0
  87. package/dist/im/adapters/feishuAdapter.d.ts.map +1 -0
  88. package/dist/im/adapters/feishuAdapter.js +154 -0
  89. package/dist/im/adapters/feishuAdapter.js.map +1 -0
  90. package/dist/im/adapters/matrixAdapter.d.ts +42 -0
  91. package/dist/im/adapters/matrixAdapter.d.ts.map +1 -0
  92. package/dist/im/adapters/matrixAdapter.js +106 -0
  93. package/dist/im/adapters/matrixAdapter.js.map +1 -0
  94. package/dist/im/adapters/slackAdapter.d.ts +41 -0
  95. package/dist/im/adapters/slackAdapter.d.ts.map +1 -0
  96. package/dist/im/adapters/slackAdapter.js +129 -0
  97. package/dist/im/adapters/slackAdapter.js.map +1 -0
  98. package/dist/im/adapters/telegramAdapter.d.ts +43 -0
  99. package/dist/im/adapters/telegramAdapter.d.ts.map +1 -0
  100. package/dist/im/adapters/telegramAdapter.js +147 -0
  101. package/dist/im/adapters/telegramAdapter.js.map +1 -0
  102. package/dist/im/binding.d.ts +24 -0
  103. package/dist/im/binding.d.ts.map +1 -0
  104. package/dist/im/binding.js +57 -0
  105. package/dist/im/binding.js.map +1 -0
  106. package/dist/im/chatBridge.d.ts +39 -0
  107. package/dist/im/chatBridge.d.ts.map +1 -0
  108. package/dist/im/chatBridge.js +215 -0
  109. package/dist/im/chatBridge.js.map +1 -0
  110. package/dist/im/router.d.ts +29 -0
  111. package/dist/im/router.d.ts.map +1 -0
  112. package/dist/im/router.js +120 -0
  113. package/dist/im/router.js.map +1 -0
  114. package/dist/im/types.d.ts +71 -0
  115. package/dist/im/types.d.ts.map +1 -0
  116. package/dist/im/types.js +25 -0
  117. package/dist/im/types.js.map +1 -0
  118. package/dist/main.js +29 -1
  119. package/dist/main.js.map +1 -1
  120. package/dist/manager/makeBackendFactory.d.ts.map +1 -1
  121. package/dist/manager/makeBackendFactory.js +4 -1
  122. package/dist/manager/makeBackendFactory.js.map +1 -1
  123. package/dist/shared/runtimeSchemas.d.ts +0 -2
  124. package/dist/shared/runtimeSchemas.d.ts.map +1 -1
  125. package/dist/shared/runtimeSchemas.js +3 -1
  126. package/dist/shared/runtimeSchemas.js.map +1 -1
  127. package/package.json +4 -1
  128. package/project-template/.claude/CLAUDE.md +81 -0
  129. package/project-template/.claude/hooks/start.sh +44 -0
  130. package/project-template/.claude/hooks/stop.sh +54 -0
  131. package/project-template/.claude/rules/.gitkeep +0 -0
  132. package/project-template/.claude/settings.json +32 -0
  133. package/project-template/.claude/settings.local.json.template +3 -0
  134. package/project-template/.claude/skills/.gitkeep +0 -0
  135. package/project-template/README.md +10 -0
  136. package/project-template/batch_scheduler.sh +8 -0
  137. package/project-template/conf.template +61 -0
  138. package/project-template/deploy.sh +3 -0
  139. package/project-template/pm_meta/.gitkeep +0 -0
  140. package/skills/sps-memory/SKILL.md +51 -0
  141. package/skills/sps-pipeline/SKILL.md +476 -0
  142. package/dist/console-assets/assets/index-BAA5k08F.js +0 -641
  143. package/dist/console-assets/assets/index-nY53xZWk.css +0 -10
@@ -0,0 +1,81 @@
1
+ # Project Rules (Claude Code Worker)
2
+
3
+ <!--
4
+ This file is auto-generated by `sps project init` / `sps doctor --fix`.
5
+ Edit it to add project-specific rules. SPS will not overwrite it once it exists.
6
+ -->
7
+
8
+ ## Scope
9
+
10
+ - Work only in the current project directory.
11
+ - Do NOT read or modify files outside this directory.
12
+ - Do NOT explore `~/.coral/projects/...` or other system paths.
13
+
14
+ ## Reading code (token-efficient — prefer this)
15
+
16
+ This project may have a **code graph**. When it does, use it INSTEAD of reading
17
+ files one-by-one — one query returns the relevant symbols, their source, and
18
+ call paths, which is far cheaper in tokens than grepping and reading whole files.
19
+ Run these from the project root (your cwd):
20
+
21
+ - `sps graph explore <keywords>` — entry points + related symbols + source + call paths for an area
22
+ - `sps graph node <symbol>` — one symbol's definition + its callers/callees
23
+ - `sps graph query <name>` — find symbols by name
24
+ - `sps graph callers <symbol>` / `sps graph impact <symbol>` — who calls it / what a change affects
25
+
26
+ Fall back to reading files directly only when the graph is missing what you need
27
+ (or `sps graph status` shows it isn't built).
28
+
29
+ ## SPS Pipeline Context
30
+
31
+ This project is driven by SPS (Smart Pipeline System). Each card is a task.
32
+ When you are launched as a worker, two env vars identify your stable context:
33
+
34
+ - `$SPS_PROJECT` — project name (stable across card reuse)
35
+ - `$SPS_WORKER_SLOT` — worker slot name (stable across card reuse)
36
+
37
+ Per-card information (card id, stage name, title) is **not** in env. POSIX
38
+ freezes env at spawn, so any per-card value would go stale once the claude
39
+ process is reused for the next card. If you need the current card info,
40
+ read the marker file or use the `sps` CLI:
41
+
42
+ - Marker file: `~/.coral/projects/$SPS_PROJECT/runtime/worker-$SPS_WORKER_SLOT-current.json`
43
+ - CLI: `sps card dashboard $SPS_PROJECT` (or the command your task prompt already passed to you)
44
+
45
+ ## Card lifecycle labels (for reference — all managed automatically)
46
+
47
+ Each card moves through these labels during its pipeline run:
48
+
49
+ - `AI-PIPELINE` — added at `sps card add`; the pipeline admission mark
50
+ - `CLAIMED` — added when SPS claims a worker slot for this card
51
+ - `STARTED-<stage>` — added automatically on each prompt submit via the
52
+ **UserPromptSubmit** hook. This is the "ACK signal" that proves Claude
53
+ received the prompt. If this label doesn't appear within
54
+ `WORKER_ACK_TIMEOUT_S` seconds after dispatch, SPS's MonitorEngine flags
55
+ `ACK-TIMEOUT` and StageEngine kills the worker + retries.
56
+ - `COMPLETED-<stage>` — added on turn end via the **Stop hook**. Tells SPS
57
+ to advance the card to the next stage (or Done).
58
+
59
+ You do NOT need to manually update card state, move the card between
60
+ columns, or commit on behalf of the pipeline. The hooks do it all.
61
+
62
+ **Honesty note**: If you declare "done" without actually implementing the
63
+ work, the pipeline will still advance (the Stop hook fires regardless). The
64
+ user relies on your honesty here.
65
+
66
+ ## Memory
67
+
68
+ - Claude's **auto memory** is enabled and stored under
69
+ `~/.coral/projects/$SPS_PROJECT/memory/`. You write to `MEMORY.md` there
70
+ to persist knowledge across sessions.
71
+ - Use `sps memory add $SPS_PROJECT --type ...` to write structured SPS memories
72
+ (conventions, decisions, lessons) for the human to curate.
73
+
74
+ ## Git (if the project uses git)
75
+
76
+ - Claude handles all git operations itself (commit, push, etc.).
77
+ - SPS does NOT intervene in git workflows or conflict resolution.
78
+
79
+ ## Project-specific rules
80
+
81
+ <!-- Add your own conventions, architecture notes, and constraints below. -->
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+ # SPS Pipeline Worker — UserPromptSubmit hook (v0.42.0+)
3
+ #
4
+ # Triggered synchronously before Claude processes each prompt. Used by SPS
5
+ # to label the card with STARTED-<stage> — this is the "ACK signal" that
6
+ # proves Claude received the prompt. Also injects skill hints based on the
7
+ # card's `skills` field (or legacy skill:* labels).
8
+ #
9
+ # Phase 2 is user-customizable: add audit logging, request rate limiting,
10
+ # prompt enrichment, etc. without touching Phase 1.
11
+ #
12
+ # Env vars (stable across claude process reuse):
13
+ # SPS_PROJECT Project name
14
+ # SPS_WORKER_SLOT Worker slot name
15
+ #
16
+ # Per-card info (card id, stage, title) is NOT in env — POSIX env freezes at
17
+ # spawn. Hook scripts must read the marker file instead. Phase 1 does this
18
+ # automatically via `sps hook user-prompt-submit`.
19
+
20
+ set -e
21
+
22
+ # ─── Phase 1: SPS official action (do NOT remove) ────────────────────
23
+ # Reads marker file → addLabel STARTED-<stage> + emit skill hints.
24
+ sps hook user-prompt-submit
25
+
26
+ # ─── Phase 2: User-customizable actions (edit as needed) ────────────
27
+
28
+ # Example: audit log of every prompt submission.
29
+ # if [ -n "$SPS_PROJECT" ] && [ -n "$SPS_WORKER_SLOT" ]; then
30
+ # echo "$(date): prompt submitted to $SPS_PROJECT/$SPS_WORKER_SLOT" \
31
+ # >> "$CLAUDE_PROJECT_DIR/.sps/user-prompts.log"
32
+ # fi
33
+
34
+ # Example: rate limiting (block if too many prompts in a window).
35
+ # count=$(find "$CLAUDE_PROJECT_DIR/.sps" -name 'last-prompt-*' -mmin -1 | wc -l)
36
+ # if [ "$count" -gt 30 ]; then
37
+ # echo '{"decision":"block","reason":"rate limit exceeded (>30 prompts/min)"}'
38
+ # exit 0
39
+ # fi
40
+
41
+ # Example: prompt-to-Slack mirror for team visibility.
42
+ # curl -sfX POST "$SLACK_WEBHOOK" -d "{\"text\":\"[$SPS_PROJECT] new prompt\"}"
43
+
44
+ exit 0
@@ -0,0 +1,54 @@
1
+ #!/bin/bash
2
+ # SPS Pipeline Worker — Stop hook
3
+ #
4
+ # Triggered when Claude finishes its current turn. The pipeline depends on
5
+ # Phase 1 to advance card state. Phase 2+ is user-customizable.
6
+ #
7
+ # Env vars (set by SPS worker at spawn time, frozen for the process lifetime):
8
+ # SPS_PROJECT Project name (stable across card reuse)
9
+ # SPS_WORKER_SLOT Worker slot name (stable across card reuse)
10
+ #
11
+ # These two env vars form the index to locate the per-slot marker file:
12
+ # ~/.coral/projects/$SPS_PROJECT/runtime/worker-$SPS_WORKER_SLOT-current.json
13
+ #
14
+ # Per-card info (card id, stage name, card title) is intentionally NOT in env.
15
+ # POSIX freezes env at spawn; when the claude process is reused for the next
16
+ # card, any per-card env would go stale. Always read the marker file (or use
17
+ # `sps` CLI) to get current card information.
18
+ #
19
+ # Claude-native env also available:
20
+ # CLAUDE_PROJECT_DIR, CLAUDE_SESSION_ID
21
+
22
+ set -e
23
+
24
+ # ─── Phase 1: SPS official action (do NOT remove) ────────────────────
25
+ # Mark the card complete so pipeline can advance state.
26
+ # We call mark-complete WITHOUT a seq — the command reads the per-slot
27
+ # current-card marker file (written by the worker manager on each dispatch)
28
+ # to get the authoritative current card. This is the only way to be correct
29
+ # when the same claude process handles multiple cards in sequence.
30
+ if [ -n "$SPS_PROJECT" ] && [ -n "$SPS_WORKER_SLOT" ]; then
31
+ # 绝不让 mark-complete 失败阻塞 stop:Stop hook 非零退出会被 claude 当成"别停、继续",
32
+ # 导致 worker 被无限重戳("Acknowledged." 死循环)。失败仅记 stderr(MonitorEngine 有超时兜底)。
33
+ sps card mark-complete "$SPS_PROJECT" || echo "[stop.sh] mark-complete non-fatal failure — allowing stop" >&2
34
+ fi
35
+
36
+ # ─── Phase 2: User-customizable actions (edit as needed) ────────────
37
+
38
+ # Example: record the session transcript location for later audit.
39
+ # if [ -n "$CLAUDE_SESSION_ID" ] && [ -n "$SPS_CARD_ID" ]; then
40
+ # echo "$CLAUDE_SESSION_ID" >> "$CLAUDE_PROJECT_DIR/.sps/session-log.txt"
41
+ # fi
42
+
43
+ # Example: third-party knowledge base capture.
44
+ # if command -v your-kb-cli &>/dev/null; then
45
+ # your-kb-cli capture --project "$SPS_PROJECT" --session "$CLAUDE_SESSION_ID"
46
+ # fi
47
+
48
+ # Example: notify on completion.
49
+ # sps notify matrix "[$SPS_PROJECT] seq $SPS_CARD_ID ($SPS_STAGE) done"
50
+
51
+ # Example: post-task CI trigger.
52
+ # curl -sfX POST "$CI_WEBHOOK" -d "{\"project\":\"$SPS_PROJECT\",\"card\":\"$SPS_CARD_ID\"}"
53
+
54
+ exit 0
File without changes
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "hooks": {
4
+ "Stop": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/stop.sh"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "hooks": [
17
+ {
18
+ "type": "command",
19
+ "command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/start.sh"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ },
25
+ "attribution": {
26
+ "commit": "",
27
+ "pr": ""
28
+ },
29
+ "companyAnnouncements": [
30
+ "🔧 SPS Pipeline Worker — completion is declared via Stop hook \u2192 COMPLETED-<stage> label"
31
+ ]
32
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "autoMemoryDirectory": "~/.coral/projects/__PROJECT__/memory"
3
+ }
File without changes
@@ -0,0 +1,10 @@
1
+ # Project Template
2
+
3
+ This folder is copied into `~/.coral/projects/<project-name>/` for each new pipeline-managed project.
4
+
5
+ Contents:
6
+ - `conf` — project-specific configuration
7
+ - `deploy.sh` — optional project-local deploy entrypoint
8
+ - `batch_scheduler.sh` — project-local Planning → Backlog scheduler
9
+ - `logs/` — runtime logs
10
+ - `pm_meta/` — local PM metadata store (used especially for Plane)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ # batch_scheduler.sh — project-local cron entry point
3
+ # Delegates to the SPS CLI tick command.
4
+ set -euo pipefail
5
+
6
+ PROJECT_NAME="$(basename "$(cd "$(dirname "$0")" && pwd)")"
7
+
8
+ exec sps tick "$PROJECT_NAME" "$@"
@@ -0,0 +1,61 @@
1
+ # ── 项目基础信息 ─────────────────────────────────────────────────
2
+ export PROJECT_NAME="__PROJECT_NAME__"
3
+
4
+ # ── 路径配置(可选,不设置则使用默认值)───────────────────────────
5
+ # 业务代码仓库目录(默认: ~/projects/<project>)
6
+ # export PROJECT_DIR="$HOME/projects/__PROJECT_NAME__"
7
+ # Worker worktree 根目录(默认: ~/.coral/worktrees/)
8
+ # export WORKTREE_DIR="$HOME/.coral/worktrees"
9
+
10
+ # ── GitLab(项目特有)──────────────────────────────────────────
11
+ # GITLAB_URL / GITLAB_TOKEN 从全局 ~/.coral/env 继承,此处不重复
12
+ export GITLAB_PROJECT="__GITLAB_PROJECT__"
13
+ # GITLAB_PROJECT_ID 可选 — 留空则通过 GITLAB_PROJECT 路径自动查询
14
+ # export GITLAB_PROJECT_ID=""
15
+ export GITLAB_MERGE_BRANCH="develop"
16
+
17
+ # ── PM Backend ───────────────────────────────────────────────────
18
+ export PM_TOOL="plane"
19
+
20
+ # ── Trello(PM_TOOL=trello 时填写)───────────────────────────────
21
+ # TRELLO_API_KEY / TRELLO_TOKEN 从全局 ~/.coral/env 继承
22
+ # export TRELLO_BOARD_ID=""
23
+ # export TRELLO_LIST_PLANNING=""
24
+ # export TRELLO_LIST_BACKLOG=""
25
+ # export TRELLO_LIST_TODO=""
26
+ # export TRELLO_LIST_INPROGRESS=""
27
+ # export TRELLO_LIST_QA=""
28
+ # export TRELLO_LIST_DONE=""
29
+ # export TRELLO_ACCOUNT=""
30
+
31
+ # ── Plane(PM_TOOL=plane 时填写)────────────────────────────────
32
+ # PLANE_URL / PLANE_API_KEY / PLANE_WORKSPACE_SLUG 从全局 ~/.coral/env 继承
33
+ export PLANE_PROJECT_ID="__PLANE_PROJECT_ID__"
34
+ export PLANE_STATE_PLANNING="__PLANE_STATE_PLANNING__"
35
+ export PLANE_STATE_BACKLOG="__PLANE_STATE_BACKLOG__"
36
+ export PLANE_STATE_TODO="__PLANE_STATE_TODO__"
37
+ export PLANE_STATE_INPROGRESS="__PLANE_STATE_INPROGRESS__"
38
+ export PLANE_STATE_QA="__PLANE_STATE_QA__"
39
+ export PLANE_STATE_DONE="__PLANE_STATE_DONE__"
40
+
41
+ # ── Pipeline ─────────────────────────────────────────────────────
42
+ export PIPELINE_LABEL="AI-PIPELINE"
43
+ export MR_MODE="none"
44
+
45
+ # ── Worker / Agent ───────────────────────────────────────────────
46
+ # claude is the only supported CLI; no selector exposed.
47
+ export MAX_CONCURRENT_WORKERS=3
48
+ # export MAX_ACTIONS_PER_TICK=1
49
+ # export WORKER_RESTART_LIMIT=2
50
+ # export DEFAULT_WORKER_SKILLS="senior"
51
+
52
+ # ── 超时与策略(可选,以下为默认值)──────────────────────────────
53
+ # export INPROGRESS_TIMEOUT_HOURS=8
54
+ # export MONITOR_AUTO_QA=false
55
+ # export CONFLICT_DEFAULT=serial
56
+ # export TICK_LOCK_TIMEOUT_MINUTES=30
57
+
58
+ # ── 通知(项目特有 — 不同项目可发不同房间)──────────────────────
59
+ # MATRIX_HOMESERVER / MATRIX_ACCESS_TOKEN 从全局 ~/.coral/env 继承
60
+ # 如果项目需要发到特定房间,设置 MATRIX_ROOM_ID:
61
+ # export MATRIX_ROOM_ID=""
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ echo "Deployment not configured for ${PROJECT_NAME:-unknown-project}"
File without changes
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: sps-memory
3
+ description: 项目级记忆 —— 续作/动手前召回历史经验,完成时记录可复用精华。统一走 `sps memory` CLI,后端(本地文件 / agentmemory / 自定义)由系统全局配置,你无需关心是哪个。召回触发:任务涉及已有项目、用户说"继续/上次/之前"、涉及代码仓库/部署路径/架构决策、需保持用户偏好。记录触发:产生新架构决策、任务/状态变化、发现新约束、用户纠正了你、产生可复用解决方案。(🪸 Coral SPS)
4
+ ---
5
+
6
+ # 项目记忆(sps-memory)
7
+
8
+ 统一 CLI 读写,**后端无关**(本地文件 / agentmemory / 自定义由系统全局配置)。
9
+ 项目名在环境变量 `$SPS_PROJECT`。开工时系统已自动召回一批注入上文;工作中按下列规则**主动**使用。
10
+
11
+ ## 召回(读)
12
+
13
+ **何时(满足任一,就先召回再动手):**
14
+ - 任务涉及已有项目
15
+ - 用户说"继续 / 上次 / 之前"
16
+ - 涉及代码仓库、部署路径、架构决策
17
+ - 需要保持用户偏好
18
+
19
+ ```bash
20
+ sps memory search "$SPS_PROJECT" "<关键词,如 部署路径 / 某模块架构 / 某引擎的坑>"
21
+ ```
22
+ 返回相关记忆标题;需要细节再据此深入(读文件 / 再检索)。
23
+
24
+ ## 记录(写)
25
+
26
+ **何时(满足任一,就记一条):**
27
+ - 产生了新的架构决策
28
+ - 任务 / 状态发生变化
29
+ - 发现了新约束
30
+ - 用户纠正了你
31
+ - 产生了可复用的解决方案
32
+
33
+ ```bash
34
+ sps memory add "$SPS_PROJECT" --type <lesson|decision|convention|reference> \
35
+ --name "<一句话标题>" --body "<要点>"
36
+ ```
37
+ - `decision` 架构/技术决策 · `lesson` 踩过的坑/教训 · `convention` 约定/规范 · `reference` 参考/路径
38
+ - 只记**非显然、可复用**的精华,别记流水账。
39
+ - 写入是**提议**——系统会事后去重和审计,轻微重复不必担心。
40
+
41
+ ## 不要记
42
+
43
+ 代码结构 / 文件路径(Read·Glob 可得)· git 历史 · 临时调试态 · CLAUDE.md/docs 已有的 · 卡/任务状态。
44
+ **不确定就不写** —— 空增长比不增长更糟。
45
+
46
+ ## 诚实
47
+
48
+ - 不编造;只记用户说过的或你真发现的。
49
+ - 记错了就改 / 删,别在矛盾上再堆一条。
50
+
51
+ 记忆服务不可用时跳过,不阻塞任务。