spec-to-graph
Turn a PRD, SRS, user story or feature specification into a requirement graph proposal with acceptance criteria and evidence. Use for spec-to-graph. Not for claiming implementation or generating application code.
- License 许可
- MIT
- 所属仓库
- philngt/contextd
- 最近更新
- 2026-11-04
- Stars
- ★ 28
- Forks
- 6
01 前言 Front Matter
- name
- spec-to-graph
- metadata
- { "version": "0.1.0", "contract": "contextd_graph_proposal.v1" }
- description
- Turn a PRD, SRS, user story or feature specification into a requirement graph proposal with acceptance criteria and evidence. Use for spec-to-graph. Not for claiming implementation or generating application code.
- compatibility
- An agent with authorized source tools; optional validator requires Python 3.10+ and jsonschema 4.x.
03 SKILL.md 正文
spec-to-graph
Read the common contract before authoring. Use the profile, proposal schema and baseline schema. Paths are relative to this skill. These resources are assembled by the repository exporter; do not install the bare template.
Extract intended product behavior without filling missing requirements with best practices.
- Resolve/bind workspace and product; read the owner baseline and shared profile.
- Read full relevant sections, including tables, definitions and exceptions. Maintain reviewed/not-reviewed scope. Use host document tools for attachments; inspect embedded figures when necessary. Never claim a universal parser or silently skip unreadable pages.
- Identify Problem, Feature, Spec, Actor, Action, Workflow, DomainType and BusinessRule only when supported. Extract AcceptanceCriterion without inventing thresholds. One file can produce many objects; multiple files can describe one Spec.
- Preserve source requirement IDs in scoped statements/source locators. Preserve polarity, must/should/may, preconditions and exceptions. Missing acceptance conditions are gaps.
- Reuse explicit/reviewed owner IDs. Keep target claims as to-be even when a requirement is approved. A document's historical description can be as-is/reference; source kind alone does not determine the model.
- Compare with existing implementation claims. Distinguish target gaps, version/scope differences and genuine incompatible assertions. Do not silently change either source.
- Stage a pending proposal, validate, report exact additions and unresolved decisions.
No source spec: return a clearly labeled scaffold or note; do not fabricate requirements.
Output and verification
Return one pending proposal with source ledger, typed additions, scoped claims, evidence,
identity-match candidates and issues. All model writes remain unapproved. Prefer an authorized
project-local .contextd/graph-authoring/ staging directory, never canonical workspace Markdown.
A missing owner baseline means non-submittable draft notes, not invented baseline fields.
The following are validator arguments, not instructions to perform extraction. Set SKILL_DIR to the actual installed skill directory and replace the example paths and IDs with resolved values. Check the optional dependency before running; do not install it without permission.
python3 "$SKILL_DIR/scripts/validate.py" \
--proposal /absolute/staging/proposal.json \
--baseline /absolute/staging/baseline.json \
--workspace resolved-workspace --project canonical-product-id
Exit 0 means structurally valid with possible warnings; 1 means validation failure (or warnings with --strict); 2 means usage/dependency/I/O/JSON/profile failure. Report semantic review and source/live-baseline verification as NOT performed by the validator. This skill has no apply permission and provides no complete execution context.
04 同仓库更多 Skills
project-to-graph
Turn an existing code project into an evidence-backed graph proposal. Use for project-to-graph, workflow/domain recovery or source-to-model mapping. Not for implementation, refactoring or spec-only extraction.
docs-to-graph
Turn scoped documents into source-backed product concepts, decisions, notes and relationships. Use for docs-to-graph or evidence reconciliation. Not a table-of-contents diagram or automatic promotion of source claims to truth.
bad-skill
A helpful skill