agentleFS
jschullerjschuller/sn-app-template/.claude/skills/add-table/SKILL.md

add-table

Skill1 starsChanged 24 days agoMITView on GitHub

Add a new table to this ServiceNow app end to end — Fluent Table(), record ACLs, AppService methods, Scripted REST routes, an ATF test and registration. Use when the user asks for a new table, entity, record type or data model in this now-sdk project.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    every column name starts with x_snc_example_.

    line 16
  2. Very specific:

    If an instance is available, run the deploy-and-verify skill.

    line 30

≈ “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.

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

Add a table

Work through every step; a table without ACLs, tests or registration is not done. Check property names with npx now-sdk explain table --format=raw (and acl, restapi, test) rather than guessing.

Names below use widget as the example entity; keep the project's scope prefix (x_snc_example unless npm run setup changed it — read scope from now.config.json).

  1. Table — create src/fluent/tables/widget.now.ts:
    • export const x_snc_example_widget = Table({ name: 'x_snc_example_widget', label, display, schema: { … } })
    • every column name starts with x_snc_example_; pick column types from npx now-sdk explain --list (*column-api)
    • allowWebServiceAccess: true only if the REST Table API must reach it
    • actions: { read: true } (object form; controls cross-scope access — add writes only if another scope needs them)
  2. ACLs — in src/fluent/acls/, one Acl() per operation (read, create, write, delete), type: 'record', table: 'x_snc_example_widget', roles: [exampleUserRole] or [exampleAdminRole] imported from ../roles/app-roles.now.
  3. Service — add methods to src/server/AppService.server.js (or a new Script Include, see AGENTS.md). Use GlideRecordSecure, validate input, return { status, body } like the existing item methods. Any platform API the template does not already call needs a CrossScopePrivilege (runtime access is enforcing; see AGENTS.md).
  4. REST routes — add routes to src/fluent/rest-api/app-api.now.ts (/widgets, /widgets/{sys_id}), each with its own $id and enforceAcl: [exampleApiAcl]; scripts only call the service and svc.send(response, result).
  5. ATF test — add a Test() to src/fluent/tests/ that inserts a record, validates it, exercises the service methods via runServerSideScript (use assertEqual), and add it to the TestSuite. Every step gets a unique $id.
  6. Register — export * from './tables/widget.now' in src/fluent/index.now.ts (other files import by side effect).
  7. Verify — npm run lint && npm run build; commit the src/fluent/generated/keys.ts changes with the code. If an instance is available, run the deploy-and-verify skill.
  8. Docs — add the table to the "What gets deployed" table in README.md and a line under [Unreleased] in CHANGELOG.md.

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.