Refactor AI workspace for improved context management and communication integration

- Introduced new commands and skills for workspace memory curation, professional communication, and status reporting.
- Updated existing commands to utilize new skills and improve clarity in instructions.
- Created a new workspace context command to load reusable core and active project profile.
- Enhanced Mattermost inbox integration with support for generic environment variables.
- Established a clear separation between project-independent core logic and project-specific profiles.
- Improved documentation across various files to reflect changes in workflow and command usage.
- Added operational memory management rules to ensure accurate context promotion and correction.
- Updated README and workflow documents to guide users in utilizing the new structure effectively.
This commit is contained in:
2026-04-16 08:35:53 -06:00
parent 1f57597ca3
commit 8026da5719
41 changed files with 1131 additions and 42 deletions

View File

@@ -0,0 +1,43 @@
---
description: Generate a self-contained prompt for another AI assistant
---
Generate a high-quality prompt for another AI assistant that may not have access to this workspace memory.
Read:
@core/README.md
@core/memory/operational-memory.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md
@ai/context/process/ai-to-ai-prompting.md
@ai/work-items/index.md
@ai/state/current.md
@ai/state/work-items.md
@knowledge/communication-rules.md
Read active profile, if present:
!`profile="${AIW_PROJECT_PROFILE:-fidelity}"; if [ -f "profiles/$profile/profile.md" ]; then cat "profiles/$profile/profile.md"; elif [ -f profiles/fidelity/profile.md ]; then cat profiles/fidelity/profile.md; else echo "No profile file found."; fi`
Relevant active work item files, if available:
!`if [ -d ai/work-items ]; then for f in ai/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`
User request:
$ARGUMENTS
Instructions:
- use `ai-prompt-engineering` when available
- make the prompt self-contained
- include only relevant project context
- tell the target AI what to inspect before changing code or producing conclusions
- include constraints, non-goals, expected output, and validation expectations
- include work-item IDs and approved titles when relevant
- do not assume the target AI can read this workspace
- do not invent file paths if the implementation repository is not available here
Return only the prompt unless the user asks for explanation.

View File

@@ -0,0 +1,62 @@
---
description: Import a historical communication archive and refine workspace memory
---
Use a historical communication export as archive evidence for the workspace.
Interpret this as historical recovery, not as current truth and not as model training.
Inputs:
- `$ARGUMENTS` may contain an export path, channel names, or date filters
- if no explicit path is given, use `AIW_SLACK_EXPORT_PATH` when available
- compatibility fallback: `FIDELITY_SLACK_EXPORT_PATH`
- otherwise, if `archives/slack/export/` exists, use it as the default import source
- if no channels are specified, auto-detect channels using `AIW_CHANNEL_PREFIX`
- compatibility/default prefix: `fidelity`
Run the importer:
!`prefix="${AIW_CHANNEL_PREFIX:-fidelity}"; if [ -n "$ARGUMENTS" ]; then python3 scripts/slack/import_slack_export.py $ARGUMENTS; elif [ -n "$AIW_SLACK_EXPORT_PATH" ]; then python3 scripts/slack/import_slack_export.py --export-path "$AIW_SLACK_EXPORT_PATH" --channel-prefix "$prefix"; elif [ -n "$FIDELITY_SLACK_EXPORT_PATH" ]; then python3 scripts/slack/import_slack_export.py --export-path "$FIDELITY_SLACK_EXPORT_PATH" --channel-prefix "$prefix"; elif [ -d archives/slack/export ]; then python3 scripts/slack/import_slack_export.py --export-path archives/slack/export --channel-prefix "$prefix"; else echo "Provide archive import arguments, set AIW_SLACK_EXPORT_PATH, set FIDELITY_SLACK_EXPORT_PATH, or place an extracted export in archives/slack/export."; fi`
Read:
@core/README.md
@core/memory/operational-memory.md
@core/integrations/communication-model.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md
@ai/context/process/context-maintenance.md
@ai/context/people/index.md
@ai/context/people/manager.md
@ai/work-items/index.md
@ai/state/current.md
@ai/state/work-items.md
@knowledge/agent-memory-rules.md
@knowledge/memory-promotion-rules.md
Imported summary, if present:
!`if [ -s scripts/slack/generated/slack_summary.md ]; then cat scripts/slack/generated/slack_summary.md; else echo "No archive summary generated."; fi`
Imported archive context, if present:
!`if [ -s scripts/slack/generated/slack_context.jsonl ]; then cat scripts/slack/generated/slack_context.jsonl; else echo "No archive context generated."; fi`
Instructions:
- treat the archive as historical evidence
- promote durable project-relevant context automatically when confidence is high
- prefer durable role/person associations, recurring architecture patterns, repeated work-item references, approval/scope history, and process lessons
- create or update person files when a human repeatedly affects project flow
- avoid promoting outdated daily status unless it changes current understanding
- update existing memory when the archive clarifies or corrects it
- keep ambiguous or likely outdated facts as archive-only context
Return:
1. What was imported
2. Which files were updated
3. Which historical facts were promoted or intentionally left as archive-only context

View File

@@ -0,0 +1,52 @@
---
description: Sync live communication context and promote high-confidence memory
---
Use the configured live communication connector to fetch fresh evidence and maintain workspace memory automatically.
Preferred command sources:
- `AIW_MATTERMOST_SYNC_CMD`
- compatibility fallback: `FIDELITY_MATTERMOST_SYNC_CMD`
- workspace fallback: `bash scripts/mattermost/sync.sh`
Run the connector:
!`if [ -n "$AIW_MATTERMOST_SYNC_CMD" ]; then bash -lc "$AIW_MATTERMOST_SYNC_CMD"; elif [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No live communication sync command is configured."; fi`
Read:
@core/README.md
@core/memory/operational-memory.md
@core/integrations/communication-model.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md
@ai/context/process/context-maintenance.md
@ai/work-items/index.md
@ai/state/current.md
@ai/state/work-items.md
@knowledge/memory-promotion-rules.md
Fresh communication evidence:
!`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 communication evidence available."; fi`
Instructions:
- if the sync command failed, stop and do not edit workspace memory
- treat connector output as evidence, not automatically as project truth
- promote only explicit, project-relevant, high-confidence facts
- default destination is `ai/logs/$(date +%F).md`
- update `ai/state/current.md` only for facts that materially change the active work window
- update `ai/work-items/*.md` for explicit work-item IDs, approved titles, points, scope, and status notes
- keep `ai/state/work-items.md` aligned as the compact summary of active work items
- do not write tooling noise, sync status, or generic chat chatter into project memory
- if a fact is ambiguous, skip it rather than asking what to do
Return:
1. What was synchronized
2. Which files were updated
3. Which facts were promoted or intentionally skipped

View File

@@ -6,6 +6,8 @@ Generate a prompt that the user can send to GitHub Copilot or another AI assista
Read:
@core/README.md
@core/memory/operational-memory.md
@prompts/copilot-prompt.md
@ai/AGENTS.md
@ai/context/process/ai-to-ai-prompting.md
@@ -19,6 +21,10 @@ Read:
@ai/state/current.md
@ai/state/work-items.md
Active profile, if present:
!`profile="${AIW_PROJECT_PROFILE:-fidelity}"; if [ -f "profiles/$profile/profile.md" ]; then cat "profiles/$profile/profile.md"; elif [ -f profiles/fidelity/profile.md ]; then cat profiles/fidelity/profile.md; else echo "No profile file found."; fi`
Detailed active work item files, if available:
!`if [ -d ai/work-items ]; then for f in ai/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`
@@ -29,7 +35,7 @@ $ARGUMENTS
Instructions:
- Use the `copilot-prompt-engineering` skill if available.
- Use `ai-prompt-engineering` and `copilot-prompt-engineering` if available.
- Generate a self-contained prompt for the target AI.
- Include only context relevant to the request.
- Include Jira ID/title when the task maps to an active work item.

View File

@@ -7,6 +7,10 @@ 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/communication-model.md
@profiles/fidelity/profile.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md

View File

@@ -13,7 +13,7 @@ Use this when the user asks for:
Run sync:
!`if [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No Mattermost sync command is configured."; fi`
!`if [ -n "$AIW_MATTERMOST_SYNC_CMD" ]; then bash -lc "$AIW_MATTERMOST_SYNC_CMD"; elif [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No Mattermost sync command is configured."; fi`
Read refreshed Mattermost context:
@@ -27,7 +27,7 @@ Instructions:
- Do not answer from old conversation memory.
- Use only the refreshed Mattermost output above.
- If the user asks for Jeff/current manager, filter messages by `jeff`, `jeff.dewitte`, or the current manager profile when visible.
- If the user asks for the current manager/stakeholder, filter messages by the profile mapping when visible; for the Fidelity profile, also match `jeff` and `jeff.dewitte`.
- If multiple messages match, return the newest matching message first.
- Include timestamp, channel, sender, and concise summary.
- If the message changes project context, update the appropriate workspace memory after answering.

View File

@@ -7,6 +7,8 @@ Use this command for quick same-day note capture.
Read:
@README.md
@core/README.md
@core/memory/operational-memory.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md
@@ -28,6 +30,7 @@ $ARGUMENTS
Instructions:
- use `workspace-memory-curation` when available
- Update or create `ai/logs/$(date +%F).md`
- Preserve concrete technical meaning
- Capture both technical findings and communication context when relevant

View File

@@ -4,6 +4,8 @@ description: Draft or polish a Mattermost update for the current manager or stak
Draft a concise Mattermost message for the current manager or stakeholder in natural, manager-ready US English.
Use `professional-communication` when available.
Read:
@prompts/manager-update.md

View File

@@ -6,12 +6,13 @@ Use the configured Mattermost sync command to fetch fresh communication context
Preferred command sources:
- `FIDELITY_MATTERMOST_SYNC_CMD`
- `AIW_MATTERMOST_SYNC_CMD`
- compatibility fallback: `FIDELITY_MATTERMOST_SYNC_CMD`
- fallback: `bash scripts/mattermost/sync.sh`
Run the command and use its output as fresh communication context:
!`if [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No Mattermost sync command is configured."; fi`
!`if [ -n "$AIW_MATTERMOST_SYNC_CMD" ]; then bash -lc "$AIW_MATTERMOST_SYNC_CMD"; elif [ -n "$FIDELITY_MATTERMOST_SYNC_CMD" ]; then bash -lc "$FIDELITY_MATTERMOST_SYNC_CMD"; elif [ -f scripts/mattermost/sync.sh ]; then bash scripts/mattermost/sync.sh; else echo "No Mattermost sync command is configured."; fi`
Use this command implicitly when the user asks for the latest or last Mattermost message, especially messages from Jeff or the current manager.
@@ -21,6 +22,7 @@ Then:
- use `ai/inbox/mattermost-latest.md` if it exists and is non-empty
- otherwise use `scripts/mattermost/generated/mattermost_context.jsonl` if it exists and is non-empty
- apply the memory promotion rules from `knowledge/memory-promotion-rules.md`
- treat Mattermost output as live communication evidence; the agent decides what becomes promoted memory
- automatically promote explicit, project-relevant, high-confidence facts
- default destination is `ai/logs/$(date +%F).md`
- update `ai/state/current.md` only for facts that materially change the current work window

View File

@@ -6,6 +6,8 @@ Use this only when you want an explicit manual promotion pass.
Read:
@core/README.md
@core/memory/operational-memory.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md

View File

@@ -9,20 +9,25 @@ Interpret this as historical recovery, not as current truth and not as model tra
Inputs:
- `$ARGUMENTS` may contain an export path, channel names, or date filters
- if no explicit path is given in the arguments, use `FIDELITY_SLACK_EXPORT_PATH` when available
- if no explicit path is given in the arguments, use `AIW_SLACK_EXPORT_PATH` when available
- compatibility fallback: `FIDELITY_SLACK_EXPORT_PATH`
- otherwise, if `archives/slack/export/` exists, use it as the default import source
- if no channels are specified, auto-detect channels whose folder names start with `fidelity`
- if no channels are specified, auto-detect channels using `AIW_CHANNEL_PREFIX`
- compatibility/default prefix: `fidelity`
- if no message limit is specified, auto-tune message selection based on archive size
- if no date range is specified, do an initial full-history sweep across the detected `fidelity*` channels
- preserve broad coverage across years and channels while still prioritizing high-signal messages
First, run the importer:
!`if [ -n "$ARGUMENTS" ]; then python3 scripts/slack/import_slack_export.py $ARGUMENTS; elif [ -n "$FIDELITY_SLACK_EXPORT_PATH" ]; then python3 scripts/slack/import_slack_export.py --export-path "$FIDELITY_SLACK_EXPORT_PATH" --channel-prefix fidelity; elif [ -d archives/slack/export ]; then python3 scripts/slack/import_slack_export.py --export-path archives/slack/export --channel-prefix fidelity; else echo "Provide Slack import arguments, set FIDELITY_SLACK_EXPORT_PATH, or place an extracted export in archives/slack/export."; fi`
!`prefix="${AIW_CHANNEL_PREFIX:-fidelity}"; if [ -n "$ARGUMENTS" ]; then python3 scripts/slack/import_slack_export.py $ARGUMENTS; elif [ -n "$AIW_SLACK_EXPORT_PATH" ]; then python3 scripts/slack/import_slack_export.py --export-path "$AIW_SLACK_EXPORT_PATH" --channel-prefix "$prefix"; elif [ -n "$FIDELITY_SLACK_EXPORT_PATH" ]; then python3 scripts/slack/import_slack_export.py --export-path "$FIDELITY_SLACK_EXPORT_PATH" --channel-prefix "$prefix"; elif [ -d archives/slack/export ]; then python3 scripts/slack/import_slack_export.py --export-path archives/slack/export --channel-prefix "$prefix"; else echo "Provide Slack import arguments, set AIW_SLACK_EXPORT_PATH, set FIDELITY_SLACK_EXPORT_PATH, or place an extracted export in archives/slack/export."; fi`
Read:
@ai/AGENTS.md
@core/README.md
@core/memory/operational-memory.md
@core/integrations/communication-model.md
@ai/context/index.md
@ai/context/project.md
@ai/context/systems/index.md
@@ -46,7 +51,7 @@ Imported Slack context, if present:
Instructions:
- treat the Slack archive as historical evidence
- treat the Slack archive as historical evidence, not promoted memory by itself
- assume this may be a large multi-year export
- assume the first import should preserve evidence from the beginning of the project, not just recent history
- promote durable project-relevant context automatically when confidence is high

View File

@@ -43,6 +43,7 @@ Detailed active work item files, if available:
Before drafting:
- use `status-reporting` when available
- update workspace memory if the refreshed context introduced clear high-confidence project facts
- prefer existing memory when the latest context is ambiguous
- treat the previous workday Mattermost context as the source for the `Yesterday` section, even when the previous calendar day was a weekend, holiday, or OOO day

View File

@@ -18,6 +18,8 @@ $ARGUMENTS
Read:
@core/README.md
@core/memory/operational-memory.md
@prompts/story-draft.md
@ai/AGENTS.md
@ai/context/index.md
@@ -47,6 +49,7 @@ Detailed active work item files, if available:
Requirements:
- Use `professional-communication` when available.
- Preserve the exact technical meaning of the input
- Rewrite fully when needed so the output sounds like a fluent senior engineer wrote it
- Choose the most appropriate story framing: bug, enhancement, spike, task, or follow-up

View File

@@ -34,6 +34,7 @@ $ARGUMENTS
Instructions:
- use `workspace-memory-curation` when available
- Decide whether the new information belongs in:
- today's log
- `ai/state/current.md`

View File

@@ -4,6 +4,8 @@ description: Rewrite rough engineering notes into natural Mattermost-ready US En
Rewrite and tighten the following rough notes into concise, natural, Mattermost-ready US English.
Use `professional-communication` when available.
Do not translate literally.
Rewrite fully when needed so the result sounds like a fluent senior engineer wrote it.

View File

@@ -0,0 +1,63 @@
---
description: Load reusable AI workspace core plus the active project profile
---
Load and internalize the reusable workspace core and the active project context before answering follow-up questions.
Read core:
@core/README.md
@core/memory/operational-memory.md
@core/integrations/communication-model.md
@core/profiles/create-project-profile.md
Read active workspace memory:
@README.md
@ai/AGENTS.md
@ai/context/index.md
@ai/context/project.md
@ai/context/process/communication.md
@ai/context/process/context-maintenance.md
@ai/context/people/manager.md
@ai/context/people/index.md
@ai/work-items/index.md
@ai/state/current.md
@ai/state/work-items.md
@knowledge/workspace-model.md
@knowledge/communication-rules.md
@knowledge/agent-memory-rules.md
@knowledge/memory-promotion-rules.md
Read active profile, preferring the configured profile and falling back to Fidelity:
!`profile="${AIW_PROJECT_PROFILE:-fidelity}"; if [ -f "profiles/$profile/profile.md" ]; then cat "profiles/$profile/profile.md"; elif [ -f profiles/fidelity/profile.md ]; then cat profiles/fidelity/profile.md; else echo "No profile file found."; fi`
Today's date:
!`date +%F`
Today's log, if present:
!`if [ -f ai/logs/$(date +%F).md ]; then cat ai/logs/$(date +%F).md; else echo "No log exists for today yet."; fi`
Recent logs available:
!`ls -1 ai/logs 2>/dev/null | sort | tail -n 5`
Detailed active work item files, if available:
!`if [ -d ai/work-items ]; then for f in ai/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`
Latest communication inbox, if available:
!`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 live communication context available."; fi`
Respond with:
1. Current context
2. Communication risks
3. Missing context to capture today
Keep the response concise, then wait for the next request.