eslint-plugin-custom-rule

作成者: coinbase

eslint-plugin-cdsパッケージ用の新しいeslintプラグインルールを作成するよう求められた場合にこれを使用してください

npx skills add https://github.com/coinbase/cds --skill eslint-plugin-custom-rule

Writing new rules

Process

When asked to create a new custom rule for the package, follow these steps in order:

  1. Run the scaffold-new-rule.mjs script found at packages/eslint-plugin-cds/scripts/scaffold-new-rule.mjs. The script should be used every time a new rule is created. This script will ensure that the same format is used for all custom rules created.
  2. Ask the user what the custom rule should do. If the user doesn't provide enough context in the prompt, ask for clarification or follow up. Do not make assumptions about how a custom rule is meant to behave or what guideline it's supposed to enforce. After gathering the needed context, ask the user which package(s) the rule should be applied to.
  3. Once you have all the needed context, ask the user to provide at least one valid and one invalid example demonstrating when the custom rule is being followed or not. This will help you to write tests for the custom rule in a future step. Similar to step 2, if the provided examples do not give you enough context to understand the difference between a valid versus invalid example, ask the user for clarification. Do not proceed until the user has provided at least one valid and one invalid example and you have enough needed context to understand a valid and invalid example.
  4. Based on the user's provided context, fill in the rule file generated under the src/rules directory. The main section you should fill out is the create() function key that's in the rule object. You can refer to packages/eslint-plugin-cds/src/rules/custom-rule.ts for more documentation on how custom rules are formatted and information to enter. Custom rules should use the AST visitor methods to determine when rules have been violated and should report warnings in the linter. Custom rules should also verify the packages being imported before performing AST parsing. If a file doesn't import a package specified in step 2, do not report an error in the custom rule. Most custom rules already do this. As an example, you can refer to the ImportDeclaration() function in the no-v7-imports rule found here: packages/eslint-plugin-cds/src/rules/no-v7-imports.ts. The rule only reports an error when one of the CDS_PACKAGES packages is used,
  5. Using the context from step 3, write in valid and invalid test cases for the test file generated from the scaffold-new-rule.mjs script. The valid and invalid examples provided in step 3 should be included. Based off those examples and the rule criteria provided in step 2, you can add additional valid or invalid examples.

Directory placement

Custom rules should always be placed in the packages/eslint-plugin-cds/src/rules directory. Tests for each custom rule should be placed in the packages/eslint-plugin-cds/tests directory.

coinbaseのその他のスキル

git.repo-manager
coinbase
git.repo-manager — coinbase/cds が公開する、AIエージェント向けのインストール可能なスキルです。
official
agentic-wallet
coinbase
awal CLIによる暗号ウォレット操作 — サインイン、残高確認、USDC/ETH/POL/SOLの送金、トークン取引、ウォレットへの資金追加、x402支払いプロトコルの使用…
official
authenticate-wallet
coinbase
メールOTPベースのウォレット認証、検証、ステータス確認機能。2段階ログインフロー:メールで6桁のOTPを受信し、flowIdとコードで検証して認証を完了。コマンド実行前にシェルインジェクションを防ぐため、メール、flowId、OTPの入力検証ルールを実装。ステータス確認、残高照会、アドレス取得、ウォレットウィンドウアクセスをCLIコマンドで提供。全コマンドは機械可読な--json出力に対応。
official
fund
coinbase
Coinbase Onrampまたは直接送金でウォレットにUSDCを入金します。ユーザーがプリセット金額($10、$20、$50)またはカスタム値を選択し、Apple Pay、デビットカード、銀行振込、Coinbaseアカウントからの資金調達方法を選べる補助UIを開きます。カードとApple Payは即時、ACH銀行振込は1~3日と、決済時間が異なる複数の支払い方法に対応しています。Baseネットワーク上でUSDCとして資金を入金します。また、npx awal@2.0.3...経由でウォレットアドレスに直接USDCを送金することもできます。
official
monetize-service
coinbase
有料APIエンドポイントをデプロイし、他のエージェントがx402プロトコルを介して発見・支払いできるようにします。HTTP 402支払いプロトコルを使用してBase上でリクエストごとにUSDCを請求。クライアントは署名済みトランザクションで支払い、APIキーやアカウントは不要。ディスカバリー拡張を宣言すると、エンドポイントが自動的にx402 Bazaarに登録され、エージェントによる発見が可能に。Expressミドルウェアを使用して、エンドポイントごとに複数の価格帯、ワイルドカードルート、複数の支払いオプションをサポート。@x402/expressおよび@x402/core上に構築...
official
pay-for-service
coinbase
Base上でx402プロトコルを介した自動USDC支払いにより有料APIを呼び出します。x402対応エンドポイントに対してHTTPリクエスト(GET、POSTなど)を実行し、USDC支払いを自動的に処理します。メソッド、JSONボディ、クエリパラメータ、カスタムヘッダーを通じたリクエストのカスタマイズをサポートします。支払い制御機能を含みます:リクエストごとの最大USDC金額の設定、相関IDによる関連操作のグループ化。ウォレット認証と十分なUSDC残高が必要です。シェルインジェクションを防ぐため、すべてのユーザー入力を検証します...
official
query-blockchain-data
coinbase
BaseのCDP SQL APIを介してx402を使用し、オンチェーンのブロックチェーンデータをクエリします。あなたまたはユーザーがデコードされたブロックに関するオンチェーン情報を確認したい場合に使用します。
official
query-onchain-data
coinbase
Base上のオンチェーンデータをSQLでクエリし、クエリごとにx402支払いを行います。CoinbaseQL(ClickHouseベースのSQL方言)を介して、デコードされたイベント、トランザクション、ブロックにアクセス可能。結合、CTE、サブクエリ、標準関数をサポート。利用可能な3つの主要テーブル:base.events(デコードされたスマートコントラクトログ)、base.transactions(完全なトランザクションデータ)、base.blocks(ブロックメタデータ)。イベントクエリでは、インデックス付きフィールド(event_signature、address、block_timestamp)でのフィルタリングが必要で、全テーブルスキャンを回避します。
official