pagecord
Apps & AutomationInteract with the Pagecord API for a blog. Use when the user wants to inspect posts or pages, publish content through the API, check API connectivity, or inspect the home page.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/lylo/pagecord/blob/HEAD/.agents/skills/pagecord/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/pagecord, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Pagecord API
Use the public API at https://api.pagecord.com.
Setup
- Read API keys from
/Users/olly/dev/pagecord/.env. - Prefer
PAGECORD_API_KEYfor the default blog. - For a specific blog, look for
PAGECORD_{BLOG}_API_KEYwith the subdomain uppercased and hyphens replaced by underscores. - If no key exists, stop and tell the user to create one in
Settings > API. - All requests use
Authorization: Bearer {API_KEY}. Never print the raw key. - Show which API key env var is in use, masked if needed.
Operations
List posts or pages
Use GET /posts or GET /pages. Status may be published, draft, or all.
For all, make one published request and one ?status=draft request, then combine results. Paginate using page=N or Link headers until exhausted. Display a concise table with token, slug, title, status, and published date.
Get a post or page
Use GET /posts/{token} or GET /pages/{token}. Show token, title, slug, status, published date, canonical URL, tags, hidden state, locale, created/updated dates, and a short content preview.
Publish markdown
When publishing a local markdown file as a post:
- Read the file.
- Parse YAML front matter for title, status, published date, tags, and slug.
- Map
published: truetostatus: publishedandpublished: falsetostatus: draft. - If no title exists in front matter, use the first
# Heading. - Rewrite local
.mdlinks to/slugformat. POST /postswith the full markdown content andcontent_format=markdown.- Report the created token and URL.
Preserve front matter when sending markdown to the API.
Home page
Use GET /home_page. Show all fields. If the response is 404, report that no home page is set.
Status
Check API connectivity by fetching page and post counts from X-Total-Count, then report the key env var in use, published post count, and page count.
Output
- Tokens are full for single-item reads and truncated in list tables.
- Dates should be ISO 8601.
- For errors, show the HTTP status and response body.
- Never print the raw API key value.