actual-software/actual-plugin
关于
Align coding agents with your architecture decisions
开发工具实测星标增长
- 24小时
- 正在收集历史
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Architectural context for coding agents
Align coding agents with your architecture decisions
Coding agents like to follow rules, especially when they are formatted as Architecture Decision Records (ADRs). Starting recently, they also like to write ADRs. You might find that your current repository already has rules in docs/adr. Rules like which database you store data in, how services call each other, and what must never be logged. When rules are generated organically, they are often too vague, too bloated, badly scoped, and become out of date over time.
Actual.AI Plugin puts well-scoped, well-formatted, automatically maintained rules in front of Claude Code and Codex, which should reduce your token usage and review time. See demos.actual.ai for examples. Once the ADRs are committed via the bootstrap command, Actual.AI Plugin:
- Briefs the agent on the rules that govern each file as it reads or edits it, so the first draft already follows them.
- Checks the plan against your rules before the agent builds on it.
- Checks the changes at the end of every turn, and sends a conflict back to the agent with the decision it breaks and why.
- Leaves the last word with you. You can override any rule, and the exception reason is recorded for later analysis.
- Writes ADRs with you. The
adr-draftskill creates, changes and removes decisions, andadr-bootstrapproposes a repository's first set from existing rules and agent logs.
In a repository with no rule files the plugin checks nothing; it tells your agent once that no decision governs the repository yet, and offers adr-bootstrap.
Documentation for the Actual.AI Plugin and the Actual CLI can be found at docs.actual.ai.
Getting started
1. Install the actual CLI
The CLI runs the checks, and the plugin does nothing without it, so installing the plugin includes installing the CLI. The plugin needs version 0.20.0 or later.
npm install -g @actualai/actual@latest
Or brew install actual-software/actual/actual. Either install keeps the CLI and the plugin up to date on their own, and it's for your machine, not a dependency of any repository. Other install options.
2. Install the plugin in your agent
Claude Code
Run each command on its own, as a message in a Claude Code session:
/plugin marketplace add actual-software/actual-plugin
/plugin install actual@actual-ai
/reload-plugins
There's nothing to configure: every setting works as it is. If the installer says options are "not yet set" or shows a form of them, leave them as they are.
The CLI keeps itself and the plugin up to date as each session starts. Optionally, to have Claude Code update the plugin as well, run /plugin, open the Marketplaces tab, select actual-ai and choose Turn on auto-update (Enable auto-update in older versions of Claude Code). Updates in Claude Code.
Codex
Run these in a terminal:
codex plugin marketplace add actual-software/actual-plugin
codex plugin add actual@actual-ai
actual plugin update
actual plugin update turns on the plugin's hooks. It adds them to your own ~/.codex/hooks.json, after any hooks of yours, which stay as they are. Your next Codex thread asks you to review them: choose Trust all and continue, or trust them later in /hooks (Settings → Hooks in the app). Until you trust them, the hooks don't run and nothing is checked.
The plugin isn't in Codex's public plugin directory, which doesn't list plugins that carry hooks, so install it with the commands above. Codex plugin covers updates and removal.
Other agents
npx skills add actual-software/actual-plugin installs the three skills alone, in Cursor, OpenCode or another agent. They run the CLI and write ADRs with you, without the checks, briefing or overrides, which need the plugin's hooks. The skill on its own.
3. Set up your decisions
In each repository, run /actual:adr-bootstrap in Claude Code, or ask your agent to "set up this repository's ADRs". It converts the ADRs the repository already has, then asks whether to draft ADRs for what they don't cover, and creates the ones you pick with their rule files under .actual/rules/, which the checks read.
Optional:
Run
actual loginto sign in to Actual AI. The checks,actual rulesand drafting ADRs run signed out. Signed in, new ADRs go to Actual AI instead ofdocs/adr/, and in a repository with decisions the CLI adds it to your organization and shares the decisions indocs/adr/with your team, then says so and how to undo it. It doesn't do this whenCIis set. GitHub isn't needed:actual repo showsays which repository a checkout uses,actual repo addadds one by hand (a fork uses the original's decisions unless you pass--separate), andactual repo link <id | owner/name>writes.actual/repo.json, which you commit, to point a checkout at one.To add one decision later, run
actual adr create(newis its alias), or/actual:adr-draft <a decision>to draft it with your agent:actual adr create "Use Postgres for storage" --policy "MUST: Services store relational data in Postgres."Signed out, it writes the decision into
docs/adr/as accepted, along with its rule file under.actual/rules/. Signed in, it saves the decision to Actual AI, andactual adr refresh, which the plugin runs for you, writes an accepted one's rule file; for a repository connected to GitHub, the sync pull request app.actual.ai opens also writes both files.actual rules lslists the rule files the checks read and marks a draft as not enforced.
From then on, every plan and every turn in that repository is checked against those decisions.
Use
The checks run on their own. In either agent you can also ask:
- "Which of our architecture rules govern
src/payments/?" - "Check my uncommitted changes against our architecture rules."
- "Bring the ADRs in
docs/adr/under governance." - "Diagnose why Actual is failing."
- "Draft an ADR for how we call the payment provider."
- "Propose the foundation ADRs for this repository."
- "List our draft decisions in Actual AI."
Claude Code and Codex side by side
Both agents run the same hook scripts and the same CLI, so the rules, the verdicts and the override codes are the same. What differs follows from what each agent offers a hook:
| Claude Code | Codex | |
|---|---|---|
| Plan check | Before you see the approval dialog, so a conflicting plan is revised first | When the Plan-mode turn that proposed the plan ends, so you see the first draft |
| Change check | At the end of every turn | At the end of every turn |
| When a check blocks | A dialog names the decision and asks whether to fix it or keep your changes | The turn stops and names the decision. Reply fix it, or override. Plan mode shows a picker instead |
| Override | /actual:override <rule-id|all> [code] [reason] |
actual override <rule-id|all> [code] [reason], typed as a message |
| Rule briefing | As the agent reads or edits a file | After a read-only shell command (cat, rg and the like) and before a patch applies |
| Session summary | A row above the prompt | A line at the end of a turn, when it has changed |
| Settings | Rows under /plugin, or ACTUAL_* environment variables |
ACTUAL_* environment variables |
The Codex guide covers each difference, the picker and unattended runs such as codex exec.
More in the docs
- The plan and change checks, overrides and rule briefing
- Settings and troubleshooting
- Write and draft decisions with
adr-draftandadr-bootstrap. Signed out, each ADR is an accepted file indocs/adr/that the checks enforce at once, and signed in, a decision in Actual AI, accepted or a draft as you choose. - Context files with adr-bot and Ask the Advisor, which the
actualskill runs when you ask for them
Contributing
Contributions are welcome, whether that's a bug report, an idea or a pull request. The plugin is Apache-2.0 licensed and developed in the open. Here's where things live:
| Path | What's there |
|---|---|
hooks/ |
The shell hooks both agents run, the Claude Code mod (hooks/register.js) and the tests in hooks/tests/ |
skills/ |
The actual, adr-draft and adr-bootstrap skills |
commands/ |
The /actual:override slash command |
.claude-plugin/, .codex-plugin/ |
The manifest for each agent |
docs/adr/, .actual/rules/ |
This repository's own decisions and rule files. The plugin governs its own development |
Some good ways in:
- Report what you hit. Open an issue for a bug or a feature request. A check that got something wrong, a confusing message and a rough edge in Codex are all worth reporting.
- Fix a hook or add a test. The hooks are plain shell, and the tests replay recorded hook payloads from
hooks/tests/fixtures/, so a payload that reproduces a bug is a useful contribution on its own. - Improve a skill. The skills are Markdown. If one gave your agent a wrong step, or missed a case, change the text.
To work on it, clone the repository and run the tests. Neither command needs the network or an installed actual CLI:
bash hooks/tests/run.sh
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude plugin test .
Before you open a pull request, read CONTRIBUTING.md. A change to what the plugin ships raises the version in both manifests and adds a line to CHANGELOG.md; a change to tests or docs needs neither. AGENTS.md has the same pointers for a coding agent working in the repository.
For changes to the checks themselves, see the actual CLI.
License
探索相关项目
加载中…