agentleFS
MicrosoftKnown publishermicrosoft/ignite26-PREL40/src/home-loan-desk/.agents/skills/functions-capability/SKILL.md

functions-capability

Skill3 starsChanged 29 days agoMITView on GitHub

Apply and build the Universal App functions capability. Use for trusted server-side logic, secrets, external APIs, custom model endpoints, published Fabric data agents, webhooks, or privileged operations.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 13 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    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
  1. Distinctive:

    Use functions when code must be trusted, needs a secret, or must call a service without exposing credentials or access tokens to the …

    line 11
  2. Distinctive:

    Run this before customizing the app:

    line 16
  3. Very specific:

    Do not copy these files by hand.

    line 30
  4. Very specific:

    Read .agents/skills/rayfin-functions/SKILL.md directly from disk, then read the package documentation under node_modules/@microsoft/ before …

    line 44
  5. Distinctive:

    Do not stop or restart.

    line 47
  6. Very specific:

    Use the documented root npm run dev session for type generation and local function development.

    line 58
  7. Distinctive:

    Before starting a Fabric-backed development session that may provision or reuse a backend, read the installed local-development guide and …

    line 62
  8. Distinctive:

    Do not deploy only to obtain generated types.

    line 67
  9. Distinctive:

    If the approved development session cannot start, report the prerequisite or target blocker and leave generated files unchanged.

    line 68
  10. Distinctive:

    Read the installed skill directly from disk and read the package docs relevant to the function.

    line 77
  11. Distinctive:

    Keep explicit input and output types on every registered function, and keep the development session running while registered signatures …

    line 84
  12. Distinctive:

    Wait for the watcher to refresh the generated schema after each signature edit.

    line 86
  13. Very specific:

    Never edit packages/functions/src/types.ts by hand.

    line 88
  14. Very specific:

    Never cast client.functions, the Rayfin client, or a handwritten invoker to bypass a function missing from AppFunctionsSchema.

    line 89
  15. Very specific:

    Run npm run validate:functions and confirm every authored udf.func() registration is present in AppFunctionsSchema with no Functions-client …

    line 93
  16. Very specific:

    After generated types are current, run the root npm run typecheck and npm run build gates.

    line 96
  17. Distinctive:

    Run the normal app validation and deployment workflow.

    line 101
  18. Distinctive:

    Keep secrets and access tokens inside the function.

    line 105
  19. Distinctive:

    Never put secrets in chat, source, YAML values, frontend environment variables, command arguments, logs, or function output.

    line 106
  20. Distinctive:

    Never log prompts, user content, authorization headers, access tokens, raw provider bodies, or sensitive exception details.

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rayfin functions

Use functions when code must be trusted, needs a secret, or must call a service without exposing credentials or access tokens to the browser.

Apply the capability first

Run this before customizing the app:

npm run pack:add -- functions

The pack enables services.functions, creates the @rayfin-app/functions workspace package under packages/functions, installs all workspace dependencies from the root, builds functions before the frontend, and wires AppFunctionsSchema into the existing client. The existing Vite adapter forwards the client's default /functions/<name>/invoke route to the local Functions host selected by rayfin dev; do not add a direct functionsBaseUrl override.

Do not copy these files by hand. Reapplying the pack preserves authored functions and generated types unless --force-seeds is explicitly used.

Install guidance and use the workspace-aware development session

Install or refresh the version-matched functions agent context separately:

npx rayfin init ai-files install --enable skill:rayfin-functions --non-interactive

The active session does not refresh its skill registry after installation, so do not call the skill tool for rayfin-functions in the same turn. Read .agents/skills/rayfin-functions/SKILL.md directly from disk, then read the package documentation under node_modules/@microsoft/ before writing Rayfin APIs. Do not stop or restart.

For Functions authentication, read the Application authentication section in the installed @microsoft/rayfin-guide documentation at functions/index.md.

Do not run npx rayfin functions init in this workspace template. The current command writes, installs, builds, and generates types under the legacy rayfin/functions location instead of the configured services.functions.path at packages/functions. That would create a second functions project and leave the workspace package's generated types stale.

Use the documented root npm run dev session for type generation and local function development. It resolves services.functions.path, performs the initial generation in packages/functions, and watches registered function signature edits. Before starting a Fabric-backed development session that may provision or reuse a backend, read the installed local-development guide and obtain the user's approval for the target workspace. Satisfy its documented Node.js and Azure Functions Core Tools prerequisites.

Do not deploy only to obtain generated types. If the approved development session cannot start, report the prerequisite or target blocker and leave generated files unchanged. There is no standalone public type-generation command to substitute.

Authoring sequence

  1. Apply the functions pack.
  2. Install the version-matched agent context with npx rayfin init ai-files install --enable skill:rayfin-functions --non-interactive.
  3. Read the installed skill directly from disk and read the package docs relevant to the function.
  4. With the target approved and local prerequisites available, run npm run dev from the workspace root and wait for its initial type-generation pass.
  5. Replace the starter registration in packages/functions/src/function_app.ts.
  6. Keep explicit input and output types on every registered function, and keep the development session running while registered signatures change. Wait for the watcher to refresh the generated schema after each signature edit.
  7. Never edit packages/functions/src/types.ts by hand. Never cast client.functions, the Rayfin client, or a handwritten invoker to bypass a function missing from AppFunctionsSchema. A green TypeScript build after as any or as unknown as is not a valid generated contract.
  8. Run npm run validate:functions and confirm every authored udf.func() registration is present in AppFunctionsSchema with no Functions-client casts.
  9. After generated types are current, run the root npm run typecheck and npm run build gates.
  10. Invoke the function through the typed client from the frontend.
  11. Preserve loading, empty, success, expected-failure, and unexpected-failure states.
  12. Run the normal app validation and deployment workflow.

Security boundary

  • Keep secrets and access tokens inside the function.
  • Never put secrets in chat, source, YAML values, frontend environment variables, command arguments, logs, or function output.
  • Never log prompts, user content, authorization headers, access tokens, raw provider bodies, or sensitive exception details.
  • Bound user input, outbound request duration, provider output, and the value returned to the browser.
  • Return typed safe results for expected configuration, authentication, provider, and timeout outcomes.
  • Surface unexpected failures without returning credentials or provider internals.

For a secret-backed service, continue with external-api-workflows. For Fabric data-agent access, continue with fabric-data-agent.

What the pack validates

The template tests prove that applying the pack:

  • Enables the functions service and its build command.
  • Creates packages/functions as @rayfin-app/functions.
  • Wires the generated schema into the frontend client while preserving the Vite same-origin Functions route.
  • Fails validation when authored function registrations and AppFunctionsSchema differ.
  • Rejects frontend casts around the Functions client that hide a stale generated contract.
  • Builds functions before the frontend in the root build scripts.
  • Preserves authored functions and generated files when reapplied.
  • Leaves existing authentication, data, and analytics pack behavior intact.

The pack does not prove that a deployment has its required secret values, resource permissions, or downstream endpoint access. Those checks require a deployed scenario. The template and CLI checks cover missing functions packages, type generation, generated-contract freshness, unsafe Functions-client casts, and workspace build failures separately.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.