vstack 0.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vstack/__init__.py +5 -0
- vstack/__main__.py +5 -0
- vstack/_templates/agents/_partials/agent-skill-boundary.md +5 -0
- vstack/_templates/agents/architect/config.yaml +38 -0
- vstack/_templates/agents/architect/template.md +84 -0
- vstack/_templates/agents/designer/config.yaml +36 -0
- vstack/_templates/agents/designer/template.md +99 -0
- vstack/_templates/agents/engineer/config.yaml +36 -0
- vstack/_templates/agents/engineer/template.md +88 -0
- vstack/_templates/agents/product/config.yaml +37 -0
- vstack/_templates/agents/product/template.md +87 -0
- vstack/_templates/agents/release/config.yaml +35 -0
- vstack/_templates/agents/release/template.md +86 -0
- vstack/_templates/agents/tester/config.yaml +41 -0
- vstack/_templates/agents/tester/template.md +90 -0
- vstack/_templates/instructions/git/config.yaml +4 -0
- vstack/_templates/instructions/git/template.md +36 -0
- vstack/_templates/instructions/python/config.yaml +4 -0
- vstack/_templates/instructions/python/template.md +37 -0
- vstack/_templates/prompts/code-review/config.yaml +10 -0
- vstack/_templates/prompts/code-review/template.md +39 -0
- vstack/_templates/skills/_partials/base-branch.md +8 -0
- vstack/_templates/skills/_partials/observability-checklist.md +36 -0
- vstack/_templates/skills/_partials/run-tests.md +22 -0
- vstack/_templates/skills/_partials/skill-context.md +21 -0
- vstack/_templates/skills/adr/config.yaml +17 -0
- vstack/_templates/skills/adr/template.md +167 -0
- vstack/_templates/skills/analyse/config.yaml +16 -0
- vstack/_templates/skills/analyse/template.md +188 -0
- vstack/_templates/skills/architecture/config.yaml +18 -0
- vstack/_templates/skills/architecture/template.md +213 -0
- vstack/_templates/skills/cicd/config.yaml +16 -0
- vstack/_templates/skills/cicd/template.md +169 -0
- vstack/_templates/skills/code-review/config.yaml +16 -0
- vstack/_templates/skills/code-review/template.md +180 -0
- vstack/_templates/skills/concise/config.yaml +16 -0
- vstack/_templates/skills/concise/template.md +128 -0
- vstack/_templates/skills/consult/config.yaml +18 -0
- vstack/_templates/skills/consult/template.md +195 -0
- vstack/_templates/skills/container/config.yaml +17 -0
- vstack/_templates/skills/container/template.md +122 -0
- vstack/_templates/skills/debug/config.yaml +16 -0
- vstack/_templates/skills/debug/template.md +247 -0
- vstack/_templates/skills/dependency/config.yaml +18 -0
- vstack/_templates/skills/dependency/template.md +293 -0
- vstack/_templates/skills/design/config.yaml +16 -0
- vstack/_templates/skills/design/template.md +231 -0
- vstack/_templates/skills/docs/config.yaml +17 -0
- vstack/_templates/skills/docs/template.md +128 -0
- vstack/_templates/skills/explore/config.yaml +17 -0
- vstack/_templates/skills/explore/template.md +188 -0
- vstack/_templates/skills/guardrails/config.yaml +16 -0
- vstack/_templates/skills/guardrails/template.md +45 -0
- vstack/_templates/skills/incident/config.yaml +17 -0
- vstack/_templates/skills/incident/template.md +293 -0
- vstack/_templates/skills/inspect/config.yaml +16 -0
- vstack/_templates/skills/inspect/template.md +105 -0
- vstack/_templates/skills/migrate/config.yaml +17 -0
- vstack/_templates/skills/migrate/template.md +298 -0
- vstack/_templates/skills/onboard/config.yaml +18 -0
- vstack/_templates/skills/onboard/template.md +289 -0
- vstack/_templates/skills/openapi/config.yaml +17 -0
- vstack/_templates/skills/openapi/template.md +382 -0
- vstack/_templates/skills/performance/config.yaml +15 -0
- vstack/_templates/skills/performance/template.md +198 -0
- vstack/_templates/skills/pr/config.yaml +15 -0
- vstack/_templates/skills/pr/template.md +108 -0
- vstack/_templates/skills/refactor/config.yaml +18 -0
- vstack/_templates/skills/refactor/template.md +283 -0
- vstack/_templates/skills/release-notes/config.yaml +16 -0
- vstack/_templates/skills/release-notes/template.md +127 -0
- vstack/_templates/skills/requirements/config.yaml +17 -0
- vstack/_templates/skills/requirements/template.md +187 -0
- vstack/_templates/skills/security/config.yaml +17 -0
- vstack/_templates/skills/security/template.md +256 -0
- vstack/_templates/skills/verify/config.yaml +17 -0
- vstack/_templates/skills/verify/template.md +201 -0
- vstack/_templates/skills/vision/config.yaml +19 -0
- vstack/_templates/skills/vision/template.md +169 -0
- vstack/agents/__init__.py +5 -0
- vstack/agents/config.py +67 -0
- vstack/agents/constants.py +14 -0
- vstack/agents/generator.py +20 -0
- vstack/artifacts/__init__.py +17 -0
- vstack/artifacts/config.py +111 -0
- vstack/artifacts/constants.py +6 -0
- vstack/artifacts/generator.py +406 -0
- vstack/artifacts/models.py +55 -0
- vstack/artifacts/protocol.py +50 -0
- vstack/cli/__init__.py +3 -0
- vstack/cli/commands.py +596 -0
- vstack/cli/constants.py +33 -0
- vstack/cli/manifest.py +166 -0
- vstack/cli/parser.py +156 -0
- vstack/constants.py +84 -0
- vstack/frontmatter/__init__.py +8 -0
- vstack/frontmatter/parser.py +272 -0
- vstack/frontmatter/schema.py +142 -0
- vstack/frontmatter/serializer.py +208 -0
- vstack/instructions/__init__.py +5 -0
- vstack/instructions/config.py +21 -0
- vstack/instructions/constants.py +9 -0
- vstack/instructions/generator.py +13 -0
- vstack/main.py +71 -0
- vstack/models.py +35 -0
- vstack/prompts/__init__.py +5 -0
- vstack/prompts/config.py +21 -0
- vstack/prompts/constants.py +9 -0
- vstack/prompts/generator.py +13 -0
- vstack/skills/__init__.py +5 -0
- vstack/skills/config.py +58 -0
- vstack/skills/constants.py +17 -0
- vstack/skills/generator.py +20 -0
- vstack/skills/models.py +15 -0
- vstack-0.0.0.dist-info/METADATA +725 -0
- vstack-0.0.0.dist-info/RECORD +119 -0
- vstack-0.0.0.dist-info/WHEEL +4 -0
- vstack-0.0.0.dist-info/entry_points.txt +3 -0
- vstack-0.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{{SKILL_CONTEXT}}
|
|
2
|
+
|
|
3
|
+
{{BASE_BRANCH}}
|
|
4
|
+
|
|
5
|
+
# vision — Mega Plan Review
|
|
6
|
+
|
|
7
|
+
Review the plan with maximum rigor and the appropriate level of ambition. Do not make code changes
|
|
8
|
+
during this review — that comes after the plan is approved.
|
|
9
|
+
|
|
10
|
+
## Out of scope
|
|
11
|
+
|
|
12
|
+
- Writing code or starting implementation
|
|
13
|
+
- Architecture detail review (use `architecture` after vision review)
|
|
14
|
+
- Requirements gathering (use `requirements`)
|
|
15
|
+
- Writing ADRs (use `adr`)
|
|
16
|
+
|
|
17
|
+
## Deliverable and artifact policy
|
|
18
|
+
|
|
19
|
+
- Primary deliverable: `docs/product/vision.md`
|
|
20
|
+
- Baseline-first default: write approved vision decisions directly to `docs/product/vision.md` on the feature branch.
|
|
21
|
+
- Optional WIP area for complex/uncertain scope exploration: `docs/delta/{intake-id}/VISION_DELTA.md`
|
|
22
|
+
- Before merge: consolidate any required content from optional delta notes back into `docs/product/vision.md`, then remove stale WIP notes.
|
|
23
|
+
|
|
24
|
+
## Review posture Envision the platform, not just the feature. Push scope UP. Ask "what would make this 10x better for 2x the effort?" Present each scope-expanding idea as a question. The user opts in or out.
|
|
25
|
+
|
|
26
|
+
- **SELECTIVE EXPANSION:** Hold the current scope as your baseline — make it bulletproof. Surface every expansion opportunity you see and present each one individually so the user can cherry-pick.
|
|
27
|
+
- **HOLD SCOPE:** The plan's scope is accepted. Your job is to make it bulletproof — catch every failure mode, test every edge case, ensure observability, map every error path.
|
|
28
|
+
- **SCOPE REDUCTION:** Find the minimum viable service/API that achieves the core outcome. Cut everything else ruthlessly.
|
|
29
|
+
|
|
30
|
+
**COMPLETENESS IS CHEAP:** AI coding compresses implementation time 10–100x. When evaluating "approach A (full) vs approach B (shortcut)" — always prefer A. "Ship the shortcut" is legacy thinking.
|
|
31
|
+
|
|
32
|
+
**Critical rule:** The user is 100% in control. Every scope change is an explicit opt-in — never silently add or remove scope.
|
|
33
|
+
|
|
34
|
+
Review the plan with maximum rigor and the appropriate level of ambition.
|
|
35
|
+
|
|
36
|
+
## Prime Directives
|
|
37
|
+
|
|
38
|
+
1. **Zero silent failures.** Every failure mode must be visible. Silent failures in distributed systems are catastrophic — they mean wrong state propagates before anyone notices.
|
|
39
|
+
1. **Every error has a name.** Don't say "handle errors." Name the specific exception class, HTTP status code, gRPC status, or error envelope field. Name what triggers it, what catches it, what the caller sees.
|
|
40
|
+
1. **Data flows have shadow paths.** Every data flow: happy path + null/empty input + upstream error + timeout/partial response. Trace all four.
|
|
41
|
+
1. **Retry/backoff/circuit breaker coverage.** Every external call: what happens on retry? Exponential backoff with jitter? Circuit breaker state machine? Dead letter queue?
|
|
42
|
+
1. **Observability is scope, not afterthought.** New codepaths need: structured logs with correlation IDs, metrics (request rate, error rate, latency p50/p95/p99), distributed traces, dashboards, and alerts.
|
|
43
|
+
1. **API contracts are immutable once published.** Breaking changes require version bumps. Plan the migration strategy before coding.
|
|
44
|
+
1. **Diagrams are mandatory.** Prefer Mermaid for every new data flow, interaction flow, state machine, processing pipeline, dependency graph, and decision tree. Use ASCII only as a fallback when Mermaid is unsupported or less clear.
|
|
45
|
+
1. **Everything deferred must be written down.** TODOS.md or it doesn't exist.
|
|
46
|
+
1. **Design for the 3am pager.** Systems over heroes. Every runbook, alert, and recovery procedure documented before go-live.
|
|
47
|
+
1. **Security is first-class scope.** Authentication, authorization, input validation, rate limiting, secret management — addressed in the plan, not "later."
|
|
48
|
+
|
|
49
|
+
## Engineering Preferences
|
|
50
|
+
|
|
51
|
+
- DRY is important — flag repetition aggressively.
|
|
52
|
+
- Well-tested code is non-negotiable; rather too many tests than too few.
|
|
53
|
+
- "Engineered enough" — not under-engineered (fragile, hacky) and not over-engineered (premature abstraction).
|
|
54
|
+
- Bias toward explicit over clever.
|
|
55
|
+
- Minimal diff: achieve the goal with the fewest new abstractions.
|
|
56
|
+
- Observability is not optional — new codepaths need logs, metrics, or traces.
|
|
57
|
+
- Security is not optional — new codepaths need threat modeling.
|
|
58
|
+
- Deployments are not atomic — plan for partial states, rollbacks, and feature flags.
|
|
59
|
+
|
|
60
|
+
## Cognitive Patterns — How Great CTOs/Founders Think
|
|
61
|
+
|
|
62
|
+
These are thinking instincts, not checklist items:
|
|
63
|
+
|
|
64
|
+
1. **Reversibility reflex** — Every decision evaluated by: reversible or irreversible? Database migrations, API breaking changes, and service renames are one-way doors. Move fast on two-way doors.
|
|
65
|
+
1. **Blast radius instinct** — What's the worst case? How many systems/teams are affected? Mono-repo vs multi-repo blast radius is very different.
|
|
66
|
+
1. **Platform vs product thinking** — Is this a one-off feature or a reusable platform primitive? Platform thinking means building once for N consumers.
|
|
67
|
+
1. **Data is your crown jewel** — Never design a system where data integrity can be silently corrupted. Idempotency keys, optimistic locking, event sourcing where appropriate.
|
|
68
|
+
1. **Boring by default** — Innovation tokens are precious. Proven technology wins 90% of the time. Reserve innovation for the 10% where it truly creates competitive advantage.
|
|
69
|
+
1. **API-first design** — Design the API contract before implementation. The contract is the product.
|
|
70
|
+
1. **Failure as information** — Blameless postmortems, error budgets, chaos engineering. Design systems to fail gracefully, not to not fail.
|
|
71
|
+
1. **Org structure IS architecture** — Conway's Law. Cross-cutting services create cross-cutting coordination. Design both intentionally.
|
|
72
|
+
1. **Temporal depth** — Think in 12–36 month arcs. Will this schema decision haunt you in 18 months? Will this service boundary create a migration project?
|
|
73
|
+
1. **Developer experience is product quality** — Slow CI, bad DX, painful deploys → worse software, higher attrition. DX is a leading indicator.
|
|
74
|
+
|
|
75
|
+
## Priority Hierarchy Under Context Pressure
|
|
76
|
+
|
|
77
|
+
Step 0 > System audit > Error/failure map > Contract review > Observability plan > Test strategy > Opinionated recommendations > Everything else.
|
|
78
|
+
|
|
79
|
+
## PRE-REVIEW SYSTEM AUDIT (before Step 0)
|
|
80
|
+
|
|
81
|
+
Run before doing anything else:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git log --oneline -20 # Recent history
|
|
85
|
+
git diff <base> --stat # What's already changed
|
|
86
|
+
cat TODOS.md 2>/dev/null | head -40 # Outstanding work
|
|
87
|
+
ls -la openapi.yaml openapi.json asyncapi.yaml 2>/dev/null # API contracts
|
|
88
|
+
find . -name '*.proto' 2>/dev/null | head -5 # Protobuf contracts
|
|
89
|
+
cat README.md 2>/dev/null | head -30 # Project overview
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Step 0: Mode Selection
|
|
93
|
+
|
|
94
|
+
Ask the user which review mode they want:
|
|
95
|
+
|
|
96
|
+
> **Question:** Which review mode?
|
|
97
|
+
> **Options:**
|
|
98
|
+
> A) SCOPE EXPANSION — Dream big, push scope up
|
|
99
|
+
> B) SELECTIVE EXPANSION — Hold scope + surface expansion opportunities
|
|
100
|
+
> C) HOLD SCOPE — Maximum rigor, make the plan bulletproof
|
|
101
|
+
> D) SCOPE REDUCTION — Strip to minimum viable
|
|
102
|
+
> **Default if no response:** HOLD SCOPE
|
|
103
|
+
|
|
104
|
+
## Step 1: Problem Framing
|
|
105
|
+
|
|
106
|
+
1. What is the **root problem** this plan is solving? (Not the stated solution — the underlying problem.)
|
|
107
|
+
1. Is this the right level of abstraction to solve it? Could it be solved at a higher/lower level?
|
|
108
|
+
1. Who are the consumers of this API/service/library? What is their actual need?
|
|
109
|
+
1. What does "success" look like in 6 months? What metrics will you track?
|
|
110
|
+
|
|
111
|
+
## Step 2: Scope & Ambition Review
|
|
112
|
+
|
|
113
|
+
1. **What existing code already partially or fully solves each sub-problem?**
|
|
114
|
+
1. Does the plan solve the complete problem or a shortcut version?
|
|
115
|
+
1. Is the scope expansion opportunity larger than estimated? (Platform thinking)
|
|
116
|
+
1. Is the scope reduction possible without sacrificing correctness?
|
|
117
|
+
|
|
118
|
+
## Step 3: API & Contract Review
|
|
119
|
+
|
|
120
|
+
1. What APIs or contracts does this plan introduce, change, or deprecate?
|
|
121
|
+
1. Are there breaking changes? If so, what is the migration plan?
|
|
122
|
+
1. Is the API design opinionated and consistent with existing conventions?
|
|
123
|
+
1. Does the contract handle all error cases (not just happy path)?
|
|
124
|
+
|
|
125
|
+
## Step 4: Reliability & Resilience Review
|
|
126
|
+
|
|
127
|
+
1. What happens when each external dependency is unavailable?
|
|
128
|
+
1. What happens under load (10x, 100x)?
|
|
129
|
+
1. What are the retry semantics? Are all operations idempotent?
|
|
130
|
+
1. What is the rollback strategy if a deployment fails?
|
|
131
|
+
1. What is the blast radius of a failure?
|
|
132
|
+
|
|
133
|
+
## Step 5: Observability Review
|
|
134
|
+
|
|
135
|
+
1. What new metrics does this introduce? Are SLOs defined?
|
|
136
|
+
1. What structured log events are emitted? Do they include correlation IDs?
|
|
137
|
+
1. Are distributed traces created for cross-service calls?
|
|
138
|
+
1. Are there new alerts? Are runbooks documented?
|
|
139
|
+
|
|
140
|
+
## Step 6: Security Review
|
|
141
|
+
|
|
142
|
+
1. What new attack surface does this introduce?
|
|
143
|
+
1. Authentication: how is identity established for new endpoints?
|
|
144
|
+
1. Authorization: what RBAC/ABAC rules apply?
|
|
145
|
+
1. Input validation: is all user-controlled input validated and sanitized?
|
|
146
|
+
1. Secret management: are secrets in secure storage (not env files)?
|
|
147
|
+
1. OWASP Top 10: any obvious risks?
|
|
148
|
+
|
|
149
|
+
## Step 7: Test Strategy Review
|
|
150
|
+
|
|
151
|
+
1. What unit tests cover the happy path?
|
|
152
|
+
1. What tests cover every error path and edge case?
|
|
153
|
+
1. Are there contract tests for new API boundaries?
|
|
154
|
+
1. Is there a smoke test plan for post-deployment verification?
|
|
155
|
+
1. Is test coverage adequate for the complexity?
|
|
156
|
+
|
|
157
|
+
## Step 8: Opinionated Recommendations
|
|
158
|
+
|
|
159
|
+
For each finding: explain the tradeoff, give an opinionated recommendation, ask before assuming direction.
|
|
160
|
+
|
|
161
|
+
## Step 9: Final Verdict
|
|
162
|
+
|
|
163
|
+
- **READY TO IMPLEMENT:** Here's what to do first.
|
|
164
|
+
- **NEEDS REVISION:** These specific issues must be resolved before coding.
|
|
165
|
+
- **SCOPE CHANGE NEEDED:** Here's the revised scope I recommend.
|
|
166
|
+
|
|
167
|
+
Present as: "Overall assessment: [READY/NEEDS REVISION/SCOPE CHANGE] because [1-2 sentence reason]."
|
|
168
|
+
|
|
169
|
+
______________________________________________________________________
|
vstack/agents/config.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Agent artifact type configuration and frontmatter schema.
|
|
2
|
+
|
|
3
|
+
Defines the :data:`AGENT_SCHEMA` (which frontmatter fields a ``.agent.md`` file
|
|
4
|
+
uses) and the :data:`AGENT_TYPE` descriptor that configures the generator for
|
|
5
|
+
the ``agents`` artifact family.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from vstack.agents.constants import AGENT_OUTPUT_SUBDIR, AGENT_OUTPUT_SUFFIX, AGENT_TEMPLATES_SUBDIR
|
|
11
|
+
from vstack.artifacts.config import ArtifactTypeConfig
|
|
12
|
+
from vstack.frontmatter import FieldSpec, FrontmatterSchema
|
|
13
|
+
|
|
14
|
+
# ── Nested schemas ────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
#: Schema for a single ``handoffs`` entry.
|
|
17
|
+
HANDOFF_ITEM_SCHEMA = FrontmatterSchema(
|
|
18
|
+
[
|
|
19
|
+
FieldSpec("label", required=True),
|
|
20
|
+
FieldSpec("agent", required=True, quoted=False),
|
|
21
|
+
FieldSpec("prompt", required=True),
|
|
22
|
+
FieldSpec("send", type="bool"),
|
|
23
|
+
FieldSpec("model"),
|
|
24
|
+
]
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
#: Fields recognised in VS Code custom agent files (``.agent.md``).
|
|
28
|
+
AGENT_SCHEMA = FrontmatterSchema(
|
|
29
|
+
[
|
|
30
|
+
FieldSpec("description"),
|
|
31
|
+
FieldSpec("name", quoted=False),
|
|
32
|
+
FieldSpec("argument-hint"),
|
|
33
|
+
FieldSpec("tools", type="list"),
|
|
34
|
+
FieldSpec("agents", type="list"),
|
|
35
|
+
# Allow model fallback lists (first available model is used).
|
|
36
|
+
FieldSpec("model", type="list"),
|
|
37
|
+
FieldSpec("user-invocable", type="bool"),
|
|
38
|
+
FieldSpec("disable-model-invocation", type="bool"),
|
|
39
|
+
FieldSpec("target", quoted=False),
|
|
40
|
+
# Handoff buttons shown after a response completes.
|
|
41
|
+
# Each entry: label (str), agent (str), prompt (str), send (bool), model (str).
|
|
42
|
+
FieldSpec("handoffs", type="object-list", item_schema=HANDOFF_ITEM_SCHEMA),
|
|
43
|
+
# MCP server config (github-copilot target only). Value is a raw YAML mapping
|
|
44
|
+
# where each key is a server name: type, command, args, tools, env.
|
|
45
|
+
FieldSpec("mcp-servers", type="raw"),
|
|
46
|
+
# Per-agent hook commands scoped to this agent (Preview, requires chat.useCustomAgentHooks).
|
|
47
|
+
# Uses the same nested format as hook config files.
|
|
48
|
+
FieldSpec("hooks", type="raw"),
|
|
49
|
+
# Arbitrary string key/value annotations (github-copilot target only).
|
|
50
|
+
FieldSpec("metadata", type="raw"),
|
|
51
|
+
]
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
#: Type descriptor for the ``agents`` artifact family.
|
|
55
|
+
AGENT_TYPE = ArtifactTypeConfig(
|
|
56
|
+
type_name="agent",
|
|
57
|
+
templates_dir=AGENT_TEMPLATES_SUBDIR,
|
|
58
|
+
output_subdir=AGENT_OUTPUT_SUBDIR,
|
|
59
|
+
output_pattern=f"{{name}}{AGENT_OUTPUT_SUFFIX}",
|
|
60
|
+
add_frontmatter=True,
|
|
61
|
+
artifact_is_dir=False,
|
|
62
|
+
partials_subdir="_partials",
|
|
63
|
+
auto_gen_footer=True,
|
|
64
|
+
fail_on_unresolved=False,
|
|
65
|
+
frontmatter_schema=AGENT_SCHEMA,
|
|
66
|
+
preserve_multiline_frontmatter=True,
|
|
67
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Constants for agent template discovery and output paths."""
|
|
2
|
+
|
|
3
|
+
from vstack.constants import TEMPLATES_ROOT
|
|
4
|
+
|
|
5
|
+
AGENT_TEMPLATE_GLOB = "*/template.md"
|
|
6
|
+
AGENT_OUTPUT_SUFFIX = ".agent.md"
|
|
7
|
+
|
|
8
|
+
#: Subdirectory name under ``templates/`` holding agent source templates.
|
|
9
|
+
AGENT_TEMPLATES_SUBDIR = "agents"
|
|
10
|
+
|
|
11
|
+
#: Subdirectory name under the install root (e.g. ``.github/``) for agent output.
|
|
12
|
+
AGENT_OUTPUT_SUBDIR = "agents"
|
|
13
|
+
|
|
14
|
+
AGENT_TEMPLATES_DIR = TEMPLATES_ROOT / AGENT_TEMPLATES_SUBDIR
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""AgentGenerator — thin wrapper around GenericArtifactGenerator for agents.
|
|
2
|
+
|
|
3
|
+
Import :class:`AgentGenerator` to get a generator pre-configured for the
|
|
4
|
+
``agents`` artifact type. All behaviour is inherited from
|
|
5
|
+
:class:`~vstack.artifacts.generator.GenericArtifactGenerator`.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from vstack.agents.config import AGENT_TYPE
|
|
11
|
+
from vstack.artifacts.generator import GenericArtifactGenerator
|
|
12
|
+
from vstack.constants import TEMPLATES_ROOT
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentGenerator(GenericArtifactGenerator):
|
|
16
|
+
"""Generate agent artifacts using the built-in agent type configuration."""
|
|
17
|
+
|
|
18
|
+
def __init__(self) -> None:
|
|
19
|
+
"""Create an agent generator bound to the built-in template root."""
|
|
20
|
+
super().__init__(AGENT_TYPE, TEMPLATES_ROOT)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""vstack.artifacts — shared prompt-artifact models, generator, and protocol."""
|
|
2
|
+
|
|
3
|
+
from vstack.artifacts.config import INSTRUCTION_SCHEMA as INSTRUCTION_SCHEMA
|
|
4
|
+
from vstack.artifacts.config import PROMPT_SCHEMA as PROMPT_SCHEMA
|
|
5
|
+
from vstack.artifacts.config import ArtifactTypeConfig as ArtifactTypeConfig
|
|
6
|
+
from vstack.artifacts.generator import (
|
|
7
|
+
GenericArtifactGenerator as GenericArtifactGenerator,
|
|
8
|
+
)
|
|
9
|
+
from vstack.artifacts.models import ArtifactResult as ArtifactResult
|
|
10
|
+
from vstack.artifacts.models import RenderedArtifact as RenderedArtifact
|
|
11
|
+
from vstack.artifacts.protocol import ArtifactGenerator as ArtifactGenerator
|
|
12
|
+
from vstack.frontmatter import FieldSpec as FieldSpec
|
|
13
|
+
from vstack.frontmatter import FieldType as FieldType
|
|
14
|
+
from vstack.frontmatter import FrontmatterContent as FrontmatterContent
|
|
15
|
+
from vstack.frontmatter import FrontmatterParser as FrontmatterParser
|
|
16
|
+
from vstack.frontmatter import FrontmatterSchema as FrontmatterSchema
|
|
17
|
+
from vstack.frontmatter import FrontmatterSerializer as FrontmatterSerializer
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"""Artifact configuration types and built-in frontmatter schema registrations.
|
|
2
|
+
|
|
3
|
+
This module provides:
|
|
4
|
+
|
|
5
|
+
* :class:`ArtifactTypeConfig` — fully describes one family of prompt artifacts:
|
|
6
|
+
where to find source templates, how to derive output paths, which frontmatter
|
|
7
|
+
schema applies, and what to verify.
|
|
8
|
+
* Shared schemas for **prompts** and **instructions**.
|
|
9
|
+
|
|
10
|
+
Frontmatter field types (:class:`~vstack.frontmatter.FieldSpec`,
|
|
11
|
+
:class:`~vstack.frontmatter.FrontmatterSchema`, :data:`~vstack.frontmatter.FieldType`)
|
|
12
|
+
live in :mod:`vstack.frontmatter`.
|
|
13
|
+
|
|
14
|
+
Type-specific schemas and descriptors live in their own packages:
|
|
15
|
+
|
|
16
|
+
* :mod:`vstack.skills.config` — :data:`~vstack.skills.config.SKILL_SCHEMA`, :data:`~vstack.skills.config.SKILL_TYPE`
|
|
17
|
+
* :mod:`vstack.agents.config` — :data:`~vstack.agents.config.AGENT_SCHEMA`, :data:`~vstack.agents.config.AGENT_TYPE`
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from dataclasses import dataclass, field
|
|
23
|
+
|
|
24
|
+
from vstack.frontmatter import FieldSpec, FrontmatterSchema
|
|
25
|
+
|
|
26
|
+
# ── ArtifactTypeConfig ────────────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class ArtifactTypeConfig:
|
|
31
|
+
"""Describes a family of prompt artifacts and how to process them.
|
|
32
|
+
|
|
33
|
+
Attributes:
|
|
34
|
+
type_name: Singular identifier used in log output and internal lookups
|
|
35
|
+
(e.g. ``"skill"``). Not used as a manifest key — see
|
|
36
|
+
:attr:`manifest_key` for that.
|
|
37
|
+
manifest_key: Key used in the manifest JSON ``artifacts`` dict
|
|
38
|
+
(e.g. ``"skills"``). Defaults to :attr:`output_subdir`
|
|
39
|
+
when left empty.
|
|
40
|
+
templates_dir: Subdirectory name under ``templates/`` that holds source templates.
|
|
41
|
+
output_subdir: Subdirectory under the install root (``.github/``) for output.
|
|
42
|
+
output_pattern: Output filename relative to *output_subdir*, with a ``{name}``
|
|
43
|
+
placeholder. Examples: ``"{name}/SKILL.md"``,
|
|
44
|
+
``"{name}.agent.md"``.
|
|
45
|
+
add_frontmatter: When ``True`` the generator validates that every artifact has
|
|
46
|
+
frontmatter (from the template or from ``config.yaml``).
|
|
47
|
+
artifact_is_dir: When ``True`` each artifact occupies its own subdirectory
|
|
48
|
+
(like ``skills/<name>/``). Used by uninstall to remove the
|
|
49
|
+
whole directory rather than a single file.
|
|
50
|
+
partials_subdir: Subdirectory relative to *templates_dir* that contains
|
|
51
|
+
partial snippets. ``None`` disables partial loading.
|
|
52
|
+
template_filename: Filename of the source template inside each ``<name>/`` dir.
|
|
53
|
+
config_filename: Optional per-artifact YAML metadata file.
|
|
54
|
+
auto_gen_footer: When ``True``, appends the shared AUTO-GENERATED footer comment
|
|
55
|
+
after the body. ``False`` means no footer is injected or verified.
|
|
56
|
+
placeholders: Registry of supported placeholders for this artifact type,
|
|
57
|
+
mapping ``TOKEN`` to the template file that defines it
|
|
58
|
+
(e.g. ``{"SKILL_CONTEXT": "skill-context.md"}``).
|
|
59
|
+
fail_on_unresolved: When ``True``, ``verify_output`` flags any remaining
|
|
60
|
+
``{{TOKEN}}`` occurrences in output files as errors.
|
|
61
|
+
frontmatter_schema: Schema controlling which fields are emitted and how.
|
|
62
|
+
Required when *add_frontmatter* is ``True``.
|
|
63
|
+
preserve_multiline_frontmatter:
|
|
64
|
+
When ``True``, long string fields are emitted as folded
|
|
65
|
+
YAML scalars (``>-``) in generated frontmatter.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
type_name: str
|
|
69
|
+
templates_dir: str
|
|
70
|
+
output_subdir: str
|
|
71
|
+
output_pattern: str
|
|
72
|
+
add_frontmatter: bool
|
|
73
|
+
artifact_is_dir: bool = False
|
|
74
|
+
partials_subdir: str | None = "_partials"
|
|
75
|
+
template_filename: str = "template.md"
|
|
76
|
+
config_filename: str = "config.yaml"
|
|
77
|
+
auto_gen_footer: bool = False
|
|
78
|
+
placeholders: dict[str, str] = field(default_factory=dict)
|
|
79
|
+
fail_on_unresolved: bool = False
|
|
80
|
+
frontmatter_schema: FrontmatterSchema | None = None
|
|
81
|
+
preserve_multiline_frontmatter: bool = False
|
|
82
|
+
manifest_key: str = ""
|
|
83
|
+
|
|
84
|
+
def __post_init__(self) -> None:
|
|
85
|
+
"""Default ``manifest_key`` to ``output_subdir`` when not explicitly set."""
|
|
86
|
+
if not self.manifest_key:
|
|
87
|
+
self.manifest_key = self.output_subdir
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# ── Frontmatter schemas ───────────────────────────────────────────────────────
|
|
91
|
+
|
|
92
|
+
#: Fields recognised in VS Code prompt files (``.prompt.md``).
|
|
93
|
+
PROMPT_SCHEMA = FrontmatterSchema(
|
|
94
|
+
[
|
|
95
|
+
FieldSpec("description"),
|
|
96
|
+
FieldSpec("name", quoted=False),
|
|
97
|
+
FieldSpec("argument-hint"),
|
|
98
|
+
FieldSpec("agent", quoted=False),
|
|
99
|
+
FieldSpec("model", quoted=False),
|
|
100
|
+
FieldSpec("tools", type="list"),
|
|
101
|
+
]
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
#: Fields recognised in VS Code instruction files (``.instructions.md``).
|
|
105
|
+
INSTRUCTION_SCHEMA = FrontmatterSchema(
|
|
106
|
+
[
|
|
107
|
+
FieldSpec("name", quoted=False),
|
|
108
|
+
FieldSpec("description"),
|
|
109
|
+
FieldSpec("applyTo", quoted=False),
|
|
110
|
+
]
|
|
111
|
+
)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"""Shared constants for the artifacts package."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
#: Markdown comment appended to every generated artifact that has ``auto_gen_footer=True``.
|
|
6
|
+
AUTO_GEN_FOOTER = "\n<!-- AUTO-GENERATED — maintained by vstack, do not edit directly -->\n"
|