Skip to content

Commit b6e8f56

Browse files
committed
feat: remove claude-self-obs plugin — hooks now managed by qyl.collector
Hook lifecycle moved to qyl.collector via attach/detach endpoints. Users control observability via MCP tools (qyl.observe_claude / qyl.stop_observing_claude) or the dashboard Settings > Integrations toggle. - Delete plugins/claude-self-obs/ (plugin.json, README, hooks.json, status command) - Update marketplace.json: 11→10 plugins, 26→25 commands - Remove .gitignore exception for claude-self-obs/server/dist/ - Update test sessions: remove session-2-self-obs, renumber remaining - Add CHANGELOG removal entry
1 parent 060b895 commit b6e8f56

File tree

18 files changed

+530
-189
lines changed

18 files changed

+530
-189
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"url": "https://github.com/ANcpLua"
66
},
77
"metadata": {
8-
"description": "Claude Code plugin marketplace: 11 plugins, 26 commands, 5 skills, 19 agents. Multi-agent orchestration, cognitive amplification, OpenTelemetry docs, .NET build enforcement, design intelligence, and self-observability."
8+
"description": "Claude Code plugin marketplace: 10 plugins, 25 commands, 5 skills, 19 agents. Multi-agent orchestration, cognitive amplification, OpenTelemetry docs, .NET build enforcement, and design intelligence."
99
},
1010
"plugins": [
1111
{
@@ -62,12 +62,6 @@
6262
"version": "2.1.0",
6363
"source": "./plugins/qyl-instrumentation"
6464
},
65-
{
66-
"name": "claude-self-obs",
67-
"description": "Self-observability for Claude Code: HTTP hooks POST every tool call and agent lifecycle event to qyl.collector. Query telemetry via qyl.mcp tools.",
68-
"version": "3.0.0",
69-
"source": "./plugins/claude-self-obs"
70-
},
7165
{
7266
"name": "design-studio",
7367
"description": "Design intelligence studio: creative direction + data-driven recommendations. 50 styles, 97 palettes, 57 font pairings, 99 UX guidelines, 25 chart types, 13 stacks. BM25 search engine with design system generator.",

.github/codex/prompts/review.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Codex pull request review
2+
3+
Review only the changes introduced by the current pull request.
4+
5+
## Available environment variables
6+
7+
- `PR_NUMBER`
8+
- `PR_BASE_SHA`
9+
- `PR_HEAD_SHA`
10+
- `PR_AUTHOR`
11+
- `PR_HEAD_REF`
12+
13+
## Repository context
14+
15+
This repository is a Claude Code plugin marketplace.
16+
17+
- Primary files: `SKILL.md`, `plugin.json`, Markdown docs, shell scripts, YAML workflows
18+
- User-facing changes should update `CHANGELOG.md`
19+
- `.cs` and `.csproj` files do not belong in this repo
20+
21+
## Required review flow
22+
23+
1. Run `git diff --name-status "$PR_BASE_SHA...$PR_HEAD_SHA"`
24+
2. Run `git diff --stat "$PR_BASE_SHA...$PR_HEAD_SHA"`
25+
3. Read `AGENTS.md`, `README.md`, and `CLAUDE.md` if you need repo conventions
26+
4. Read the changed files and any nearby context required to review them well
27+
5. Ignore unrelated pre-existing issues
28+
29+
## Review rules
30+
31+
- Ground every finding in the actual diff or repository rules
32+
- Do not speculate about undocumented Claude Code behavior or private Anthropic docs
33+
- Do not suggest changes based on unofficial or unverifiable platform guidance
34+
- Prefer concrete, actionable feedback over style nitpicks
35+
- Request changes only for blocking issues that would break automation, validation, or published guidance
36+
37+
## Checklist
38+
39+
- GitHub Actions workflow safety and correctness
40+
- Prompt quality, clarity, and task grounding
41+
- JSON, Markdown, and YAML validity
42+
- Shell command safety and quoting
43+
- `CHANGELOG.md` coverage for user-facing changes
44+
- No forbidden repo content
45+
46+
## Output requirements
47+
48+
Return JSON that matches the provided schema.
49+
50+
- Set `event` to `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`
51+
- Set `body` to concise Markdown with these sections:
52+
- `## Codex Review`
53+
- `**Verdict:** ...`
54+
- `### Summary`
55+
- `### Findings`
56+
- `### Strengths`
57+
- If you found no issues, write `- None.` under `### Findings`
58+
- End with `*Autonomous review by Codex via GitHub Actions*`
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [
6+
"event",
7+
"body"
8+
],
9+
"properties": {
10+
"event": {
11+
"type": "string",
12+
"enum": [
13+
"APPROVE",
14+
"REQUEST_CHANGES",
15+
"COMMENT"
16+
]
17+
},
18+
"body": {
19+
"type": "string",
20+
"minLength": 1,
21+
"maxLength": 20000
22+
}
23+
}
24+
}

.github/workflows/auto-merge.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# 1a. Dependabot PRs: Auto-approve + auto-merge for patch/minor
55
# 1b. Renovate PRs: Auto-approve + auto-merge
66
# 2. AI Agent fix PRs (copilot/, claude/): Auto-merge when CI passes
7-
# 3. CodeRabbit/Claude approved PRs: Auto-merge when CI passes
7+
# 3. CodeRabbit/Claude/Codex approved PRs: Auto-merge when CI passes
88
#
99
# Requirements:
1010
# - Repo setting "Allow auto-merge" must be enabled
@@ -168,4 +168,25 @@ jobs:
168168
PR_NUMBER: ${{ github.event.pull_request.number }}
169169
run: |
170170
echo "Claude approved PR #$PR_NUMBER"
171-
gh pr merge --auto --squash "$PR_URL"
171+
gh pr merge --auto --squash "$PR_URL"
172+
173+
# Tier 3c: Auto-merge PRs approved by Codex
174+
# SECURITY: Requires github-actions[bot] to prevent spoofing by humans
175+
codex-approved-auto-merge:
176+
name: Codex approved auto-merge
177+
runs-on: ubuntu-latest
178+
if: |
179+
github.event_name == 'pull_request_review' &&
180+
github.event.review.state == 'approved' &&
181+
github.event.review.user.login == 'github-actions[bot]' &&
182+
contains(github.event.review.body, '## Codex Review')
183+
184+
steps:
185+
- name: Enable auto-merge for Codex approved PRs
186+
env:
187+
PR_URL: ${{ github.event.pull_request.html_url }}
188+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189+
PR_NUMBER: ${{ github.event.pull_request.number }}
190+
run: |
191+
echo "Codex approved PR #$PR_NUMBER"
192+
gh pr merge --auto --squash "$PR_URL"

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ jobs:
178178
179179
**Alternative reviewers:**
180180
- CodeRabbit (Tier 3a auto-merge)
181+
- Codex Code Review
181182
- Human codeowner (@ANcpLua)
182183
- Other AI reviewers (Gemini, Copilot)
183184
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
name: Codex Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, ready_for_review]
6+
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'PR number to review'
10+
required: true
11+
type: number
12+
13+
jobs:
14+
check-files:
15+
name: Check Changed Files
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
pull-requests: read
20+
outputs:
21+
skip_codex: ${{ steps.check.outputs.skip }}
22+
steps:
23+
- name: Check for Codex workflow-only changes
24+
id: check
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
28+
run: |
29+
FILES=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json files -q '.files[].path')
30+
31+
if echo "$FILES" | grep -qvE '^(\.github/workflows/codex-code-review\.yml|\.github/codex/)'; then
32+
echo "PR contains non-Codex-review files - Codex will review"
33+
echo "skip=false" >> "$GITHUB_OUTPUT"
34+
else
35+
echo "PR only modifies Codex review automation files - skipping self-review"
36+
echo "skip=true" >> "$GITHUB_OUTPUT"
37+
fi
38+
39+
codex-review:
40+
name: Codex Review
41+
needs: check-files
42+
if: needs.check-files.outputs.skip_codex != 'true'
43+
runs-on: ubuntu-latest
44+
continue-on-error: true
45+
permissions:
46+
contents: read
47+
pull-requests: write
48+
env:
49+
HAS_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY != '' }}
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v6
53+
with:
54+
ref: refs/pull/${{ github.event.pull_request.number || inputs.pr_number }}/merge
55+
fetch-depth: 0
56+
57+
- name: Load pull request metadata
58+
id: pr
59+
env:
60+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
62+
run: |
63+
gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" \
64+
--json number,baseRefName,baseRefOid,headRefName,headRefOid,author,isDraft \
65+
> pr.json
66+
67+
{
68+
echo "number=$(jq -r '.number' pr.json)"
69+
echo "base_ref=$(jq -r '.baseRefName' pr.json)"
70+
echo "base_sha=$(jq -r '.baseRefOid' pr.json)"
71+
echo "head_ref=$(jq -r '.headRefName' pr.json)"
72+
echo "head_sha=$(jq -r '.headRefOid' pr.json)"
73+
echo "author=$(jq -r '.author.login' pr.json)"
74+
echo "draft=$(jq -r '.isDraft' pr.json)"
75+
} >> "$GITHUB_OUTPUT"
76+
77+
- name: Decide whether to run Codex
78+
id: gate
79+
env:
80+
AUTHOR: ${{ steps.pr.outputs.author }}
81+
IS_DRAFT: ${{ steps.pr.outputs.draft }}
82+
HAS_OPENAI_API_KEY: ${{ env.HAS_OPENAI_API_KEY }}
83+
run: |
84+
if [ "$IS_DRAFT" = 'true' ]; then
85+
{
86+
echo 'run=false'
87+
echo 'reason=Draft pull request'
88+
} >> "$GITHUB_OUTPUT"
89+
exit 0
90+
fi
91+
92+
case "$AUTHOR" in
93+
dependabot[bot]|renovate[bot]|github-actions[bot])
94+
{
95+
echo 'run=false'
96+
echo 'reason=Bot-authored pull request'
97+
} >> "$GITHUB_OUTPUT"
98+
exit 0
99+
;;
100+
esac
101+
102+
if [ "$HAS_OPENAI_API_KEY" != 'true' ]; then
103+
{
104+
echo 'run=false'
105+
echo 'reason=OPENAI_API_KEY is unavailable for this run'
106+
} >> "$GITHUB_OUTPUT"
107+
exit 0
108+
fi
109+
110+
{
111+
echo 'run=true'
112+
echo 'reason=Review enabled'
113+
} >> "$GITHUB_OUTPUT"
114+
115+
- name: Pre-fetch base and head refs
116+
if: steps.gate.outputs.run == 'true'
117+
run: |
118+
git fetch --no-tags origin \
119+
"${{ steps.pr.outputs.base_ref }}" \
120+
"+refs/pull/${{ steps.pr.outputs.number }}/head"
121+
122+
- name: Run Codex Review
123+
if: steps.gate.outputs.run == 'true'
124+
id: run_codex
125+
uses: openai/codex-action@v1
126+
env:
127+
PR_NUMBER: ${{ steps.pr.outputs.number }}
128+
PR_BASE_SHA: ${{ steps.pr.outputs.base_sha }}
129+
PR_HEAD_SHA: ${{ steps.pr.outputs.head_sha }}
130+
PR_AUTHOR: ${{ steps.pr.outputs.author }}
131+
PR_HEAD_REF: ${{ steps.pr.outputs.head_ref }}
132+
with:
133+
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
134+
prompt-file: .github/codex/prompts/review.md
135+
output-file: codex-review.json
136+
output-schema-file: .github/codex/schemas/review-output.schema.json
137+
codex-args: --full-auto
138+
safety-strategy: drop-sudo
139+
sandbox: read-only
140+
141+
- name: Post Codex review
142+
if: steps.gate.outputs.run == 'true'
143+
env:
144+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
PR_NUMBER: ${{ steps.pr.outputs.number }}
146+
run: |
147+
jq -e '.event and .body' codex-review.json >/dev/null
148+
jq -r '.body' codex-review.json > codex-review-body.md
149+
REVIEW_EVENT=$(jq -r '.event' codex-review.json)
150+
151+
case "$REVIEW_EVENT" in
152+
APPROVE) REVIEW_FLAG='--approve' ;;
153+
REQUEST_CHANGES) REVIEW_FLAG='--request-changes' ;;
154+
COMMENT) REVIEW_FLAG='--comment' ;;
155+
*)
156+
echo "::error::Unsupported review event: $REVIEW_EVENT"
157+
exit 1
158+
;;
159+
esac
160+
161+
gh pr review "$PR_NUMBER" \
162+
--repo "${{ github.repository }}" \
163+
"$REVIEW_FLAG" \
164+
--body-file codex-review-body.md
165+
166+
- name: Log skipped Codex review
167+
if: steps.gate.outputs.run != 'true'
168+
run: |
169+
echo "Skipping Codex review"
170+
echo "Reason: ${{ steps.gate.outputs.reason }}"
171+
172+
skip-notification:
173+
name: Skip Notification
174+
needs: check-files
175+
if: needs.check-files.outputs.skip_codex == 'true'
176+
runs-on: ubuntu-latest
177+
permissions:
178+
pull-requests: write
179+
steps:
180+
- name: Post skip notification
181+
env:
182+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183+
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
184+
run: |
185+
gh pr comment "$PR_NUMBER" --repo "${{ github.repository }}" --body "## Codex Code Review - Skipped
186+
187+
This PR only modifies Codex review automation files. Codex cannot review changes to its own workflow or prompt files.
188+
189+
**Alternative reviewers:**
190+
- Claude Code Review
191+
- CodeRabbit
192+
- Human codeowner (@ANcpLua)
193+
194+
---
195+
*This is expected behavior, not an error.*"

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
# --- Node / TypeScript ---
1111
node_modules/
1212
dist/
13-
# Allow compiled MCP server dist (users shouldn't need to build)
14-
!plugins/claude-self-obs/server/dist/
1513
out/
1614
coverage/
1715
*.log

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
### Added
1010

11+
- **Codex PR review automation**: Added `.github/workflows/codex-code-review.yml`, `.github/codex/prompts/review.md`, and `.github/codex/schemas/review-output.schema.json`. Codex now reviews pull requests in a read-only sandbox, returns structured verdicts, publishes formal GitHub reviews, and skips PRs that only modify Codex review automation
1112
- **metacognitive-guard `InstructionsLoaded` hook**: Truth beacon now fires on both SessionStart AND InstructionsLoaded — ground truth re-injected when CLAUDE.md/rules are loaded, ensuring authoritative facts arrive after instructions context
1213
- **metacognitive-guard `agent_type` filtering**: Struggle detector and Ralph Loop now skip subagents via `agent_type` field in hook events — prevents wasted haiku calls and false positives from subagent responses
1314
- **`design-studio` plugin (1.0.0)**: Design intelligence studio merging creative direction with data-driven recommendations. Combines `frontend-design` (Anthropic plugin — bold aesthetic philosophy, anti-generic guidelines) with `ui-ux-pro-max` (local skill — BM25 search engine, 750+ CSV rows, design system generator). Single unified workflow: creative direction → `--design-system` CLI → domain/stack searches → implementation with aesthetic precision. 50 styles, 97 palettes, 57 font pairings, 99 UX guidelines, 25 chart types, 13 stacks. Pre-delivery checklist includes creative distinctiveness check. Python stdlib-only, no pip dependencies
@@ -28,6 +29,7 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2829

2930
### Removed
3031

32+
- **`claude-self-obs` plugin removed from marketplace**: Hook lifecycle now managed by qyl.collector via attach/detach endpoints. qyl owns the hooks — users control observability via MCP tools (`qyl.observe_claude` / `qyl.stop_observing_claude`) or the dashboard Settings > Integrations toggle. No more error spam when collector is down
3133
- **`claude-self-obs` standalone server**: Deleted `server/` directory (TypeScript MCP server, node_modules, dist, package.json, tsconfig.json) and `.mcp.json` registration. ~300 lines TS + 58K npm dependencies eliminated. Query capabilities now provided by qyl.mcp (registered globally)
3234
- **`claude-self-obs` bash scripts**: Deleted `emit-span.sh` (83 lines), `emit-agent-start.sh` (60 lines), `emit-agent-stop.sh` (67 lines). Dependencies on `jq`, `python3`, `curl` eliminated
3335

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ Add the marketplace, then install plugins individually:
4545

4646
8 plugins, 23 commands, 4 skills, 14 agents, 21 scripts, 7 hook configs.
4747

48-
Tri-AI review system: Claude, Copilot, CodeRabbit all review PRs independently.
48+
Quad-AI review system: Claude, Codex, Copilot, and CodeRabbit review PRs independently.
49+
50+
## GitHub review automation
51+
52+
Codex review lives in `.github/workflows/codex-code-review.yml`.
53+
54+
- Set the `OPENAI_API_KEY` repository secret to enable the workflow
55+
- Codex runs in a `read-only` sandbox with `drop-sudo`
56+
- The workflow posts a formal PR review from structured Codex output
57+
- Self-review is blocked when a PR only changes Codex review automation files
4958

5059
```text
5160
plugins/

0 commit comments

Comments
 (0)