Skip to content

chore: move skill file to skills/soroswap-sdk/SKILL.md for agent skills CLI discovery#10

Open
miguelnietoa wants to merge 1 commit into
soroswap:mainfrom
miguelnietoa:chore/skill-md-discovery
Open

chore: move skill file to skills/soroswap-sdk/SKILL.md for agent skills CLI discovery#10
miguelnietoa wants to merge 1 commit into
soroswap:mainfrom
miguelnietoa:chore/skill-md-discovery

Conversation

@miguelnietoa

@miguelnietoa miguelnietoa commented Jun 11, 2026

Copy link
Copy Markdown

Closes #9.

Moves soroswap-sdk-skill.md to skills/soroswap-sdk/SKILL.md so the skills.sh website and skills CLI can auto-detect it. Content is unchanged; the frontmatter was already valid.

After this change, installation works directly:

npx skills add soroswap/sdk

and the skill becomes eligible for listing on skills.sh, with consumers getting version pinning in skills-lock.json and update detection via npx skills update.

I left a one-line soroswap-sdk-skill.md stub pointing to the new path so existing links (for example the community skill card on skills.stellar.org) don't break.

… discovery

The skills CLI (npx skills) only auto-detects files named SKILL.md, so
the skill was not installable from this repo. Content is unchanged; a
stub is left at the old path so existing links keep working.

Closes soroswap#9
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR reorganizes Soroswap SDK documentation to meet the skills CLI tool's auto-discovery requirement for files named SKILL.md. A comprehensive new guide is added to skills/soroswap-sdk/SKILL.md, and the original soroswap-sdk-skill.md is converted into a redirect stub pointing to the new location.

Changes

SDK Documentation and Skill Registration

Layer / File(s) Summary
Complete SDK integration documentation
skills/soroswap-sdk/SKILL.md
New comprehensive reference covering SDK initialization with API key security, keypair and wallet transaction signing, swap operations (quote → build → sign → send) with request/response examples, liquidity operations (add/remove/positions), read-only queries (prices, pools, balances, assets, addresses), send response type discrimination by result kind, backend proxy patterns (Next.js and Express implementations), error handling with status code inspection, and common pitfalls (BigInt usage, smallest-unit amounts, enum mismatches, liquidity ratio constraints, referralId requirements, and frontend API key exposure).
Documentation relocation redirect
soroswap-sdk-skill.md
Original file replaced with a short "Moved" notice and npx skills add soroswap/sdk installation instruction directing users to the new skill location.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The SDK guide hops to a new home so bright,
Where skills CLI finds it with pure delight!
From soroswap-sdk-skill to SKILL.md's door,
Now npx skills discovers what we adore! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: relocating the skill file to the correct directory structure for CLI discovery.
Linked Issues check ✅ Passed The PR directly addresses issue #9 by moving soroswap-sdk-skill.md to skills/soroswap-sdk/SKILL.md, enabling npx skills CLI auto-detection.
Out of Scope Changes check ✅ Passed All changes are scoped to the skill file relocation and stub creation; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/soroswap-sdk/SKILL.md`:
- Around line 96-139: The sdk.send call is using three arguments but the method
signature only accepts (xdr, network); update calls to sdk.send so they pass
only the signed XDR and the SupportedNetworks enum (remove the extraneous
boolean). Locate the send invocation(s) (symbol: sdk.send) in the sample and
replace sdk.send(signedXdr, false, SupportedNetworks.MAINNET) with a
two-argument call sdk.send(signedXdr, SupportedNetworks.MAINNET) (and do the
same for the earlier duplicate instance mentioned).
- Line 70: Update the three incorrect calls to sdk.send in the Backend Signing
example, Full Swap Flow example, and Express backend example to match the actual
signature send(xdr: string, network?: SupportedNetworks): remove the extraneous
middle boolean argument (the `false`) so each call becomes
sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET) or sdk.send(xdr) as
appropriate; verify the examples around the Backend Signing, Full Swap Flow and
Express backend sections use the two-parameter form consistent with the Quick
Reference entry send(xdr, network?).
- Around line 398-429: The sdk.send(...) invocation incorrectly passes a third
boolean argument; update the call to match the sdk.send signature by removing
the extraneous false argument from the sdk.send(signedXdr, false) call
(referencing the sdk.send function) or, if you need to specify network, pass it
using the supported parameter shape for SoroswapSDK.send rather than adding a
third positional boolean; edit the example in SKILL.md where sdk.send is used to
either call sdk.send(signedXdr) or the proper form that accepts an explicit
network option.
- Around line 56-71: The SKILL.md example passes an extra boolean to sdk.send
which doesn't match the method signature; update the example calls to sdk.send
to only pass the XDR string and optional network enum (e.g.,
sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET)), and apply the same
change to the Express example so both use the correct signature; locate
references to sdk.send, TransactionBuilder.fromXDR, Keypair.fromSecret, and
transaction.sign in the markdown to make the edits.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03173076-f00b-414c-b72e-4621fea89f52

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3852b and 97ff866.

📒 Files selected for processing (2)
  • skills/soroswap-sdk/SKILL.md
  • soroswap-sdk-skill.md

Comment on lines +56 to +71

For scripts, bots, or server-side execution where you control the signing key:

```typescript
import { Keypair, Networks, Transaction, TransactionBuilder } from "@stellar/stellar-sdk";

// After receiving XDR from any SDK method:
const transaction = TransactionBuilder.fromXDR(
response.xdr,
Networks.PUBLIC // or Networks.TESTNET
) as Transaction;

transaction.sign(Keypair.fromSecret(process.env.STELLAR_SECRET_KEY as string));

const result = await sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET);
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for the send method signature in the SDK source
rg -nP --type=ts -C3 'async\s+send\s*\(' src/

Repository: soroswap/sdk

Length of output: 548


Fix incorrect sdk.send() arguments in SKILL.md example

The SDK method signature is async send(xdr: string, network?: SupportedNetworks), but the example calls sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET), passing an extra false argument that doesn’t belong to the method and will break/cause type errors for anyone copy-pasting.

🐛 Proposed fix
-const result = await sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET);
+const result = await sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET);

Also ensure the Express example uses the same sdk.send(xdr, network?) calling convention.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/soroswap-sdk/SKILL.md` around lines 56 - 71, The SKILL.md example
passes an extra boolean to sdk.send which doesn't match the method signature;
update the example calls to sdk.send to only pass the XDR string and optional
network enum (e.g., sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET)),
and apply the same change to the Express example so both use the correct
signature; locate references to sdk.send, TransactionBuilder.fromXDR,
Keypair.fromSecret, and transaction.sign in the markdown to make the edits.


transaction.sign(Keypair.fromSecret(process.env.STELLAR_SECRET_KEY as string));

const result = await sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Three instances of incorrect sdk.send() signature across the file.

Lines 70, 134, and 426 all call sdk.send() with an invalid middle parameter. The actual signature is send(xdr: string, network?: SupportedNetworks) (two parameters), but these examples pass three arguments. The false parameter in the middle position does not exist and will cause type errors.

This affects the Backend Signing example (line 70), the Full Swap Flow example (line 134), and the Express backend example (line 426).

The Quick Reference table at line 340 correctly documents the signature as send(xdr, network?).

🐛 Proposed fixes for all three instances

Line 70:

-const result = await sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET);
+const result = await sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET);

Line 134:

-const result = await sdk.send(signedXdr, false, SupportedNetworks.MAINNET);
+const result = await sdk.send(signedXdr, SupportedNetworks.MAINNET);

Line 426:

-  const result = await sdk.send(signedXdr, false);
+  const result = await sdk.send(signedXdr);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const result = await sdk.send(transaction.toXDR(), false, SupportedNetworks.MAINNET);
const result = await sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/soroswap-sdk/SKILL.md` at line 70, Update the three incorrect calls to
sdk.send in the Backend Signing example, Full Swap Flow example, and Express
backend example to match the actual signature send(xdr: string, network?:
SupportedNetworks): remove the extraneous middle boolean argument (the `false`)
so each call becomes sdk.send(transaction.toXDR(), SupportedNetworks.MAINNET) or
sdk.send(xdr) as appropriate; verify the examples around the Backend Signing,
Full Swap Flow and Express backend sections use the two-parameter form
consistent with the Quick Reference entry send(xdr, network?).

Comment on lines +96 to +139
```typescript
import {
SoroswapSDK,
QuoteRequest,
BuildQuoteRequest,
TradeType,
SupportedNetworks,
SupportedProtocols,
} from "@soroswap/sdk";

// 1. Get a quote
const quoteRequest: QuoteRequest = {
assetIn: "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75", // USDC contract
assetOut: "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA", // XLM contract
amount: 1000000000n, // 100 USDC (7 decimals) - MUST be BigInt
tradeType: TradeType.EXACT_IN, // or TradeType.EXACT_OUT
protocols: [SupportedProtocols.SOROSWAP, SupportedProtocols.AQUA],
slippageBps: 50, // 0.5% slippage in basis points
maxHops: 2, // Optional: max routing hops
};

const quote = await sdk.quote(quoteRequest, SupportedNetworks.MAINNET);
// quote.amountIn, quote.amountOut, quote.priceImpactPct, quote.routePlan

// 2. Build transaction XDR from quote
const buildRequest: BuildQuoteRequest = {
quote,
from: "GXXXXXXX...", // Sender wallet address
to: "GXXXXXXX...", // Optional: recipient (defaults to 'from')
};

const buildResponse = await sdk.build(buildRequest, SupportedNetworks.MAINNET);
// buildResponse.xdr - unsigned transaction XDR

// 3. Sign the XDR (see Transaction Signing section above)
const signedXdr = signTransaction(buildResponse.xdr);

// 4. Send signed transaction
const result = await sdk.send(signedXdr, false, SupportedNetworks.MAINNET);

if (result.success && result.result?.type === "swap") {
console.log(`Swapped ${result.result.amountIn} for ${result.result.amountOut}`);
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix incorrect parameter count in sdk.send() call.

Line 134 has the same issue as line 70: sdk.send() only accepts two parameters (xdr and optional network), not three. The false parameter should be removed.

🐛 Proposed fix
-const result = await sdk.send(signedXdr, false, SupportedNetworks.MAINNET);
+const result = await sdk.send(signedXdr, SupportedNetworks.MAINNET);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```typescript
import {
SoroswapSDK,
QuoteRequest,
BuildQuoteRequest,
TradeType,
SupportedNetworks,
SupportedProtocols,
} from "@soroswap/sdk";
// 1. Get a quote
const quoteRequest: QuoteRequest = {
assetIn: "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75", // USDC contract
assetOut: "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA", // XLM contract
amount: 1000000000n, // 100 USDC (7 decimals) - MUST be BigInt
tradeType: TradeType.EXACT_IN, // or TradeType.EXACT_OUT
protocols: [SupportedProtocols.SOROSWAP, SupportedProtocols.AQUA],
slippageBps: 50, // 0.5% slippage in basis points
maxHops: 2, // Optional: max routing hops
};
const quote = await sdk.quote(quoteRequest, SupportedNetworks.MAINNET);
// quote.amountIn, quote.amountOut, quote.priceImpactPct, quote.routePlan
// 2. Build transaction XDR from quote
const buildRequest: BuildQuoteRequest = {
quote,
from: "GXXXXXXX...", // Sender wallet address
to: "GXXXXXXX...", // Optional: recipient (defaults to 'from')
};
const buildResponse = await sdk.build(buildRequest, SupportedNetworks.MAINNET);
// buildResponse.xdr - unsigned transaction XDR
// 3. Sign the XDR (see Transaction Signing section above)
const signedXdr = signTransaction(buildResponse.xdr);
// 4. Send signed transaction
const result = await sdk.send(signedXdr, false, SupportedNetworks.MAINNET);
if (result.success && result.result?.type === "swap") {
console.log(`Swapped ${result.result.amountIn} for ${result.result.amountOut}`);
}
```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/soroswap-sdk/SKILL.md` around lines 96 - 139, The sdk.send call is
using three arguments but the method signature only accepts (xdr, network);
update calls to sdk.send so they pass only the signed XDR and the
SupportedNetworks enum (remove the extraneous boolean). Locate the send
invocation(s) (symbol: sdk.send) in the sample and replace sdk.send(signedXdr,
false, SupportedNetworks.MAINNET) with a two-argument call sdk.send(signedXdr,
SupportedNetworks.MAINNET) (and do the same for the earlier duplicate instance
mentioned).

Comment on lines +398 to +429
### Express.js Backend Example

```typescript
import { SoroswapSDK, SupportedNetworks, TradeType, SupportedProtocols } from "@soroswap/sdk";

const sdk = new SoroswapSDK({
apiKey: process.env.SOROSWAP_API_KEY as string,
defaultNetwork: SupportedNetworks.MAINNET,
});

app.post("/api/quote-and-build", async (req, res) => {
const { assetIn, assetOut, amount, walletAddress } = req.body;

const quote = await sdk.quote({
assetIn,
assetOut,
amount: BigInt(amount),
tradeType: TradeType.EXACT_IN,
protocols: [SupportedProtocols.SOROSWAP, SupportedProtocols.AQUA],
});

const buildResponse = await sdk.build({ quote, from: walletAddress });

res.json({ quote, xdr: buildResponse.xdr });
});

app.post("/api/send-transaction", async (req, res) => {
const { signedXdr } = req.body;
const result = await sdk.send(signedXdr, false);
res.json(result);
});
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix incorrect parameter count in sdk.send() call.

Line 426 has the same issue: sdk.send() only accepts two parameters, not three. The false parameter should be removed.

🐛 Proposed fix
-  const result = await sdk.send(signedXdr, false);
+  const result = await sdk.send(signedXdr);

Or, if you want to specify the network explicitly:

-  const result = await sdk.send(signedXdr, false);
+  const result = await sdk.send(signedXdr, SupportedNetworks.MAINNET);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Express.js Backend Example
```typescript
import { SoroswapSDK, SupportedNetworks, TradeType, SupportedProtocols } from "@soroswap/sdk";
const sdk = new SoroswapSDK({
apiKey: process.env.SOROSWAP_API_KEY as string,
defaultNetwork: SupportedNetworks.MAINNET,
});
app.post("/api/quote-and-build", async (req, res) => {
const { assetIn, assetOut, amount, walletAddress } = req.body;
const quote = await sdk.quote({
assetIn,
assetOut,
amount: BigInt(amount),
tradeType: TradeType.EXACT_IN,
protocols: [SupportedProtocols.SOROSWAP, SupportedProtocols.AQUA],
});
const buildResponse = await sdk.build({ quote, from: walletAddress });
res.json({ quote, xdr: buildResponse.xdr });
});
app.post("/api/send-transaction", async (req, res) => {
const { signedXdr } = req.body;
const result = await sdk.send(signedXdr, false);
res.json(result);
});
```
### Express.js Backend Example
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/soroswap-sdk/SKILL.md` around lines 398 - 429, The sdk.send(...)
invocation incorrectly passes a third boolean argument; update the call to match
the sdk.send signature by removing the extraneous false argument from the
sdk.send(signedXdr, false) call (referencing the sdk.send function) or, if you
need to specify network, pass it using the supported parameter shape for
SoroswapSDK.send rather than adding a third positional boolean; edit the example
in SKILL.md where sdk.send is used to either call sdk.send(signedXdr) or the
proper form that accepts an explicit network option.

miguelnietoa added a commit to LumenWipe/lumenwipe that referenced this pull request Jun 11, 2026
Adds agent guidance (CLAUDE.md) plus six skills managed with the skills
CLI: dapp, data, assets (stellar/stellar-dev-skill), soroswap-sdk
(soroswap/sdk, vendored until soroswap/sdk#10 lands),
vercel-react-best-practices and webapp-testing. Canonical copies live in
.agents/skills/ with symlinks in .claude/skills/ so any agent can read
them; versions are pinned in skills-lock.json.
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.

Skill file not installable via npx skills — rename soroswap-sdk-skill.md to SKILL.md

1 participant