shipgate-cli 0.0.0-stage → 0.2.1

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.
Files changed (122) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +258 -2
  3. package/agents/context-builder.md +158 -0
  4. package/agents/debug-executor.md +234 -0
  5. package/assets/gates/classifier.js +245 -0
  6. package/assets/gates/dsh/index.js +767 -0
  7. package/assets/gates/dsh/policy.json +93 -0
  8. package/assets/gates/index.js +3 -0
  9. package/assets/gates/pi/index.js +1121 -0
  10. package/assets/gates/pi/policy.json +93 -0
  11. package/assets/gates/policy.js +4199 -0
  12. package/assets/gates/profiles/ai4s-dry-lab.json +64 -0
  13. package/assets/gates/profiles/ai4s-quant.json +36 -0
  14. package/assets/pi-extensions/auto-continue.ts +176 -0
  15. package/assets/pi-extensions/goal-mode.ts +313 -0
  16. package/bin/shipgate.mjs +9 -0
  17. package/commands/ai-spec.md +9 -0
  18. package/commands/api-first.md +33 -0
  19. package/commands/code-review.md +7 -0
  20. package/commands/codebase-context.md +19 -0
  21. package/commands/debug-ui.md +147 -0
  22. package/commands/debug.md +101 -0
  23. package/commands/dev-env-scan.md +18 -0
  24. package/commands/dev-host-init.md +28 -0
  25. package/commands/discover-skill-opportunities.md +33 -0
  26. package/commands/fork-sync.md +17 -0
  27. package/commands/gh-actions.md +26 -0
  28. package/commands/goal-driven-development.md +7 -0
  29. package/commands/intent-grill.md +7 -0
  30. package/commands/iteration-manager.md +7 -0
  31. package/commands/loop-engineer.md +21 -0
  32. package/commands/nodejs-npm-auto-release.md +12 -0
  33. package/commands/prd.md +7 -0
  34. package/commands/project-health-audit.md +7 -0
  35. package/commands/ralph-yolo.md +346 -0
  36. package/commands/ralph.md +226 -0
  37. package/commands/security-audit.md +7 -0
  38. package/commands/ux-experience-audit.md +133 -0
  39. package/docs/ARCHITECTURE.md +63 -0
  40. package/docs/GATES.md +106 -0
  41. package/docs/HARNESS.md +215 -0
  42. package/package.json +48 -4
  43. package/references/ADR-FORMAT.md +67 -0
  44. package/references/CONTEXT-FORMAT.md +62 -0
  45. package/references/mcp-config-template.json +54 -0
  46. package/scripts/fix-skill-frontmatter.mjs +66 -0
  47. package/scripts/migrate-skillpack.mjs +257 -0
  48. package/skills/ai-spec/SKILL.md +90 -0
  49. package/skills/api-first-modular/SKILL.md +411 -0
  50. package/skills/code-debugger/SKILL.md +379 -0
  51. package/skills/code-review/SKILL.md +62 -0
  52. package/skills/codebase-context/SKILL.md +139 -0
  53. package/skills/debug-ui/SKILL.md +220 -0
  54. package/skills/dev-env-scan/SKILL.md +147 -0
  55. package/skills/dev-host-init/SKILL.md +198 -0
  56. package/skills/dev-host-init/scripts/fill-placeholders.py +226 -0
  57. package/skills/dev-host-init/scripts/host-scan.ps1 +159 -0
  58. package/skills/dev-host-init/scripts/host-scan.sh +201 -0
  59. package/skills/dev-host-init/scripts/render-now.py +488 -0
  60. package/skills/dev-host-init/scripts/tools-catalog.py +229 -0
  61. package/skills/dev-host-init/templates/graph-first-gate.ts +291 -0
  62. package/skills/dev-host-init/templates/host-injection.template.md +725 -0
  63. package/skills/discover-skill-opportunities/SKILL.md +145 -0
  64. package/skills/discover-skill-opportunities/references/accounting-finance-ops.md +24 -0
  65. package/skills/discover-skill-opportunities/references/business-consulting.md +24 -0
  66. package/skills/discover-skill-opportunities/references/evidence-and-privacy.md +39 -0
  67. package/skills/discover-skill-opportunities/references/finance-investment.md +24 -0
  68. package/skills/discover-skill-opportunities/references/legal-and-compliance.md +24 -0
  69. package/skills/discover-skill-opportunities/references/output-contract.md +75 -0
  70. package/skills/discover-skill-opportunities/references/product-and-operations.md +24 -0
  71. package/skills/discover-skill-opportunities/references/quant-trading.md +24 -0
  72. package/skills/discover-skill-opportunities/references/scientific-research.md +24 -0
  73. package/skills/discover-skill-opportunities/references/scoring-rubric.md +45 -0
  74. package/skills/discover-skill-opportunities/references/session-skill-review.md +78 -0
  75. package/skills/discover-skill-opportunities/references/software-development.md +24 -0
  76. package/skills/fork-sync/SKILL.md +86 -0
  77. package/skills/gh-actions-architect/SKILL.md +395 -0
  78. package/skills/goal-driven-development/SKILL.md +132 -0
  79. package/skills/intent-grill/SKILL.md +46 -0
  80. package/skills/iteration-manager/SKILL.md +53 -0
  81. package/skills/loop-engineer/SKILL.md +108 -0
  82. package/skills/nodejs-npm-auto-release/SKILL.md +141 -0
  83. package/skills/prd/SKILL.md +63 -0
  84. package/skills/project-health-audit/SKILL.md +64 -0
  85. package/skills/ralph/SKILL.md +329 -0
  86. package/skills/ralph-yolo/SKILL.md +623 -0
  87. package/skills/security-audit/SKILL.md +114 -0
  88. package/skills/security-audit/references/audit-checklist.md +135 -0
  89. package/skills/security-audit/references/evidence-conventions.md +54 -0
  90. package/skills/security-audit/references/findings-schema.md +37 -0
  91. package/skills/security-audit/references/stack-signatures.md +66 -0
  92. package/skills/shipgate/SKILL.md +40 -0
  93. package/skills/shipgate-install/SKILL.md +87 -0
  94. package/skills/shipgate-quality/SKILL.md +80 -0
  95. package/skills/shipgate-security/SKILL.md +97 -0
  96. package/skills/shipgate-spec/SKILL.md +67 -0
  97. package/skills/ux-experience-audit/SKILL.md +202 -0
  98. package/src/cli.mjs +117 -0
  99. package/src/commands/ask.mjs +82 -0
  100. package/src/commands/deploy.mjs +589 -0
  101. package/src/commands/gates.mjs +83 -0
  102. package/src/commands/policy.mjs +67 -0
  103. package/src/gates/quality.mjs +123 -0
  104. package/src/gates/security.mjs +92 -0
  105. package/src/gates/ship.mjs +74 -0
  106. package/src/gates/spec.mjs +88 -0
  107. package/src/harness/index.mjs +203 -0
  108. package/src/inject/render.mjs +75 -0
  109. package/src/lib/cfg.mjs +66 -0
  110. package/src/lib/engines.mjs +182 -0
  111. package/src/lib/exec.mjs +80 -0
  112. package/src/lib/fsx.mjs +119 -0
  113. package/src/lib/gate.mjs +288 -0
  114. package/src/lib/log.mjs +31 -0
  115. package/src/lib/skills.mjs +347 -0
  116. package/src/lib/state.mjs +41 -0
  117. package/src/lib/update.mjs +67 -0
  118. package/src/version.mjs +14 -0
  119. package/templates/agents-snippet.md +82 -0
  120. package/templates/dev-profile.schema.json +119 -0
  121. package/templates/prd.json.example +64 -0
  122. package/templates/rule.json.example +28 -0
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: discover-skill-opportunities
3
+ description: Analyze conversation exports, task logs, project artifacts, SOPs, tickets, reports, and work history to discover hidden work patterns and rank repeatable workflows worth packaging as AI skills. Also reviews how the Skills loaded in the current session performed — where they helped, where they created friction, and whether an existing Skill should be upgraded — using only visible evidence. Use when users ask what they repeatedly do, what they may be overlooking, or which workflows should become skills; for an evidence-based skill opportunity audit; or to review the current session Skill performance, which triggers when the user asks, when two or more Skills were used, when a correction, permission or path error occurred, or after a large SPEC, package, or release loop. Do not claim access to unavailable history, hidden Skill activation, or session memory; do not infer sensitive personal traits; do not create or modify skills without separate authorization.
4
+ ---
5
+
6
+ # Discover Skill Opportunities
7
+
8
+ ## Overview
9
+
10
+ Turn accessible work evidence into a prioritized portfolio of reusable skill opportunities. Separate observed facts from inference, expose high-leverage patterns the user may not have named, and hand implementation-ready specifications to a skill-building workflow.
11
+
12
+ ## Non-negotiable boundaries
13
+
14
+ - Analyze only sources available in the current context or explicitly accessible through approved tools.
15
+ - State the analyzed scope, time range, missing sources, and sampling limits. Never say that all history or memory was scanned unless it actually was.
16
+ - Minimize exposure of secrets, personal data, client data, credentials, and regulated information. Redact examples when exact content is unnecessary.
17
+ - Describe work patterns, process constraints, and decision habits. Do not diagnose personality, health, intent, or other sensitive traits.
18
+ - Treat frequency as one signal, not proof of value. A rare, costly, stable workflow may outrank a frequent trivial task.
19
+ - Preserve evidence links or artifact references for every major finding. Mark unsupported ideas as hypotheses.
20
+ - Recommend creation; do not write, install, commit, publish, or deploy another skill without explicit authorization.
21
+ - For legal, medical, financial, accounting, or trading workflows, recommend human review and deterministic checks where consequences are material.
22
+
23
+ ## Workflow
24
+
25
+ ### Phase 1: Establish the evidence envelope
26
+
27
+ 1. Restate the audit objective and desired number of candidates; default to three final candidates.
28
+ 2. Inventory available sources by type, date range, owner, and completeness.
29
+ 3. Record inaccessible sources and avoid asking for data that is unnecessary for the audit.
30
+ 4. Choose the smallest representative sample when the corpus is very large; disclose the sampling method.
31
+ 5. Read `references/evidence-and-privacy.md` before handling conversation exports, customer data, financial records, health information, or other sensitive material.
32
+
33
+ ### Phase 2: Extract work episodes
34
+
35
+ 1. Convert evidence into atomic work episodes with: trigger, goal, inputs, actions, decisions, outputs, validation, tools, friction, and outcome.
36
+ 2. Normalize different wording that represents the same underlying job.
37
+ 3. Distinguish user work from assistant boilerplate and incidental conversation.
38
+ 4. Label each episode as `observed`, `inferred`, or `unknown` and attach an evidence pointer.
39
+
40
+ Use this minimal episode schema:
41
+
42
+ ```yaml
43
+ episode_id: E-001
44
+ goal: ""
45
+ trigger: ""
46
+ inputs: []
47
+ actions: []
48
+ decisions: []
49
+ output: ""
50
+ validation: ""
51
+ friction: ""
52
+ evidence: []
53
+ confidence: high|medium|low
54
+ ```
55
+
56
+ ### Phase 3: Cluster recurring jobs
57
+
58
+ 1. Cluster by shared job, decision logic, inputs, outputs, and validation—not keywords alone.
59
+ 2. Split a cluster when its risk level, output contract, or required tools differ materially.
60
+ 3. Identify hidden leverage patterns such as repeated context reconstruction, recurring exception handling, manual reconciliation, cross-system translation, review bottlenecks, and undocumented quality gates.
61
+ 4. Load only the relevant domain references listed below. Combine references when a workflow crosses domains.
62
+
63
+ ### Phase 4: Score skill potential
64
+
65
+ 1. Score every cluster from 0 to 5 on the eight dimensions in `references/scoring-rubric.md`.
66
+ 2. Calculate the weighted score and apply red-flag caps.
67
+ 3. Compare against simpler alternatives: checklist, template, saved prompt, script, automation, policy document, or no action.
68
+ 4. Assign one disposition:
69
+ - `BUILD_SKILL`: stable workflow, reusable context, and verifiable output.
70
+ - `PILOT_AS_SOP`: promising but needs more examples or stabilized decisions.
71
+ - `AUTOMATE_DIFFERENTLY`: deterministic integration or script is the better unit.
72
+ - `KEEP_AD_HOC`: variation or low value does not justify packaging.
73
+
74
+ ### Phase 5: Surface consequential findings
75
+
76
+ 1. Select at most three findings the user likely has not explicitly named.
77
+ 2. For each finding, show the evidence pattern, why it matters, the decisions it could change, confidence, and a reversible next action.
78
+ 3. Include at least one plausible alternative explanation or disconfirming signal.
79
+ 4. Avoid novelty theater: omit observations that do not change a decision, workflow, allocation, or control.
80
+
81
+ ### Phase 6: Specify the top candidates
82
+
83
+ 1. Rank candidates by weighted score, evidence strength, strategic leverage, and portfolio diversity.
84
+ 2. Produce an implementation-ready specification using `references/output-contract.md`.
85
+ 3. Define positive and negative trigger examples, inputs, workflow, output contract, resources, tools, risk controls, validation, and success metrics.
86
+ 4. Identify whether each reusable element belongs in `SKILL.md`, `references/`, `scripts/`, or `assets/`.
87
+ 5. Note overlap with existing skills and recommend extending an existing skill when duplication would be wasteful.
88
+
89
+ ### Phase 7: Hand off deliberately
90
+
91
+ 1. Ask for confirmation before implementation.
92
+ 2. When approved, hand the selected specification to the platform's skill-creation or skill-governance workflow.
93
+ 3. Preserve rejected candidates and reasons so a later audit can detect changed evidence.
94
+
95
+ ### Phase (optional): Active Skill Performance Review
96
+
97
+ Review how Skills actually loaded or invoked in the current session performed. This is a distinct lens from work-pattern mining: it asks whether the Skills used this session helped, where they created friction, and whether an existing Skill should be upgraded. Read `references/session-skill-review.md` before running it.
98
+
99
+ 1. Confirm a trigger condition is met (user request; two or more Skills used; a correction/path/permission error or rework; a large SPEC/package/release loop finished; Skill output diverged from delivery). If none is met, skip and say so.
100
+ 2. State the visible-Skill scope and its limits. Use only visible evidence — do not claim to scan all loaded Skills or hidden invocation traces.
101
+ 3. For each reviewed Skill, record execution episodes with the attribution schema, separating `skill_logic` defects from `execution`, `platform`, `permission`, `input`, and `repository_debt` causes.
102
+ 4. Output both strengths/rules-to-preserve and friction/failures, never weaknesses alone.
103
+ 5. Assign an upgrade disposition, preferring `UPDATE_EXISTING_SKILL` over creating a new Skill when evidence supports it.
104
+ 6. Add the findings to the `Current-session Skill performance` section of the output contract. Recommend changes only; do not modify Skills without separate authorization.
105
+
106
+ ## Domain routing
107
+
108
+ | Domain signal | Read when needed |
109
+ |---|---|
110
+ | Software engineering, DevOps, QA, architecture | `references/software-development.md` |
111
+ | Strategy, organization, operations, client advisory | `references/business-consulting.md` |
112
+ | Literature, experiments, data analysis, papers, grants | `references/scientific-research.md` |
113
+ | Signals, backtests, portfolios, execution, risk | `references/quant-trading.md` |
114
+ | Investment research, valuation, markets, credit, treasury | `references/finance-investment.md` |
115
+ | Bookkeeping, close, reporting, tax support, controls | `references/accounting-finance-ops.md` |
116
+ | Product discovery, roadmap, growth, content, support | `references/product-and-operations.md` |
117
+ | Contracts, policy, privacy, regulatory controls | `references/legal-and-compliance.md` |
118
+
119
+ ## Output Contract
120
+
121
+ Complete an audit only when the response contains:
122
+
123
+ 1. `Audit scope and limitations` — sources examined, time range, exclusions, and confidence limits.
124
+ 2. `Consequential findings` — evidence-backed hidden patterns with impact, alternative explanation, and next action.
125
+ 3. `Recurring work clusters` — normalized clusters with frequency or recurrence evidence, friction, and disposition.
126
+ 4. `Ranked opportunities` — score breakdown, rationale, simpler-alternative check, and top candidates.
127
+ 5. `Skill specifications` — implementation-ready specifications for the requested number of candidates.
128
+ 6. `Not recommended yet` — rejected or deferred candidates and the evidence needed to reconsider them.
129
+ 7. `Next decision` — ask whether to prototype, observe longer, or stop; do not imply approval.
130
+
131
+ When the Active Skill Performance Review phase runs, also include:
132
+
133
+ 8. `Current-session Skill performance` — per reviewed Skill: visible-scope statement, attribution table, strengths and rules to preserve, friction/failures, upgrade disposition, minimal proposed change, and a regression scenario. Omit this section when the session review is not triggered.
134
+
135
+ Use calibrated language: `observed`, `strongly supported`, `plausible`, or `speculative`. Never present an inference as a fact.
136
+
137
+ ## Resources
138
+
139
+ | File | Purpose | When to load |
140
+ |---|---|---|
141
+ | `references/evidence-and-privacy.md` | Evidence access, provenance, sampling, privacy, and redaction | Phase 1; always for sensitive corpora |
142
+ | `references/scoring-rubric.md` | Weighted scoring, red flags, and build thresholds | Phase 4; always |
143
+ | `references/output-contract.md` | Audit and candidate specification templates | Phases 5-7; always |
144
+ | `references/session-skill-review.md` | Visible-evidence envelope, attribution schema, strengths, and upgrade dispositions | Active Skill Performance Review; only when triggered |
145
+ | Domain references listed above | Domain-specific work clusters, boundaries, and validation ideas | Phase 3; only for relevant domains |
@@ -0,0 +1,24 @@
1
+ # Accounting and finance operations opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Transaction classification and reconciliation | Repeated mapping, unmatched items, manual tie-outs | chart-of-accounts rules, matcher, exception queue | opening + movements = closing; unmatched items listed |
8
+ | Period close | Recurring checklist, dependencies, late evidence | close calendar, ownership matrix, evidence pack | all accounts and approvals complete |
9
+ | Management reporting | Repeated extracts, variance commentary, packs | metric dictionary, report template, variance rules | source-to-report totals reconcile |
10
+ | Accounts payable or receivable | Recurring invoice checks, aging, collections | validation rules, workflow states, communication templates | subledger and general ledger reconcile |
11
+ | Expense and revenue controls | Repeated policy checks and exceptions | policy reference, evidence checklist, exception log | sampled transactions meet control criteria |
12
+ | Audit and tax support | Repeated schedules, request tracking, evidence retrieval | PBC tracker, workpaper templates, cross-reference rules | schedules tie to books and source evidence |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Use skills to orchestrate classification, evidence gathering, exception handling, review, and reporting. Use deterministic accounting software or scripts for postings and calculations. Keep entity-specific chart of accounts, policies, periods, and materiality in controlled references.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for repeated spreadsheet formulas, manual matching, recurring close delays, inconsistent variance explanations, repeated auditor requests, or control evidence assembled from multiple systems.
21
+
22
+ ## Risk controls
23
+
24
+ Preserve audit trails, periods, entity, currency, tax treatment, approvals, segregation of duties, and immutable source evidence. Never post entries, submit filings, initiate payments, or certify reports without explicit authorization and qualified review.
@@ -0,0 +1,24 @@
1
+ # Business consulting opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Problem framing and workplan design | Repeated issue trees, hypotheses, interview plans | framing rubric, workplan templates, sector references | questions are mutually distinct and decision-linked |
8
+ | Market and competitor assessment | Same source plan, sizing logic, comparison dimensions | research protocol, source hierarchy, sizing model | assumptions and sources are traceable |
9
+ | Operating model and process redesign | Recurring stakeholder maps, RACI, bottleneck analysis | process schema, interview guide, control checklist | future state has owners and measurable controls |
10
+ | Executive decision memo | Repeated synthesis into options and recommendations | memo structure, evidence rubric, decision table | recommendation maps to evidence and tradeoffs |
11
+ | Due diligence and risk review | Similar request lists, red flags, evidence rooms | diligence checklist, red-flag taxonomy | every conclusion links to evidence or gap |
12
+ | Meeting-to-action conversion | Recurring synthesis, follow-ups, decision logs | action schema, decision log, follow-up template | owners, dates, dependencies, decisions captured |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package a repeatable advisory method and output contract, not generic "be a consultant" roleplay. Separate industry-specific knowledge into references. Keep client-specific facts outside the reusable skill unless access and retention are approved.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for repeated slide structures, copied interview questions, recurring stakeholder objections, recurring requests for the same analysis, and manual synthesis across documents.
21
+
22
+ ## Risk controls
23
+
24
+ Separate facts, assumptions, estimates, and recommendations. Record source dates and conflicts. Require human judgment for organizational, employment, pricing, negotiation, or reputational decisions.
@@ -0,0 +1,39 @@
1
+ # Evidence, provenance, and privacy
2
+
3
+ ## Source inventory
4
+
5
+ Record each source as `source_id`, type, accessible range, owner, sensitivity, completeness, and location. Prefer stable artifact pointers such as file paths, ticket IDs, dates, or conversation identifiers over long quotations.
6
+
7
+ Possible sources include conversation exports, task trackers, commit history, code review, meeting notes, SOPs, spreadsheets, reports, calendars, support tickets, experiment logs, and user-provided memory summaries. Availability is platform-specific; never imply access that was not demonstrated.
8
+
9
+ ## Evidence levels
10
+
11
+ - `Direct`: an artifact shows the task, decision, output, or validation.
12
+ - `Corroborated`: two or more independent artifacts support the pattern.
13
+ - `Inferred`: the pattern is a reasonable explanation but is not directly recorded.
14
+ - `Unknown`: evidence is insufficient or contradictory.
15
+
16
+ Attach at least one pointer to every cluster and two independent pointers for a consequential hidden finding when possible.
17
+
18
+ ## Sampling large corpora
19
+
20
+ Use full review when feasible. Otherwise declare one method:
21
+
22
+ - time-stratified sample across early, middle, and recent periods;
23
+ - source-stratified sample across conversations, tickets, files, and reports;
24
+ - event-focused sample around launches, closes, submissions, incidents, or decisions;
25
+ - random or systematic interval sample.
26
+
27
+ Check the proposed top clusters against a second sample before final ranking. State that counts are sample estimates rather than corpus totals.
28
+
29
+ ## Data minimization
30
+
31
+ - Request only the evidence needed to identify workflow structure.
32
+ - Replace names, account numbers, credentials, client identifiers, unpublished results, and health details with neutral tokens.
33
+ - Do not reproduce secrets in the audit. If encountered, report the category and location without exposing the value.
34
+ - Keep personal evaluation out of scope. Analyze process behavior, not identity or character.
35
+ - Respect retention, access-control, contractual, and regulatory constraints supplied by the user or workspace.
36
+
37
+ ## Conflict handling
38
+
39
+ When evidence conflicts, show both signals, prefer newer or directly observed artifacts only with justification, and lower confidence. Do not merge workflows merely because their surface language is similar.
@@ -0,0 +1,24 @@
1
+ # Finance and investment opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Company and industry research | Repeated filings, KPI extraction, peer comparisons | source hierarchy, KPI schema, peer template | figures reconcile to dated primary sources |
8
+ | Valuation and scenario analysis | Reused DCF, multiples, sensitivities | model template, assumption register, validators | formulas, units and scenarios reconcile |
9
+ | Credit and counterparty review | Recurring covenant, liquidity, leverage analysis | credit rubric, covenant schema, red flags | calculations trace to source documents |
10
+ | Portfolio or exposure reporting | Repeated aggregation and commentary | exposure schema, attribution template | totals reconcile and timestamps are explicit |
11
+ | Treasury and liquidity planning | Recurring cash forecasts and funding decisions | cash model, scenario playbook, controls | opening-to-closing cash bridge reconciles |
12
+ | Market or event monitoring | Repeated news, filings, policy and price synthesis | event schema, source ladder, freshness rules | current state is separated from historical narrative |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package research method, model controls, and reporting—not a standing promise of financial advice. Separate public-market, private-market, credit, treasury, and personal-finance workflows when sources and duties differ.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for repeated manual KPI extraction, copied model tabs, recurring source reconciliation, recurring memo structures, or decisions delayed by stale data.
21
+
22
+ ## Risk controls
23
+
24
+ Timestamp market data, identify currency and units, distinguish reported from adjusted figures, preserve assumptions, and use primary sources for material claims. Require qualified human review for investment, lending, suitability, tax, treasury, or regulated advice.
@@ -0,0 +1,24 @@
1
+ # Legal and compliance opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Contract intake and clause review | Repeated clause comparisons, fallback positions, missing terms | clause library, issue checklist, playbook | deviations and unresolved issues listed |
8
+ | Policy mapping and control evidence | Recurring requirement-to-control mapping | obligation schema, control matrix, evidence tracker | every applicable obligation has status and owner |
9
+ | Privacy and data review | Repeated data-flow, retention, access, vendor questions | data inventory, review questionnaire, risk rubric | data categories and transfers accounted for |
10
+ | Regulatory monitoring | Recurring source checks and impact memos | jurisdiction map, source hierarchy, change log | current effective date and applicability confirmed |
11
+ | Incident or investigation chronology | Repeated evidence collection and timeline reconstruction | evidence register, chronology template, privilege labels | sources, custody and uncertainties recorded |
12
+ | Filing and approval readiness | Recurring completeness and sign-off checks | submission checklist, approval matrix | required materials and approvals present |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package intake, issue spotting, evidence organization, and review preparation. Do not represent the skill as a lawyer, final legal opinion, regulator, or autonomous compliance decision maker. Keep jurisdiction- and organization-specific rules in dated references.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for repeated redlines, copied questionnaires, recurring missing approvals, manual obligation tracking, or inconsistent retention and vendor reviews.
21
+
22
+ ## Risk controls
23
+
24
+ Identify jurisdiction, effective date, privilege, confidentiality, authority, and source hierarchy. Require qualified counsel or compliance owner for interpretations, submissions, waivers, investigations, employment actions, or binding commitments.
@@ -0,0 +1,75 @@
1
+ # Audit and candidate templates
2
+
3
+ ## Consequential finding
4
+
5
+ ```markdown
6
+ ### Finding: <decision-relevant pattern>
7
+ - Status: observed | strongly supported | plausible | speculative
8
+ - Evidence: <artifact pointers and recurrence>
9
+ - Hidden leverage or risk: <why this matters>
10
+ - Decisions affected: <allocation, sequencing, control, delegation, tooling>
11
+ - Alternative explanation: <credible competing interpretation>
12
+ - Reversible next action: <small test>
13
+ ```
14
+
15
+ ## Cluster summary
16
+
17
+ ```markdown
18
+ | Cluster | Episodes/evidence | Stable core | Main friction | Score | Disposition |
19
+ |---|---|---|---|---:|---|
20
+ ```
21
+
22
+ Avoid false precision. Use ranges or qualitative recurrence when the corpus is sampled.
23
+
24
+ ## Skill candidate specification
25
+
26
+ ```markdown
27
+ ### <rank>. <kebab-case-name>
28
+
29
+ **Job and value**
30
+ - User job:
31
+ - Evidence:
32
+ - Expected leverage:
33
+ - Why a skill beats simpler alternatives:
34
+
35
+ **Trigger contract**
36
+ - Trigger when:
37
+ - Positive examples:
38
+ - Do not trigger when:
39
+ - Negative examples:
40
+
41
+ **Inputs and prerequisites**
42
+ - Required:
43
+ - Optional:
44
+ - Missing-input behavior:
45
+
46
+ **Workflow**
47
+ 1. ...
48
+
49
+ **Output contract and validation**
50
+ - Deliverables:
51
+ - Acceptance criteria:
52
+ - Human review gates:
53
+ - Failure/degraded modes:
54
+
55
+ **Reusable contents**
56
+ - SKILL.md:
57
+ - references/:
58
+ - scripts/:
59
+ - assets/:
60
+ - tool or connector dependencies:
61
+
62
+ **Risks and controls**
63
+ - Data/privacy:
64
+ - Domain risk:
65
+ - Scope boundary:
66
+
67
+ **Pilot plan**
68
+ - Test episodes:
69
+ - Success metrics:
70
+ - Stop/revise criteria:
71
+ ```
72
+
73
+ ## Portfolio recommendation
74
+
75
+ Rank the requested number of candidates, normally three. Favor a portfolio that covers distinct high-value jobs unless adjacent skills share resources and should deliberately form a parent-child package. Name overlaps with existing skills and recommend extension rather than duplication.
@@ -0,0 +1,24 @@
1
+ # Product and operations opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Voice-of-customer synthesis | Repeated interview, survey, review, and ticket coding | taxonomy, extraction schema, evidence matrix | themes trace to source samples |
8
+ | Prioritization and roadmap decisions | Recurring scoring and stakeholder reconciliation | decision rubric, dependency map, roadmap template | priorities expose assumptions and tradeoffs |
9
+ | Requirements and acceptance criteria | Repeated ambiguity resolution and edge-case review | requirement schema, question bank, test template | requirements are testable and owned |
10
+ | Launch planning | Recurring cross-functional checklist and readiness review | launch gates, RACI, rollback plan | owners, dependencies and go/no-go criteria complete |
11
+ | Growth or content experiments | Repeated briefs, variants, tracking and readouts | experiment template, metric dictionary, analysis rules | hypotheses and stopping rules predeclared |
12
+ | Support and operational triage | Recurring classification, routing and escalation | taxonomy, SLA rules, response templates | correct owner, urgency and closure evidence |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package a decision process plus shared schemas and gates. Keep product-specific facts, customer data, and current roadmap in controlled references or source systems. Prefer workflow automation for simple routing without meaningful reasoning.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for recurring clarification meetings, duplicated launch checklists, inconsistent metric definitions, repeated ticket tagging, or decisions revisited because assumptions were not recorded.
21
+
22
+ ## Risk controls
23
+
24
+ Separate user evidence from stakeholder opinion, declare metric definitions, prevent dark patterns, respect consent and privacy, and require owners for irreversible launches or customer communication.
@@ -0,0 +1,24 @@
1
+ # Quantitative trading opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Data ingestion and quality control | Repeated vendor pulls, adjustments, missing-data repair | adapters, schema, freshness and survivorship checks | point-in-time and quality tests pass |
8
+ | Hypothesis and factor research | Reused transformations, neutralization, IC analysis | research protocol, factor library, notebook template | out-of-sample and robustness tests |
9
+ | Backtest review | Repeated leakage, cost, turnover, exposure checks | backtest audit rubric, metric scripts | no look-ahead; costs and constraints modeled |
10
+ | Portfolio construction and risk | Recurring optimization, limits, rebalance logic | constraint schema, exposure reports, stress tests | limits, concentration and scenario tests pass |
11
+ | Signal-to-execution handoff | Repeated order sizing, liquidity and slippage checks | execution contract, broker adapter, kill-switch checklist | paper/shadow execution reconciliation |
12
+ | Strategy monitoring and attribution | Recurring drift, PnL decomposition, alert review | monitoring thresholds, attribution scripts | alerts and attribution reconcile to books |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Separate research, validation, portfolio construction, and live execution when permissions and failure costs differ. Prefer deterministic code for calculations; use a skill to orchestrate evidence, decisions, controls, and interpretation.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for copied notebooks, repeated data repairs, parameter sweeps without protocol, recurring post-hoc explanations, manual broker reconciliation, or the same risk questions before each deployment.
21
+
22
+ ## Risk controls
23
+
24
+ Require point-in-time data, transaction costs, liquidity, corporate-action handling, survivorship checks, out-of-sample tests, sensitivity analysis, and explicit market timestamps. Never infer live executability from stale or incomplete data. Require human approval and platform controls for orders, leverage, capital allocation, and production deployment.
@@ -0,0 +1,24 @@
1
+ # Scientific research opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Literature search and evidence synthesis | Repeated queries, screening, extraction, citation cleanup | query protocol, inclusion rubric, extraction schema | search is reproducible and citations resolve |
8
+ | Experiment or analysis planning | Repeated design choices, controls, power or feasibility checks | protocol template, decision tree, preregistration checklist | hypotheses, endpoints and controls are explicit |
9
+ | Data preprocessing and QC | Similar cleaning, exclusion, normalization, plots | scripts, schemas, QC thresholds | provenance and QC reports are reproducible |
10
+ | Statistical analysis and sensitivity checks | Reused models and diagnostics | analysis scripts, assumption checklist | code, environment and outputs reproduce |
11
+ | Figure-to-narrative synthesis | Repeated panel interpretation and claim calibration | figure rubric, claim-evidence matrix | claims match data and uncertainty |
12
+ | Manuscript, grant, or submission compliance | Recurring formatting and completeness checks | journal/funder references, validators, checklists | required sections and files are present |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package reproducible procedures, domain schemas, and validation—not conclusions. Split wet-lab, computational, clinical, and qualitative workflows when their controls differ. Keep project data and unpublished findings outside reusable references unless explicitly intended.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for duplicated notebooks, repeated database queries, manual citation repair, recurring reviewer comments, inconsistent preprocessing, or repeated explanation of instruments and datasets.
21
+
22
+ ## Risk controls
23
+
24
+ Preserve provenance, versions, units, exclusions, negative results, and uncertainty. Never fabricate citations or results. Require expert review for clinical, biosafety, ethics, authorship, and regulatory decisions.
@@ -0,0 +1,45 @@
1
+ # Skill opportunity scoring rubric
2
+
3
+ Score each dimension from 0 to 5. Keep raw scores visible.
4
+
5
+ | Dimension | Weight | A score of 5 means |
6
+ |---|---:|---|
7
+ | Recurrence | 15 | Repeated across periods, projects, or users with credible evidence |
8
+ | Process stability | 15 | Core steps and decision points are stable despite variable inputs |
9
+ | Reusable context | 10 | The same schemas, policies, examples, or domain rules are repeatedly reconstructed |
10
+ | Friction and time | 15 | The workflow consumes material effort, coordination, or attention |
11
+ | Error or omission cost | 15 | Missed steps cause meaningful rework, loss, delay, or control failure |
12
+ | Verifiability | 15 | Outputs have observable acceptance criteria or deterministic checks |
13
+ | Tool and resource leverage | 10 | Scripts, references, templates, or integrations materially improve execution |
14
+ | Strategic leverage | 5 | Packaging improves delegation, scale, consistency, or decision speed |
15
+
16
+ Calculate `weighted_score = sum(score / 5 * weight)`, yielding 0-100.
17
+
18
+ ## Interpretation
19
+
20
+ - `75-100`: strong `BUILD_SKILL` candidate if no red flag applies.
21
+ - `60-74`: prototype or `PILOT_AS_SOP`; validate with more episodes.
22
+ - `40-59`: prefer a checklist, template, saved prompt, or small script.
23
+ - `<40`: keep ad hoc unless risk controls independently justify standardization.
24
+
25
+ ## Red-flag caps
26
+
27
+ - Cap at 59 when fewer than two credible episodes support recurrence.
28
+ - Cap at 59 when the output cannot be evaluated and no review gate can be defined.
29
+ - Cap at 49 when the core method changes on almost every instance.
30
+ - Mark `AUTOMATE_DIFFERENTLY` when the task is deterministic data movement with negligible reasoning.
31
+ - Mark `KEEP_AD_HOC` when value comes primarily from unconstrained originality or one-off negotiation.
32
+ - Do not recommend autonomous execution for regulated advice, trading, payments, filings, publication claims, or production changes without explicit review and controls.
33
+
34
+ ## Simpler-alternative test
35
+
36
+ Before recommending a skill, ask whether the dominant need is better served by:
37
+
38
+ 1. a one-page checklist for human execution;
39
+ 2. a reusable document or spreadsheet template;
40
+ 3. a saved prompt with little domain context;
41
+ 4. a deterministic script or scheduled integration;
42
+ 5. a policy/reference document;
43
+ 6. an update to an existing skill.
44
+
45
+ A new skill should win because it combines reusable reasoning, workflow, context, resources, and validation—not because it is fashionable.
@@ -0,0 +1,78 @@
1
+ # Session Skill Performance Review — 当前会话已加载 Skill 的工作表现复盘
2
+
3
+ > 加载时机:`Phase: Active Skill Performance Review`(仅在触发条件满足时)。
4
+ > 对应 SPEC 需求:DS-01、DS-02、DS-03、DS-04、DS-05、DS-06。
5
+
6
+ 这是常规工作痕迹挖掘之外的一个独立视角:不是「历史上有哪些可沉淀的工作」,而是「**本次会话里实际用到的 Skill 是否帮上了忙、在哪卡住、是否该升级**」。
7
+
8
+ ## 何时触发(DS-06)
9
+
10
+ **不是每轮都跑。** 简单任务复盘会徒增上下文与延迟。仅在以下任一条件满足时进行:
11
+
12
+ - 用户明确要求 session/Skill 复盘;
13
+ - 本 session 实际使用了两个及以上 Skill;
14
+ - 出现用户纠错、路径/权限错误、失败后返工;
15
+ - 完成了一次较大的 SPEC / package / release loop;
16
+ - Skill 输出与实际交付存在明显偏差。
17
+
18
+ 条件都不满足时,跳过本 Phase 并说明「未触发 session 复盘」。
19
+
20
+ ## 可见证据信封(DS-02)
21
+
22
+ 只纳入**当前上下文中可见**的证据,**不得**声称扫描了「全部已加载 Skill」或访问了隐藏调用轨迹,除非平台确实提供完整清单与轨迹。
23
+
24
+ 允许纳入:
25
+
26
+ - 当前上下文明确列出的 available Skills;
27
+ - 本 session 中明确读取过的 `SKILL.md`;
28
+ - 用户或助手明确调用/引用过的 Skill;
29
+ - Skill 导致的文件改动、命令、报告、tool output;
30
+ - 用户纠错、失败日志、返工与覆盖指令。
31
+
32
+ 不允许:推断隐藏系统 prompt、隐藏 Skill 激活、其他会话历史、未暴露的完整 memory。复盘开头必须声明「可见 Skill 范围」与其局限。
33
+
34
+ ## 执行 episode + 归因 schema(DS-03)
35
+
36
+ 一次失败可能来自 Skill 本身、执行偏差、平台差异、缺失权限、仓库历史债务或输入不足。每项不足按下列字段归因分层:
37
+
38
+ ```yaml
39
+ skill: "" # 被审查的 Skill 名
40
+ expected_job: "" # 该 Skill 本应完成的工作
41
+ observed_episode: "" # 本 session 中实际发生的片段(带证据指针)
42
+ outcome: helped # helped | partial | failed | not_used
43
+ friction: "" # 摩擦点描述
44
+ attribution: skill_logic # skill_logic | execution | platform | permission | input | repository_debt | unknown
45
+ evidence: [] # 可见证据指针
46
+ confidence: high # high | medium | low
47
+ recommended_change: "" # 建议的最小改动
48
+ ```
49
+
50
+ 归因分层是关键:`execution`(本次执行偏差)、`platform`(平台差异)、`input`(输入不足)等**不应**导致修改 Skill 逻辑;只有 `skill_logic` 才指向 Skill 本体升级。
51
+
52
+ ## 同时总结有效部分(DS-04)
53
+
54
+ 只找不足会产生负面选择偏差,甚至误删真正有效的规则。对**每个被审查 Skill** 同时输出:
55
+
56
+ - **helped / reusable strengths** — 哪些规则真正帮到了工作;
57
+ - **friction / failures** — 哪里卡住或产生返工;
58
+ - **rules to preserve** — 明确列出不应在升级中被删除的规则;
59
+ - **proposed changes** — 建议的改动;
60
+ - **regression scenario** — 用于验证改动不破坏既有有效行为的场景。
61
+
62
+ ## 既有 Skill 升级优先(DS-05)
63
+
64
+ 改进既有 Skill 优先于创建新 Skill。每项复盘结论给出一个 disposition:
65
+
66
+ | Disposition | 含义 |
67
+ |---|---|
68
+ | `KEEP_AS_IS` | 表现良好,无需改动 |
69
+ | `UPDATE_EXISTING_SKILL` | 升级既有 Skill 的正文/规则(首选) |
70
+ | `UPDATE_SCRIPT_OR_REFERENCE` | 只需改脚本或 reference |
71
+ | `UPDATE_ROUTING_OR_ENTRY` | 只需改路由表或入口文档 |
72
+ | `CREATE_COMPLEMENTARY_SKILL` | 确需新建互补 Skill |
73
+ | `EXECUTION_ONLY_LEARNING` | 属执行经验,不改 Skill 本体 |
74
+ | `INSUFFICIENT_EVIDENCE` | 证据不足,记录待观察 |
75
+
76
+ ## 输出(并入主 Output Contract)
77
+
78
+ 在审计输出中新增一段 `Current-session Skill performance`,对每个被审查 Skill 给出:可见范围声明 → episode 归因表 → strengths/preserve → weaknesses → disposition + 建议最小改动 + regression scenario。改动建议移交实现时,仍遵守 discover 的授权边界(不自动创建/修改/commit)。
@@ -0,0 +1,24 @@
1
+ # Software development opportunity patterns
2
+
3
+ ## High-value recurring clusters
4
+
5
+ | Cluster | Evidence signals | Likely reusable contents | Validation |
6
+ |---|---|---|---|
7
+ | Repository onboarding and context reconstruction | Repeated architecture scans, conventions rediscovered, same setup questions | architecture map, search workflow, project conventions | required paths and commands resolve |
8
+ | Issue reproduction and debugging | Similar log collection, environment checks, hypothesis loops | diagnostic decision tree, log parsers, repro template | failing test or repro becomes deterministic |
9
+ | Code review and release gates | Repeated review criteria, missed checks, release checklists | review rubric, CI scripts, release template | tests, lint, security and artifact checks pass |
10
+ | Cross-platform configuration synchronization | Equivalent files drift across platforms | mapping reference, sync script, diff guard | mirrors and entry docs agree |
11
+ | Migration and dependency upgrades | Same compatibility research and staged rollout | migration playbook, codemods, rollback checklist | tests and compatibility matrix pass |
12
+ | Incident response and postmortems | Recurring triage, timelines, action tracking | severity rubric, evidence collector, postmortem template | timeline and actions are complete |
13
+
14
+ ## Good skill boundaries
15
+
16
+ Package reasoning plus repository-specific conventions, tool commands, and quality gates. Split by materially different stacks or deployment risks. Prefer a script alone for deterministic formatting or file copying; prefer CI configuration for checks that must always run.
17
+
18
+ ## Candidate evidence
19
+
20
+ Look for repeated shell commands, copied review comments, recurring missing context, nearly identical tickets, release regressions, or manual comparisons across files. Distinguish maintenance of a single repository from a reusable multi-project workflow.
21
+
22
+ ## Risk controls
23
+
24
+ Require explicit authorization for destructive commands, production changes, releases, commits, pushes, credential operations, and external messages. Preserve user changes and define rollback or degraded behavior.