gsd-code-first 1.0.0
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.
- package/LICENSE +21 -0
- package/README.ja-JP.md +834 -0
- package/README.ko-KR.md +823 -0
- package/README.md +937 -0
- package/README.pt-BR.md +452 -0
- package/README.zh-CN.md +800 -0
- package/agents/gsd-advisor-researcher.md +104 -0
- package/agents/gsd-annotator.md +148 -0
- package/agents/gsd-arc-executor.md +537 -0
- package/agents/gsd-arc-planner.md +374 -0
- package/agents/gsd-assumptions-analyzer.md +105 -0
- package/agents/gsd-code-planner.md +155 -0
- package/agents/gsd-codebase-mapper.md +770 -0
- package/agents/gsd-debugger.md +1373 -0
- package/agents/gsd-executor.md +509 -0
- package/agents/gsd-integration-checker.md +443 -0
- package/agents/gsd-nyquist-auditor.md +176 -0
- package/agents/gsd-phase-researcher.md +698 -0
- package/agents/gsd-plan-checker.md +773 -0
- package/agents/gsd-planner.md +1354 -0
- package/agents/gsd-project-researcher.md +654 -0
- package/agents/gsd-prototyper.md +161 -0
- package/agents/gsd-research-synthesizer.md +247 -0
- package/agents/gsd-roadmapper.md +679 -0
- package/agents/gsd-ui-auditor.md +439 -0
- package/agents/gsd-ui-checker.md +300 -0
- package/agents/gsd-ui-researcher.md +357 -0
- package/agents/gsd-user-profiler.md +171 -0
- package/agents/gsd-verifier.md +700 -0
- package/bin/install.js +5009 -0
- package/commands/gsd/add-backlog.md +76 -0
- package/commands/gsd/add-phase.md +43 -0
- package/commands/gsd/add-tests.md +41 -0
- package/commands/gsd/add-todo.md +47 -0
- package/commands/gsd/annotate.md +54 -0
- package/commands/gsd/audit-milestone.md +36 -0
- package/commands/gsd/audit-uat.md +24 -0
- package/commands/gsd/autonomous.md +41 -0
- package/commands/gsd/check-todos.md +45 -0
- package/commands/gsd/cleanup.md +18 -0
- package/commands/gsd/complete-milestone.md +136 -0
- package/commands/gsd/debug.md +173 -0
- package/commands/gsd/deep-plan.md +52 -0
- package/commands/gsd/discuss-phase.md +64 -0
- package/commands/gsd/do.md +30 -0
- package/commands/gsd/execute-phase.md +59 -0
- package/commands/gsd/extract-plan.md +35 -0
- package/commands/gsd/fast.md +30 -0
- package/commands/gsd/forensics.md +56 -0
- package/commands/gsd/health.md +22 -0
- package/commands/gsd/help.md +22 -0
- package/commands/gsd/insert-phase.md +32 -0
- package/commands/gsd/iterate.md +124 -0
- package/commands/gsd/join-discord.md +18 -0
- package/commands/gsd/list-phase-assumptions.md +46 -0
- package/commands/gsd/list-workspaces.md +19 -0
- package/commands/gsd/manager.md +39 -0
- package/commands/gsd/map-codebase.md +71 -0
- package/commands/gsd/milestone-summary.md +51 -0
- package/commands/gsd/new-milestone.md +44 -0
- package/commands/gsd/new-project.md +42 -0
- package/commands/gsd/new-workspace.md +44 -0
- package/commands/gsd/next.md +24 -0
- package/commands/gsd/note.md +34 -0
- package/commands/gsd/pause-work.md +38 -0
- package/commands/gsd/plan-milestone-gaps.md +34 -0
- package/commands/gsd/plan-phase.md +47 -0
- package/commands/gsd/plant-seed.md +28 -0
- package/commands/gsd/pr-branch.md +25 -0
- package/commands/gsd/profile-user.md +46 -0
- package/commands/gsd/progress.md +24 -0
- package/commands/gsd/prototype.md +56 -0
- package/commands/gsd/quick.md +47 -0
- package/commands/gsd/reapply-patches.md +123 -0
- package/commands/gsd/remove-phase.md +31 -0
- package/commands/gsd/remove-workspace.md +26 -0
- package/commands/gsd/research-phase.md +195 -0
- package/commands/gsd/resume-work.md +40 -0
- package/commands/gsd/review-backlog.md +61 -0
- package/commands/gsd/review.md +37 -0
- package/commands/gsd/session-report.md +19 -0
- package/commands/gsd/set-mode.md +41 -0
- package/commands/gsd/set-profile.md +12 -0
- package/commands/gsd/settings.md +36 -0
- package/commands/gsd/ship.md +23 -0
- package/commands/gsd/stats.md +18 -0
- package/commands/gsd/thread.md +127 -0
- package/commands/gsd/ui-phase.md +34 -0
- package/commands/gsd/ui-review.md +32 -0
- package/commands/gsd/update.md +37 -0
- package/commands/gsd/validate-phase.md +35 -0
- package/commands/gsd/verify-work.md +38 -0
- package/commands/gsd/workstreams.md +63 -0
- package/get-shit-done/bin/gsd-tools.cjs +946 -0
- package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
- package/get-shit-done/bin/lib/commands.cjs +959 -0
- package/get-shit-done/bin/lib/config.cjs +466 -0
- package/get-shit-done/bin/lib/core.cjs +1230 -0
- package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
- package/get-shit-done/bin/lib/init.cjs +1442 -0
- package/get-shit-done/bin/lib/milestone.cjs +252 -0
- package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
- package/get-shit-done/bin/lib/phase.cjs +888 -0
- package/get-shit-done/bin/lib/profile-output.cjs +952 -0
- package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
- package/get-shit-done/bin/lib/roadmap.cjs +329 -0
- package/get-shit-done/bin/lib/security.cjs +382 -0
- package/get-shit-done/bin/lib/state.cjs +1031 -0
- package/get-shit-done/bin/lib/template.cjs +222 -0
- package/get-shit-done/bin/lib/uat.cjs +282 -0
- package/get-shit-done/bin/lib/verify.cjs +888 -0
- package/get-shit-done/bin/lib/workstream.cjs +491 -0
- package/get-shit-done/commands/gsd/workstreams.md +63 -0
- package/get-shit-done/references/arc-standard.md +315 -0
- package/get-shit-done/references/checkpoints.md +778 -0
- package/get-shit-done/references/continuation-format.md +249 -0
- package/get-shit-done/references/decimal-phase-calculation.md +64 -0
- package/get-shit-done/references/git-integration.md +295 -0
- package/get-shit-done/references/git-planning-commit.md +38 -0
- package/get-shit-done/references/model-profile-resolution.md +36 -0
- package/get-shit-done/references/model-profiles.md +139 -0
- package/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/get-shit-done/references/planning-config.md +202 -0
- package/get-shit-done/references/questioning.md +162 -0
- package/get-shit-done/references/tdd.md +263 -0
- package/get-shit-done/references/ui-brand.md +160 -0
- package/get-shit-done/references/user-profiling.md +681 -0
- package/get-shit-done/references/verification-patterns.md +612 -0
- package/get-shit-done/references/workstream-flag.md +58 -0
- package/get-shit-done/templates/DEBUG.md +164 -0
- package/get-shit-done/templates/UAT.md +265 -0
- package/get-shit-done/templates/UI-SPEC.md +100 -0
- package/get-shit-done/templates/VALIDATION.md +76 -0
- package/get-shit-done/templates/claude-md.md +122 -0
- package/get-shit-done/templates/codebase/architecture.md +255 -0
- package/get-shit-done/templates/codebase/concerns.md +310 -0
- package/get-shit-done/templates/codebase/conventions.md +307 -0
- package/get-shit-done/templates/codebase/integrations.md +280 -0
- package/get-shit-done/templates/codebase/stack.md +186 -0
- package/get-shit-done/templates/codebase/structure.md +285 -0
- package/get-shit-done/templates/codebase/testing.md +480 -0
- package/get-shit-done/templates/config.json +44 -0
- package/get-shit-done/templates/context.md +352 -0
- package/get-shit-done/templates/continue-here.md +78 -0
- package/get-shit-done/templates/copilot-instructions.md +7 -0
- package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
- package/get-shit-done/templates/dev-preferences.md +21 -0
- package/get-shit-done/templates/discovery.md +146 -0
- package/get-shit-done/templates/discussion-log.md +63 -0
- package/get-shit-done/templates/milestone-archive.md +123 -0
- package/get-shit-done/templates/milestone.md +115 -0
- package/get-shit-done/templates/phase-prompt.md +610 -0
- package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
- package/get-shit-done/templates/project.md +186 -0
- package/get-shit-done/templates/requirements.md +231 -0
- package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
- package/get-shit-done/templates/research-project/FEATURES.md +147 -0
- package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
- package/get-shit-done/templates/research-project/STACK.md +120 -0
- package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
- package/get-shit-done/templates/research.md +552 -0
- package/get-shit-done/templates/retrospective.md +54 -0
- package/get-shit-done/templates/roadmap.md +202 -0
- package/get-shit-done/templates/state.md +176 -0
- package/get-shit-done/templates/summary-complex.md +59 -0
- package/get-shit-done/templates/summary-minimal.md +41 -0
- package/get-shit-done/templates/summary-standard.md +48 -0
- package/get-shit-done/templates/summary.md +248 -0
- package/get-shit-done/templates/user-profile.md +146 -0
- package/get-shit-done/templates/user-setup.md +311 -0
- package/get-shit-done/templates/verification-report.md +322 -0
- package/get-shit-done/workflows/add-phase.md +112 -0
- package/get-shit-done/workflows/add-tests.md +351 -0
- package/get-shit-done/workflows/add-todo.md +158 -0
- package/get-shit-done/workflows/audit-milestone.md +340 -0
- package/get-shit-done/workflows/audit-uat.md +109 -0
- package/get-shit-done/workflows/autonomous.md +891 -0
- package/get-shit-done/workflows/check-todos.md +177 -0
- package/get-shit-done/workflows/cleanup.md +152 -0
- package/get-shit-done/workflows/complete-milestone.md +767 -0
- package/get-shit-done/workflows/diagnose-issues.md +231 -0
- package/get-shit-done/workflows/discovery-phase.md +289 -0
- package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
- package/get-shit-done/workflows/discuss-phase.md +1049 -0
- package/get-shit-done/workflows/do.md +104 -0
- package/get-shit-done/workflows/execute-phase.md +846 -0
- package/get-shit-done/workflows/execute-plan.md +514 -0
- package/get-shit-done/workflows/fast.md +105 -0
- package/get-shit-done/workflows/forensics.md +265 -0
- package/get-shit-done/workflows/health.md +181 -0
- package/get-shit-done/workflows/help.md +634 -0
- package/get-shit-done/workflows/insert-phase.md +130 -0
- package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
- package/get-shit-done/workflows/list-workspaces.md +56 -0
- package/get-shit-done/workflows/manager.md +362 -0
- package/get-shit-done/workflows/map-codebase.md +377 -0
- package/get-shit-done/workflows/milestone-summary.md +223 -0
- package/get-shit-done/workflows/new-milestone.md +486 -0
- package/get-shit-done/workflows/new-project.md +1250 -0
- package/get-shit-done/workflows/new-workspace.md +237 -0
- package/get-shit-done/workflows/next.md +97 -0
- package/get-shit-done/workflows/node-repair.md +92 -0
- package/get-shit-done/workflows/note.md +156 -0
- package/get-shit-done/workflows/pause-work.md +176 -0
- package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
- package/get-shit-done/workflows/plan-phase.md +859 -0
- package/get-shit-done/workflows/plant-seed.md +169 -0
- package/get-shit-done/workflows/pr-branch.md +129 -0
- package/get-shit-done/workflows/profile-user.md +450 -0
- package/get-shit-done/workflows/progress.md +507 -0
- package/get-shit-done/workflows/quick.md +757 -0
- package/get-shit-done/workflows/remove-phase.md +155 -0
- package/get-shit-done/workflows/remove-workspace.md +90 -0
- package/get-shit-done/workflows/research-phase.md +82 -0
- package/get-shit-done/workflows/resume-project.md +326 -0
- package/get-shit-done/workflows/review.md +228 -0
- package/get-shit-done/workflows/session-report.md +146 -0
- package/get-shit-done/workflows/settings.md +283 -0
- package/get-shit-done/workflows/ship.md +228 -0
- package/get-shit-done/workflows/stats.md +60 -0
- package/get-shit-done/workflows/transition.md +671 -0
- package/get-shit-done/workflows/ui-phase.md +302 -0
- package/get-shit-done/workflows/ui-review.md +165 -0
- package/get-shit-done/workflows/update.md +323 -0
- package/get-shit-done/workflows/validate-phase.md +174 -0
- package/get-shit-done/workflows/verify-phase.md +254 -0
- package/get-shit-done/workflows/verify-work.md +637 -0
- package/hooks/dist/gsd-check-update.js +114 -0
- package/hooks/dist/gsd-context-monitor.js +156 -0
- package/hooks/dist/gsd-prompt-guard.js +96 -0
- package/hooks/dist/gsd-statusline.js +119 -0
- package/hooks/dist/gsd-workflow-guard.js +94 -0
- package/package.json +52 -0
- package/scripts/base64-scan.sh +262 -0
- package/scripts/build-hooks.js +82 -0
- package/scripts/prompt-injection-scan.sh +198 -0
- package/scripts/run-tests.cjs +29 -0
- package/scripts/secret-scan.sh +227 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# ARC Annotation Standard
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0
|
|
4
|
+
**Stability:** Stable — tag names and parenthesized keys will not change in v1.x. New optional metadata keys may be added in future versions. Tag types will not be renamed.
|
|
5
|
+
**Purpose:** @gsd-tags embedded in source code comments are machine-readable planning metadata. They allow the tag scanner to extract CODE-INVENTORY.md and allow agents to understand code structure and intent without reading every file.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tag Syntax
|
|
10
|
+
|
|
11
|
+
Tags use a single-line structured format:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
@gsd-<type>[(key:value, key:value)] Description text
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The metadata block (parenthesized key-value pairs) is optional. All three of these are valid:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
// @gsd-context JWT validation module — stateless, RS256 only
|
|
21
|
+
// @gsd-todo(phase:2) Add refresh token rotation
|
|
22
|
+
// @gsd-todo(phase:2, priority:high) Add refresh token rotation
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Rules:
|
|
26
|
+
- Tags are single-line only — no multi-line tag bodies
|
|
27
|
+
- The `@gsd-` prefix is lowercase and case-sensitive
|
|
28
|
+
- Tag type names are lowercase (e.g., `context`, not `Context`)
|
|
29
|
+
- Description text runs to end of line after the optional metadata block
|
|
30
|
+
- Whitespace between the comment token and `@gsd-` is permitted
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Comment Anchor Rule
|
|
35
|
+
|
|
36
|
+
A tag is ONLY valid when it appears on a line where the first non-whitespace content is a comment-opening token.
|
|
37
|
+
|
|
38
|
+
Valid comment-opening tokens:
|
|
39
|
+
- `//` — C-style single-line comment (JavaScript, TypeScript, Go, Rust, Java, C, C++)
|
|
40
|
+
- `//+` — Variant single-line comment
|
|
41
|
+
- `/*` — C-style block comment opener
|
|
42
|
+
- `*` — Block comment continuation line (inside `/* ... */`)
|
|
43
|
+
- `#` — Hash comment (Python, Ruby, Shell, YAML)
|
|
44
|
+
- `--` — SQL single-line comment
|
|
45
|
+
- `"""` — Python docstring opener (triple double-quote)
|
|
46
|
+
- `'''` — Python docstring opener (triple single-quote)
|
|
47
|
+
|
|
48
|
+
**@gsd- appearing inside a string literal, URL path, or template literal is NOT a tag and the scanner will skip it.**
|
|
49
|
+
|
|
50
|
+
Side-by-side examples:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
// @gsd-context Valid tag — anchored to comment token (VALID)
|
|
54
|
+
const x = "// @gsd-todo this is NOT a tag"; (INVALID — inside string)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
More examples:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
# @gsd-constraint No external HTTP calls allowed (VALID — hash comment)
|
|
61
|
+
url := "http://pkg.go.dev/@gsd-pattern/something" (INVALID — inside string)
|
|
62
|
+
-- @gsd-context Partitioned by tenant_id (VALID — SQL comment)
|
|
63
|
+
const tmpl = `@gsd-todo fix this` (INVALID — template literal)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The scanner regex anchors to `^[ \t]*` (optional leading whitespace only) followed by the comment token, then optional whitespace, then `@gsd-`. Any line where non-whitespace content precedes the comment token does not match.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Tag Types
|
|
71
|
+
|
|
72
|
+
| Tag | Purpose |
|
|
73
|
+
|-----|---------|
|
|
74
|
+
| @gsd-context | Explain WHY this code exists, what problem it solves, architectural context |
|
|
75
|
+
| @gsd-decision | Record a design/implementation choice and its rationale |
|
|
76
|
+
| @gsd-todo | Planned future work, optionally scoped to a phase |
|
|
77
|
+
| @gsd-constraint | Hard boundaries the code must respect (performance, security, compatibility) |
|
|
78
|
+
| @gsd-pattern | Document a reusable pattern established here that should be followed elsewhere |
|
|
79
|
+
| @gsd-ref | Cross-reference to another file, doc, issue, or external resource |
|
|
80
|
+
| @gsd-risk | Flag known risks, edge cases, or fragile areas |
|
|
81
|
+
| @gsd-api | Document a public API surface: contract, parameters, return shape |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### @gsd-context
|
|
86
|
+
|
|
87
|
+
Use `@gsd-context` to explain why a module, function, or block of code exists — what problem it solves and where it fits in the architecture. This is the most important tag type. Future maintainers and agents reading CODE-INVENTORY.md will use context tags to understand the codebase without reading every file. Place it near the top of a file or at the start of a significant function.
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
// @gsd-context(phase:1) Auth middleware — validates JWT on every protected route. Stateless, RS256 only.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### @gsd-decision
|
|
96
|
+
|
|
97
|
+
Use `@gsd-decision` to record a design or implementation choice and the reasoning behind it. Decisions are the "why we did it this way" that gets lost over time. Tag the exact location where the decision manifests in code so the rationale travels with the implementation. Include the alternatives considered when space permits.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
// @gsd-decision Using jose over jsonwebtoken: jose is ESM-compatible and actively maintained. jsonwebtoken has no ESM export.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### @gsd-todo
|
|
106
|
+
|
|
107
|
+
Use `@gsd-todo` for planned future work, bug fixes not yet addressed, or features deferred to a later phase. The optional `phase:N` metadata ties the todo to a specific project phase so `extract-plan` can group planned work by phase. Use `priority:high` for items that block other work.
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
// @gsd-todo(phase:2, priority:high) Add refresh token rotation — currently tokens never expire
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### @gsd-constraint
|
|
116
|
+
|
|
117
|
+
Use `@gsd-constraint` to document hard boundaries the code must respect: performance budgets, security requirements, compatibility limits, or regulatory rules. Constraints differ from decisions — a constraint is a non-negotiable boundary, not a choice. Annotate the code that enforces or depends on the constraint.
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
// @gsd-constraint Max response time 200ms — SLA requirement. Do not add synchronous I/O in this path.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### @gsd-pattern
|
|
126
|
+
|
|
127
|
+
Use `@gsd-pattern` to document a reusable pattern established at this location that should be followed elsewhere in the codebase. Patterns are standards-in-waiting: they describe a recurring structure, idiom, or convention that agents and developers should replicate rather than reinvent. Place the tag where the canonical implementation lives.
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
// @gsd-pattern Use sync.Once for all singleton initializations in this package — see Init() as the reference implementation
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### @gsd-ref
|
|
136
|
+
|
|
137
|
+
Use `@gsd-ref` to create a cross-reference from code to another file, documentation page, issue tracker entry, pull request, or external resource. Refs preserve traceability: they connect an implementation decision to its origin. Use the `ref:` metadata key for machine-readable IDs.
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
// @gsd-ref(ref:ISSUE-142) Rate limiting logic — see docs/rate-limiting.md for the algorithm specification
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### @gsd-risk
|
|
146
|
+
|
|
147
|
+
Use `@gsd-risk` to flag known risks, edge cases, fragile areas, or technical debt that could cause future failures. Risks are not todos (they may never need fixing) and not constraints (they describe potential problems, not rules). Tag the exact code location where the risk lives so it surfaces in CODE-INVENTORY.md risk reports.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
// @gsd-risk(ref:ISSUE-142) Race condition possible if Init() called before DB connection pool is ready
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### @gsd-api
|
|
156
|
+
|
|
157
|
+
Use `@gsd-api` to document a public API surface: its contract, parameter types, return shape, and any side effects. This tag is for the API boundary itself — exported functions, HTTP endpoints, public class methods, CLI interfaces. It gives agents reading CODE-INVENTORY.md a compact API reference without reading implementation code.
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
// @gsd-api POST /auth/token — body: {email, password} — returns: {token, expiresAt} or 401 on invalid credentials
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Metadata Keys
|
|
166
|
+
|
|
167
|
+
Metadata is a parenthesized comma-separated list of `key:value` pairs. Any key is valid. Conventional standard keys:
|
|
168
|
+
|
|
169
|
+
- `phase:<N>` — project phase this tag applies to (e.g., `phase:2`)
|
|
170
|
+
- `priority:<value>` — urgency level (`priority:high`, `priority:medium`, `priority:low`)
|
|
171
|
+
- `ref:<id>` — external reference (issue number, requirement ID, PR number, e.g., `ref:ISSUE-142`, `ref:REQ-AUTH-01`)
|
|
172
|
+
|
|
173
|
+
Examples:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
// @gsd-todo(phase:2) Single key
|
|
177
|
+
// @gsd-todo(phase:2, priority:high) Two keys
|
|
178
|
+
// @gsd-risk(ref:ISSUE-142, priority:high) Two keys with external reference
|
|
179
|
+
// @gsd-context(phase:1) Single phase scoping
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The scanner stores all metadata as a flat key-value object. Agents interpret keys by convention, not by schema enforcement. Future versions of the ARC standard may add new conventional keys — existing keys will not be renamed.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Language Examples
|
|
187
|
+
|
|
188
|
+
### JavaScript / TypeScript
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// @gsd-context(phase:1) Auth middleware — validates JWT on every protected route
|
|
192
|
+
// @gsd-decision Using jose over jsonwebtoken: jose is ESM-compatible, no CommonJS issues
|
|
193
|
+
export async function authMiddleware(req, res, next) { ... }
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
// @gsd-api POST /users — body: {email, password, name} — returns: {id, email, createdAt} or 400/409
|
|
198
|
+
// @gsd-constraint No plaintext passwords stored — bcrypt hash only, cost factor 12
|
|
199
|
+
export async function createUser(body: CreateUserBody): Promise<User> { ... }
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Python
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
# @gsd-constraint No external HTTP calls from this module — must be pure compute
|
|
206
|
+
# @gsd-todo(phase:2, priority:high) Add caching layer for repeated signature verifications
|
|
207
|
+
def verify_token(token: str) -> dict:
|
|
208
|
+
"""
|
|
209
|
+
@gsd-api Parameters: token (str) — raw JWT. Returns: decoded payload dict or raises AuthError.
|
|
210
|
+
"""
|
|
211
|
+
...
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
# @gsd-decision Using bcrypt not argon2 — bcrypt is available on all target deployment platforms without custom compile
|
|
216
|
+
# @gsd-risk Memory: bcrypt is CPU-bound; under load this blocks the event loop in sync contexts
|
|
217
|
+
def hash_password(password: str) -> str:
|
|
218
|
+
...
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Go
|
|
222
|
+
|
|
223
|
+
```go
|
|
224
|
+
// @gsd-pattern Use sync.Once for all singleton initializations in this package
|
|
225
|
+
// @gsd-risk(ref:ISSUE-142) Race condition possible if Init() called before DB is ready
|
|
226
|
+
func Init() *DB { ... }
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
```go
|
|
230
|
+
// @gsd-context Connection pool — shared across all handlers, initialized once at startup
|
|
231
|
+
// @gsd-constraint Max 25 connections — production database limit. Do not increase without DBA approval.
|
|
232
|
+
var pool *sql.DB
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Rust
|
|
236
|
+
|
|
237
|
+
```rust
|
|
238
|
+
// @gsd-context FFI boundary to the C crypto library — unsafe block intentional
|
|
239
|
+
// @gsd-risk Memory safety: caller must ensure buf lives longer than the returned slice
|
|
240
|
+
unsafe fn decrypt_raw(buf: *const u8, len: usize) -> &'static [u8] { ... }
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```rust
|
|
244
|
+
// @gsd-decision Chose ring over openssl: ring has a smaller attack surface and is pure Rust
|
|
245
|
+
// @gsd-constraint FIPS compliance required — ring is FIPS 140-2 validated for production use
|
|
246
|
+
fn init_crypto() -> CryptoContext { ... }
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### SQL
|
|
250
|
+
|
|
251
|
+
```sql
|
|
252
|
+
-- @gsd-context Partitioned by tenant_id for query isolation — max 50K rows per partition
|
|
253
|
+
-- @gsd-constraint No cross-tenant JOINs allowed in this view
|
|
254
|
+
CREATE VIEW tenant_events AS ...
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```sql
|
|
258
|
+
-- @gsd-decision Storing UTC timestamps as BIGINT (epoch ms) not TIMESTAMPTZ — avoids timezone conversion bugs in legacy importers
|
|
259
|
+
-- @gsd-todo(phase:3) Migrate to TIMESTAMPTZ once legacy importers are decommissioned
|
|
260
|
+
CREATE TABLE events (
|
|
261
|
+
id BIGSERIAL PRIMARY KEY,
|
|
262
|
+
occurred_at BIGINT NOT NULL
|
|
263
|
+
);
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Shell
|
|
267
|
+
|
|
268
|
+
```sh
|
|
269
|
+
# @gsd-context Bootstraps the dev environment — must be idempotent
|
|
270
|
+
# @gsd-todo(phase:3) Add --dry-run flag for CI validation without side effects
|
|
271
|
+
set -euo pipefail
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```sh
|
|
275
|
+
# @gsd-constraint Requires bash >=4.0 — uses associative arrays. macOS ships bash 3.2; install via Homebrew.
|
|
276
|
+
# @gsd-risk If HOME is unset this script silently writes to //.config — add guard before production use
|
|
277
|
+
main() {
|
|
278
|
+
...
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## What the Scanner Extracts
|
|
285
|
+
|
|
286
|
+
For each @gsd-tag found in source code, the scanner produces one JSON object:
|
|
287
|
+
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"type": "context",
|
|
291
|
+
"file": "src/auth/jwt.js",
|
|
292
|
+
"line": 12,
|
|
293
|
+
"metadata": { "phase": "1" },
|
|
294
|
+
"description": "JWT validation module — stateless, RS256 only",
|
|
295
|
+
"raw": "// @gsd-context(phase:1) JWT validation module — stateless, RS256 only"
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Field notes:
|
|
300
|
+
- `type` — the tag name without the `@gsd-` prefix (always lowercase)
|
|
301
|
+
- `file` — path relative to project root
|
|
302
|
+
- `line` — 1-based line number in the source file
|
|
303
|
+
- `metadata` — key-value object parsed from the parenthesized block; `{}` when no parenthesized keys are present; all values are strings
|
|
304
|
+
- `description` — text after the optional metadata block, trimmed of leading and trailing whitespace
|
|
305
|
+
- `raw` — the complete original line including the comment token, for reference and debugging
|
|
306
|
+
|
|
307
|
+
The scanner outputs an array of these objects. When writing CODE-INVENTORY.md, the scanner groups tags by type, then by file, within each type group.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## GSD Commands
|
|
312
|
+
|
|
313
|
+
`extract-plan` scans the project for all @gsd-tags and writes `.planning/prototype/CODE-INVENTORY.md` grouped by tag type and file, with a summary statistics table and a phase reference index. Run it after annotating code or after a significant annotation session to update the inventory.
|
|
314
|
+
|
|
315
|
+
`annotate` spawns gsd-annotator — an agent that reads existing source code alongside PROJECT.md and REQUIREMENTS.md to determine appropriate @gsd-tags and adds them inline as comments. On completion, `annotate` automatically runs `extract-plan` to produce an updated CODE-INVENTORY.md. Use `annotate` to retroactively add ARC annotations to an existing codebase.
|