yahoo-finance2
AGENTS.md802 starsChanged 5 months agoMITView on GitHub
This file applies to the whole repository. For fuller contributor guidance, read CONTRIBUTING.md; this file repeats the essentials agents are most likely to need during edits. - This is a Deno-first TypeScript library that is published to npm via generated output. - Source code lives under src/. Tests usually sit beside the module they cover and use fixtures from tests/fixtures/http. - The npm/ directory is generated package output. Prefer editing source files under src/ and regenerate npm output only when…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- improveSkill
- yahoo-finance2Skill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 5 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 20
Run the full test suite with deno task test.
- Very specific: line 21
Run deno task test:replay for a cache-only baseline that fails on missing fixtures and denies live network requests and fixture writes.
- Very specific: line 23
Run FETCH_DEVEL=recache deno task test:recache for a paced live batch after an automatic replay-only baseline.
- Very specific: line 26
Run a targeted test with deno task test path/to/file.test.ts.
- Very specific: line 27
Run serial tests with deno task test:serial path/to/file.test.ts when debugging or limiting live Yahoo request concurrency.
- Very specific: line 29
Run schema generation with deno task schema after changing exported interfaces marked with @yf-schema.
- Very specific: line 31
Use deno fmt and deno lint for formatting and linting.
- Distinctive: line 43
Before committing recached fixtures, inspect their HTTP status and payload.
- Very specific: line 51
If a module file has @yf-schema, keep the generated .schema.json file in sync with deno task schema.
- Distinctive: line 53
Prefer updating typed interfaces and validation schemas together with focused tests that cover the Yahoo response shape involved.
- Distinctive: line 55
When Yahoo adds a response field, model it as required first.
- Very specific: line 64
Keep types tight: use concrete types and observed literal unions.
- Distinctive: line 89
Avoid editing generated directories, dependency directories, coverage output, or docs output unless the task explicitly requires it.
- Distinctive: line 91
Check git status before and after changes, and do not overwrite unrelated local work.
- Very specific: line 96
Use Conventional Commits with scope, e.g.
- Very specific: line 99
Always end with: Co-authored-by: <Assistant> (<model>, reasoning: <high>) <<email>> email part may be ommitted.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Agent Notes
This file applies to the whole repository. For fuller contributor guidance, read CONTRIBUTING.md; this file repeats the essentials agents are most likely to need during edits.
Project Context
- This is a Deno-first TypeScript library that is published to npm via generated output.
- Source code lives under
src/. Tests usually sit beside the module they cover and use fixtures fromtests/fixtures/http. - The
npm/directory is generated package output. Prefer editing source files undersrc/and regenerate npm output only when the task explicitly calls for it. - The default development branch is
dev.
Commands
- Run the full test suite with
deno task test. - Run
deno task test:replayfor a cache-only baseline that fails on missing fixtures and denies live network requests and fixture writes. - Run
FETCH_DEVEL=recache deno task test:recachefor a paced live batch after an automatic replay-only baseline. It aborts on 429 without rolling back earlier captures; generic getCrumb behavior tests remain replay-only. - Run a targeted test with
deno task test path/to/file.test.ts. - Run serial tests with
deno task test:serial path/to/file.test.tswhen debugging or limiting live Yahoo request concurrency. - Run schema generation with
deno task schemaafter changing exported interfaces marked with@yf-schema. - Use
deno fmtanddeno lintfor formatting and linting. - Build npm output with
deno task build:npmwhen generated npm artifacts are required.
Testing And Fixtures
- Tests use
fetch-mock-cacheand cached HTTP fixtures for repeatability. - New module tests should call
setupCache()fromtests/common.tswhen they touch Yahoo HTTP responses. FETCH_DEVEL=nocacheforces live network tests without cache.FETCH_DEVEL=recacheupdates cache for failing tests. Be careful with fixture churn, and do not recache files ending in.static.jsonor.fake.json.- Before committing recached fixtures, inspect their HTTP status and payload. Do not commit transient failures such as rate limits, consent interstitials, timeouts, or upstream 5xx responses as replacements for successful fixtures.
Schema And Validation
- TypeScript interfaces in module files are the source of truth for runtime validation schemas.
- If a module file has
@yf-schema, keep the generated.schema.jsonfile in sync withdeno task schema. - Prefer updating typed interfaces and validation schemas together with focused tests that cover the Yahoo response shape involved.
- When Yahoo adds a response field, model it as required first. Make it optional only when other cached valid responses demonstrate that the field is absent, and add descriptive JSDoc when its meaning is clear. Do not guess semantics.
Repairing failures after recaching
- Inspect failures and fixture HTTP status/payload before editing interfaces. Separate response-shape drift from HTTP/API errors, changed assertions, and runtime behavior issues. Do not loosen types to accommodate an error response.
- Keep types tight: use concrete types and observed literal unions. Add
?only with successful fixture evidence of omission in the same response shape; distinguish omission fromnull, empty objects, and empty arrays. Check older, static, and fake fixtures as well as the newly recached fixtures, and record representative filenames in the change description. - Edit TypeScript interfaces, then regenerate every affected schema before
retrying tests. The generator's timestamp check does not track imported type
dependencies. Explicit file arguments force regeneration, e.g.
deno task schema src/modules/quote.ts src/modules/options.ts; alternatively rundeno task schema --forceto regenerate all schemas. Also test consumers of shared schemas, such as historical after chart changes. - Automated fixture repair is limited to interfaces and generated schemas. If a failure needs runtime code, test expectations, or fixture changes, stop that particular repair, report the evidence and proposed action to the operator, and await feedback. Continue independent type/schema fixes while waiting and check for feedback before finishing. Do not disable validation or broaden a type simply to make a test pass.
- Replay focused cached tests first, then the full suite. Inspect generated schema diffs and final Git status; do not recache again as part of verification.
Editing Guidelines
- Preserve existing Deno import style, including
.tsextensions for local imports. - Avoid editing generated directories, dependency directories, coverage output, or docs output unless the task explicitly requires it.
- Check
git statusbefore and after changes, and do not overwrite unrelated local work.
Commit Messages
- Use Conventional Commits with scope, e.g. "fix(quote):". This is important for
semantic-releaseto publish correct versions. - The commit body should include a concise summary of motivation and changes.
- Always end with: Co-authored-by:
<Assistant>(<model>, reasoning:<high>) <<email>>emailpart may be ommitted. The rest is best effort, ask the user if not sure. For Codex, ~/.codex/config.toml has top levelmodelandmodel_reasoning_effort.
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.

