Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,72 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## pstack-claude

Selected reliability, safety, and policy improvements—including pull-request
watcher hardening (`tools/meta-mode/watch-pr/`), worktree audit hold gates
(`tools/meta-mode/worktree-audit.mjs`), Windows CRLF handling in `statechart`,
decision-log quote neutralization, `MSTACK_SESSION_HOOK` environment override,
comment-reviewer `HOLD` policy, playbook safeguards, and reference/invariant
tests—are adapted from
[`michael-denyer/pstack-claude`](https://github.com/michael-denyer/pstack-claude)
under the MIT License.

### pstack-claude MIT license

MIT License

Copyright (c) 2026 Michael Denyer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## t3-pstack

Selected T3 Code integration improvements—including external dependency caching
in `tools/meta-mode/bootstrap.ts`, optional review-settle window support
(`tools/meta-mode/watch-pr/settle.ts`), read-only `-b`/`--base` and `--fetch`
worktree audit semantics, T3 provider home discovery (`scripts/t3-homes.mjs`),
and T3 catalog/panel-family validation—are adapted from
[`chhoumann/t3-pstack`](https://github.com/chhoumann/t3-pstack) under the MIT
License.

### t3-pstack MIT license

MIT License

Copyright (c) 2026 Christian Bager Bach Houmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 3 additions & 1 deletion agents/comment-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ That list is my only leash. When I am not sure a keep clause applies, the commen

`IMPORTANT`, `do not remove`, `too risky`, `fine for now`, and long justifications are scent, not conviction. Before judging, I read nearby code. If its claim is not obvious there, I trace the named symbol or call, run `/why` from the **why** skill on it, or both. Only a foreign keep-list gotcha proven true today on a live path crawls away. Our-code surprises die with the reshape flag above. Doubt after the hunt is meat.

`/how` and `/why` read our code, so they cannot prove a rule that a dependency, platform, vendor, or protocol sets. When a comment states such a rule, I hunt in the documentation or source code of whatever sets it. A comment whose rule they confirm for this code crawls away under the keep list. One whose rule they refute, or show binds something else, dies, and the kill cites the page or file. When I cannot reach either, or what I read leaves the rule unsettled, the comment stays put as a `HOLD`, the one case where doubt is not meat.

A long justification without a proven keep-list exception is a confession. Kill it. Never polish meat into a shorter alibi. Mark the exact guilty symbol `MUST KILL`. My kill ends there. I do not touch the code.

Every flag names code inside the scope and tells the truth. I invent nothing. I touch comments and identify refactor targets. I never write application code.

Report only. Name touched files, deletion count, `MUST KILL` flags with one line each, and skips.
Report only. Name touched files, deletion count, each kill of a comment that states a dependency, platform, vendor, or protocol rule with the page or file it cites, `MUST KILL` flags with one line each, each `HOLD` with the rule it states and where to check it, and skips.
16 changes: 9 additions & 7 deletions docs/t3code.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This page was checked against the T3 Code source at commit `8f75697` (October 20
| Claude Code | T3 scans the directories | `<config dir>/skills`, where the config dir is the instance's home path, else `CLAUDE_CONFIG_DIR`, else `~/.claude` | `<cwd>/.claude/skills` only |
| Cursor | T3 scans the directories | `~/.cursor/skills`, `~/.agents/skills`, `~/.codex/skills`, `~/.claude/skills` | The same four names under `<cwd>` |
| Grok | `grok inspect --json` | Grok's own; on Grok CLI 1.0.62 both `~/.agents/skills` and `~/.claude/skills` were reported | Grok's own, not checked |
| Antigravity | T3 scans the directories | `~/.gemini/config/skills`, `~/.gemini/antigravity-cli/skills`. Not `~/.agents/skills`. | `<cwd>/.gemini/skills`, `<cwd>/.agents/skills`, `<cwd>/.agent/skills` |
| Antigravity | T3 scans the directories | T3 runs each Antigravity instance with a private profile (`${T3CODE_HOME:-~/.t3}/userdata/providers/antigravity/<sha256(instanceId)>`) instead of `~/.gemini`; outside T3, `~/.gemini/config/skills` and `~/.gemini/antigravity-cli/skills`. Not `~/.agents/skills`. | `<cwd>/.gemini/skills`, `<cwd>/.agents/skills`, `<cwd>/.agent/skills` |
| Pi | Pi (`get_commands`) | Pi's own | Pi's own; approve the project in Pi first |
| OpenCode | OpenCode, per project directory | OpenCode's own | OpenCode's own |
| ACP Registry agents | The agent; commands it names with a `$` prefix | Agent-defined | Agent-defined |
Expand All @@ -29,14 +29,15 @@ npx @3metajun/mstack --harness codex,claude,pi

- Codex, Pi, OpenCode, and Cursor read the shared copy. Grok read it on 1.0.62.
- Claude Code needs its own copy in `~/.claude/skills`, which `--harness claude` writes. The installer leaves out the frontmatter `name` there because Claude Code names a skill after its directory.
- Antigravity does not read `~/.agents/skills`, and it needs the frontmatter `name`, so the Claude copy does not work for it either. Use an `antigravity` harness if your mstack version has one (`npx @3metajun/mstack --help` lists the harnesses). Otherwise install the canonical copy into its directory by overriding the Codex target:
- Antigravity does not read `~/.agents/skills`, and it needs the frontmatter `name`, so the Claude copy does not work for it either. Use `--harness antigravity` for `~/.gemini/antigravity-cli/skills` outside T3, or point `HARNESS_SKILLS_ANTIGRAVITY_DIR` at the T3 private profile path printed by `npm run check-t3`:

```bash
HARNESS_SKILLS_CODEX_DIR='~/.gemini/antigravity-cli/skills' \
npx @3metajun/mstack --harness codex --dry-run
npx @3metajun/mstack --harness antigravity --dry-run
# Inside T3, check your instance's private profile path first:
npm run check-t3
```

Drop `--dry-run` once the printed plan looks right. On Windows PowerShell, set `$env:HARNESS_SKILLS_CODEX_DIR` first.
Drop `--dry-run` once the printed plan looks right. On Windows PowerShell, set `$env:HARNESS_SKILLS_ANTIGRAVITY_DIR` before running the installer when targeting a T3 private profile.

After installing, run **Restart agent session** from the command palette (web and desktop). The conversation continues and the next message starts the agent with the new skills. If a skill is still missing, open **Settings → Providers** and refresh that provider's status.

Expand All @@ -62,7 +63,8 @@ A mention only counts when the name matches `[a-zA-Z0-9][a-zA-Z0-9:_-]*`, contai
- **Invalid YAML hides a skill.** Cursor and Antigravity skip a skill whose frontmatter fails strict YAML parsing. Claude Code tolerates an unquoted `: ` inside a plain scalar and T3 repairs it for Claude only, so a description like `description: Use when: x` works in Claude and vanishes in Cursor. Quote any description that contains `: `.
- **Antigravity needs `name`.** Without it T3 falls back to the file name and lists the skill as `SKILL`. Its project directories include `.agents/skills`, so a committed project wrapper is found there, but `~/.agents/skills` is only scanned when the project is your home directory.
- **Windows home directories differ.** Claude and mstack's installer use the OS home directory (`USERPROFILE`). Cursor checks `HOME` first, then `USERPROFILE`. Antigravity uses `USERPROFILE`, then `HOMEDRIVE` plus `HOMEPATH`. If `HOME` is set to something else in the environment T3 runs in, Cursor looks in a different place than the installer wrote.
- **Instance settings are not inherited by your own commands.** A Claude instance with a custom home path, or environment variables set on a provider instance, apply to the agent T3 starts. A terminal or script you run yourself, including `npx @3metajun/mstack`, does not see them. For a Claude instance with its own config directory, point the installer there explicitly with `HARNESS_SKILLS_CLAUDE_DIR=<that directory>/skills`.
- **Instance settings are not inherited by your own commands.** A Claude instance with a custom home path, an Antigravity instance with a T3 private profile (`~/.t3/userdata/providers/antigravity/<sha256(instanceId)>`), or environment variables set on a provider instance apply to the agent T3 starts. A terminal or script you run yourself, including `npx @3metajun/mstack`, does not see them. Run `npm run check-t3` (or `node scripts/t3-homes.mjs`) to inspect every provider instance configured in `${T3CODE_HOME:-~/.t3}/userdata/settings.json` and print the exact install command for any missing target.
- **Codex plugin hook trust.** Codex 0.164 and later trust a plugin's hooks by hashing every file in the installed plugin directory. `tools/meta-mode/bootstrap.ts` therefore caches `watch-pr` production dependencies under `${XDG_CACHE_HOME:-~/.cache}/mstack/meta-mode-tools/` instead of writing `node_modules/` into the plugin tree.
- **Project skills for Pi** need the project approved in Pi, and then a provider refresh.

## Worktrees
Expand All @@ -79,7 +81,7 @@ By default T3 creates a worktree for a thread at:

- Run it from the main checkout or from any worktree of the same repository; it skips the main worktree.
- The `PR` column asks `gh` for PRs you authored and matches them by branch name, so a worktree whose branch has no PR shows `-`.
- `LAST_CHAT` scans Claude Code, Codex, and pi transcripts only. Threads run through Cursor, Grok, OpenCode, or Antigravity, and T3's own thread history, are not read, so those worktrees can look idle. Set `MSTACK_TRANSCRIPTS_DIR` to scan one directory instead.
- `LAST_CHAT` scans Claude Code, Codex, pi, and GitHub Copilot (`COPILOT_HOME` / `~/.copilot/session-state`) transcripts only. Threads run through Cursor, Grok, OpenCode, or Antigravity, and T3's own thread history, are not read, so those worktrees can look idle. Set `MSTACK_TRANSCRIPTS_DIR` to scan one directory instead.
- Treat its `safe` bucket as a report. T3 has its own cleanup under **Settings → Storage** that removes only T3-managed worktrees without running sessions or uncommitted work. I did not check how T3 reacts when a worktree it manages is removed with `git worktree remove`, so use T3's cleanup or thread deletion for those.

## Project install for T3 worktrees
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"audit-context": "node scripts/audit-context.mjs",
"check-package": "node scripts/check-package.mjs",
"check-models": "node scripts/model-config.mjs",
"check-t3": "node scripts/t3-homes.mjs",
"model-budget": "node scripts/model-budget.mjs",
"check-upstream": "node scripts/check-upstream.mjs",
"check-playbooks": "node tools/meta-mode/check-playbooks.mjs",
Expand All @@ -33,7 +34,7 @@
"install-skills": "node scripts/install.mjs",
"optimize-context": "node scripts/optimize-context.mjs",
"reconcile-context": "node scripts/reconcile-context.mjs",
"test": "node scripts/validate.mjs && node scripts/skill-baseline.mjs --check && node --test scripts/install.test.mjs scripts/install-migration.test.mjs scripts/migration-integration.test.mjs scripts/skill-discovery.test.mjs scripts/harness-targets.test.mjs scripts/remote-discovery.test.mjs scripts/context.test.mjs scripts/model-config.test.mjs scripts/model-budget.test.mjs scripts/audit-context.test.mjs scripts/worktree-audit.test.mjs scripts/sync-upstream.test.mjs scripts/runtime.test.mjs scripts/environment.test.mjs scripts/skill-integrity.test.mjs scripts/skill-baseline.test.mjs scripts/version-integrity.test.mjs scripts/agent-format.test.mjs scripts/history.test.mjs scripts/harness-policy.test.mjs scripts/harness-project.test.mjs scripts/check-upstream-adaptations.test.mjs scripts/check-playbooks.test.mjs scripts/pack-claude-skills.test.mjs scripts/session-hook.test.mjs scripts/skill-compat.test.mjs scripts/host-binding.test.mjs scripts/upstream-drift.test.mjs"
"test": "node scripts/validate.mjs && node scripts/skill-baseline.mjs --check && node --test scripts/install.test.mjs scripts/install-migration.test.mjs scripts/migration-integration.test.mjs scripts/skill-discovery.test.mjs scripts/harness-targets.test.mjs scripts/remote-discovery.test.mjs scripts/context.test.mjs scripts/model-config.test.mjs scripts/model-budget.test.mjs scripts/audit-context.test.mjs scripts/worktree-audit.test.mjs scripts/sync-upstream.test.mjs scripts/runtime.test.mjs scripts/environment.test.mjs scripts/skill-integrity.test.mjs scripts/skill-baseline.test.mjs scripts/version-integrity.test.mjs scripts/agent-format.test.mjs scripts/history.test.mjs scripts/harness-policy.test.mjs scripts/harness-project.test.mjs scripts/check-upstream-adaptations.test.mjs scripts/check-playbooks.test.mjs scripts/pack-claude-skills.test.mjs scripts/session-hook.test.mjs scripts/skill-compat.test.mjs scripts/host-binding.test.mjs scripts/upstream-drift.test.mjs scripts/t3-homes.test.mjs scripts/skill-references.test.mjs scripts/readme-facts.test.mjs scripts/test-discovery.test.mjs scripts/invariants.test.mjs"
},
"bin": {
"mstack": "scripts/install.mjs",
Expand Down
Loading
Loading