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

@@ -29,12 +29,13 @@ It also supports readable channel names in `.env`, not only channel IDs.
If you still want to override it with another script, expose that to OpenCode with:
- `AIW_MATTERMOST_SYNC_CMD`
- `FIDELITY_MATTERMOST_SYNC_CMD`
Example:
```bash
export FIDELITY_MATTERMOST_SYNC_CMD="/absolute/path/to/your-mattermost-sync-script"
export AIW_MATTERMOST_SYNC_CMD="/absolute/path/to/your-mattermost-sync-script"
```
Expected behavior:
@@ -48,13 +49,14 @@ OpenCode can then use that output to refresh `ai/inbox/mattermost-latest.md` pro
Historical Slack exports can also be imported through:
- `python3 scripts/slack/import_slack_export.py ...`
- `/archive-import ...`
- `/slack-import ...`
Recommended raw archive location:
- `archives/slack/export/`
The importer can auto-detect `fidelity*` channels and auto-tune message selection for very large exports.
The importer can auto-detect channels using `AIW_CHANNEL_PREFIX` and auto-tune message selection for very large exports. It defaults to `fidelity` for this project profile.
The Mattermost extractor can also fetch the latest prior day with channel activity for standups. It starts from the previous calendar day and expands backward automatically when there is no activity, which covers Mondays, weekends, holidays, and OOO gaps.

View File

@@ -1,9 +1,19 @@
MATTERMOST_URL=https://tu-mattermost.example.com
MATTERMOST_TOKEN=tu_personal_access_token
CHANNELS=fidelity-preguntas
AIW_PROJECT_PROFILE=fidelity
AIW_CHANNEL_PREFIX=fidelity
# Optional generic OpenCode overrides:
# AIW_MATTERMOST_SYNC_CMD=bash scripts/mattermost/sync.sh
# AIW_MATTERMOST_SYNC_INTERVAL_MINUTES=15
# AIW_MANAGER_NAME=jeff
# Optional only if the same channel name exists in multiple teams:
# MATTERMOST_TEAM_NAME=fidelity
# MATTERMOST_TEAM_ID=team_id_here
# Legacy Fidelity-specific options still supported by workspace plugins:
# FIDELITY_MATTERMOST_SYNC_CMD=bash scripts/mattermost/sync.sh
# FIDELITY_MATTERMOST_SYNC_INTERVAL_MINUTES=15
# FIDELITY_MANAGER_NAME=jeff
# Legacy options still supported:
# CHANNEL_NAMES=fidelity-preguntas,otro-canal
# CHANNEL_IDS=canal_id_1,canal_id_2

View File

@@ -58,7 +58,16 @@ Manual run:
bash scripts/mattermost/sync.sh
```
OpenCode can use this script directly. If `FIDELITY_MATTERMOST_SYNC_CMD` is not set, the workspace plugins will fall back to this wrapper automatically.
OpenCode can use this script directly. If `AIW_MATTERMOST_SYNC_CMD` is not set, the workspace plugins will fall back to `FIDELITY_MATTERMOST_SYNC_CMD`, then to this wrapper automatically.
Generic workspace variables are preferred for reusable projects:
- `AIW_PROJECT_PROFILE`
- `AIW_CHANNEL_PREFIX`
- `AIW_MATTERMOST_SYNC_CMD`
- `AIW_MATTERMOST_SYNC_INTERVAL_MINUTES`
The older `FIDELITY_*` variables remain supported for this project profile.
Previous workday mode for standups:

View File

@@ -14,6 +14,7 @@ Use old Slack history to recover durable project context, stakeholder relationsh
- keep raw imported artifacts under `generated/`
- keep the raw Slack export under `archives/slack/export/` when you want the workspace to find it later
- for a first pass on a large export, let the importer auto-detect `fidelity*` channels and auto-tune message selection
- for reusable project profiles, set `AIW_CHANNEL_PREFIX` so the importer can auto-detect project-specific channels without hardcoding a prefix
## Supported Export Shape
@@ -30,7 +31,7 @@ Manual example:
```bash
python3 scripts/slack/import_slack_export.py \
--export-path /absolute/path/to/slack-export \
--channel-prefix fidelity \
--channel-prefix "${AIW_CHANNEL_PREFIX:-fidelity}" \
--output-dir scripts/slack/generated
```
@@ -46,6 +47,7 @@ Use the OpenCode command `/slack-import ...` for the guided workflow.
For very large multi-year exports, the importer is designed to be selective by default:
- auto-detects channels whose names start with `fidelity` when no channels are specified
- uses `AIW_CHANNEL_PREFIX` when set; otherwise defaults to `fidelity` for compatibility with this workspace
- auto-tunes the message limit based on archive size
- when no date filters are provided, performs an initial full-history sweep across the detected `fidelity*` channels
- preserves coverage across channels and years, not only recent history
@@ -69,4 +71,4 @@ If you want the workspace to find the export later without needing a custom path
archives/slack/export/
```
The `/slack-import` command will use that location automatically when no explicit path or environment variable is provided.
The `/archive-import` and `/slack-import` commands will use that location automatically when no explicit path or environment variable is provided.

View File

@@ -2,6 +2,7 @@
import argparse
import json
import os
import re
import sys
from collections import Counter
@@ -99,7 +100,7 @@ def parse_args() -> argparse.Namespace:
)
parser.add_argument(
"--channel-prefix",
default="fidelity",
default=os.getenv("AIW_CHANNEL_PREFIX", "fidelity"),
help="Default channel prefix to auto-detect when --channels is omitted.",
)
parser.add_argument(