Skip to content

feat: add pharaoh:spec and pharaoh:decide skills#2

Merged
patdhlk merged 7 commits intomainfrom
feat/spec-decide
Apr 10, 2026
Merged

feat: add pharaoh:spec and pharaoh:decide skills#2
patdhlk merged 7 commits intomainfrom
feat/spec-decide

Conversation

@patdhlk
Copy link
Copy Markdown
Collaborator

@patdhlk patdhlk commented Apr 7, 2026

Summary

  • decision need type — new sphinx-needs type with decided_by, alternatives, rationale fields and :decides: link type, using modern [needs.fields.*] TOML syntax
  • pharaoh:decide skill — records design decisions as traceable needs, delegates RST writing to pharaoh:author, no workflow gates
  • pharaoh:spec skill — reads requirements hierarchy, identifies coverage gaps, invokes pharaoh:decide for design choices, generates Superpowers-compatible spec doc with embedded plan table for pharaoh:plan execution
  • Copilot agent mirrors@pharaoh.spec and @pharaoh.decide in .github/agents/
  • Updated docs/config — README, copilot-instructions, pharaoh.toml.example, plugin.json

This eliminates the disconnect between sphinx-needs requirements and Claude Code + Superpowers spec/plan docs by generating specs deterministically from needs data, with decisions tracked as first-class sphinx-needs objects versioned in git.

Test plan

  • Verify ubproject.toml parses correctly (python3 -c "import tomllib; ...")
  • Invoke pharaoh:spec REQ_001 against the test fixture and confirm spec doc is generated with correct sections
  • Invoke pharaoh:decide standalone and confirm decision need is written with all fields
  • Verify Copilot agents load correctly in VS Code with @pharaoh.spec and @pharaoh.decide
  • Confirm plan table format matches pharaoh:plan (7 columns including File)

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the pharaoh:decide and pharaoh:spec skills to the framework, enabling the recording of traceable design decisions and the generation of specification documents with implementation plans. The update includes new agent definitions, skill documentation, and expanded configuration options in pharaoh.toml. Review feedback highlights opportunities to better align the skill logic with new configuration keys for file placement and status defaults, alongside suggestions to use the artifact style for decision needs to improve visual clarity in traceability graphs.

title = "Decision"
prefix = "DEC_"
color = "#E8D0A9"
style = "node"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The suggested style for the decision type is node, but the test fixture in tests/fixtures/basic-project/ubproject.toml uses artifact. Using artifact is generally preferred for decisions to distinguish them from requirements in visual representations.

Suggested change
style = "node"
style = "artifact"

Comment on lines +113 to +114
- **Standalone invocation**: Default status to `proposed`.
- **Called by `pharaoh:spec`**: Default status to `accepted`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These default status values should be explicitly linked to the configuration keys default_status and spec_status from the [pharaoh.decisions] section in pharaoh.toml. This ensures the AI respects user-defined defaults when they are provided.


### Step 5: File Placement

Place the decision in `decisions.rst` in the same directory as the affected requirements.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The file placement logic should prioritize the default_file setting from pharaoh.toml if it is configured. The current description only mentions the directory-based fallback logic, which is inconsistent with the configuration options provided in pharaoh.toml.example.

title = "Decision"
prefix = "DEC_"
color = "#E8D0A9"
style = "node"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the test fixtures and better visual distinction in the needs graph, consider using style = "artifact" for the decision type instead of node.

Suggested change
style = "node"
style = "artifact"


### Step 5: File Placement

Place in `decisions.rst` in the same directory as the first need in `:decides:`. Create the file with proper RST title if it does not exist. If no `:decides:` links, fall back to @pharaoh.author file placement. Delegate actual writing to @pharaoh.author.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This step should also check for the [pharaoh.decisions].default_file setting in pharaoh.toml. If configured, the decision should be placed in that file instead of defaulting to a directory-relative decisions.rst.

- **decided_by**: `claude` (since the AI is generating the spec).
- **alternatives**: At least two alternatives considered, semicolon-separated.
- **rationale**: Why this option was chosen.
- **status**: `accepted` (decisions made during spec generation are accepted by default).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The default status for decisions created during spec generation should be retrieved from the spec_status configuration key in pharaoh.toml if available, rather than being hardcoded to accepted.

@patdhlk patdhlk merged commit 0835184 into main Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant