Skip to content

feat: discover the owner's existing sources at profile setup - #204

Merged
titanwings merged 5 commits into
dot-skillfrom
feat/owner-discovery
Oct 12, 2026
Merged

titanwings merged 5 commits into
dot-skillfrom
feat/owner-discovery

Conversation

@titanwings

Copy link
Copy Markdown
Owner

Requested by Tianyi · project thread

Stacked on #197 and #201, and already merged with dot-skill (including #202). Until #197 and #201 merge, this PR also shows their commits. Only the last commit, feat: discover the owner's existing sources at profile setup, is new here.

Summary

Before: the owner flow described a fixed set of source types (calendar, mail, docs, code), and the agent had to work out on its own whether it could reach any of them.

After: at setup, the agent first takes stock of what it can already reach:

  • the tools, connectors, MCP servers and memory in its own session;
  • the platform it runs on (for example Grok and the owner's X account);
  • what tools/owner_sources.py discover finds on the machine: host user and memory files, configured MCP servers, related skills, and personal exports in ~/Downloads.

It then proposes one small, read-only slice per source and asks the owner which sources to use and whether to add anything else. Nothing is read until the owner picks it.

Changes

  • tools/owner_sources.py (new):
    • discover reports local sources by name only. It never prints commands, args, env values or tokens, and never opens exports.
    • It reads the config locations of Claude Code, Claude Desktop, Codex, Hermes and Cursor, plus OpenClaw's workspace and skills.
    • classify maps any source or tool name to a category hint (mail, calendar, social, docs, code, chat, media, ai_memory) with the slice to read and what it teaches. Health and finance are flagged as sensitive, and unmatched names come back as unknown for the agent to judge from the tool description.
  • prompts/owner/intake.md: new Step 0 (discover), Step 1 (propose a plan and ask "which ones, anything else?") and Step 2 (read only the approved sources). The interview then asks only what the sources did not answer.
  • prompts/owner/profile_builder.md: source labels are now <category>: <name>.
  • SKILL.md: the owner flow describes discovery instead of a fixed list, in both languages.
  • tests/test_owner_sources.py: 8 unit tests, including one checking that config secrets never appear in the report.
  • tests/e2e/owner_discovery/ and docs/examples/owner-discovery-e2e.md: a harness and a recorded run in a real Claude Code CLI.

Motivation

Personal agents already hold the owner's connections and memory, and which ones differ from host to host. Discovering them works across hosts without maintaining a list of every app.

Testing

  • python -m unittest discover -s tests -p 'test_*.py' passed (109 tests)
  • python -m compileall tools/ passed
  • node bin/distilly.mjs --check-package passed
  • Manually tested end to end in Claude Code 2.1.296. I used a fresh HOME with mock gmail, google-calendar, x and weather MCP connectors serving fictional data, plus an X archive in ~/Downloads. See docs/examples/owner-discovery-e2e.md.
    • The agent found all four connectors and the archive, and skipped weather.
    • It asked which sources to use and read only the chosen ones: sent mail only, the past four weeks of calendar, and the owner's own posts.
    • It never called the send or post tools.
    • It wrote the profile with a source per fact, kept the existing CLAUDE.md line and made a backup.
    • A new session then used the profile correctly.

Not covered: real Gmail, Calendar or X connectors, and cloud agents such as Grok Bot or OpenAI Dots. These use the same prompt but were not run here.

Checklist

  • I read CONTRIBUTING.md
  • Docs updated (SKILL.md, owner prompts, example)
  • No secrets, tokens, or personal data committed (test data is fictional)
  • No new dependencies
  • Tests added

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27


Generated by Claude Code

Adds an owner family (self/yourself/me alias to it) that interviews the
agent's own user and writes a short always-on summary between Distilly
markers into the host user file (Claude Code ~/.claude/CLAUDE.md,
OpenClaw workspace USER.md). The full profile stays at
~/.distilly/owner/profile.md. It is context about the user, not a
role-play Skill, so skill_writer refuses the owner family.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
The owner intake now starts by checking what the host already knows
(memory, existing user files, connected tools), then asks only for what
is missing, and can read connected calendar, mail, docs, code or user
exports read-only with the user's OK. Distilly never asks for keys or
OAuth on this path. Profiles record a source per fact, and the summary
limit is resolved per host.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
At owner init the agent now inventories what it can already reach (its
own tools, connectors and memory, the platform it runs on, and what
tools/owner_sources.py finds on the machine: host user files, configured
MCP servers, related skills and personal exports), proposes a read-only
slice per source, and asks the owner which to use and what to add.

owner_sources.py reports names only, never config values. Includes a
recorded end-to-end run in Claude Code with mock connectors and the
harness to reproduce it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y32jGbUW3JKCyeeySUBm27
@titanwings titanwings self-assigned this Oct 12, 2026
…very

# Conflicts:
#	SKILL.md
#	prompts/owner/intake.md
#	prompts/owner/profile_builder.md
#	tests/test_owner_profile.py
@titanwings
titanwings marked this pull request as ready for review October 12, 2026 08:31
@titanwings
titanwings merged commit 113bb93 into dot-skill Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants