소스 정보
- 저장소
- canonical/pragma
- 최근 소스 활동
- 2026년 8월 29일 02:27
- 감지된 SKILL.md 언어
- 영어
- 스타
- 14
- 포크
- 13
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/canonical/pragma --skill add-standard명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | add-standard |
| description | Create and add a new code standard to the code-standards package |
Create and add a new code standard to the code-standards package.
Use this skill when:
Before creating a new standard, always check if one already exists:
PREFIX cs: <http://pragma.canonical.com/codestandards#>
SELECT ?standard ?description WHERE {
?standard a cs:CodeStandard ;
cs:description ?description .
FILTER(CONTAINS(LCASE(STR(?standard)), "your-topic"))
}
Or use lookup:
sem_lookup(type: "cs:CodeStandard", filters: {"@id": {"$contains": "your-topic"}})
List existing categories to find the right fit:
PREFIX cs: <http://pragma.canonical.com/codestandards#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?category ?label ?slug WHERE {
?category a cs:Category ;
rdfs:label ?label ;
cs:slug ?slug .
}
Available Categories:
| Category | Slug | Description |
|---|---|---|
| React | react | React component development |
| CSS | css | CSS technical implementation |
| Styling | styling | Design system styling patterns |
| Code | code | General TypeScript standards |
| Storybook | storybook | Storybook documentation |
| Icons | icons | Icon implementation |
| Packaging | packaging | Package structure and exports |
| Rust | rust | Idiomatic Rust development |
| Git | git | Git workflow conventions |
| TSDoc | tsdoc | Documentation conventions |
| Turtle | turtle | RDF/Turtle authoring |
| UI Blocks | ui-blocks | Framework-agnostic capabilities and patterns for UI blocks |
If no existing category fits, create a new one (see Section 5).
Standard identifiers follow a hierarchical compact IRI pattern: cs:{category}.{domain}.{topic}
Pattern: ^cs:[a-z]+(\.[a-z0-9_]+){2,}$
Examples:
cs:react.component.structure.foldercs:css.selectors.namespacecs:styling.tokens.creationcs:react.hooks.namingGuidelines:
cs:cs:name only for an optional human-readable display titleCreate a new standard instance in the appropriate data file under data/.
Template:
cs:category.domain.topic a cs:CodeStandard ;
cs:name "Human Readable Title" ;
cs:hasCategory cs:category ;
cs:description "Clear, concise description of what this standard covers and why it matters." ;
cs:do [
cs:description "First recommended practice." ;
cs:language "typescript" ;
cs:code """
// Example showing the correct approach
const good = true;
"""
] ;
cs:do [
cs:description "Second recommended practice." ;
cs:language "typescript" ;
cs:code """
// Another correct example
const alsoGood = true;
"""
] ;
cs:dont [
cs:description "First anti-pattern to avoid." ;
cs:language "typescript" ;
cs:code """
// Example showing what NOT to do
const bad = true;
"""
] ;
cs:dont [
cs:description "Second anti-pattern." ;
cs:language "typescript" ;
cs:code """
// Another bad example
const alsoBad = true;
"""
] .
Each cs:do and cs:dont is a blank node (cs:Example) with structured fields:
cs:description — What the example demonstrates (required)cs:language — Language of the code block, e.g. "typescript", "rust", "css", "bash", "svg" (optional, omit when no code)cs:code — The code content (optional, omit for description-only examples)Required Properties:
cs:hasCategory - Reference to a Category instancecs:description - What and why (plain text or markdown)cs:do - One or more positive examples (blank nodes)cs:dont - One or more negative examples (blank nodes)Optional Properties:
cs:name - Human-readable display titlecs:extends - Reference to a parent standard this builds uponIf your standard doesn't fit existing categories:
cs:new_category a cs:Category ;
rdfs:label "Category Name"@en ;
rdfs:comment "Description of what this category covers"@en ;
cs:slug "slug-name" .
When your standard builds on another:
cs:react.component.props.special_case a cs:CodeStandard ;
cs:name "React Props Special Case" ;
cs:extends cs:react.component.props ;
cs:hasCategory cs:react ;
cs:description "Specific guidance that builds on the general props standard." ;
cs:do [
cs:description "Example of the specific pattern." ;
cs:language "typescript" ;
cs:code """
// ...
"""
] ;
cs:dont [
cs:description "Anti-pattern to avoid." ;
cs:language "typescript" ;
cs:code """
// ...
"""
] .
Query to find potential parent standards:
PREFIX cs: <http://pragma.canonical.com/codestandards#>
SELECT ?standard WHERE {
?standard a cs:CodeStandard .
FILTER(STRSTARTS(STR(?standard), STR(cs:react.component.props)))
}
After writing the standard, validate the Turtle syntax:
sem check code-standards
Then verify the standard loads correctly:
sem_lookup(type: "cs:CodeStandard", filters: {"@id": "cs:category.domain.topic"})
The @id must always use the canonical compact IRI. Do not look up standards by cs:name.
Standards are organized by category in data/:
code-standards/
├── definitions/
│ └── CodeStandard.ttl # Ontology schema
├── data/
│ ├── react.ttl # React standards
│ ├── css.ttl # CSS standards
│ ├── styling.ttl # Styling standards
│ ├── code.ttl # General code standards
│ ├── storybook.ttl # Storybook standards
│ └── icons.ttl # Icon standards
└── skills/
└── standards-guide/
└── SKILL.md
Add new standards to the file matching their category.
cs:do blank node is one discrete positive examplecs:description explains what the example demonstratescs:language must match the code block language (e.g. "typescript", "css", "rust")cs:code contains the actual code — no markdown fences neededcs:dont blank node is one discrete negative examplecs:description should explain WHY it's problematicfoo/barAdding a new standard for React error boundaries:
# In data/react.ttl
cs:react.component.error_boundaries a cs:CodeStandard ;
cs:name "React Error Boundaries" ;
cs:hasCategory cs:react ;
cs:description "Error boundaries must be used to catch JavaScript errors in component trees and display fallback UI. They should be placed strategically to isolate failures without breaking the entire application." ;
cs:do [
cs:description "Wrap feature sections with error boundaries to isolate failures." ;
cs:language "tsx" ;
cs:code """
const Dashboard = () => (
<div className="ds dashboard">
<ErrorBoundary fallback={<WidgetError />}>
<AnalyticsWidget />
</ErrorBoundary>
<ErrorBoundary fallback={<WidgetError />}>
<ActivityWidget />
</ErrorBoundary>
</div>
);
"""
] ;
cs:do [
cs:description "Provide meaningful fallback UI that helps users understand and recover." ;
cs:language "tsx" ;
cs:code """
const WidgetError = () => (
<div className="ds widget-error">
<p>This section couldn't load.</p>
<button onClick={() => window.location.reload()}>
Refresh page
</button>
</div>
);
"""
] ;
cs:dont [
cs:description "Wrap the entire application in a single error boundary." ;
cs:language "tsx" ;
cs:code """
// Bad: One error anywhere crashes everything
const App = () => (
<ErrorBoundary>
<Header />
<Main />
<Footer />
</ErrorBoundary>
);
"""
] ;
cs:dont [
cs:description "Use generic or unhelpful fallback messages." ;
cs:language "tsx" ;
cs:code """
// Bad: Doesn't help the user
const fallback = <div>Something went wrong</div>;
"""
] .
cs:extends when your standard builds on another