Part-DB Inventory
Use this skill for Part-DB inventory workflows. Keep this public skill generic;
the instance, credentials, inventory, and local organization conventions belong
in private context.
Scope
Use Part-DB for countable items with a physical location or stock-management
reason, such as components, tools, hardware, consumables, and supplies. Do not
force project plans, maintenance history, warranties, receipts, or unrelated
one-off possessions into an inventory workflow.
Do not configure an MCP server as a side effect. If the user already has a
trusted Part-DB MCP server, treat it only as a transport and keep the same
private-context and approval boundaries below.
Private Context
Before accessing an instance, resolve the configured private context. Read
references/private-context.md for the context contract, resolution order,
expected fields, first-configured-pointer fallback behavior, and output rules.
If no valid private context is available, explain what is missing without
guessing an endpoint, searching shell history, inspecting unrelated .env
files, or inventing inventory conventions.
Target Safety Tiers
The tiers below define the contract. The bundled helpers implement the
read-only tier and a deliberately narrow mutation path for part-lot quantity
updates.
- Read-only: Search, inspect schema, find locations, and verify stock. A
helper uses a scoped read credential after local contract checks.
- Propose: Turn supplied evidence into a structured draft. Show unknown or
ambiguous fields explicitly; never fabricate part numbers, quantities,
locations, or categories.
- Mutate: Create, update, move, adjust, or delete inventory only after the
user explicitly approves the rendered change set. Re-verify the target and
result, and do not reuse approval for later changes.
Do not improvise request payloads from general memory. Probe the installed
instance's OpenAPI contract before relying on version-sensitive endpoints.
Workflow
- Classify the request as inventory planning, read-only lookup, a proposed
change, or a Part-DB service operation.
- Route service operations to
infra-ops. For inventory work, resolve private
context without exposing it in public artifacts.
- For proposals, gather the operator's evidence and produce a reviewable
draft. Keep item type, category, physical location, quantity, unit, and
source evidence separate.
- Run
uv run scripts/partdb-read.py context-check, then a schema probe before
querying inventory.
For a mutation, generate a plan from a private intent file, render its exact
diff, and wait for explicit approval of that plan digest.
- Keep durable local taxonomy and location decisions in the private source of
truth; update public skill guidance only when the generic contract changes.
Quantity Updates
The bundled mutation helper supports only setting a single existing part lot's
quantity. It does not create, delete, move, or attach records. Keep its intent,
plan, approval, and receipt files in a private ignored directory.
- Create an intent with only
op, lot_id, and amount; op must be
part-lot-amount-set.
- Run
uv run scripts/partdb-write.py plan --intent ... --output .... It
validates the installed OpenAPI schema, reads the current amount, and emits a
plan with an exact digest.
- Show the plan's
prior_amount and target_amount to the user. Do not run
the next step until the user explicitly approves that exact digest.
- Run
uv run scripts/partdb-write.py approve --plan ... --approve <digest> --output ....
- Run
uv run scripts/partdb-write.py apply --plan ... --approval ... --apply.
It reads again, refuses drift, patches only after those checks, reads back to
verify, and records a redacted digest-keyed receipt beside the plan. Each approval is single-use;
a failed apply leaves a needs-reconciliation receipt instead of retrying a
possibly completed write.
The private context must declare a separate write-token environment variable
and allow_mutations = true; that only enables this helper's exact-plan gates,
not unreviewed mutations.
Public Safety
Do not commit or copy instance URLs, credentials, supplier accounts, inventory
exports, part names, serial numbers, quantities, storage maps, photos, or
attachments into public skill files, issues, pull requests, examples, or logs.
When reporting to the user in a private session, minimize sensitive inventory
data to the requested task. Redact configuration values and do not expose
tokens, authorization headers, or private network details.
Future Work
Part and attachment creation, location moves, and deletion require their own
schema-driven, idempotent proposal workflows. The read-only helper also
provides context-check, schema-probe, search, and locations commands.
1---2name: partdb3description: Use when the user asks to find, organize, count, categorize, locate, or safely update components, tools, consumables, or other inventory in a Part-DB instance. Trigger for Part-DB inventory workflows, API or MCP integration choices, schema discovery, read-only stock lookup, intake planning, and proposed inventory changes. Do not use for a Part-DB container, proxy, backup, migration, or host operation; use `infra-ops` instead.4---56# Part-DB Inventory78Use this skill for Part-DB inventory workflows. Keep this public skill generic;9the instance, credentials, inventory, and local organization conventions belong10in private context.1112## Scope1314Use Part-DB for countable items with a physical location or stock-management15reason, such as components, tools, hardware, consumables, and supplies. Do not16force project plans, maintenance history, warranties, receipts, or unrelated17one-off possessions into an inventory workflow.1819Do not configure an MCP server as a side effect. If the user already has a20trusted Part-DB MCP server, treat it only as a transport and keep the same21private-context and approval boundaries below.2223## Private Context2425Before accessing an instance, resolve the configured private context. Read26`references/private-context.md` for the context contract, resolution order,27expected fields, first-configured-pointer fallback behavior, and output rules.2829If no valid private context is available, explain what is missing without30guessing an endpoint, searching shell history, inspecting unrelated `.env`31files, or inventing inventory conventions.3233## Target Safety Tiers3435The tiers below define the contract. The bundled helpers implement the36read-only tier and a deliberately narrow mutation path for part-lot quantity37updates.38391. **Read-only:** Search, inspect schema, find locations, and verify stock. A40 helper uses a scoped read credential after local contract checks.412. **Propose:** Turn supplied evidence into a structured draft. Show unknown or42 ambiguous fields explicitly; never fabricate part numbers, quantities,43 locations, or categories.443. **Mutate:** Create, update, move, adjust, or delete inventory only after the45 user explicitly approves the rendered change set. Re-verify the target and46 result, and do not reuse approval for later changes.4748Do not improvise request payloads from general memory. Probe the installed49instance's OpenAPI contract before relying on version-sensitive endpoints.5051## Workflow52531. Classify the request as inventory planning, read-only lookup, a proposed54 change, or a Part-DB service operation.552. Route service operations to `infra-ops`. For inventory work, resolve private56 context without exposing it in public artifacts.573. For proposals, gather the operator's evidence and produce a reviewable58 draft. Keep item type, category, physical location, quantity, unit, and59 source evidence separate.604. Run `uv run scripts/partdb-read.py context-check`, then a schema probe before61 querying inventory.62 For a mutation, generate a plan from a private intent file, render its exact63 diff, and wait for explicit approval of that plan digest.645. Keep durable local taxonomy and location decisions in the private source of65 truth; update public skill guidance only when the generic contract changes.6667## Quantity Updates6869The bundled mutation helper supports only setting a single existing part lot's70quantity. It does not create, delete, move, or attach records. Keep its intent,71plan, approval, and receipt files in a private ignored directory.72731. Create an intent with only `op`, `lot_id`, and `amount`; `op` must be74 `part-lot-amount-set`.752. Run `uv run scripts/partdb-write.py plan --intent ... --output ...`. It76 validates the installed OpenAPI schema, reads the current amount, and emits a77 plan with an exact digest.783. Show the plan's `prior_amount` and `target_amount` to the user. Do not run79 the next step until the user explicitly approves that exact digest.804. Run `uv run scripts/partdb-write.py approve --plan ... --approve <digest>81 --output ...`.825. Run `uv run scripts/partdb-write.py apply --plan ... --approval ... --apply`.83 It reads again, refuses drift, patches only after those checks, reads back to84 verify, and records a redacted digest-keyed receipt beside the plan. Each approval is single-use;85 a failed apply leaves a `needs-reconciliation` receipt instead of retrying a86 possibly completed write.8788The private context must declare a separate write-token environment variable89and `allow_mutations = true`; that only enables this helper's exact-plan gates,90not unreviewed mutations.9192## Public Safety9394Do not commit or copy instance URLs, credentials, supplier accounts, inventory95exports, part names, serial numbers, quantities, storage maps, photos, or96attachments into public skill files, issues, pull requests, examples, or logs.9798When reporting to the user in a private session, minimize sensitive inventory99data to the requested task. Redact configuration values and do not expose100tokens, authorization headers, or private network details.101102## Future Work103104Part and attachment creation, location moves, and deletion require their own105schema-driven, idempotent proposal workflows. The read-only helper also106provides `context-check`, `schema-probe`, `search`, and `locations` commands.