feat: refactor work item file retrieval to use Python script for improved error handling and readability
This commit is contained in:
@@ -19,7 +19,28 @@ Read active profile, if present:
|
||||
|
||||
Relevant active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
User request:
|
||||
|
||||
|
||||
@@ -24,7 +24,28 @@ Active profile, if present:
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
User request:
|
||||
|
||||
|
||||
@@ -6,34 +6,17 @@ Load and internalize the active context for this Fidelity workspace before answe
|
||||
|
||||
Use these files as the baseline context:
|
||||
|
||||
@README.md
|
||||
@core/README.md
|
||||
@core/memory/operational-memory.md
|
||||
@core/integrations/memory-vault-model.md
|
||||
@core/integrations/communication-model.md
|
||||
@profiles/fidelity/profile.md
|
||||
@agent-memory/README.md
|
||||
@agent-memory/behavior/agent-behavior.md
|
||||
@agent-memory/behavior/learning-sessions.md
|
||||
@agent-memory/behavior/self-maintenance.md
|
||||
@agent-memory/memory/operational-memory.md
|
||||
@agent-memory/integrations/memory-interface.md
|
||||
@agent-memory/integrations/obsidian.md
|
||||
@agent-memory/integrations/communication-sources.md
|
||||
@agent-memory/memory/promotion-rules.md
|
||||
@agent-memory/integrations/technical-verification.md
|
||||
@project-knowledge/00-start/start-here.md
|
||||
@project-knowledge/01-current/current-work.md
|
||||
@project-knowledge/01-current/work-items.md
|
||||
@project-knowledge/07-maps/current-work.md
|
||||
@project-knowledge/07-maps/fidelity-domain.md
|
||||
@project-knowledge/07-maps/work-items.md
|
||||
@project-knowledge/07-maps/people.md
|
||||
@project-knowledge/03-context/project.md
|
||||
@project-knowledge/03-context/process/communication.md
|
||||
@agent-memory/integrations/technical-verification.md
|
||||
@agent-memory/workflows/ai-to-ai-prompting.md
|
||||
@project-knowledge/03-context/process/jira-story-rules.md
|
||||
@agent-memory/workflows/workspace-model.md
|
||||
@agent-memory/behavior/agent-behavior.md
|
||||
@agent-memory/memory/promotion-rules.md
|
||||
@project-knowledge/03-context/ios/index.md
|
||||
@project-knowledge/04-people/manager.md
|
||||
@project-knowledge/04-people/index.md
|
||||
|
||||
@@ -45,13 +28,34 @@ Today's canonical daily note, if present:
|
||||
|
||||
!`if [ -f project-knowledge/06-daily/$(date +%F).md ]; then cat project-knowledge/06-daily/$(date +%F).md; else echo "No daily note exists for today yet."; fi`
|
||||
|
||||
Recent daily notes available:
|
||||
Latest daily notes available:
|
||||
|
||||
!`if [ -d project-knowledge/06-daily ]; then ls -1 project-knowledge/06-daily 2>/dev/null | sort | tail -n 5; else echo "No daily notes directory available."; fi`
|
||||
!`if [ -d project-knowledge/06-daily ]; then ls -1 project-knowledge/06-daily 2>/dev/null | sort | tail -n 3; else echo "No daily notes directory available."; fi`
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
Latest Mattermost context, if available:
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ Read:
|
||||
@project-knowledge/01-current/current-work.md
|
||||
@project-knowledge/01-current/work-items.md
|
||||
@project-knowledge/03-context/project.md
|
||||
@project-knowledge/03-context/workstreams/index.md
|
||||
@project-knowledge/03-context/process/communication.md
|
||||
@project-knowledge/04-people/manager.md
|
||||
@project-knowledge/04-people/index.md
|
||||
@@ -27,7 +26,28 @@ Latest Mattermost context, if available:
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
User draft or rough notes:
|
||||
|
||||
|
||||
@@ -4,18 +4,24 @@ description: Draft a standup from the latest Fidelity workspace context
|
||||
|
||||
Generate a standup update using the latest workspace state.
|
||||
|
||||
First, refresh Mattermost context before drafting:
|
||||
First, refresh previous-workday Mattermost context before drafting:
|
||||
|
||||
!`python3 - <<'PY'
|
||||
import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from datetime import date
|
||||
|
||||
cmd = os.environ.get("AIW_MATTERMOST_SYNC_CMD") or os.environ.get("FIDELITY_MATTERMOST_SYNC_CMD")
|
||||
if cmd:
|
||||
today = date.today().isoformat()
|
||||
if Path("scripts/mattermost/sync.sh").is_file():
|
||||
result = subprocess.run(
|
||||
["bash", "scripts/mattermost/sync.sh", "--previous-workday", "--today", today],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
elif cmd:
|
||||
result = subprocess.run(["bash", "-lc", cmd], capture_output=True, text=True)
|
||||
elif Path("scripts/mattermost/sync.sh").is_file():
|
||||
result = subprocess.run(["bash", "scripts/mattermost/sync.sh"], capture_output=True, text=True)
|
||||
else:
|
||||
print("No Mattermost sync command configured.")
|
||||
raise SystemExit(0)
|
||||
@@ -34,28 +40,17 @@ PY`
|
||||
Read:
|
||||
|
||||
@prompts/standup.md
|
||||
@project-knowledge/00-start/start-here.md
|
||||
@project-knowledge/01-current/current-work.md
|
||||
@project-knowledge/01-current/work-items.md
|
||||
@project-knowledge/03-context/project.md
|
||||
@project-knowledge/03-context/workstreams/index.md
|
||||
@project-knowledge/03-context/workstreams/flow-page-references.md
|
||||
@project-knowledge/03-context/process/communication.md
|
||||
@project-knowledge/03-context/process/jira-story-rules.md
|
||||
@project-knowledge/04-people/manager.md
|
||||
|
||||
Previous workday Mattermost context, if present:
|
||||
|
||||
!`bash scripts/mattermost/sync.sh --previous-workday --today "$(date +%F)"`
|
||||
|
||||
Today's log, if present:
|
||||
|
||||
!`if [ -f project-knowledge/06-daily/$(date +%F).md ]; then cat project-knowledge/06-daily/$(date +%F).md; else echo "No daily note exists for today yet."; fi`
|
||||
|
||||
Latest Mattermost context, preferring inbox and falling back to generated JSONL:
|
||||
|
||||
!`if [ -s ai/inbox/mattermost-latest.md ]; then cat ai/inbox/mattermost-latest.md; elif [ -s scripts/mattermost/generated/mattermost_context.jsonl ]; then cat scripts/mattermost/generated/mattermost_context.jsonl; else echo "No Mattermost context available."; fi`
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`python3 - <<'PY'
|
||||
|
||||
@@ -40,7 +40,28 @@ Latest Mattermost context, if available:
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
Requirements:
|
||||
|
||||
|
||||
@@ -6,37 +6,20 @@ Load and internalize the reusable workspace core and the active project context
|
||||
|
||||
Read core:
|
||||
|
||||
@core/README.md
|
||||
@core/memory/operational-memory.md
|
||||
@core/integrations/memory-vault-model.md
|
||||
@core/integrations/communication-model.md
|
||||
@core/profiles/create-project-profile.md
|
||||
@agent-memory/README.md
|
||||
@profiles/fidelity/profile.md
|
||||
@agent-memory/behavior/agent-behavior.md
|
||||
@agent-memory/behavior/learning-sessions.md
|
||||
@agent-memory/behavior/self-maintenance.md
|
||||
@agent-memory/memory/operational-memory.md
|
||||
@agent-memory/integrations/memory-interface.md
|
||||
@agent-memory/integrations/obsidian.md
|
||||
@agent-memory/integrations/communication-sources.md
|
||||
@agent-memory/memory/promotion-rules.md
|
||||
@agent-memory/integrations/technical-verification.md
|
||||
|
||||
Read active workspace memory:
|
||||
|
||||
@README.md
|
||||
@project-knowledge/00-start/start-here.md
|
||||
@project-knowledge/00-start/onboarding.md
|
||||
@project-knowledge/01-current/current-work.md
|
||||
@project-knowledge/01-current/work-items.md
|
||||
@project-knowledge/07-maps/current-work.md
|
||||
@project-knowledge/07-maps/fidelity-domain.md
|
||||
@project-knowledge/07-maps/work-items.md
|
||||
@project-knowledge/07-maps/people.md
|
||||
@project-knowledge/03-context/project.md
|
||||
@project-knowledge/03-context/process/communication.md
|
||||
@agent-memory/integrations/technical-verification.md
|
||||
@agent-memory/memory/context-maintenance.md
|
||||
@agent-memory/workflows/workspace-model.md
|
||||
@agent-memory/behavior/agent-behavior.md
|
||||
@agent-memory/memory/promotion-rules.md
|
||||
@project-knowledge/03-context/ios/index.md
|
||||
@project-knowledge/04-people/manager.md
|
||||
@project-knowledge/04-people/index.md
|
||||
|
||||
@@ -52,13 +35,34 @@ Today's canonical daily note, if present:
|
||||
|
||||
!`if [ -f project-knowledge/06-daily/$(date +%F).md ]; then cat project-knowledge/06-daily/$(date +%F).md; else echo "No daily note exists for today yet."; fi`
|
||||
|
||||
Recent daily notes available:
|
||||
Latest daily notes available:
|
||||
|
||||
!`if [ -d project-knowledge/06-daily ]; then ls -1 project-knowledge/06-daily 2>/dev/null | sort | tail -n 5; else echo "No daily notes directory available."; fi`
|
||||
!`if [ -d project-knowledge/06-daily ]; then ls -1 project-knowledge/06-daily 2>/dev/null | sort | tail -n 3; else echo "No daily notes directory available."; fi`
|
||||
|
||||
Detailed active work item files, if available:
|
||||
|
||||
!`if [ -d project-knowledge/02-work-items ]; then for f in project-knowledge/02-work-items/*.md; do case "$f" in *README.md|*index.md) continue;; esac; echo "\n### $f"; cat "$f"; done; else echo "No work item files available."; fi`
|
||||
!`python3 - <<'PY'
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
summary = Path("project-knowledge/01-current/work-items.md")
|
||||
if not summary.is_file():
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
text = summary.read_text()
|
||||
paths = re.findall(r"Detail: `(project-knowledge/02-work-items/[^`]+)`", text)
|
||||
if not paths:
|
||||
print("No work item files available.")
|
||||
raise SystemExit(0)
|
||||
|
||||
for rel in paths:
|
||||
path = Path(rel)
|
||||
if not path.is_file():
|
||||
continue
|
||||
print(f"\n### {rel}")
|
||||
print(path.read_text())
|
||||
PY`
|
||||
|
||||
Latest communication inbox, if available:
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Behavior rules:
|
||||
- If missing context materially affects the answer, ask a concise clarification question instead of inventing details.
|
||||
- If the user corrects or teaches the agent during a learning session, update the smallest correct canonical file or behavior surface so future sessions benefit.
|
||||
- For any meaningful prompt, decide whether the interaction adds, corrects, or sharpens project memory.
|
||||
- When the user provides new durable information, update the right workspace files before or while answering.
|
||||
- When the user provides new durable information, update the right workspace files during the same turn when the destination is clear, but do not delay a straightforward answer just to create or reorganize memory.
|
||||
- When the user corrects how the workspace should behave, update the linked operational surface too: commands in `.opencode/commands/`, prompt templates in `prompts/`, agent rules in `AGENTS.md` or `.opencode/agents/`, skills in `.opencode/skills/`, and agent operating rules in `agent-memory/` when those files control the behavior.
|
||||
- If existing context is stale, correct it directly instead of leaving conflicting versions.
|
||||
- Promote information carefully:
|
||||
@@ -54,6 +54,8 @@ Behavior rules:
|
||||
- Write canonical memory to `project-knowledge/`.
|
||||
- Update preexisting memory when a new prompt clarifies or corrects something already stored.
|
||||
- Do not wait for a dedicated sync command if the correct memory update is already obvious.
|
||||
- For analysis, drafting, review, or translation prompts, answer first and persist second unless saving the fact is required to produce the answer safely.
|
||||
- Avoid creating brand-new canonical notes in the middle of a response unless the user explicitly asked for persistence or the new note is the smallest correct update.
|
||||
- Do not leave behavior-only corrections only in daily logs. If a correction should affect future output, update the tool or instruction that produces that output.
|
||||
- If the memory interface or Obsidian adapter fails, continue with direct Markdown operations when safe and do not promote the failure as project memory.
|
||||
- Do not over-promote uncertain information. Keep uncertain items in the daily log.
|
||||
|
||||
@@ -13,33 +13,21 @@ export const FidelityCompaction = async ({ directory }) => {
|
||||
return {
|
||||
"experimental.session.compacting": async (_input, output) => {
|
||||
const baseFiles = [
|
||||
"README.md",
|
||||
"core/README.md",
|
||||
"core/memory/operational-memory.md",
|
||||
"core/integrations/memory-vault-model.md",
|
||||
"core/integrations/communication-model.md",
|
||||
"profiles/fidelity/profile.md",
|
||||
"agent-memory/README.md",
|
||||
"agent-memory/behavior/agent-behavior.md",
|
||||
"agent-memory/behavior/learning-sessions.md",
|
||||
"agent-memory/memory/promotion-rules.md",
|
||||
"agent-memory/memory/context-maintenance.md",
|
||||
"agent-memory/integrations/technical-verification.md",
|
||||
"agent-memory/workflows/workspace-model.md",
|
||||
"agent-memory/workflows/ai-to-ai-prompting.md",
|
||||
"project-knowledge/00-start/start-here.md",
|
||||
"project-knowledge/01-current/current-work.md",
|
||||
"project-knowledge/01-current/work-items.md",
|
||||
"project-knowledge/03-context/project.md",
|
||||
"project-knowledge/03-context/ios/index.md",
|
||||
"project-knowledge/03-context/ios/current-practices.md",
|
||||
"project-knowledge/03-context/ios/project-swift-guidance.md",
|
||||
"project-knowledge/03-context/systems/index.md",
|
||||
"project-knowledge/03-context/workstreams/index.md",
|
||||
"project-knowledge/03-context/process/communication.md",
|
||||
"project-knowledge/03-context/ios/index.md",
|
||||
"project-knowledge/03-context/ios/project-swift-guidance.md",
|
||||
"project-knowledge/04-people/manager.md",
|
||||
"project-knowledge/04-people/index.md",
|
||||
"project-knowledge/05-decisions/rest-vs-graphql.md",
|
||||
"project-knowledge/05-decisions/discourse-handling.md",
|
||||
]
|
||||
|
||||
const sections = []
|
||||
@@ -56,7 +44,7 @@ export const FidelityCompaction = async ({ directory }) => {
|
||||
const logs = (await readdir(logsDir))
|
||||
.filter((name) => name.endsWith(".md"))
|
||||
.sort()
|
||||
.slice(-2)
|
||||
.slice(-1)
|
||||
|
||||
for (const logName of logs) {
|
||||
const content = await safeRead(path.join(logsDir, logName))
|
||||
|
||||
40
AGENTS.md
40
AGENTS.md
@@ -9,40 +9,29 @@ OpenCode should treat this project as a persistent context layer used to:
|
||||
- draft standups and Mattermost messages
|
||||
- improve communication for the current manager or stakeholder in natural professional English
|
||||
|
||||
## Always-Loaded Context
|
||||
## Hot Context
|
||||
|
||||
The detailed operating rules live in:
|
||||
Keep the always-loaded context small. The hot set is:
|
||||
|
||||
- `project-knowledge/00-start/start-here.md`
|
||||
- `agent-memory/README.md`
|
||||
- `profiles/fidelity/profile.md`
|
||||
- `agent-memory/behavior/agent-behavior.md`
|
||||
- `agent-memory/behavior/learning-sessions.md`
|
||||
- `agent-memory/behavior/self-maintenance.md`
|
||||
- `agent-memory/memory/operational-memory.md`
|
||||
- `agent-memory/memory/context-maintenance.md`
|
||||
- `agent-memory/workflows/workspace-architecture.md`
|
||||
- `agent-memory/memory/promotion-rules.md`
|
||||
- `agent-memory/integrations/technical-verification.md`
|
||||
- `agent-memory/workflows/ai-to-ai-prompting.md`
|
||||
- `project-knowledge/00-start/start-here.md`
|
||||
- `project-knowledge/01-current/current-work.md`
|
||||
- `project-knowledge/01-current/work-items.md`
|
||||
- `project-knowledge/03-context/project.md`
|
||||
- `project-knowledge/03-context/ios/index.md`
|
||||
- `project-knowledge/03-context/ios/current-practices.md`
|
||||
- `project-knowledge/03-context/ios/project-swift-guidance.md`
|
||||
- `project-knowledge/03-context/systems/index.md`
|
||||
- `project-knowledge/03-context/workstreams/index.md`
|
||||
- `project-knowledge/03-context/process/communication.md`
|
||||
- `agent-memory/integrations/technical-verification.md`
|
||||
- `agent-memory/workflows/ai-to-ai-prompting.md`
|
||||
- `agent-memory/workflows/workspace-model.md`
|
||||
- `agent-memory/memory/promotion-rules.md`
|
||||
- `agent-memory/integrations/memory-interface.md`
|
||||
- `agent-memory/integrations/obsidian.md`
|
||||
- `agent-memory/integrations/communication-sources.md`
|
||||
- `core/integrations/memory-vault-model.md`
|
||||
- `project-knowledge/03-context/ios/index.md`
|
||||
- `project-knowledge/03-context/ios/project-swift-guidance.md`
|
||||
- `project-knowledge/04-people/manager.md`
|
||||
- `project-knowledge/04-people/index.md`
|
||||
- `project-knowledge/02-work-items/index.md`
|
||||
|
||||
These are also loaded through `opencode.json`.
|
||||
Load everything else lazily when the task actually needs it.
|
||||
|
||||
Do not preemptively load broad context sets, all work-item files, or all process notes unless the current task clearly requires them.
|
||||
|
||||
## Required Behavior
|
||||
|
||||
@@ -53,6 +42,7 @@ These are also loaded through `opencode.json`.
|
||||
- Keep Obsidian Bases clean: templates in `project-knowledge/09-templates/` must not be treated as real notes, and role mapping files such as `project-knowledge/04-people/manager.md` must not be typed as people.
|
||||
- Maintain useful project-note properties when editing canonical notes, especially work-item relationships (`systems`, `workstreams`, `people`, `related`) and daily note fields (`focus`, `work-items`, `blockers`).
|
||||
- Before answering questions that depend on current work state, inspect `project-knowledge/01-current/current-work.md` and the latest relevant daily note under `project-knowledge/06-daily/`.
|
||||
- Prefer lazy loading over eager loading. Pull in only the smallest relevant files for the active task.
|
||||
- If `ai/inbox/mattermost-latest.md` exists, inspect it for fresher communication context before answering standup, status, or manager-message prompts.
|
||||
- If the user asks for the latest/last/recent Mattermost message, the latest message from Jeff/current manager, or what someone just said, synchronize Mattermost first instead of relying on existing inbox context.
|
||||
- If automatic refresh is uncertain, use the explicit latest-message flow: run the Mattermost sync command, then answer from the refreshed inbox only.
|
||||
@@ -62,6 +52,9 @@ These are also loaded through `opencode.json`.
|
||||
- Ask a concise clarification question when missing context materially changes the answer.
|
||||
- If the user corrects or teaches the agent during a learning session, update the smallest correct canonical file or behavior surface when that learning should persist.
|
||||
- For any meaningful prompt, decide whether the interaction introduces or corrects project memory.
|
||||
- For analysis, review, translation, or drafting requests, answer first unless a memory update is required to avoid losing a clear durable fact.
|
||||
- Do not create new canonical notes before answering unless the user asked to save the information, the destination is obvious, and the write is small and non-blocking.
|
||||
- Prefer updating existing canonical files over creating new files during the critical path of a user-facing answer.
|
||||
- If a sync command, extraction script, or inbox refresh fails, do not update logs, state, or context files from that failed attempt.
|
||||
- Treat sync failures as operational errors, not project context.
|
||||
- `mattermost-sync` should automatically promote high-confidence project facts without asking what to promote.
|
||||
@@ -76,6 +69,7 @@ These are also loaded through `opencode.json`.
|
||||
- If a new prompt corrects prior understanding, update the canonical file directly instead of keeping both versions alive.
|
||||
- Do not ask what should be saved when the correct destination is already clear.
|
||||
- If the user provides durable new facts, update the appropriate context files instead of leaving the new information only in chat history.
|
||||
- When the prompt is primarily asking for analysis of a screenshot, message, or document, do not interrupt the answer to perform proactive note creation unless that persistence is the explicit goal.
|
||||
- When creating a new canonical note from a known type, prefer `scripts/memory/memory.sh create <type> <slug> [title]` so type-to-folder routing stays centralized.
|
||||
- If the Obsidian CLI adapter fails, fall back to direct Markdown operations and treat the failure as tooling status, not project context.
|
||||
- If a previous context file is now stale or inaccurate, update that file directly.
|
||||
|
||||
@@ -15,7 +15,7 @@ Make workspace memory maintenance part of the agent's normal job, not a separate
|
||||
|
||||
## Default Agent Behavior (Real-Time Auto-Documentation)
|
||||
|
||||
For EVERY meaningful prompt, the agent MUST execute a real-time auto-documentation loop. It is not an optional workflow; it is the core of the agent's job.
|
||||
For every meaningful prompt, the agent must evaluate whether a memory update is needed in the same turn. Auto-documentation is part of the job, but it must not dominate the critical path of simple user-facing answers.
|
||||
|
||||
This applies to:
|
||||
|
||||
@@ -27,10 +27,13 @@ This applies to:
|
||||
- debugging discussions
|
||||
- corrections to previous understanding
|
||||
|
||||
The agent MUST NOT wait for a separate promotion command. The agent MUST proactively use file editing tools to update `project-knowledge/` (including 01-current, 02-work-items, 03-context, 04-people, 06-daily) within the SAME conversational turn if new information is detected or if prior context becomes stale.
|
||||
The agent must not wait for a separate promotion command. The agent should proactively update `project-knowledge/` (including 01-current, 02-work-items, 03-context, 04-people, 06-daily) within the same conversational turn when new information is clear, durable, and the destination is obvious.
|
||||
|
||||
- When editing `project-knowledge/`, write as a human engineer maintaining shared project documentation.
|
||||
- Keep agent-operating logic out of `project-knowledge/`; store that logic in prompts, commands, skills, agents, or `agent-memory/`.
|
||||
- Answer-first rule: when the user's main goal is analysis, review, translation, or drafting, answer first unless persistence is required to avoid losing a clear durable fact.
|
||||
- Do not create a brand-new canonical note during the critical path of the answer unless the user explicitly asked to save the fact or the new note is the smallest correct update.
|
||||
- Prefer updating an existing canonical note over creating a new file when both are valid.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"default_agent": "fidelity",
|
||||
"share": "manual",
|
||||
"snapshot": false,
|
||||
"watcher": {
|
||||
"ignore": [
|
||||
".git/**",
|
||||
"archives/**",
|
||||
".opencode/node_modules/**",
|
||||
"scripts/*/generated/**",
|
||||
"project-knowledge/attachments/**"
|
||||
]
|
||||
},
|
||||
"mcp": {
|
||||
"obsidian": {
|
||||
"type": "local",
|
||||
@@ -53,51 +63,20 @@
|
||||
"doom_loop": "ask"
|
||||
},
|
||||
"instructions": [
|
||||
"./README.md",
|
||||
"./core/README.md",
|
||||
"./core/memory/operational-memory.md",
|
||||
"./core/integrations/memory-vault-model.md",
|
||||
"./core/integrations/communication-model.md",
|
||||
"./core/integrations/obsidian-model.md",
|
||||
"./core/profiles/create-project-profile.md",
|
||||
"./profiles/fidelity/profile.md",
|
||||
"./agent-memory/README.md",
|
||||
"./agent-memory/behavior/agent-behavior.md",
|
||||
"./agent-memory/behavior/learning-sessions.md",
|
||||
"./agent-memory/behavior/self-maintenance.md",
|
||||
"./agent-memory/memory/operational-memory.md",
|
||||
"./agent-memory/memory/promotion-rules.md",
|
||||
"./agent-memory/memory/context-maintenance.md",
|
||||
"./agent-memory/integrations/memory-interface.md",
|
||||
"./agent-memory/integrations/obsidian.md",
|
||||
"./agent-memory/integrations/communication-sources.md",
|
||||
"./agent-memory/integrations/technical-verification.md",
|
||||
"./agent-memory/workflows/ai-to-ai-prompting.md",
|
||||
"./agent-memory/workflows/workspace-model.md",
|
||||
"./agent-memory/workflows/workspace-architecture.md",
|
||||
"./project-knowledge/00-start/start-here.md",
|
||||
"./project-knowledge/00-start/onboarding.md",
|
||||
"./project-knowledge/00-start/glossary.md",
|
||||
"./project-knowledge/01-current/current-work.md",
|
||||
"./project-knowledge/01-current/work-items.md",
|
||||
"./project-knowledge/07-maps/current-work.md",
|
||||
"./project-knowledge/07-maps/fidelity-domain.md",
|
||||
"./project-knowledge/07-maps/work-items.md",
|
||||
"./project-knowledge/07-maps/people.md",
|
||||
"./project-knowledge/03-context/project.md",
|
||||
"./project-knowledge/03-context/process/communication.md",
|
||||
"./project-knowledge/03-context/process/jira-story-rules.md",
|
||||
"./project-knowledge/03-context/process/communication-rules.md",
|
||||
"./project-knowledge/03-context/process/pull-requests.md",
|
||||
"./project-knowledge/03-context/ios/index.md",
|
||||
"./project-knowledge/03-context/ios/current-practices.md",
|
||||
"./project-knowledge/03-context/ios/project-swift-guidance.md",
|
||||
"./project-knowledge/03-context/systems/index.md",
|
||||
"./project-knowledge/03-context/workstreams/index.md",
|
||||
"./project-knowledge/03-context/workstreams/flow-page-references.md",
|
||||
"./project-knowledge/04-people/manager.md",
|
||||
"./project-knowledge/04-people/index.md",
|
||||
"./project-knowledge/05-decisions/rest-vs-graphql.md",
|
||||
"./project-knowledge/05-decisions/discourse-handling.md"
|
||||
"./project-knowledge/04-people/index.md"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user