跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
搜索与研究

night-market-collective-memory

Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.

athola · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add athola/claude-night-market --skill night-market-collective-memory

技能说明


name: night-market-collective-memory description: 'Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.'

Night Market Collective Memory

This repo treats GitHub Discussions as agent collective memory (ADR-0007, docs/adr/0007-github-discussions-integration.md, accepted 2026-02-19). Sessions are amnesiac by default. The memory system fixes that with four layers: Discussions (cross-session, searchable), the decision journal (append-only tradeoff and lesson logs), numbered ADRs (architecture decisions), and dated research syntheses in docs/research/. One caveat on the fourth layer: docs/research/ is gitignored and machine-local, so it exists only on the authoring machine and is empty on fresh clones. A synthesis counts as collective memory only after promotion to a Discussion, ADR, or rule. This skill tells you where each kind of knowledge lives, how to read it, and how to write to it.

One hard fact first: there is NO gh discussion subcommand. Discussions are GraphQL-only. Minister playbooks once referenced a CLI that does not exist, and ADR-0007 replaced every reference with gh api graphql calls. Never guess a gh discussion command.

Routing table: which memory layer

You haveRecord or read it via
Settled battle, revert, dead endnight-market-failure-archaeology skill (read only, do not relitigate)
Tradeoff (chose A, sacrificed B)Decision journal docs/tradeoffs.md, TR-NNN entry
Lesson, failed approach, reworkDecision journal docs/lessons-learned.md, LL-NNN entry
Architecture decisionNumbered ADR in docs/adr/ (0001-0017 exist today)
Session insight, skill stats[Learning] Discussion (auto-posted daily, see below)
Strategy debate, big design[War Room] Discussion (Decisions category)
Durable synthesis, audit result[Knowledge] Discussion (Knowledge category)
PR review finding worth keeping[PR Finding] Discussion (Learnings category)
Multi-source research outputDated file in docs/research/ (LOCAL ONLY: gitignored, absent on fresh clones). Promote durable syntheses to a [Knowledge] Discussion, ADR, or rule to make them collective memory

Retrieval discipline: search before re-investigating

Before investigating any question about this repo's history, design, or past failures, run these searches first. Re-deriving a settled answer wastes a session and risks contradicting an accepted decision.

# 1. Search Discussions by keyword (tested 2026-07-02)
gh api graphql -f query='
query($q: String!) {
  search(query: $q, type: DISCUSSION, first: 10) {
    nodes { ... on Discussion { number title url category { name } } }
  }
}' -f q='repo:athola/claude-night-market YOUR SEARCH TERMS'

# 2. Search local docs of record. Note: docs/research/ is gitignored
#    and machine-local, so it is empty on fresh clones and this
#    search only helps on the authoring machine.
rg -il "your terms" docs/research/ docs/adr/ CHANGELOG.md

# 3. Check the decision journal (if the files exist yet, see below)
rg -in "your terms" docs/tradeoffs.md docs/lessons-learned.md

Also check the night-market-failure-archaeology sibling for settled battles. A leyline SessionStart hook (plugins/leyline/hooks/fetch-recent-discussions.sh) already injects the 5 most recent Decisions discussions at session start, bounded to under 600 tokens with a 3-second timeout.

Discussion taxonomy (verified live 2026-07-02)

Repo categories include the four ADR-0007 ones (Decisions, Deliberations, Learnings, Knowledge) plus GitHub defaults. Title prefixes are the working taxonomy:

PrefixCategoryWhat it isVerified examples
[Learning]LearningsDaily digest, auto-posted#601, #602 (2026-07-01/02)
[Knowledge]KnowledgeDurable syntheses#448, #449 (April 2026 skill audit synthesis and Wave-3 backlog)
[War Room]DecisionsStrategy deliberations#222 (collective memory design), #271 (wiring publishing into workflows)
[PR Finding]LearningsReview findings worth keeping#424, #595

The [Learning] pipeline

Daily digests are auto-posted by abstract's Stop hook, part of the improvement feedback loop (Issue #69). The chain:

  1. plugins/abstract/hooks/skill_execution_logger.py (PreToolUse/PostToolUse) logs skill executions.
  2. plugins/abstract/scripts/aggregate_skill_logs.py writes ~/.claude/skills/LEARNINGS.md with skill-performance stats (skills analyzed, high-impact issues, slow and low-rated skills).
  3. plugins/abstract/hooks/post_learnings_stop.py (Stop hook, registered in plugins/abstract/hooks/hooks.json) posts a [Learning] YYYY-MM-DD digest, deduplicated by title. Opt-out: ~/.claude/skills/discussions/config.json.
  4. Promotion: 3 or more fire-emoji reactions on a Learnings discussion promote it to a GitHub Issue via plugins/abstract/scripts/promote_discussion_to_issue.py (default threshold 3, configurable via promotion_threshold).

Reading Discussions (tested queries)

List recent discussions, newest first (tested 2026-07-02, returned #602 and siblings):

gh api graphql -f query='
query($owner: String!, $name: String!) {
  repository(owner: $owner, name: $name) {
    discussions(first: 10,
                orderBy: {field: CREATED_AT, direction: DESC}) {
      nodes { number title category { name } createdAt url }
    }
  }
}' -f owner=athola -f name=claude-night-market

Fetch one discussion by number. The number is a GraphQL Int, so pass it with -F (typed), not -f (string). Passing -f fails with a type error:

gh api graphql -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    discussion(number: $number) {
      title body url cat
阅读完整来源 ↗