Commit Graph

22 Commits

Author SHA1 Message Date
gnekt
1b9450aa03 fix: review corrections for Codex CLI adapter (PR #35)
Great work on the Codex CLI integration, thanks for putting this together!
After reviewing the PR against the actual Codex CLI docs and source code,
I found a few things that needed fixing. Here is what changed and why.

## request_user_input is a real Codex CLI tool

The adapter was removing `request_user_input` and replacing it with "ask
the user directly in chat". But `request_user_input` is a native Codex CLI
tool (like `shell` or `spawn_agent`). The fix: `AskUserQuestion` now maps
to `request_user_input` instead of being erased, and `request_user_input`
is preserved everywhere (adapter, docs, compat reference, tests).

## Fictional model names replaced with real ones

The config profiles used `gpt-5.4`, `gpt-5.4-mini`, and
`gpt-5.3-codex-spark`, which do not exist. Replaced with `o3` and
`o4-mini`, which are the current production models for Codex CLI.

## TOML key quoting (security)

`_cc_toml_quote_key` was sanitizing server names by replacing spaces with
hyphens (`Google Calendar` -> `Google-Calendar`). This broke cross-platform
parity because `mcp/servers.yaml` is the source of truth for all platforms.
The fix: the function now properly quotes keys per TOML spec when they
contain spaces or special characters, so `Google Calendar` stays as-is in
YAML and becomes `[mcp_servers."Google Calendar"]` in TOML output.

## servers.yaml breaking change reverted

The PR renamed `Google Calendar` to `Google-Calendar` in servers.yaml.
Since this file feeds all four platform adapters, that rename would break
Claude Code, Gemini CLI, and OpenCode builds. Reverted.

## TOML agent schema in migration doc was wrong

The example in codex-migration.md used a nested `[agent]` /
`[agent.prompt].content` structure. Codex CLI actually uses top-level keys:
`name`, `description`, `developer_instructions`. Fixed the example.

## Security hardening

- Path traversal guard on agent names: rejects `/` and `..` sequences
- Control character rejection in TOML key quoting (newline/CR/tab)
- Newline and tab escaping in all three TOML string escape functions
- Fixed glob expansion risk in `_cc_capabilities_to_sandbox` (now uses
  `read -ra` array instead of unquoted word splitting)

## Docs and smoke matrix

- codex-cli.md: fixed tool mapping table, replaced `@Agent` syntax with
  natural language prompts (Codex CLI does not support @ mentions), added
  note about dispatcher routing
- codex-cli-compat.md: added Read/Glob/Grep/Bash tool mappings
- README.md: added codex-cli adapter and docs to the project structure tree

## Test updates

- ~15 tests updated to match the new semantics (request_user_input
  preserved, model names, POSIX find instead of GNU -printf)
- 119/123 tests pass; the 4 remaining failures are pre-existing (bash 3.2
  on macOS lacks `mapfile` and `declare -A`)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 21:25:12 +02:00
Arpit Behera
3dde38e284 feat: add Codex CLI as a first-class fourth platform
Rebuilt from scratch following Codex CLI's actual architecture (as
outlined in the review on PR #26). Closes the integration gap with a
proper build adapter, correct install paths, TOML agent files, and
all the architectural differences documented and tested.

What changed vs the previous attempt (PR #26):

- Agents: build adapter generates .toml files (name/description/
  developer_instructions) into dist/codex-cli/.codex/agents/ instead
  of copying .md files with sed transforms
- Skills: installed to .agents/skills/ (correct Codex discovery path)
  instead of .codex/skills/
- Dispatcher: AGENTS.md uses a root-context orchestration header that
  works within agents.max_depth=1 constraints; named-agent routing
  replaced with embedded-instructions workaround for the known
  spawn_agents limitation (openai/codex#15250)
- Tool compat: AskUserQuestion and request_user_input removed; all
  prompts adapted to Codex's actual tool set and approval/confirmation
  flow
- Installer/updater: launchme.sh --platform codex-cli and updateme.sh
  with Codex auto-detection, creating the correct split layout
  (AGENTS.md + .codex/agents/ + .codex/config.toml + .agents/skills/)
- Tests: new per-adapter test suite (tests/adapters/codex-cli/),
  install/update smoke (tests/scripts/codex-cli-install.test.sh), and
  a four-platform parity gate that proves Codex changes do not regress
  Claude Code, Gemini CLI, or OpenCode
- Docs: new codex-cli.md guide, codex-migration.md for users switching
  from other platforms, and README/getting-started/examples updated for
  four-platform positioning
- Bash harness: .gitattributes added to enforce LF on .sh files;
  harness LF-normalized so tests/run.sh works on Windows checkouts
- .gitignore: .planning/ added (internal GSD workflow artifacts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 17:45:10 +03:00
Gnekt
49839486b8 Enh readme (#33)
* Update README header to highlight multi-platform support

* Use neutral color for platform badges in README header

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 00:21:52 +02:00
Giacomo Nunziati
53b605379e feat: multi-platform adapter architecture (Claude Code, Gemini CLI, OpenCode) (#32)
* Fix istall/update scripts

* test: capture pre-refactor install snapshot for regression

Adds take-snapshot.sh script and the resulting snapshot/ directory,
capturing the exact vault state produced by launchme.sh before the
framework-agnosticity refactor begins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Summary: Refactor agents/skills/hooks/mcp in agentic-platform-agnostic templates.

refactor: rename source CLAUDE.md → DISPATCHER.md (framework-neutral)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

refactor: convert agent frontmatter from tools: to neutral capabilities:

Replace Claude Code-specific `tools:` frontmatter with framework-agnostic
`mode: subagent` and `capabilities: [...]` in all 8 agent files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

refactor: add neutral hook trigger manifests (.hook.yaml)

refactor: hooks read neutral JSON schema (args.* instead of tool_input.*)

refactor: convert .mcp.json to neutral mcp/servers.yaml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Implement agentic-platform adapters skeleton.

build: add adapters/lib.sh skeleton with vocabulary constants

test: bash test runner for adapter helpers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): parse_frontmatter helper with tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): parse_capabilities helper with tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): should_include helper with tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): parse_hook_yaml helper with tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): agent_body helper with tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(adapters): enumerate_agents and enumerate_hooks helpers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Implement agentic-platform adapter for Claude Code.

build(adapters): claude-code adapter skeleton with capability/event tables

build(claude-code): adapter_translate_dispatcher with test

build(claude-code): adapter_translate_references with test

build(claude-code): adapter_translate_skills with tests

build(claude-code): adapter_translate_agents with capability→tools mapping

build(claude-code): hook wrapper template (CC native → neutral schema)

build(claude-code): adapter_translate_hooks with wrapper generation

build(claude-code): adapter_translate_mcp with hand-rolled YAML parser

build(claude-code): adapter_finalize and complete adapter_build wiring

build: scripts/build.sh dispatches to per-framework adapter

Also fix adapter_translate_hooks and adapter_translate_agents to use
while-read loops (avoiding word-splitting on paths with spaces) and
guard grep calls with || true to survive set -eo pipefail when hooks
have no match-tool field. Remove scripts/build.sh from .gitignore.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Refactor install/update scripts to support agentic-platform agnosticity.

refactor(lib.sh): generalize install_claude_md → install_dispatcher

New signature takes the full destination path instead of just the vault
dir, allowing callers to install CLAUDE.md, AGENTS.md, or any dispatcher
file to an explicit location.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(launchme): support --framework flag, build dist/ before install

Add --framework and --target arg parsing. Run build.sh before installing
to populate dist/<framework>/. All install_* calls now read from
dist/<framework>/ instead of the raw source dirs. MCP is now handled
automatically by the adapter (no interactive prompt). Replaced
install_claude_md with install_dispatcher.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(updateme): support --framework flag, build dist/ before update

Add --framework and --target arg parsing. Run build.sh before installing
to populate dist/<framework>/. All install_* calls now read from
dist/<framework>/ instead of raw source dirs. Replaced install_claude_md
with install_dispatcher.

Also fix set -e compatibility in lib.sh: add || true to all conditional
[[ ... ]] && info "..." logging lines so they don't abort the script
when VERBOSE_COPY=0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: regression runner diffs dist/claude-code against pre-refactor snapshot

- Add tests/regression/run.sh that builds dist/claude-code and compares
  against snapshot, excluding runtime-only artifacts (.mbifc-manifest,
  .mcp.json, .claude-plugin/plugin.json)
- Fix adapters/lib.sh agent_body: preserve '---' section dividers in body
  (awk now only skips '---' while still inside frontmatter, fm < 2)
- Fix adapters/claude-code/adapter.sh: change 'read' capability to expand
  to only 'Read', appending 'Glob, Grep' at end of tools list to match
  snapshot ordering
- Update snapshot to reflect intentional refactor changes: hook JSON schema
  (.args.* instead of .tool_input.*), wrapper scripts, settings.json with
  wrapper paths, and consistent tool ordering for postman/sorter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Implement opencode adapter.

Co-Authored-By: win0na <winnie@winneon.moe>

feat(lib.sh): add install_plugins helper for opencode JS plugins

build(adapters): opencode adapter skeleton with capability/event tables

build(opencode): adapter_translate_dispatcher (DISPATCHER.md → AGENTS.md)

build(opencode): adapter_translate_references and adapter_translate_skills

Implements Task 4 and Task 5:
- adapter_translate_references: Copies reference markdown files to .opencode/references/
- adapter_translate_skills: Copies skill SKILL.md files to .opencode/skills/<name>/ with exclude filtering

Both functions respect framework filtering via should_include().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(opencode): adapter_translate_agents with capability→permission mapping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(opencode): bash-executor template for spawning hook scripts

build(opencode): plugin-stub template for mbifc-hooks.js

build(opencode): adapter_translate_hooks with JS plugin generation

Implements _oc_hook_registry_json and adapter_translate_hooks in the
opencode adapter. Copies hook scripts to .opencode/hooks/, generates a
single .opencode/plugins/mbifc-hooks.js by inlining bash-executor.js and
synthesising a hook registry from *.hook.yaml files. Uses python3 for
template substitution to safely handle multi-line JS content. Adds 3
unit tests (copies scripts, registry entries, noop when no hooks dir).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(opencode): adapter_translate_mcp with local/remote handling

build(opencode): adapter_finalize and complete adapter_build wiring

Add adapter_finalize placeholder and wire adapter_translate_mcp into
adapter_build; add end-to-end integration test (14/14 pass).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(launchme): branch on --framework for opencode install layout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(updateme): branch on --framework for opencode install layout

Mirror the same case "$FRAMEWORK" block from launchme.sh: framework-specific
DIST_COMPONENTS_DIR, VAULT_COMPONENTS_DIR, DISPATCHER_SRC/DST, MCP_SRC/DST,
HAS_PLUGINS; conditional install_plugins; conditional install_settings;
framework-aware vault-setup check; framework-neutral summary messages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix adapters to follow the same template.

fix: restore adapter_build() contract, revert function renames

Both adapters now export adapter_build() and adapter_translate_*() as
the uniform public contract. scripts/build.sh sources one adapter and
calls adapter_build uniformly. Private helpers (_oc_*) and vocabulary
tables (cc_capability_to_tools, oc_capability_to_permission, etc.)
retain their prefixes. CC regression and OC unit tests all pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

fix(tests): restore test_oc_ prefix on adapter_build end-to-end test

* Fix agent format in opencode adapter

* refactor: rename --framework to --platform across all scripts and tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Modify generic name for model tiers

Co-Authored-By: win0na <winnie@winneon.moe>

refactor: neutral model vocabulary (low/mid/high) in source agents

feat(claude-code): cc_model_to_native() maps low/mid/high to haiku/sonnet/opus

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(opencode): update oc_model_to_provider() for low/mid/high vocabulary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add gemini-cli adapter

Co-Authored-By: win0na <winnie@winneon.moe>

build(gemini-cli): adapter skeleton with capability/event/model tables

build(gemini-cli): adapter_translate_dispatcher (DISPATCHER.md → GEMINI.md)

build(gemini-cli): adapter_translate_references and adapter_translate_skills

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(gemini-cli): adapter_translate_agents with capability→tools mapping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(gemini-cli): adapter_translate_hooks with wrapper scripts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

feat(install): add gemini-cli platform to launchme.sh and updateme.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Implement preserving config merge for opencode.

Co-Authored-By: win0na <winnie@winneon.moe>

feat(opencode): config-merge.sh with formatting-preserving JSON merge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

build(opencode): source config-merge.sh from adapter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat(install): use oc_config_merge for opencode.json instead of overwrite

Source config-merge.sh from install scripts for opencode platform so
user keys in opencode.json are preserved on reinstall and update.
Fix in-place merge by writing to a temp file before moving to output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add mcp files to gitignore.

* Fix claude-specific references in agents, skills and references

* Fix: remove claude-specific reference from hooks.

build: add platform_dir and dispatcher_name to all hook wrapper/plugin templates

feat(hooks): platform-aware path checks using platform_dir and dispatcher_name from JSON input

test: update regression snapshot for platform-aware hook wrappers and scripts

* Added interactive platform choice in launchme, and platform auto-detection in updateme.

* Fix: remove claude-specific references from documentation

* Update documentation to reflect the new platform-agnostic architecture

* fix: address Copilot review feedback on PR #32

- tests/run.sh: check source return code, report failures
- tests/regression/run.sh: use mktemp + trap cleanup instead of fixed /tmp paths
- tests/regression/run.sh: include .mcp.json in regression comparison
- tests/regression/take-snapshot.sh: use --platform flag instead of stale scripted input
- adapters/opencode/templates/plugin-stub.js.tmpl: include stdout in hook block error message

* fix: address Copilot review round 2

- config-merge.sh: reword comment to only promise indentation preservation (not full formatting)
- take-snapshot.sh: copy required artifacts explicitly, optional ones with existence check
- adapters/lib.sh: document parse_hook_yaml single-trigger limitation

* fix: address Copilot review round 3

- adapters/opencode/adapter.sh: replace python3 template substitution with
  pure bash (while-read loop with case matching), removing python3 dependency
- adapters/lib.sh: should_include now falls back to plain YAML key read for
  files without frontmatter delimiters (fixes hook .yaml exclude: support)

* fix: address Copilot review round 4

- scripts/launchme.sh: fix double-dot in FW_DIR_NAME display (basename
  already includes the dot, e.g. ".claude")
- scripts/launchme.sh: replace undefined MCP_ANSWER with check on MCP_DST
  existence for summary banner

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:28:28 +02:00
lh
e8452f0801 Add orchestra: named scripts for permission-free agent operations (#29)
* Add orchestra: named scripts for permission-free agent operations

14 named scripts that wrap common Hey, tracker, and vault operations
into single commands. When added to the Bash permission allowlist,
they eliminate repeated permission prompts during email triage and
vault operations.

Scripts derive vault path from their own location (portable).
Installer and updater copy them to Meta/scripts/ in the vault.
Postman agent and email-triage skill updated to prefer scripts
over inline pipelines.

* Address Copilot review feedback on orchestra scripts

- Pass shell variables to Python via sys.argv instead of string
  interpolation to prevent quoting/injection issues
- Validate --mailbox argument has a value before shifting
- Validate numeric arguments (hours, days) as integers
- Fix vault-stats folder list to use bash array (word splitting)
- Fix vault-inbox to handle missing 00-Inbox/ gracefully
- Remove unused import os from hey-check
- Narrow postman.md allowed commands from Meta/scripts/* wildcard
  to explicitly named scripts
- Add .core-manifest tracking for scripts in launchme.sh/updateme.sh
  with deprecation of removed scripts on update
- Fix contact-lookup description (matches senders only, not recipients)

* Fix orchestra scripts bugs, security allowlist, and docs consistency

- Replace deprecated datetime.utcnow() with datetime.now(timezone.utc)
  in hey-check for Python 3.12+ compatibility
- Replace bare except: with except Exception: in all 6 tracker/lookup
  scripts to avoid swallowing KeyboardInterrupt and SystemExit
- Fix postman.md Hey triage step numbering (5→7 gap, now 1-9 sequential)
- Add Meta/scripts/ commands to email-triage SKILL.md allowed Bash list
  (procedure referenced them but security section blocked them)
- Update email-triage templates from hardcoded "Gmail" to {{source}}
  placeholder for Hey/Gmail/MCP compatibility
- Add orchestra/ directory to README project structure tree and
  Meta/scripts/ to installed vault structure diagram

* Address Copilot review: timestamp comparison, stale scripts, naming, JSON

- Fix tracker-recent timestamp comparison: truncate both cutoff and
  active_at to YYYY-MM-DDTHH:MM:SS before comparing, avoiding
  unreliable lexicographic comparison of Z vs +00:00 suffixes
- Fix contact-lookup dedup: skip entries with no topic_id to prevent
  unrelated results collapsing into a single None key
- Rename hey-thread parameter from <topic_id> to <posting_id> to
  align with Hey CLI terminology and hey-seen naming
- Fix orchestra README JSON snippet: wrap in valid settings.json
  structure so users can copy/paste without syntax errors
- Add stale script cleanup to launchme.sh on reinstall, mirroring
  the existing agent deprecation logic
- Separate removed-scripts counter from deprecated-files counter
  in updateme.sh summary for accurate messaging

---------

Co-authored-by: gnekt <dima9610@gmail.com>
2026-04-09 12:09:04 +02:00
lh
00969d1c34 Add /contact-sync skill for Apple Contacts integration (#28)
* Add /contact-sync skill for Apple Contacts integration

New skill that syncs contacts to Apple Contacts via MCP: searches
by name/email, creates if missing, updates if info is incomplete.
Designed to chain automatically after email workflows or run on demand.

Requires the apple-contacts MCP server (optional dependency).

* Fix apple-contacts MCP package name to @griches/apple-contacts-mcp

Corrected the NPM package reference and added .mcp.json config example.

* Address Copilot review feedback on contact-sync skill

- Add security section for untrusted email content (prompt injection)
- Fix name handling: consistent rules for single-token names, align
  Step 1 requirements with Step 3 and error handling
- Fix skill chaining: email-triage now suggests postman agent (not
  skill directly), contact-sync docs clarify dispatcher invocation
- Update CLAUDE.md intro from "13 skills" to "14 skills"
- Update README mermaid diagram from "13" to "14"

* Fix review issues: mermaid count, mcp.json format, alignment, routing bug

- README.md: Update mermaid diagram skill count from +8 to +9 (14 - 5 shown)
- README.md: Add mcpServers wrapper to apple-contacts .mcp.json example so
  users don't create a broken config
- README.md: Fix 1-space alignment on contact-sync line in project structure
- email-triage SKILL.md: Fix inter-agent suggestion that incorrectly pointed
  to Postman agent instead of /contact-sync skill — dispatcher would have
  invoked the wrong thing

---------

Co-authored-by: gnekt <dima9610@gmail.com>
2026-04-09 11:23:38 +02:00
lh
f66f4f6566 Add Hey CLI as alternative email backend for Postman (#14)
* Add Hey CLI support as alternative email backend

The Postman agent now supports two email backends:
- Hey (hey CLI) for Hey.com accounts with pre-sorted mailboxes
- GWS (gws CLI) for Gmail/Google Workspace accounts

Hey's mailbox model (Imbox, Feed, Paper Trail, Reply Later,
Set Aside, Bubble Up) is mapped to triage behaviours so the
agent leverages Hey's existing sorting. Calendar operations
remain on GWS.

All MCP function references replaced with CLI equivalents.
No user-specific details in the agent file.

* Update agents in postman.md by removing two roles

Removed descriptions for Food Coach and Wellness Guide agents from the postman documentation.

* Add Hey CLI as email backend across all docs, skills, and references

- Resolve all merge conflicts in postman.md keeping GWS + MCP + Hey
- Apply all 7 review comments from PR #14 (complete mailbox list,
  concrete email_backend setting, consistent template placeholders,
  Hey ID clarification, productivity features disclaimer, deadline
  body scanning, remove user-specific agent references)
- Add Hey CLI alongside GWS/MCP in: README, CLAUDE.md, TERMS_OF_USE,
  DISCLAIMERS, getting-started, gws-setup-guide (renamed sections),
  agents-registry, agents.md, onboarding skill, launchme.sh
- Update all 4 Postman-related skills (email-triage, deadline-radar,
  meeting-prep, weekly-agenda) with Hey CLI commands and backend
  detection
- Expand security section to cover Hey CLI injection vectors
- Keep MCP as read-only fallback for all backends

* Address Copilot review: fix typos, injection rules, platform compat, install hooks

- Fix hey imbox --json typo → hey box imbox --json
- Fix after:{{yesterday}} → newer_than:2d for consistent 48h scan
- Reconcile shell injection rules with hey reply/compose -m (user-approved
  text only, with safe quoting guidance)
- Separate email write ops (GWS/Hey) from calendar write ops (GWS only)
  in TERMS_OF_USE and DISCLAIMERS
- Replace grep -P with POSIX-compatible tab detection in validate-frontmatter
- Add hooks/ and settings.json installation to launchme.sh and updateme.sh
  so .claude/hooks/ paths in settings.json resolve correctly

---------

Co-authored-by: gnekt <dima9610@gmail.com>
2026-03-27 15:51:06 +01:00
lh
547fe06450 Replace MCP Gmail/Calendar with Google Workspace CLI (#9)
* Replace MCP Gmail/Calendar with Google Workspace CLI

Swap all MCP tool references (gmail_*, gcal_*) for gws CLI
equivalents in the postman agent and all 4 postman-related skills.
Add Bash to postman tools for gws execution. Include setup guide
for gws installation and OAuth configuration.

Addresses review feedback: Food Coach and Wellness Guide references
removed (those agents no longer exist on main).

* Update skills/weekly-agenda/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address Copilot review feedback

- Add gmail.send scope to setup guide and agent docs
- Use narrower calendar scopes (calendar.events + calendarlist.readonly)
- Make gcloud optional in prerequisites
- Fix .mcp.json example to remove only Gmail/Calendar entries
- Split label modify into separate add/remove examples
- Replace hard-coded dates with placeholders
- Fix after:{{yesterday}} to newer_than:2d for 48h filtering
- Update all docs/gws-setup-guide.md paths to repo-relative
- Add MCP fallback note for users without gws
- Add mandatory user confirmation before mark-read/archive actions

* Fix PR review findings: add security guardrails and update all MCP references for gws dual-support

- Add Security: External Content section to postman.md to prevent command injection from untrusted email content
- Update agents-registry.md, agents.md, CLAUDE.md, README.md to reflect gws CLI + MCP fallback duality
- Update TERMS_OF_USE.md and DISCLAIMERS.md legal text to mention gws alongside MCP
- Update onboarding skill to present gws as recommended option with MCP as fallback
- Fix placeholder in gws-setup-guide.md (was a raw template, now a concrete date)
- Update agent-template.md to document Bash for CLI tool access pattern

* Harden security for email/calendar operations and update legal coverage

- Postman agent: comprehensive security section covering prompt injection,
  shell injection, write operation safeguards, and Bash command allowlist
- All 4 postman-related skills: add security sections with prompt injection
  defense, shell injection rules, and explicit MCP fallback instructions
- TERMS_OF_USE.md: new Section 4A covering risks from email/calendar read
  and write operations (adversarial content, unintended sends, deletions,
  calendar disruptions), updated Limitation of Liability section
- DISCLAIMERS.md: new section explaining write operation risks in plain
  language, MCP as safer read-only alternative, and acknowledgment of
  prompt-based security limitations

---------

Co-authored-by: gnekt <dima9610@gmail.com>
2026-03-26 18:41:04 +01:00
Gnekt
1ee2dc415f Add custom agent system with orchestration, templates, and broadened legal coverage (#21)
* Add standardized template for custom agent creation

New file: references/agent-template.md

This is a reference document that the Architect reads when generating
custom agents. It defines the exact structure every agent must follow:
YAML frontmatter format, required sections (Language, User Profile,
Inter-Agent Coordination, Core Responsibilities, Operational Rules),
placeholder tokens, and inline conventions (naming rules, tool
permissions, multilingual triggers).

The template is not an agent itself. It is a structural guide that
ensures custom agents are generated with the same quality and
consistency as the core 8.

* Add custom agent support to orchestration references

agents-registry.md:
- Added "Custom Agents" section with rules for how custom agents
  are added to the registry (naming, priority, creation flow)
- Custom agents always have lower priority than core 8
- Names must be lowercase with hyphens, no conflicts with core names

agents.md:
- Added "Custom Agents" section explaining what they are, how they
  coordinate with core agents, and how to create/edit/remove them

agent-orchestration.md:
- Added "Suggested new agent" signal format so agents can flag when
  the user needs functionality that no existing agent provides
- Added step in Dispatcher Decision Logic to check for this signal
- Added "Custom Agent Lifecycle" section covering creation, discovery,
  routing, chaining, maintenance, and deletion

* Add "Suggested new agent" capability to all 7 non-architect agents

Each agent now has a "When to suggest a new agent" subsection inside
its Inter-Agent Coordination block. When an agent detects that the
user needs functionality that no existing agent can handle, it
outputs a "Suggested new agent" section with:
- Need: what capability is missing
- Reason: why no existing agent covers it
- Suggested role: what the new agent would do

The dispatcher reads this and asks the user if they want the
Architect to create a custom agent for the detected need.

Agents are also told when NOT to suggest a new agent (existing
agent can handle it, one-off task, outside vault scope).

* Add full custom agent creation flow to the Architect

The Architect can now create, edit, and remove custom agents through
an extended conversational flow with the user.

Changes to the frontmatter:
- Added trigger phrases for custom agent creation in 6 languages
  ("create a new agent", "custom agent", "crea un nuovo agente", etc.)

New section "Custom Agent Creation" with:
- 5-phase conversation flow (Understanding, Capabilities, Output,
  Advanced, Confirmation) where the Architect asks one question at
  a time and adapts follow-ups based on user answers
- Agent file generation following references/agent-template.md
- Automatic updates to agents-registry.md and agents.md
- Management commands: edit, remove, list custom agents
- Validation rules: no name conflicts with core 8, minimal tool
  permissions by default, mandatory coordination sections
- Quality standards: Core Responsibilities must be detailed enough
  to produce a production-quality agent

Also added the "Suggested new agent" subsection (same as other agents).

* Update dispatcher routing to support custom agents

- Changed "The ONLY agents you may use are these 8" to acknowledge
  that custom agents created by the Architect are also valid
- Added row 9+ to the routing priority table for custom agents
  (always lower priority than core 8)
- Added section 9 "CUSTOM AGENTS" with routing logic: when no core
  agent matches, check agents-registry.md for custom agents
- Added check for "Suggested new agent" signals in the multi-agent
  routing decision flow (step 6)

* Add custom agents to README, CONTRIBUTING, and TERMS_OF_USE

README.md:
- Badge changed from "8 Agents" to "8+ Agents"
- Added custom agents as point 4 of "What makes this different",
  positioned right after the main pitch for maximum visibility
- Includes a table of real-life scenarios (budget tracking, journaling,
  paper reading, project monitoring, client deadline management)
- Links to Terms of Use for the responsibility disclaimer

CONTRIBUTING.md:
- Renamed "Propose a new crew member" to "Propose a new core crew
  member" with a note that users can create custom agents via Architect
- Added "Custom agents vs. core agents" section explaining the
  distinction between personal custom agents and project-shipped
  core agents

TERMS_OF_USE.md:
- Added new Section 9 "Custom Agents" with full disclaimer: custom
  agents are entirely the user's creation and responsibility, no
  warranty on their behavior, author accepts no liability
- Updated Section 7 (Limitation of Liability) to reference custom
  agents explicitly
- Renumbered sections 9-11 to 10-12

* Force the Architect to always run the full conversation before creating a custom agent

The Architect was generating custom agents immediately from a single
user message instead of going through the 5-phase conversation flow.

Added explicit blocking instructions at three points:
- Section intro: "NEVER create an agent in one shot"
- Before the conversation phases: "Do NOT generate the agent
  immediately, even if the request seems clear"
- Explicit rule: "You are NOT allowed to create the agent file
  until Phase 5"
- Reinforced one-question-per-message rule

* Force custom agent descriptions to use only the user's language

The Architect was copying the multilingual pattern from core agents
and adding translations in 6+ languages to custom agent descriptions.

Custom agents should have their description and trigger phrases
written exclusively in the language the user speaks. Reinforced
this rule in both the generation instructions and the validation
rules section.

* Force custom agent body to always be written in English

The frontmatter description uses the user's language (for trigger
matching), but the agent body (system prompt) must always be in
English for better LLM instruction-following performance. The agent
still responds in the user's language at runtime thanks to the
language matching rule.

* Add confirmation prompt before overwriting existing installation

launchme.sh:
- Detects if .claude/ or CLAUDE.md already exist in the vault
- Shows the user what will be overwritten
- Asks for explicit confirmation before proceeding
- Clarifies that custom agents and vault notes are never touched

updateme.sh:
- Asks for confirmation before overwriting core files
- Same clarification about custom agents being preserved

* Deprecate removed files instead of leaving orphans in the vault

When a file is removed from the repo (agents, references, or skills),
the updater now renames it with a "-DEPRECATED" suffix and prepends
a "DEPRECATED DO NOT USE" header instead of silently leaving it.

updateme.sh:
- Core agents in .claude/agents/ that no longer exist in the repo
  get renamed to {name}-DEPRECATED.md with deprecation header
  (custom agents are never touched)
- References in .claude/references/ that no longer exist in the repo
  get the same treatment
- The entire .claude/skills/ directory (removed from the project)
  gets renamed to .claude/skills-DEPRECATED/ with deprecation headers
  on each SKILL.md
- Summary now reports deprecated file count

launchme.sh:
- Added confirmation prompt before overwriting existing installation
- Skills generation and copying kept intact (generate-skills.py runs
  first, then copies to .claude/skills/)

* Add first-run setup section to custom agent template and creation flow

Custom agents now have a "First Run Setup" section that defines what
the agent must do the very first time it is invoked: what questions
to ask the user, what config files or folders to create, and how to
detect that it has already been set up.

agent-template.md:
- New "First Run Setup" section between Core Responsibilities and
  Operational Rules, with subsections for detection, questions to
  ask, what to create, and post-setup behavior

architect.md:
- New Phase 4 "First Run Setup" in the conversational flow where
  the Architect asks the user what the agent should do on first run
- Previous Phase 4 (Advanced) becomes Phase 5
- Previous Phase 5 (Confirmation) becomes Phase 6
- Updated blocking rules to reference Phase 6

* Redesign README header and broaden legal disclaimers for custom agents

Improve README header visual hierarchy: centered title, prominent Discord
CTA, metadata badges moved to secondary row. Replace two custom agent
examples with funnier, gender-neutral ones. Rewrite TERMS_OF_USE Section 3
from "Health and Wellness Agents" to "Custom Agents and Advice-Generating
Output" covering health, legal, financial, and all regulated domains.

* Fix reference paths in architect to use .claude/references/ prefix

The agent runs inside the vault where references live under
.claude/references/, not under references/ (which is the repo layout).

* Fix reference paths in agent-template to use .claude/references/ prefix

* Add core-manifest to protect custom agents from deprecation

launchme.sh and updateme.sh now write .core-manifest listing which agent
files were installed as core. The deprecation loop checks this manifest
before touching any file, so custom agents are never deprecated.

* Skip agent deprecation if target DEPRECATED file already exists

* Include skill count in updateme.sh summary condition and message

* Fix agents-registry.md paths in CLAUDE.md to use .claude/references/ prefix

* Add edit/remove/list trigger phrases to custom agent routing

* Deprecate stale core agents on reinstall before copying new ones

On reinstall (EXISTING=1), read the old .core-manifest and deprecate
any agent that is no longer shipped in the repo, before writing the
new manifest. Prevents stale core agents from lingering in the vault.

* Fix custom agent description: triggers are in user's language, not multilingual

* Fix updateme.sh: deprecate stale agents before rewriting manifest

The manifest was being truncated and rewritten before the deprecation
loop ran, so removed core agents were no longer in the manifest and
got skipped as "custom". Now: read old manifest -> deprecate -> copy
new agents -> rewrite manifest.

* Fix grep exit code handling when removing last entry from manifest

* Fix nested fenced code blocks in agent-template using tildes

* Add core-manifest for references to protect user-created reference docs

Same pattern as agents: launchme/updateme write a .core-manifest in
.claude/references/ listing installed core files. The deprecation loop
only touches files in the manifest, leaving user-created references
untouched.

* Move deprecated files to .claude/deprecated/ to prevent auto-discovery

Deprecated agents kept in .claude/agents/ could still be auto-discovered
by Claude Code via their frontmatter. Moving them to .claude/deprecated/
ensures they are completely invisible to the dispatcher while still
preserved for user reference.

* Harden updateme.sh from Copilot review feedback

Address multiple issues raised during PR code review:

- Skip deprecation entirely when .core-manifest is missing, preventing
  accidental deprecation of custom agents/references on first update
- Preserve user's "## Custom Agents" sections in agents-registry.md and
  agents.md during reference updates (merge strategy instead of overwrite)
- Update confirmation message to accurately reflect what is preserved

* Preserve custom agent content during install and update

- launchme.sh: skip overwriting agents-registry.md and agents.md on
  reinstall to preserve custom agent entries
- updateme.sh: extract and re-insert custom table rows from the
  registry table plus custom sections, preventing data loss when
  updating from upstream
- Require manifest before deprecating to avoid false positives

* Update wardrobe-coach example phrase in README

* Use robust string matching and printf for user-mutable refs

- Replace grep -qw with bash substring match for filename detection
- Replace echo with printf '%s\n' to prevent content mangling

* Enforce step-by-step conversation in Architect and fix registry row reinsertion

- Add HARD CONSTRAINT blocks to both onboarding and custom agent creation
  flows, forcing the use of AskUserQuestion for each question to prevent
  the Architect from skipping phases or bundling questions
- Replace hard-coded "| postman |" match in updateme.sh with generic
  last-table-row detection to avoid breaking custom row reinsertion if
  core agents are renamed or reordered

* Improve input handling in launchme.sh and updateme.sh for non-interactive shells

* Extract 13 skills from agents and update full documentation

Architecture change: complex multi-step flows (onboarding, email triage,
transcription, etc.) are now skills that run in the main conversation
context instead of agent subprocesses. This fixes the state/context loss
that caused agents to skip phases during multi-turn conversations.

Skills created (13):
- Architect: /onboarding, /create-agent, /manage-agent, /defrag
- Postman: /email-triage, /meeting-prep, /weekly-agenda, /deadline-radar
- Transcriber: /transcribe
- Librarian: /vault-audit, /deep-clean, /tag-garden
- Sorter: /inbox-triage

Agent changes:
- architect.md: -70% (1554 → 473 lines)
- transcriber.md: -72% (530 → 147 lines)
- postman.md: -42%, librarian.md: -37%, sorter.md: -11%
- All agents: explicit post-it create-if-not-exists

Scripts:
- launchme.sh/updateme.sh: copy skills/ directly, remove generate-skills.py

Docs updated:
- README.md: new Skills section, mermaid diagrams, routing
- getting-started.md, examples.md: skill references
- docs/agents/*.md: capability tables with skill vs agent routing
- references/agents.md, agent-orchestration.md, agents-registry.md,
  agent-template.md: skill registry, skill-first routing protocol
2026-03-25 12:00:00 +01:00
Gnekt
1df4afb6dd Merge pull request #18 from gnekt/f_13
Replace agent messaging with dispatcher-driven orchestration
2026-03-23 21:38:36 +01:00
gnekt
10ea817aa5 Generate skills into temp dir to avoid polluting git status
- generate-skills.py now respects SKILLS_DIR env var
- launchme.sh and updateme.sh generate into mktemp -d, copy to vault,
  then clean up — no more untracked skills/ left in the repo
- Warn the user when python3 is missing so Cowork/Desktop users know
  why .claude/skills/ is absent
2026-03-23 21:24:20 +01:00
gnekt
89b408217a Update agents.md to use dispatcher-driven coordination language
- Remove "message board archival" from Librarian responsibilities
- Rename "Who to Message for What" → "When to Suggest Another Agent"
- Replace "Message to" column with "Suggest"
- Move coordination explanation above the table
- Update intro line to reflect dispatcher model
2026-03-23 20:39:17 +01:00
gnekt
1ebe161117 Quote Mermaid node label to fix rendering 2026-03-23 20:38:35 +01:00
gnekt
c1c24a65bc Renumber Phase 4 creation checklist in architect.md
Steps jumped from 6 to 8 after removing the agent-messages step.
Now sequential 1-9.
2026-03-23 20:38:19 +01:00
gnekt
a7e5625250 Address Copilot review feedback on PR
- Fix call-chain example consistency in CLAUDE.md and agent-orchestration.md
  (chain lists already-invoked agents, "step N" matches chain length + 1)
- Renumber architect.md Task Checklist (was skipping 3) and replace
  "Leave messages" step with dispatcher-driven "Suggested next agent"
- Replace "Leave a message to the Sorter" with signal via Suggested next agent
- Clarify "Do NOT write to other agents' files" → only prompt/config files
  (.claude/agents/*.md), normal vault edits still allowed
- Fix agent count 10→8 in docs/getting-started.md
- Initialize SKILL_COUNT before conditional block in launchme.sh
2026-03-23 20:24:35 +01:00
gnekt
f35c704550 Update README and CONTRIBUTING for the new architecture
README:
- Removed the "Skills" section since skills/ no longer exists
- Updated the project structure tree to reflect the current layout
- Clarified that agents are discovered natively by Claude Code

CONTRIBUTING:
- Replaced all references to "inter-agent messaging" with the new
  coordination protocol (agent-orchestration.md)
- Updated the agent writing guidelines to use "Suggested next agent"
  output format instead of the old shared file approach
2026-03-23 15:30:31 +01:00
gnekt
c8e2db5053 Update all 8 agents to the new coordination protocol
What changed in every agent file:
- Removed the "Inter-agent messaging" section that referenced the
  old shared file protocol (Meta/agent-messages.md)
- Added a "Suggested next agent" output block so agents can signal
  follow-up work to the dispatcher without invoking other agents
- Simplified the prompts by removing routing logic that is now
  handled centrally by CLAUDE.md

The agents no longer know about each other. They just do their job
and report what else might need attention. The dispatcher decides
whether to chain another agent.
2026-03-23 15:30:28 +01:00
gnekt
65253cdf7c Replace peer-to-peer agent messaging with centralized orchestration
Before this change, agents communicated directly with each other by
writing to a shared file (Meta/agent-messages.md), following the
protocol in references/inter-agent-messaging.md. This was fragile
and hard to control.

Now the dispatcher (CLAUDE.md) is the only coordinator. Agents do
not talk to each other. Instead, when an agent detects work for
another agent (e.g. missing vault structure, orphan notes), it
outputs a "Suggested next agent" section. The dispatcher reads it,
validates it against the agents-registry, and decides whether to
chain the next agent.

New files added:
- references/agent-orchestration.md: the new coordination protocol,
  including call chain tracking, anti-recursion rules, and a max
  depth of 3 agents per user request
- references/agents-registry.md: a capability registry that maps
  each agent to its inputs, outputs, and chaining suggestions

Deleted:
- references/inter-agent-messaging.md: the old peer-to-peer protocol
2026-03-23 15:30:20 +01:00
gnekt
0a7213081c Remove the skills/ directory entirely
The skills/ folder contained 8 SKILL.md files (one per agent) that
were auto-generated wrappers. They duplicated the same logic already
present in the agent files under agents/.

Claude Code discovers agents natively from .claude/agents/ by reading
their YAML frontmatter (name, description, tools, model), so the
skills layer was redundant and has been removed.
2026-03-23 15:30:13 +01:00
gnekt
03a36db2f7 Enhance multi-agent routing and coordination rules in CLAUDE.md 2026-03-22 23:20:55 +01:00
gnekt
8245d7312a Add Discord community badge to README 2026-03-22 21:53:52 +01:00
gnekt
299df8b1c9 REVAMPED 2026-03-22 17:17:30 +01:00