prd-v06-technical-specification

用于在 PRD v0.6 架构阶段定义实施合同(API 与数据模型),供开发人员基于这些合同开发。触发条件包括请求定义 API、设计数据库模式或创建数据模型,或询问“定义 API”“数据模型”“数据库模式”“API 合同”“技术规格”“端点设计”“模式设计”等。消费 ARC-(架构)、TECH-(构建项)、UJ-(流程)、SCR-(屏幕)条目,输出 API- 条目(端点)和 DBT- 条目(数据模型),为 v0.7 构建执行提供输入。

仓库最近推送
GitHub Stars
179
Forks
12
Issues / PRs
6

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "prd-v06-technical-specification":https://skillpi.com/zh/skills/deepskill-7084b435c9ba94e3a8c1a75eaaa653b7b27babed3f926e64611257390a2177b7。安装前核对上游来源和版本:https://github.com/mattgierhart/PRD-driven-context-engineering。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于在 PRD v0.6 架构阶段定义实施合同(API 与数据模型),供开发人员基于这些合同开发。触发条件包括请求定义 API、设计数据库模式或创建数据模型,或询问“定义 API”“数据模型”“数据库模式”“API 合同”“技术规格”“端点设计”“模式设计”等。消费 ARC-(架构)、TECH-(构建项)、UJ-(流程)、SCR-(屏幕)条目,输出 API- 条目(端点)和 DBT- 条目(数据模型),为 v0.7 构建执行提供输入。

0 下载

介绍来源: third_party · mattgierhart · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: prd-v06-technical-specification
description: Define implementation contracts (APIs and data models) that developers will build against during PRD v0.6 Architecture. Triggers on requests to define APIs, design database schema, create data models, or when user asks "define APIs", "data model", "database schema", "API contracts", "technical spec", "endpoint design", "schema design". Consumes ARC- (architecture), TECH- (Build items), UJ- (flows), SCR- (screens). Outputs API- entries for endpoints and DBT- entries for data models. Feeds v0.7 Build Execution.
context: fork
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep

Technical Specification

Position in workflow: v0.6 Architecture Design → v0.6 Technical Specification → v0.7 Build Execution

Technical specification defines the contracts developers build against: API endpoints and data models. This is the bridge between architecture and implementation.

Consumes

This skill requires prior work from v0.3-v0.6:

  • ARC-* architecture decisions (from v0.6 Architecture Design) — System structure (monolith vs microservices) determines API organization; integration patterns guide webhook/adapter design
  • TECH-* Build items (from v0.5 Technical Stack Selection) — Technologies chosen define data model types (PostgreSQL requires relational schema; MongoDB requires document schema)
  • UJ-* user journeys (from v0.4 User Journey Mapping) — Journey steps determine API call sequences; value moments determine response contracts
  • SCR-* screen entries (from v0.4 Screen Flow Definition) — Screen data requirements determine API response shape; form submissions map to POST/PUT/PATCH endpoints
  • BR-* business rules (from v0.3 Commercial Model) — Business constraints enforced in API responses (rate limits, validation rules, field constraints)

This skill assumes v0.6 Architecture Design is complete with ARC- entries providing system structure.

Produces

This skill creates/updates:

  • API-* entries (API endpoint contracts) — REST/GraphQL endpoint specifications with request/response shapes, auth requirements, error codes, tied to UJ-/SCR- consumers and DBT- data sources
  • DBT-* entries (database schema contracts) — Data model specifications with fields, relationships, indexes, constraints, tied to API- accessors and BR- rules
  • Screen-to-API validation matrix — Verification showing every SCR- has supporting API- and every UJ-* step can be completed via API calls
  • API-to-Data validation matrix — Verification showing every API- response field maps to DBT- and every DBT- is used by at least one API-

All API- and DBT- entries are implementation contracts (not confidence-based). They are:

  • Derivable from upstream IDs (UJ-/SCR-/ARC-/BR-/TECH-)
  • Testable (API responses have concrete shape, DBT constraints are verifiable)
  • Complete enough for developers to implement without re-research

Example API- entry (from UJ- and SCR-):

API-001: Create Report
Method: POST
Path: /api/reports
Purpose: Create new report from selected data source and template (implements UJ-001 Step 1)
Auth: User

Journey: UJ-001 (Step 1 - Create Report)
Screen: SCR-002 (Report Builder)

Request:
  Body:
    {
      title: string (required) — Report name
      templateId: string (required) — Selected template (FEA-008)
      dataSourceId: string (required) — Connected data source (FEA-001)
      options: { dateRange: { start, end }, filters: [...] }
    }

Response:
  Success (201):
    {
      data: { id, title, status: "pending|generating|ready", createdAt }
    }
  Errors:
    - 400: Invalid input — Missing required field
    - 403: Forbidden — User doesn't own data source
    - 404: Not found — Template or data source not found
    - 429: Rate limit exceeded

Business Rules: BR-015 (max 100 reports per user)
Data: DBT-001 (reports table), DBT-002 (data_sources table)

Example DBT- entry (referenced by API- entries):

DBT-001: Reports
Purpose: Stores user-generated reports (entities created by API-001, updated by API-004)
Table: reports

Fields:
  - id: uuid — Primary key
  - user_id: uuid — Report owner (FK → users) [NOT NULL]
  - title: varchar(255) — Display name [NOT NULL]
  - status: enum('pending','generating','ready','failed') [NOT NULL]
  - created_at: timestamp [NOT NULL, DEFAULT now()]

Relationships:
  - belongs_to: users via user_id
  - belongs_to: templates via template_id

Indexes:
  - user_id — List reports by user (API-003)
  - (user_id, created_at DESC) — Recent reports (API-003)
  - status — Find pending reports (background job)

Constraints:
  - title: NOT NULL, length 1-255
  - status: valid enum only

Business Rules: BR-015 (max 100 per user — enforce in API-001)
APIs: API-001 (create), API-002 (get), API-003 (list), API-005 (delete)

Specification Types

Type What It Defines Example
API- Endpoint contracts POST /users, GET /reports/:id
DBT- Data model/schema Users table, Reports table

Rule: Every API- should know which DBT- it reads/writes. Every DBT- should know which API- accesses it.

Specification Process

  1. Pull ARC- decisions — System structure and boundaries

  2. Pull TECH- Build items — What we're implementing

  3. Pull UJ- journeys — User flows the API must support

  4. Pull SCR- screens — UI data requirements

  5. Define API contracts for each endpoint:

    • What's the request/response shape?
    • What auth is required?
    • What errors can occur?
  6. Define data models for each entity:

    • What fields exist?
    • What relationships?
    • What constraints?
  7. Validate consistency:

    • Does every screen have APIs to fetch its data?
    • Does every API response map to DBT- fields?

API- Output Template

API-XXX: [Endpoint Name]
Method: [GET | POST | PUT | PATCH | DELETE]
Path: [/resource/{id}/action]
Purpose: [What this endpoint does]
Auth: [Public | User | Admin | Service]

Journey: [UJ-XXX that uses this]
Screen: [SCR-XXX that calls this]

Request:
  Headers:
    - Authorization: Bearer <token>
    - Content-Type: application/json
  Params:
    - id: string (required) — Resource identifier
  Query:
    - limit: number (optional, default 20) — Pagination limit
  Body:
    {
      field: type — Description
    }

Response:
  Success (200/201):
    {
      data: { ... }
    }
  Errors:
    - 400: Invalid input — [when this occurs]
    - 401: Unauthorized — [when this occurs]
    - 404: Not found — [when this occurs]
    - 500: Server error — [when this occurs]

Business Rules: [BR-XXX enforced here]
Data: [DBT-XXX entities accessed]
Rate Limit: [requests/minute if applicable]

Example API- entry:

API-001: Create Report
Method: POST
Path: /api/reports
Purpose: Create a new report from selected data source and template
Auth: User

Journey: UJ-001 (Step 1 - Create Report)
Screen: SCR-002 (Report Builder)

Request:
  Headers:
    - Authorization: Bearer <token>
    - Content-Type: application/json
  Body:
    {
      title: string (required) — Report name
      templateId: string (required) — Selected template
      dataSourceId: string (required) — Connected data source
      options: {
        dateRange: { start: ISO8601, end: ISO8601 }
        filters: [{ field: string, operator: string, value: any }]
      }
    }

Response:
  Success (201):
    {
      data: {
        id: string
        title: string
        status: "pending" | "generating" | "ready"
        createdAt: ISO8601
      }
    }
  Errors:
    - 400: Invalid input — Missing required field or invalid templateId
    - 401: Unauthorized — Invalid or expired token
    - 403: Forbidden — User doesn't own data source
    - 404: Not found — Template or data source not found
    - 429: Too many requests — Rate limit exceeded

Business Rules: BR-015 (max 100 reports per user)
Data: DBT-001 (reports), DBT-002 (data_sources)
Rate Limit: 10 requests/minute

DBT- Output Template

DBT-XXX: [Entity Name]
Purpose: [What this entity represents]
Table: [database_table_name]

Fields:
  - id: uuid — Primary key, auto-generated
  - [field_name]: [type] — Description [constraints]
  - created_at: timestamp — Record creation (auto)
  - updated_at: timestamp — Last modification (auto)

Relationships:
  - belongs_to: [DBT-YYY] via [foreign_key]
  - has_many: [DBT-ZZZ]

Indexes:
  - [field_name] — [Query pattern it supports]

Constraints:
  - [field]: [UNIQUE | NOT NULL | CHECK expression]

Business Rules: [BR-XXX that affect this entity]
APIs: [API-XXX that read/write this]

Example DBT- entry:

DBT-001: Reports
Purpose: Stores user-generated reports with configuration and status
Table: reports

Fields:
  - id: uuid — Primary key
  - user_id: uuid — Report owner (FK → users) [NOT NULL]
  - title: varchar(255) — Display name [NOT NULL]
  - template_id: uuid — Template used (FK → templates) [NOT NULL]
  - data_source_id: uuid — Data source (FK → data_sources) [NOT NULL]
  - status: enum('pending','generating','ready','failed') — Generation status [NOT NULL, DEFAULT 'pending']
  - options: jsonb — Report configuration (date range, filters) [DEFAULT '{}']
  - output_url: varchar(500) — Generated report file URL [NULL until ready]
  - created_at: timestamp — [NOT NULL, DEFAULT now()]
  - updated_at: timestamp — [NOT NULL, DEFAULT now()]

Relationships:
  - belongs_to: DBT-010 (users) via user_id
  - belongs_to: DBT-002 (templates) via template_id
  - belongs_to: DBT-003 (data_sources) via data_source_id

Indexes:
  - user_id — List reports by user
  - (user_id, created_at DESC) — List recent reports
  - status — Find pending reports for processing

Constraints:
  - title: NOT NULL, length 1-255
  - status: NOT NULL, valid enum value

Business Rules: BR-015 (max 100 reports per user — enforce in API)
APIs: API-001 (create), API-002 (get), API-003 (list), API-005 (delete)

API Design Principles

Principle Guidance Example
Resource-oriented URLs are nouns, not verbs /reports not /createReport
Consistent naming Plural nouns, kebab-case /data-sources not /dataSource
Stateless No server-side sessions Auth via token, not cookie session
Versioned Prefix for breaking changes /v1/reports
Documented errors Clear codes and messages { error: { code: "LIMIT_EXCEEDED", message: "..." } }

Data Model Principles

Principle Guidance Example
Normalized Avoid redundancy (unless denormalized for performance) User name in users table, not duplicated
Audit trail created_at, updated_at on all tables Track when records change
Soft delete deleted_at instead of hard delete (when needed) Recover deleted data
Foreign keys Enforce referential integrity user_id → users.id
Index strategy Index fields in WHERE and JOIN Filter fields, FK columns

Validation Checklist

Use this to ensure spec completeness:

Screen-to-API Validation

  • [ ] Every SCR- screen has APIs to fetch its data
  • [ ] Every form submission maps to a POST/PUT/PATCH
  • [ ] Every list view has a paginated GET

Journey-to-API Validation

  • [ ] Every UJ- step that needs data has an API call
  • [ ] API sequence supports journey flow
  • [ ] Error states in journey have error responses

API-to-Data Validation

  • [ ] Every API- response field maps to DBT- fields
  • [ ] Every API- that writes data has a target DBT-
  • [ ] Business rules (BR-) enforced in API or DB constraint

Orphan Check

  • [ ] No API- without SCR-/UJ- consumer
  • [ ] No DBT- table unused by any API-
  • [ ] No dead code paths

Anti-Patterns to Avoid

Anti-Pattern Signal Fix
API/UI mismatch Screen needs data not in any API Add API- or modify existing
Schema sprawl 50+ tables for MVP Consolidate; YAGNI applies
Missing constraints No validation, anything accepted Add BR- enforcement
N+1 queries baked in API design requires multiple calls for one view Add compound endpoints
No error handling Only happy path documented Define all error responses
Vague types data: any Specify exact shape

Quality Gates

Before proceeding to Build Execution:

  • [ ] All SCR- screens have supporting API- endpoints
  • [ ] All UJ- journeys can be completed via API- calls
  • [ ] All API- responses map to DBT- fields
  • [ ] All BR- rules enforced in API- or DBT- constraints
  • [ ] No orphaned tables or endpoints
  • [ ] Error responses documented for all endpoints

Downstream Connections

API- and DBT- entries feed into:

Consumer What It Uses Example
v0.7 Epic Scoping API- and DBT- define EPIC scope EPIC-01 implements API-001–005
v0.7 Test Planning API- defines test contracts TEST-001 validates API-001
v0.7 Implementation Loop API-/DBT- are implementation tasks Code implements API-001
API Documentation API- becomes OpenAPI spec Swagger from API- entries

Detailed References

  • API and data model examples: See references/examples.md
  • API- entry template: See assets/api.md
  • DBT- entry template: See assets/dbt.md

版本历史

  1. v3.2.0 GitHub ↗
    原版更新说明

    ## [3.2.0] — 2026-04-01 ### Added - `.claude/rules/` directory with 6 modular rule files (01-session-protocols through 06-cross-agent-communication) — auto-loaded by Claude Code via `alwaysApply: true` frontmatter - `SoT/SoT.LESSONS_LEARNED.md` — new SoT file with LL-XXX prefix for cross-session behavioral corrections and validated patterns - Staleness protocol in `SoT/SoT.UNIQUE_ID_SYSTEM.md` — <30d current, 30-90d review, >90d verify before use - `MEMORY_ARCHIVE.md` for all 4 agents — stores entries promoted to SoT during Phase E harvest - `.claude/hooks/traceability-gate.sh` — PreToolUse hook (Write|Edit) verifies active EPIC before source code writes - `.claude/hooks/sot-sync-reminder.sh` — PostToolUse hook (Write|Edit) reminds agent to update SoT after code writes - EPIC template: coordinator pattern (multi-agent routing table, synthesis checkpoint, self-contained worker prompts) - EPIC template: memory harvest step in Phase E (agent memory → SoT.LESSONS_LEARNED.md) - EPIC template: session ownership/locking with Active Session field (2-hour staleness threshold) - Squad Status dashboard in README.md (agent activity + EPIC status tables) - Cross-agent communication protocol rule (file-based async via SoT cross-references, EPIC observations, session state blockers) - Git-based memory sync: `subagent-memory-save.sh` auto-stages MEMORY.md changes; commit convention `memory({agent}): {summary}` - `context` and `allowed-tools` frontmatter fields added to all 33 skills - `CLAUDE.local.md` added to `.gitignore` for per-developer overrides - Context loading order documented as intentional cache architecture (stable→volatile for prompt cache efficiency) ### Changed - **Agent renamed**: `werk` → `devlab` across all files (AGENT.md, domain-profile.yaml, CHANGELOG, MIGRATION, all cross-references in horizon/studio/metro AGENT.md files) - Agent MEMORY.md simplified from 5-8 complex tables → 4 sections (Feedback, Patterns, Decisions, Handoff Notes) — prior format was never populated - `subagent-memory-save.sh` upgraded from passive `systemMessage` → active `hookSpecificOutput` with `additionalContext` (matches load hook pattern) - CLAUDE.md slimmed from 114 lines → ~30 lines (pointer to `.claude/rules/`) - `settings.json` expanded from 5 hook events → 7 (added PreToolUse, PostToolUse) - HOOK_CONTRACT.md updated with new hooks inventory, git commit conventions, Python dependency note - `domain-profile.yaml` — added LL prefix, agent registry updated (werk → devlab) ### Breaking - **Agent `werk` removed** — renamed to `devlab`. Repos referencing `werk` in EPIC leads, agent routing, or custom hooks must update to `devlab` - **CLAUDE.md content moved** — rules now in `.claude/rules/*.md`. CLAUDE.md is a pointer only. Repos that grep CLAUDE.md for rule content must update to search `.claude/rules/` - **MEMORY.md format changed** — old tables replaced with 4-section format. Repos with populated MEMORY.md files should migrate content into the new sections - **settings.json schema expanded** — PreToolUse and PostToolUse entries added. Repos using `/localize` must re-sync settings.json

  2. v3.1.0 GitHub ↗
    原版更新说明

    ## [3.1.0] — 2026-03-18 ### Added - `prd-v04-visual-prototype-gate` skill — converts SCR- entries into structured prompts for Google Stitch (or equivalent UI generation tool), captures stakeholder feedback routed back to SoT IDs. Sits between Screen Flow Definition and v0.5 Red Team Review. - `prd-v06-environment-setup` registered in domain-profile.yaml, skills-inventory.md, and DEVLAB agent (skill existed on disk but was missing from all registries) ### Changed - `.claude/domain-profile.yaml` — domain skills list updated (24 → 26 entries) - `.claude/skills/skills-inventory.md` — added Visual Prototype Gate and Environment Setup entries (Quick Nav, stage overview tables, full skill specs) - `.claude/agents/studio/AGENT.md` — added `prd-v04-visual-prototype-gate` to Skills I Invoke - `.claude/agents/devlab/AGENT.md` — added `prd-v06-environment-setup` to Skills I Invoke - `.claude/README.md` — updated v0.4 skill count (3 → 4) and v0.6 skill count (2 → 3) - Skill count: 26 → 28 PRD lifecycle skills + 5 methodology skills

  3. v3.0.0 GitHub ↗
    原版更新说明

    ## [3.0.0] — 2026-02-12 ### Added - `.claude/VERSION` — single source of truth for template version - `CHANGELOG.md` — structural changes documented per version - `MIGRATION.md` — step-by-step migration guide for derivative repos - `<!-- SECTION: -->` and `<!-- CUSTOMIZABLE: -->` markers in all template files for merge-friendly syncing - `.claude/hooks/HOOK_CONTRACT.md` — universal hook interface specification (language-agnostic) - `.claude/hooks/context-validation.sh` — shell variant of SessionStart hook - `.claude/hooks/context-density-gate.sh` — shell variant of UserPromptSubmit hook - `.claude/hooks/sot-update-trigger.sh` — shell variant of Stop hook - `.claude/domain-profile.yaml` — parameterized ID prefixes, skill taxonomy (core vs domain), agent registry - Dependency manifests in all hook `.md` documentation files - `template_version` frontmatter field in CLAUDE.md, PRD.md, README_template.md, EPIC_TEMPLATE.md, SoT.README.md ### Changed - EPIC template sections: numbered (`## 0. Session State`) → semantic (`## Session State`) - CLAUDE.md: "Section 0" references → "Session State" semantic references - ID Ownership in CLAUDE.md now references `domain-profile.yaml` as canonical registry - `.claude/README.md` updated to reflect actual directory structure (agents, hooks, skills) - Agent files restructured: flat `.claude/agents/DEVLAB.md` → `.claude/agents/devlab/AGENT.md` + `MEMORY.md` ### Breaking - Agent paths changed: `agents/{NAME}.md` → `agents/{name}/AGENT.md` + `agents/{name}/MEMORY.md` - EPIC section headers no longer numbered — scripts referencing "Section 0" must update to "Session State" - See `MIGRATION.md` for complete derivative update checklist

  4. v2.0.0 GitHub ↗
    原版更新说明

    ## [2.0.0] — 2026-01-12 ### Added - Complete skill library: 26 PRD lifecycle skills (v0.1–v0.9) + 5 methodology skills (ghm-*) (note: count updated to 28 in v3.1.0) - Skill-per-directory structure with SKILL.md + assets/ + references/ - 3 hooks: context-validation, context-density-gate, sot-update-trigger - Hook .md documentation paired with each script - 4 agent definitions: HORIZON, STUDIO, DEVLAB, METRO - 12 SoT files standardized to ~100-150 lines each - EPIC template with 5-phase execution model - Progressive documentation protocol in CLAUDE.md - README_template.md for derivative repos ### Changed - Standardized SoT files to consistent structure with YAML frontmatter - Methodology renamed to "PRD Led Context Engineering"

  5. v1.0.0 GitHub ↗
    原版更新说明

    ## [1.0.0] — 2025-12-22 ### Added - Initial template structure - CLAUDE.md agent operating guide - PRD.md progressive requirements template - SoT directory with ID-based knowledge graph - EPIC template for execution planning - README.md methodology explainer

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 为PRD v0.6架构阶段提供高价值的API和数据模型定义能力
  • 明确桥接架构设计与实施执行,解决开发团队核心痛点
  • 输入输出定义清晰,支持端到端的技术规范生成
触发精准90/100

亮点

  • 触发词覆盖全面,包含多种技术规格相关术语变体
  • 边界清晰,输入输出类型定义明确,不易误触或漏触
结构规范85/100

待提升项

  • 文档长度超过500行 原报告严重程度:轻微

    主文档内容较长,可能影响可读性和维护性

    改进建议:考虑将部分内容拆分为引用文件,保持主文档简洁

  • 缺少显式的'When to Use'章节 原报告严重程度:轻微

    虽然上下文清晰,但缺少专门的使用场景说明章节

    改进建议:添加'When to Use'章节明确使用时机和前提条件

亮点

  • 结构完整,包含详细的API和DBT模板
  • 提供了验证清单和质量门禁,确保规范完整性
  • 包含反模式指南,帮助避免常见设计错误
执行可靠90/100

亮点

  • 工具选择恰当,支持完整的读写和搜索操作
  • 流程定义清晰,依赖关系明确,异常处理覆盖全面
  • 业务规则执行和数据一致性验证机制完善
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。