ontology-requirements
Skill78 starsChanged 9 days agoApache-2.0View on GitHub
Manages ontology requirements specification. Elicits, refines, and formalizes competency questions (CQs). Generates ORSD documents and CQ test suites. Use when starting a new ontology, defining scope, or creating acceptance tests.
In this repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- explorations/AGENTS.mdAGENTS.md
- adhdSkill
- atom-reactivity-specialistSkill
- browser-qa-loopSkill
- closeoutSkill
- codex-findingsSkill
- crispenSkill
- effect-first-developmentSkill
- exploreSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- jsdoc-annotation-specialistSkill
- motion-evidence-reviewSkill
- onepassword-secret-refsSkill
- ontology-architectSkill
- ontology-conceptualizerSkill
- ontology-curatorSkill
- ontology-foundational-auditorSkill
- ontology-mapperSkill
- ontology-scoutSkill
- ontology-validatorSkill
- operator-handoffSkill
- orchestrateSkill
- plasma-sensitive-entrySkill
- portlessSkill
- qa-session-opsSkill
- quality-review-fix-loopSkill
- reflectSkill
- remote-development-agentsSkill
- schema-first-developmentSkill
- shadcnSkill
- sparql-expertSkill
- teachSkill
- turborepoSkill
- unslopSkill
- yeetSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Read these files from _shared/ before beginning work:
- Distinctive: line 51
Before drafting CQs, capture structured use cases that connect stakeholder needs to ontology behavior.
- Distinctive: line 54
Use this template for each use case:
- Distinctive: line 74
Keep use cases as living artifacts.
- Distinctive: line 99
Remove duplicates and subsumptions
- Very specific: line 102
Add at least one concrete sample_answer
- Distinctive: line 181
Every stakeholder need must map to at least one use case and CQ.
- Distinctive: line 182
Every CQ must map to at least one CANDIDATE term (pre-glossary entry) and test query.
- Distinctive: line 187
Update this matrix whenever CQs are added, merged, or deprecated.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ontology Requirements Engineer
Role Statement
You are responsible for the specification phase of ontology development. You elicit competency questions from stakeholders, define scope, produce the Ontology Requirements Specification Document (ORSD), and generate SPARQL-based test suites that serve as acceptance criteria throughout the lifecycle. You do NOT design the taxonomy or formalize axioms — that is the work of downstream skills.
When to Activate
- User wants to start a new ontology project
- User wants to define scope or requirements for an ontology
- User mentions "competency questions", "CQs", or "requirements"
- User wants to create tests or acceptance criteria for an ontology
- Pipeline A is initiated (this skill runs first)
Shared Reference Materials
Read these files from _shared/ before beginning work:
_shared/methodology-backbone.md— lifecycle phase context (Phase 1: Specification)_shared/naming-conventions.md— term standards for the pre-glossary_shared/namespaces.json— standard prefixes for SPARQL test queries
Core Workflow
Step 1: Domain Scoping
Gather from the user:
- Domain description and intended use cases
- Key stakeholders and their information needs
- What is IN scope and what is OUT of scope
- Known constraints (OWL profile, size, existing systems)
Produce ontologies/{name}/docs/scope.md documenting scope decisions.
Step 1.5: Use Case Development
Before drafting CQs, capture structured use cases that connect stakeholder needs to ontology behavior.
Use this template for each use case:
- id: UC-001
name: "Find all instruments available for student checkout"
actor: "Music school librarian"
goal: "Identify currently available instruments by type and condition"
preconditions:
- "Instrument inventory is represented in the ontology/graph"
main_flow:
- "Actor filters by instrument family"
- "System returns available instruments with condition labels"
postconditions:
- "Actor has a candidate list for checkout assignment"
related_cqs: []
priority: must_haveGuidance:
- Each use case should generate 3-10 CQs.
- Keep use cases as living artifacts; refine them after stakeholder review.
- Store use cases in
ontologies/{name}/docs/use-cases.yaml.
Example derived CQs from UC-001:
- "Which instruments are currently available for checkout?"
- "What condition rating does each available instrument have?"
- "Which available instruments belong to the string family?"
Step 2: CQ Elicitation
For each stakeholder perspective and use case, generate candidate CQs across these types:
| CQ Type | Pattern | Example |
| Enumerative | "What are all the X?" | "What instruments are in the orchestra?" |
| Boolean | "Is X a Y?" | "Is a piano a string instrument?" |
| Relational | "What Y relates to X via R?" | "What pieces are composed for violin?" |
| Quantitative | "How many X have property P?" | "How many strings does a guitar have?" |
| Constraint | "Can X and Y co-occur?" | "Can an instrument be both wind and string?" |
| Temporal | "When does X occur relative to Y?" | "When was the instrument first manufactured?" |
Step 3: CQ Refinement
- Decompose compound questions into atomic CQs
- Remove duplicates and subsumptions
- Classify each CQ by type (from Step 2)
- Assign unique IDs:
CQ-{NNN} - Add at least one concrete
sample_answer - Record
derivation_method:direct_lookup|inference|aggregation|external_join - Record explicit
out_of_scopeboundaries
Step 4: Prioritization (MoSCoW)
Classify each CQ:
- Must Have: core CQs without which the ontology is useless
- Should Have: significantly enhance utility
- Could Have: nice-to-have for future iterations
- Won't Have: explicitly out of scope (record why)
Step 5: Formalization
For each Must/Should CQ, produce a structured entry:
- id: CQ-001
source_use_case: UC-001
natural_language: "What instruments exist in the ontology?"
type: enumerative
priority: must_have
sample_answer:
- instrument: ex:Violin_001
label: "student violin 001"
derivation_method: direct_lookup
out_of_scope:
- "Instrument pricing and procurement details"
sparql: |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://example.org/ontology/>
SELECT ?instrument ?label WHERE {
?instrument rdf:type :Instrument ;
rdfs:label ?label .
}
expected_result: non_empty
required_classes:
- Instrument
required_properties: []
required_axioms: []Step 6: Pre-Glossary Extraction
From all CQs, extract candidate terms:
- Candidate classes: nouns and noun phrases
- Candidate properties: verbs and relationship phrases
- Candidate individuals: proper nouns, specific instances
Output as ontologies/{name}/docs/pre-glossary.csv with columns:
term, category (class|property|individual), source_cq, notes
Step 7: Test Suite Generation
For each formalized CQ:
- Generate a
.sparqlfile inontologies/{name}/tests/ - Enumerative CQs: SELECT query expecting non-empty results
- Constraint CQs: SELECT query expecting zero rows (zero violations)
- Generate
ontologies/{name}/tests/cq-test-manifest.yamllinking CQs to test files
Step 8: Traceability Matrix
Maintain explicit requirement traceability in ontologies/{name}/docs/traceability-matrix.csv.
Required mapping chain:
Stakeholder Need -> Use Case -> CQ ID -> Ontology Term(s) -> SPARQL TestCSV template:
stakeholder_need,use_case_id,cq_id,ontology_terms,sparql_test
"Track instrument availability",UC-001,CQ-001,"Instrument;hasAvailabilityStatus",ontologies/{name}/tests/cq-001.sparqlRules:
- Every stakeholder need must map to at least one use case and CQ.
- Every CQ must map to at least one CANDIDATE term (pre-glossary entry) and
test query. The
ontology_termscolumn names candidates, not ontology — whether a candidate becomes a term is decided downstream by the foundational auditor's analysis + steward ratification, and a CQ whose candidates all die there keeps its trace to the proposals that replaced them. - Update this matrix whenever CQs are added, merged, or deprecated.
Tool Commands
Writing SPARQL test files
# Write individual test queries
cat > ontologies/{name}/tests/cq-001.sparql << 'EOF'
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://example.org/ontology/>
# CQ-001: What instruments exist in the ontology?
# Expected: non-empty result set
SELECT ?instrument ?label WHERE {
?instrument rdf:type :Instrument ;
rdfs:label ?label .
}
EOFValidating SPARQL syntax
uv run python -c "
from rdflib.plugins.sparql import prepareQuery
prepareQuery(open('ontologies/{name}/tests/cq-001.sparql').read())
print('Valid')
"Outputs
This skill produces:
| Artifact | Location | Format | Description |
| Scope document | ontologies/{name}/docs/scope.md | Markdown | In/out scope, constraints, stakeholders |
| Use case catalog | ontologies/{name}/docs/use-cases.yaml | YAML | Structured use cases driving CQ derivation |
| ORSD | ontologies/{name}/docs/orsd.md | Markdown | Full requirements specification |
| CQ list | ontologies/{name}/docs/competency-questions.yaml | YAML | Structured CQ definitions with SPARQL |
| Pre-glossary | ontologies/{name}/docs/pre-glossary.csv | CSV | Candidate terms extracted from CQs |
| Test queries | ontologies/{name}/tests/cq-*.sparql | SPARQL | One file per CQ |
| Test manifest | ontologies/{name}/tests/cq-test-manifest.yaml | YAML | Maps CQ IDs to test files and expectations |
| Traceability matrix | ontologies/{name}/docs/traceability-matrix.csv | CSV | End-to-end trace: need -> use case -> CQ -> term -> test |
Handoff
Receives from: User input (domain description, use cases, stakeholder needs)
Passes to:
ontology-scout—ontologies/{name}/docs/pre-glossary.csv,ontologies/{name}/docs/scope.mdontology-foundational-auditor—ontologies/{name}/docs/competency-questions.yaml,ontologies/{name}/docs/pre-glossary.csv,ontologies/{name}/docs/traceability-matrix.csv(the pre-glossary is a CANDIDATE harvest with no ontological authority — thecategorycolumn is a lexical guess; only the auditor's analysis + human ratification may turn a candidate into a term the conceptualizer sees)
Handoff checklist:
- All Must-Have CQs have formalized SPARQL queries
- Pre-glossary covers all terms mentioned in CQs
- Scope document clearly separates in-scope from out-of-scope
- Test manifest references all generated
.sparqlfiles - Every stakeholder need traces to at least one use case and CQ
- Every CQ traces to at least one SPARQL test in the matrix
Anti-Patterns to Avoid
- Vague CQs: "What is the meaning of X?" — CQs must be answerable by a SPARQL query against the ontology. A good CQ is specific enough to fail: "Which string instruments require a bow?" can return zero results; "What instruments exist?" cannot.
- Implementation-coupled CQs: "How is X stored in the database?" — CQs describe information needs, not implementation details
- Over-specification: Designing the taxonomy during requirements — leave that to the conceptualizer
- CQs beyond OWL expressivity: "What is the probability that X is Y?" — OWL cannot represent probabilities natively
- Retroactive CQs: Writing CQs after the ontology to justify existing structure. CQs must be written BEFORE conceptualization begins — they drive the design, not document it. If CQs arrive after modeling starts, flag this explicitly and re-evaluate the model.
- Stale CQ tests: CQ SPARQL tests must be updated whenever the ontology evolves. Untouched tests become meaningless. Link CQ maintenance to the curator skill's change workflow.
- Prioritization bias: Involve multiple stakeholders independently before consolidating priorities. The most vocal stakeholder's CQs should not automatically become Must-Have.
Error Handling
| Error | Likely Cause | Recovery |
| CQ cannot be expressed in SPARQL | CQ is too vague or beyond OWL expressivity | Decompose into simpler CQs or mark as Won't Have |
| Duplicate CQs detected | Stakeholder overlap | Merge and reference all source stakeholders |
| Pre-glossary has conflicting terms | Polysemy in domain language | Record both candidates with distinct notes; the foundational auditor disambiguates during denotation analysis (the conceptualizer never sees raw pre-glossary terms) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

