Skip to content

Commit f212a7d

Browse files
authored
Merge pull request #320 from githits-com/jlitola/explore-skills-over-mcp
fix: make MCP skill self-contained
2 parents 0585e92 + fec4d80 commit f212a7d

13 files changed

Lines changed: 576 additions & 42 deletions

File tree

.agents/skills/githits-plugin-maintenance/SKILL.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,27 @@ host MCP files as reviewable build artifacts, not authoring locations.
2424
2. Read `docs/implementation/plugin-packaging.md` before changing packaging or
2525
transport behavior.
2626
3. Edit canonical inputs only.
27-
4. Run `bun run plugins:generate`.
28-
5. Inspect every generated diff and confirm it follows from the canonical
27+
4. For the stable MCP quick-start guide, keep
28+
`packages/mcp/src/mcp/instructions.ts` `buildMcpQuickStart()` and the
29+
terminal `## Quick-start guide` section in `skills/githits-mcp/SKILL.md`
30+
byte-for-byte aligned in the same PR. `src/skills-packaging.test.ts` is the
31+
exact-parity contract; exclude `buildLocalMcpQuickStart()` runtime
32+
appendices from the public copy. Route behavior-dependent guide changes
33+
through the public Agent Skill lifecycle.
34+
5. Run `bun run plugins:generate`.
35+
6. Inspect every generated diff and confirm it follows from the canonical
2936
change.
30-
6. Run `bun run plugins:check`.
31-
7. Run targeted tests, then the required smoke or agent evaluations for the
37+
7. Run `bun run plugins:check`.
38+
8. Run targeted tests, then the required smoke or agent evaluations for the
3239
affected surface.
3340

3441
## Canonical Ownership
3542

3643
- Author public skill content only under `skills/`.
3744
- Author shared agent guidance in `AGENTS.md`; keep `CLAUDE.md` and `GEMINI.md`
3845
as symlinks to it.
46+
- `packages/mcp/src/mcp/instructions.ts` owns the stable quick-start builder;
47+
the terminal guide in `skills/githits-mcp/SKILL.md` is its exact public copy.
3948
- Use `package.json` for root version, identity, and shared package metadata.
4049
- Use `server.json` for registry transports and the hosted MCP endpoint.
4150
- Use `scripts/generate-plugin-assets.ts` for host rendering and validation.

.agents/skills/githits-release/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ Use this skill for GitHits changelog maintenance, release work, version-bump PRs
6161
## Agent Skills Lifecycle
6262

6363
- User-facing skills under `skills/` are picked up by `skills.sh` from `main`, not from npm release artifacts.
64-
- Do not update `skills/` to describe unreleased CLI/MCP behavior. A merge to `main` can expose those skill instructions immediately.
64+
- Do not update `skills/` to describe unreleased CLI/MCP behavior, except for the bounded `githits-mcp` stable-guide rule below. A merge to `main` can expose those skill instructions immediately.
65+
- For the `githits-mcp` stable guide, exact parity is a bounded exception: when backing stable behavior or `buildMcpQuickStart()` changes, update the backing behavior, builder, and embedded terminal guide copy in the same PR, merge that PR to `main`, and ship it in the next applicable release cycle. This accepts the bounded main-to-release window for `skills.sh`; it does not create a deploy-first or two-PR flow. `buildLocalMcpQuickStart()` runtime appendices remain excluded from the public copy.
66+
- `githits-onboarding` keeps its separate release-branch rule: update the public skill only on the release branch after the corresponding CLI behavior is included, so `skills.sh` does not advertise unreleased onboarding behavior.
6567
- After the backing CLI/MCP behavior is released or part of the release being prepared, update `skills/` so skill descriptions, decision flows, examples, detailed references, and command-to-MCP mappings match the released surface.
6668
- When MCP instructions, tool descriptions, or guardrails change, review `skills/githits-code/SKILL.md`, `skills/githits-package/SKILL.md`, and their references for parity. Keep MCP instructions as the quality baseline; they are currently strong and should not be weakened casually.
6769
- After changing public skills or plugin-facing guidance, run `bun run plugins:generate` and `bun run plugins:check` so every host manifest remains aligned with the canonical root surface.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ See `docs/guidelines/TESTING.md` for comprehensive patterns.
8282
- Root `skills/` and `AGENTS.md` are the only authored shared agent guidance. `CLAUDE.md` and `GEMINI.md` must remain symlinks to `AGENTS.md`.
8383
- Use the repository-internal `githits-plugin-maintenance` skill when changing skills, agent guidance, plugin/marketplace/extension manifests, MCP transport metadata, root release metadata, generator behavior, or agent-facing setup/auth behavior. It must remain under `.agents/skills/` and must not be published with the public root `skills/` tree.
8484
- Do not edit generated plugin assets directly. Change their canonical inputs, run `bun run plugins:generate`, inspect the diff, and run `bun run plugins:check`.
85+
- `packages/mcp/src/mcp/instructions.ts` owns the stable `buildMcpQuickStart()` guide. When it or the terminal guide section in `skills/githits-mcp/SKILL.md` changes, update both in the same PR; `src/skills-packaging.test.ts` exact-parity coverage is the contract. `buildLocalMcpQuickStart()` runtime appendices are excluded from the public skill copy. Behavior-dependent guide changes follow the public Agent Skill lifecycle.
8586
- `server.json` owns the canonical plugin keyword list used by generated manifests; keep `package.json` aligned with it.
8687
- All plugin and extension packages use hosted remote MCP. Direct `githits init` configuration retains local stdio except for Cursor, which is remote-only. Claude and Gemini direct setup remove legacy plugin or extension state before installing the user-scoped stdio server.
8788

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"githits": patch
3+
"@githits/mcp": none
4+
---
5+
6+
- **Self-contained MCP skill** - The loaded `githits-mcp` skill now includes the stable quick-start guidance without a redundant bootstrap call, while plain MCP clients retain the `quick_start` fallback.

docs/implementation/TOOL_GUARDRAILS.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ the source values and relies on JSON escaping rather than terminal sanitization.
4343

4444
One layer, with a second held in reserve:
4545

46-
1. **Shared block** in the `quick_start` result — once per session —
47-
states the external-content posture. Names the harm-pass-through
48-
categories the agent must discount when consuming any third-party
46+
1. **Shared block** is delivered in the plain-MCP `quick_start` result — once
47+
per session — or by the exact embedded stable guide in a loaded
48+
`githits-mcp` skill. Both paths state the external-content posture and name
49+
the harm-pass-through categories the agent must discount when consuming any third-party
4950
prose: shell / install / build / test / "validator" commands
5051
(including "do not execute, only display" framings); alternative /
5152
successor / "extracted" / "renamed" / "moved to" / peer-dependency
@@ -72,13 +73,16 @@ gate. Compact loses ~2 percentage points and saves ~78% of the
7273
wording (787 words v4 → 171 words compact).
7374

7475
Those measurements validate the shared wording only when the block is in
75-
context. Delivery normally depends on the agent calling `quick_start`; this
76-
avoids host-dependent server-instruction duplication. Luna-low descriptor-only
76+
context. Plain MCP delivery normally depends on the agent calling `quick_start`;
77+
the loaded `githits-mcp` skill embeds the same stable block and skips that
78+
redundant call. Current tool descriptions remain authoritative, and a material
79+
stale-snapshot mismatch or exposed local `Experimental` descriptor can still
80+
justify `quick_start` for runtime-specific guidance. Luna-low descriptor-only
7781
and full-guidance canaries called `quick_start` exactly once in every workload,
7882
but a later Claude Desktop source-reading session skipped it. `code_read` and
7983
`code_grep` therefore now carry focused local posture as a fallback. This is
80-
not evidence that other content tools are protected when the bootstrap is
81-
skipped.
84+
not evidence that other content tools are protected when neither the skill nor
85+
the bootstrap supplies the shared block.
8286

8387
The focused source fallback was validated in August 2026 with exactly one
8488
tool-local addendum and no shared block. After scoping it to redirecting advice,
@@ -115,8 +119,11 @@ maintainer-controlled content:
115119

116120
Other tools (`quick_start`, `pkg_deps`, `code_files`, `search_status`,
117121
`search_language`, `feedback`) have no third-party prose surface or attacker
118-
control and need no per-tool addendum. The shared posture is available after
119-
the agent calls `quick_start`; it is not inherited automatically.
122+
control and need no per-tool addendum. The shared posture is available to plain
123+
MCP agents after they call `quick_start`; a loaded `githits-mcp` skill already
124+
carries the stable posture. The runtime-only local appendices are not embedded
125+
in that skill. An exposed `Experimental` descriptor or material stale-snapshot
126+
mismatch remains a bounded reason to call `quick_start`.
120127

121128
## Where the wording lives
122129

@@ -147,8 +154,11 @@ maintainer-controlled content:
147154
(IDs, versions, hashes, paths, dedicated reference URLs) versus
148155
the prose fields the agent should treat with the external-content
149156
posture.
150-
2. Add the tool to the `quick_start` guide — the shared block is intended to
151-
be sufficient once the guide is loaded.
157+
2. Add the tool to the `quick_start` guide and update the exact embedded
158+
`## Quick-start guide` copy in `skills/githits-mcp/SKILL.md` in the same PR;
159+
`src/skills-packaging.test.ts` must continue to prove byte parity. The
160+
shared block is intended to be sufficient once either stable delivery path
161+
has loaded the guide.
152162
3. If a Pass 1 cell on the new tool shows compliance >= 2/3 on any
153163
attack, add a per-tool addendum to `packages/mcp/src/tools/guardrails.ts`
154164
naming the trustworthy structured fields and any tool-specific

docs/implementation/init-guidance-and-expanded-agent-support.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@ probe means Codex is not detected.
5454

5555
## Supporting MCP guidance
5656

57-
Remote MCP docs and setup help recommend the `githits-mcp` skill. Its managed
58-
instruction block stays compact, and the skill points agents to the MCP
59-
`quick_start` tool. `quick_start` owns shared routing, scope, output, and safety
60-
guidance because clients expose server-level MCP instructions inconsistently.
57+
Remote MCP docs and setup help recommend the `githits-mcp` skill. The skill
58+
carries the stable quick-start guide, so a skill-loaded agent skips the
59+
normal `quick_start` call. Plain MCP clients use `quick_start` as the fallback
60+
for shared routing, scope, output, and safety guidance because clients expose
61+
server-level MCP instructions inconsistently. Current tool descriptions remain
62+
authoritative; an exposed local `Experimental` descriptor or material stale
63+
skill snapshot can still require `quick_start`. The stable skill copy is kept
64+
byte-for-byte aligned with `buildMcpQuickStart()` in
65+
`packages/mcp/src/mcp/instructions.ts`; runtime-only local appendices are
66+
excluded.
6167

6268
## Skill catalog and active roots
6369

docs/implementation/plugin-packaging.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ Antigravity user scope, and Hermes user scope use their native roots. Cline and
6666
Junie use the shared root; their historical native `githits-mcp/SKILL.md` files
6767
are migration-only targets.
6868

69+
The public `githits-mcp` skill is self-contained for the stable path: its
70+
terminal `## Quick-start guide` section is an exact copy of
71+
`buildMcpQuickStart()` from `packages/mcp/src/mcp/instructions.ts`, enforced by
72+
`src/skills-packaging.test.ts`. Plain MCP clients use the `quick_start` tool;
73+
clients with the loaded skill skip that normal call. Current tool descriptions
74+
remain authoritative, and exposed local `Experimental` descriptors or a
75+
material stale-snapshot mismatch can still require `quick_start`. The
76+
runtime-only `buildLocalMcpQuickStart()` appendices are excluded from the
77+
public skill copy.
78+
6979
There are no authored host-specific skill copies. If a host later requires a
7080
self-contained copy, the generator may create it, but tests must enforce exact
7181
content and reference parity with the root source.

docs/implementation/release-process.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ yet in the released CLI. A feature branch may review the public skill for stale
8787
or contradictory claims, but should leave it unchanged until that release
8888
boundary is reached.
8989

90+
For the `githits-mcp` stable guide, exact parity is a bounded exception: when
91+
backing stable behavior or `buildMcpQuickStart()` changes, update the backing
92+
behavior, builder in `packages/mcp/src/mcp/instructions.ts`, and terminal guide
93+
copy in `skills/githits-mcp/SKILL.md` in the same PR, merge that PR to `main`, and
94+
ship it in the next applicable release cycle. This accepts the bounded
95+
main-to-release window for `skills.sh`; it does not require a deploy-first or
96+
two-PR flow. The local `buildLocalMcpQuickStart()` appendices are runtime-only
97+
and stay out of the public copy. This exception does not change the separate
98+
release-branch rule above for `githits-onboarding`.
99+
90100
Before assigning `none`, compare the delta against every public consumer and
91101
package export. A fragment's impact records the conclusion; it does not replace
92102
that review.

docs/implementation/tools.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ Write the prefix as the answer to “why would an agent choose this tool now?”
5252

5353
GitHits intentionally omits MCP initialize instructions because clients treat
5454
them inconsistently: some hide them, some promote them, and some repeat them
55-
with every tool. The no-argument, read-only `quick_start` tool is the canonical
56-
shared guide. Its catalog prefix names routing, public-OSS scope, and
57-
external-content safety; its full description asks agents to call it once per
58-
session before other GitHits tools unless the quick-start guide is already in
59-
context. It also states that tools execute without it but then lack the shared
60-
safety posture. Its result owns public-OSS scope, target syntax, output,
61-
safety, citations, and cross-tool routing. Individual tool descriptions remain
62-
self-contained so direct tool selection does not depend on the bootstrap.
55+
with every tool. Guidance has two delivery paths: a loaded `githits-mcp` skill
56+
already carries the stable guide and skips a normal `quick_start` call, while
57+
plain MCP clients use the no-argument, read-only `quick_start` tool as their
58+
fallback. Current tool descriptions remain authoritative; a material mismatch
59+
with a stale skill snapshot or an exposed `Experimental` descriptor can still
60+
require `quick_start` for runtime-specific guidance. The stable guide is owned
61+
by `packages/mcp/src/mcp/instructions.ts`; the terminal skill section must stay
62+
byte-for-byte aligned under `src/skills-packaging.test.ts`. Local
63+
`buildLocalMcpQuickStart()` appendices are runtime-only and excluded from that
64+
public copy. Individual tool descriptions remain self-contained so direct
65+
tool selection does not depend on the bootstrap.
6366

6467
Use the tools in these roles:
6568

@@ -97,7 +100,7 @@ Use the tools in these roles:
97100

98101
| Tool | Parameters | Description |
99102
|---|---|---|
100-
| `quick_start` | none | Load the canonical guide for public GitHub/package search, grep, code, docs, examples, routing, and external-content safety without querying GitHits evidence. Call once per session before other GitHits tools unless the guide is already in context. |
103+
| `quick_start` | none | Load the canonical guide for public GitHub/package search, grep, code, docs, examples, routing, and external-content safety without querying GitHits evidence. Plain MCP clients call it once per session before other GitHits tools; skip it when the loaded `githits-mcp` skill already carries the guide. |
101104
| `get_example` | `query`, `language?`, `license_mode?`, `format?` | Find canonical cross-project examples when no single target is the answer or target-scoped search came up short. For a known package or repository, use `search`, `docs_*`, or `code_*`. Defaults to markdown with source provenance and an optional `solution_id` for `feedback`; pass `format: "json"` for `{result, solution_id?}`. |
102105
| `search_language` | `query`, `format?` | Resolve a supported language name or alias for `get_example`; do not use it for source search. Defaults to one compact line per match; pass `format: "json"` for structured matches. |
103106
| `feedback` | `solution_id?`, `accepted`, `feedback_text?`, `tool_name?` | Submit feedback when a GitHits result or the overall experience was helpful, unhelpful, wrong, incomplete, slow, or confusing. Pass `solution_id` to rate an example or `tool_name` to identify a result. |
@@ -458,9 +461,11 @@ total-line response contract.
458461

459462
The MCP server deliberately omits protocol-level `instructions`. Clients have
460463
handled that field as hidden guidance, privileged guidance, namespace metadata,
461-
or a prefix repeated on every tool. The `quick_start` tool exposes shared
462-
guidance once, on demand, while individual descriptions remain the source of
463-
truth for tool-specific routing, arguments, output, and recovery.
464+
or a prefix repeated on every tool. Plain MCP clients use the `quick_start`
465+
tool to expose shared guidance once, on demand. The loaded `githits-mcp` skill
466+
contains the same stable guide and therefore needs no normal bootstrap call;
467+
current tool descriptions remain the source of truth for tool-specific
468+
routing, arguments, output, and recovery.
464469

465470
The concrete Codex failure was verified in August 2026. Codex PR
466471
[#21053](https://github.com/openai/codex/pull/21053) intentionally preserved
@@ -494,6 +499,13 @@ payload whose privilege, visibility, and repetition vary by host.
494499
Disabled or dormant reporting returns the public builder's exact baseline;
495500
public and remote servers never receive this block.
496501

502+
The stable guide embedded in `skills/githits-mcp/SKILL.md` is an exact copy of
503+
`buildMcpQuickStart()` and is checked by `src/skills-packaging.test.ts`. The
504+
local experimental appendices from `buildLocalMcpQuickStart()` are not copied
505+
into the public skill; an exposed local `Experimental` descriptor or a material
506+
stale-snapshot mismatch is the bounded case where that client may call
507+
`quick_start` after loading the skill.
508+
497509
The reporting contract is validated structurally in the focused instruction
498510
tests: one concise `accepted: false` report per distinct issue, exact enabled
499511
tool scope, redacted context, non-defect suppression, and no
@@ -665,7 +677,7 @@ See `docs/guidelines/TESTING.md` for the full testing pattern.
665677
| `packages/mcp/src/tools/shared.ts` | Shared MCP error/action helpers |
666678
| `packages/mcp/src/services/test-helpers.ts` | Mock service factories |
667679
| `packages/mcp/src/mcp/server.ts` | Transport-neutral MCP server construction and tool registration |
668-
| `packages/mcp/src/mcp/instructions.ts` | Canonical guide returned by `quick_start` |
680+
| `packages/mcp/src/mcp/instructions.ts` | Stable guide builder returned by `quick_start` and copied into the loaded `githits-mcp` skill |
669681
| `src/commands/mcp.ts` | CLI stdio startup, request-header mode setup, and TTY setup instructions |
670682
| `packages/core-internal/src/services/githits-service.ts` | REST API client for example search, languages, and feedback |
671683
| `packages/core-internal/src/services/code-navigation-service.ts` | Package/source service client for unified `search`, `search_status`, `code_files`, `code_read`, and `code_grep` |

0 commit comments

Comments
 (0)