Skip to content
Automation
Agent

write-intent

Announce intent before writing files — one sentence stating what, where, and why, with an idempotence check that skips the Write entirely when state is already correct.

From plugin
octo
4.3k49 skills49 agents53 commands18 hooks

Claude Code

> /plugin marketplace add nyldn/claude-octopus

Agent definition

write-intent.md
name: write-intent-principle
domain: general
description: Announce intent before writing files — one sentence stating what, where, and why, with an idempotence check that skips the Write entirely when state is already correct.

Write-Intent Principle

Before creating, overwriting, or rewriting any file as part of a command, skill, or agent workflow, you MUST:

1. Check for idempotence first

If the desired state already matches the current state, **do not call Write at all.** Confirm the state to the user and exit. The most common bug this prevents is writing config for a mode / setting / flag the user is already in — that's noise, not value.

Examples of state to check before writing:

  • Target mode matches current mode → skip
  • Target frontmatter field matches current field → skip
  • Generated file is byte-identical to what you'd write → skip

2. Announce intent in one sentence

When a Write **is** needed, say what you're about to do **before** calling the tool. Format:

> Writing `<path>` (create | update | overwrite) — `<field/change>` — because `<why>`.

Example:

> Updating `.claude/claude-octopus.local.md` — setting `knowledge_mode: false` (was `true`) — because the user requested `/octo:dev`.

3. Never write "empty" config

Do not create a config file populated with defaults just to "mark" a state. Absent config is a legitimate state — it means "use defaults". Creating a file to restate defaults adds noise, makes diffs confusing, and implies the user opted into something they didn't.

4. Respect scope

Before writing to `.claude/`, `~/.claude-octopus/`, `~/.claude/`, or any user-owned directory from a command/skill, consider whether the file should live in:

  • The plugin (committed, shipped to all users)
  • The user's home (`~/.claude/`) — persists across projects
  • The project workspace (`.claude/`) — per-project
  • `~/.claude/scratchpad/<session-id>/` — ephemeral working files

A user-facing command that writes to an unexpected scope (e.g. a "mode switch" that writes to project `.claude/`) needs to say *which* scope in its intent sentence.

Anti-Patterns (reject in review)

  • ❌ `/octo:dev` writes `.claude/claude-octopus.local.md` when the file didn't exist and the user was already in default Dev Work Mode.
  • ❌ A "setup" wizard silently creates configuration for every possible option even when not selected.
  • ❌ An idempotent-looking operation overwrites a file with identical content, bumping its mtime and confusing build systems.
  • ❌ A skill announces "I'll update your config" and then writes without showing the diff or field being changed.

Correct Patterns

  • ✅ Check current state → already matches target → confirm to user → exit without Write.
  • ✅ "Switching Knowledge Work → Dev Work — updating `.claude/claude-octopus.local.md` (`knowledge_mode: true` → `false`)." followed by the Write.
  • ✅ "No `.claude/claude-octopus.local.md` exists — you're in default Dev Work Mode. Nothing to change." followed by no Write.

Scope

This principle applies to **all** Write operations initiated by skills, commands, and agents in this plugin. Tests in `tests/unit/test-write-intent.sh` enforce that user-facing mode-switch commands carry the idempotence check in their implementation instructions.

Read more
@nyldn
Ships withocto

Every AI model has blind spots. Claude Octopus supports twelve external provider integrations — Codex, Antigravity CLI, Copilot, Qwen, Ollama, Perplexity, OpenRouter, OrcaRouter, OpenCode, Cursor CLI, Grok, and Kimi Code — alongside the built-in Claude Code

4.3k70 skills49 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
4.3k
Star history of nyldn/claude-octopus on GitHub, a chart by star-history.com

Other agents on octo.

backend-architect

backend-architect

Agent

Expert backend architect for scalable API design, microservices, and distributed systems. Masters REST/GraphQL/gRPC, event-driven…

@nyldn@nyldnInstall Agent
cloud-architect

cloud-architect

Agent

Expert cloud architect for AWS/Azure/GCP multi-cloud design, IaC (Terraform/CDK), FinOps, serverless, security, and compliance.…

@nyldn@nyldnInstall Agent
code-reviewer

code-reviewer

Agent

Elite code reviewer for AI-powered analysis, security vulnerabilities, performance, and production reliability. Masters static…

@nyldn@nyldnInstall Agent
database-architect

database-architect

Agent

Expert database architect for data layer design, technology selection, schema modeling, and scalable architectures. Masters…

@nyldn@nyldnInstall Agent
debugger

debugger

Agent

Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.

@nyldn@nyldnInstall Agent
docs-architect

docs-architect

Agent

Creates comprehensive technical documentation from existing codebases. Analyzes architecture, design patterns, and implementation…

@nyldn@nyldnInstall Agent

More agents from other plugins.

BUILT_IN_TOOLS

BUILT_IN_TOOLS

Agent

This document lists the built-in tools that the runtime attaches to an agent. It explains what each tool does and when the…

n8n11d209k
@n8n-io@n8n-ioInstall Agent
aris-fanout-leaf

aris-fanout-leaf

Agent

Read-only leaf worker for one bounded ARIS fan-out shard. Never delegates, writes files, or renders verdicts.

aris11d18k
@wanshuiyin@wanshuiyinInstall Agent
branch-diff-reviewer

branch-diff-reviewer

Agent

Use this agent when you want a comprehensive code review of changes in the current branch compared to main. This includes…

windmill11d18k
@windmill-labs@windmill-labsInstall Agent
GLOBAL

GLOBAL

Agent

本文件包含所有 Agent 必须遵守的通用规则。各 Agent 的 SOUL.md 可覆盖此处设定。

edict6w17k
@cft0808@cft0808Install Agent

Questions about write-intent.

Which coding agents can use write-intent?
write-intent installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.