Skip to content

Commit cf8935d

Browse files
Initial commit
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit cf8935d

291 files changed

Lines changed: 28159 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: speakeasy-context
3+
description: "Speakeasy workflow: run 'agent context' FIRST, do task, run 'agent feedback' LAST. Triggers on speakeasy, SDK, OpenAPI."
4+
license: Apache-2.0
5+
---
6+
7+
# speakeasy-context
8+
9+
## Rule
10+
11+
Before any Speakeasy task: **run `speakeasy agent context`**. Prefer CLI output over web/docs.
12+
13+
## Commands
14+
15+
```bash
16+
speakeasy agent context # Get current CLI capabilities
17+
speakeasy agent feedback "<msg>" # Report issues or suggestions
18+
speakeasy <command> --help # Command-specific help
19+
```
20+
21+
## Workflow
22+
23+
1. `speakeasy agent context`
24+
2. Do the task using Speakeasy CLI
25+
3. `speakeasy agent feedback "<msg>"`**always provide feedback** after completing a task (what worked, what was confusing, suggestions)
26+
27+
## Don'ts
28+
29+
- Don't use web search as source of truth
30+
- Don't guess syntax; use `context` or `--help`
31+
- Don't skip `context` at session start

.devcontainer/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
3+
4+
# Dev Containers Quick Start
5+
6+
The default location for usage snippets is the `samples` directory.
7+
8+
## Running a Usage Sample
9+
10+
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11+
12+
```
13+
ts-node root.ts
14+
```
15+
16+
## Generating Additional Usage Samples
17+
18+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
19+
20+
- To generate a sample for a specific operation by providing an operation ID, use:
21+
22+
```
23+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -i {INPUT_OPERATION_ID} -o ./samples
24+
```
25+
26+
- To generate samples for an entire namespace (like a tag or group name), use:
27+
28+
```
29+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -n {INPUT_TAG_NAME} -o ./samples
30+
```

.devcontainer/devcontainer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
3+
{
4+
"name": "TypeScript",
5+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
// "features": {},
8+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
9+
// "forwardPorts": [],
10+
// Use 'postCreateCommand' to run commands after the container is created.
11+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-vscode.vscode-typescript-tslint-plugin",
16+
"esbenp.prettier-vscode",
17+
"github.vscode-pull-request-github"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.formatOnSave": true,
22+
"typescript.tsc.autoDetect": "on",
23+
"typescript.updateImportsOnFileMove.enabled": "always",
24+
"typescript.preferences.importModuleSpecifier": "relative",
25+
"[typescript]": {
26+
"editor.codeActionsOnSave": {
27+
"source.organizeImports": true
28+
}
29+
},
30+
"[typescriptreact]": {
31+
"editor.codeActionsOnSave": {
32+
"source.organizeImports": true
33+
}
34+
}
35+
}
36+
},
37+
"codespaces": {
38+
"openFiles": [
39+
".devcontainer/README.md"
40+
]
41+
}
42+
}
43+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44+
// "remoteUser": "root"
45+
}

.devcontainer/setup.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Install the speakeasy CLI
4+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5+
6+
# Setup samples directory
7+
rmdir samples || true
8+
mkdir samples
9+
10+
npm install --ignore-scripts
11+
npm install -g ts-node --ignore-scripts
12+
npm link
13+
npm link @sfcompute/sdk
14+
TS_CONFIG_CONTENT=$(cat <<EOL
15+
{
16+
"compilerOptions": {
17+
"baseUrl": ".",
18+
"paths": {
19+
"openapi": ["../src/index"],
20+
"openapi/*": ["../src/*"]
21+
}
22+
},
23+
"include": ["./**/*.ts"]
24+
}
25+
EOL
26+
)
27+
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json
28+
29+
# Generate starter usage sample with speakeasy
30+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -o samples/root.ts

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.ts linguist-generated=false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.agents/skills/speakeasy-context

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/models
2+
/models/errors
3+
/types
4+
/node_modules
5+
/examples/node_modules
6+
/lib
7+
/sdk
8+
/funcs
9+
/react-query
10+
/mcp-server
11+
/hooks
12+
/index.*
13+
/core.*
14+
/bin
15+
/cjs
16+
/esm
17+
/dist
18+
/.tsbuildinfo
19+
/.eslintcache
20+
/.tshy
21+
/.tshy-*
22+
/__tests__
23+
.DS_Store
24+
**/.speakeasy/temp/
25+
**/.speakeasy/logs/
26+
.DS_Store
27+
/.speakeasy/reports
28+
.env
29+
.env.local
30+
.env.*.local

.npmignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**/*
2+
!/FUNCTIONS.md
3+
!/RUNTIMES.md
4+
!/REACT_QUERY.md
5+
!/**/*.ts
6+
!/**/*.js
7+
!/**/*.mjs
8+
!/**/*.json
9+
!/**/*.map
10+
11+
/eslint.config.mjs
12+
/cjs
13+
/.tshy
14+
/.tshy-*
15+
/__tests__

0 commit comments

Comments
 (0)