work-ally 0.2.0-alpha.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 (172) hide show
  1. package/AGENTS.md +110 -0
  2. package/DASHBOARD.md +160 -0
  3. package/PRODUCT.md +113 -0
  4. package/README.md +403 -0
  5. package/ally.sh +171 -0
  6. package/bridge/src/approval-rules.ts +360 -0
  7. package/bridge/src/channel-delivery.ts +207 -0
  8. package/bridge/src/channel-types.ts +22 -0
  9. package/bridge/src/channels/fake/adapter.ts +31 -0
  10. package/bridge/src/channels/feishu/adapter.ts +411 -0
  11. package/bridge/src/channels/feishu/approvals.ts +6 -0
  12. package/bridge/src/channels/feishu/formatter.ts +276 -0
  13. package/bridge/src/channels/feishu/normalize.ts +368 -0
  14. package/bridge/src/codex-config.ts +52 -0
  15. package/bridge/src/config.ts +240 -0
  16. package/bridge/src/fake-runtime-client.ts +505 -0
  17. package/bridge/src/handoff-service.ts +494 -0
  18. package/bridge/src/logger.ts +194 -0
  19. package/bridge/src/memory-digest.ts +186 -0
  20. package/bridge/src/receiver-approval-autonomy.ts +158 -0
  21. package/bridge/src/receiver-control-core.ts +140 -0
  22. package/bridge/src/receiver-control-work-session.ts +218 -0
  23. package/bridge/src/receiver-control.ts +83 -0
  24. package/bridge/src/receiver-delivery.ts +136 -0
  25. package/bridge/src/receiver-helpers.ts +96 -0
  26. package/bridge/src/receiver-human-gate.ts +333 -0
  27. package/bridge/src/receiver-inbound-preflight.ts +162 -0
  28. package/bridge/src/receiver-recovery.ts +236 -0
  29. package/bridge/src/receiver-runtime-callbacks.ts +367 -0
  30. package/bridge/src/receiver-runtime-policy.ts +132 -0
  31. package/bridge/src/receiver-runtime-state.ts +124 -0
  32. package/bridge/src/receiver-support-actions.ts +189 -0
  33. package/bridge/src/receiver-thread-start.ts +57 -0
  34. package/bridge/src/receiver-turn-coordination.ts +94 -0
  35. package/bridge/src/receiver-turn-execution.ts +257 -0
  36. package/bridge/src/receiver-turn-failure.ts +143 -0
  37. package/bridge/src/receiver-turn-result.ts +185 -0
  38. package/bridge/src/receiver-turn-steer.ts +70 -0
  39. package/bridge/src/receiver-work-session.ts +76 -0
  40. package/bridge/src/receiver.ts +329 -0
  41. package/bridge/src/router.ts +62 -0
  42. package/bridge/src/runtime-client-agent-messages.ts +150 -0
  43. package/bridge/src/runtime-client-message-dispatch.ts +176 -0
  44. package/bridge/src/runtime-client-protocol.ts +411 -0
  45. package/bridge/src/runtime-client-request-ops.ts +56 -0
  46. package/bridge/src/runtime-client-run-turn.ts +158 -0
  47. package/bridge/src/runtime-client-thread-ops.ts +270 -0
  48. package/bridge/src/runtime-client-transport.ts +309 -0
  49. package/bridge/src/runtime-client-turn-poll.ts +224 -0
  50. package/bridge/src/runtime-client-turn-read.ts +185 -0
  51. package/bridge/src/runtime-client-turn-state.ts +105 -0
  52. package/bridge/src/runtime-client.ts +344 -0
  53. package/bridge/src/runtime-user-input.ts +403 -0
  54. package/bridge/src/scheduler.ts +239 -0
  55. package/bridge/src/server-handoff-command.ts +364 -0
  56. package/bridge/src/server-main.ts +80 -0
  57. package/bridge/src/server-routine-command.ts +60 -0
  58. package/bridge/src/server-routine-execution.ts +222 -0
  59. package/bridge/src/server-runtime-app-support.ts +107 -0
  60. package/bridge/src/server-runtime-app.ts +238 -0
  61. package/bridge/src/server-thread-sync-command.ts +63 -0
  62. package/bridge/src/server.ts +17 -0
  63. package/bridge/src/session-store-delivery.ts +220 -0
  64. package/bridge/src/session-store-human-gate.ts +380 -0
  65. package/bridge/src/session-store-inbound-acceptance.ts +66 -0
  66. package/bridge/src/session-store-meta.ts +134 -0
  67. package/bridge/src/session-store-turn-ledger.ts +272 -0
  68. package/bridge/src/session-store.ts +380 -0
  69. package/bridge/src/system-notify.ts +220 -0
  70. package/bridge/src/thread-sync.ts +200 -0
  71. package/bridge/src/translator.ts +494 -0
  72. package/bridge/src/types.ts +289 -0
  73. package/bridge/src/utils.ts +104 -0
  74. package/bridge/src/work-session-store.ts +471 -0
  75. package/docs/.gitkeep +0 -0
  76. package/docs/architecture/codex-feishu-bridge-proposal.md +2742 -0
  77. package/docs/completed/FEATURE-feishu-markdown-and-reply-support.md +327 -0
  78. package/docs/completed/README.md +21 -0
  79. package/docs/completed/SPEC-approval-autonomy-and-safe-defaults.md +205 -0
  80. package/docs/completed/SPEC-approval-batch-and-strict-reply-shortcuts.md +153 -0
  81. package/docs/completed/SPEC-conversation-noise-reduction-and-busy-input-gate.md +538 -0
  82. package/docs/completed/SPEC-engineering-sop-skillization.md +190 -0
  83. package/docs/completed/SPEC-faithful-bridge-core-thinning-v2.md +376 -0
  84. package/docs/completed/SPEC-faithful-bridge-core-thinning.md +1071 -0
  85. package/docs/completed/SPEC-group-chat-sender-identity.md +301 -0
  86. package/docs/completed/SPEC-middleware-exception-visibility.md +227 -0
  87. package/docs/completed/SPEC-nightly-memory-digest-visibility.md +121 -0
  88. package/docs/completed/SPEC-project-group-chat-human-centered-conversation-mapping.md +326 -0
  89. package/docs/completed/SPEC-remove-cli-persona-bootstrap.md +201 -0
  90. package/docs/developer-workflow.md +49 -0
  91. package/docs/implementation/SPEC-codex-same-machine-session-handoff-implementation.md +239 -0
  92. package/docs/implementation/test-coverage-map.md +363 -0
  93. package/docs/implementation/work-ally-implementation-guide.md +790 -0
  94. package/docs/issues/README.md +10 -0
  95. package/docs/issues/pending/ANALYSIS-ally-premature-recovery-notice-and-task-state-semantics-2026-03-18.md +295 -0
  96. package/docs/issues/resolved/ANALYSIS-approval-waiting-visible-but-approval-artifact-missing-2026-03-16.md +466 -0
  97. package/docs/issues/resolved/ANALYSIS-blocking-state-visible-without-user-actionable-artifact-2026-03-16.md +261 -0
  98. package/docs/issues/resolved/ANALYSIS-codex-app-server-transport-disconnect-semantics-2026-03-14.md +606 -0
  99. package/docs/issues/resolved/ANALYSIS-premature-terminalization-on-fresh-thread-poll-and-object-error-leak-2026-03-16.md +348 -0
  100. package/docs/issues/resolved/ANALYSIS-runtime-turn-delivery-and-recovery-2026-03-14.md +603 -0
  101. package/docs/issues/resolved/ANALYSIS-self-test-gap-approval-waiting-visible-but-approval-artifact-missing-2026-03-16.md +166 -0
  102. package/docs/issues/resolved/ANALYSIS-self-test-gap-blocking-state-visible-without-user-actionable-artifact-2026-03-16.md +186 -0
  103. package/docs/issues/resolved/ANALYSIS-self-test-gap-premature-terminalization-on-fresh-thread-poll-and-object-error-leak-2026-03-16.md +166 -0
  104. package/docs/issues/resolved/REPORT-ally-runtime-turn-delivery-3b42fb8-2026-03-15.md +373 -0
  105. package/docs/manual-acceptance.md +127 -0
  106. package/docs/ops-runbook.md +44 -0
  107. package/docs/planning/FEATURE-memory-system.md +748 -0
  108. package/docs/planning/SPEC-active-turn-steer-and-context-compaction-visibility.md +269 -0
  109. package/docs/planning/SPEC-approval-rules-inheritance-and-local-validation-lane.md +450 -0
  110. package/docs/planning/SPEC-assistant-persona-bootstrap.md +199 -0
  111. package/docs/planning/SPEC-assistant-rename.md +610 -0
  112. package/docs/planning/SPEC-bridge-app-server-protocol-alignment.md +667 -0
  113. package/docs/planning/SPEC-claude-runtime-host-for-work-ally.md +434 -0
  114. package/docs/planning/SPEC-cli-feishu-codex-session-unification.md +236 -0
  115. package/docs/planning/SPEC-codex-same-machine-session-handoff.md +873 -0
  116. package/docs/planning/SPEC-feishu-reaction-shortcuts.md +282 -0
  117. package/docs/planning/SPEC-local-stable-release-boundary.md +166 -0
  118. package/docs/planning/SPEC-managed-thread-entry-and-surface-mobility.md +862 -0
  119. package/docs/planning/SPEC-minimal-bridge-semantics-and-user-visible-surface.md +362 -0
  120. package/docs/planning/SPEC-npm-alpha-distribution-and-install-first-release.md +222 -0
  121. package/docs/planning/SPEC-remove-websocket-runtime-transport.md +364 -0
  122. package/docs/planning/SPEC-runtime-abstraction-phase-1.md +424 -0
  123. package/docs/planning/SPEC-runtime-connection-and-turn-recovery-semantics.md +274 -0
  124. package/docs/planning/SPEC-session-presence-and-state-visibility.md +397 -0
  125. package/docs/planning/SPEC-skill-first-capability-packaging.md +338 -0
  126. package/docs/planning/SPEC-stable-archive-contract.md +456 -0
  127. package/docs/planning/SPEC-supervised-start-boundary.md +127 -0
  128. package/docs/planning/SPEC-user-barrier-reduction-and-activation.md +832 -0
  129. package/docs/planning/ally-next.md +1278 -0
  130. package/docs/planning/assistant-workbench-spec.md +725 -0
  131. package/docs/planning/product-workbench.md +283 -0
  132. package/docs/product-onboarding.md +227 -0
  133. package/docs/product-spec-standard.md +528 -0
  134. package/docs/troubleshooting.md +45 -0
  135. package/docs/user-quickstart.md +46 -0
  136. package/internal/dispatch.sh +95 -0
  137. package/internal/lib/common.sh +1450 -0
  138. package/internal/modules/assistant/manage.sh +1312 -0
  139. package/internal/modules/bootstrap/setup.sh +144 -0
  140. package/internal/modules/config/init-env.sh +10 -0
  141. package/internal/modules/global/manage.sh +154 -0
  142. package/internal/modules/handoff/manage.sh +54 -0
  143. package/internal/modules/mcp/manage.sh +83 -0
  144. package/internal/modules/ops/logs.sh +76 -0
  145. package/internal/modules/routines/manage.sh +55 -0
  146. package/internal/modules/runtime/assistant-autosave.sh +26 -0
  147. package/internal/modules/runtime/restart.sh +6 -0
  148. package/internal/modules/runtime/start.sh +283 -0
  149. package/internal/modules/runtime/status.sh +194 -0
  150. package/internal/modules/runtime/stop.sh +55 -0
  151. package/internal/modules/runtime/supervisor.sh +216 -0
  152. package/internal/modules/runtime/update.sh +26 -0
  153. package/package.json +41 -0
  154. package/runtime/config/.gitkeep +0 -0
  155. package/runtime/host/.gitkeep +0 -0
  156. package/runtime/host/healthcheck-codex-app-server.ts +22 -0
  157. package/runtime/host/ping-pong-codex-app-server.ts +66 -0
  158. package/runtime/host/probe-codex-app-server.ts +115 -0
  159. package/skills/archive-reader/SKILL.md +9 -0
  160. package/skills/feishu-production-debug/SKILL.md +37 -0
  161. package/skills/feishu-production-debug/references/feishu-debug-order.md +49 -0
  162. package/skills/feishu-production-debug/references/platform-permission-baseline.md +23 -0
  163. package/skills/issue-to-spec-triage/SKILL.md +44 -0
  164. package/skills/issue-to-spec-triage/references/triage-rules.md +66 -0
  165. package/skills/memory-digest/SKILL.md +9 -0
  166. package/skills/post-implementation-closure/SKILL.md +39 -0
  167. package/skills/post-implementation-closure/references/closure-checklist.md +45 -0
  168. package/skills/post-implementation-closure/references/doc-drift-map.md +49 -0
  169. package/skills/product-spec/SKILL.md +244 -0
  170. package/templates/env.example +5 -0
  171. package/templates/routines/nightly-memory-digest.yaml +10 -0
  172. package/templates/workspace/AGENTS.md +26 -0
@@ -0,0 +1,66 @@
1
+ # Triage Rules
2
+
3
+ ## Decision order
4
+
5
+ Ask these questions in order:
6
+
7
+ 1. Does this change product meaning, default behavior, or user path?
8
+ 2. Does it cross module, role, or system boundaries?
9
+ 3. Does it introduce a new object, state, flow, command, or long-term maintenance contract?
10
+ 4. Would it be expensive to get wrong and likely to cause rework?
11
+
12
+ If any answer is yes, default to `spec-needed`.
13
+
14
+ ## Classification guide
15
+
16
+ ### `small-bugfix`
17
+
18
+ Use when all of the following are true:
19
+
20
+ - low-risk
21
+ - local
22
+ - does not change product semantics
23
+ - does not need a new user path or mechanism contract
24
+
25
+ Typical examples:
26
+
27
+ - typo or wording correction
28
+ - obvious local regression
29
+ - tiny implementation hole already covered by an existing spec
30
+
31
+ ### `boundary-fix`
32
+
33
+ Use when the underlying issue is that current behavior drifted from the already chosen product boundary.
34
+
35
+ Typical examples:
36
+
37
+ - bridge exposed too much internal state
38
+ - docs drifted away from current shipped model
39
+ - implementation violated an existing constraint such as KISS or faithful bridge
40
+
41
+ ### `spec-needed`
42
+
43
+ Use when the request introduces or changes product behavior in a way another engineer could not safely infer without a written contract.
44
+
45
+ Typical examples:
46
+
47
+ - new command or workflow
48
+ - new approval or routing behavior
49
+ - new desk asset contract
50
+ - non-trivial capability packaging decision
51
+
52
+ ### `hold`
53
+
54
+ Use when the idea has value but should not become active implementation input yet.
55
+
56
+ Typical examples:
57
+
58
+ - promising direction but unclear target user or trigger path
59
+ - good enhancement but below current priority line
60
+ - interesting thought that belongs in planning, not execution
61
+
62
+ ## Output template
63
+
64
+ - 结论:`<classification>`
65
+ - 原因:`<1-3 short bullets>`
66
+ - 下一步:`<draft spec / fix locally / park in dashboard / align with existing spec>`
@@ -0,0 +1,9 @@
1
+ # memory-digest
2
+
3
+ Use this skill when consolidating raw archive material into durable workspace memory.
4
+
5
+ ## Output contract
6
+
7
+ 1. Produce a daily summary suitable for `memory/daily/YYYY-MM-DD.md`.
8
+ 2. Produce an updated long-term memory version suitable for `memory/long-term/MEMORY.md`.
9
+ 3. Keep facts inspectable, concise, and grep-friendly.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: post-implementation-closure
3
+ description: Use this skill when implementation is largely done and you need to close the loop properly: self-review, run the right regression checks, verify doc drift, sync spec and dashboard state, and decide whether the change is truly ready to commit or report as done.
4
+ ---
5
+
6
+ # Post Implementation Closure
7
+
8
+ Use this skill after implementation, not before it.
9
+
10
+ Do not use this skill when:
11
+
12
+ - the task is still in active design or coding mode
13
+ - you are still trying to find the root cause of a bug
14
+ - no meaningful code, behavior, or documentation change has happened yet
15
+
16
+ ## Quick start
17
+
18
+ 1. Read `references/closure-checklist.md` first.
19
+ 2. Load the relevant spec and the affected user or maintainer docs.
20
+ 3. Review the diff before you report status.
21
+ 4. Run only the validations that actually match the changed surface.
22
+ 5. Use `references/doc-drift-map.md` to check whether README, quickstart, troubleshooting, dashboard, or spec state needs updating.
23
+
24
+ ## Output contract
25
+
26
+ When you use this skill, the closure result should cover:
27
+
28
+ 1. review findings or an explicit `no findings`
29
+ 2. validation run and remaining gaps
30
+ 3. documentation updates made or explicitly not needed
31
+ 4. final readiness judgment
32
+
33
+ ## Working rules
34
+
35
+ - Default to closing the loop yourself instead of returning a half-finished progress report.
36
+ - Findings come before summaries.
37
+ - Prefer clean-environment regression when shell or runtime environment pollution could hide the truth.
38
+ - Do not mark a task done while spec, dashboard, or user-facing docs still reflect stale status.
39
+ - If you could not verify something important, state the gap plainly instead of pretending closure is complete.
@@ -0,0 +1,45 @@
1
+ # Closure Checklist
2
+
3
+ ## 1. Review the change itself
4
+
5
+ - Read the relevant diff.
6
+ - Look for regressions, scope leaks, edge cases, missing cleanup, and documentation drift.
7
+ - If the user asked for a review, present findings first.
8
+
9
+ ## 2. Run the right validation
10
+
11
+ Choose the minimum set that matches the changed area.
12
+
13
+ Examples:
14
+
15
+ - shell or lifecycle change: `bash -n ally.sh`, related shell checks, `tests/shell/assistant.sh`
16
+ - bridge channel or Feishu change: unit and integration channel tests
17
+ - broad product change: `npm test` or the relevant narrowed suite
18
+ - runtime or shell environment sensitivity: rerun with clean env
19
+
20
+ ## 3. Check documentation drift
21
+
22
+ At minimum, reconsider whether any of these changed:
23
+
24
+ - `README.md`
25
+ - `docs/user-quickstart.md`
26
+ - `docs/user-quickstart-desktop.md`
27
+ - `docs/manual-acceptance.md`
28
+ - `docs/troubleshooting.md`
29
+ - `DASHBOARD.md`
30
+ - current spec status or location
31
+
32
+ ## 4. Sync project state
33
+
34
+ - If the work is done, move planning status to completed or implemented state.
35
+ - If a topic is no longer active, remove it from the wrong dashboard lane.
36
+ - If a spec is superseded or completed, make that relationship explicit.
37
+
38
+ ## 5. Final readiness judgment
39
+
40
+ Only call the work closed when:
41
+
42
+ - review is done
43
+ - validation is done or gaps are explicitly called out
44
+ - docs are aligned
45
+ - status surfaces are aligned
@@ -0,0 +1,49 @@
1
+ # Doc Drift Map
2
+
3
+ ## Change type -> Docs to recheck
4
+
5
+ ### User-visible CLI behavior
6
+
7
+ Recheck:
8
+
9
+ - `README.md`
10
+ - `docs/user-quickstart.md`
11
+ - `docs/manual-acceptance.md`
12
+ - `docs/troubleshooting.md`
13
+
14
+ ### Desktop-only internal beta behavior
15
+
16
+ Recheck:
17
+
18
+ - `README.md`
19
+ - `docs/user-quickstart-desktop.md`
20
+ - relevant desktop implementation docs
21
+
22
+ ### Bridge semantics, approval, routing, or recovery behavior
23
+
24
+ Recheck:
25
+
26
+ - `README.md`
27
+ - `docs/manual-acceptance.md`
28
+ - `docs/troubleshooting.md`
29
+ - relevant planning or completed spec
30
+ - `DASHBOARD.md`
31
+
32
+ ### Product boundary or long-term direction
33
+
34
+ Recheck:
35
+
36
+ - `PRODUCT.md`
37
+ - `AGENTS.md`
38
+ - `README.md`
39
+ - `DASHBOARD.md`
40
+ - relevant spec state
41
+
42
+ ### Engineering-only workflow improvements
43
+
44
+ Recheck:
45
+
46
+ - `AGENTS.md`
47
+ - `README.md`
48
+ - `docs/developer-workflow.md`
49
+ - `DASHBOARD.md`
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: product-spec
3
+ description: Use this skill when drafting, refining, reviewing, or self-scoring a product spec for work-ally. It applies the team spec standard, determines whether a request is non-trivial and needs a spec, identifies missing product inputs, guides clarification with the requester, and outputs either a spec draft or a readiness review against docs/product-spec-standard.md.
4
+ ---
5
+
6
+ # Product Spec
7
+
8
+ Use this skill only for product-spec work. Do not load it for normal coding, architecture debugging, or implementation tasks.
9
+
10
+ ## What this skill is for
11
+
12
+ This skill exists to help product managers and collaborators produce a spec that is:
13
+
14
+ - clear
15
+ - understandable by others
16
+ - ready for engineering handoff
17
+
18
+ It is not a general writing style guide.
19
+
20
+ The source of truth for the standard is:
21
+
22
+ - [docs/product-spec-standard.md](../../docs/product-spec-standard.md)
23
+
24
+ Read that file first when using this skill.
25
+
26
+ ## Trigger conditions
27
+
28
+ Use this skill when the task is any of the following:
29
+
30
+ - write a new product spec
31
+ - turn a rough product idea into a spec
32
+ - assess whether a request is non-trivial and needs a spec
33
+ - review an existing spec against the team standard
34
+ - self-score a spec before implementation
35
+ - tighten a spec so another engineer can implement it without guesswork
36
+
37
+ Do not use this skill when the task is only:
38
+
39
+ - writing code
40
+ - reviewing implementation details unrelated to product behavior
41
+ - editing README / quickstart copy without product behavior changes
42
+
43
+ ## Non-trivial request rule
44
+
45
+ A request is non-trivial and should become a spec if any of these are true:
46
+
47
+ - it changes product meaning, default behavior, or user path
48
+ - it introduces a new object, state, flow, or command
49
+ - it crosses module, role, or system boundaries
50
+ - it affects long-term product or maintenance semantics
51
+ - it is expensive to get wrong and likely to cause rework
52
+
53
+ If none of these are true, a full spec may not be necessary.
54
+
55
+ ## Modes
56
+
57
+ This skill has four modes. Pick one explicitly based on the task.
58
+
59
+ ### 1. Draft
60
+
61
+ Use when the requester has a rough idea and needs a new spec.
62
+
63
+ Your job:
64
+
65
+ - determine whether the request needs a spec
66
+ - extract the real problem, not just the proposed solution
67
+ - identify missing product inputs
68
+ - ask only the minimum clarifying questions needed
69
+ - produce a first spec draft using the team standard
70
+
71
+ ### 2. Refine
72
+
73
+ Use when a draft spec exists but is not yet handoff-ready.
74
+
75
+ Your job:
76
+
77
+ - find unclear sections
78
+ - strengthen `what / why / how`
79
+ - tighten terminology
80
+ - fill gaps in user path, mechanism, boundaries, and acceptance
81
+
82
+ ### 3. Review
83
+
84
+ Use when evaluating an existing spec.
85
+
86
+ Your job:
87
+
88
+ - review against [docs/product-spec-standard.md](../../docs/product-spec-standard.md)
89
+ - focus on missing clarity, ambiguity, mechanism gaps, scope confusion, and weak acceptance
90
+ - state whether it is `Not ready`, `Ready for review`, or `Ready for implementation`
91
+
92
+ ### 4. Score
93
+
94
+ Use when the requester wants a structured self-check.
95
+
96
+ Your job:
97
+
98
+ - run the quick yes/no gate first
99
+ - then score against the 10-item rubric in the standard doc
100
+ - explain deductions briefly
101
+ - give a final readiness recommendation
102
+
103
+ ## Working method
104
+
105
+ ### Step 1: Load only the standard first
106
+
107
+ Always start by reading:
108
+
109
+ - [docs/product-spec-standard.md](../../docs/product-spec-standard.md)
110
+
111
+ Do not load unrelated large docs unless the current spec references them or the task requires them.
112
+
113
+ ### Step 2: Classify the task
114
+
115
+ Determine:
116
+
117
+ - Does this request need a spec?
118
+ - Is the user asking to draft, refine, review, or score?
119
+ - Is the current input enough to proceed, or are key product inputs missing?
120
+
121
+ ### Step 3: Check the six essentials
122
+
123
+ Before calling a spec handoff-ready, verify that it clearly answers:
124
+
125
+ 1. what it is
126
+ 2. why it matters
127
+ 3. scope
128
+ 4. user path
129
+ 5. mechanism
130
+ 6. completion criteria
131
+
132
+ If any of these are materially unclear, do not mark it ready for implementation.
133
+
134
+ ### Step 4: Be strict on mechanism when needed
135
+
136
+ If the feature includes any of the following, require explicit mechanism design:
137
+
138
+ - new object
139
+ - new ID / key
140
+ - new state or state transition
141
+ - new command / entry point
142
+ - new default behavior
143
+ - current vs history behavior
144
+ - persistent storage changes
145
+ - migration or fallback logic
146
+
147
+ In those cases, do not accept a spec that only explains direction.
148
+
149
+ ### Step 5: Keep the spec lightweight
150
+
151
+ Do not force the full long template on every request.
152
+
153
+ Default expectation:
154
+
155
+ - use the minimal structure for ordinary features
156
+ - use expanded structure only when complexity truly requires it
157
+
158
+ The goal is not “complete paperwork”. The goal is “clear enough that another engineer can implement correctly”.
159
+
160
+ If the spec includes `Scope / Phase`, require that each phase be a user-value delivery slice, not an engineering task list. Treat `build UI / wire API / storage refactor / integration` style phases as a spec-quality problem, not as acceptable structure.
161
+
162
+ ## Clarification policy
163
+
164
+ This skill should not pretend unclear requests are implementation-ready.
165
+
166
+ When core inputs are missing, ask for only the minimum needed to unblock product clarity. Typical missing inputs are:
167
+
168
+ - target user or role
169
+ - main user path
170
+ - default behavior
171
+ - non-goals
172
+ - success condition
173
+ - boundary with existing behavior
174
+
175
+ Do not ask broad brainstorming questions if the gap can be reasonably inferred.
176
+
177
+ ## Output contracts
178
+
179
+ ### If drafting a spec
180
+
181
+ Output should include:
182
+
183
+ - a concise readiness statement
184
+ - missing assumptions called out explicitly
185
+ - a spec draft aligned to the standard
186
+
187
+ ### If reviewing a spec
188
+
189
+ Output should include, in this order:
190
+
191
+ - findings
192
+ - readiness verdict
193
+ - concrete next fixes
194
+
195
+ Prioritize:
196
+
197
+ - unclear problem definition
198
+ - weak mechanism design
199
+ - object / ID / state ambiguity
200
+ - acceptance that cannot be tested
201
+ - scope leaks and missing non-goals
202
+ - `Scope / Phase` written as engineering task sequencing instead of user-value delivery
203
+
204
+ ### If scoring a spec
205
+
206
+ Output should include:
207
+
208
+ - quick gate result
209
+ - 10-item score table or list
210
+ - total score
211
+ - final verdict
212
+
213
+ ## Readiness labels
214
+
215
+ Use exactly these labels:
216
+
217
+ - `Not ready`
218
+ - `Ready for review`
219
+ - `Ready for implementation`
220
+
221
+ Use them consistently with the team standard.
222
+
223
+ ## Review posture
224
+
225
+ Be direct and pragmatic.
226
+
227
+ Do not praise a spec for being long.
228
+ Do not reject a spec just because it is short.
229
+ Reject specs that still require the author to explain the important parts verbally.
230
+
231
+ ## Suggested structure defaults
232
+
233
+ For most specs, prefer the minimal structure:
234
+
235
+ 1. Summary
236
+ 2. 背景
237
+ 3. 问题定义
238
+ 4. 目标 / 非目标
239
+ 5. 产品定义与用户路径
240
+ 6. 机制设计
241
+ 7. 验收标准
242
+ 8. 风险 / 假设 / 待决问题
243
+
244
+ Only expand beyond this when the feature complexity warrants it.
@@ -0,0 +1,5 @@
1
+ WORK_ALLY_ALLOWED_USER_IDS=
2
+ FEISHU_APP_ID=
3
+ FEISHU_APP_SECRET=
4
+ WORK_ALLY_ASSISTANT_NAME=
5
+ WORK_ALLY_ASSISTANT_GIT_REMOTE=
@@ -0,0 +1,10 @@
1
+ id: nightly-memory-digest
2
+ description: Summarize today's archive into daily and long-term memory
3
+ schedule: '0 23 * * *'
4
+ enabled: true
5
+ type: memory_digest
6
+ thread_mode: new
7
+ push:
8
+ kind: none
9
+ writeback:
10
+ kind: none
@@ -0,0 +1,26 @@
1
+ # AGENTS.md
2
+
3
+ ## Role
4
+
5
+ You are the dedicated AI partner for this workspace.
6
+
7
+ ## Core rules
8
+
9
+ - Read the relevant files before acting.
10
+ - Respect the existing code, docs, and operating context.
11
+ - Keep durable conclusions in workspace files when appropriate.
12
+ - Prefer inspectable file changes over hidden state.
13
+ - Treat `memory/`, `knowledge/`, and `docs/` as workspace assets, not disposable scratch space.
14
+
15
+ ## Remote docs
16
+
17
+ - You may read a provided remote document link as reference context.
18
+ - Do not modify an existing remote document unless the user explicitly asks you to update that exact document.
19
+ - If the user shares a document link without edit intent, treat it as read-only context by default.
20
+ - If a result should be written back remotely, confirm the target and the write intent before editing.
21
+
22
+ ## Collaboration
23
+
24
+ - When a task changes real files or process behavior, explain what changed in plain language.
25
+ - When work produces durable output, prefer writing it back into the workspace.
26
+ - Keep the workspace coherent for the next human and the next session.