feat: Initial Claude skills for websimple-devops
This commit is contained in:
70
references/websimple-gitea.md
Normal file
70
references/websimple-gitea.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Websimple Gitea
|
||||
|
||||
Use this skill for Websimple Gitea repository conventions and read-only metadata lookup workflows.
|
||||
|
||||
## Base URL
|
||||
|
||||
Websimple Gitea is hosted at:
|
||||
|
||||
- `https://gitea.websimple.com`
|
||||
|
||||
|
||||
## Authentication
|
||||
|
||||
Authenticated Gitea API reads use the `WEBSIMPLE_GITEA_API_TOKEN` environment variable. The bundled `scripts/gitea.sh` wrapper reads this value automatically. Assume the base URL is constant at `https://gitea.websimple.com`.
|
||||
|
||||
If `WEBSIMPLE_GITEA_API_TOKEN` is not set in the user's environment, ask them to export it before proceeding. Never print or echo the token's value back in chat. Use it only for read-only Gitea API requests.
|
||||
|
||||
## Available operations
|
||||
|
||||
The skill bundles a `scripts/gitea.sh` wrapper that exposes three read-only operations. The path is relative to the skill root, so resolve it from the skill directory (typically something like `<skill-root>/scripts/gitea.sh`).
|
||||
|
||||
Each operation prints a JSON envelope to stdout and exits non-zero on failure (with an error message on stderr).
|
||||
|
||||
- `gitea.sh repos-list [--org <org>]` — list repositories for an organization. Default org is `wp-sites`. Maps to `GET /orgs/{org}/repos`.
|
||||
- `gitea.sh vars-list <owner> <repo>` — list Actions variables for a repository. Maps to `GET /repos/{owner}/{repo}/actions/variables`.
|
||||
- `gitea.sh var-get <owner> <repo> <variable-name>` — get one Actions variable. Maps to `GET /repos/{owner}/{repo}/actions/variables/{variablename}`.
|
||||
|
||||
Example usage:
|
||||
|
||||
```bash
|
||||
bash "${SKILL_ROOT}/scripts/gitea.sh" var-get wp-sites example WP_SITE_URL
|
||||
```
|
||||
|
||||
Pipe through `jq` if a specific field is needed:
|
||||
|
||||
```bash
|
||||
bash "${SKILL_ROOT}/scripts/gitea.sh" var-get wp-sites example WP_SITE_URL | jq -r '.variable.data'
|
||||
```
|
||||
|
||||
If the wrapper exits non-zero, surface its stderr message to the user rather than retrying blindly; common causes are a missing/expired token or a typo in owner/repo/variable name.
|
||||
|
||||
## WordPress repositories
|
||||
|
||||
Websimple WordPress site repositories live under the `wp-sites` organization.
|
||||
|
||||
For WordPress project slug `${slug}`:
|
||||
|
||||
- Repository URL: `https://gitea.websimple.com/wp-sites/${slug}`
|
||||
|
||||
## Actions variables
|
||||
|
||||
Use Gitea Actions variables as the source of truth for project deployment and remote environment metadata.
|
||||
|
||||
For WordPress projects, expect these deployment values, usually from repository Actions variables:
|
||||
|
||||
- `WP_SITE_URL`: production WordPress site URL, including protocol, matching the WordPress `siteurl` option concept.
|
||||
- `REMOTE_HOST`: SSH host for the remote environment.
|
||||
- `REMOTE_PORT`: SSH port for the remote environment.
|
||||
- `REMOTE_USER`: SSH user for the remote environment.
|
||||
- `REMOTE_PATH`: WordPress project path on the remote host.
|
||||
|
||||
`wp-sites` repositories may rely on organization/repository fallback variables or secrets for `REMOTE_*` deployment values. If a per-repository `REMOTE_HOST`, `REMOTE_PORT`, `REMOTE_USER`, or `REMOTE_PATH` variable is missing, check the relevant fallback variable/secret source before treating the repository metadata as incomplete.
|
||||
|
||||
Prefer reading Gitea deployment metadata before using SSH. SSH lookups are fallback-only when required metadata is missing after repository values and fallback variables/secrets are considered.
|
||||
|
||||
## Safety
|
||||
|
||||
Treat Gitea metadata reads as read-only. Do not modify repositories, variables, secrets, workflows, branches, tags, issues, releases, or pull requests unless a future workflow explicitly adds an approval path.
|
||||
|
||||
Do not expose tokens or secrets. If authentication is needed beyond `WEBSIMPLE_GITEA_API_TOKEN`, ask the user to set the appropriate environment variable rather than printing or storing secrets inline.
|
||||
Reference in New Issue
Block a user