identity
ERC-8004 on-chain agent identity management — register agent identities, update URI and metadata, manage operator approvals, set/unset agent wallet, transfer identity NFTs, and query identity info.
What this skill does
# Identity Skill
Provides ERC-8004 on-chain agent identity operations using the identity-registry contract. Read operations (get, get-metadata, get-last-id) work without a wallet. Write operations (register, set-uri, set-metadata, set-approval, set-wallet, unset-wallet, transfer) require an unlocked wallet.
## Usage
```
bun run identity/identity.ts <subcommand> [options]
```
## Subcommands
### register
Register a new agent identity on-chain using the ERC-8004 identity registry. Returns a transaction ID. Check the transaction result to get the assigned agent ID. Requires an unlocked wallet.
```
bun run identity/identity.ts register [--uri <uri>] [--metadata <json>] [--fee <fee>] [--sponsored]
```
Options:
- `--uri` (optional) — URI pointing to agent metadata (IPFS, HTTP, etc.)
- `--metadata` (optional) — JSON array of `{"key": "...", "value": "<hex>"}` pairs (values are hex-encoded buffers)
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xabc...",
"message": "Identity registration transaction submitted. Check transaction result to get your agent ID.",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xabc..."
}
```
### get
Get agent identity information from the ERC-8004 identity registry. Returns owner address, URI, and wallet if set.
```
bun run identity/identity.ts get --agent-id <id>
```
Options:
- `--agent-id` (required) — Agent ID to look up (non-negative integer)
Output:
```json
{
"success": true,
"agentId": 42,
"owner": "SP1...",
"uri": "ipfs://...",
"wallet": "SP2...",
"network": "mainnet"
}
```
### set-uri
Update the URI for an agent identity. Caller must be the agent owner or an approved operator. Requires an unlocked wallet.
```
bun run identity/identity.ts set-uri --agent-id <id> --uri <uri> [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID to update (non-negative integer)
- `--uri` (required) — New URI pointing to agent metadata (IPFS, HTTP, etc.)
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xdef...",
"message": "Identity URI update transaction submitted.",
"agentId": 42,
"uri": "ipfs://newuri...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xdef..."
}
```
### set-metadata
Set a metadata key-value pair for an agent identity. Value must be a hex-encoded buffer (max 512 bytes). The key `agentWallet` is reserved and will be rejected by the contract. Caller must be the agent owner or an approved operator. Requires an unlocked wallet.
```
bun run identity/identity.ts set-metadata --agent-id <id> --key <key> --value <hex> [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID to update (non-negative integer)
- `--key` (required) — Metadata key (string)
- `--value` (required) — Metadata value as a hex-encoded buffer (e.g., `616c696365` for "alice")
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xghi...",
"message": "Metadata set transaction submitted.",
"agentId": 42,
"key": "name",
"valueHex": "616c696365",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xghi..."
}
```
### set-approval
Approve or revoke an operator for an agent identity. Approved operators can update URI, metadata, and wallet on behalf of the owner. Only the NFT owner can call this. Requires an unlocked wallet.
```
bun run identity/identity.ts set-approval --agent-id <id> --operator <address> [--approved] [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID to update (non-negative integer)
- `--operator` (required) — Stacks address of the operator to approve or revoke
- `--approved` (flag) — Grant approval (omit to revoke)
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xjkl...",
"message": "Operator SP3... approved for agent 42.",
"agentId": 42,
"operator": "SP3...",
"approved": true,
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xjkl..."
}
```
### set-wallet
Set the agent wallet for an identity to tx-sender (the active wallet address). This links the active Stacks address to the agent ID without requiring a separate signature. Caller must be the agent owner or an approved operator. Requires an unlocked wallet.
```
bun run identity/identity.ts set-wallet --agent-id <id> [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID to update (non-negative integer)
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xmno...",
"message": "Agent wallet set to tx-sender (SP1...) for agent 42.",
"agentId": 42,
"wallet": "SP1...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xmno..."
}
```
### unset-wallet
Remove the agent wallet association from an agent identity. Caller must be the agent owner or an approved operator. Requires an unlocked wallet.
```
bun run identity/identity.ts unset-wallet --agent-id <id> [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID to update (non-negative integer)
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xpqr...",
"message": "Agent wallet cleared for agent 42.",
"agentId": 42,
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xpqr..."
}
```
### transfer
Transfer an agent identity NFT to a new owner. The active wallet (tx-sender) must equal the current owner. Transfer automatically clears the agent wallet association. Requires an unlocked wallet.
```
bun run identity/identity.ts transfer --agent-id <id> --recipient <address> [--fee <fee>] [--sponsored]
```
Options:
- `--agent-id` (required) — Agent ID (token ID) to transfer (non-negative integer)
- `--recipient` (required) — Stacks address of the new owner
- `--fee` (optional) — Fee preset (`low`, `medium`, `high`) or micro-STX amount
- `--sponsored` (flag) — Submit as a sponsored transaction
Output:
```json
{
"success": true,
"txid": "0xstu...",
"message": "Identity NFT transfer submitted for agent 42.",
"agentId": 42,
"sender": "SP1...",
"recipient": "SP4...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/0xstu..."
}
```
### get-metadata
Read a metadata value by key from the ERC-8004 identity registry. Returns the raw buffer value as a hex string. Does not require a wallet.
```
bun run identity/identity.ts get-metadata --agent-id <id> --key <key>
```
Options:
- `--agent-id` (required) — Agent ID to query (non-negative integer)
- `--key` (required) — Metadata key to read
Output:
```json
{
"success": true,
"agentId": 42,
"key": "name",
"valueHex": "616c696365",
"network": "mainnet"
}
```
### get-last-id
Get the most recently minted agent ID from the ERC-8004 identity registry. Returns null if no agents have been registered. Does not require a wallet.
```
bun run identity/identity.ts get-last-id
```
Output:
```json
{
"success": true,
"lastAgentId": 99,
"network": "mainnet"
}
```
## Notes
- Read operations (get, get-metadata, get-last-id) work without a wallet
- Write operations require an unlocked wallet (`bun run wallet/wallet.ts unlock`)
- Agent IDs are assigned by the contract upon registration — check the transaction result to find your assigned ID
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.