@flydocs/cli 0.6.0-alpha.13 → 0.6.0-alpha.20

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 (152) hide show
  1. package/dist/cli.js +281 -256
  2. package/package.json +1 -1
  3. package/template/.claude/CLAUDE.md +62 -66
  4. package/template/.claude/agents/implementation-agent.md +1 -1
  5. package/template/.claude/agents/pm-agent.md +1 -1
  6. package/template/.claude/commands/activate.md +1 -1
  7. package/template/.claude/commands/attach.md +1 -1
  8. package/template/.claude/commands/block.md +2 -2
  9. package/template/.claude/commands/capture.md +1 -1
  10. package/template/.claude/commands/close.md +1 -1
  11. package/template/.claude/commands/flydocs-setup.md +261 -58
  12. package/template/.claude/commands/flydocs-upgrade.md +26 -27
  13. package/template/.claude/commands/implement.md +1 -1
  14. package/template/.claude/commands/new-project.md +1 -1
  15. package/template/.claude/commands/onboard.md +275 -0
  16. package/template/.claude/commands/project-update.md +1 -1
  17. package/template/.claude/commands/refine.md +1 -1
  18. package/template/.claude/commands/review.md +1 -1
  19. package/template/.claude/commands/start-session.md +1 -1
  20. package/template/.claude/commands/status.md +1 -1
  21. package/template/.claude/commands/validate.md +1 -1
  22. package/template/.claude/commands/wrap-session.md +1 -1
  23. package/template/.claude/hooks/auto-approve.py +132 -0
  24. package/template/.claude/hooks/post-pr-check.py +108 -0
  25. package/template/.claude/hooks/post-transition-check.py +94 -0
  26. package/template/{.flydocs → .claude}/hooks/prompt-submit.py +167 -17
  27. package/template/.claude/hooks/session-start.py +146 -0
  28. package/template/.claude/hooks/stop-gate.py +109 -0
  29. package/template/.claude/settings.json +41 -4
  30. package/template/.claude/skills/README.md +23 -25
  31. package/template/.claude/skills/flydocs-workflow/SKILL.md +121 -34
  32. package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +9 -8
  33. package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +28 -17
  34. package/template/.claude/skills/flydocs-workflow/reference/graph-schema.md +116 -0
  35. package/template/.claude/skills/flydocs-workflow/reference/pr-workflow.md +30 -15
  36. package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +1 -1
  37. package/template/.claude/skills/flydocs-workflow/reference/service-descriptor-schema.md +251 -0
  38. package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +26 -26
  39. package/template/.claude/skills/flydocs-workflow/scripts/_local/__init__.py +0 -0
  40. package/template/.claude/skills/{flydocs-local/scripts/flydocs_api.py → flydocs-workflow/scripts/_local/file_store.py} +133 -46
  41. package/template/.claude/skills/flydocs-workflow/scripts/flydocs_api.py +693 -0
  42. package/template/{.flydocs → .claude/skills/flydocs-workflow}/scripts/generate_manifest.py +4 -4
  43. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_build.py +132 -1
  44. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_query.py +18 -5
  45. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_session.py +1 -1
  46. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_update.py +4 -4
  47. package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_utils.py +2 -1
  48. package/template/.claude/skills/flydocs-workflow/scripts/issues.py +489 -0
  49. package/template/.claude/skills/flydocs-workflow/scripts/projects.py +144 -0
  50. package/template/.claude/skills/flydocs-workflow/scripts/pull_services.py +128 -0
  51. package/template/.claude/skills/flydocs-workflow/scripts/push_service.py +132 -0
  52. package/template/.claude/skills/flydocs-workflow/scripts/session.py +54 -0
  53. package/template/.claude/skills/flydocs-workflow/scripts/workspace.py +860 -0
  54. package/template/.claude/skills/flydocs-workflow/session.md +16 -11
  55. package/template/.claude/skills/flydocs-workflow/stages/activate.md +13 -8
  56. package/template/.claude/skills/flydocs-workflow/stages/capture.md +4 -4
  57. package/template/.claude/skills/flydocs-workflow/stages/close.md +1 -1
  58. package/template/.claude/skills/flydocs-workflow/stages/implement.md +7 -7
  59. package/template/.claude/skills/flydocs-workflow/stages/refine.md +5 -5
  60. package/template/.claude/skills/flydocs-workflow/stages/review.md +2 -2
  61. package/template/.claude/skills/flydocs-workflow/stages/validate.md +3 -1
  62. package/template/.claude/skills/flydocs-workflow/templates/pr/default.md +33 -0
  63. package/template/.cursor/agents/implementation-agent.md +1 -1
  64. package/template/.cursor/agents/pm-agent.md +2 -2
  65. package/template/.cursor/hooks.json +10 -3
  66. package/template/.env.example +6 -6
  67. package/template/.flydocs/config.json +2 -1
  68. package/template/.flydocs/templates/README.md +13 -14
  69. package/template/.flydocs/templates/quick-capture.md +4 -8
  70. package/template/.flydocs/version +1 -1
  71. package/template/AGENTS.md +39 -32
  72. package/template/flydocs/README.md +1 -3
  73. package/template/flydocs/context/project.md +6 -3
  74. package/template/flydocs/design-system/README.md +3 -3
  75. package/template/manifest.json +17 -19
  76. package/template/.claude/skills/flydocs-cloud/SKILL.md +0 -138
  77. package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +0 -50
  78. package/template/.claude/skills/flydocs-cloud/scripts/assign.py +0 -28
  79. package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +0 -28
  80. package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +0 -22
  81. package/template/.claude/skills/flydocs-cloud/scripts/comment.py +0 -29
  82. package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +0 -83
  83. package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +0 -35
  84. package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +0 -33
  85. package/template/.claude/skills/flydocs-cloud/scripts/create_team.py +0 -39
  86. package/template/.claude/skills/flydocs-cloud/scripts/delete_milestone.py +0 -21
  87. package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +0 -33
  88. package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +0 -241
  89. package/template/.claude/skills/flydocs-cloud/scripts/generate_config.py +0 -125
  90. package/template/.claude/skills/flydocs-cloud/scripts/get_estimate_scale.py +0 -23
  91. package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +0 -24
  92. package/template/.claude/skills/flydocs-cloud/scripts/get_me.py +0 -103
  93. package/template/.claude/skills/flydocs-cloud/scripts/link.py +0 -28
  94. package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +0 -28
  95. package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +0 -44
  96. package/template/.claude/skills/flydocs-cloud/scripts/list_labels.py +0 -19
  97. package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +0 -28
  98. package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +0 -31
  99. package/template/.claude/skills/flydocs-cloud/scripts/list_providers.py +0 -19
  100. package/template/.claude/skills/flydocs-cloud/scripts/list_statuses.py +0 -19
  101. package/template/.claude/skills/flydocs-cloud/scripts/list_teams.py +0 -19
  102. package/template/.claude/skills/flydocs-cloud/scripts/priority.py +0 -29
  103. package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +0 -45
  104. package/template/.claude/skills/flydocs-cloud/scripts/refresh_labels.py +0 -87
  105. package/template/.claude/skills/flydocs-cloud/scripts/set_identity.py +0 -54
  106. package/template/.claude/skills/flydocs-cloud/scripts/set_labels.py +0 -54
  107. package/template/.claude/skills/flydocs-cloud/scripts/set_preferences.py +0 -49
  108. package/template/.claude/skills/flydocs-cloud/scripts/set_provider.py +0 -31
  109. package/template/.claude/skills/flydocs-cloud/scripts/set_status_mapping.py +0 -57
  110. package/template/.claude/skills/flydocs-cloud/scripts/set_team.py +0 -28
  111. package/template/.claude/skills/flydocs-cloud/scripts/transition.py +0 -26
  112. package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +0 -36
  113. package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +0 -100
  114. package/template/.claude/skills/flydocs-cloud/scripts/update_milestone.py +0 -42
  115. package/template/.claude/skills/flydocs-cloud/scripts/validate_setup.py +0 -120
  116. package/template/.claude/skills/flydocs-context-graph/SKILL.md +0 -94
  117. package/template/.claude/skills/flydocs-context-graph/schema.md +0 -78
  118. package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +0 -338
  119. package/template/.claude/skills/flydocs-context7/SKILL.md +0 -105
  120. package/template/.claude/skills/flydocs-context7/cursor-rule.mdc +0 -49
  121. package/template/.claude/skills/flydocs-context7/scripts/context7.py +0 -293
  122. package/template/.claude/skills/flydocs-estimates/SKILL.md +0 -384
  123. package/template/.claude/skills/flydocs-figma/SKILL.md +0 -377
  124. package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +0 -108
  125. package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +0 -112
  126. package/template/.claude/skills/flydocs-local/SKILL.md +0 -103
  127. package/template/.claude/skills/flydocs-local/cursor-rule.mdc +0 -43
  128. package/template/.claude/skills/flydocs-local/scripts/assign.py +0 -29
  129. package/template/.claude/skills/flydocs-local/scripts/comment.py +0 -27
  130. package/template/.claude/skills/flydocs-local/scripts/create_issue.py +0 -44
  131. package/template/.claude/skills/flydocs-local/scripts/estimate.py +0 -37
  132. package/template/.claude/skills/flydocs-local/scripts/get_issue.py +0 -20
  133. package/template/.claude/skills/flydocs-local/scripts/link.py +0 -41
  134. package/template/.claude/skills/flydocs-local/scripts/list_issues.py +0 -50
  135. package/template/.claude/skills/flydocs-local/scripts/priority.py +0 -37
  136. package/template/.claude/skills/flydocs-local/scripts/project_update.py +0 -67
  137. package/template/.claude/skills/flydocs-local/scripts/status_summary.py +0 -16
  138. package/template/.claude/skills/flydocs-local/scripts/transition.py +0 -24
  139. package/template/.claude/skills/flydocs-local/scripts/update_description.py +0 -35
  140. package/template/.claude/skills/flydocs-local/scripts/update_issue.py +0 -84
  141. package/template/.flydocs/hooks/auto-approve.py +0 -71
  142. package/template/.flydocs/scripts/skill_manager.py +0 -541
  143. package/template/.flydocs/templates/bug.md +0 -166
  144. package/template/.flydocs/templates/chore.md +0 -110
  145. package/template/.flydocs/templates/feature.md +0 -173
  146. package/template/.flydocs/templates/idea.md +0 -122
  147. /package/template/{.flydocs → .claude}/hooks/post-edit.py +0 -0
  148. /package/template/.claude/skills/{flydocs-estimates/references → flydocs-workflow/reference}/provider-costs.md +0 -0
  149. /package/template/.claude/skills/flydocs-workflow/templates/{bug.md → issues/bug.md} +0 -0
  150. /package/template/.claude/skills/flydocs-workflow/templates/{chore.md → issues/chore.md} +0 -0
  151. /package/template/.claude/skills/flydocs-workflow/templates/{feature.md → issues/feature.md} +0 -0
  152. /package/template/.claude/skills/flydocs-workflow/templates/{idea.md → issues/idea.md} +0 -0
@@ -1,100 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Bulk update an issue — set multiple fields in a single API call."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json, fail
10
-
11
-
12
- def main():
13
- parser = argparse.ArgumentParser(description="Update issue fields")
14
- parser.add_argument("ref", help="Issue reference (e.g., ENG-123)")
15
- parser.add_argument("--title", default=None)
16
- parser.add_argument("--priority", type=int, help="Priority (0-4, relay translates per provider)")
17
- parser.add_argument("--estimate", type=int, help="Estimate points (relay translates per provider)")
18
- parser.add_argument("--assignee", default=None)
19
- parser.add_argument("--state", default=None)
20
- parser.add_argument("--description", default=None)
21
- parser.add_argument("--description-file", default=None)
22
- parser.add_argument("--labels", default=None, help="Comma-separated label names")
23
- parser.add_argument("--milestone", default=None, help="Milestone ID or name (resolved by name lookup)")
24
- parser.add_argument("--comment", default=None)
25
- args = parser.parse_args()
26
-
27
- # Build request body from provided args
28
- body: dict = {}
29
- updated_fields: list[str] = []
30
-
31
- if args.title is not None:
32
- body["title"] = args.title
33
- updated_fields.append("title")
34
-
35
- if args.priority is not None:
36
- body["priority"] = args.priority
37
- updated_fields.append("priority")
38
-
39
- if args.estimate is not None:
40
- body["estimate"] = args.estimate
41
- updated_fields.append("estimate")
42
-
43
- if args.assignee is not None:
44
- body["assignee"] = args.assignee
45
- updated_fields.append("assignee")
46
-
47
- if args.state is not None:
48
- body["state"] = args.state.upper()
49
- updated_fields.append("state")
50
-
51
- if args.description_file is not None:
52
- path = Path(args.description_file)
53
- if not path.exists():
54
- fail(f"File not found: {args.description_file}")
55
- body["description"] = path.read_text()
56
- updated_fields.append("description")
57
- elif args.description is not None:
58
- body["description"] = args.description
59
- updated_fields.append("description")
60
-
61
- if args.labels is not None:
62
- body["labels"] = [l.strip() for l in args.labels.split(",") if l.strip()]
63
- updated_fields.append("labels")
64
-
65
- if args.comment is not None:
66
- body["comment"] = args.comment
67
- updated_fields.append("comment")
68
-
69
- if not body and args.milestone is None:
70
- fail("No fields to update. Use --title, --priority, --estimate, --assignee, --state, --description, --labels, --milestone, or --comment")
71
-
72
- client = get_client()
73
-
74
- if args.milestone is not None:
75
- milestone_id = args.milestone
76
- # If it doesn't look like a UUID, resolve by name
77
- if len(milestone_id) != 36 or "-" not in milestone_id:
78
- milestones = client.get("/milestones")
79
- match = None
80
- for m in milestones:
81
- if m["name"].lower() == milestone_id.lower():
82
- match = m
83
- break
84
- if not match:
85
- fail(f"Milestone not found: {milestone_id}")
86
- milestone_id = match["id"]
87
- body["milestoneId"] = milestone_id
88
- updated_fields.append("milestone")
89
-
90
- result = client.patch(f"/issues/{args.ref}", body)
91
-
92
- output_json({
93
- "success": result.get("success", True),
94
- "issue": result.get("issue", args.ref),
95
- "updated": updated_fields,
96
- })
97
-
98
-
99
- if __name__ == "__main__":
100
- main()
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Update a milestone via the FlyDocs Relay API."""
3
-
4
- import argparse
5
- import sys
6
- from pathlib import Path
7
-
8
- sys.path.insert(0, str(Path(__file__).parent))
9
- from flydocs_api import get_client, output_json, fail
10
-
11
-
12
- def main():
13
- parser = argparse.ArgumentParser(description="Update milestone")
14
- parser.add_argument("milestone_id", help="Milestone UUID")
15
- parser.add_argument("--name", default=None)
16
- parser.add_argument("--target-date", default=None, dest="target_date")
17
- parser.add_argument("--description", default=None)
18
- args = parser.parse_args()
19
-
20
- body: dict = {}
21
- if args.name is not None:
22
- body["name"] = args.name
23
- if args.target_date is not None:
24
- body["targetDate"] = args.target_date
25
- if args.description is not None:
26
- body["description"] = args.description
27
-
28
- if not body:
29
- fail("No fields to update. Use --name, --target-date, or --description")
30
-
31
- client = get_client()
32
- result = client.patch(f"/milestones/{args.milestone_id}", body)
33
-
34
- output_json({
35
- "success": result.get("success", True),
36
- "id": result.get("id", args.milestone_id),
37
- "name": result.get("name", args.name),
38
- })
39
-
40
-
41
- if __name__ == "__main__":
42
- main()
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Validate workspace setup via the FlyDocs Relay API.
3
-
4
- Read-only validation that calls GET /auth/config. The relay returns:
5
- - valid: bool (all required checks pass)
6
- - missing: ["provider", "statusMapping", ...] (required, blocks setup)
7
- - warnings: ["repos", ...] (optional, informational)
8
-
9
- Writes result to .flydocs/validation-cache.json and sets
10
- setupComplete: true in config when valid is true.
11
- """
12
-
13
- import json
14
- import sys
15
- from datetime import datetime, timezone
16
- from pathlib import Path
17
-
18
- sys.path.insert(0, str(Path(__file__).parent))
19
- from flydocs_api import get_client, output_json, fail
20
-
21
-
22
- # Human-readable messages for missing/warning items
23
- CHECK_MESSAGES: dict[str, str] = {
24
- "provider": "No provider connected — configure in FlyDocs dashboard",
25
- "team": "No team selected — configure in FlyDocs dashboard",
26
- "statusMapping": "Status mapping not configured — configure in FlyDocs dashboard",
27
- "labelConfig": "Label config not configured — configure in FlyDocs dashboard",
28
- "userIdentity": (
29
- "Provider identity not linked — run: "
30
- "python3 .claude/skills/flydocs-cloud/scripts/set_identity.py <provider> <id>"
31
- ),
32
- "repos": "No repos linked — GitHub features won't work until you push and link a repo",
33
- }
34
-
35
- DEFAULT_MESSAGE = "Not configured — check FlyDocs dashboard"
36
-
37
-
38
- def main() -> None:
39
- client = get_client()
40
-
41
- # Fetch workspace config from relay — relay does the validation
42
- config_response = client.get("/auth/config")
43
-
44
- # Read relay-computed validation results
45
- is_valid = config_response.get("valid", False)
46
- missing_keys: list[str] = config_response.get("missing", [])
47
- warning_keys: list[str] = config_response.get("warnings", [])
48
-
49
- # Build structured missing/warning lists with messages
50
- missing = [
51
- {"check": k, "action": CHECK_MESSAGES.get(k, DEFAULT_MESSAGE)}
52
- for k in missing_keys
53
- ]
54
- warnings = [
55
- {"check": k, "action": CHECK_MESSAGES.get(k, DEFAULT_MESSAGE)}
56
- for k in warning_keys
57
- ]
58
-
59
- # Build checks map for cache
60
- all_keys = set(CHECK_MESSAGES.keys())
61
- checks: dict[str, bool] = {}
62
- for k in all_keys:
63
- checks[k] = k not in missing_keys and k not in warning_keys
64
-
65
- # Build workspace info from response
66
- workspace = config_response.get("workspace", {})
67
- provider_type = config_response.get("provider", {}).get("type", "unknown")
68
-
69
- # Write validation cache
70
- cache = {
71
- "timestamp": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
72
- "valid": is_valid,
73
- "workspace": {
74
- "id": workspace.get("id", ""),
75
- "name": workspace.get("name", ""),
76
- },
77
- "provider": provider_type,
78
- "checks": checks,
79
- "missing": missing_keys,
80
- "warnings": warning_keys,
81
- }
82
-
83
- cache_path = client.project_root / ".flydocs" / "validation-cache.json"
84
- cache_path.parent.mkdir(parents=True, exist_ok=True)
85
- with open(cache_path, "w") as f:
86
- json.dump(cache, f, indent=2)
87
- f.write("\n")
88
-
89
- # If all required checks pass, set setupComplete in config
90
- if is_valid:
91
- config_path = client.config_path
92
- if config_path.exists():
93
- with open(config_path, "r") as f:
94
- local_config = json.load(f)
95
- else:
96
- local_config = {}
97
-
98
- local_config["setupComplete"] = True
99
- with open(config_path, "w") as f:
100
- json.dump(local_config, f, indent=2)
101
- f.write("\n")
102
-
103
- # Output structured report
104
- report: dict = {
105
- "valid": is_valid,
106
- "checks": checks,
107
- "passed": [k for k, v in checks.items() if v],
108
- }
109
- if missing:
110
- report["missing"] = missing
111
- if warnings:
112
- report["warnings"] = warnings
113
- if is_valid:
114
- report["setupComplete"] = True
115
-
116
- output_json(report)
117
-
118
-
119
- if __name__ == "__main__":
120
- main()
@@ -1,94 +0,0 @@
1
- ---
2
- name: flydocs-context-graph
3
- description: |
4
- Project knowledge graph — relationship-aware context assembly from skills,
5
- ADRs, issues, modules, and sessions. Use when navigating dependencies,
6
- understanding impact, or assembling session context.
7
- triggers:
8
- - context graph
9
- - knowledge graph
10
- - graph
11
- - dependencies
12
- - impact analysis
13
- - session context
14
- - related decisions
15
- ---
16
-
17
- # Context Graph
18
-
19
- On-demand query layer for structural relationships in the project knowledge
20
- graph. Use graph scripts to explore dependencies, impact, and cross-references
21
- between skills, ADRs, issues, and sessions.
22
-
23
- The graph is **not** auto-injected into prompts. The prompt hook reads
24
- lightweight orientation files directly (`.flydocs/session/last-summary.json`,
25
- `flydocs/context/project.md`). Use the graph scripts below when you need
26
- deeper structural queries — relationship traversal, impact analysis, or
27
- dependency chains.
28
-
29
- ## Key Rules
30
-
31
- 1. **Graph is derived, not authored.** Run `graph_build.py` to rebuild from
32
- source files. Manual edges use `graph_update.py` and are preserved on rebuild.
33
- 2. **Stdlib-only Python.** No external dependencies in any script.
34
- 3. **JSON storage.** Graph lives at `flydocs/context/graph.json` — no database.
35
- 4. **Gitignored.** The graph contains session-specific data. Rebuild from sources.
36
-
37
- ## Script Catalog
38
-
39
- All scripts: `python3 .claude/skills/flydocs-context-graph/scripts/<script>`
40
-
41
- | Script | Usage | Output |
42
- | ------------------ | -------------------------------------------------------------------- | ---------------------------------------------------- |
43
- | `graph_build.py` | `[--root PATH]` | Rebuild graph from skills, ADRs. Writes `graph.json` |
44
- | `graph_query.py` | `--node ID [--depth N] [--rel TYPE] [--reverse] [--format json\|md]` | Context block (markdown or JSON) |
45
- | `graph_update.py` | `add-node ID --type TYPE [--label STR] [--path STR]` | `{success, node}` |
46
- | | `remove-node ID` | `{success, removed}` |
47
- | | `add-edge FROM TO REL [--weight N] [--manual]` | `{success, edge}` |
48
- | | `remove-edge FROM TO REL` | `{success, removed}` |
49
- | `graph_context.py` | `[--issue REF] [--branch NAME]` | Plain text context block for prime hook |
50
- | `graph_session.py` | `--summary "..." [--issue REF]... [--decision NNN]...` | `{success, sessionId, edges[]}` |
51
-
52
- ### Script Notes
53
-
54
- - **`graph_build.py`**: Scans `.claude/skills/*/SKILL.md` and
55
- `flydocs/knowledge/decisions/*.md`. Extracts cross-references from ADR
56
- "Relationship to Other ADRs" sections. Preserves edges marked `"manual": true`.
57
- - **`graph_query.py --depth`**: BFS traversal depth (default 2). Higher depth
58
- returns more context but may be noisy.
59
- - **`graph_query.py --reverse`**: Follow edges in reverse direction (who points to this node?).
60
- - **`graph_update.py --manual`**: Mark edge as manually added (preserved on rebuild).
61
- - **`graph_context.py`**: Available for manual queries. Assembles compressed
62
- context from active issue/branch traversal + recent session nodes. ~200-400 tokens max.
63
- Not called automatically by the prompt hook (replaced by direct file reads in v0.6.0).
64
- - **`graph_session.py`**: Called during session wrap. Creates a session node with
65
- WORKED_ON edges to issues. Session nodes older than 30 days get reduced weight;
66
- nodes within 7 days get full weight.
67
-
68
- ## Node Types
69
-
70
- | Type | ID Pattern | Source |
71
- | ---------- | -------------------- | -------------------- |
72
- | `skill` | `skill:{name}` | SKILL.md frontmatter |
73
- | `decision` | `decision:{number}` | ADR directory |
74
- | `issue` | `issue:{identifier}` | Issue tracker |
75
- | `module` | `module:{name}` | Manual |
76
- | `session` | `session:{date-seq}` | Session wrap |
77
- | `concept` | `concept:{name}` | Manual |
78
-
79
- ## Edge Types
80
-
81
- | Relationship | Meaning |
82
- | -------------- | -------------------------- |
83
- | `EXTENDS` | Builds on, refines |
84
- | `IMPLEMENTS` | Realizes in code/config |
85
- | `DELEGATES_TO` | Hands off execution |
86
- | `PRECEDES` | Should load/execute before |
87
- | `MODIFIES` | Changes/affects |
88
- | `WORKED_ON` | Session activity |
89
- | `PRODUCED` | Created as output |
90
- | `RELATES_TO` | General association |
91
- | `SUPERSEDES` | Replaces |
92
- | `BLOCKS` | Prevents progress |
93
-
94
- For full schema details, see `schema.md`.
@@ -1,78 +0,0 @@
1
- # Context Graph Schema
2
-
3
- Reference for the graph JSON structure stored at `flydocs/context/graph.json`.
4
-
5
- ## Top-Level Structure
6
-
7
- ```json
8
- {
9
- "version": 1,
10
- "updated": "ISO-8601 timestamp",
11
- "nodes": { "<id>": { ... } },
12
- "edges": [ { ... } ]
13
- }
14
- ```
15
-
16
- ## Node Schema
17
-
18
- ```json
19
- {
20
- "type": "skill | decision | issue | module | session | concept",
21
- "label": "Human-readable name",
22
- "path": "Relative file path (optional)",
23
- "status": "Node-specific status (optional)",
24
- "date": "ISO date for temporal nodes (optional)",
25
- "tier": "Skill tier: behavioral | mechanism | premium (optional)",
26
- "manual": true
27
- }
28
- ```
29
-
30
- **ID conventions:**
31
-
32
- | Type | Pattern | Example |
33
- |------|---------|---------|
34
- | skill | `skill:{directory-name}` | `skill:typescript-strict` |
35
- | decision | `decision:{3-digit-number}` | `decision:001` |
36
- | issue | `issue:{identifier}` | `issue:FLY-56` |
37
- | module | `module:{kebab-name}` | `module:install-script` |
38
- | session | `session:{YYYY-MM-DD-seq}` | `session:2026-02-03-a` |
39
- | concept | `concept:{kebab-name}` | `concept:progressive-disclosure` |
40
-
41
- ## Edge Schema
42
-
43
- ```json
44
- {
45
- "from": "source node ID",
46
- "to": "target node ID",
47
- "rel": "RELATIONSHIP_TYPE",
48
- "weight": 0.0-1.0,
49
- "manual": true
50
- }
51
- ```
52
-
53
- **Weight guidelines:**
54
-
55
- | Weight | Meaning |
56
- |--------|---------|
57
- | 1.0 | Direct, strong relationship |
58
- | 0.7-0.9 | Strong but indirect |
59
- | 0.4-0.6 | Moderate association |
60
- | 0.1-0.3 | Weak or tangential |
61
-
62
- **Edges with `"manual": true`** are preserved when `graph_build.py` rebuilds
63
- the graph from sources. Auto-derived edges are regenerated on each build.
64
-
65
- ## Relationship Types
66
-
67
- | Relationship | Direction | Example |
68
- |-------------|-----------|---------|
69
- | `EXTENDS` | A extends B | ADR-004 extends ADR-001 |
70
- | `IMPLEMENTS` | A implements B | Issue implements a decision |
71
- | `DELEGATES_TO` | A delegates to B | Workflow delegates to mechanism |
72
- | `PRECEDES` | A should load before B | typescript-strict precedes implementation |
73
- | `MODIFIES` | A modifies B | Issue modifies a module |
74
- | `WORKED_ON` | A worked on B | Session worked on an issue |
75
- | `PRODUCED` | A produced B | Session produced a decision |
76
- | `RELATES_TO` | A relates to B | General association |
77
- | `SUPERSEDES` | A supersedes B | New decision replaces old |
78
- | `BLOCKS` | A blocks B | Issue blocks another issue |