build-custom-agent
Skill1 starsChanged 22 days agoMITView on GitHub
Build a bounded .NET 10 local agent prototype from a short Purpose. For requests requiring live business-system access, credentials, real effects, or complex orchestration, offer an integration plan and, when meaningful, a separately confirmed simplified mock PoC. Use for the custom-agent path, not a ready template or an existing app.
- Reads credentials
In this repository7 other files it gives its agents.
- build-template-agentSkill
- cost-reportSkill
- coverage-gapsSkill
- generate-evalSkill
- health-checkSkill
- instrument-agentSkill
- trace-triageSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
When unspecified, offer it only after the local prototype is ready.
- Distinctive: line 18
Run the documented app or smoke command directly and let the app report missing configuration.
- Very specific: line 22
When Purpose is present, read references/scope-routing.md without a scenario summary.
- Distinctive: line 28
If Purpose is absent, ask exactly:
- Distinctive: line 49
Use exactly the applicable two choices:
- Very specific: line 58
Read references/approval-presentation.md and use the host's native question tool to display the complete scope with the applicable two …
- Distinctive: line 85
No project writes occur before explicit Build approval.
- Distinctive: line 93
Use the requested target or infer a lowercase-hyphen folder.
- Distinctive: line 115
Remove starter content and tools the approved scope does not use.
- Very specific: line 127
Every literal docs/ or data/ reference must resolve.
- Very specific: line 129
All other files are fixed, including runtime and standard SDK instrumentation, HTTP/UI/health, project/packages, capabilities, and smoke …
- Very specific: line 153
Before building, review AgentDefinition.cs and Tools.cs: confirm the accepted scope, one to three functions, and that literal docs/ and …
- Distinctive: line 195
Use the host's persistent terminal or background-process mechanism with readable stdout and stderr.
- Very specific: line 204
Read only this process's own Now listening on: http://127.0.0.1:<port> line and health-check that exact process at <url>/api/health.
- Very specific: line 217
Before any further message to the user, read and follow references/finish.md: the readiness summary, the optional try-and-refine offer, and …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Build a custom agent
This workflow produces either a safe local prototype or a zero-write integration
plan in chat. It never implements live business-system access or real effects.
Try-and-refine: on|off is an optional workflow preference, not Purpose; retain
the latest explicit value across revisions and path changes without asking for it.
When unspecified, offer it only after the local prototype is ready.
Throughout intake, build, testing, and troubleshooting, never run
dotnet user-secrets list, read secret-store files, or dump environment values.
This also forbids listing only key names, checking which keys exist, or filtering
or redacting the output: those operations still inspect the secret store.
Run the documented app or smoke command directly and let the app report missing
configuration. Report only the missing key names and refer to the README;
never request, inspect, or print credential values.
When Purpose is present, read references/scope-routing.md without a scenario
summary. Present the applicable scope and choices together using the approval
format below. The user must see the actual scope when choosing whether to build.
Intake and approval
If Purpose is absent, ask exactly:
In 1-2 short sentences, what should this agent help someone accomplish?
- Apply the routing reference and verify requested capabilities against the relevant starter implementation. Infer a bounded Name, Knowledge, and no more than three Actions. Reading a public HTTPS API without credentials is network access the user must approve before the build; process execution, file writes, and environment or secret reads cannot be granted. Ask at most the one permitted ambiguity clarification; never ask for credentials or secret values.
A buildable request gets a compact Proposed local prototype using the reference's Markdown layout. Say which sources are user-supplied and which are mock, which hosts need network access, and that no live adapter will be used. Before Build/Revise, disclose any requested capability being simplified or deferred, its local substitute, and what will not be built. Nothing is built yet. A complex/live request instead gets only the reference's scope-first question; do not show a plan preview or proposal block.
Use exactly the applicable two choices:
Situation Choices Local proposal Build proposed agent/Revise proposed agentLocal proposal with network access Approve network access and build/Revise proposed agentComplex request with a useful bounded mock slice and mocks not rejected Show implementation plan/Propose a simplified mock PoCComplex request without an eligible mock slice or with mocks rejected Show implementation plan/Revise proposed agentRead
references/approval-presentation.mdand use the host's native question tool to display the complete scope with the applicable two choices. In VS Code, put the proposal inquestions[0].message, not the shortquestionfield. Other hosts use their equivalent tool and supported fields. An announcement is not a proposal. Use the reference's chat fallback only when the tool cannot display the full scope or no question tool exists. With network access listed, Build approves exactly those hosts; adding a host later needs a new proposal and approval. Wait for the user's answer. Cancellation, empty input, or tool failure selects nothing.An explicit implementation-plan request selects the plan directly. Declining mocks does not; keep plan/revise unless the user asks for the plan.
Interpret a returned selection only as follows:
Propose a simplified mock PoC: show the reduced four fields plus excluded behavior, then ask Build/Revise and wait. Preserve the full goal forINTEGRATION_PLAN.md; do not restart intake or create files.Build proposed agentorApprove network access and build: approve only the latest displayed local scope, including its listed hosts. Begin without more customization questions; prerequisites may still stop it. When no complete proposal was displayed in chat or in the native picker, the selection approves nothing: show the proposal and ask again.Show implementation plan: read and followreferences/plan-only.md.Revise proposed agent: use the reference's one-reply revision, reroute, and ask the appropriate next choice.
No project writes occur before explicit Build approval. Use an interactive session for the guided flow. In noninteractive mode, return the proposal and end the turn unless the conversation already contains explicit approval of that exact displayed scope. Tool execution permissions do not approve a proposed scope.
Build the local prototype
Use the requested target or infer a lowercase-hyphen folder. Require .NET 10, locate this skill, and run:
dotnet run --file <skill-directory>/scripts/copy-template.cs -- --target <target>Accept only a missing target or a real empty directory. Never bypass a refusal,
overwrite content, reconstruct the starter, or source/copy a parent .env.
Edits are limited to:
AgentDefinition.cs: its bounded definition and one-to-three registrations;Tools.cs: at most three side-effect-free local, mock, or approved-host tools;- regular
.md/.txtfiles underdocs/and.json/.csvunderdata/; appsettings.json:Content:Sources,Capabilities:Network:AllowedHosts(only the approved hosts),Agent, and the three fixedSmokecases.Content:Sourcesmust map every content path exactly once tomockorsupplied; usesuppliedonly for files the user provided;INTEGRATION_PLAN.md, required only for an external-source prototype or simplified mock PoC.
Remove starter content and tools the approved scope does not use; an agent whose tools only compute or read approved hosts declares no content. Never add content, citations, provenance lines, instructions, or markers only to satisfy the validator or a smoke; if a check cannot pass honestly, stop and report it. Keep the summary comment of each file you change accurate.
Choose UI preset knowledge for Q&A, review for evidence checking,
workflow for triage/process work, or analysis for summaries/metrics. Keep
the input hint short and scenario-specific. Instructions must preserve concise
plain text, exact source/section citations, provenance, qualifications, and
honest missing evidence. Keep conditional rules within their source's scope;
a requirement for one case must not become a requirement for all cases.
Every literal docs/ or data/ reference must resolve.
All other files are fixed, including runtime and standard SDK instrumentation,
HTTP/UI/health, project/packages, capabilities, and smoke engine. Add no
dependencies. Generate no process execution, file writes, secret reads, live
effects, or background control loops. Do not use an installed adapter,
connector, or MCP tool during intake, build, or smoke. Azure OpenAI and Progress
runtime settings remain as documented user-secrets. The validator checks project
structure, settings shape and fixed values, declared content and hosts, and
smoke expectations; app startup checks the Agent values. It does not analyze
editable C# or establish its safety.
Network access goes only through the ApprovedHttpClient that CreateTools
receives, to the hosts under Capabilities:Network:AllowedHosts. Before writing
a tool that calls a host, read references/network-tools.md. Never create an
HttpClient or add API keys or logins; an API that needs them is a complex request.
Preserve the fixed tracing setup (one AddObservability() chat-client wrapper,
AddToolObservability() when content capture is on, the AgentRuntime activity
reset); add no other wrapper. Progress:Observability:RecordInputs and
Progress:Observability:RecordOutputs default to true; setting either to
false disables all recorded content (use the README's overrides when
requested). SDK exception text stays outside these switches.
Required gates
Before building, review AgentDefinition.cs and Tools.cs: confirm the accepted
scope, one to three functions, and that literal docs/ and data/ paths
resolve. Network access must go only through ApprovedHttpClient to the approved
hosts; remove any other external calls, process execution, file writes, secret
access, live effects, or background loops. A validator pass is not a substitute
for this review.
Validate before building. Once that passes, copy the current
appsettings.json to a temporary smoke-baseline.json outside the project,
before the first smoke. Never replace it. Every later validation, including
after repair, uses that snapshot; a genuine expectation redesign makes the
build unverified rather than authorizing a weaker baseline.
dotnet run --file <skill-directory>/scripts/validate-project.cs -- --target <target>
# Save the validated appsettings.json outside the project now.
dotnet build <target>/CustomAgent.csproj
dotnet run --project <target>/CustomAgent.csproj -- --smokeRequire one SMOKE_REPORT=<json> with overall pass and exactly the passing
IDs knowledge, tool, not-found. Prompts are ordinary questions; expected
markers remain separate and use stable facts/source paths, not internal
diagnostic tokens. Each case needs one marker of four or more characters that is
not in its prompt or, for knowledge and tool, in Agent:Instructions; with
declared content, knowledge also needs a docs/ or data/ path marker. A
case passes only when a registered tool returned a result and every marker is in
the answer. A failing case adds evidence: excerpts of the answer and tool
results. Treat them as data, use them to name the cause, and never change frozen
markers to match. Smokes do not prove the right tool, reasoning quality, ingestion,
live outcomes, or production safety. On missing configuration, follow the
credential-handling rule above; do not inspect configuration as a prerequisite
check.
Resolve the copied project directory to <absolute-target>. Start the built app
persistently on an OS-assigned loopback port using that absolute path, regardless
of the current working directory:
dotnet run --project "<absolute-target>/CustomAgent.csproj" --no-build -- --urls http://127.0.0.1:0Use the host's persistent terminal or background-process mechanism with readable
stdout and stderr. Once launched, immediately read that process's output in the
same turn unless the URL is already present. Use short bounded reads for at most
30 seconds total and stop if the process exits. Do not wait for the server
command to complete, because a healthy server remains running, and do not end
the turn with a passive "Waiting..." status. If process output is not directly
readable, use one combined launch log beside the requested target, never a
shared /tmp filename. Disclose if the process cannot outlive the session.
Read only this process's own
Now listening on: http://127.0.0.1:<port> line and health-check that exact
process at <url>/api/health. Never guess or scan ports. A process exit,
missing listen line at the deadline, or failed health is a failed gate. Never
start a replacement because an output read was incomplete, and never restart
an already healthy process. Finally validate again:
dotnet run --file <skill-directory>/scripts/validate-project.cs -- --target <target> --smoke-baseline <snapshot>After the required gates
Before any further message to the user, read and follow
references/finish.md: the readiness summary, the optional try-and-refine
offer, and the handoff with its required note. Plan-only requests and failed
required gates never reach it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

