Help us improve
Share bugs, ideas, or general feedback.
From pharaoh
Records design decisions as traceable sphinx-needs 'decision' directives with alternatives, rationale, and links to requirements. Use for documenting choices with full traceability in Sphinx projects.
npx claudepluginhub useblocks/pharaoh --plugin pharaohHow this skill is triggered — by the user, by Claude, or both
Slash command
/pharaoh:pharaoh-decideThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill's visible output MUST contain, in order:
Guides creation of decision records with full context, alternatives, rationale, and revisit conditions. Auto-links related PRDs, strategy docs, OKRs. Useful for product decision documentation.
Creates structured narrative decision records for design system choices like components, tokens, tooling, and governance, capturing context, options, trade-offs, and rationale.
Records finalized decisions as ADRs and open proposals as RFCs. Routes to standards or architecture specs when requested.
Share bugs, ideas, or general feedback.
This skill's visible output MUST contain, in order:
Decision <DEC_ID> written to <file_path>The confirmation is mandatory. The suggestion is optional and is suppressed when the skill is called by pharaoh:spec (per existing Step 7 logic). Returning only the suggestion without the confirmation line is a REGRESSION.
Session-state update is internal bookkeeping and runs before the visible output.
Record design decisions as traceable sphinx-needs decision directives. Each decision captures the chosen option, rejected alternatives, rationale, and explicit links to the requirements or specifications it affects. This skill ensures every decision has proper decided_by, alternatives, and rationale fields.
pharaoh:spec identifies a gap and calls this skill programmatically to record the resolution.decision type configured.Execute the following steps in order.
Follow the full detection and data access algorithm defined in skills/shared/data-access.md.
pharaoh.toml for strictness level and workflow settings.Present the detection summary before proceeding:
Project: <name> (<config source>)
Types: <list of directive names>
Links: <list of link type names>
Data source: <tier used>
Needs found: <count>
Strictness: <advisory|enforcing>
decision type existsAfter reading the project configuration, confirm that a type with directive name decision is present in the types list.
If decision is not configured, show the user the exact TOML to add:
[[needs.types]]
directive = "decision"
title = "Decision"
prefix = "DEC_"
color = "#E8D0A9"
style = "node"
Also verify that these extra options are configured:
[needs.fields.decided_by]
description = "Who made the decision"
[needs.fields.alternatives]
description = "Rejected alternatives, semicolon-separated"
[needs.fields.rationale]
description = "Why this option was chosen"
And verify the decides link type exists:
[needs.extra_links.decides]
incoming = "is decided by"
outgoing = "decides for"
Ask the user to confirm before proceeding if any of these are missing.
Determine what to record. The following pieces of information are required:
:decides: link (e.g., REQ_001, SPEC_001).claude when the AI is generating the decision autonomously. Ask the user otherwise.SPI at 1MHz; Direct analog input).proposed, accepted, superseded, rejected.Prompt the user for each missing piece. Do not proceed until all five fields (title, affected needs, decided_by, alternatives, rationale) are populated. If the user omits any field, ask for it explicitly.
pharaoh:specAccept all context programmatically. Do not prompt. All required fields must be provided by the calling skill.
proposed.pharaoh:spec: Default status to accepted.The user may override the default in either case.
pharaoh.toml for [pharaoh.id_scheme]. If a pattern exists, apply it with {TYPE} resolving to DEC.decision needs in the index. Look for DEC_* IDs and determine the numbering scheme.DEC_) and start at 001, padded to match id_length.Write the directive directly to the target file with all fields populated:
.. decision:: <title>
:id: <generated_id>
:status: <proposed|accepted>
:decides: <need_id1>, <need_id2>
:decided_by: <name or claude>
:alternatives: <alt1>; <alt2>
:rationale: <why this option>
<expanded description>
The expanded description should summarize the decision in one to three sentences, covering what was chosen and why the alternatives were rejected.
When a new decision replaces an old one:
:status: field value to superseded.:links: <old_dec_id> to establish the supersession chain.Place the decision in decisions.rst in the same directory as the affected requirements.
:decides:. Use the needs index to find its file path.decisions.rst exists in that directory. If it does, append the new decision after the last existing decision directive in the file.decisions.rst does not exist, create it with a proper RST title:Decisions
=========
.. decision:: <title>
:id: <id>
...
:decides: links are specified (rare case), place the decision in decisions.rst at the sphinx-needs source root.This step is internal bookkeeping. It MUST run before any visible output is emitted in Step 7. Do not print anything in this step.
After successfully writing the decision:
.pharaoh/session.json (or initialize if it does not exist)..pharaoh/ directory if it does not exist.changes.<dec_id>.authored = true:{
"<dec_id>": {
"change_analysis": null,
"acknowledged": false,
"authored": true,
"verified": false
}
}
updated to the current ISO 8601 timestamp..pharaoh/session.json.Emit the visible turn output. The FIRST line MUST be the written-confirmation. The follow-up suggestion is appended after a blank line:
Decision <DEC_ID> written to <file_path>
Next step: Run pharaoh:req-review to validate the decision against its linked requirements.
Substitute <DEC_ID> with the generated ID from Step 3 and <file_path> with the absolute or repo-relative path to the file written in Step 4 / Step 5. The confirmation line MUST appear even if the follow-up suggestion is suppressed for any reason.
pharaoh:specReturn the decision ID silently. Do not print follow-up suggestions. Do not print the written-confirmation line. The calling skill manages the workflow.
Follow the instructions in skills/shared/strictness.md.
Execute freely. No gates. Decisions have no prerequisites and do not gate other skills. Do not show tips -- decisions can be recorded at any time without prior analysis.
Execute freely. No gates. Decisions can be recorded at any time regardless of strictness level. This skill is gate-free in both modes.
Strictness has no effect on decision recording. Both modes follow the same process.
decided_by, alternatives, and rationale. If the user omits any of them, ask explicitly. Do not write a decision with missing fields.decided_by to claude when the AI is making the decision autonomously (e.g., during pharaoh:spec execution).status to proposed when standalone, accepted when called by pharaoh:spec.superseded AND add :links: on the new decision referencing the old one.:decides: targets exist. Every need ID in the :decides: field must exist in the needs index. If a target does not exist, warn the user and ask whether to proceed.User request: "Record a decision that we chose PostgreSQL over MongoDB for the data store"
Step 1 -- Data access detects:
Project: Backend Service (ubproject.toml)
Types: req, spec, impl, test, decision
Links: links, implements, tests, decides
Data source: Tier 3 (raw file parsing)
Needs found: 12
Strictness: advisory
Step 2 -- Gather context. The user provided the title and one alternative. Prompt for missing fields:
Recording decision: "Use PostgreSQL for the data store"
Which requirements or specs does this decision affect?
> REQ_003, SPEC_005
Who is making this decision?
> engineering-lead
Any other rejected alternatives besides MongoDB?
> Redis as primary store
Why was PostgreSQL chosen over the alternatives?
> PostgreSQL provides ACID transactions and mature JSON support,
which MongoDB and Redis cannot guarantee for our consistency requirements.
Step 3 -- Generate ID. Existing decisions: DEC_001, DEC_002. Next ID: DEC_003.
Step 4 -- Directive written directly to file:
.. decision:: Use PostgreSQL for the data store
:id: DEC_003
:status: proposed
:decides: REQ_003, SPEC_005
:decided_by: engineering-lead
:alternatives: MongoDB; Redis as primary store
:rationale: PostgreSQL provides ACID transactions and mature JSON support required for data consistency
Selected PostgreSQL over MongoDB and Redis. MongoDB lacks full ACID transaction
support across collections. Redis does not provide durable storage guarantees
suitable for a primary data store. PostgreSQL meets the consistency requirements
defined in REQ_003.
Step 5 -- Written to docs/decisions.rst (same directory as REQ_003).
Step 6 -- Session state updated: DEC_003.authored = true.
Step 7 -- Visible output:
Decision DEC_003 written to docs/decisions.rst
Next step: Run pharaoh:req-review to validate the decision against its linked requirements.
pharaoh:spec identifies that no specification covers the communication protocol for subsystem X. It calls pharaoh:decide with all context provided:
REQ_001, SPEC_001claudeSPI at 1MHz; Direct analog inputacceptedpharaoh:decide executes without prompting:
decision type exists in configuration.DEC_004.docs/decisions.rst:.. decision:: Use CAN bus for brake pedal sensor communication
:id: DEC_004
:status: accepted
:decides: REQ_001, SPEC_001
:decided_by: claude
:alternatives: SPI at 1MHz; Direct analog input
:rationale: CAN bus provides noise immunity required for safety-critical braking
Selected CAN bus over SPI and direct analog based on EMC requirements.
SPI at 1MHz lacks sufficient noise immunity for the safety-critical braking
subsystem. Direct analog input introduces unacceptable signal degradation
over the required cable lengths.
DEC_004.authored = true.DEC_004 to pharaoh:spec. No follow-up message printed.