| mode |
|---|
agent |
We are in the folder for a new project. Your job is to set up the workspace according to my usual preferences. Here are the requirements:
{
"scripts": {
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
},
}Install Prettier and the necessary plugins:
npm install --save-dev prettierCreate a .prettierrc.json file with the following content:
{
"jsxSingleQuote": true,
"trailingComma": "es5"
}Create a .prettierignore file with the following lines:
- Always include
node_modules/ - If the project is a Next.js project, include
.next/ - If the project uses Drizzle ORM, include
drizzle/meta/ - If the project uses Snaplet, include
src/db/.snaplet/
Add the following script to package.json:
{
"scripts": {
"format": "prettier --write .",
}
}Create an .editorconfig file with the following content:
root = true
[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# These .json files are automatically generated
[{package.json}]
indent_style = space
indent_size = 2
# YAML does not allow tabs
[*.{yml,yaml}]
indent_style = space
indent_size = 2If the project has a package-lock.json file, update [{package.json}] to be [{package.json,package-lock.json}].
Create a .vscode/settings.json file with the following settings:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.sortImports": "always"
},
"[typescript]": {
"editor.formatOnType": true
},
"[typescriptreact]": {
"editor.formatOnType": true
},
"typescript.suggest.autoImports": true,
}Create a .vscode/mcp.json file with the following MCP server configurations:
{
"servers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github-reponame-pat}"
}
},
},
"inputs": [
{
"id": "github-reponame-pat",
"type": "promptString",
"description": "GitHub Personal Access Token for organization/repository-name repository"
},
]
}{
"servers": {
"git-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/git-mcp-server"
]
},
},
}Try to figure out whether the project is using Jira for issue tracking. If you cannot determine this from the context, ask the user to confirm. If the project is using Jira, include the following MCP server configuration:
{
"servers": {
"mcp-atlassian": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.atlassian.com/v1/sse"
]
},
},
}Create a .vscode/tasks.json file and populate it with tasks:
{
"version": "2.0.0",
"tasks": [
]
}For each scripts in package.json#scripts section, add a task in .vscode/tasks.json:
// npm run scriptname
{
"type": "npm",
"script": "scriptname",
"problemMatcher": [],
"label": "npm: scriptname"
},If the project is using Vercel add the following task:
// vercel
{
"type": "shell",
"command": "npx",
"args": ["vercel", "env", "pull", ".env.local"],
"problemMatcher": [],
"label": "vercel:env:pull"
},If the project is using Docker Compose, add the following task:
// docker-compose up
{
"type": "shell",
"command": "docker-compose",
"args": ["up"],
"problemMatcher": [],
"label": "docker-compose:up",
"runOptions": {
"runOn": "folderOpen"
}
},Ask the user whether this project should use Dependabot for version updates. If the user confirms, create a .github/dependabot.yml file with the following content:
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
commit-message:
prefix: "[npm] "
labels:
- "npm dependencies"