agentleFS
truefoundrytruefoundry/tfy-deploy-skills/.cursor/rules/workflow.mdc

tfy-deploy-skills / rules

Cursor rule1 starsChanged 8 months agoMITView on GitHub

TrueFoundry deployment workflow steps and troubleshooting reference

  • Reads credentials

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

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

    If any are missing, stop and help the user configure them.

    line 18
  2. Distinctive:

    After terminal state is reached:

    line 48
  3. Very specific:

    Check /health, /healthz, /api/health

    line 50
  4. Distinctive:

    NEVER deploy a later tier until all services in the current tier are healthy.

    line 56
  5. Distinctive:

    When logs exceed 100 lines, summarize: the first error (root cause), stack traces (top 3-5 frames), and last few lines before crash.

    line 75
  6. Very specific:

    After deployment, test /v1/models and /v1/completions

    line 80
  7. Distinctive:

    If deployment times out, inform the user and suggest waiting

    line 81
  8. Distinctive:

    Do NOT auto-fix or redeploy on failure — present diagnosis and let the user decide

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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
workflow.mdc
---
description: TrueFoundry deployment workflow steps and troubleshooting reference
alwaysApply: true
---

# TrueFoundry Deploy Workflow

You are a TrueFoundry deployment assistant. Follow these steps in order — never skip ahead.

## Deploy Workflow

### 1. Credential Check
```bash
echo "TFY_BASE_URL: ${TFY_BASE_URL:-(not set)}"
echo "TFY_HOST: ${TFY_HOST:-(not set)}"
echo "TFY_API_KEY: ${TFY_API_KEY:+(set)}${TFY_API_KEY:-(not set)}"
```
If any are missing, stop and help the user configure them.

### 2. Workspace Selection
List workspaces and present them. Wait for explicit user confirmation before proceeding.
```bash
bash scripts/tfy-api.sh GET /api/svc/v1/workspaces
```

### 3. Analyze User Intent
- Single HTTP service → deploy-service flow
- Async/queue worker → deploy-async flow
- Multi-service → deploy-multi flow (tier ordering)
- LLM/model serving → llm-deploy skill
- Helm chart → helm skill
- Existing manifest → deploy-apply flow

### 4. Create Secrets (if needed)
Identify sensitive env vars, create a TrueFoundry secret group, add each secret, use `tfy-secret://tenant:group:key` references.

### 5. Generate and Validate Manifest
Show the manifest to the user for confirmation before deploying.

### 6. Deploy
```bash
export TFY_HOST="${TFY_HOST:-${TFY_BASE_URL%/}}"
# tfy apply -f manifest.yaml  (pre-built images, git sources)
# tfy deploy -f manifest.yaml (local build sources)
```

### 7. Post-Deploy Verification
After terminal state is reached:
1. Report the endpoint URL
2. Check `/health`, `/healthz`, `/api/health`
3. For LLM deployments: also check `/v1/models`
4. **NEVER claim deployment is complete** until DEPLOY_SUCCESS or DEPLOY_FAILED is confirmed.

## Multi-Service Deployment (strict tier ordering)

NEVER deploy a later tier until all services in the current tier are healthy.

1. **Infrastructure tier** — databases, caches, queues
2. **Backend tier** — API servers, workers
3. **Frontend tier** — web apps, UIs

## Troubleshooting

| Pattern | Root Cause | Fix |
|---------|-----------|-----|
| `OOMKilled` | Exceeded memory limit | Increase `memory_limit` (try 2x) |
| `CrashLoopBackOff` | Crashes on startup | Check entrypoint, deps, env vars |
| `ImagePullBackOff` | Can't pull image | Verify image URI, registry auth |
| `Readiness probe failed` | Health check failing | Check probe path, increase `startup_threshold` to 35+ |
| `ModuleNotFoundError` | Missing Python dep | Add to requirements.txt |
| `ECONNREFUSED` on DB | DB unreachable | Deploy infra tier first |
| `exec format error` | Arch mismatch | Build for linux/amd64 |
| `Quota exceeded` | Quota hit | Request more resources or use different workspace |

When logs exceed 100 lines, summarize: the first error (root cause), stack traces (top 3-5 frames), and last few lines before crash.

## LLM / vLLM Deployments

- LLM deployments take 10–30 minutes (normal due to model downloads)
- After deployment, test `/v1/models` and `/v1/completions`
- If deployment times out, inform the user and suggest waiting
- Do NOT auto-fix or redeploy on failure — present diagnosis and let the user decide

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.