Skip to content

feat(artifacts): generic engine + 8 extended categories (manifest 0.2)#29

Merged
nicolasguelfi merged 2 commits into
mainfrom
feat/pack-artifacts-v0.2
May 26, 2026
Merged

feat(artifacts): generic engine + 8 extended categories (manifest 0.2)#29
nicolasguelfi merged 2 commits into
mainfrom
feat/pack-artifacts-v0.2

Conversation

@nicolasguelfi

Copy link
Copy Markdown
Owner

Summary

Introduces a generic artifact engine in streamtex.core.artifacts that
unlocks 8 new categories of pack artifacts under an additive [pack.data]
section in _pack_manifest.toml (format 0.2):

  • palette — JSON canonical, Python view at import (composable Style atoms)
  • ai_prompt — prefix + per-orientation suffixes for AI image generation
  • archetype — markdown + YAML frontmatter, reusable visual scene patterns
  • guideline — markdown + YAML frontmatter, opposable R-rules
  • skill — pack-scoped Claude Code skill (lifecycle: install to .claude/custom/)
  • agent — pack-scoped Claude Code agent
  • asset_manifest.toml + binary files with license tracking
  • integration — open-contract recipe per third-party framework

Each category ships:

  • A TypedDict / dataclass for its content view
  • A validator with dedicated error codes (PAV/APV/ARV/GLV/SKV/AGV/ASV/INV)
  • A typed loader (lazy import to keep engine startup cheap)

CLI: new stx artifact list|show|validate|install [--kind <k>] [--pack <p>],
backward compatible with existing stx pack/component/ds/kit surface.

Test plan

  • 2192 existing tests pass (no regression)
  • Ruff clean across the new modules + CLI
  • End-to-end: stx artifact list enumerates 17 artifacts in streamtex-pack-gse v2.0.0 (palette + ai_prompt + 11 archetypes + 2 guidelines + 1 skill + 1 integration)
  • stx artifact validate returns OK on all 17 with this branch

Backward compatibility

  • Format 0.1 packs (pack-design v0.3.0, pack-manuals v0.2.0) unaffected.
  • No [pack.data] section in a 0.2 pack = behaves exactly like a 0.1 pack.

Sister PRs

  • streamtex-packs — pack-gse v2.0 migration consuming the new engine
  • streamtex-claude — reuse-architecture skill documenting the 8 categories

RFC

Local document documentation/maintenance/design-packs/RFC-extended-artifacts.md
records 10 design decisions (EAR-1 … EAR-10). Not in repo (gitignored
maintenance dir).

🤖 Generated with Claude Code

nicolasguelfi and others added 2 commits May 26, 2026 00:00
Introduces a generic artifact engine for the extended pack mechanism.
Manifest format 0.2 (additive) unlocks a new optional [pack.data]
section listing artifact slugs per category. Format 0.1 packs continue
to work unchanged.

Core additions:
- streamtex/core/artifacts/{spec,discovery,validation,loaders}.py —
  ArtifactKind enum, DiscoveredArtifact dataclass, generic
  discover_artifacts / resolve_artifact / validate_artifact /
  load_artifact functions.
- streamtex/core/artifacts/palette.py — Palette dataclass + Color
  atoms with as_style(), validators PAV001-PAV010, JSON-canonical
  schema.
- streamtex/core/artifacts/ai_prompt.py — AIPrompt dataclass with
  compose(orientation, scene), validators APV001-APV006, convention
  ai_prompts/<name>/{prefix,suffix-*}.txt.
- contracts.PackManifest gains optional PackDataSection (TypedDict).
- core/__init__.py re-exports the artifacts subpackage.

CLI:
- New `stx artifact list|show|validate [--kind <k>] [--pack <p>]`
  with per-kind rendering (palette swatches table, ai_prompt
  prefix+suffixes). Backward compatible with the existing pack /
  component / ds / kit CLIs.

Backward compatibility:
- Existing 0.1 packs work unchanged — no [pack.data] section means
  no data-first artifacts to enumerate.
- 2192 existing tests pass without modification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nt, asset, integration

Extends the manifest-0.2 generic engine with all remaining categories
declared in the RFC. Each follows the same pattern: per-kind module
under streamtex/core/artifacts/, plugged into the validation and loader
dispatch tables, with kind-specific Python view types.

New per-kind modules:
- archetype.py — markdown + YAML frontmatter (name, description,
  orientation, status, tags, extrapolable, since, palette_refs).
  Validators ARV001-ARV007.
- guideline.py — markdown + YAML frontmatter (name, description, rules,
  applies_to, since). R-rule pattern check. Validators GLV001-GLV006.
- skill.py — Claude Code skill (name + description frontmatter).
  Namespaced filename <pack_slug>__<name>.md to avoid collisions across
  packs. Validators SKV001-SKV004.
- agent.py — same shape as skill, for Claude Code agents.
  Validators AGV001-AGV004.
- asset.py — _manifest.toml + binary files, with kind / license /
  optional sha256 per entry. Validators ASV001-ASV005.
- integration.py — open contract: <pack>/integrations/<framework>/
  with a README.md. Validators INV001-INV003.

Shared infrastructure:
- _frontmatter.py — minimal YAML subset parser (scalars + inline /
  indented lists) so the engine has zero PyYAML runtime dependency.
- install.py — install_claude_artifact() copies pack-shipped skills /
  agents into <project>/.claude/custom/<subdir>/ with namespaced
  filename. Symmetric uninstall_claude_artifact(). Implements EAR-4
  (confirmation prompt default, --yes to skip).

CLI:
- New `stx artifact install <name> --kind skill|agent [--pack <p>]
  [--yes] [--overwrite]` command surface for the install hook.
- show_cmd now renders archetype, guideline, skill, agent with
  category-specific formatting.

Test coverage: 2192 existing tests pass unchanged. The dispatch tables
in validation.py and loaders.py now cover all 8 ArtifactKind values.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nicolasguelfi
nicolasguelfi merged commit 655642d into main May 26, 2026
1 check passed
@nicolasguelfi
nicolasguelfi deleted the feat/pack-artifacts-v0.2 branch May 26, 2026 08:07
@nicolasguelfi nicolasguelfi mentioned this pull request May 26, 2026
2 tasks
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