# Claude Skill: DEV.to Publishing (AppleScript)
**Publish articles to DEV.to** from Claude Code — using AppleScript to control your real Chrome browser and DEV.to's internal CSRF API.
## What's Inside
| Skill | Description |
|-------|-------------|
| `devto-post` | Publish markdown articles to DEV.to with tags, via the reliable CSRF API |
## Why Not Just Use the Editor?
DEV.to's React editor has multiple bugs that make automation unreliable:
| Issue | What Happens |
|-------|-------------|
| Tag input | Tags concatenate into one string instead of separating |
| Auto-save drafts | Bad state persists across page reloads |
| React state | Native value setters can corrupt controlled components |
**The solution:** Bypass the editor entirely. Use DEV.to's internal `POST /articles` API with a CSRF token. One API call = article published. 100% reliable.
## Install
```bash
npx skills add PHY041/claude-skill-devto
```
Or manually copy the `.claude/skills/` directory into your project.
## Requirements
- **macOS** (AppleScript is macOS-only)
- **Google Chrome** with "Allow JavaScript from Apple Events" enabled:
- Chrome → View → Developer → Allow JavaScript from Apple Events
- Restart Chrome after enabling
- Logged into DEV.to in Chrome
## Usage
Once installed, just tell Claude Code:
```
Post this article to DEV.to
```
or
```
Publish my markdown file to DEV.to with tags: python, opensource, tutorial
```
The skill will:
1. Navigate Chrome to dev.to
2. Extract CSRF token from the page
3. POST to `/articles` with your content
4. Return the published URL
## How It Works
```javascript
// 1. Get CSRF token from page meta tag
var csrf = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
// 2. POST to internal API
var resp = await fetch('/articles', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf
},
credentials: 'include',
body: JSON.stringify({
article: {
title: "Your Title",
body_markdown: "# Your content...",
tags: ["python", "opensource"],
published: true
}
})
});
```
All executed through Chrome via AppleScript — uses your existing login session.
## Important Gotchas
- **Never start article body with `---`** — DEV.to parses it as YAML front matter
- **Max 4 tags**, all lowercase
- **Long articles**: Write body to a temp JSON file, then inject via JXA (see skill for details)
## License
MIT