@drawbridge/drawbridge-agents 0.1.1 → 0.1.3

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.
@@ -3,6 +3,10 @@
3
3
  "sentry": {
4
4
  "type": "http",
5
5
  "url": "https://mcp.sentry.dev/mcp"
6
+ },
7
+ "asana": {
8
+ "type": "sse",
9
+ "url": "https://mcp.asana.com/sse"
6
10
  }
7
11
  }
8
12
  }
package/README.md CHANGED
@@ -87,13 +87,14 @@ and the knowledge graph from drifting. Everything below is committed **only in t
87
87
  reaches consumers without committing anything to them (see "Isolation").
88
88
 
89
89
  - **Family knowledge graph (Graphify).** `npx drawbridge-agents-graph` runs code-only AST
90
- extraction over every `drawbridge-*` repo and merges them into the cross-repo graph at
91
- `~/.graphify/global-graph.json`. Agents query it with the `graphify` CLI (e.g.
92
- `graphify query "…" --graph ~/.graphify/global-graph.json`) instead of grepping. The runtime is
93
- a per-machine Python tool `npm run sync` installs it (`bin/preflight-graphify.js`); set
94
- `DRAWBRIDGE_SKIP_GRAPHIFY=1` to skip in CI/headless. We deliberately do **not** run
95
- `graphify install` (it would rewrite `CLAUDE.md`); the optional `graphify-mcp` server is
96
- available if you prefer MCP.
90
+ extraction over every `drawbridge-*` repo and writes the merged graph to the committed, shared
91
+ location `drawbridge-docs/knowledge/graphs/global.json`. Agents query it with the `graphify` CLI
92
+ (e.g. `graphify query "…" --graph ../drawbridge-docs/knowledge/graphs/global.json`) instead of
93
+ grepping; refreshing is rebuild + commit in docs + `git pull` (no npm/publish cycle). The
94
+ runtime is a per-machine Python tool `npm run sync` installs it
95
+ (`bin/preflight-graphify.js`); set `DRAWBRIDGE_SKIP_GRAPHIFY=1` to skip in CI/headless. We
96
+ deliberately do **not** run `graphify install` (it would rewrite `CLAUDE.md`); the optional
97
+ `graphify-mcp` server is available if you prefer MCP.
97
98
  - **Docs linkage + validator.** Feature code carries `@story <domain>/<slug>` / `@doc
98
99
  reference/<file>#<anchor>` anchors (see `conventions/docs-linkage.md`).
99
100
  `npx drawbridge-agents-check-docs` scans every repo and fails if any anchor no longer resolves
package/bin/graph.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // Builds the family knowledge graph: runs graphify's headless AST extraction over every
3
- // drawbridge-* repo (plus drawbridge-docs and the shared @drawbridge/* packages) and merges
4
- // each into the global cross-repo graph at ~/.graphify/global-graph.json — which is what agents
5
- // query. Code-only (local AST, no API key). See conventions/graphify.md.
3
+ // drawbridge-* repo (plus drawbridge-docs and the shared @drawbridge/* packages) into graphify's
4
+ // global graph, then copies it to drawbridge-docs/knowledge/graphs/global.json — the committed,
5
+ // shared graph agents query. Code-only (local AST, no API key). See conventions/graphify.md.
6
6
  //
7
7
  // A semantic build (adds doc/paper content + INFERRED edges) needs an LLM backend: drop
8
8
  // --code-only and set an API key (e.g. ANTHROPIC_API_KEY) — slower and costs LLM calls.
@@ -12,8 +12,24 @@ const path = require('path')
12
12
  const { execFileSync } = require('child_process')
13
13
 
14
14
  const packageRoot = path.resolve(__dirname, '..')
15
- const familyRoot = path.resolve(packageRoot, '..')
16
15
  const buildDir = path.join(os.homedir(), '.graphify', 'build')
16
+ const globalGraph = path.join(os.homedir(), '.graphify', 'global-graph.json')
17
+
18
+ // The family root is the directory that contains drawbridge-docs. Walk up from cwd so this works
19
+ // whether run from the agents repo or via npx from inside a consumer's node_modules.
20
+ const findFamilyRoot = () => {
21
+ let dir = process.env.INIT_CWD || process.cwd()
22
+ for (let i = 0; i < 8; i++) {
23
+ if (fs.existsSync(path.join(dir, 'drawbridge-docs'))) return dir
24
+ const parent = path.dirname(dir)
25
+ if (parent === dir) break
26
+ dir = parent
27
+ }
28
+ return path.resolve(packageRoot, '..')
29
+ }
30
+
31
+ const familyRoot = findFamilyRoot()
32
+ const docsGraph = path.join(familyRoot, 'drawbridge-docs', 'knowledge', 'graphs', 'global.json')
17
33
 
18
34
  // The canonical family list lives in the shared settings template — single source of truth.
19
35
  const settings = JSON.parse(fs.readFileSync(path.join(packageRoot, '.claude-template', 'settings.json'), 'utf8'))
@@ -52,10 +68,17 @@ for (const name of repos) {
52
68
  [ 'extract', repoPath, '--out', path.join(buildDir, name), '--global', '--as', name, '--code-only' ],
53
69
  { stdio: 'inherit' }
54
70
  )
71
+ // graphify still drops a graphify-out/ in the target repo despite --out; remove it so the
72
+ // build never dirties a source repo (the incremental cache lives under ~/.graphify/build).
73
+ fs.rmSync(path.join(repoPath, 'graphify-out'), { recursive: true, force: true })
55
74
  built.push(name)
56
75
  }
57
76
 
58
- const globalGraph = path.join(os.homedir(), '.graphify', 'global-graph.json')
77
+ // Publish the merged global graph to the committed, shared location in drawbridge-docs.
78
+ fs.mkdirSync(path.dirname(docsGraph), { recursive: true })
79
+ fs.copyFileSync(globalGraph, docsGraph)
80
+
59
81
  console.log(`drawbridge-agents-graph: built cross-repo graph from ${ built.length } repo(s)`)
60
- console.log(` global graph: ${ globalGraph }`)
61
- console.log(' query it: graphify query "<question>" --graph ' + globalGraph)
82
+ console.log(` written to: ${ docsGraph }`)
83
+ console.log(' commit it in drawbridge-docs so the team shares one graph, then: git pull')
84
+ console.log(' query it: graphify query "<question>" --graph ' + docsGraph)
package/claude/CLAUDE.md CHANGED
@@ -13,4 +13,6 @@
13
13
  @../conventions/sentry-sdk.md
14
14
  @../conventions/app-web-forms.md
15
15
  @../conventions/docs-linkage.md
16
+ @../conventions/superpowers-docs.md
17
+ @../conventions/git-branching.md
16
18
  @../conventions/graphify.md
@@ -0,0 +1,19 @@
1
+ # Branch naming (gitflow)
2
+
3
+ Branches use the **full gitflow prefixes, always spelled out**. Never use abbreviations.
4
+
5
+ | Prefix | Use |
6
+ | --- | --- |
7
+ | `feature/<name>` | New features / changes (branched from `develop`) |
8
+ | `bugfix/<name>` | Non-urgent bug fixes |
9
+ | `hotfix/<name>` | Urgent production fixes (branched from `main`) |
10
+ | `release/<version>` | Release preparation |
11
+ | `chore/<name>` | Maintenance — dependency bumps, config, cleanup |
12
+ | `support/<name>` | Long-lived support branches |
13
+
14
+ - **Never** abbreviate: no `feat/`, `fix/`, `ci/`, `docs/`, `refactor/`, etc. Use the full word
15
+ (`feature/`, `bugfix/`, `chore/`, …).
16
+ - `<name>` is a short kebab-case description (e.g. `feature/ecosystem-knowledge-graphify`,
17
+ `chore/agents-devdep`).
18
+ - Branch from `develop` for normal work (see the integration-branch convention); `main`-only
19
+ repos like `drawbridge-docs` branch from `main`.
@@ -7,31 +7,34 @@ shared packages — built by [Graphify](https://github.com/Graphify-Labs/graphif
7
7
 
8
8
  When you need to trace behaviour that spans repos (api ↔ sync ↔ stripe ↔ app-web, who emits an
9
9
  event, what depends on a package), **query the graph instead of grepping 16 directories**. The
10
- cross-repo graph lives at `~/.graphify/global-graph.json`; point the CLI at it with `--graph`:
10
+ cross-repo graph is committed in drawbridge-docs at
11
+ `drawbridge-docs/knowledge/graphs/global.json` — a sibling of every repo, so point the CLI at it:
11
12
 
12
13
  ```sh
13
- graphify query "what connects sync change streams to the billing meter?" --graph ~/.graphify/global-graph.json
14
- graphify path "drawbridge-app-web" "drawbridge-stripe" --graph ~/.graphify/global-graph.json
15
- graphify explain "closeDraw" --graph ~/.graphify/global-graph.json
16
- graphify affected "closeDraw" --graph ~/.graphify/global-graph.json
14
+ graphify query "what connects sync change streams to the billing meter?" --graph ../drawbridge-docs/knowledge/graphs/global.json
15
+ graphify path "drawbridge-app-web" "drawbridge-stripe" --graph ../drawbridge-docs/knowledge/graphs/global.json
16
+ graphify explain "closeDraw" --graph ../drawbridge-docs/knowledge/graphs/global.json
17
+ graphify affected "closeDraw" --graph ../drawbridge-docs/knowledge/graphs/global.json
17
18
  ```
18
19
 
19
- The graph spans all sibling repos (code, via local AST). A semantic build additionally pulls in
20
- `drawbridge-docs` and richer INFERRED edges see "Refreshing it".
20
+ `git pull` in drawbridge-docs gets you the current shared graph. It spans all sibling repos
21
+ (code, via local AST); a semantic build additionally pulls in doc prose and richer INFERRED
22
+ edges — see "Refreshing it".
21
23
 
22
24
  ## Refreshing it
23
25
 
24
- The graph is as fresh as the last build. After a change that alters cross-repo structure,
25
- rebuild it:
26
+ The graph is as fresh as the last committed build. After a change that alters cross-repo
27
+ structure, rebuild and commit it:
26
28
 
27
29
  ```sh
28
- npx drawbridge-agents-graph
30
+ npx drawbridge-agents-graph # rebuilds -> drawbridge-docs/knowledge/graphs/global.json
31
+ cd ../drawbridge-docs && git add knowledge/graphs && git commit -m "chore: refresh knowledge graph"
29
32
  ```
30
33
 
31
- This re-extracts every repo (code-only, no API key) and merges them into the global graph. The
32
- drift-check hook nudges when tracked source has changed since the last build. For a semantic
33
- build that also indexes docs, run `graphify extract <repo> --global --as <repo>` with an LLM
34
- backend / API key set (slower, costs LLM calls).
34
+ Other developers just `git pull` drawbridge-docs. The drift-check hook nudges when tracked
35
+ source has changed since the committed graph was last built. For a semantic build that also
36
+ indexes docs, run `graphify extract <repo> --global --as <repo>` with an LLM backend / API key
37
+ set (slower, costs LLM calls).
35
38
 
36
39
  ## Runtime
37
40
 
@@ -0,0 +1,19 @@
1
+ # Superpowers working docs live in drawbridge-docs
2
+
3
+ All superpowers **plans** and **specs** — the outputs of the brainstorming / writing-plans /
4
+ spec workflows — live in one canonical place, at the **root** of drawbridge-docs:
5
+
6
+ ```
7
+ drawbridge-docs/superpowers/plans/YYYY-MM-DD-<slug>.md
8
+ drawbridge-docs/superpowers/specs/YYYY-MM-DD-<slug>.md
9
+ ```
10
+
11
+ This is the **only** allowed home for these working docs. Rules:
12
+
13
+ - Do **not** create or keep superpowers plans/specs (or `docs/superpowers/`, `docs/plans/`)
14
+ inside any other repo. When you finalize a plan or spec, write it under
15
+ `../drawbridge-docs/superpowers/{plans,specs}/`, not the repo you're working in.
16
+ - When plan mode or a superpowers skill produces a plan/spec, the finalized document goes into
17
+ drawbridge-docs — regardless of which repo the work targets. Note the target repo in the doc.
18
+ - `.superpowers/` (brainstorm scratch — server state, HTML mockups) is ephemeral. **Never commit
19
+ it**; it belongs in `.gitignore`.
package/graph/README.md CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  The cross-repo knowledge graph is built by `npx drawbridge-agents-graph` (`bin/graph.js`), which
4
4
  runs [Graphify](https://github.com/Graphify-Labs/graphify) headless AST extraction over every
5
- `drawbridge-*` repo and merges each into the **global** graph at
6
- `~/.graphify/global-graph.json` (per machine, not committed).
5
+ `drawbridge-*` repo and writes the merged graph to the **committed, shared** location:
7
6
 
8
- That global graph is what agents query — see `conventions/graphify.md`. There are no committed
9
- artifacts in this directory; it holds this README only. Per-repo extraction output is redirected
10
- to `~/.graphify/build/` so it never litters the source repos.
7
+ ```
8
+ drawbridge-docs/knowledge/graphs/global.json
9
+ ```
10
+
11
+ That committed file is what agents query (`--graph ../drawbridge-docs/knowledge/graphs/global.json`)
12
+ and is shared via `git pull` — see `conventions/graphify.md`. There are no graph artifacts in
13
+ this package directory; per-repo extraction output is redirected to `~/.graphify/build/` so it
14
+ never litters the source repos.
@@ -3,7 +3,6 @@
3
3
  // Blocks (must fix) on unresolved @story/@doc tags; nudges (non-blocking) on a stale graph or
4
4
  // likely doc drift. Gated so it never fires on trivial turns. See conventions/docs-linkage.md.
5
5
  const fs = require('fs')
6
- const os = require('os')
7
6
  const path = require('path')
8
7
  const { execFileSync } = require('child_process')
9
8
 
@@ -70,10 +69,11 @@ const run = () => {
70
69
  // 2. Graph freshness (non-blocking nudge) — a full re-extract is expensive, so alert rather
71
70
  // than block on every edit turn. Flip to block() if you want it enforced hard.
72
71
  if (!skipGraph) {
73
- const globalGraph = path.join(os.homedir(), '.graphify', 'global-graph.json')
72
+ // The shared graph is committed in drawbridge-docs (a sibling of this repo).
73
+ const docsGraph = path.join(path.dirname(cwd), 'drawbridge-docs', 'knowledge', 'graphs', 'global.json')
74
74
  let builtAt = 0
75
75
  try {
76
- builtAt = fs.statSync(globalGraph).mtimeMs
76
+ builtAt = fs.statSync(docsGraph).mtimeMs
77
77
  } catch (error) {
78
78
  builtAt = 0
79
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/drawbridge-agents",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared agent-instruction content (rules, code style, conventions) for the drawbridge-* monorepo.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {