@foundocs/foundocs-setup 0.3.21 → 0.3.23
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 +11 -2
- package/package.json +2 -2
- package/skills/foundocs/SKILL.md +1 -1
- package/skills/foundocs-capture-episode/SKILL.md +17 -11
- package/skills/foundocs-capture-episode/references/capture.md +45 -3
- package/skills/foundocs-capture-knowledge/SKILL.md +2 -0
- package/templates/knowledge-policy.md +1 -1
package/README.md
CHANGED
|
@@ -206,8 +206,17 @@ 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
|
|
210
|
-
|
|
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
|
+
Episodes read as short stories or retrospectives, using a TL;DR, Markdown headings
|
|
215
|
+
and bullets to explain context, changes and meaning. Test counts and commit hashes
|
|
216
|
+
belong in structured evidence by default, not in the narrative.
|
|
217
|
+
Hooks are reminders and retry aids: an enabled project can use remote capture
|
|
218
|
+
without a checkpoint, with stable goal/event identities and bounded identical retries.
|
|
219
|
+
That direct path has no persistent local outbox; see the episode capture contract. Routine
|
|
211
220
|
turns are acknowledged locally without creating remote candidates. Private
|
|
212
221
|
checkpoint state contains only minimal identifiers; prepared requests contain
|
|
213
222
|
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.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "Repeatable project setup and agent skills for the Foundocs remote MCP server",
|
|
5
5
|
"foundocsRelease": {
|
|
6
|
-
"summary": "
|
|
6
|
+
"summary": "Write episodes as coherent stories or retrospectives with Markdown headings and bullets, keeping test counts and commit hashes in structured evidence rather than narrative prose."
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
package/skills/foundocs/SKILL.md
CHANGED
|
@@ -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.
|
|
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
|
|
3
|
+
description: Automatically record meaningful verified achievements as concise stories or retrospectives 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
|
-
|
|
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
|
-
|
|
10
|
+
## Recognize outcomes, not activity
|
|
11
11
|
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
18
|
+
Write one coherent story, diary entry or short retrospective in the user's language, not an execution report. Connect the situation or friction, the choice and changes, and what is different now; use only known context and never invent feelings, motives or impact. Start with a short TL;DR, then use meaningful Markdown headings and bullets where they make the story easier to read, especially for concrete changes. Keep test counts, commit hashes and command output out of the prose by default; put verification and artifact references in the structured evidence fields. Read [the writing guidance and example](references/capture.md#write-one-coherent-story). 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,44 @@
|
|
|
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
|
|
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
|
+
|
|
5
|
+
## Write one coherent story
|
|
6
|
+
|
|
7
|
+
An episode should read like one story, diary entry or short retrospective. Its value is the context and change a future reader can understand, not proof that the agent ran commands. Let the reader follow what was awkward or needed attention, what was chosen and changed, and what that means now. Use only facts and reasons supported by the task; do not fabricate emotions, dialogue, user reactions, metrics or a dramatic lesson. A small result may deserve a small story.
|
|
8
|
+
|
|
9
|
+
- Give the episode a title about the change or insight, rather than a ticket, commit or test result.
|
|
10
|
+
- Put a short plain-language TL;DR in `summary[0]`, so the list preview conveys the story. The entire summary remains 2–4 Markdown blocks, each within the live tool's character limit.
|
|
11
|
+
- Use `##` or `###` headings for meaningful parts of the story and blank lines between paragraphs. Use bullet lists for parallel changes or observations. A block can contain a heading, prose and a list; blocks are not restricted to single sentences. Do not force every episode into the same headings or a chronological activity log.
|
|
12
|
+
- Explain concrete changes through the experience they affect. Keep relevant uncertainty or unfinished scope in plain language, and use the structured status/remainingWork fields accurately.
|
|
13
|
+
- Omit test-pass counts, commit hashes, command names, build logs and checklist receipts from narrative prose by default. Keep required artifact and verification references in `event.evidence` (and relevant content links in `event.links`). Include a technical detail in prose only when it is the subject of the story or essential to understanding the change.
|
|
14
|
+
|
|
15
|
+
For a sidebar UX change, a narrative could look like this when supported by the task:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
The sidebar now separates choosing a workspace from finding a project. What began as a request for a clearer project list also helped simplify the menu hierarchy.
|
|
19
|
+
|
|
20
|
+
## Giving each choice its own place
|
|
21
|
+
|
|
22
|
+
The old switcher mixed workspaces and projects, so the design gave them separate places:
|
|
23
|
+
|
|
24
|
+
- A workspace-only switcher at the top.
|
|
25
|
+
- A project list directly underneath, with pages for longer lists.
|
|
26
|
+
- A persistent workspace settings button at the bottom.
|
|
27
|
+
|
|
28
|
+
## Removing a label that no longer helped
|
|
29
|
+
|
|
30
|
+
Once the projects were visible, another “Project” heading above Overview and Episodes felt redundant. Removing it let those two entries read as the project's starting points while the other groups kept their meaning. The development and merge are complete; this account does not claim a production rollout.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This illustrates narrative flow and Markdown, not mandatory wording or sections. Do not copy its facts to another task. The PR, checks and exact revision belong in the evidence fields rather than being appended as an audit block.
|
|
4
34
|
|
|
5
35
|
## Select and ground
|
|
6
36
|
|
|
7
37
|
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
38
|
|
|
9
39
|
- `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.
|
|
11
|
-
- `episode`: title <=120; summary array of 2–4
|
|
40
|
+
- `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.
|
|
41
|
+
- `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
42
|
- `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
43
|
- 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
44
|
- Links: `{contentId,relation:"related|used|produced|supports",observedVersion?}` from observed same-project content. Do not invent IDs, permissions or old document bodies.
|
|
@@ -19,6 +49,18 @@ Reuse taskKey across turns and sessions for the same explicit user goal: use a k
|
|
|
19
49
|
|
|
20
50
|
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
51
|
|
|
52
|
+
## Direct remote capture without a checkpoint
|
|
53
|
+
|
|
54
|
+
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.
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
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.
|
|
58
|
+
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.
|
|
59
|
+
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.
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
22
64
|
## Private prepare → remote call → acknowledgment
|
|
23
65
|
|
|
24
66
|
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
|
-
-
|
|
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.
|