Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
e902bd7
feat: Docs for POST /admin/reminders/stats (#757)
KirtiGautam Dec 8, 2025
38c1608
feat: Docs for POST admin/employees/stats (#759)
KirtiGautam Dec 10, 2025
d007a47
feat: add budget visibility and user_ids to schema (#758)
KrupaH Dec 11, 2025
7045cbe
feat: spender budgets api (#761)
KrupaH Dec 18, 2025
c2a35e5
feat: Add spec for `POST <role>/expenses/permissions/bulk` API (#760)
devadathanmb Dec 22, 2025
d3d835b
feat: added `added_to_report_by` to `GET /expenses` spec (#766)
yashUkalkar Jan 2, 2026
4b19796
feat: add budget status (#763)
KrupaH Jan 2, 2026
7a55b92
feat: `GET /reports` new field `creator_type` spec changes (#767)
yashUkalkar Jan 5, 2026
6f214ab
feat: add budget export api docs (#768)
KrupaH Jan 6, 2026
efab1e7
feat: Add default_billable field to project's Schema (#769)
Ash-2k3 Jan 6, 2026
17bc1f9
fix typo in budgets export api (#770)
KrupaH Jan 7, 2026
d878c97
fix: show user_ids for get admin/budgets and not for spender/budgets …
KrupaH Jan 9, 2026
4f6398f
feat: Add default_billable to Post /projects payload (#771)
Ash-2k3 Jan 13, 2026
bec03e5
feat: Added required elements for mobile version apis (#775)
sumitkumarsage Feb 1, 2026
407570d
feat: Added auto approval field in GET expenses and reports api respo…
Anjanna Feb 3, 2026
90b2d29
feat: add mobile notification toggle in reminders api (#776)
NileshPant1999 Feb 4, 2026
63937a8
fix: Expense matched corporate card transaction id and matched corpra…
madangopal122 Feb 5, 2026
789a756
feat: add scopes to delegatee-related apis (#777)
KrupaH Feb 17, 2026
cfc00ab
update redocly version to fix React not defined error (#780)
KrupaH Feb 19, 2026
455ed24
fix: add scopes to employee_rot delegatees (#779)
KrupaH Feb 20, 2026
a219a37
chore: Clean hash urls (#778)
shubham-fyle Feb 24, 2026
6bc6336
feat: FYLE-86d0686td-eligible-cards-new-stats (#781)
Kulsekar4 Mar 9, 2026
b8ac125
feat: FYLE-86d0d4neu-reconcile-action-apis (#732)
Kulsekar4 Mar 17, 2026
0f3c28e
feat: Added api docs for report Revert to Processing api (#782)
Anjanna Mar 17, 2026
1199418
feat: Updated doc for reconciliation txn expense obj (#783)
satyamyesj Mar 18, 2026
15e0b10
feat: Added api docs for revert report to approved state api (#784)
Anjanna Mar 23, 2026
d4ea46c
feat: spender in_app_rating_state GET/POST OpenAPI (#785)
sumitkumarsage Apr 10, 2026
3253245
feat: FYLE-tax-requirement-column-addition (#787)
Kulsekar4 Apr 28, 2026
0745dff
add claude.md (#790)
KrupaH Apr 30, 2026
1121d7c
feat: Admin Approver expenses/check policy/check mandatory bulk APIs …
prabs222 May 18, 2026
433da10
feat: Add corporate cards merge api spec (#792)
madangopal122 Jun 11, 2026
bc458b9
feat: Add corporate card duplicate suggestions list api spec (#793)
madangopal122 Jun 16, 2026
f28b516
feat: Add corporate card duplicate suggestions dismiss api spec (#794)
madangopal122 Jun 17, 2026
889e6d0
feat: Add corporate card is_archived field to cct response schema (#795)
madangopal122 Jun 22, 2026
2cf3479
feat: Adding API Docs for approver/corporate_cards API (#797)
satyamyesj Jun 25, 2026
35f69c1
feat: Added archival fields to corporate card api response schemas (#…
madangopal122 Jun 25, 2026
b9de536
feat: Add corporate card is archived column to reconciliation eligibl…
madangopal122 Jul 3, 2026
b64caaf
feat: Add corporate card archive api spec (#799)
madangopal122 Jul 3, 2026
a4160cb
feat: Add corporate card unarchive api specs (#800)
madangopal122 Jul 3, 2026
0d70132
feat: Add spec for api to list archived cards in the statement upload…
madangopal122 Jul 7, 2026
91ca935
feat: FYLE-default-tax-group-changes (#803)
Kulsekar4 Jul 8, 2026
8a270ae
feat: Ignore stmt line items associated with archived cards api spec …
madangopal122 Jul 13, 2026
fd88094
fix: Update operationId of ignore archived cards api to be unique (#809)
madangopal122 Jul 13, 2026
f68b537
feat: Add corporate card archive suggestions list api spec (#810)
madangopal122 Jul 15, 2026
758f495
feat: Add corporate card archive suggestion dismiss api spec (#834)
madangopal122 Jul 15, 2026
c0863a3
fix: Fix required OpenAPI drift for Budgets (#812)
rvab Jul 15, 2026
3589719
fix: Fix required OpenAPI drift for Categories (#814)
rvab Jul 15, 2026
a4dbf9a
fix:Fix required OpenAPI drift for Corporate Cards Transactions (#815)
rvab Jul 15, 2026
b3486b0
fix: Fix required OpenAPI drift for Personal Cards (#824)
rvab Jul 15, 2026
fc5a334
fix: Fix required OpenAPI drift for Reconciliation (#827)
rvab Jul 15, 2026
e1ac6ca
feat: add cost centers delete and delete_summary bulk API contracts (…
Aniruddha-Shriwant Jul 15, 2026
72d257d
feat: add per diem rates delete bulk API contracts (#808)
Aniruddha-Shriwant Jul 15, 2026
7ab874b
fix: remove dept display_name where api does not return it (#789)
KrupaH Jul 16, 2026
a21e0fe
fix: create new schema for budget POST API response (#840)
rvab Jul 16, 2026
5427936
fix: employee embed used in reports apis (#841)
KrupaH Jul 16, 2026
5352bdc
fix: Fix required OpenAPI drift for Statement Upload (#832)
rvab Jul 16, 2026
a5067fd
feat: Added changes in API documentation for supported policy_violati…
sumitkumarsage Jul 17, 2026
a0b215e
feat: Added information for support of expense_merchants and expense_…
sumitkumarsage Jul 17, 2026
8dfa995
fix: Fix required OpenAPI drift for Departments (#837)
rvab Jul 20, 2026
a4f3aab
fix: Fix required OpenAPI drift for Files (#819)
rvab Jul 20, 2026
7cee78b
fix: Fix required OpenAPI drift for Org user settings (#823)
rvab Jul 20, 2026
ad5a4fc
fix: Fix required OpenAPI drift for Projects (#826)
rvab Jul 20, 2026
f9ad3e4
fix: Fix required OpenAPI drift for Policies (#825)
rvab Jul 20, 2026
7c665ba
fix: Fix required OpenAPI drift for Mileage (#821)
rvab Jul 20, 2026
7f3d31a
fix: Fix required OpenAPI drift for Business Expenses (#813)
rvab Jul 20, 2026
97aea03
fix: Fix required OpenAPI drift for Saved filters (#831)
rvab Jul 20, 2026
c6ef211
fix: Fix required OpenAPI drift for Reminders (#836)
rvab Jul 20, 2026
cd195c7
fix:Fix required OpenAPI drift for Recurrences (#828)
rvab Jul 20, 2026
74e6828
fix:Fix required OpenAPI drift for Team expenses (#833)
rvab Jul 20, 2026
e4074e3
fix: Fix Openapi drift required expenses (#817)
rvab Jul 20, 2026
3b81071
fix: Fix required OpenAPI drift for Employees (#835)
rvab Jul 20, 2026
efdf434
fix:Fix required OpenAPI drift for Cost Centers (#816)
rvab Jul 20, 2026
e3244fc
fix: correct mileage rate POST request schema (#838)
Aniruddha-Shriwant Jul 20, 2026
bcfcc49
feat: add mileage rates bulk API contracts (#839)
Aniruddha-Shriwant Jul 20, 2026
06995da
Added fix for failing test case by including null in contains_from_li…
sumitkumarsage Jul 21, 2026
1030c74
fix: Fix required OpenAPI drift for Exports (#818)
rvab Jul 22, 2026
9fe3702
fix:Fix required OpenAPI drift for Reimbursement (#829)
rvab Jul 22, 2026
b47d87b
fix: Fix required OpenAPI drift for Advances (#811)
rvab Jul 22, 2026
26b9f5c
feat: Add ignore_archived_cards field in create card transactions, su…
madangopal122 Jul 27, 2026
1353541
chore: mark data, count and offset fields required where applicable (…
rvab Jul 27, 2026
7a75b46
feat: Added doc for org weekly invitation usage API (#852)
satyamyesj Jul 28, 2026
9434639
feat: add OpenAPI contract for custom expense field reordering (#848)
devadathanmb Jul 28, 2026
762d5e1
feat: notify platform-types repo on reference change (#853)
rvab Jul 28, 2026
7e13c5a
feat: add departments bulk delete OpenAPI contracts (#846)
Aniruddha-Shriwant Jul 31, 2026
5c17edc
feat: add levels bulk delete OpenAPI contracts (#849)
Aniruddha-Shriwant Jul 31, 2026
26b9112
chore: update required fields (#855)
rvab Aug 5, 2026
ec3692d
Revert "chore: update required fields (#855)" (#856)
rvab Aug 6, 2026
02efe06
feat: Add advanced mileage rate properties (#842)
tirth-bhagwat Aug 6, 2026
1720e62
chore: update required fields (#858)
rvab Aug 10, 2026
4fb59b7
chore: add Platform API contract review skill (#807)
abhishek1234321 Aug 11, 2026
3590c71
fix: Fix expense action_data dropped from package types (#861)
rvab Aug 11, 2026
d79d4d9
feat: adding docs for mileate rates related fields in expenses api (#…
tirth-bhagwat Aug 12, 2026
bf0e8fe
feat: update required fields (#862)
rvab Aug 12, 2026
bfd5f8c
fix: API mismatch keys (#864)
rvab Aug 12, 2026
cded48c
chore: update required fields (#865)
rvab Aug 13, 2026
a1a2c08
feat: document admin report resubmission (#866)
Shwetabhk Aug 13, 2026
c9d0b6c
feat: Added api docs for get expenses count based on state (#863)
Anjanna Aug 17, 2026
2f5c53e
chore: update required fields (#867)
rvab Aug 19, 2026
9b014b2
chore: update reminder API schema (#868)
rvab Aug 19, 2026
ab93138
chore: update reminder amind reference file (#869)
rvab Aug 19, 2026
a3c6961
fix: update schema (#870)
rvab Aug 24, 2026
400fadb
fix: update schema (#872)
rvab Aug 25, 2026
9db1261
feat: Add spender corporate cards rtf monthly enrollment usage api sp…
madangopal122 Aug 28, 2026
24d8d85
feat: update any_type schema (#874)
rvab Sep 1, 2026
c219078
feat: Update any type schema to include unknown (#875)
rvab Sep 1, 2026
fe127d8
chore: add dummy common operation (#879)
Aniruddha-Shriwant Sep 3, 2026
d2da7a9
feat:update required fields for delegatees schema (#880)
rvab Sep 3, 2026
f7b6144
chore: sync main into v1
Aniruddha-Shriwant Sep 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
76 changes: 76 additions & 0 deletions .agents/skills/review-platform-api-contract/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: review-platform-api-contract
description: Review Fyle Platform API contract pull requests across runtime code, OpenAPI source and bundles, generated TypeScript, and consumers. Use for changes to endpoints, request or response schemas, requiredness, nullability, enums, or compatibility in fyle-platform-docs, fyle-platform-api, or fyle-platform-types. Produce evidence-backed findings and do not publish review comments unless explicitly asked.
---

# Review Platform API Contracts

Compare the proposed API contract change with runtime behavior, OpenAPI, and downstream types. Read [references/contract-chain.md](references/contract-chain.md) for repository-specific paths and commands.

## 1. Fix the review scope

- Resolve the PR base and head to immutable commits. Resolve the runtime revision separately: prefer a linked API PR or commit; otherwise use the API default-branch commit only as evidence of current behavior. Never use a sibling checkout unless its commit matches the recorded revision.
- Label each repository commit as proposed, current, or historical evidence. Do not use current behavior to prove what an old or closed PR did.
- Read the repository-local guidance files that exist, such as `AGENTS.md` or `CLAUDE.md`, and inspect each working-tree status.
- Preserve local changes. Use GitHub, `git show`, temporary copies, or a temporary worktree when a sibling repository is dirty.
- Inspect changed files, checks, reviews, and existing comments so findings are scoped and not duplicated.
- For docs-backed changes, run `<skill-dir>/scripts/contract_diff_inventory.py` with the PR base and head. Use its source-file, risk, role, and bulk-mode counts as review denominators.
- Triage changed source lines first. Prioritize `$ref`, requiredness, nullability, enums, shared schemas, and request/response shape changes; trace high-risk candidates through the full chain before expanding the review.

If a required repository is unavailable, continue only with supported conclusions and state the evidence gap.

## 2. Review source before generated output

- Treat `fyle-platform-docs/src/**` as source and `reference/*.yaml` as generated output.
- Map generated changes back to the exact source schema or path and attach findings there.
- Read the affected root document's OpenAPI version.
- Lint and rebuild every role reported by the inventory. A change under `src/components/**` requires every discoverable role root; a role-local change requires that role.

## 3. Prove runtime behavior

Trace each high-risk changed field from the endpoint through the exact runtime path.

Read runtime files from the selected immutable commit with `git show` or an isolated worktree. If no revision is linked strongly enough to support the claim, report the gap instead of treating an unrelated current checkout as proof.

- For requests, inspect the loaded Marshmallow schema, validation, defaults, `post_load`, action logic, and request/error fixtures.
- For responses, inspect the handler's dump schema, serialization hooks, the object being dumped, models, current database views and constraints, relevant migrations, and response fixtures.
- For enums, compare OpenAPI with the runtime enum, validators, storage representation, fixtures, migrations, and history for removed values.

Use these contract rules:

- Marshmallow `required` primarily controls loading; it does not prove response-key presence.
- OpenAPI object-level `required` means the key is present. `nullable` means a present key may be `null`.
- Omitted and present-with-`null` are different contracts.
- In OpenAPI 3.0, schema keywords beside `$ref` do not extend the referenced schema. Use `allOf` only after runtime evidence proves the added constraint is correct.
- When input and output behavior differ, prefer separate request and response schemas over weakening the response contract.

Do not infer runtime behavior from the OpenAPI diff or a Marshmallow field flag alone.

## 4. Check generated types and consumers

- Compare base and proposed bundles in isolated directories in `fyle-platform-types`.
- Run the version classifier and generate representative before/after TypeScript when the contract shape changes.
- If dependencies are unavailable, compare the specs and generator configuration only. Generated output is not committed in `fyle-platform-types`; mark TypeScript shape and semver as unverified instead of installing into a sibling repository.
- Search identifiable consumers for affected imports, enum members, request arguments, optional fields, and null handling.
- Classify runtime compatibility, documentation accuracy, generated-source compatibility, and semver impact separately.

Do not call a change runtime-breaking only because a generated type breaks, or call it documentation-only when generated consumers need a migration.

## 5. Validate and report

Run the smallest relevant checks from the repository map. Report failures and skipped checks without hiding them.

When the inventory selects bulk mode, account for the whole diff:

- Disposition every changed source file as manually reviewed or covered by a named deterministic check.
- Triage every risk-marker line and trace every resulting high-risk candidate; group mechanical edits only after proving the same rule covers every member.
- Report `reviewed/total` for source files, risk-marker lines, high-risk candidates, bundle roles, generated roles, and known consumer symbols. Sampling can support a finding, but cannot support a claim of complete review.

Return findings in severity order. Each finding must include:

1. The exact changed source line; for docs changes, prefer `src/**` over `reference/**`.
2. The concrete contract mismatch and user or SDK impact.
3. Concise runtime and generated-type evidence.
4. A specific requested change and, when useful, a proposed inline comment.

Finish with the reviewed commits, checks run or skipped, evidence gaps, and publication status. Keep comments as proposals unless the user explicitly authorizes posting them.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Review Platform API Contract"
short_description: "Review API contracts across runtime and types"
default_prompt: "Use $review-platform-api-contract to review this API contract PR across runtime, OpenAPI source, generated types, and consumers."
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Platform API contract chain

The repositories normally live beside one another:

| Repository | Contract role |
| --- | --- |
| `fyle-platform-api` | Runtime handlers, schemas, models, database views, migrations, and fixtures |
| `fyle-platform-docs` | OpenAPI source in `src/` and generated bundles in `reference/` |
| `fyle-platform-types` | Synced bundles, generated TypeScript, and semver classification |
| `fyle-app` | Known direct consumer of `@fylein/types`; do not assume it is the only consumer |

Resolve default branches and commits at review time. The contract flow is:

```text
fyle-platform-api runtime
-> fyle-platform-docs/src
-> fyle-platform-docs/reference
-> fyle-platform-types/specs
-> @fylein/types
-> consumers
```

## Record repository state

```bash
git status --short --branch
git symbolic-ref --short refs/remotes/origin/HEAD
git log -1 --format='%H %cI %s'
gh pr view <number> --json baseRefOid,headRefOid,state,url
```

The PR base branch may advance after the PR opens. Resolve both PR refs, then use their merge base for the reviewed diff. For runtime evidence, use a linked `fyle-platform-api` PR or commit when one exists. Otherwise, an exact default-branch commit can prove only current behavior. A checked-out branch, similar timestamp, or current file is not evidence for a historical PR unless its commit is the selected revision.

Record the evidence role beside every commit: proposed change, current behavior, or historical context. Read files with `git show <commit>:<path>` or from an isolated worktree so paths from different revisions are not mixed.

Do not switch, pull, install into, or generate inside a dirty sibling. Use read-only evidence or an isolated worktree instead.

## Review and validate docs

`src/<role>/openapi.yaml` declares the document version, tags, security, and path references. Endpoint definitions live in `src/<role>/paths/`; shared schemas live in `src/components/schemas/`. Filenames use `@` for URL separators.

Inventory a docs diff before tracing it:

```bash
python3 <skill-dir>/scripts/contract_diff_inventory.py \
--repo <fyle-platform-docs> --base <base-ref> --head <head-ref>
```

The script resolves immutable commits, computes the merge base, counts changed source files and risk-marker lines, discovers role roots from `src/*/openapi.yaml`, and selects bulk mode for more than 10 source files or more than 3 directly changed roles. Use `--format json` when file-level details are needed.

`reference/<role>.yaml` is generated. Read the pinned Redocly version from `.github/workflows/bundler.yml` at the reviewed revision and verify its bundle steps cover every discovered role root. Lint and bundle every role reported by the inventory:

```bash
openapi lint src/<role>/openapi.yaml
openapi bundle -o /tmp/<role>.yaml src/<role>/openapi.yaml
```

Compare temporary base and head bundles with their corresponding committed `reference/<role>.yaml` files, then compare base with head. A shared `src/components/**` change requires all role roots because shared-schema fan-out is not reliably visible from changed paths alone.

## Trace runtime behavior

Start from the route and inspect only the evidence needed for the changed field:

- `api/<resource>/<role>.py` or the relevant blueprint and view.
- `api/<resource>/schema.py` and inherited `core/schema/**` fields.
- The action class and model validation for writes.
- `db/models/**` column definitions.
- Current `db-migrations/views/**` plus migrations that changed the field or view.
- `api/tests/**/input.yaml` and `expected_output.yaml` for successful and validation-error cases.

Use history when removed enum values or legacy storage are relevant:

```bash
git log -p -G '<field-or-enum>' --all -- <relevant-paths>
```

Run the narrowest affected test group or test case using the commands in `fyle-platform-api/CLAUDE.md` when runtime verification is needed.

## Compare generated types

Read `package.json` for the required Node and pnpm versions. The useful entry points are:

```bash
pnpm test
OLD_SPECS_DIR=<base-specs> NEW_SPECS_DIR=<head-specs> pnpm run version:check
OPENAPI_SPECS_DIR=<specs> OPENAPI_OUTPUT_DIR=<output> pnpm exec openapi-ts
```

Use temporary base/head spec and output directories. `pnpm run build` syncs local docs into the types worktree, so run it only in an isolated worktree.

`dist/` and `.generated/` are ignored rather than committed. If generation dependencies cannot run, compare the input specs and generator configuration, state that generated TypeScript and semver are unverified, and stop short of claiming full-chain validation.

The classifier's highest result wins:

- `major`: `oasdiff breaking` reports a breaking OpenAPI change or a role disappears.
- `minor`: generated structure changes without an OpenAPI breaking result, or a role appears.
- `patch`: only generated documentation changes.
- `none`: no generated or documentation change.

## Account for broad changes

For bulk mode, keep a coverage manifest with these denominators:

- changed `src/**` files reviewed;
- risk-marker lines triaged and resulting candidates traced to runtime evidence;
- bundle roles linted and regenerated;
- generated roles compared when shape changes;
- affected symbols checked in every known available consumer.

Report each as `reviewed/total` and name the deterministic check used for grouped mechanical edits. Do not describe a sampled review as exhaustive; list any uncovered files, roles, or consumers as evidence gaps.

## Find consumers

`TYPES_CONSUMER_REPOS` is a GitHub repository variable and is not enumerated in source. Search available sibling repositories instead:

```bash
rg -l '"@fylein/types"\s*:' .. -g 'package.json' -g '!**/node_modules/**' -g '!**/.pnpm-store/**'
rg '<affected-generated-symbol>' ../<consumer> -g '*.ts' -g '*.tsx' -g '!**/node_modules/**'
```

Inspect only consumers that use affected generated symbols. State that the search is incomplete when private or unavailable consumers may exist.
Loading
Loading