# P1 Task Codex skill

The P1 Task Codex skill (`p1-task-api`) is a Codex skill that drives the P1 Task Public API v1 with a project API key. It follows the live agent guide (https://p1task.com/docs/public/llms.md) and the OpenAPI contract (https://p1task.com/openapi.public.json) and uses only documented public operations.

| | |
| --- | --- |
| Version | **0.3.0** |
| Download | https://p1task.com/downloads/p1-task-api-0.3.0.zip |
| File name | `p1-task-api-0.3.0.zip` |
| SHA-256 | `59ad2811596d3cedeff1e1664fdd6db6e467a18de064674971e677b157b8a871` |

## Supported workflows

- Inspect a task and download its developer package (the same package as the app's "Move to development" download).
- Ask the reporter structured questions when facts are missing (`information-requests`).
- Defer a task to the backlog for an owner decision (`defer`), with an internal reason note or silently (`createInternalNote: false`).
- Set the owner priority after every analysis (`priority`): P1 urgent or critical, P2 high, P3 normal.
- Implement a fix through claim, start, evidence, comment and complete.
- Run scheduled queue checks that a caller sets up.

## Install

1. Download https://p1task.com/downloads/p1-task-api-0.3.0.zip.
2. Verify the checksum before you extract the file. Run one of these in the folder with the download:

   ```bash
   shasum -a 256 p1-task-api-0.3.0.zip   # macOS
   sha256sum p1-task-api-0.3.0.zip       # Linux
   ```

   The output must be exactly `59ad2811596d3cedeff1e1664fdd6db6e467a18de064674971e677b157b8a871`. Do not install a file whose checksum differs.
3. Extract the `p1-task-api` folder into `$CODEX_HOME/skills`, or into `~/.codex/skills` when `CODEX_HOME` is not set:

   ```bash
   SKILLS_DIR="${CODEX_HOME:-$HOME/.codex}/skills"
   mkdir -p "$SKILLS_DIR"
   unzip p1-task-api-0.3.0.zip -d "$SKILLS_DIR"
   ```

4. Start a new Codex chat and invoke `$p1-task-api`.

## Upgrade

Never extract a new version over an existing `p1-task-api` folder: files that no longer exist in the new version would stay behind. Preserve the installed version first:

1. Move the installed folder aside, outside the skills directory. A folder left inside it may still be picked up as a skill.

   ```bash
   SKILLS_DIR="${CODEX_HOME:-$HOME/.codex}/skills"
   mkdir -p "$HOME/.codex/skill-backups"
   mv "$SKILLS_DIR/p1-task-api" "$HOME/.codex/skill-backups/p1-task-api-<old version>"
   ```

2. Verify the checksum of the new ZIP and extract it as described under Install.
3. Start a new Codex chat and check that the new version works.
4. Delete the backup only after the new version works.

Your local configuration (the credential file, the project pins and any automation state) lives outside the skill folder, so an upgrade does not touch it.

## Versions

- **0.3.0** (current): adds the `priority` command and the `Client.set_priority` call of the helper for `POST …/priority`, and the instructions tell the agent to set the owner priority (P3 normal, P2 high, P1 urgent or critical) after every analysis.
- **0.2.0**: withdrawn and no longer available for download. It added silent deferral (`createInternalNote: false`). Upgrade to the current version as described under Upgrade.
- **0.1.0**: withdrawn and no longer available for download. Upgrade to the current version as described under Upgrade.

## Credentials

1. Create a project API key on the Integrations page (https://p1task.com/admin/integrations) with access "Whole project". The key is shown once. API access requires a paid plan.
2. Provide the key in one of two ways:
   - as the `P1_API_KEY` environment variable of the process that runs Codex, or
   - in a credential file outside any Git repository. The file must be a regular file (not a symlink), owned by you, readable and writable by you only, and contain exactly one line, `P1_API_KEY=...`.

This creates the credential file without putting the key in your shell history or on a command line. Paste the key into the editor, then save and close it:

```bash
umask 077
mkdir -p ~/.config/p1task
${EDITOR:-vi} ~/.config/p1task/project.env
chmod 600 ~/.config/p1task/project.env
```

Never paste the key into a chat, commit it, or pass it as a command argument.

## Project configuration

The skill requires the expected project ID and project key explicitly (`--project-id` and `--project-key`) on every command, and checks them against `GET /status` before any other call. If they do not match, it stops.

To find them, call `GET /status` with your key. The response has `project.id` and `project.key`. The Integrations page shows the project the key belongs to.

```bash
curl -sS -H "x-api-key: $P1_API_KEY" https://p1task.com/api/public/v1/status
```

Keep these pins and the credential file path in your own local configuration, for example the repository's agent instructions or your Codex configuration, not inside the skill folder.

## What the package contains

The ZIP holds one folder, `p1-task-api/`:

- `SKILL.md`: the skill instructions.
- `agents/openai.yaml`: the Codex display name, short description and default prompt.
- `references/client.md`: how to use the helper.
- `references/automation.md`: how to run scheduled queue checks.
- `scripts/p1_api.py`: the helper (Python standard library only) with the commands `status`, `list`, `detail`, `export`, `triage` and `priority`.
- `scripts/test_p1_api.py`: tests of the helper.

It contains no credentials, no project IDs and no local settings.

## Links

- Agent guide: https://p1task.com/docs/public/llms.md
- OpenAPI JSON: https://p1task.com/openapi.public.json
- Interactive API reference: https://p1task.com/docs/public/
