feat: add engineering discipline skills inspired by agent-skills#17
feat: add engineering discipline skills inspired by agent-skills#17
Conversation
Architecture Decision Record template for documenting the 'why' behind architectural decisions, with flow-code integration guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stack-agnostic skill for managing deprecation workflows — assessment, replacement, migration, and clean removal. Inspired by agent-skills. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidates context optimization methodology — 5-tier hierarchy, CLAUDE.md optimization, and strategic use of existing context tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stack-agnostic reference checklists for testing patterns, security, performance, and code review. Adapted from agent-skills patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contract-first interface design skill covering REST APIs, CLI tools, libraries, RPC, and event schemas. Includes Hyrum's Law, idempotency, and boundary validation patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Quality gate pipeline design, shift-left principle, feature flags, and staged rollouts. Platform-agnostic with GitHub Actions examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Measure-Identify-Fix-Verify-Guard workflow for systematic performance optimization. Stack-agnostic with multi-language profiling examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reviewed 13 skills for Common Rationalizations and Red Flags coverage. 10 skills already met the >=5 rationalizations, >=3 red flags minimum. Added both sections to the 3 skills that were missing them entirely: plan-review (7 rationalizations, 6 red flags), brainstorm (7, 6), and auto-improve (7, 6). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each checklist now lives inside the skill that references it, matching the established pattern (django, browser skills). This ensures Skill tool path resolution works correctly. - testing-patterns.md, security-checklist.md → skills/flow-code-cicd/references/ - performance-checklist.md → skills/flow-code-performance/references/ - code-review-checklist.md → skills/flow-code-api-design/references/ - adr-template.md stays in root references/ (not skill-specific) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add skills table (name, description, embedding) with vector index for semantic skill matching. SkillRepo provides upsert() and match_skills() using cosine similarity via BGE-small embeddings. Reuses embed_one()/ensure_embedder() from memory module — zero duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
skill register: scans skills/*/SKILL.md, extracts YAML frontmatter (name + description), embeds via BGE-small, stores in skills table. skill match: semantic search against registered skills, returns ranked results with cosine similarity scores. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Step 0.6 (skill routing) between clarity check and research. Translates request to English keywords, calls flowctl skill-match, and injects matched skills into task spec Approach sections. Non-blocking: embedder failure or no matches → skip silently. Max 3 skill references per task to avoid spec bloat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace vector_top_k (requires ANN index, fails in embedded libSQL) with vector_distance_cos (exact search, no index needed). Works unconditionally in embedded mode. Performance is <1ms for 30 skills. Also lower default threshold from 0.75 to 0.70 based on testing — "deprecate old module" scores 0.73 against flow-code-deprecation. Tested: all 5 new skills match correctly with relevant queries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR ports several stack-agnostic “engineering discipline” skills and checklists into the flow-code skills system, and adds a new flowctl skill CLI + DB support to register/match skills via embeddings (used by planning to auto-route relevant guidance).
Changes:
- Added 5 new skills (API design, deprecation, CI/CD, performance methodology, context engineering) plus per-skill reference checklists.
- Added ADR template + ADR integration guide, and expanded rationalization/red-flag sections in several existing skills.
- Implemented skill registry + semantic match in
flowctl(DB schema/repo + CLI commands) and documented “skill routing” in the planning steps.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/flow-code-plan/steps.md | Adds Step 0.6 “skill routing” instructions using flowctl skill match. |
| skills/flow-code-plan-review/SKILL.md | Adds rationalizations + red flags for plan review. |
| skills/flow-code-performance/SKILL.md | New performance methodology skill (Measure→Identify→Fix→Verify→Guard). |
| skills/flow-code-performance/references/performance-checklist.md | Adds a performance checklist reference for the performance skill. |
| skills/flow-code-deprecation/SKILL.md | New deprecation/migration skill with decision framework + process phases. |
| skills/flow-code-context-eng/SKILL.md | New context-engineering skill (hierarchy, token budgeting, pruning). |
| skills/flow-code-cicd/SKILL.md | New CI/CD patterns skill (quality gates, shift-left, rollouts, monitoring). |
| skills/flow-code-cicd/references/testing-patterns.md | Adds testing patterns reference used by CI/CD skill. |
| skills/flow-code-cicd/references/security-checklist.md | Adds security checklist reference used by CI/CD skill. |
| skills/flow-code-brainstorm/SKILL.md | Adds rationalizations + red flags for brainstorming. |
| skills/flow-code-auto-improve/SKILL.md | Adds rationalizations + red flags for auto-improve. |
| skills/flow-code-api-design/SKILL.md | New API/interface design skill with contract-first + evolution guidance. |
| skills/flow-code-api-design/references/code-review-checklist.md | Adds a structured code review checklist reference used by API design skill. |
| references/adr-template.md | Adds ADR template for architectural decision records. |
| docs/adr-guide.md | Adds ADR integration guide (storage, referencing, lifecycle, plan integration). |
| flowctl/crates/flowctl-db/src/skill.rs | Introduces SkillRepo (upsert/list/match) with cosine-distance semantic search. |
| flowctl/crates/flowctl-db/src/schema.sql | Adds skills table for skill registry + embeddings. |
| flowctl/crates/flowctl-db/src/pool.rs | Attempts to create skills_emb_idx vector index with graceful degradation. |
| flowctl/crates/flowctl-db/src/memory.rs | Exposes embedder helpers (ensure_embedder, embed_one, vec_to_literal) to crate. |
| flowctl/crates/flowctl-db/src/lib.rs | Exports new skill repo/types from flowctl-db. |
| flowctl/crates/flowctl-cli/src/commands/skill.rs | Adds flowctl skill register and flowctl skill match commands. |
| flowctl/crates/flowctl-cli/src/commands/mod.rs | Registers the new skill command module. |
| flowctl/crates/flowctl-cli/src/commands/db_shim.rs | Adds inner_conn() accessor for raw libsql connection for async repos. |
| flowctl/crates/flowctl-cli/src/main.rs | Wires the new skill command group into the CLI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 1. Translate the request to English keywords (if not already English). This costs zero tokens — you're already processing the request. | ||
| 2. Run: | ||
| ```bash | ||
| $FLOWCTL skill match "<english keywords>" --threshold 0.70 --limit 3 --json | ||
| ``` | ||
| 3. If matches found (non-empty JSON array): save them for Step 5 (task spec writing). Each matched skill will be referenced in the task's Approach section. | ||
| 4. If empty result, error, or embedder unavailable: skip silently. Skill routing is advisory, never blocking. |
There was a problem hiding this comment.
The instructions here assume flowctl skill match --json returns a raw JSON array and can include below-threshold results. In the current CLI implementation, JSON output is wrapped (e.g., { success, data: [...] }), and match_skills filters out scores below --threshold, so the example/result-handling logic won’t match actual output. Update the step to parse the correct JSON shape (likely data) and adjust the example accordingly (or change the CLI output contract).
| /// Semantic search: embed the query, find nearest skills via | ||
| /// `vector_top_k`, convert L2 distance to cosine similarity, and | ||
| /// filter by threshold. | ||
| /// | ||
| /// Returns `Ok(vec![])` (not an error) if the embedder or vector | ||
| /// index is unavailable -- graceful degradation. |
There was a problem hiding this comment.
The doc comment for match_skills says it uses vector_top_k and converts “L2 distance to cosine similarity”, but the implementation uses vector_distance_cos (cosine distance) with a full table scan and converts via score = 1.0 - dist. Please update the comment to reflect the actual query strategy and distance metric so callers aren’t misled about index requirements and scoring semantics.
| /// Semantic search: embed the query, find nearest skills via | |
| /// `vector_top_k`, convert L2 distance to cosine similarity, and | |
| /// filter by threshold. | |
| /// | |
| /// Returns `Ok(vec![])` (not an error) if the embedder or vector | |
| /// index is unavailable -- graceful degradation. | |
| /// Semantic search: embed the query, compute `vector_distance_cos` | |
| /// against stored embeddings via an exact full-table scan, order by | |
| /// ascending cosine distance, convert to a similarity score with | |
| /// `score = 1.0 - distance`, and filter by threshold. | |
| /// | |
| /// This query strategy does not use `vector_top_k` and does not | |
| /// require a vector/ANN index. | |
| /// | |
| /// Returns `Ok(vec![])` (not an error) if the embedder or vector | |
| /// functions are unavailable -- graceful degradation. |
| **When NOT to use:** | ||
| - One-off manual deployments that won't recur | ||
| - Local-only development with no shared branches | ||
| - For test design details, see `references/testing-patterns.md` | ||
|
|
There was a problem hiding this comment.
PR description says the new reference checklists live in top-level references/, but these skills reference checklists in per-skill references/ directories (e.g. skills/flow-code-cicd/references/...). Please either move the files to match the documented location or update the PR description/docs to avoid confusing future contributors about where shared references belong.
Summary
Port the most valuable, stack-agnostic engineering discipline patterns from the agent-skills reference plugin into flow-code:
references/New Skills
flow-code-api-designflow-code-deprecationflow-code-cicdflow-code-performanceflow-code-context-engDesign Decisions
docs/skill-anatomy.mdtemplate exactly (6 required sections)references/— skills reference by name, don't embedTest plan
flowctl validatepassesflowctl guardpasses (229 unit tests, known trycmd flake excluded)🤖 Generated with Claude Code