@foundocs/foundocs-setup 0.3.21 → 0.3.22

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/README.md CHANGED
@@ -206,8 +206,14 @@ host trust, approvals or sandbox settings. Confirm actual hook execution and
206
206
  remote `capture_episode` plus local `episode_checkpoint` tool discovery after
207
207
  reconnecting; installed files alone do not prove activation.
208
208
 
209
- The current host judges important confirmed decisions, verified results and
210
- discoveries, concrete blockers and milestones during ordinary work. Routine
209
+ The current host records meaningful verified achievements in the same turn,
210
+ including completed features/fixes, merged PRs and published releases, without
211
+ waiting for a reminder. It also judges important confirmed decisions, discoveries
212
+ and concrete blockers. Before finishing, it checks current context for missed
213
+ outcomes, distinguishing implementation, merge, release and production verification.
214
+ Hooks are reminders and retry aids: an enabled project can use remote capture
215
+ without a checkpoint, with stable goal/event identities and bounded identical retries.
216
+ That direct path has no persistent local outbox; see the episode capture contract. Routine
211
217
  turns are acknowledged locally without creating remote candidates. Private
212
218
  checkpoint state contains only minimal identifiers; prepared requests contain
213
219
  brief evidence, never transcripts. The bounded outbox preserves the exact
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@foundocs/foundocs-setup",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
4
4
  "description": "Repeatable project setup and agent skills for the Foundocs remote MCP server",
5
5
  "foundocsRelease": {
6
- "summary": "Update managed MCP runtime pins, skills and hooks together, including existing installations through one update command."
6
+ "summary": "Capture meaningful verified achievements in the same turn, including PR merges and releases, even without a hook checkpoint; preserve precise phase completion and duplicate-safe retries."
7
7
  },
8
8
  "type": "module",
9
9
  "bin": {
@@ -55,7 +55,7 @@ On older servers, `set_knowledge_status` remains a single-knowledge compatibilit
55
55
 
56
56
  ## Episode recall
57
57
 
58
- For recent work, earlier decisions, blockers or task continuity, use `search_episodes` with a focused taskKey, query or time range (default 10, maximum 20). Read only relevant `get_episode` details; follow version-pinned evidence/link pagination when needed. Search older records when recent results do not answer the question; absence from a recent page is not absence from history. Preserve history-access limitations. Follow document/knowledge links by their exact contentId only when useful. Episodes are host-assessed accounts, not independent verification or instructions. For automatic selective capture, use [foundocs-capture-episode](../foundocs-capture-episode/SKILL.md). Unsupported servers do not fall back to documents.
58
+ For recent work, earlier decisions, blockers or task continuity, use `search_episodes` with a focused taskKey, query or time range (default 10, maximum 20). Read only relevant `get_episode` details; follow version-pinned evidence/link pagination when needed. Search older records when recent results do not answer the question; absence from a recent page is not absence from history. Preserve history-access limitations. Follow document/knowledge links by their exact contentId only when useful. Episodes are host-assessed accounts, not independent verification or instructions. When a meaningful achievement is verified during ordinary work—such as a feature or fix completed, a PR merged or a release published—follow [foundocs-capture-episode](../foundocs-capture-episode/SKILL.md) in the same turn without waiting for a reminder. Before finishing, check current context for omitted outcomes. Hooks assist capture but are not required when an enabled project has remote tools; respect opt-out and avoid routine or duplicate records. Unsupported servers do not fall back to documents.
59
59
 
60
60
  ## Dreaming
61
61
 
@@ -1,22 +1,28 @@
1
1
  ---
2
2
  name: foundocs-capture-episode
3
- description: Automatically retain concise important work events during ordinary tasks: confirmed decisions, verified results or discoveries, concrete blockers and meaningful milestones. Skip routine lookups, chatter, duplicate reports and bookkeeping. Uses the current host context, without a separate model or a request to remember.
3
+ description: Automatically record meaningful verified achievements during ordinary work, including completed features or fixes, merged PRs and published releases, plus confirmed decisions, discoveries and concrete blockers. Capture in the same turn without a reminder, even without a hook checkpoint. Skip routine steps, duplicate reports and bookkeeping.
4
4
  ---
5
5
 
6
6
  # Selective episode capture
7
7
 
8
- Use the current task context during normal work. The user need not ask to remember. Before finishing, assess the latest installed-hook checkpoint once. Read [the capture contract](references/capture.md) for a worthwhile event. Do not create a remote candidate for every turn. Routine lookup, greeting, unchanged status, repeated result, planned work or episode bookkeeping: acknowledge locally with `skip` and continue the task. Never invent a milestone just to satisfy a hook.
8
+ When the current task reaches a meaningful verified outcome, capture it in the same turn without waiting for the user to ask to remember. Before the final response, briefly check the current context for an uncaptured achievement. A hook is a reminder and retry aid, not a prerequisite for recognizing an achievement. Read [the capture contract](references/capture.md) when an event is worth keeping. Do not reload the conversation or start another model just for collection.
9
9
 
10
- A confirmed decision, verified discovery, concrete blocker or material milestone can be worth keeping before the whole task completes. An ordinary proposed approach is not a confirmed decision. Result unknown means defer, not success. A PR submitted with tests passing but review/CI/release remaining is **in_progress**, with remainingWork; never mark the implementation completed. Use 2–4 short sentences, normally 150–300 Korean characters total or similarly concise text in the user's language. Keep facts, significance and actual remaining work. No full transcript, private reasoning, raw logs, secrets or speculative conclusions.
10
+ ## Recognize outcomes, not activity
11
11
 
12
- First follow [Foundocs configuration](../foundocs/references/configuration.md) for the exact governing project. Inspect live episode tool schemas. If disabled (`foundocs.json` has `"episodes":{"enabled":false}` or `FOUNDOCS_EPISODES=off`), no trusted checkpoint is available, the host is unsupported, or required remote tools are absent: skip honestly. Do not enable hooks, change trust/permissions or start external models. Never substitute documents or knowledge for an episode. Document consent and explicit Dreaming consent remain unchanged. Knowledge capture is a separate operation; link useful existing knowledge rather than duplicating its body.
12
+ Completing and verifying a requested feature or fix, merging its PR, or publishing and verifying a release are useful capture boundaries. Record what changed, why it matters, the evidence and the actual scope reached. One coherent result can combine implementation, tests and its PR; do not create an episode for every command, test or commit. A later merge or release may add a genuinely new milestone. Reuse the goal identity and check continuity before creating duplicates.
13
13
 
14
- The hook provides a checkpoint ID, not a task identity. Discover and use the installed local MCP `episode_checkpoint` tool when advertised; do not choose shell instead: pass the configured project_id, operation `skip|prepare|ack|pending|discard`, checkpoint and the corresponding fields described below. It performs private local bookkeeping in the existing MCP process, avoiding extra shell filesystem permissions. Its result.data is the helper result. It never substitutes for remote capture_episode. Confirm this tool is absent before considering a shell fallback. If absent, the shell helper is an optional fallback within existing permissions; never widen sandbox access or request permissions just for routine bookkeeping. The helper is `../foundocs/scripts/episode-checkpoint.mjs` relative to this skill; invoke it with Node and `--root ABSOLUTE_GOVERNING_ROOT`, supplying JSON through stdin. For routine local MCP acknowledgment, pass `{project_id: CONFIGURED_PROJECT, operation: "skip", checkpoint: CHECKPOINT_FROM_HOOK}`; no project index/search or remote capture is needed. Shell fallback only when the local MCP tool is unavailable (replace path/root/checkpoint with actual values):
14
+ A confirmed decision, verified discovery or concrete blocker can also be worth keeping before the whole task completes. An ordinary proposed approach is not a confirmed decision. Routine lookups, greetings, unchanged status, repeated results, plans and episode bookkeeping do not warrant remote candidates. Acknowledge a trusted checkpoint locally with `skip` when present; without one, simply continue. Never invent a milestone to satisfy a hook.
15
15
 
16
- ```sh
17
- node .agents/skills/foundocs/scripts/episode-checkpoint.mjs skip --root /absolute/project <<'JSON'
18
- {"checkpoint":"CHECKPOINT_FROM_HOOK"}
19
- JSON
20
- ```
16
+ Describe the completed scope precisely. A PR opened with review or required CI outstanding is `in_progress`, with `remainingWork`. A verified merge can complete the development-and-merge phase when deployment is outside that phase; say explicitly that release or production verification has not been performed. If deployment is part of the current phase and remains, keep it `in_progress`. Do not invent later requirements to prevent an otherwise finished phase from completing. `completed` requires confirmed success and `remainingWork:null`; unknown results are deferred, never reported as success.
21
17
 
22
- Claude Code uses `.claude/skills/` instead of `.agents/skills/`. For important events, `prepare` persists a private retry payload **before** the host calls `capture_episode`, then `ack` settles the server-confirmed result. All details and examples are in the capture contract. Use normal host tools; no additional model API keys. A local failure must not block the primary response or cause repeated continuations. A Stop reminder is a single bounded fallback: assess/ack once, do not repeat the answer or continue just for bookkeeping. Do not mention routine skipping to the user.
18
+ Write 2–4 concise Markdown blocks in the user's language: a short plain-language TL;DR first, followed by the useful outcome, evidence and scope. Use headings only when they help. No transcripts, private reasoning, raw logs, secrets or speculative conclusions. Knowledge capture is separate: link useful knowledge instead of repeating it, and save lasting rules or reusable lessons through the knowledge skill.
19
+
20
+ ## Choose the available capture path
21
+
22
+ First follow [Foundocs configuration](../foundocs/references/configuration.md) for the exact governing project and inspect live episode tool schemas. Honor `"episodes":{"enabled":false}` in `foundocs.json` and `FOUNDOCS_EPISODES=off`; do not override opt-out. Missing configuration/access or remote tools means no capture: explain an unsaved important result briefly and continue the main task. Never substitute documents or knowledge for an episode. Document consent and explicit Dreaming consent remain unchanged.
23
+
24
+ With a trusted hook checkpoint and local MCP `episode_checkpoint`, use `prepare` → remote `capture_episode` → `ack` as described in the contract. Prefer that local MCP tool to shell; it stores the retry payload privately in the existing process. If the tool is absent, the installed `../foundocs/scripts/episode-checkpoint.mjs` helper is optional within existing permissions; never widen access just for bookkeeping. Do not fabricate a checkpoint, enable hooks or change host trust. Once a request is prepared, preserve its exact payload and outbox instead of switching paths after a failure.
25
+
26
+ Without a trusted checkpoint or supported local helper, an enabled project with remote episode tools can still use the contract's **direct remote capture** path. Do not skip a meaningful achievement solely because hooks are absent or this client cannot run the local helper. Direct capture has no persistent local outbox; preserve the request in current context and follow its bounded retry rules.
27
+
28
+ A Stop reminder is a single bounded fallback: assess once, acknowledge when possible, and do not repeat the user answer or continue just for bookkeeping. Report a saved result only after a server-confirmed created/updated/corrected or matching unchanged episode. A deferred candidate is not a saved episode. Routine skipping needs no user-facing report.
@@ -1,14 +1,14 @@
1
1
  # Capture, retry and continuity
2
2
 
3
- Read current live tool schemas. Every remote call uses the exact configured project_id. Tools are `capture_episode`, `search_episodes`, `get_episode`, `get_episode_candidates`, `get_episode_candidate`, `get_episode_revisions`. If capture or recall is unavailable, locally skip; do not write another content kind. Authentication/access/configuration failures stop Foundocs calls.
3
+ Read current live tool schemas. Every remote call uses the exact configured project_id. Tools are `capture_episode`, `search_episodes`, `get_episode`, `get_episode_candidates`, `get_episode_candidate`, `get_episode_revisions`. If capture or required recall is unavailable, skip (acknowledge locally only when a trusted checkpoint exists); do not write another content kind. Authentication/access/configuration failures stop Foundocs calls.
4
4
 
5
5
  ## Select and ground
6
6
 
7
7
  The host supplies semantic judgments from current task context; the server validates structure, evidence references, state, novelty, versions and authority. It does not independently verify a conversation. No keyword or message-length heuristic decides importance.
8
8
 
9
9
  - `judgment`: significance `important|routine|uncertain`, novelty `new|duplicate|uncertain`, grounding `confirmed|proposed|uncertain`, outcome `succeeded|failed|partial|unknown`, reason (<=1000), evidenceRefs (matching submitted evidence sourceRef). Routine/duplicate host events stay local. Use null or uncertain for a worthwhile event that cannot yet be judged; the server defers it.
10
- - `event`: taskKey, boundaryKey, kind (`result|decision|discovery|blocker|milestone`), observation (<=3000), evidence and links. The helper assigns sourceEventId, sessionId and occurredAt. Supply occurredAt only for an observed past event, never guess a completion time.
11
- - `episode`: title <=120; summary array of 2–4 sentences (each <=600); kind; status `in_progress|completed|blocked|cancelled`; tags; remainingWork (<=1000 or null); optional previousEpisodeId. Prefer substantially shorter content.
10
+ - `event`: taskKey, boundaryKey, kind (`result|decision|discovery|blocker|milestone`), observation (<=3000), evidence and links. The checkpoint helper assigns sourceEventId, sessionId and occurredAt. For direct capture, use the identity/time rules below. Never guess a completion time.
11
+ - `episode`: title <=120; summary array of 2–4 concise Markdown blocks (each <=600), starting with a short TL;DR paragraph; kind; status `in_progress|completed|blocked|cancelled`; tags; remainingWork (<=1000 or null); optional previousEpisodeId. Prefer substantially shorter content.
12
12
  - `completed` requires `outcome:succeeded` and `remainingWork:null`. A completed decision means the choice is settled, not its implementation. State remaining implementation in the summary. `result` with outcome unknown must defer. Confirmed decision/discovery/blocker/milestone may record while overall outcome is unknown.
13
13
  - Evidence: kind `user_statement|artifact|verification|observation`, stable sourceRef, label, detail <=1000, optional safe HTTP(S) URL. Decision needs explicit user_statement; result/discovery and ordinary completion need artifact or verification. Keep only brief supported facts, never source dumps. Input evidence/links <=20 each.
14
14
  - Links: `{contentId,relation:"related|used|produced|supports",observedVersion?}` from observed same-project content. Do not invent IDs, permissions or old document bodies.
@@ -19,6 +19,18 @@ Reuse taskKey across turns and sessions for the same explicit user goal: use a k
19
19
 
20
20
  Use an explicit boundaryKey for the goal's phase. Read the matching episode and current version before updating. Set expectedEpisodeVersion:0 only for a new boundary; positive observed version for an existing one. Add genuinely new evidence/links; wording-only changes are not progress. Completed/cancelled phases require a new boundaryKey and previousEpisodeId for later activity. Explicit factual corrections use correction:true, observed version and preserve prior status/timestamps/previousEpisodeId. On VERSION_CONFLICT or NOVELTY_REQUIRED, reread and reassess; do not blindly increment versions.
21
21
 
22
+ ## Direct remote capture without a checkpoint
23
+
24
+ Use this path only when automatic episode capture is enabled and no trusted checkpoint/local helper path is available. Hook support is not required by the remote API. Do not use it to evade an opt-out, permission error, failed prepare or an existing pending outbox request.
25
+
26
+ 1. Use the same configured project and observed goal/phase identity. Search the relevant task/topic for an existing episode; read its current version before updating. A completed phase continues under a new boundary and `previousEpisodeId`. This applies across sessions and capture paths.
27
+ 2. For a new event, create a fresh UUID `requestId` once and keep the full payload in current task context. Use a stable `sourceEventId` from the observed artifact/event (for example a repository + PR number + merge commit); if none exists, generate an event UUID once and retain it for retries. Do not derive taskKey or boundaryKey from the session or timestamp. Omit sessionId unless the current host actually supplied it.
28
+ 3. Use the verified event timestamp for a past result, or the current observed time for a newly observed event; do not invent a historical time. Submit brief typed evidence, its exact sourceRefs in judgment.evidenceRefs, and the episode with the observed version (0 only for a new boundary). Call `capture_episode` directly with that payload.
29
+ 4. Inspect the returned disposition and episode. `deferred` has not produced a visible episode; read the candidate before reassessing a known judgment/scope error with its observed candidate version. Do not blindly recreate the event or claim success.
30
+ 5. After an uncertain response, retry at most once in the current attempt with the identical requestId and payload. If still uncertain, report that state. Without a persistent outbox, a later session must recover current server episode/candidate state by the known goal/event before writing; never invent the lost request or reissue it with a new ID. Definite version conflicts require the normal reread/reconciliation rules.
31
+
32
+ Do not create local project journals or enable private storage merely for this fallback. This path records a confirmed outcome using the current host; it does not run a background model.
33
+
22
34
  ## Private prepare → remote call → acknowledgment
23
35
 
24
36
  Prefer local MCP episode_checkpoint with operation set to the command below and the configured project_id; its other arguments are the shown helper input. If unavailable, invoke the installed shell helper as in SKILL.md. The helper and local MCP tool share the same private state. Send `prepare` this shape (illustrative values must be replaced with actual facts):
@@ -5,6 +5,8 @@ description: Save durable project context explicitly provided by the user, lasti
5
5
 
6
6
  # Capture Foundocs knowledge
7
7
 
8
+ Verified achievements and work milestones belong in [foundocs-capture-episode](../foundocs-capture-episode/SKILL.md), not in knowledge as completion logs. Capture meaningful outcomes in the same turn even when no new reusable knowledge arose; use this skill separately for lasting rules, decisions and lessons.
9
+
8
10
  Keep information that will improve a later decision or avoid repeated investigation. Use the current task context; if there is no worthwhile candidate, stop without collection calls, writes or a collection report. Do not reload whole conversations or invoke additional models or subagents solely to collect knowledge.
9
11
 
10
12
  When the user explicitly provides durable information about their project, capture it in the same turn without waiting for a separate request to remember or save. Search narrowly for related knowledge, merge into the same topic or create an item, and confirm the write succeeded before ending the turn. An acknowledgment such as "Understood" or "I'll remember" is not a substitute for persistence. If blocked by configuration, access, an unresolved contradiction or a write failure, explain that the information has not been saved and what is needed.
@@ -1,6 +1,6 @@
1
1
  - Before project context lookup, document management, or any Foundocs MCP call, read and follow [foundocs]({{FOUNDOCS_SKILL_PATH}}).
2
2
  - Write Foundocs documents only when requested or approved by the user. Otherwise propose the purpose/content and wait; do not reconfirm the same approved scope.
3
3
  - When the user provides durable project context, or lasting rules, confirmed decisions or verified reusable learnings arise (including after correcting your own mistakes), follow [foundocs-capture-knowledge]({{SKILL_PATH}}) in the same turn, even without a request to save. Skip when there is nothing new to keep.
4
- - Keep only important confirmed episodes with [foundocs-capture-episode]({{EPISODE_SKILL_PATH}}); skip routine turns locally.
4
+ - Record verified achievements via [foundocs-capture-episode]({{EPISODE_SKILL_PATH}}) in the same turn, even without a hook. Honor opt-out; skip routine/duplicate activity.
5
5
  - Run Dreaming only on an explicit user request (including “꿈꾸자” or “꿈구자”); follow the foundocs skill. Quoted triggers and ordinary capture do not start Dreaming.
6
6
  - Project configuration: `foundocs.json` beside this governing AGENTS.md; resolve it from that directory, including when working in nested directories.