agentleFS
NexusGPUNexusGPU/tensor-fusion/.cursor/rules/requirement.mdc

tensor-fusion / rules

Cursor rule170 starsChanged 10 months agoApache-2.0View on GitHub

Underlying tech: in this repo: Kubebulder, Scheduler, CDI. not in this repo: user-space time-divided sharing based fractional GPU, API forwarding based GPU-over-IP.

We split this requirement.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always be user-centric, think the whole user workflow and scenario and how a AI inference/training app running on this system for every …

    line 23
  2. Distinctive:

    Don't abstract too much nor abstract nothing, extract interface based on business understanding.

    line 25
  3. Distinctive:

    use modern latest golang features, eg any rather than interface{}, generic typing if needed etc.

    line 27
  4. Distinctive:

    Never reinvent wheels, think how kubernetes source codes and kubernetes SIGs do, leverage utils and constants packages and introduced …

    line 28
  5. Distinctive:

    Always prioritize security, scalability, and maintainability.

    line 29
  6. Distinctive:

    Never write large task at once, break to smaller ones

    line 32
  7. Distinctive:

    Only write necessary comments, e.g for some complex algorithm and background info, never write stupid comment.

    line 34
  8. Distinctive:

    Always remember to add events by kubernetes event recorder and logs for KEY code paths, which are important for user observability and …

    line 35
  9. Distinctive:

    Always test-driven, USE Ginkgo to write test cases, don't write native golang unit test, review codes and refactor until test works

    line 36
  10. Distinctive:

    When the task introduce some new memory state, consider expose it to server module for troubleshooting

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
requirement.mdc
---
alwaysApply: true
---

# Project Goals
TensorFusion is building large scale heterogeneous GPU pooling and scheduling AI infra using cloudnative ecosystem projects libs, help enterprise save GPU costs, simplify O&M and increase observability, boost elasticity.

Underlying tech: in this repo: Kubebulder, Scheduler, CDI. not in this repo: user-space time-divided sharing based fractional GPU, API forwarding based GPU-over-IP.

# Critical Modules
- pod mutating webhook for augment user pods, add needed inputs and outputs
- advanced scheduler with allocator/GPU-resource vertical scaler/bin-packing/rebalancer/quotas, based on schedulerFramework
- custom resource operator, GPU cluster -> pool -> gpunode -> gpu, gpunodeclaim -> node -> gpunode, maintain resources and TensorFusion components status, eval alerts etc.
- hypervisor, works like kubelet, reconcile TensorFusion workers on each gpu node, discover and bin devices, multi-process priority and autoFreeze handlers, produce metrics etc.
- server, for offering API to assign remote vGPU worker, expose system debug endpoints
- cloud provider integration (direct integration or with karpenter).
- indexallocator is a special module to resolve CDI device plugin Allocate interface can not get Pod info issue, without CDI container -> Pod matching, not possible to get advanced allocation info (hack before k8s DRA deployed). using dummy resource name and number to compose a special index pass to hypervisor. this is not general device plugin patter, need remember this context only when changing device allocation and device plugin related functions.

# Requirements

- You are professional cloudnative and AI infra engineer. High quality, robust codes with Golang and k8s best practices.
- For complex tasks, ask user to confirm the plan, then write code.
- Always be user-centric, think the whole user workflow and scenario and how a AI inference/training app running on this system for every task, no hidden logic, concise and strong type definition
- Define fields are in @api/v1 package, always think best data structure when CRD changes are needed.
- Don't abstract too much nor abstract nothing, extract interface based on business understanding.
- extract function when its larger than 50-80 lines, otherwise prefer simple single function for one responsibility of codes.
- use modern latest golang features, eg any rather than interface{}, generic typing if needed etc.
- Never reinvent wheels, think how kubernetes source codes and kubernetes SIGs do, leverage utils and constants packages and introduced dependencies.
- Always prioritize security, scalability, and maintainability.
- Think reconcile loop, memory consistency pattern, kubebuilder framework.
- Think k8s tricky issues like resource conflicts, finalizers, deepCopy rather than one field by one assignment, use equality.semantic.DeepEqual rather than hard code comparing.
- Never write large task at once, break to smaller ones
- For every task completed, run `golangci-lint run --fix` to check and fix lint issues, and run `make test` for parallel regression testing, if failed without useful debug info, try ginkgo Focused file mode or `make test-serial` to narrow down the issue
- Only write necessary comments, e.g for some complex algorithm and background info, never write stupid comment.
- Always remember to add events by kubernetes event recorder and logs for KEY code paths, which are important for user observability and troubleshooting, but events should not be too many.
- Always test-driven, USE Ginkgo to write test cases, don't write native golang unit test, review codes and refactor until test works
- When the task introduce some new memory state, consider expose it to server module for troubleshooting

Download now (ZIP)

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 3,978 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 repository2 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.