Skip to content

feat: merge plugin-store-community + PRD optimization#2

Merged
mig-pre merged 71 commits into
okx:mainfrom
mig-pre:feat/prd-optimization
Apr 5, 2026
Merged

feat: merge plugin-store-community + PRD optimization#2
mig-pre merged 71 commits into
okx:mainfrom
mig-pre:feat/prd-optimization

Conversation

@mig-pre
Copy link
Copy Markdown
Collaborator

@mig-pre mig-pre commented Apr 5, 2026

Summary

Merges okx/plugin-store-community into a single unified repository per PRD requirements.

Key changes:

  • Repo merge: 14 community plugins moved into skills/ alongside official plugin (single path)
  • CLI relocated: src/cli/src/ to separate CLI source from plugin content
  • 5 community CI workflows migrated and adapted (lint, build, AI review, summary, publish)
  • CLI code updated: removed community repo special logic, all paths point to unified repo
  • registry.json: all repo refs updated to okx/plugin-store, added trust_source/risk_level/category fields
  • marketplace.json: lists all 15 plugins with ./skills/<name> source paths
  • CODEOWNERS: permission control for core/reviewer teams
  • .claude-plugin/plugin.json: added to all 22 plugins (Claude Skill architecture compliance)
  • Pre-flight injection: installs onchainos CLI + onchainos Skills + plugin-store Skill + install report
  • Install reporting: moved from CLI-only to SKILL.md pre-flight (works with npx skills add)

New documentation:

  • docs/FOR-USERS.md — non-technical user guide (677 lines)
  • docs/FOR-DEVELOPERS.md — developer guide with 3 submission modes (870+ lines)
  • docs/FOR-PARTNERS.md — partner guide with high-risk brand isolation policy
  • docs/REVIEW-GUIDELINES.md — public review standards (4-stage pipeline)
  • README.md — rewritten for all user roles

Backward compatibility:

  • plugin-store install CLI command still works (registry.json format compatible)
  • npx skills add okx/plugin-store --skill <name> works for all 15 plugins (verified)
  • Old CLI binary ignores new registry fields (serde default behavior)

Test plan

E2E verified on fork (MigOKG/plugin-store):

  • 7 test plugins (5 languages + pure skill + stub) — all CI phases pass
  • npx skills add installs all plugins correctly (Found 22 skills)
  • Pre-flight injects onchainos CLI + Skills + plugin-store Skill + install report
  • OnchainOS ETH price query returns live data
  • Rust/Go/TypeScript/Python CLIs call onchainos successfully
  • Install report fires to Vercel stats + OKX API
  • CLI compiles with zero warnings (cargo build --release)
  • All lint checks pass (plugin-store lint)

🤖 Generated with Claude Code

yz06276 and others added 30 commits April 5, 2026 19:52
- Move CLI source to cli/ directory
- Merge 14 community plugins into skills/ (single path)
- Add CODEOWNERS for permission control
- Migrate 5 community CI workflows with path updates (submissions/ → skills/)
- Update CLI Rust code: remove community repo special logic, update paths
- Update registry.json: repo refs, add trust_source/risk_level/category fields
- Rewrite marketplace.json: all 15 plugins with ./skills/<name> source paths
- Rewrite README.md: 4-screen layout for all user roles
- Add docs/FOR-USERS.md: non-technical user guide (677 lines)
- Add docs/FOR-DEVELOPERS.md: developer guide with 3 submission modes (818 lines)
- Add docs/FOR-PARTNERS.md: partner guide with high-risk policy
- Add docs/REVIEW-GUIDELINES.md: public review standards
- Add .github/security-rules, prompts, scripts, PR template
- Full npx skills add compatibility preserved
- Backward compatible with published plugin-store CLI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update .gitignore: add /cli/target, remove docs/ and skills/okx-* exclusions
- Remove 7071 build artifact files from git tracking
- Add docs/ (FOR-USERS, FOR-DEVELOPERS, FOR-PARTNERS, REVIEW-GUIDELINES)
- Add skills/okx-buildx-hackathon-agent-track/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove plugin directory table (per PM feedback)
- Replace plugin-store install/list/search with npx skills add commands
- Keep category, risk level, and trust indicator tables

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test-pure-skill: Pure SKILL.md, no binary
- test-rust-cli: Rust CLI + OnchainOS ETH price query
- test-go-cli: Go CLI + OnchainOS ETH price query
- test-ts-cli: TypeScript/Bun CLI + OnchainOS ETH price query
- test-node-cli: Node.js CLI + OnchainOS ETH price query
- test-python-cli: Python script + OnchainOS ETH price query
- test-stub-external: Mode B external repo pointer (MigOKG/test-stub-skill)

All pass plugin-store lint. All CLIs compile and run successfully.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
onchainos uses `token price-info --address <addr> --chain <chain>` not `token price ETH`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Change checkout condition from source_mode=='local' to source_mode!='external'
  (handles case where source_mode output is empty)
- Add fallback: local_source_dir → plugin_dir when source_mode is not external
- Fix all 5 build jobs (Rust, Go, TypeScript, Node.js, Python)
- Fix plugin-summary.yml: use head.sha instead of head.ref

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scripts are now in the same repo at .github/scripts/, no need to
sparse-checkout from okx/plugin-store anymore.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Checkout uses SHA (detached HEAD), so git push needs explicit branch target.

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

plugin-summary.yml was incorrectly adding 'ai-reviewed' label.
Changed to 'summary-generated' to distinguish from AI code review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generated from plugin.yaml metadata for all plugins missing this file.
Required by skill-review.yml and follows Claude Skill architecture standard.

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

- Add to directory layout as required
- Add full field reference table
- Add Step 4 in Quick Start for creating plugin.json
- Note that name/description/version must match plugin.yaml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Install onchainos CLI + onchainos skills (npx skills add okx/onchainos-skills)
- Install plugin-store skill (npx skills add okx/plugin-store --skill plugin-store)
- Fix binary download URL: plugin-store-community → plugin-store

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moves install count reporting from CLI-only (plugin-store install) to
SKILL.md pre-flight, so npx-installed plugins also report usage.

- Reports to Vercel stats API (name + version)
- Reports to OKX API (pluginName + device ID)
- Runs once per plugin using ~/.plugin-store/reported/<name> flag file
- Fire-and-forget: curl errors silenced, never blocks the user

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yz06276 and others added 20 commits April 5, 2026 22:19
…st plugins

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove 7 test plugins (test-pure-skill, test-rust-cli, test-go-cli,
test-ts-cli, test-node-cli, test-python-cli, test-stub-external) and
their entries from registry.json and marketplace.json.

These were used for E2E verification of the merged repo CI pipeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mig-pre mig-pre merged commit 431e4b6 into okx:main Apr 5, 2026
1 check failed
mig-pre added a commit that referenced this pull request Apr 6, 2026
feat: merge plugin-store-community + PRD optimization
skylavis-sky referenced this pull request in skylavis-sky/plugin-store Apr 12, 2026
….md scenario hints

- config: add clear_credentials() that removes ~/.config/polymarket/creds.json
- buy/sell: detect NOT AUTHORIZED / UNAUTHORIZED from CLOB, auto-clear cached
  creds and bail with "run again to re-derive" (stale credential recovery okx#9)
- buy: accepting_orders guard in resolve_market_token — bails early with clear
  error for closed/resolved markets before any wallet calls (#2)
- SKILL.md: six targeted one-liners for common deviation scenarios:
  URL slug extraction (#1), short-lived market warning (#3),
  amount-vs-shares clarification (okx#5), no-Polymarket-deposit note (okx#10),
  cancel open-orders-only note (okx#11), price=probability clarification (okx#12)
- SKILL.md: credential rotation section updated to mention auto-clear

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SamSee-314 pushed a commit that referenced this pull request Apr 27, 2026
Bug fixes (all observed in 10h production log, onchainos 2.2.2, EOA mode, Polygon 137):

#1 PATH: onchainos_bin() now tries ~/.local/bin/onchainos before bare "onchainos".
   Non-interactive shells (Claude Code Bash) never source ~/.zshrc so the binary
   was "os error 2" on every call. POLYMARKET_ONCHAINOS_BIN env var for test injection.

#2 NegRisk redeem: removed hard-block ("not supported for neg_risk markets").
   Plugin now calls NegRiskAdapter.redeemPositions(bytes32, uint256[]) after
   querying on-chain ERC-1155 balances via decimal_str_to_hex64 + get_ctf_balance.

#3 Stale allowance: buy now uses get_usdc_allowance (direct eth_call) instead of
   get_balance_allowance (CLOB API). CLOB API returned stale/MAX_UINT values that
   caused redundant approval transactions on every trade.

#4 MAX_UINT approval: approve_usdc now approves u128::MAX unconditionally instead
   of the specific order amount. Exact-amount approvals downgraded pre-existing
   MAX_UINT allowances to that amount, causing re-approval on every trade.

#5 Partly resolved by #3: eliminating redundant approves removes ~95% of TEE
   sign-tx failures. Root TEE issue on genuine first-time approvals is upstream.

#6 Timeout: approval wait raised 30s → 90s (POLYMARKET_APPROVE_TIMEOUT_SECS env
   var). Polygon at 5-10s/block + congestion routinely exceeded 30s.

Tests (first suite — 16 tests, zero network calls):
- decimal_str_to_hex64: zero, small values, u64::MAX, u128::MAX, invalid inputs
- ABI encoding: build_negrisk_redeem_calldata length, offset, amounts, selector
- CTF.redeemPositions selector correctness
- approve_timeout_secs: default 90s, env override, invalid env fallback
- onchainos_bin: env override, bare-name fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SamSee-314 pushed a commit that referenced this pull request Apr 27, 2026
…s tests

Adds two integration test modules covering all 6 production bugs fixed in v0.4.11.
Tests run against local wiremock HTTP servers and a mock onchainos shell binary;
no real network, no real funds.

Test infrastructure:
- src/lib.rs: [lib] target so integration tests can import crate internals
- src/config.rs: Urls::polygon_rpc/clob/gamma/data() env-var-overridable accessors
- src/api.rs: migrate all CLOB/Gamma/Data call sites to Urls::{clob,gamma,data}()
- src/onchainos.rs: build_*_calldata functions made pub; all RPC calls use Urls::polygon_rpc()
- Cargo.toml: [lib] section; wiremock/tempfile dev-deps
- tests/common/mod.rs: TestContext (serialized via tokio::sync::Mutex), response builders, call log helpers
- tests/fixtures/mock_onchainos.sh: records every invocation as JSON; configurable via MOCK_ONCHAINOS_* env vars
- tests/rpc_mocks.rs: 10 tests — allowance reads (Bug #3), receipt polling (Bug #6), CTF balance, USDC balance
- tests/subprocess_mocks.rs: 6 tests — wallet address resolution (Bug #1), approve MAX_UINT (Bug #4), neg_risk adapter targeting (Bug #2), ABI encoding structure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mig-pre pushed a commit that referenced this pull request Apr 28, 2026
fix(polymarket): v0.5.1 QA bugs + GEN-001 structured errors
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